aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2013-11-08 13:56:38 -0500
committerPaul Moore <pmoore@redhat.com>2013-11-08 13:56:38 -0500
commit94851b18d4eb94f8bbf0d9176f7429bd8e371f62 (patch)
treec3c743ac6323e1caf9e987d6946cc4b2333a8256 /include
parent42d64e1add3a1ce8a787116036163b8724362145 (diff)
parent5e01dc7b26d9f24f39abace5da98ccbd6a5ceb52 (diff)
Merge tag 'v3.12'
Linux 3.12
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h35
-rw-r--r--include/acpi/acpi_drivers.h14
-rw-r--r--include/acpi/acpixf.h8
-rw-r--r--include/acpi/actypes.h21
-rw-r--r--include/asm-generic/dma-contiguous.h28
-rw-r--r--include/asm-generic/hugetlb.h4
-rw-r--r--include/asm-generic/pgtable.h4
-rw-r--r--include/asm-generic/vmlinux.lds.h7
-rw-r--r--include/asm-generic/vtime.h1
-rw-r--r--include/clocksource/arm_arch_timer.h10
-rw-r--r--include/clocksource/samsung_pwm.h7
-rw-r--r--include/crypto/scatterwalk.h2
-rw-r--r--include/drm/drmP.h247
-rw-r--r--include/drm/drm_agpsupport.h194
-rw-r--r--include/drm/drm_crtc.h85
-rw-r--r--include/drm/drm_dp_helper.h31
-rw-r--r--include/drm/drm_edid.h5
-rw-r--r--include/drm/drm_fb_cma_helper.h1
-rw-r--r--include/drm/drm_flip_work.h76
-rw-r--r--include/drm/drm_gem_cma_helper.h8
-rw-r--r--include/drm/drm_mm.h142
-rw-r--r--include/drm/drm_pciids.h51
-rw-r--r--include/drm/drm_vma_manager.h257
-rw-r--r--include/drm/exynos_drm.h3
-rw-r--r--include/drm/i2c/tda998x.h30
-rw-r--r--include/drm/i915_drm.h34
-rw-r--r--include/drm/i915_pciids.h211
-rw-r--r--include/drm/ttm/ttm_bo_api.h15
-rw-r--r--include/drm/ttm/ttm_bo_driver.h10
-rw-r--r--include/dt-bindings/clock/samsung,s3c64xx-clock.h178
-rw-r--r--include/dt-bindings/input/input.h525
-rw-r--r--include/dt-bindings/pinctrl/nomadik.h36
-rw-r--r--include/dt-bindings/pinctrl/omap.h4
-rw-r--r--include/dt-bindings/pwm/pwm.h14
-rw-r--r--include/dt-bindings/sound/fsl-imx-audmux.h56
-rw-r--r--include/kvm/arm_vgic.h2
-rw-r--r--include/linux/acpi.h7
-rw-r--r--include/linux/aio.h21
-rw-r--r--include/linux/amba/pl080.h1
-rw-r--r--include/linux/anon_inodes.h3
-rw-r--r--include/linux/ata.h123
-rw-r--r--include/linux/atmel-ssc.h2
-rw-r--r--include/linux/atmel_serial.h2
-rw-r--r--include/linux/backing-dev.h3
-rw-r--r--include/linux/balloon_compaction.h25
-rw-r--r--include/linux/bcma/bcma.h17
-rw-r--r--include/linux/bcma/bcma_driver_pci.h25
-rw-r--r--include/linux/binfmts.h2
-rw-r--r--include/linux/blkdev.h11
-rw-r--r--include/linux/buffer_head.h2
-rw-r--r--include/linux/can/platform/mcp251x.h15
-rw-r--r--include/linux/capability.h1
-rw-r--r--include/linux/ceph/osd_client.h2
-rw-r--r--include/linux/cgroup.h303
-rw-r--r--include/linux/clk-private.h3
-rw-r--r--include/linux/clk-provider.h31
-rw-r--r--include/linux/cmdline-parser.h43
-rw-r--r--include/linux/coda.h1
-rw-r--r--include/linux/compat.h8
-rw-r--r--include/linux/compiler-gcc4.h15
-rw-r--r--include/linux/context_tracking.h128
-rw-r--r--include/linux/context_tracking_state.h39
-rw-r--r--include/linux/cpu.h5
-rw-r--r--include/linux/cpu_rmap.h3
-rw-r--r--include/linux/cpufreq.h389
-rw-r--r--include/linux/cpuidle.h9
-rw-r--r--include/linux/crash_dump.h9
-rw-r--r--include/linux/crc-t10dif.h4
-rw-r--r--include/linux/dcache.h50
-rw-r--r--include/linux/debugfs.h7
-rw-r--r--include/linux/debugobjects.h6
-rw-r--r--include/linux/device-mapper.h12
-rw-r--r--include/linux/device.h35
-rw-r--r--include/linux/dm9000.h4
-rw-r--r--include/linux/dma-contiguous.h64
-rw-r--r--include/linux/dma-mapping.h5
-rw-r--r--include/linux/dma/mmp-pdma.h15
-rw-r--r--include/linux/dmaengine.h54
-rw-r--r--include/linux/err.h5
-rw-r--r--include/linux/etherdevice.h15
-rw-r--r--include/linux/eventfd.h3
-rw-r--r--include/linux/extcon/of_extcon.h31
-rw-r--r--include/linux/f2fs_fs.h20
-rw-r--r--include/linux/filter.h15
-rw-r--r--include/linux/fs.h43
-rw-r--r--include/linux/fs_enet_pd.h6
-rw-r--r--include/linux/fs_struct.h11
-rw-r--r--include/linux/fscache-cache.h4
-rw-r--r--include/linux/fscache.h42
-rw-r--r--include/linux/fsl/mxs-dma.h20
-rw-r--r--include/linux/ftrace_event.h34
-rw-r--r--include/linux/genalloc.h4
-rw-r--r--include/linux/hardirq.h121
-rw-r--r--include/linux/hdmi.h53
-rw-r--r--include/linux/hid-sensor-hub.h2
-rw-r--r--include/linux/hid-sensor-ids.h2
-rw-r--r--include/linux/hid.h20
-rw-r--r--include/linux/hidraw.h1
-rw-r--r--include/linux/huge_mm.h3
-rw-r--r--include/linux/hugetlb.h25
-rw-r--r--include/linux/hyperv.h34
-rw-r--r--include/linux/i2c.h24
-rw-r--r--include/linux/i2c/i2c-hid.h3
-rw-r--r--include/linux/i2c/pxa-i2c.h3
-rw-r--r--include/linux/i8042.h24
-rw-r--r--include/linux/ieee80211.h72
-rw-r--r--include/linux/if_team.h14
-rw-r--r--include/linux/igmp.h1
-rw-r--r--include/linux/iio/common/st_sensors.h14
-rw-r--r--include/linux/iio/iio.h54
-rw-r--r--include/linux/iio/sysfs.h5
-rw-r--r--include/linux/init.h1
-rw-r--r--include/linux/intel-iommu.h2
-rw-r--r--include/linux/interrupt.h75
-rw-r--r--include/linux/iommu.h16
-rw-r--r--include/linux/ipc_namespace.h8
-rw-r--r--include/linux/ipv6.h3
-rw-r--r--include/linux/irq.h9
-rw-r--r--include/linux/irqchip/arm-gic.h1
-rw-r--r--include/linux/irqchip/mmp.h6
-rw-r--r--include/linux/irqdesc.h3
-rw-r--r--include/linux/irqnr.h19
-rw-r--r--include/linux/jbd.h17
-rw-r--r--include/linux/jiffies.h8
-rw-r--r--include/linux/jump_label.h28
-rw-r--r--include/linux/jump_label_ratelimit.h34
-rw-r--r--include/linux/kbd_kern.h3
-rw-r--r--include/linux/kernel.h11
-rw-r--r--include/linux/kernel_stat.h34
-rw-r--r--include/linux/kobject.h4
-rw-r--r--include/linux/kobject_ns.h2
-rw-r--r--include/linux/kprobes.h34
-rw-r--r--include/linux/ktime.h28
-rw-r--r--include/linux/kvm_host.h14
-rw-r--r--include/linux/libata.h120
-rw-r--r--include/linux/list_lru.h131
-rw-r--r--include/linux/llist.h23
-rw-r--r--include/linux/lockdep.h92
-rw-r--r--include/linux/lockref.h62
-rw-r--r--include/linux/lz4.h8
-rw-r--r--include/linux/math64.h13
-rw-r--r--include/linux/mbus.h16
-rw-r--r--include/linux/memblock.h2
-rw-r--r--include/linux/memcontrol.h67
-rw-r--r--include/linux/memory.h14
-rw-r--r--include/linux/mempolicy.h11
-rw-r--r--include/linux/mfd/arizona/gpio.h96
-rw-r--r--include/linux/mfd/da9063/core.h93
-rw-r--r--include/linux/mfd/da9063/pdata.h111
-rw-r--r--include/linux/mfd/da9063/registers.h1028
-rw-r--r--include/linux/mfd/davinci_voicecodec.h3
-rw-r--r--include/linux/mfd/mcp.h2
-rw-r--r--include/linux/mfd/palmas.h102
-rw-r--r--include/linux/mfd/rtsx_common.h3
-rw-r--r--include/linux/mfd/rtsx_pci.h66
-rw-r--r--include/linux/mfd/samsung/s2mps11.h17
-rw-r--r--include/linux/mfd/ti_am335x_tscadc.h1
-rw-r--r--include/linux/mfd/tmio.h1
-rw-r--r--include/linux/mfd/tps65217.h19
-rw-r--r--include/linux/mfd/twl6040.h2
-rw-r--r--include/linux/mfd/ucb1x00.h1
-rw-r--r--include/linux/micrel_phy.h6
-rw-r--r--include/linux/migrate.h8
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mlx4/cmd.h1
-rw-r--r--include/linux/mlx4/device.h17
-rw-r--r--include/linux/mlx4/qp.h5
-rw-r--r--include/linux/mlx5/device.h4
-rw-r--r--include/linux/mlx5/driver.h6
-rw-r--r--include/linux/mm.h39
-rw-r--r--include/linux/mm_inline.h1
-rw-r--r--include/linux/mm_types.h5
-rw-r--r--include/linux/mmc/core.h2
-rw-r--r--include/linux/mmc/sdhci.h1
-rw-r--r--include/linux/mmc/sh_mmcif.h6
-rw-r--r--include/linux/mmc/sh_mobile_sdhi.h2
-rw-r--r--include/linux/mmc/slot-gpio.h3
-rw-r--r--include/linux/mmzone.h2
-rw-r--r--include/linux/module.h6
-rw-r--r--include/linux/moduleparam.h13
-rw-r--r--include/linux/mount.h1
-rw-r--r--include/linux/msi.h21
-rw-r--r--include/linux/mtd/bbm.h2
-rw-r--r--include/linux/mtd/fsmc.h1
-rw-r--r--include/linux/mtd/mtd.h3
-rw-r--r--include/linux/mtd/nand.h83
-rw-r--r--include/linux/mutex.h6
-rw-r--r--include/linux/mv643xx_eth.h3
-rw-r--r--include/linux/namei.h3
-rw-r--r--include/linux/netdevice.h85
-rw-r--r--include/linux/netfilter.h15
-rw-r--r--include/linux/netfilter/ipset/ip_set.h6
-rw-r--r--include/linux/nfs_fs.h1
-rw-r--r--include/linux/nfs_fs_sb.h13
-rw-r--r--include/linux/nfs_xdr.h28
-rw-r--r--include/linux/nodemask.h11
-rw-r--r--include/linux/nvme.h466
-rw-r--r--include/linux/of.h63
-rw-r--r--include/linux/of_device.h15
-rw-r--r--include/linux/of_fdt.h6
-rw-r--r--include/linux/of_i2c.h46
-rw-r--r--include/linux/of_irq.h20
-rw-r--r--include/linux/of_net.h4
-rw-r--r--include/linux/of_pci.h12
-rw-r--r--include/linux/olpc-ec.h1
-rw-r--r--include/linux/oprofile.h16
-rw-r--r--include/linux/pci-acpi.h10
-rw-r--r--include/linux/pci.h30
-rw-r--r--include/linux/pci_hotplug.h17
-rw-r--r--include/linux/pci_ids.h7
-rw-r--r--include/linux/percpu-defs.h5
-rw-r--r--include/linux/percpu.h8
-rw-r--r--include/linux/percpu_ida.h60
-rw-r--r--include/linux/perf_event.h49
-rw-r--r--include/linux/pinctrl/pinconf-generic.h33
-rw-r--r--include/linux/pinctrl/pinconf.h6
-rw-r--r--include/linux/platform_data/asoc-s3c.h1
-rw-r--r--include/linux/platform_data/at91_adc.h4
-rw-r--r--include/linux/platform_data/atmel.h4
-rw-r--r--include/linux/platform_data/bd6107.h19
-rw-r--r--include/linux/platform_data/brcmfmac-sdio.h6
-rw-r--r--include/linux/platform_data/camera-mx3.h4
-rw-r--r--include/linux/platform_data/camera-rcar.h25
-rw-r--r--include/linux/platform_data/cpsw.h44
-rw-r--r--include/linux/platform_data/dma-rcar-hpbdma.h103
-rw-r--r--include/linux/platform_data/edma.h2
-rw-r--r--include/linux/platform_data/efm32-spi.h14
-rw-r--r--include/linux/platform_data/exynos_thermal.h119
-rw-r--r--include/linux/platform_data/gpio-em.h1
-rw-r--r--include/linux/platform_data/gpio_backlight.h21
-rw-r--r--include/linux/platform_data/leds-lp55xx.h10
-rw-r--r--include/linux/platform_data/leds-pca963x.h (renamed from include/linux/platform_data/leds-pca9633.h)25
-rw-r--r--include/linux/platform_data/leds-renesas-tpu.h14
-rw-r--r--include/linux/platform_data/lv5207lp.h19
-rw-r--r--include/linux/platform_data/max310x.h9
-rw-r--r--include/linux/platform_data/mtd-nand-pxa3xx.h13
-rw-r--r--include/linux/platform_data/omap-abe-twl6040.h49
-rw-r--r--include/linux/platform_data/pca953x.h (renamed from include/linux/i2c/pca953x.h)0
-rw-r--r--include/linux/platform_data/pinctrl-nomadik.h24
-rw-r--r--include/linux/platform_data/rcar-du.h34
-rw-r--r--include/linux/platform_data/serial-sccnxp.h3
-rw-r--r--include/linux/platform_data/simplefb.h64
-rw-r--r--include/linux/platform_data/st_sensors_pdata.h24
-rw-r--r--include/linux/platform_data/tegra_usb.h32
-rw-r--r--include/linux/platform_data/vsp1.h25
-rw-r--r--include/linux/power/bq24190_charger.h16
-rw-r--r--include/linux/power/twl4030_madc_battery.h39
-rw-r--r--include/linux/power_supply.h3
-rw-r--r--include/linux/pps_kernel.h2
-rw-r--r--include/linux/preempt_mask.h122
-rw-r--r--include/linux/printk.h2
-rw-r--r--include/linux/pstore.h6
-rw-r--r--include/linux/pxa2xx_ssp.h11
-rw-r--r--include/linux/quota.h1
-rw-r--r--include/linux/quotaops.h15
-rw-r--r--include/linux/radix-tree.h1
-rw-r--r--include/linux/raid/pq.h6
-rw-r--r--include/linux/ramfs.h2
-rw-r--r--include/linux/random.h1
-rw-r--r--include/linux/rbtree.h22
-rw-r--r--include/linux/rculist.h5
-rw-r--r--include/linux/rcupdate.h26
-rw-r--r--include/linux/regmap.h10
-rw-r--r--include/linux/regulator/consumer.h32
-rw-r--r--include/linux/regulator/driver.h27
-rw-r--r--include/linux/regulator/fan53555.h1
-rw-r--r--include/linux/regulator/machine.h1
-rw-r--r--include/linux/regulator/max8660.h2
-rw-r--r--include/linux/regulator/pfuze100.h44
-rw-r--r--include/linux/res_counter.h2
-rw-r--r--include/linux/sched.h25
-rw-r--r--include/linux/security.h8
-rw-r--r--include/linux/seqlock.h68
-rw-r--r--include/linux/sh_dma.h55
-rw-r--r--include/linux/sh_eth.h10
-rw-r--r--include/linux/shdma-base.h3
-rw-r--r--include/linux/shrinker.h54
-rw-r--r--include/linux/signal.h8
-rw-r--r--include/linux/skbuff.h21
-rw-r--r--include/linux/slab.h156
-rw-r--r--include/linux/slab_def.h106
-rw-r--r--include/linux/slob_def.h31
-rw-r--r--include/linux/slub_def.h110
-rw-r--r--include/linux/smp.h85
-rw-r--r--include/linux/smsc911x.h3
-rw-r--r--include/linux/socket.h2
-rw-r--r--include/linux/spi/mmc_spi.h19
-rw-r--r--include/linux/spi/spi.h36
-rw-r--r--include/linux/spi/spi_bitbang.h5
-rw-r--r--include/linux/stmmac.h1
-rw-r--r--include/linux/sunrpc/auth.h28
-rw-r--r--include/linux/sunrpc/cache.h22
-rw-r--r--include/linux/sunrpc/clnt.h6
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h39
-rw-r--r--include/linux/sunrpc/sched.h2
-rw-r--r--include/linux/sunrpc/svc.h1
-rw-r--r--include/linux/swap.h54
-rw-r--r--include/linux/syscalls.h1
-rw-r--r--include/linux/sysfs.h36
-rw-r--r--include/linux/tcp.h2
-rw-r--r--include/linux/tegra-cpuidle.h25
-rw-r--r--include/linux/thermal.h18
-rw-r--r--include/linux/tick.h45
-rw-r--r--include/linux/time-armada-370-xp.h18
-rw-r--r--include/linux/timex.h15
-rw-r--r--include/linux/tty.h66
-rw-r--r--include/linux/tty_flip.h8
-rw-r--r--include/linux/tty_ldisc.h16
-rw-r--r--include/linux/usb.h32
-rw-r--r--include/linux/usb/chipidea.h7
-rw-r--r--include/linux/usb/dwc3-omap.h30
-rw-r--r--include/linux/usb/gadget.h4
-rw-r--r--include/linux/usb/hcd.h19
-rw-r--r--include/linux/usb/of.h10
-rw-r--r--include/linux/usb/phy.h18
-rw-r--r--include/linux/usb/tegra_usb_phy.h40
-rw-r--r--include/linux/usb/usb_phy_gen_xceiv.h (renamed from include/linux/usb/nop-usb-xceiv.h)2
-rw-r--r--include/linux/usb/usbnet.h5
-rw-r--r--include/linux/usb/wusb-wa.h1
-rw-r--r--include/linux/usb_usual.h4
-rw-r--r--include/linux/user_namespace.h4
-rw-r--r--include/linux/uwb/spec.h5
-rw-r--r--include/linux/vfio.h7
-rw-r--r--include/linux/vga_switcheroo.h13
-rw-r--r--include/linux/vm_event_item.h6
-rw-r--r--include/linux/vmpressure.h6
-rw-r--r--include/linux/vmstat.h4
-rw-r--r--include/linux/vtime.h74
-rw-r--r--include/linux/workqueue.h7
-rw-r--r--include/linux/writeback.h2
-rw-r--r--include/linux/xattr.h2
-rw-r--r--include/linux/yam.h2
-rw-r--r--include/media/adv7343.h20
-rw-r--r--include/media/adv7511.h48
-rw-r--r--include/media/adv7842.h226
-rw-r--r--include/media/davinci/vpif_types.h4
-rw-r--r--include/media/lirc_dev.h1
-rw-r--r--include/media/media-entity.h4
-rw-r--r--include/media/mt9v032.h4
-rw-r--r--include/media/rc-core.h4
-rw-r--r--include/media/saa7115.h77
-rw-r--r--include/media/smiapp.h1
-rw-r--r--include/media/tea575x.h (renamed from include/sound/tea575x-tuner.h)1
-rw-r--r--include/media/tveeprom.h4
-rw-r--r--include/media/v4l2-async.h36
-rw-r--r--include/media/v4l2-common.h14
-rw-r--r--include/media/v4l2-dv-timings.h161
-rw-r--r--include/media/v4l2-mediabus.h3
-rw-r--r--include/media/v4l2-mem2mem.h13
-rw-r--r--include/media/v4l2-subdev.h13
-rw-r--r--include/media/videobuf2-core.h11
-rw-r--r--include/net/9p/client.h5
-rw-r--r--include/net/9p/transport.h3
-rw-r--r--include/net/act_api.h60
-rw-r--r--include/net/addrconf.h184
-rw-r--r--include/net/af_rxrpc.h35
-rw-r--r--include/net/af_unix.h17
-rw-r--r--include/net/af_vsock.h175
-rw-r--r--include/net/arp.h30
-rw-r--r--include/net/ax25.h215
-rw-r--r--include/net/bluetooth/bluetooth.h8
-rw-r--r--include/net/bluetooth/hci.h8
-rw-r--r--include/net/bluetooth/hci_core.h10
-rw-r--r--include/net/bluetooth/sco.h1
-rw-r--r--include/net/cfg80211.h239
-rw-r--r--include/net/checksum.h10
-rw-r--r--include/net/cipso_ipv4.h6
-rw-r--r--include/net/cls_cgroup.h6
-rw-r--r--include/net/dst.h24
-rw-r--r--include/net/fib_rules.h14
-rw-r--r--include/net/ieee80211_radiotap.h4
-rw-r--r--include/net/if_inet6.h9
-rw-r--r--include/net/ip.h24
-rw-r--r--include/net/ip6_route.h8
-rw-r--r--include/net/ip6_tunnel.h2
-rw-r--r--include/net/ip_tunnels.h11
-rw-r--r--include/net/ip_vs.h9
-rw-r--r--include/net/ipv6.h3
-rw-r--r--include/net/irda/irlan_common.h3
-rw-r--r--include/net/llc_if.h30
-rw-r--r--include/net/mac80211.h192
-rw-r--r--include/net/mac802154.h2
-rw-r--r--include/net/mld.h51
-rw-r--r--include/net/mrp.h1
-rw-r--r--include/net/ndisc.h7
-rw-r--r--include/net/neighbour.h98
-rw-r--r--include/net/net_namespace.h38
-rw-r--r--include/net/netfilter/nf_conntrack.h9
-rw-r--r--include/net/netfilter/nf_conntrack_extend.h8
-rw-r--r--include/net/netfilter/nf_conntrack_l4proto.h7
-rw-r--r--include/net/netfilter/nf_conntrack_seqadj.h51
-rw-r--r--include/net/netfilter/nf_conntrack_synproxy.h77
-rw-r--r--include/net/netfilter/nf_nat.h10
-rw-r--r--include/net/netfilter/nf_nat_helper.h19
-rw-r--r--include/net/netfilter/nf_tproxy_core.h210
-rw-r--r--include/net/netfilter/nfnetlink_queue.h8
-rw-r--r--include/net/netns/ipv4.h1
-rw-r--r--include/net/netns/ipv6.h1
-rw-r--r--include/net/netprio_cgroup.h10
-rw-r--r--include/net/nfc/nfc.h3
-rw-r--r--include/net/pkt_cls.h42
-rw-r--r--include/net/pkt_sched.h53
-rw-r--r--include/net/sch_generic.h54
-rw-r--r--include/net/sctp/auth.h8
-rw-r--r--include/net/sctp/checksum.h23
-rw-r--r--include/net/sctp/command.h18
-rw-r--r--include/net/sctp/constants.h8
-rw-r--r--include/net/sctp/sctp.h10
-rw-r--r--include/net/sctp/sm.h8
-rw-r--r--include/net/sctp/structs.h29
-rw-r--r--include/net/sctp/tsnmap.h8
-rw-r--r--include/net/sctp/ulpevent.h8
-rw-r--r--include/net/sctp/ulpqueue.h8
-rw-r--r--include/net/secure_seq.h1
-rw-r--r--include/net/sock.h40
-rw-r--r--include/net/tcp.h44
-rw-r--r--include/net/udp.h1
-rw-r--r--include/net/vsock_addr.h30
-rw-r--r--include/net/vxlan.h40
-rw-r--r--include/net/xfrm.h2
-rw-r--r--include/rdma/ib_verbs.h128
-rw-r--r--include/rdma/iw_cm.h8
-rw-r--r--include/scsi/iscsi_if.h32
-rw-r--r--include/scsi/libiscsi.h31
-rw-r--r--include/scsi/scsi.h4
-rw-r--r--include/scsi/scsi_device.h13
-rw-r--r--include/sound/core.h8
-rw-r--r--include/sound/pxa2xx-lib.h7
-rw-r--r--include/sound/rcar_snd.h85
-rw-r--r--include/sound/soc-dapm.h201
-rw-r--r--include/sound/soc-dpcm.h2
-rw-r--r--include/sound/soc.h47
-rw-r--r--include/target/iscsi/iscsi_transport.h8
-rw-r--r--include/target/target_core_backend.h7
-rw-r--r--include/target/target_core_base.h26
-rw-r--r--include/target/target_core_fabric.h30
-rw-r--r--include/trace/events/block.h6
-rw-r--r--include/trace/events/btrfs.h61
-rw-r--r--include/trace/events/context_tracking.h58
-rw-r--r--include/trace/events/ext4.h29
-rw-r--r--include/trace/events/kmem.h10
-rw-r--r--include/trace/events/power.h37
-rw-r--r--include/trace/events/rcu.h82
-rw-r--r--include/trace/events/sched.h22
-rw-r--r--include/trace/events/sunrpc.h181
-rw-r--r--include/trace/events/target.h4
-rw-r--r--include/trace/events/vmscan.h4
-rw-r--r--include/trace/ftrace.h33
-rw-r--r--include/uapi/drm/Kbuild1
-rw-r--r--include/uapi/drm/drm.h3
-rw-r--r--include/uapi/drm/drm_mode.h18
-rw-r--r--include/uapi/drm/i915_drm.h49
-rw-r--r--include/uapi/drm/msm_drm.h207
-rw-r--r--include/uapi/drm/radeon_drm.h4
-rw-r--r--include/uapi/linux/Kbuild2
-rw-r--r--include/uapi/linux/btrfs.h30
-rw-r--r--include/uapi/linux/can/gw.h9
-rw-r--r--include/uapi/linux/cifs/cifs_mount.h27
-rw-r--r--include/uapi/linux/dm-ioctl.h4
-rw-r--r--include/uapi/linux/dn.h3
-rw-r--r--include/uapi/linux/dqblk_xfs.h47
-rw-r--r--include/uapi/linux/elf-em.h2
-rw-r--r--include/uapi/linux/fib_rules.h4
-rw-r--r--include/uapi/linux/fiemap.h1
-rw-r--r--include/uapi/linux/fs.h6
-rw-r--r--include/uapi/linux/icmpv6.h2
-rw-r--r--include/uapi/linux/if_bridge.h3
-rw-r--r--include/uapi/linux/if_link.h3
-rw-r--r--include/uapi/linux/if_packet.h1
-rw-r--r--include/uapi/linux/if_pppox.h2
-rw-r--r--include/uapi/linux/if_tun.h6
-rw-r--r--include/uapi/linux/in.h49
-rw-r--r--include/uapi/linux/in6.h36
-rw-r--r--include/uapi/linux/input.h3
-rw-r--r--include/uapi/linux/ip.h2
-rw-r--r--include/uapi/linux/ipv6.h3
-rw-r--r--include/uapi/linux/kvm.h1
-rw-r--r--include/uapi/linux/kvm_para.h1
-rw-r--r--include/uapi/linux/libc-compat.h103
-rw-r--r--include/uapi/linux/netfilter/Kbuild2
-rw-r--r--include/uapi/linux/netfilter/nf_conntrack_common.h3
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_conntrack.h15
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_queue.h1
-rw-r--r--include/uapi/linux/netfilter/xt_HMARK.h (renamed from include/linux/netfilter/xt_HMARK.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_SYNPROXY.h16
-rw-r--r--include/uapi/linux/netfilter/xt_rpfilter.h (renamed from include/linux/netfilter/xt_rpfilter.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_802_3.h5
-rw-r--r--include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h3
-rw-r--r--include/uapi/linux/nfc.h20
-rw-r--r--include/uapi/linux/nl80211.h199
-rw-r--r--include/uapi/linux/nvme.h477
-rw-r--r--include/uapi/linux/openvswitch.h26
-rw-r--r--include/uapi/linux/pci_regs.h113
-rw-r--r--include/uapi/linux/perf_event.h140
-rw-r--r--include/uapi/linux/pkt_sched.h41
-rw-r--r--include/uapi/linux/reiserfs_xattr.h2
-rw-r--r--include/uapi/linux/sctp.h2
-rw-r--r--include/uapi/linux/serial_core.h6
-rw-r--r--include/uapi/linux/snmp.h4
-rw-r--r--include/uapi/linux/tc_act/Kbuild1
-rw-r--r--include/uapi/linux/tc_act/tc_defact.h (renamed from include/linux/tc_act/tc_defact.h)2
-rw-r--r--include/uapi/linux/tcp.h1
-rw-r--r--include/uapi/linux/uhid.h4
-rw-r--r--include/uapi/linux/v4l2-controls.h29
-rw-r--r--include/uapi/linux/v4l2-dv-timings.h8
-rw-r--r--include/uapi/linux/v4l2-mediabus.h6
-rw-r--r--include/uapi/linux/vfio.h38
-rw-r--r--include/uapi/linux/videodev2.h12
-rw-r--r--include/uapi/linux/virtio_net.h6
-rw-r--r--include/uapi/linux/wimax/i2400m.h4
-rw-r--r--include/uapi/rdma/ib_user_verbs.h105
-rw-r--r--include/uapi/sound/hdspm.h2
-rw-r--r--include/video/da8xx-fb.h5
-rw-r--r--include/video/omap-panel-data.h118
-rw-r--r--include/video/omapdss.h106
-rw-r--r--include/xen/acpi.h8
-rw-r--r--include/xen/balloon.h3
-rw-r--r--include/xen/interface/io/tpmif.h52
-rw-r--r--include/xen/interface/platform.h7
-rw-r--r--include/xen/interface/vcpu.h2
520 files changed, 12429 insertions, 4956 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 94383a70c1a3..d9019821aa60 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -56,6 +56,16 @@ acpi_evaluate_hotplug_ost(acpi_handle handle, u32 source_event,
56 56
57acpi_status 57acpi_status
58acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld); 58acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld);
59
60bool acpi_has_method(acpi_handle handle, char *name);
61acpi_status acpi_execute_simple_method(acpi_handle handle, char *method,
62 u64 arg);
63acpi_status acpi_evaluate_ej0(acpi_handle handle);
64acpi_status acpi_evaluate_lck(acpi_handle handle, int lock);
65bool acpi_ata_match(acpi_handle handle);
66bool acpi_bay_match(acpi_handle handle);
67bool acpi_dock_match(acpi_handle handle);
68
59#ifdef CONFIG_ACPI 69#ifdef CONFIG_ACPI
60 70
61#include <linux/proc_fs.h> 71#include <linux/proc_fs.h>
@@ -157,9 +167,8 @@ struct acpi_device_flags {
157 u32 removable:1; 167 u32 removable:1;
158 u32 ejectable:1; 168 u32 ejectable:1;
159 u32 power_manageable:1; 169 u32 power_manageable:1;
160 u32 eject_pending:1;
161 u32 match_driver:1; 170 u32 match_driver:1;
162 u32 reserved:26; 171 u32 reserved:27;
163}; 172};
164 173
165/* File System */ 174/* File System */
@@ -302,7 +311,6 @@ struct acpi_device {
302 unsigned int physical_node_count; 311 unsigned int physical_node_count;
303 struct list_head physical_node_list; 312 struct list_head physical_node_list;
304 struct mutex physical_node_lock; 313 struct mutex physical_node_lock;
305 struct list_head power_dependent;
306 void (*remove)(struct acpi_device *); 314 void (*remove)(struct acpi_device *);
307}; 315};
308 316
@@ -352,14 +360,11 @@ extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32);
352extern int register_acpi_notifier(struct notifier_block *); 360extern int register_acpi_notifier(struct notifier_block *);
353extern int unregister_acpi_notifier(struct notifier_block *); 361extern int unregister_acpi_notifier(struct notifier_block *);
354 362
355extern int register_acpi_bus_notifier(struct notifier_block *nb);
356extern void unregister_acpi_bus_notifier(struct notifier_block *nb);
357/* 363/*
358 * External Functions 364 * External Functions
359 */ 365 */
360 366
361int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); 367int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
362void acpi_bus_data_handler(acpi_handle handle, void *context);
363acpi_status acpi_bus_get_status_handle(acpi_handle handle, 368acpi_status acpi_bus_get_status_handle(acpi_handle handle,
364 unsigned long long *sta); 369 unsigned long long *sta);
365int acpi_bus_get_status(struct acpi_device *device); 370int acpi_bus_get_status(struct acpi_device *device);
@@ -379,15 +384,6 @@ bool acpi_bus_can_wakeup(acpi_handle handle);
379static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; } 384static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; }
380#endif 385#endif
381 386
382#ifdef CONFIG_ACPI_PROC_EVENT
383int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);
384int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data);
385int acpi_bus_receive_event(struct acpi_bus_event *event);
386#else
387static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
388 { return 0; }
389#endif
390
391void acpi_scan_lock_acquire(void); 387void acpi_scan_lock_acquire(void);
392void acpi_scan_lock_release(void); 388void acpi_scan_lock_release(void);
393int acpi_scan_add_handler(struct acpi_scan_handler *handler); 389int acpi_scan_add_handler(struct acpi_scan_handler *handler);
@@ -459,8 +455,6 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
459acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, 455acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
460 acpi_notify_handler handler); 456 acpi_notify_handler handler);
461int acpi_pm_device_sleep_state(struct device *, int *, int); 457int acpi_pm_device_sleep_state(struct device *, int *, int);
462void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev);
463void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev);
464#else 458#else
465static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, 459static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
466 acpi_notify_handler handler, 460 acpi_notify_handler handler,
@@ -478,12 +472,9 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
478 if (p) 472 if (p)
479 *p = ACPI_STATE_D0; 473 *p = ACPI_STATE_D0;
480 474
481 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0; 475 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ?
476 m : ACPI_STATE_D0;
482} 477}
483static inline void acpi_dev_pm_add_dependent(acpi_handle handle,
484 struct device *depdev) {}
485static inline void acpi_dev_pm_remove_dependent(acpi_handle handle,
486 struct device *depdev) {}
487#endif 478#endif
488 479
489#ifdef CONFIG_PM_RUNTIME 480#ifdef CONFIG_PM_RUNTIME
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index b420939f5eb5..1cedfcb1bd88 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -113,14 +113,13 @@ void pci_acpi_crs_quirks(void);
113 Dock Station 113 Dock Station
114 -------------------------------------------------------------------------- */ 114 -------------------------------------------------------------------------- */
115struct acpi_dock_ops { 115struct acpi_dock_ops {
116 acpi_notify_handler fixup;
116 acpi_notify_handler handler; 117 acpi_notify_handler handler;
117 acpi_notify_handler uevent; 118 acpi_notify_handler uevent;
118}; 119};
119 120
120#if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE) 121#ifdef CONFIG_ACPI_DOCK
121extern int is_dock_device(acpi_handle handle); 122extern int is_dock_device(acpi_handle handle);
122extern int register_dock_notifier(struct notifier_block *nb);
123extern void unregister_dock_notifier(struct notifier_block *nb);
124extern int register_hotplug_dock_device(acpi_handle handle, 123extern int register_hotplug_dock_device(acpi_handle handle,
125 const struct acpi_dock_ops *ops, 124 const struct acpi_dock_ops *ops,
126 void *context, 125 void *context,
@@ -132,13 +131,6 @@ static inline int is_dock_device(acpi_handle handle)
132{ 131{
133 return 0; 132 return 0;
134} 133}
135static inline int register_dock_notifier(struct notifier_block *nb)
136{
137 return -ENODEV;
138}
139static inline void unregister_dock_notifier(struct notifier_block *nb)
140{
141}
142static inline int register_hotplug_dock_device(acpi_handle handle, 134static inline int register_hotplug_dock_device(acpi_handle handle,
143 const struct acpi_dock_ops *ops, 135 const struct acpi_dock_ops *ops,
144 void *context, 136 void *context,
@@ -150,6 +142,6 @@ static inline int register_hotplug_dock_device(acpi_handle handle,
150static inline void unregister_hotplug_dock_device(acpi_handle handle) 142static inline void unregister_hotplug_dock_device(acpi_handle handle)
151{ 143{
152} 144}
153#endif 145#endif /* CONFIG_ACPI_DOCK */
154 146
155#endif /*__ACPI_DRIVERS_H__*/ 147#endif /*__ACPI_DRIVERS_H__*/
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 22d497ee6ef9..85bfdbe17805 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
46 46
47/* Current ACPICA subsystem version in YYYYMMDD format */ 47/* Current ACPICA subsystem version in YYYYMMDD format */
48 48
49#define ACPI_CA_VERSION 0x20130517 49#define ACPI_CA_VERSION 0x20130725
50 50
51#include <acpi/acconfig.h> 51#include <acpi/acconfig.h>
52#include <acpi/actypes.h> 52#include <acpi/actypes.h>
@@ -147,6 +147,8 @@ acpi_status acpi_install_interface(acpi_string interface_name);
147 147
148acpi_status acpi_remove_interface(acpi_string interface_name); 148acpi_status acpi_remove_interface(acpi_string interface_name);
149 149
150acpi_status acpi_update_interfaces(u8 action);
151
150u32 152u32
151acpi_check_address_range(acpi_adr_space_type space_id, 153acpi_check_address_range(acpi_adr_space_type space_id,
152 acpi_physical_address address, 154 acpi_physical_address address,
@@ -210,8 +212,8 @@ acpi_status
210acpi_walk_namespace(acpi_object_type type, 212acpi_walk_namespace(acpi_object_type type,
211 acpi_handle start_object, 213 acpi_handle start_object,
212 u32 max_depth, 214 u32 max_depth,
213 acpi_walk_callback pre_order_visit, 215 acpi_walk_callback descending_callback,
214 acpi_walk_callback post_order_visit, 216 acpi_walk_callback ascending_callback,
215 void *context, void **return_value); 217 void *context, void **return_value);
216 218
217acpi_status 219acpi_status
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 22b03c9286e9..b748aefce929 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -668,13 +668,6 @@ typedef u32 acpi_event_status;
668#define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x04 668#define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x04
669#define ACPI_EVENT_FLAG_HANDLE (acpi_event_status) 0x08 669#define ACPI_EVENT_FLAG_HANDLE (acpi_event_status) 0x08
670 670
671/*
672 * General Purpose Events (GPE)
673 */
674#define ACPI_GPE_INVALID 0xFF
675#define ACPI_GPE_MAX 0xFF
676#define ACPI_NUM_GPE 256
677
678/* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */ 671/* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */
679 672
680#define ACPI_GPE_ENABLE 0 673#define ACPI_GPE_ENABLE 0
@@ -1144,7 +1137,19 @@ struct acpi_memory_list {
1144#endif 1137#endif
1145}; 1138};
1146 1139
1147/* Definitions for _OSI support */ 1140/* Definitions of _OSI support */
1141
1142#define ACPI_VENDOR_STRINGS 0x01
1143#define ACPI_FEATURE_STRINGS 0x02
1144#define ACPI_ENABLE_INTERFACES 0x00
1145#define ACPI_DISABLE_INTERFACES 0x04
1146
1147#define ACPI_DISABLE_ALL_VENDOR_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS)
1148#define ACPI_DISABLE_ALL_FEATURE_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_FEATURE_STRINGS)
1149#define ACPI_DISABLE_ALL_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
1150#define ACPI_ENABLE_ALL_VENDOR_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS)
1151#define ACPI_ENABLE_ALL_FEATURE_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_FEATURE_STRINGS)
1152#define ACPI_ENABLE_ALL_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
1148 1153
1149#define ACPI_OSI_WIN_2000 0x01 1154#define ACPI_OSI_WIN_2000 0x01
1150#define ACPI_OSI_WIN_XP 0x02 1155#define ACPI_OSI_WIN_XP 0x02
diff --git a/include/asm-generic/dma-contiguous.h b/include/asm-generic/dma-contiguous.h
deleted file mode 100644
index 294b1e755ab2..000000000000
--- a/include/asm-generic/dma-contiguous.h
+++ /dev/null
@@ -1,28 +0,0 @@
1#ifndef ASM_DMA_CONTIGUOUS_H
2#define ASM_DMA_CONTIGUOUS_H
3
4#ifdef __KERNEL__
5#ifdef CONFIG_CMA
6
7#include <linux/device.h>
8#include <linux/dma-contiguous.h>
9
10static inline struct cma *dev_get_cma_area(struct device *dev)
11{
12 if (dev && dev->cma_area)
13 return dev->cma_area;
14 return dma_contiguous_default_area;
15}
16
17static inline void dev_set_cma_area(struct device *dev, struct cma *cma)
18{
19 if (dev)
20 dev->cma_area = cma;
21 if (!dev && !dma_contiguous_default_area)
22 dma_contiguous_default_area = cma;
23}
24
25#endif
26#endif
27
28#endif
diff --git a/include/asm-generic/hugetlb.h b/include/asm-generic/hugetlb.h
index d06079c774a0..99b490b4d05a 100644
--- a/include/asm-generic/hugetlb.h
+++ b/include/asm-generic/hugetlb.h
@@ -6,12 +6,12 @@ static inline pte_t mk_huge_pte(struct page *page, pgprot_t pgprot)
6 return mk_pte(page, pgprot); 6 return mk_pte(page, pgprot);
7} 7}
8 8
9static inline int huge_pte_write(pte_t pte) 9static inline unsigned long huge_pte_write(pte_t pte)
10{ 10{
11 return pte_write(pte); 11 return pte_write(pte);
12} 12}
13 13
14static inline int huge_pte_dirty(pte_t pte) 14static inline unsigned long huge_pte_dirty(pte_t pte)
15{ 15{
16 return pte_dirty(pte); 16 return pte_dirty(pte);
17} 17}
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 0807ddf97b05..f330d28e4d0e 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -208,10 +208,6 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
208#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ 208#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
209#endif 209#endif
210 210
211#ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG
212#define page_test_and_clear_young(pfn) (0)
213#endif
214
215#ifndef __HAVE_ARCH_PGD_OFFSET_GATE 211#ifndef __HAVE_ARCH_PGD_OFFSET_GATE
216#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr) 212#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr)
217#endif 213#endif
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 69732d279e8b..83e2c31e8b00 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -122,8 +122,12 @@
122#define TRACE_PRINTKS() VMLINUX_SYMBOL(__start___trace_bprintk_fmt) = .; \ 122#define TRACE_PRINTKS() VMLINUX_SYMBOL(__start___trace_bprintk_fmt) = .; \
123 *(__trace_printk_fmt) /* Trace_printk fmt' pointer */ \ 123 *(__trace_printk_fmt) /* Trace_printk fmt' pointer */ \
124 VMLINUX_SYMBOL(__stop___trace_bprintk_fmt) = .; 124 VMLINUX_SYMBOL(__stop___trace_bprintk_fmt) = .;
125#define TRACEPOINT_STR() VMLINUX_SYMBOL(__start___tracepoint_str) = .; \
126 *(__tracepoint_str) /* Trace_printk fmt' pointer */ \
127 VMLINUX_SYMBOL(__stop___tracepoint_str) = .;
125#else 128#else
126#define TRACE_PRINTKS() 129#define TRACE_PRINTKS()
130#define TRACEPOINT_STR()
127#endif 131#endif
128 132
129#ifdef CONFIG_FTRACE_SYSCALLS 133#ifdef CONFIG_FTRACE_SYSCALLS
@@ -190,7 +194,8 @@
190 VMLINUX_SYMBOL(__stop___verbose) = .; \ 194 VMLINUX_SYMBOL(__stop___verbose) = .; \
191 LIKELY_PROFILE() \ 195 LIKELY_PROFILE() \
192 BRANCH_PROFILE() \ 196 BRANCH_PROFILE() \
193 TRACE_PRINTKS() 197 TRACE_PRINTKS() \
198 TRACEPOINT_STR()
194 199
195/* 200/*
196 * Data section helpers 201 * Data section helpers
diff --git a/include/asm-generic/vtime.h b/include/asm-generic/vtime.h
new file mode 100644
index 000000000000..b1a49677fe25
--- /dev/null
+++ b/include/asm-generic/vtime.h
@@ -0,0 +1 @@
/* no content, but patch(1) dislikes empty files */
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h
index c463ce990c48..93b7f96f9c59 100644
--- a/include/clocksource/arm_arch_timer.h
+++ b/include/clocksource/arm_arch_timer.h
@@ -23,16 +23,20 @@
23#define ARCH_TIMER_CTRL_IT_MASK (1 << 1) 23#define ARCH_TIMER_CTRL_IT_MASK (1 << 1)
24#define ARCH_TIMER_CTRL_IT_STAT (1 << 2) 24#define ARCH_TIMER_CTRL_IT_STAT (1 << 2)
25 25
26#define ARCH_TIMER_REG_CTRL 0 26enum arch_timer_reg {
27#define ARCH_TIMER_REG_TVAL 1 27 ARCH_TIMER_REG_CTRL,
28 ARCH_TIMER_REG_TVAL,
29};
28 30
29#define ARCH_TIMER_PHYS_ACCESS 0 31#define ARCH_TIMER_PHYS_ACCESS 0
30#define ARCH_TIMER_VIRT_ACCESS 1 32#define ARCH_TIMER_VIRT_ACCESS 1
33#define ARCH_TIMER_MEM_PHYS_ACCESS 2
34#define ARCH_TIMER_MEM_VIRT_ACCESS 3
31 35
32#ifdef CONFIG_ARM_ARCH_TIMER 36#ifdef CONFIG_ARM_ARCH_TIMER
33 37
34extern u32 arch_timer_get_rate(void); 38extern u32 arch_timer_get_rate(void);
35extern u64 arch_timer_read_counter(void); 39extern u64 (*arch_timer_read_counter)(void);
36extern struct timecounter *arch_timer_get_timecounter(void); 40extern struct timecounter *arch_timer_get_timecounter(void);
37 41
38#else 42#else
diff --git a/include/clocksource/samsung_pwm.h b/include/clocksource/samsung_pwm.h
index 5c449c8199e9..0c7d48b8b396 100644
--- a/include/clocksource/samsung_pwm.h
+++ b/include/clocksource/samsung_pwm.h
@@ -20,7 +20,14 @@
20 20
21#define SAMSUNG_PWM_NUM 5 21#define SAMSUNG_PWM_NUM 5
22 22
23/*
24 * Following declaration must be in an ifdef due to this symbol being static
25 * in pwm-samsung driver if the clocksource driver is not compiled in and the
26 * spinlock is not shared between both drivers.
27 */
28#ifdef CONFIG_CLKSRC_SAMSUNG_PWM
23extern spinlock_t samsung_pwm_lock; 29extern spinlock_t samsung_pwm_lock;
30#endif
24 31
25struct samsung_pwm_variant { 32struct samsung_pwm_variant {
26 u8 bits; 33 u8 bits;
diff --git a/include/crypto/scatterwalk.h b/include/crypto/scatterwalk.h
index 3744d2a642df..13621cc8cf4c 100644
--- a/include/crypto/scatterwalk.h
+++ b/include/crypto/scatterwalk.h
@@ -113,4 +113,6 @@ void scatterwalk_done(struct scatter_walk *walk, int out, int more);
113void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg, 113void scatterwalk_map_and_copy(void *buf, struct scatterlist *sg,
114 unsigned int start, unsigned int nbytes, int out); 114 unsigned int start, unsigned int nbytes, int out);
115 115
116int scatterwalk_bytes_sglen(struct scatterlist *sg, int num_bytes);
117
116#endif /* _CRYPTO_SCATTERWALK_H */ 118#endif /* _CRYPTO_SCATTERWALK_H */
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 12083dc862a9..b46fb45f2cca 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -45,7 +45,6 @@
45#include <linux/kernel.h> 45#include <linux/kernel.h>
46#include <linux/miscdevice.h> 46#include <linux/miscdevice.h>
47#include <linux/fs.h> 47#include <linux/fs.h>
48#include <linux/proc_fs.h>
49#include <linux/init.h> 48#include <linux/init.h>
50#include <linux/file.h> 49#include <linux/file.h>
51#include <linux/platform_device.h> 50#include <linux/platform_device.h>
@@ -62,20 +61,18 @@
62#endif 61#endif
63#include <asm/mman.h> 62#include <asm/mman.h>
64#include <asm/uaccess.h> 63#include <asm/uaccess.h>
65#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
66#include <linux/types.h> 64#include <linux/types.h>
67#include <linux/agp_backend.h> 65#include <linux/agp_backend.h>
68#endif
69#include <linux/workqueue.h> 66#include <linux/workqueue.h>
70#include <linux/poll.h> 67#include <linux/poll.h>
71#include <asm/pgalloc.h> 68#include <asm/pgalloc.h>
72#include <drm/drm.h> 69#include <drm/drm.h>
73#include <drm/drm_sarea.h> 70#include <drm/drm_sarea.h>
71#include <drm/drm_vma_manager.h>
74 72
75#include <linux/idr.h> 73#include <linux/idr.h>
76 74
77#define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) 75#define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)))
78#define __OS_HAS_MTRR (defined(CONFIG_MTRR))
79 76
80struct module; 77struct module;
81 78
@@ -140,19 +137,15 @@ int drm_err(const char *func, const char *format, ...);
140/* driver capabilities and requirements mask */ 137/* driver capabilities and requirements mask */
141#define DRIVER_USE_AGP 0x1 138#define DRIVER_USE_AGP 0x1
142#define DRIVER_REQUIRE_AGP 0x2 139#define DRIVER_REQUIRE_AGP 0x2
143#define DRIVER_USE_MTRR 0x4
144#define DRIVER_PCI_DMA 0x8 140#define DRIVER_PCI_DMA 0x8
145#define DRIVER_SG 0x10 141#define DRIVER_SG 0x10
146#define DRIVER_HAVE_DMA 0x20 142#define DRIVER_HAVE_DMA 0x20
147#define DRIVER_HAVE_IRQ 0x40 143#define DRIVER_HAVE_IRQ 0x40
148#define DRIVER_IRQ_SHARED 0x80 144#define DRIVER_IRQ_SHARED 0x80
149#define DRIVER_IRQ_VBL 0x100
150#define DRIVER_DMA_QUEUE 0x200
151#define DRIVER_FB_DMA 0x400
152#define DRIVER_IRQ_VBL2 0x800
153#define DRIVER_GEM 0x1000 145#define DRIVER_GEM 0x1000
154#define DRIVER_MODESET 0x2000 146#define DRIVER_MODESET 0x2000
155#define DRIVER_PRIME 0x4000 147#define DRIVER_PRIME 0x4000
148#define DRIVER_RENDER 0x8000
156 149
157#define DRIVER_BUS_PCI 0x1 150#define DRIVER_BUS_PCI 0x1
158#define DRIVER_BUS_PLATFORM 0x2 151#define DRIVER_BUS_PLATFORM 0x2
@@ -168,13 +161,7 @@ int drm_err(const char *func, const char *format, ...);
168#define DRM_MAGIC_HASH_ORDER 4 /**< Size of key hash table. Must be power of 2. */ 161#define DRM_MAGIC_HASH_ORDER 4 /**< Size of key hash table. Must be power of 2. */
169#define DRM_KERNEL_CONTEXT 0 /**< Change drm_resctx if changed */ 162#define DRM_KERNEL_CONTEXT 0 /**< Change drm_resctx if changed */
170#define DRM_RESERVED_CONTEXTS 1 /**< Change drm_resctx if changed */ 163#define DRM_RESERVED_CONTEXTS 1 /**< Change drm_resctx if changed */
171#define DRM_LOOPING_LIMIT 5000000
172#define DRM_TIME_SLICE (HZ/20) /**< Time slice for GLXContexts */
173#define DRM_LOCK_SLICE 1 /**< Time slice for lock, in jiffies */
174
175#define DRM_FLAG_DEBUG 0x01
176 164
177#define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8)
178#define DRM_MAP_HASH_OFFSET 0x10000000 165#define DRM_MAP_HASH_OFFSET 0x10000000
179 166
180/*@}*/ 167/*@}*/
@@ -263,9 +250,6 @@ int drm_err(const char *func, const char *format, ...);
263 250
264#define DRM_ARRAY_SIZE(x) ARRAY_SIZE(x) 251#define DRM_ARRAY_SIZE(x) ARRAY_SIZE(x)
265 252
266#define DRM_LEFTCOUNT(x) (((x)->rp + (x)->count - (x)->wp) % ((x)->count + 1))
267#define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x))
268
269#define DRM_IF_VERSION(maj, min) (maj << 16 | min) 253#define DRM_IF_VERSION(maj, min) (maj << 16 | min)
270 254
271/** 255/**
@@ -307,6 +291,7 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,
307#define DRM_ROOT_ONLY 0x4 291#define DRM_ROOT_ONLY 0x4
308#define DRM_CONTROL_ALLOW 0x8 292#define DRM_CONTROL_ALLOW 0x8
309#define DRM_UNLOCKED 0x10 293#define DRM_UNLOCKED 0x10
294#define DRM_RENDER_ALLOW 0x20
310 295
311struct drm_ioctl_desc { 296struct drm_ioctl_desc {
312 unsigned int cmd; 297 unsigned int cmd;
@@ -587,7 +572,6 @@ struct drm_map_list {
587 struct drm_local_map *map; /**< mapping */ 572 struct drm_local_map *map; /**< mapping */
588 uint64_t user_token; 573 uint64_t user_token;
589 struct drm_master *master; 574 struct drm_master *master;
590 struct drm_mm_node *file_offset_node; /**< fake offset */
591}; 575};
592 576
593/** 577/**
@@ -622,8 +606,7 @@ struct drm_ati_pcigart_info {
622 * GEM specific mm private for tracking GEM objects 606 * GEM specific mm private for tracking GEM objects
623 */ 607 */
624struct drm_gem_mm { 608struct drm_gem_mm {
625 struct drm_mm offset_manager; /**< Offset mgmt for buffer objects */ 609 struct drm_vma_offset_manager vma_manager;
626 struct drm_open_hash offset_hash; /**< User token hash table for maps */
627}; 610};
628 611
629/** 612/**
@@ -634,8 +617,16 @@ struct drm_gem_object {
634 /** Reference count of this object */ 617 /** Reference count of this object */
635 struct kref refcount; 618 struct kref refcount;
636 619
637 /** Handle count of this object. Each handle also holds a reference */ 620 /**
638 atomic_t handle_count; /* number of handles on this object */ 621 * handle_count - gem file_priv handle count of this object
622 *
623 * Each handle also holds a reference. Note that when the handle_count
624 * drops to 0 any global names (e.g. the id in the flink namespace) will
625 * be cleared.
626 *
627 * Protected by dev->object_name_lock.
628 * */
629 unsigned handle_count;
639 630
640 /** Related drm device */ 631 /** Related drm device */
641 struct drm_device *dev; 632 struct drm_device *dev;
@@ -644,7 +635,7 @@ struct drm_gem_object {
644 struct file *filp; 635 struct file *filp;
645 636
646 /* Mapping info for this object */ 637 /* Mapping info for this object */
647 struct drm_map_list map_list; 638 struct drm_vma_offset_node vma_node;
648 639
649 /** 640 /**
650 * Size of the object, in bytes. Immutable over the object's 641 * Size of the object, in bytes. Immutable over the object's
@@ -678,10 +669,32 @@ struct drm_gem_object {
678 669
679 void *driver_private; 670 void *driver_private;
680 671
681 /* dma buf exported from this GEM object */ 672 /**
682 struct dma_buf *export_dma_buf; 673 * dma_buf - dma buf associated with this GEM object
674 *
675 * Pointer to the dma-buf associated with this gem object (either
676 * through importing or exporting). We break the resulting reference
677 * loop when the last gem handle for this object is released.
678 *
679 * Protected by obj->object_name_lock
680 */
681 struct dma_buf *dma_buf;
683 682
684 /* dma buf attachment backing this object */ 683 /**
684 * import_attach - dma buf attachment backing this object
685 *
686 * Any foreign dma_buf imported as a gem object has this set to the
687 * attachment point for the device. This is invariant over the lifetime
688 * of a gem object.
689 *
690 * The driver's ->gem_free_object callback is responsible for cleaning
691 * up the dma_buf attachment and references acquired at import time.
692 *
693 * Note that the drm gem/prime core does not depend upon drivers setting
694 * this field any more. So for drivers where this doesn't make sense
695 * (e.g. virtual devices or a displaylink behind an usb bus) they can
696 * simply leave it as NULL.
697 */
685 struct dma_buf_attachment *import_attach; 698 struct dma_buf_attachment *import_attach;
686}; 699};
687 700
@@ -737,6 +750,7 @@ struct drm_bus {
737 int (*irq_by_busid)(struct drm_device *dev, struct drm_irq_busid *p); 750 int (*irq_by_busid)(struct drm_device *dev, struct drm_irq_busid *p);
738 /* hooks that are for PCI */ 751 /* hooks that are for PCI */
739 int (*agp_init)(struct drm_device *dev); 752 int (*agp_init)(struct drm_device *dev);
753 void (*agp_destroy)(struct drm_device *dev);
740 754
741}; 755};
742 756
@@ -885,8 +899,6 @@ struct drm_driver {
885 void (*irq_preinstall) (struct drm_device *dev); 899 void (*irq_preinstall) (struct drm_device *dev);
886 int (*irq_postinstall) (struct drm_device *dev); 900 int (*irq_postinstall) (struct drm_device *dev);
887 void (*irq_uninstall) (struct drm_device *dev); 901 void (*irq_uninstall) (struct drm_device *dev);
888 void (*set_version) (struct drm_device *dev,
889 struct drm_set_version *sv);
890 902
891 /* Master routines */ 903 /* Master routines */
892 int (*master_create)(struct drm_device *dev, struct drm_master *master); 904 int (*master_create)(struct drm_device *dev, struct drm_master *master);
@@ -966,7 +978,7 @@ struct drm_driver {
966 978
967 u32 driver_features; 979 u32 driver_features;
968 int dev_priv_size; 980 int dev_priv_size;
969 struct drm_ioctl_desc *ioctls; 981 const struct drm_ioctl_desc *ioctls;
970 int num_ioctls; 982 int num_ioctls;
971 const struct file_operations *fops; 983 const struct file_operations *fops;
972 union { 984 union {
@@ -1037,8 +1049,6 @@ struct drm_minor {
1037 struct device kdev; /**< Linux device */ 1049 struct device kdev; /**< Linux device */
1038 struct drm_device *dev; 1050 struct drm_device *dev;
1039 1051
1040 struct proc_dir_entry *proc_root; /**< proc directory entry */
1041 struct drm_info_node proc_nodes;
1042 struct dentry *debugfs_root; 1052 struct dentry *debugfs_root;
1043 1053
1044 struct list_head debugfs_list; 1054 struct list_head debugfs_list;
@@ -1131,12 +1141,7 @@ struct drm_device {
1131 /*@{ */ 1141 /*@{ */
1132 int irq_enabled; /**< True if irq handler is enabled */ 1142 int irq_enabled; /**< True if irq handler is enabled */
1133 __volatile__ long context_flag; /**< Context swapping flag */ 1143 __volatile__ long context_flag; /**< Context swapping flag */
1134 __volatile__ long interrupt_flag; /**< Interruption handler flag */
1135 __volatile__ long dma_flag; /**< DMA dispatch flag */
1136 wait_queue_head_t context_wait; /**< Processes waiting on ctx switch */
1137 int last_checked; /**< Last context checked for DMA */
1138 int last_context; /**< Last current context */ 1144 int last_context; /**< Last current context */
1139 unsigned long last_switch; /**< jiffies at last context switch */
1140 /*@} */ 1145 /*@} */
1141 1146
1142 struct work_struct work; 1147 struct work_struct work;
@@ -1174,12 +1179,6 @@ struct drm_device {
1174 spinlock_t event_lock; 1179 spinlock_t event_lock;
1175 1180
1176 /*@} */ 1181 /*@} */
1177 cycles_t ctx_start;
1178 cycles_t lck_start;
1179
1180 struct fasync_struct *buf_async;/**< Processes waiting for SIGIO */
1181 wait_queue_head_t buf_readers; /**< Processes waiting to read */
1182 wait_queue_head_t buf_writers; /**< Processes waiting to ctx switch */
1183 1182
1184 struct drm_agp_head *agp; /**< AGP data */ 1183 struct drm_agp_head *agp; /**< AGP data */
1185 1184
@@ -1207,12 +1206,13 @@ struct drm_device {
1207 unsigned int agp_buffer_token; 1206 unsigned int agp_buffer_token;
1208 struct drm_minor *control; /**< Control node for card */ 1207 struct drm_minor *control; /**< Control node for card */
1209 struct drm_minor *primary; /**< render type primary screen head */ 1208 struct drm_minor *primary; /**< render type primary screen head */
1209 struct drm_minor *render; /**< render node for card */
1210 1210
1211 struct drm_mode_config mode_config; /**< Current mode config */ 1211 struct drm_mode_config mode_config; /**< Current mode config */
1212 1212
1213 /** \name GEM information */ 1213 /** \name GEM information */
1214 /*@{ */ 1214 /*@{ */
1215 spinlock_t object_name_lock; 1215 struct mutex object_name_lock;
1216 struct idr object_name_idr; 1216 struct idr object_name_idr;
1217 /*@} */ 1217 /*@} */
1218 int switch_power_state; 1218 int switch_power_state;
@@ -1223,6 +1223,7 @@ struct drm_device {
1223#define DRM_SWITCH_POWER_ON 0 1223#define DRM_SWITCH_POWER_ON 0
1224#define DRM_SWITCH_POWER_OFF 1 1224#define DRM_SWITCH_POWER_OFF 1
1225#define DRM_SWITCH_POWER_CHANGING 2 1225#define DRM_SWITCH_POWER_CHANGING 2
1226#define DRM_SWITCH_POWER_DYNAMIC_OFF 3
1226 1227
1227static __inline__ int drm_core_check_feature(struct drm_device *dev, 1228static __inline__ int drm_core_check_feature(struct drm_device *dev,
1228 int feature) 1229 int feature)
@@ -1235,25 +1236,6 @@ static inline int drm_dev_to_irq(struct drm_device *dev)
1235 return dev->driver->bus->get_irq(dev); 1236 return dev->driver->bus->get_irq(dev);
1236} 1237}
1237 1238
1238
1239#if __OS_HAS_AGP
1240static inline int drm_core_has_AGP(struct drm_device *dev)
1241{
1242 return drm_core_check_feature(dev, DRIVER_USE_AGP);
1243}
1244#else
1245#define drm_core_has_AGP(dev) (0)
1246#endif
1247
1248#if __OS_HAS_MTRR
1249static inline int drm_core_has_MTRR(struct drm_device *dev)
1250{
1251 return drm_core_check_feature(dev, DRIVER_USE_MTRR);
1252}
1253#else
1254#define drm_core_has_MTRR(dev) (0)
1255#endif
1256
1257static inline void drm_device_set_unplugged(struct drm_device *dev) 1239static inline void drm_device_set_unplugged(struct drm_device *dev)
1258{ 1240{
1259 smp_wmb(); 1241 smp_wmb();
@@ -1272,6 +1254,11 @@ static inline bool drm_modeset_is_locked(struct drm_device *dev)
1272 return mutex_is_locked(&dev->mode_config.mutex); 1254 return mutex_is_locked(&dev->mode_config.mutex);
1273} 1255}
1274 1256
1257static inline bool drm_is_render_client(struct drm_file *file_priv)
1258{
1259 return file_priv->minor->type == DRM_MINOR_RENDER;
1260}
1261
1275/******************************************************************/ 1262/******************************************************************/
1276/** \name Internal function definitions */ 1263/** \name Internal function definitions */
1277/*@{*/ 1264/*@{*/
@@ -1287,7 +1274,6 @@ extern int drm_lastclose(struct drm_device *dev);
1287extern struct mutex drm_global_mutex; 1274extern struct mutex drm_global_mutex;
1288extern int drm_open(struct inode *inode, struct file *filp); 1275extern int drm_open(struct inode *inode, struct file *filp);
1289extern int drm_stub_open(struct inode *inode, struct file *filp); 1276extern int drm_stub_open(struct inode *inode, struct file *filp);
1290extern int drm_fasync(int fd, struct file *filp, int on);
1291extern ssize_t drm_read(struct file *filp, char __user *buffer, 1277extern ssize_t drm_read(struct file *filp, char __user *buffer,
1292 size_t count, loff_t *offset); 1278 size_t count, loff_t *offset);
1293extern int drm_release(struct inode *inode, struct file *filp); 1279extern int drm_release(struct inode *inode, struct file *filp);
@@ -1301,14 +1287,6 @@ extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
1301 1287
1302 /* Memory management support (drm_memory.h) */ 1288 /* Memory management support (drm_memory.h) */
1303#include <drm/drm_memory.h> 1289#include <drm/drm_memory.h>
1304extern void drm_free_agp(DRM_AGP_MEM * handle, int pages);
1305extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start);
1306extern DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
1307 struct page **pages,
1308 unsigned long num_pages,
1309 uint32_t gtt_offset,
1310 uint32_t type);
1311extern int drm_unbind_agp(DRM_AGP_MEM * handle);
1312 1290
1313 /* Misc. IOCTL support (drm_ioctl.h) */ 1291 /* Misc. IOCTL support (drm_ioctl.h) */
1314extern int drm_irq_by_busid(struct drm_device *dev, void *data, 1292extern int drm_irq_by_busid(struct drm_device *dev, void *data,
@@ -1335,8 +1313,6 @@ extern int drm_resctx(struct drm_device *dev, void *data,
1335 struct drm_file *file_priv); 1313 struct drm_file *file_priv);
1336extern int drm_addctx(struct drm_device *dev, void *data, 1314extern int drm_addctx(struct drm_device *dev, void *data,
1337 struct drm_file *file_priv); 1315 struct drm_file *file_priv);
1338extern int drm_modctx(struct drm_device *dev, void *data,
1339 struct drm_file *file_priv);
1340extern int drm_getctx(struct drm_device *dev, void *data, 1316extern int drm_getctx(struct drm_device *dev, void *data,
1341 struct drm_file *file_priv); 1317 struct drm_file *file_priv);
1342extern int drm_switchctx(struct drm_device *dev, void *data, 1318extern int drm_switchctx(struct drm_device *dev, void *data,
@@ -1405,11 +1381,12 @@ extern int drm_freebufs(struct drm_device *dev, void *data,
1405 struct drm_file *file_priv); 1381 struct drm_file *file_priv);
1406extern int drm_mapbufs(struct drm_device *dev, void *data, 1382extern int drm_mapbufs(struct drm_device *dev, void *data,
1407 struct drm_file *file_priv); 1383 struct drm_file *file_priv);
1408extern int drm_order(unsigned long size); 1384extern int drm_dma_ioctl(struct drm_device *dev, void *data,
1385 struct drm_file *file_priv);
1409 1386
1410 /* DMA support (drm_dma.h) */ 1387 /* DMA support (drm_dma.h) */
1411extern int drm_dma_setup(struct drm_device *dev); 1388extern int drm_legacy_dma_setup(struct drm_device *dev);
1412extern void drm_dma_takedown(struct drm_device *dev); 1389extern void drm_legacy_dma_takedown(struct drm_device *dev);
1413extern void drm_free_buffer(struct drm_device *dev, struct drm_buf * buf); 1390extern void drm_free_buffer(struct drm_device *dev, struct drm_buf * buf);
1414extern void drm_core_reclaim_buffers(struct drm_device *dev, 1391extern void drm_core_reclaim_buffers(struct drm_device *dev,
1415 struct drm_file *filp); 1392 struct drm_file *filp);
@@ -1423,7 +1400,6 @@ extern int drm_irq_uninstall(struct drm_device *dev);
1423extern int drm_vblank_init(struct drm_device *dev, int num_crtcs); 1400extern int drm_vblank_init(struct drm_device *dev, int num_crtcs);
1424extern int drm_wait_vblank(struct drm_device *dev, void *data, 1401extern int drm_wait_vblank(struct drm_device *dev, void *data,
1425 struct drm_file *filp); 1402 struct drm_file *filp);
1426extern int drm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq);
1427extern u32 drm_vblank_count(struct drm_device *dev, int crtc); 1403extern u32 drm_vblank_count(struct drm_device *dev, int crtc);
1428extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc, 1404extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc,
1429 struct timeval *vblanktime); 1405 struct timeval *vblanktime);
@@ -1465,31 +1441,8 @@ extern int drm_modeset_ctl(struct drm_device *dev, void *data,
1465 struct drm_file *file_priv); 1441 struct drm_file *file_priv);
1466 1442
1467 /* AGP/GART support (drm_agpsupport.h) */ 1443 /* AGP/GART support (drm_agpsupport.h) */
1468extern struct drm_agp_head *drm_agp_init(struct drm_device *dev); 1444
1469extern int drm_agp_acquire(struct drm_device *dev); 1445#include <drm/drm_agpsupport.h>
1470extern int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
1471 struct drm_file *file_priv);
1472extern int drm_agp_release(struct drm_device *dev);
1473extern int drm_agp_release_ioctl(struct drm_device *dev, void *data,
1474 struct drm_file *file_priv);
1475extern int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode);
1476extern int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
1477 struct drm_file *file_priv);
1478extern int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info);
1479extern int drm_agp_info_ioctl(struct drm_device *dev, void *data,
1480 struct drm_file *file_priv);
1481extern int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request);
1482extern int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
1483 struct drm_file *file_priv);
1484extern int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request);
1485extern int drm_agp_free_ioctl(struct drm_device *dev, void *data,
1486 struct drm_file *file_priv);
1487extern int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request);
1488extern int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
1489 struct drm_file *file_priv);
1490extern int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
1491extern int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
1492 struct drm_file *file_priv);
1493 1446
1494 /* Stub support (drm_stub.h) */ 1447 /* Stub support (drm_stub.h) */
1495extern int drm_setmaster_ioctl(struct drm_device *dev, void *data, 1448extern int drm_setmaster_ioctl(struct drm_device *dev, void *data,
@@ -1504,23 +1457,19 @@ extern void drm_put_dev(struct drm_device *dev);
1504extern int drm_put_minor(struct drm_minor **minor); 1457extern int drm_put_minor(struct drm_minor **minor);
1505extern void drm_unplug_dev(struct drm_device *dev); 1458extern void drm_unplug_dev(struct drm_device *dev);
1506extern unsigned int drm_debug; 1459extern unsigned int drm_debug;
1460extern unsigned int drm_rnodes;
1507 1461
1508extern unsigned int drm_vblank_offdelay; 1462extern unsigned int drm_vblank_offdelay;
1509extern unsigned int drm_timestamp_precision; 1463extern unsigned int drm_timestamp_precision;
1510extern unsigned int drm_timestamp_monotonic; 1464extern unsigned int drm_timestamp_monotonic;
1511 1465
1512extern struct class *drm_class; 1466extern struct class *drm_class;
1513extern struct proc_dir_entry *drm_proc_root;
1514extern struct dentry *drm_debugfs_root; 1467extern struct dentry *drm_debugfs_root;
1515 1468
1516extern struct idr drm_minors_idr; 1469extern struct idr drm_minors_idr;
1517 1470
1518extern struct drm_local_map *drm_getsarea(struct drm_device *dev); 1471extern struct drm_local_map *drm_getsarea(struct drm_device *dev);
1519 1472
1520 /* Proc support (drm_proc.h) */
1521extern int drm_proc_init(struct drm_minor *minor, struct proc_dir_entry *root);
1522extern int drm_proc_cleanup(struct drm_minor *minor, struct proc_dir_entry *root);
1523
1524 /* Debugfs support */ 1473 /* Debugfs support */
1525#if defined(CONFIG_DEBUG_FS) 1474#if defined(CONFIG_DEBUG_FS)
1526extern int drm_debugfs_init(struct drm_minor *minor, int minor_id, 1475extern int drm_debugfs_init(struct drm_minor *minor, int minor_id,
@@ -1550,6 +1499,7 @@ extern struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev,
1550 struct dma_buf *dma_buf); 1499 struct dma_buf *dma_buf);
1551extern int drm_gem_prime_fd_to_handle(struct drm_device *dev, 1500extern int drm_gem_prime_fd_to_handle(struct drm_device *dev,
1552 struct drm_file *file_priv, int prime_fd, uint32_t *handle); 1501 struct drm_file *file_priv, int prime_fd, uint32_t *handle);
1502extern void drm_gem_dmabuf_release(struct dma_buf *dma_buf);
1553 1503
1554extern int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data, 1504extern int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
1555 struct drm_file *file_priv); 1505 struct drm_file *file_priv);
@@ -1561,25 +1511,22 @@ extern int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **
1561extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages); 1511extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages);
1562extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg); 1512extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg);
1563 1513
1514int drm_gem_dumb_destroy(struct drm_file *file,
1515 struct drm_device *dev,
1516 uint32_t handle);
1564 1517
1565void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv); 1518void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv);
1566void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv); 1519void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv);
1567int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf, uint32_t *handle); 1520void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf);
1568void drm_prime_remove_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf);
1569
1570int drm_prime_add_dma_buf(struct drm_device *dev, struct drm_gem_object *obj);
1571int drm_prime_lookup_obj(struct drm_device *dev, struct dma_buf *buf,
1572 struct drm_gem_object **obj);
1573 1521
1574#if DRM_DEBUG_CODE 1522#if DRM_DEBUG_CODE
1575extern int drm_vma_info(struct seq_file *m, void *data); 1523extern int drm_vma_info(struct seq_file *m, void *data);
1576#endif 1524#endif
1577 1525
1578 /* Scatter Gather Support (drm_scatter.h) */ 1526 /* Scatter Gather Support (drm_scatter.h) */
1579extern void drm_sg_cleanup(struct drm_sg_mem * entry); 1527extern void drm_legacy_sg_cleanup(struct drm_device *dev);
1580extern int drm_sg_alloc_ioctl(struct drm_device *dev, void *data, 1528extern int drm_sg_alloc(struct drm_device *dev, void *data,
1581 struct drm_file *file_priv); 1529 struct drm_file *file_priv);
1582extern int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request);
1583extern int drm_sg_free(struct drm_device *dev, void *data, 1530extern int drm_sg_free(struct drm_device *dev, void *data,
1584 struct drm_file *file_priv); 1531 struct drm_file *file_priv);
1585 1532
@@ -1613,9 +1560,8 @@ struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev,
1613 size_t size); 1560 size_t size);
1614int drm_gem_object_init(struct drm_device *dev, 1561int drm_gem_object_init(struct drm_device *dev,
1615 struct drm_gem_object *obj, size_t size); 1562 struct drm_gem_object *obj, size_t size);
1616int drm_gem_private_object_init(struct drm_device *dev, 1563void drm_gem_private_object_init(struct drm_device *dev,
1617 struct drm_gem_object *obj, size_t size); 1564 struct drm_gem_object *obj, size_t size);
1618void drm_gem_object_handle_free(struct drm_gem_object *obj);
1619void drm_gem_vm_open(struct vm_area_struct *vma); 1565void drm_gem_vm_open(struct vm_area_struct *vma);
1620void drm_gem_vm_close(struct vm_area_struct *vma); 1566void drm_gem_vm_close(struct vm_area_struct *vma);
1621int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size, 1567int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size,
@@ -1640,66 +1586,32 @@ drm_gem_object_unreference(struct drm_gem_object *obj)
1640static inline void 1586static inline void
1641drm_gem_object_unreference_unlocked(struct drm_gem_object *obj) 1587drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
1642{ 1588{
1643 if (obj != NULL) { 1589 if (obj && !atomic_add_unless(&obj->refcount.refcount, -1, 1)) {
1644 struct drm_device *dev = obj->dev; 1590 struct drm_device *dev = obj->dev;
1591
1645 mutex_lock(&dev->struct_mutex); 1592 mutex_lock(&dev->struct_mutex);
1646 kref_put(&obj->refcount, drm_gem_object_free); 1593 if (likely(atomic_dec_and_test(&obj->refcount.refcount)))
1594 drm_gem_object_free(&obj->refcount);
1647 mutex_unlock(&dev->struct_mutex); 1595 mutex_unlock(&dev->struct_mutex);
1648 } 1596 }
1649} 1597}
1650 1598
1599int drm_gem_handle_create_tail(struct drm_file *file_priv,
1600 struct drm_gem_object *obj,
1601 u32 *handlep);
1651int drm_gem_handle_create(struct drm_file *file_priv, 1602int drm_gem_handle_create(struct drm_file *file_priv,
1652 struct drm_gem_object *obj, 1603 struct drm_gem_object *obj,
1653 u32 *handlep); 1604 u32 *handlep);
1654int drm_gem_handle_delete(struct drm_file *filp, u32 handle); 1605int drm_gem_handle_delete(struct drm_file *filp, u32 handle);
1655 1606
1656static inline void
1657drm_gem_object_handle_reference(struct drm_gem_object *obj)
1658{
1659 drm_gem_object_reference(obj);
1660 atomic_inc(&obj->handle_count);
1661}
1662
1663static inline void
1664drm_gem_object_handle_unreference(struct drm_gem_object *obj)
1665{
1666 if (obj == NULL)
1667 return;
1668
1669 if (atomic_read(&obj->handle_count) == 0)
1670 return;
1671 /*
1672 * Must bump handle count first as this may be the last
1673 * ref, in which case the object would disappear before we
1674 * checked for a name
1675 */
1676 if (atomic_dec_and_test(&obj->handle_count))
1677 drm_gem_object_handle_free(obj);
1678 drm_gem_object_unreference(obj);
1679}
1680
1681static inline void
1682drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj)
1683{
1684 if (obj == NULL)
1685 return;
1686
1687 if (atomic_read(&obj->handle_count) == 0)
1688 return;
1689
1690 /*
1691 * Must bump handle count first as this may be the last
1692 * ref, in which case the object would disappear before we
1693 * checked for a name
1694 */
1695
1696 if (atomic_dec_and_test(&obj->handle_count))
1697 drm_gem_object_handle_free(obj);
1698 drm_gem_object_unreference_unlocked(obj);
1699}
1700 1607
1701void drm_gem_free_mmap_offset(struct drm_gem_object *obj); 1608void drm_gem_free_mmap_offset(struct drm_gem_object *obj);
1702int drm_gem_create_mmap_offset(struct drm_gem_object *obj); 1609int drm_gem_create_mmap_offset(struct drm_gem_object *obj);
1610int drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size);
1611
1612struct page **drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask);
1613void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
1614 bool dirty, bool accessed);
1703 1615
1704struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev, 1616struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev,
1705 struct drm_file *filp, 1617 struct drm_file *filp,
@@ -1769,9 +1681,6 @@ extern int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *speed_mask);
1769extern int drm_platform_init(struct drm_driver *driver, struct platform_device *platform_device); 1681extern int drm_platform_init(struct drm_driver *driver, struct platform_device *platform_device);
1770extern void drm_platform_exit(struct drm_driver *driver, struct platform_device *platform_device); 1682extern void drm_platform_exit(struct drm_driver *driver, struct platform_device *platform_device);
1771 1683
1772extern int drm_get_platform_dev(struct platform_device *pdev,
1773 struct drm_driver *driver);
1774
1775/* returns true if currently okay to sleep */ 1684/* returns true if currently okay to sleep */
1776static __inline__ bool drm_can_sleep(void) 1685static __inline__ bool drm_can_sleep(void)
1777{ 1686{
diff --git a/include/drm/drm_agpsupport.h b/include/drm/drm_agpsupport.h
new file mode 100644
index 000000000000..a184eeee9c96
--- /dev/null
+++ b/include/drm/drm_agpsupport.h
@@ -0,0 +1,194 @@
1#ifndef _DRM_AGPSUPPORT_H_
2#define _DRM_AGPSUPPORT_H_
3
4#include <linux/kernel.h>
5#include <linux/mm.h>
6#include <linux/mutex.h>
7#include <linux/types.h>
8#include <linux/agp_backend.h>
9#include <drm/drmP.h>
10
11#if __OS_HAS_AGP
12
13void drm_free_agp(DRM_AGP_MEM * handle, int pages);
14int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start);
15int drm_unbind_agp(DRM_AGP_MEM * handle);
16DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
17 struct page **pages,
18 unsigned long num_pages,
19 uint32_t gtt_offset,
20 uint32_t type);
21
22struct drm_agp_head *drm_agp_init(struct drm_device *dev);
23void drm_agp_destroy(struct drm_agp_head *agp);
24void drm_agp_clear(struct drm_device *dev);
25int drm_agp_acquire(struct drm_device *dev);
26int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
27 struct drm_file *file_priv);
28int drm_agp_release(struct drm_device *dev);
29int drm_agp_release_ioctl(struct drm_device *dev, void *data,
30 struct drm_file *file_priv);
31int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode);
32int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
33 struct drm_file *file_priv);
34int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info);
35int drm_agp_info_ioctl(struct drm_device *dev, void *data,
36 struct drm_file *file_priv);
37int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request);
38int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
39 struct drm_file *file_priv);
40int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request);
41int drm_agp_free_ioctl(struct drm_device *dev, void *data,
42 struct drm_file *file_priv);
43int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request);
44int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
45 struct drm_file *file_priv);
46int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
47int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
48 struct drm_file *file_priv);
49
50static inline int drm_core_has_AGP(struct drm_device *dev)
51{
52 return drm_core_check_feature(dev, DRIVER_USE_AGP);
53}
54
55#else /* __OS_HAS_AGP */
56
57static inline void drm_free_agp(DRM_AGP_MEM * handle, int pages)
58{
59}
60
61static inline int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start)
62{
63 return -ENODEV;
64}
65
66static inline int drm_unbind_agp(DRM_AGP_MEM * handle)
67{
68 return -ENODEV;
69}
70
71static inline DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
72 struct page **pages,
73 unsigned long num_pages,
74 uint32_t gtt_offset,
75 uint32_t type)
76{
77 return NULL;
78}
79
80static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev)
81{
82 return NULL;
83}
84
85static inline void drm_agp_destroy(struct drm_agp_head *agp)
86{
87}
88
89static inline void drm_agp_clear(struct drm_device *dev)
90{
91}
92
93static inline int drm_agp_acquire(struct drm_device *dev)
94{
95 return -ENODEV;
96}
97
98static inline int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
99 struct drm_file *file_priv)
100{
101 return -ENODEV;
102}
103
104static inline int drm_agp_release(struct drm_device *dev)
105{
106 return -ENODEV;
107}
108
109static inline int drm_agp_release_ioctl(struct drm_device *dev, void *data,
110 struct drm_file *file_priv)
111{
112 return -ENODEV;
113}
114
115static inline int drm_agp_enable(struct drm_device *dev,
116 struct drm_agp_mode mode)
117{
118 return -ENODEV;
119}
120
121static inline int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
122 struct drm_file *file_priv)
123{
124 return -ENODEV;
125}
126
127static inline int drm_agp_info(struct drm_device *dev,
128 struct drm_agp_info *info)
129{
130 return -ENODEV;
131}
132
133static inline int drm_agp_info_ioctl(struct drm_device *dev, void *data,
134 struct drm_file *file_priv)
135{
136 return -ENODEV;
137}
138
139static inline int drm_agp_alloc(struct drm_device *dev,
140 struct drm_agp_buffer *request)
141{
142 return -ENODEV;
143}
144
145static inline int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
146 struct drm_file *file_priv)
147{
148 return -ENODEV;
149}
150
151static inline int drm_agp_free(struct drm_device *dev,
152 struct drm_agp_buffer *request)
153{
154 return -ENODEV;
155}
156
157static inline int drm_agp_free_ioctl(struct drm_device *dev, void *data,
158 struct drm_file *file_priv)
159{
160 return -ENODEV;
161}
162
163static inline int drm_agp_unbind(struct drm_device *dev,
164 struct drm_agp_binding *request)
165{
166 return -ENODEV;
167}
168
169static inline int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
170 struct drm_file *file_priv)
171{
172 return -ENODEV;
173}
174
175static inline int drm_agp_bind(struct drm_device *dev,
176 struct drm_agp_binding *request)
177{
178 return -ENODEV;
179}
180
181static inline int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
182 struct drm_file *file_priv)
183{
184 return -ENODEV;
185}
186
187static inline int drm_core_has_AGP(struct drm_device *dev)
188{
189 return 0;
190}
191
192#endif /* __OS_HAS_AGP */
193
194#endif /* _DRM_AGPSUPPORT_H_ */
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index fa12a2fa4293..24f499569a2f 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -49,6 +49,7 @@ struct drm_clip_rect;
49#define DRM_MODE_OBJECT_FB 0xfbfbfbfb 49#define DRM_MODE_OBJECT_FB 0xfbfbfbfb
50#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb 50#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb
51#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee 51#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
52#define DRM_MODE_OBJECT_BRIDGE 0xbdbdbdbd
52 53
53struct drm_mode_object { 54struct drm_mode_object {
54 uint32_t id; 55 uint32_t id;
@@ -305,6 +306,7 @@ struct drm_connector;
305struct drm_encoder; 306struct drm_encoder;
306struct drm_pending_vblank_event; 307struct drm_pending_vblank_event;
307struct drm_plane; 308struct drm_plane;
309struct drm_bridge;
308 310
309/** 311/**
310 * drm_crtc_funcs - control CRTCs for a given device 312 * drm_crtc_funcs - control CRTCs for a given device
@@ -363,7 +365,8 @@ struct drm_crtc_funcs {
363 */ 365 */
364 int (*page_flip)(struct drm_crtc *crtc, 366 int (*page_flip)(struct drm_crtc *crtc,
365 struct drm_framebuffer *fb, 367 struct drm_framebuffer *fb,
366 struct drm_pending_vblank_event *event); 368 struct drm_pending_vblank_event *event,
369 uint32_t flags);
367 370
368 int (*set_property)(struct drm_crtc *crtc, 371 int (*set_property)(struct drm_crtc *crtc,
369 struct drm_property *property, uint64_t val); 372 struct drm_property *property, uint64_t val);
@@ -494,8 +497,6 @@ struct drm_encoder_funcs {
494 void (*destroy)(struct drm_encoder *encoder); 497 void (*destroy)(struct drm_encoder *encoder);
495}; 498};
496 499
497#define DRM_CONNECTOR_MAX_UMODES 16
498#define DRM_CONNECTOR_LEN 32
499#define DRM_CONNECTOR_MAX_ENCODER 3 500#define DRM_CONNECTOR_MAX_ENCODER 3
500 501
501/** 502/**
@@ -507,6 +508,7 @@ struct drm_encoder_funcs {
507 * @possible_crtcs: bitmask of potential CRTC bindings 508 * @possible_crtcs: bitmask of potential CRTC bindings
508 * @possible_clones: bitmask of potential sibling encoders for cloning 509 * @possible_clones: bitmask of potential sibling encoders for cloning
509 * @crtc: currently bound CRTC 510 * @crtc: currently bound CRTC
511 * @bridge: bridge associated to the encoder
510 * @funcs: control functions 512 * @funcs: control functions
511 * @helper_private: mid-layer private data 513 * @helper_private: mid-layer private data
512 * 514 *
@@ -523,6 +525,7 @@ struct drm_encoder {
523 uint32_t possible_clones; 525 uint32_t possible_clones;
524 526
525 struct drm_crtc *crtc; 527 struct drm_crtc *crtc;
528 struct drm_bridge *bridge;
526 const struct drm_encoder_funcs *funcs; 529 const struct drm_encoder_funcs *funcs;
527 void *helper_private; 530 void *helper_private;
528}; 531};
@@ -683,6 +686,48 @@ struct drm_plane {
683}; 686};
684 687
685/** 688/**
689 * drm_bridge_funcs - drm_bridge control functions
690 * @mode_fixup: Try to fixup (or reject entirely) proposed mode for this bridge
691 * @disable: Called right before encoder prepare, disables the bridge
692 * @post_disable: Called right after encoder prepare, for lockstepped disable
693 * @mode_set: Set this mode to the bridge
694 * @pre_enable: Called right before encoder commit, for lockstepped commit
695 * @enable: Called right after encoder commit, enables the bridge
696 * @destroy: make object go away
697 */
698struct drm_bridge_funcs {
699 bool (*mode_fixup)(struct drm_bridge *bridge,
700 const struct drm_display_mode *mode,
701 struct drm_display_mode *adjusted_mode);
702 void (*disable)(struct drm_bridge *bridge);
703 void (*post_disable)(struct drm_bridge *bridge);
704 void (*mode_set)(struct drm_bridge *bridge,
705 struct drm_display_mode *mode,
706 struct drm_display_mode *adjusted_mode);
707 void (*pre_enable)(struct drm_bridge *bridge);
708 void (*enable)(struct drm_bridge *bridge);
709 void (*destroy)(struct drm_bridge *bridge);
710};
711
712/**
713 * drm_bridge - central DRM bridge control structure
714 * @dev: DRM device this bridge belongs to
715 * @head: list management
716 * @base: base mode object
717 * @funcs: control functions
718 * @driver_private: pointer to the bridge driver's internal context
719 */
720struct drm_bridge {
721 struct drm_device *dev;
722 struct list_head head;
723
724 struct drm_mode_object base;
725
726 const struct drm_bridge_funcs *funcs;
727 void *driver_private;
728};
729
730/**
686 * drm_mode_set - new values for a CRTC config change 731 * drm_mode_set - new values for a CRTC config change
687 * @head: list management 732 * @head: list management
688 * @fb: framebuffer to use for new config 733 * @fb: framebuffer to use for new config
@@ -742,6 +787,7 @@ struct drm_mode_group {
742 uint32_t num_crtcs; 787 uint32_t num_crtcs;
743 uint32_t num_encoders; 788 uint32_t num_encoders;
744 uint32_t num_connectors; 789 uint32_t num_connectors;
790 uint32_t num_bridges;
745 791
746 /* list of object IDs for this group */ 792 /* list of object IDs for this group */
747 uint32_t *id_list; 793 uint32_t *id_list;
@@ -756,6 +802,8 @@ struct drm_mode_group {
756 * @fb_list: list of framebuffers available 802 * @fb_list: list of framebuffers available
757 * @num_connector: number of connectors on this device 803 * @num_connector: number of connectors on this device
758 * @connector_list: list of connector objects 804 * @connector_list: list of connector objects
805 * @num_bridge: number of bridges on this device
806 * @bridge_list: list of bridge objects
759 * @num_encoder: number of encoders on this device 807 * @num_encoder: number of encoders on this device
760 * @encoder_list: list of encoder objects 808 * @encoder_list: list of encoder objects
761 * @num_crtc: number of CRTCs on this device 809 * @num_crtc: number of CRTCs on this device
@@ -793,6 +841,8 @@ struct drm_mode_config {
793 841
794 int num_connector; 842 int num_connector;
795 struct list_head connector_list; 843 struct list_head connector_list;
844 int num_bridge;
845 struct list_head bridge_list;
796 int num_encoder; 846 int num_encoder;
797 struct list_head encoder_list; 847 struct list_head encoder_list;
798 int num_plane; 848 int num_plane;
@@ -839,11 +889,13 @@ struct drm_mode_config {
839 889
840 /* Optional properties */ 890 /* Optional properties */
841 struct drm_property *scaling_mode_property; 891 struct drm_property *scaling_mode_property;
842 struct drm_property *dithering_mode_property;
843 struct drm_property *dirty_info_property; 892 struct drm_property *dirty_info_property;
844 893
845 /* dumb ioctl parameters */ 894 /* dumb ioctl parameters */
846 uint32_t preferred_depth, prefer_shadow; 895 uint32_t preferred_depth, prefer_shadow;
896
897 /* whether async page flip is supported or not */
898 bool async_page_flip;
847}; 899};
848 900
849#define obj_to_crtc(x) container_of(x, struct drm_crtc, base) 901#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
@@ -869,6 +921,8 @@ extern int drm_crtc_init(struct drm_device *dev,
869 const struct drm_crtc_funcs *funcs); 921 const struct drm_crtc_funcs *funcs);
870extern void drm_crtc_cleanup(struct drm_crtc *crtc); 922extern void drm_crtc_cleanup(struct drm_crtc *crtc);
871 923
924extern void drm_connector_ida_init(void);
925extern void drm_connector_ida_destroy(void);
872extern int drm_connector_init(struct drm_device *dev, 926extern int drm_connector_init(struct drm_device *dev,
873 struct drm_connector *connector, 927 struct drm_connector *connector,
874 const struct drm_connector_funcs *funcs, 928 const struct drm_connector_funcs *funcs,
@@ -878,6 +932,10 @@ extern void drm_connector_cleanup(struct drm_connector *connector);
878/* helper to unplug all connectors from sysfs for device */ 932/* helper to unplug all connectors from sysfs for device */
879extern void drm_connector_unplug_all(struct drm_device *dev); 933extern void drm_connector_unplug_all(struct drm_device *dev);
880 934
935extern int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge,
936 const struct drm_bridge_funcs *funcs);
937extern void drm_bridge_cleanup(struct drm_bridge *bridge);
938
881extern int drm_encoder_init(struct drm_device *dev, 939extern int drm_encoder_init(struct drm_device *dev,
882 struct drm_encoder *encoder, 940 struct drm_encoder *encoder,
883 const struct drm_encoder_funcs *funcs, 941 const struct drm_encoder_funcs *funcs,
@@ -908,7 +966,6 @@ extern struct edid *drm_get_edid(struct drm_connector *connector,
908 struct i2c_adapter *adapter); 966 struct i2c_adapter *adapter);
909extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid); 967extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
910extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode); 968extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
911extern void drm_mode_remove(struct drm_connector *connector, struct drm_display_mode *mode);
912extern void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src); 969extern void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src);
913extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev, 970extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
914 const struct drm_display_mode *mode); 971 const struct drm_display_mode *mode);
@@ -925,14 +982,9 @@ extern int drm_mode_height(const struct drm_display_mode *mode);
925/* for us by fb module */ 982/* for us by fb module */
926extern struct drm_display_mode *drm_mode_create(struct drm_device *dev); 983extern struct drm_display_mode *drm_mode_create(struct drm_device *dev);
927extern void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode); 984extern void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode);
928extern void drm_mode_list_concat(struct list_head *head,
929 struct list_head *new);
930extern void drm_mode_validate_size(struct drm_device *dev, 985extern void drm_mode_validate_size(struct drm_device *dev,
931 struct list_head *mode_list, 986 struct list_head *mode_list,
932 int maxX, int maxY, int maxPitch); 987 int maxX, int maxY, int maxPitch);
933extern void drm_mode_validate_clocks(struct drm_device *dev,
934 struct list_head *mode_list,
935 int *min, int *max, int n_ranges);
936extern void drm_mode_prune_invalid(struct drm_device *dev, 988extern void drm_mode_prune_invalid(struct drm_device *dev,
937 struct list_head *mode_list, bool verbose); 989 struct list_head *mode_list, bool verbose);
938extern void drm_mode_sort(struct list_head *mode_list); 990extern void drm_mode_sort(struct list_head *mode_list);
@@ -949,9 +1001,6 @@ extern int drm_object_property_set_value(struct drm_mode_object *obj,
949extern int drm_object_property_get_value(struct drm_mode_object *obj, 1001extern int drm_object_property_get_value(struct drm_mode_object *obj,
950 struct drm_property *property, 1002 struct drm_property *property,
951 uint64_t *value); 1003 uint64_t *value);
952extern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev);
953extern void drm_framebuffer_set_object(struct drm_device *dev,
954 unsigned long handle);
955extern int drm_framebuffer_init(struct drm_device *dev, 1004extern int drm_framebuffer_init(struct drm_device *dev,
956 struct drm_framebuffer *fb, 1005 struct drm_framebuffer *fb,
957 const struct drm_framebuffer_funcs *funcs); 1006 const struct drm_framebuffer_funcs *funcs);
@@ -962,10 +1011,6 @@ extern void drm_framebuffer_reference(struct drm_framebuffer *fb);
962extern void drm_framebuffer_remove(struct drm_framebuffer *fb); 1011extern void drm_framebuffer_remove(struct drm_framebuffer *fb);
963extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb); 1012extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb);
964extern void drm_framebuffer_unregister_private(struct drm_framebuffer *fb); 1013extern void drm_framebuffer_unregister_private(struct drm_framebuffer *fb);
965extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc);
966extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
967extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY);
968extern bool drm_crtc_in_use(struct drm_crtc *crtc);
969 1014
970extern void drm_object_attach_property(struct drm_mode_object *obj, 1015extern void drm_object_attach_property(struct drm_mode_object *obj,
971 struct drm_property *property, 1016 struct drm_property *property,
@@ -990,7 +1035,6 @@ extern int drm_mode_create_dvi_i_properties(struct drm_device *dev);
990extern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats, 1035extern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats,
991 char *formats[]); 1036 char *formats[]);
992extern int drm_mode_create_scaling_mode_property(struct drm_device *dev); 1037extern int drm_mode_create_scaling_mode_property(struct drm_device *dev);
993extern int drm_mode_create_dithering_property(struct drm_device *dev);
994extern int drm_mode_create_dirty_info_property(struct drm_device *dev); 1038extern int drm_mode_create_dirty_info_property(struct drm_device *dev);
995extern const char *drm_get_encoder_name(const struct drm_encoder *encoder); 1039extern const char *drm_get_encoder_name(const struct drm_encoder *encoder);
996 1040
@@ -1040,17 +1084,12 @@ extern int drm_mode_getblob_ioctl(struct drm_device *dev,
1040 void *data, struct drm_file *file_priv); 1084 void *data, struct drm_file *file_priv);
1041extern int drm_mode_connector_property_set_ioctl(struct drm_device *dev, 1085extern int drm_mode_connector_property_set_ioctl(struct drm_device *dev,
1042 void *data, struct drm_file *file_priv); 1086 void *data, struct drm_file *file_priv);
1043extern int drm_mode_hotplug_ioctl(struct drm_device *dev,
1044 void *data, struct drm_file *file_priv);
1045extern int drm_mode_replacefb(struct drm_device *dev,
1046 void *data, struct drm_file *file_priv);
1047extern int drm_mode_getencoder(struct drm_device *dev, 1087extern int drm_mode_getencoder(struct drm_device *dev,
1048 void *data, struct drm_file *file_priv); 1088 void *data, struct drm_file *file_priv);
1049extern int drm_mode_gamma_get_ioctl(struct drm_device *dev, 1089extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
1050 void *data, struct drm_file *file_priv); 1090 void *data, struct drm_file *file_priv);
1051extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, 1091extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
1052 void *data, struct drm_file *file_priv); 1092 void *data, struct drm_file *file_priv);
1053extern u8 *drm_find_cea_extension(struct edid *edid);
1054extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match); 1093extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
1055extern bool drm_detect_hdmi_monitor(struct edid *edid); 1094extern bool drm_detect_hdmi_monitor(struct edid *edid);
1056extern bool drm_detect_monitor_audio(struct edid *edid); 1095extern bool drm_detect_monitor_audio(struct edid *edid);
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index e8e1417af3d9..ae8dbfb1207c 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -342,13 +342,42 @@ u8 drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE],
342u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE], 342u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE],
343 int lane); 343 int lane);
344 344
345#define DP_RECEIVER_CAP_SIZE 0xf 345#define DP_RECEIVER_CAP_SIZE 0xf
346#define EDP_PSR_RECEIVER_CAP_SIZE 2
347
346void drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]); 348void drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]);
347void drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]); 349void drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]);
348 350
349u8 drm_dp_link_rate_to_bw_code(int link_rate); 351u8 drm_dp_link_rate_to_bw_code(int link_rate);
350int drm_dp_bw_code_to_link_rate(u8 link_bw); 352int drm_dp_bw_code_to_link_rate(u8 link_bw);
351 353
354struct edp_sdp_header {
355 u8 HB0; /* Secondary Data Packet ID */
356 u8 HB1; /* Secondary Data Packet Type */
357 u8 HB2; /* 7:5 reserved, 4:0 revision number */
358 u8 HB3; /* 7:5 reserved, 4:0 number of valid data bytes */
359} __packed;
360
361#define EDP_SDP_HEADER_REVISION_MASK 0x1F
362#define EDP_SDP_HEADER_VALID_PAYLOAD_BYTES 0x1F
363
364struct edp_vsc_psr {
365 struct edp_sdp_header sdp_header;
366 u8 DB0; /* Stereo Interface */
367 u8 DB1; /* 0 - PSR State; 1 - Update RFB; 2 - CRC Valid */
368 u8 DB2; /* CRC value bits 7:0 of the R or Cr component */
369 u8 DB3; /* CRC value bits 15:8 of the R or Cr component */
370 u8 DB4; /* CRC value bits 7:0 of the G or Y component */
371 u8 DB5; /* CRC value bits 15:8 of the G or Y component */
372 u8 DB6; /* CRC value bits 7:0 of the B or Cb component */
373 u8 DB7; /* CRC value bits 15:8 of the B or Cb component */
374 u8 DB8_31[24]; /* Reserved */
375} __packed;
376
377#define EDP_VSC_PSR_STATE_ACTIVE (1<<0)
378#define EDP_VSC_PSR_UPDATE_RFB (1<<1)
379#define EDP_VSC_PSR_CRC_VALUES_VALID (1<<2)
380
352static inline int 381static inline int
353drm_dp_max_link_rate(u8 dpcd[DP_RECEIVER_CAP_SIZE]) 382drm_dp_max_link_rate(u8 dpcd[DP_RECEIVER_CAP_SIZE])
354{ 383{
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index fc481fc17085..a1441c5ac63d 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -256,9 +256,11 @@ struct drm_encoder;
256struct drm_connector; 256struct drm_connector;
257struct drm_display_mode; 257struct drm_display_mode;
258struct hdmi_avi_infoframe; 258struct hdmi_avi_infoframe;
259struct hdmi_vendor_infoframe;
259 260
260void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid); 261void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid);
261int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads); 262int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads);
263int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb);
262int drm_av_sync_delay(struct drm_connector *connector, 264int drm_av_sync_delay(struct drm_connector *connector,
263 struct drm_display_mode *mode); 265 struct drm_display_mode *mode);
264struct drm_connector *drm_select_eld(struct drm_encoder *encoder, 266struct drm_connector *drm_select_eld(struct drm_encoder *encoder,
@@ -268,5 +270,8 @@ int drm_load_edid_firmware(struct drm_connector *connector);
268int 270int
269drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, 271drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
270 const struct drm_display_mode *mode); 272 const struct drm_display_mode *mode);
273int
274drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
275 const struct drm_display_mode *mode);
271 276
272#endif /* __DRM_EDID_H__ */ 277#endif /* __DRM_EDID_H__ */
diff --git a/include/drm/drm_fb_cma_helper.h b/include/drm/drm_fb_cma_helper.h
index 4a3fc244301c..c54cf3d4a03f 100644
--- a/include/drm/drm_fb_cma_helper.h
+++ b/include/drm/drm_fb_cma_helper.h
@@ -24,7 +24,6 @@ struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
24 unsigned int plane); 24 unsigned int plane);
25 25
26#ifdef CONFIG_DEBUG_FS 26#ifdef CONFIG_DEBUG_FS
27void drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m);
28int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg); 27int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg);
29#endif 28#endif
30 29
diff --git a/include/drm/drm_flip_work.h b/include/drm/drm_flip_work.h
new file mode 100644
index 000000000000..35c776ae7d3b
--- /dev/null
+++ b/include/drm/drm_flip_work.h
@@ -0,0 +1,76 @@
1/*
2 * Copyright (C) 2013 Red Hat
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 */
23
24#ifndef DRM_FLIP_WORK_H
25#define DRM_FLIP_WORK_H
26
27#include <linux/kfifo.h>
28#include <linux/workqueue.h>
29
30/**
31 * DOC: flip utils
32 *
33 * Util to queue up work to run from work-queue context after flip/vblank.
34 * Typically this can be used to defer unref of framebuffer's, cursor
35 * bo's, etc until after vblank. The APIs are all safe (and lockless)
36 * for up to one producer and once consumer at a time. The single-consumer
37 * aspect is ensured by committing the queued work to a single work-queue.
38 */
39
40struct drm_flip_work;
41
42/*
43 * drm_flip_func_t - callback function
44 *
45 * @work: the flip work
46 * @val: value queued via drm_flip_work_queue()
47 *
48 * Callback function to be called for each of the queue'd work items after
49 * drm_flip_work_commit() is called.
50 */
51typedef void (*drm_flip_func_t)(struct drm_flip_work *work, void *val);
52
53/**
54 * struct drm_flip_work - flip work queue
55 * @name: debug name
56 * @pending: number of queued but not committed items
57 * @count: number of committed items
58 * @func: callback fxn called for each committed item
59 * @worker: worker which calls @func
60 */
61struct drm_flip_work {
62 const char *name;
63 atomic_t pending, count;
64 drm_flip_func_t func;
65 struct work_struct worker;
66 DECLARE_KFIFO_PTR(fifo, void *);
67};
68
69void drm_flip_work_queue(struct drm_flip_work *work, void *val);
70void drm_flip_work_commit(struct drm_flip_work *work,
71 struct workqueue_struct *wq);
72int drm_flip_work_init(struct drm_flip_work *work, int size,
73 const char *name, drm_flip_func_t func);
74void drm_flip_work_cleanup(struct drm_flip_work *work);
75
76#endif /* DRM_FLIP_WORK_H */
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h
index c34f27f80bcc..89b4d7db1ebd 100644
--- a/include/drm/drm_gem_cma_helper.h
+++ b/include/drm/drm_gem_cma_helper.h
@@ -30,14 +30,6 @@ int drm_gem_cma_dumb_map_offset(struct drm_file *file_priv,
30/* set vm_flags and we can change the vm attribute to other one at here. */ 30/* set vm_flags and we can change the vm attribute to other one at here. */
31int drm_gem_cma_mmap(struct file *filp, struct vm_area_struct *vma); 31int drm_gem_cma_mmap(struct file *filp, struct vm_area_struct *vma);
32 32
33/*
34 * destroy memory region allocated.
35 * - a gem handle and physical memory region pointed by a gem object
36 * would be released by drm_gem_handle_delete().
37 */
38int drm_gem_cma_dumb_destroy(struct drm_file *file_priv,
39 struct drm_device *drm, unsigned int handle);
40
41/* allocate physical memory. */ 33/* allocate physical memory. */
42struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm, 34struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm,
43 unsigned int size); 35 unsigned int size);
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index 4d06edb56d5f..cba67865d18f 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -36,11 +36,19 @@
36/* 36/*
37 * Generic range manager structs 37 * Generic range manager structs
38 */ 38 */
39#include <linux/bug.h>
40#include <linux/kernel.h>
39#include <linux/list.h> 41#include <linux/list.h>
42#include <linux/spinlock.h>
40#ifdef CONFIG_DEBUG_FS 43#ifdef CONFIG_DEBUG_FS
41#include <linux/seq_file.h> 44#include <linux/seq_file.h>
42#endif 45#endif
43 46
47enum drm_mm_search_flags {
48 DRM_MM_SEARCH_DEFAULT = 0,
49 DRM_MM_SEARCH_BEST = 1 << 0,
50};
51
44struct drm_mm_node { 52struct drm_mm_node {
45 struct list_head node_list; 53 struct list_head node_list;
46 struct list_head hole_stack; 54 struct list_head hole_stack;
@@ -62,9 +70,6 @@ struct drm_mm {
62 /* head_node.node_list is the list of all memory nodes, ordered 70 /* head_node.node_list is the list of all memory nodes, ordered
63 * according to the (increasing) start address of the memory node. */ 71 * according to the (increasing) start address of the memory node. */
64 struct drm_mm_node head_node; 72 struct drm_mm_node head_node;
65 struct list_head unused_nodes;
66 int num_unused;
67 spinlock_t unused_lock;
68 unsigned int scan_check_range : 1; 73 unsigned int scan_check_range : 1;
69 unsigned scan_alignment; 74 unsigned scan_alignment;
70 unsigned long scan_color; 75 unsigned long scan_color;
@@ -115,13 +120,6 @@ static inline unsigned long drm_mm_hole_node_end(struct drm_mm_node *hole_node)
115#define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \ 120#define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \
116 &(mm)->head_node.node_list, \ 121 &(mm)->head_node.node_list, \
117 node_list) 122 node_list)
118#define drm_mm_for_each_scanned_node_reverse(entry, n, mm) \
119 for (entry = (mm)->prev_scanned_node, \
120 next = entry ? list_entry(entry->node_list.next, \
121 struct drm_mm_node, node_list) : NULL; \
122 entry != NULL; entry = next, \
123 next = entry ? list_entry(entry->node_list.next, \
124 struct drm_mm_node, node_list) : NULL) \
125 123
126/* Note that we need to unroll list_for_each_entry in order to inline 124/* Note that we need to unroll list_for_each_entry in order to inline
127 * setting hole_start and hole_end on each iteration and keep the 125 * setting hole_start and hole_end on each iteration and keep the
@@ -138,124 +136,50 @@ static inline unsigned long drm_mm_hole_node_end(struct drm_mm_node *hole_node)
138/* 136/*
139 * Basic range manager support (drm_mm.c) 137 * Basic range manager support (drm_mm.c)
140 */ 138 */
141extern struct drm_mm_node *drm_mm_create_block(struct drm_mm *mm, 139extern int drm_mm_reserve_node(struct drm_mm *mm, struct drm_mm_node *node);
142 unsigned long start,
143 unsigned long size,
144 bool atomic);
145extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node,
146 unsigned long size,
147 unsigned alignment,
148 unsigned long color,
149 int atomic);
150extern struct drm_mm_node *drm_mm_get_block_range_generic(
151 struct drm_mm_node *node,
152 unsigned long size,
153 unsigned alignment,
154 unsigned long color,
155 unsigned long start,
156 unsigned long end,
157 int atomic);
158static inline struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent,
159 unsigned long size,
160 unsigned alignment)
161{
162 return drm_mm_get_block_generic(parent, size, alignment, 0, 0);
163}
164static inline struct drm_mm_node *drm_mm_get_block_atomic(struct drm_mm_node *parent,
165 unsigned long size,
166 unsigned alignment)
167{
168 return drm_mm_get_block_generic(parent, size, alignment, 0, 1);
169}
170static inline struct drm_mm_node *drm_mm_get_block_range(
171 struct drm_mm_node *parent,
172 unsigned long size,
173 unsigned alignment,
174 unsigned long start,
175 unsigned long end)
176{
177 return drm_mm_get_block_range_generic(parent, size, alignment, 0,
178 start, end, 0);
179}
180static inline struct drm_mm_node *drm_mm_get_block_atomic_range(
181 struct drm_mm_node *parent,
182 unsigned long size,
183 unsigned alignment,
184 unsigned long start,
185 unsigned long end)
186{
187 return drm_mm_get_block_range_generic(parent, size, alignment, 0,
188 start, end, 1);
189}
190 140
191extern int drm_mm_insert_node(struct drm_mm *mm,
192 struct drm_mm_node *node,
193 unsigned long size,
194 unsigned alignment);
195extern int drm_mm_insert_node_in_range(struct drm_mm *mm,
196 struct drm_mm_node *node,
197 unsigned long size,
198 unsigned alignment,
199 unsigned long start,
200 unsigned long end);
201extern int drm_mm_insert_node_generic(struct drm_mm *mm, 141extern int drm_mm_insert_node_generic(struct drm_mm *mm,
202 struct drm_mm_node *node, 142 struct drm_mm_node *node,
203 unsigned long size, 143 unsigned long size,
204 unsigned alignment, 144 unsigned alignment,
205 unsigned long color); 145 unsigned long color,
146 enum drm_mm_search_flags flags);
147static inline int drm_mm_insert_node(struct drm_mm *mm,
148 struct drm_mm_node *node,
149 unsigned long size,
150 unsigned alignment,
151 enum drm_mm_search_flags flags)
152{
153 return drm_mm_insert_node_generic(mm, node, size, alignment, 0, flags);
154}
155
206extern int drm_mm_insert_node_in_range_generic(struct drm_mm *mm, 156extern int drm_mm_insert_node_in_range_generic(struct drm_mm *mm,
207 struct drm_mm_node *node, 157 struct drm_mm_node *node,
208 unsigned long size, 158 unsigned long size,
209 unsigned alignment, 159 unsigned alignment,
210 unsigned long color, 160 unsigned long color,
211 unsigned long start, 161 unsigned long start,
212 unsigned long end); 162 unsigned long end,
213extern void drm_mm_put_block(struct drm_mm_node *cur); 163 enum drm_mm_search_flags flags);
214extern void drm_mm_remove_node(struct drm_mm_node *node); 164static inline int drm_mm_insert_node_in_range(struct drm_mm *mm,
215extern void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new); 165 struct drm_mm_node *node,
216extern struct drm_mm_node *drm_mm_search_free_generic(const struct drm_mm *mm, 166 unsigned long size,
217 unsigned long size, 167 unsigned alignment,
218 unsigned alignment, 168 unsigned long start,
219 unsigned long color, 169 unsigned long end,
220 bool best_match); 170 enum drm_mm_search_flags flags)
221extern struct drm_mm_node *drm_mm_search_free_in_range_generic(
222 const struct drm_mm *mm,
223 unsigned long size,
224 unsigned alignment,
225 unsigned long color,
226 unsigned long start,
227 unsigned long end,
228 bool best_match);
229static inline struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm,
230 unsigned long size,
231 unsigned alignment,
232 bool best_match)
233{ 171{
234 return drm_mm_search_free_generic(mm,size, alignment, 0, best_match); 172 return drm_mm_insert_node_in_range_generic(mm, node, size, alignment,
235} 173 0, start, end, flags);
236static inline struct drm_mm_node *drm_mm_search_free_in_range(
237 const struct drm_mm *mm,
238 unsigned long size,
239 unsigned alignment,
240 unsigned long start,
241 unsigned long end,
242 bool best_match)
243{
244 return drm_mm_search_free_in_range_generic(mm, size, alignment, 0,
245 start, end, best_match);
246} 174}
247 175
176extern void drm_mm_remove_node(struct drm_mm_node *node);
177extern void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new);
248extern void drm_mm_init(struct drm_mm *mm, 178extern void drm_mm_init(struct drm_mm *mm,
249 unsigned long start, 179 unsigned long start,
250 unsigned long size); 180 unsigned long size);
251extern void drm_mm_takedown(struct drm_mm *mm); 181extern void drm_mm_takedown(struct drm_mm *mm);
252extern int drm_mm_clean(struct drm_mm *mm); 182extern int drm_mm_clean(struct drm_mm *mm);
253extern int drm_mm_pre_get(struct drm_mm *mm);
254
255static inline struct drm_mm *drm_get_mm(struct drm_mm_node *block)
256{
257 return block->mm;
258}
259 183
260void drm_mm_init_scan(struct drm_mm *mm, 184void drm_mm_init_scan(struct drm_mm *mm,
261 unsigned long size, 185 unsigned long size,
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 34efaf64cc87..3d79e513c0b3 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -1,4 +1,25 @@
1#define radeon_PCI_IDS \ 1#define radeon_PCI_IDS \
2 {0x1002, 0x1304, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
3 {0x1002, 0x1305, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
4 {0x1002, 0x1306, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
5 {0x1002, 0x1307, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
6 {0x1002, 0x1309, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
7 {0x1002, 0x130A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
8 {0x1002, 0x130B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
9 {0x1002, 0x130C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
10 {0x1002, 0x130D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
11 {0x1002, 0x130E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
12 {0x1002, 0x130F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
13 {0x1002, 0x1310, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
14 {0x1002, 0x1311, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
15 {0x1002, 0x1312, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
16 {0x1002, 0x1313, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
17 {0x1002, 0x1315, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
18 {0x1002, 0x1316, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
19 {0x1002, 0x1317, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
20 {0x1002, 0x131B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
21 {0x1002, 0x131C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
22 {0x1002, 0x131D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
2 {0x1002, 0x3150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ 23 {0x1002, 0x3150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
3 {0x1002, 0x3151, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 24 {0x1002, 0x3151, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
4 {0x1002, 0x3152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 25 {0x1002, 0x3152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
@@ -690,29 +711,6 @@
690 {0x102b, 0x2527, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MGA_CARD_TYPE_G550}, \ 711 {0x102b, 0x2527, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MGA_CARD_TYPE_G550}, \
691 {0, 0, 0} 712 {0, 0, 0}
692 713
693#define mach64_PCI_IDS \
694 {0x1002, 0x4749, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
695 {0x1002, 0x4750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
696 {0x1002, 0x4751, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
697 {0x1002, 0x4742, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
698 {0x1002, 0x4744, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
699 {0x1002, 0x4c49, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
700 {0x1002, 0x4c50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
701 {0x1002, 0x4c51, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
702 {0x1002, 0x4c42, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
703 {0x1002, 0x4c44, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
704 {0x1002, 0x474c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
705 {0x1002, 0x474f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
706 {0x1002, 0x4752, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
707 {0x1002, 0x4753, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
708 {0x1002, 0x474d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
709 {0x1002, 0x474e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
710 {0x1002, 0x4c52, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
711 {0x1002, 0x4c53, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
712 {0x1002, 0x4c4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
713 {0x1002, 0x4c4e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
714 {0, 0, 0}
715
716#define sisdrv_PCI_IDS \ 714#define sisdrv_PCI_IDS \
717 {0x1039, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 715 {0x1039, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
718 {0x1039, 0x5300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 716 {0x1039, 0x5300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
@@ -752,10 +750,6 @@
752 {0x8086, 0x1132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 750 {0x8086, 0x1132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
753 {0, 0, 0} 751 {0, 0, 0}
754 752
755#define gamma_PCI_IDS \
756 {0x3d3d, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
757 {0, 0, 0}
758
759#define savage_PCI_IDS \ 753#define savage_PCI_IDS \
760 {0x5333, 0x8a20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_SAVAGE3D}, \ 754 {0x5333, 0x8a20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_SAVAGE3D}, \
761 {0x5333, 0x8a21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_SAVAGE3D}, \ 755 {0x5333, 0x8a21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_SAVAGE3D}, \
@@ -781,6 +775,3 @@
781 {0x5333, 0x8d03, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_PROSAVAGEDDR}, \ 775 {0x5333, 0x8d03, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_PROSAVAGEDDR}, \
782 {0x5333, 0x8d04, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_PROSAVAGEDDR}, \ 776 {0x5333, 0x8d04, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_PROSAVAGEDDR}, \
783 {0, 0, 0} 777 {0, 0, 0}
784
785#define ffb_PCI_IDS \
786 {0, 0, 0}
diff --git a/include/drm/drm_vma_manager.h b/include/drm/drm_vma_manager.h
new file mode 100644
index 000000000000..c18a593d1744
--- /dev/null
+++ b/include/drm/drm_vma_manager.h
@@ -0,0 +1,257 @@
1#ifndef __DRM_VMA_MANAGER_H__
2#define __DRM_VMA_MANAGER_H__
3
4/*
5 * Copyright (c) 2013 David Herrmann <dh.herrmann@gmail.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26#include <drm/drm_mm.h>
27#include <linux/fs.h>
28#include <linux/mm.h>
29#include <linux/module.h>
30#include <linux/rbtree.h>
31#include <linux/spinlock.h>
32#include <linux/types.h>
33
34struct drm_vma_offset_file {
35 struct rb_node vm_rb;
36 struct file *vm_filp;
37 unsigned long vm_count;
38};
39
40struct drm_vma_offset_node {
41 rwlock_t vm_lock;
42 struct drm_mm_node vm_node;
43 struct rb_node vm_rb;
44 struct rb_root vm_files;
45};
46
47struct drm_vma_offset_manager {
48 rwlock_t vm_lock;
49 struct rb_root vm_addr_space_rb;
50 struct drm_mm vm_addr_space_mm;
51};
52
53void drm_vma_offset_manager_init(struct drm_vma_offset_manager *mgr,
54 unsigned long page_offset, unsigned long size);
55void drm_vma_offset_manager_destroy(struct drm_vma_offset_manager *mgr);
56
57struct drm_vma_offset_node *drm_vma_offset_lookup(struct drm_vma_offset_manager *mgr,
58 unsigned long start,
59 unsigned long pages);
60struct drm_vma_offset_node *drm_vma_offset_lookup_locked(struct drm_vma_offset_manager *mgr,
61 unsigned long start,
62 unsigned long pages);
63int drm_vma_offset_add(struct drm_vma_offset_manager *mgr,
64 struct drm_vma_offset_node *node, unsigned long pages);
65void drm_vma_offset_remove(struct drm_vma_offset_manager *mgr,
66 struct drm_vma_offset_node *node);
67
68int drm_vma_node_allow(struct drm_vma_offset_node *node, struct file *filp);
69void drm_vma_node_revoke(struct drm_vma_offset_node *node, struct file *filp);
70bool drm_vma_node_is_allowed(struct drm_vma_offset_node *node,
71 struct file *filp);
72
73/**
74 * drm_vma_offset_exact_lookup() - Look up node by exact address
75 * @mgr: Manager object
76 * @start: Start address (page-based, not byte-based)
77 * @pages: Size of object (page-based)
78 *
79 * Same as drm_vma_offset_lookup() but does not allow any offset into the node.
80 * It only returns the exact object with the given start address.
81 *
82 * RETURNS:
83 * Node at exact start address @start.
84 */
85static inline struct drm_vma_offset_node *
86drm_vma_offset_exact_lookup(struct drm_vma_offset_manager *mgr,
87 unsigned long start,
88 unsigned long pages)
89{
90 struct drm_vma_offset_node *node;
91
92 node = drm_vma_offset_lookup(mgr, start, pages);
93 return (node && node->vm_node.start == start) ? node : NULL;
94}
95
96/**
97 * drm_vma_offset_lock_lookup() - Lock lookup for extended private use
98 * @mgr: Manager object
99 *
100 * Lock VMA manager for extended lookups. Only *_locked() VMA function calls
101 * are allowed while holding this lock. All other contexts are blocked from VMA
102 * until the lock is released via drm_vma_offset_unlock_lookup().
103 *
104 * Use this if you need to take a reference to the objects returned by
105 * drm_vma_offset_lookup_locked() before releasing this lock again.
106 *
107 * This lock must not be used for anything else than extended lookups. You must
108 * not call any other VMA helpers while holding this lock.
109 *
110 * Note: You're in atomic-context while holding this lock!
111 *
112 * Example:
113 * drm_vma_offset_lock_lookup(mgr);
114 * node = drm_vma_offset_lookup_locked(mgr);
115 * if (node)
116 * kref_get_unless_zero(container_of(node, sth, entr));
117 * drm_vma_offset_unlock_lookup(mgr);
118 */
119static inline void drm_vma_offset_lock_lookup(struct drm_vma_offset_manager *mgr)
120{
121 read_lock(&mgr->vm_lock);
122}
123
124/**
125 * drm_vma_offset_unlock_lookup() - Unlock lookup for extended private use
126 * @mgr: Manager object
127 *
128 * Release lookup-lock. See drm_vma_offset_lock_lookup() for more information.
129 */
130static inline void drm_vma_offset_unlock_lookup(struct drm_vma_offset_manager *mgr)
131{
132 read_unlock(&mgr->vm_lock);
133}
134
135/**
136 * drm_vma_node_reset() - Initialize or reset node object
137 * @node: Node to initialize or reset
138 *
139 * Reset a node to its initial state. This must be called before using it with
140 * any VMA offset manager.
141 *
142 * This must not be called on an already allocated node, or you will leak
143 * memory.
144 */
145static inline void drm_vma_node_reset(struct drm_vma_offset_node *node)
146{
147 memset(node, 0, sizeof(*node));
148 node->vm_files = RB_ROOT;
149 rwlock_init(&node->vm_lock);
150}
151
152/**
153 * drm_vma_node_start() - Return start address for page-based addressing
154 * @node: Node to inspect
155 *
156 * Return the start address of the given node. This can be used as offset into
157 * the linear VM space that is provided by the VMA offset manager. Note that
158 * this can only be used for page-based addressing. If you need a proper offset
159 * for user-space mappings, you must apply "<< PAGE_SHIFT" or use the
160 * drm_vma_node_offset_addr() helper instead.
161 *
162 * RETURNS:
163 * Start address of @node for page-based addressing. 0 if the node does not
164 * have an offset allocated.
165 */
166static inline unsigned long drm_vma_node_start(struct drm_vma_offset_node *node)
167{
168 return node->vm_node.start;
169}
170
171/**
172 * drm_vma_node_size() - Return size (page-based)
173 * @node: Node to inspect
174 *
175 * Return the size as number of pages for the given node. This is the same size
176 * that was passed to drm_vma_offset_add(). If no offset is allocated for the
177 * node, this is 0.
178 *
179 * RETURNS:
180 * Size of @node as number of pages. 0 if the node does not have an offset
181 * allocated.
182 */
183static inline unsigned long drm_vma_node_size(struct drm_vma_offset_node *node)
184{
185 return node->vm_node.size;
186}
187
188/**
189 * drm_vma_node_has_offset() - Check whether node is added to offset manager
190 * @node: Node to be checked
191 *
192 * RETURNS:
193 * true iff the node was previously allocated an offset and added to
194 * an vma offset manager.
195 */
196static inline bool drm_vma_node_has_offset(struct drm_vma_offset_node *node)
197{
198 return drm_mm_node_allocated(&node->vm_node);
199}
200
201/**
202 * drm_vma_node_offset_addr() - Return sanitized offset for user-space mmaps
203 * @node: Linked offset node
204 *
205 * Same as drm_vma_node_start() but returns the address as a valid offset that
206 * can be used for user-space mappings during mmap().
207 * This must not be called on unlinked nodes.
208 *
209 * RETURNS:
210 * Offset of @node for byte-based addressing. 0 if the node does not have an
211 * object allocated.
212 */
213static inline __u64 drm_vma_node_offset_addr(struct drm_vma_offset_node *node)
214{
215 return ((__u64)node->vm_node.start) << PAGE_SHIFT;
216}
217
218/**
219 * drm_vma_node_unmap() - Unmap offset node
220 * @node: Offset node
221 * @file_mapping: Address space to unmap @node from
222 *
223 * Unmap all userspace mappings for a given offset node. The mappings must be
224 * associated with the @file_mapping address-space. If no offset exists or
225 * the address-space is invalid, nothing is done.
226 *
227 * This call is unlocked. The caller must guarantee that drm_vma_offset_remove()
228 * is not called on this node concurrently.
229 */
230static inline void drm_vma_node_unmap(struct drm_vma_offset_node *node,
231 struct address_space *file_mapping)
232{
233 if (file_mapping && drm_vma_node_has_offset(node))
234 unmap_mapping_range(file_mapping,
235 drm_vma_node_offset_addr(node),
236 drm_vma_node_size(node) << PAGE_SHIFT, 1);
237}
238
239/**
240 * drm_vma_node_verify_access() - Access verification helper for TTM
241 * @node: Offset node
242 * @filp: Open-file
243 *
244 * This checks whether @filp is granted access to @node. It is the same as
245 * drm_vma_node_is_allowed() but suitable as drop-in helper for TTM
246 * verify_access() callbacks.
247 *
248 * RETURNS:
249 * 0 if access is granted, -EACCES otherwise.
250 */
251static inline int drm_vma_node_verify_access(struct drm_vma_offset_node *node,
252 struct file *filp)
253{
254 return drm_vma_node_is_allowed(node, filp) ? 0 : -EACCES;
255}
256
257#endif /* __DRM_VMA_MANAGER_H__ */
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
index d6aeaf3c6d6c..cb65fa14acfc 100644
--- a/include/drm/exynos_drm.h
+++ b/include/drm/exynos_drm.h
@@ -15,6 +15,7 @@
15#define _EXYNOS_DRM_H_ 15#define _EXYNOS_DRM_H_
16 16
17#include <uapi/drm/exynos_drm.h> 17#include <uapi/drm/exynos_drm.h>
18#include <video/videomode.h>
18 19
19/** 20/**
20 * A structure for lcd panel information. 21 * A structure for lcd panel information.
@@ -24,7 +25,7 @@
24 * @height_mm: physical size of lcd height. 25 * @height_mm: physical size of lcd height.
25 */ 26 */
26struct exynos_drm_panel_info { 27struct exynos_drm_panel_info {
27 struct fb_videomode timing; 28 struct videomode vm;
28 u32 width_mm; 29 u32 width_mm;
29 u32 height_mm; 30 u32 height_mm;
30}; 31};
diff --git a/include/drm/i2c/tda998x.h b/include/drm/i2c/tda998x.h
new file mode 100644
index 000000000000..3e419d92cf5a
--- /dev/null
+++ b/include/drm/i2c/tda998x.h
@@ -0,0 +1,30 @@
1#ifndef __DRM_I2C_TDA998X_H__
2#define __DRM_I2C_TDA998X_H__
3
4struct tda998x_encoder_params {
5 u8 swap_b:3;
6 u8 mirr_b:1;
7 u8 swap_a:3;
8 u8 mirr_a:1;
9 u8 swap_d:3;
10 u8 mirr_d:1;
11 u8 swap_c:3;
12 u8 mirr_c:1;
13 u8 swap_f:3;
14 u8 mirr_f:1;
15 u8 swap_e:3;
16 u8 mirr_e:1;
17
18 u8 audio_cfg;
19 u8 audio_clk_cfg;
20 u8 audio_frame[6];
21
22 enum {
23 AFMT_SPDIF,
24 AFMT_I2S
25 } audio_format;
26
27 unsigned audio_sample_rate;
28};
29
30#endif
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 63d609d8a3f6..3abfa6ea226e 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -26,6 +26,7 @@
26#ifndef _I915_DRM_H_ 26#ifndef _I915_DRM_H_
27#define _I915_DRM_H_ 27#define _I915_DRM_H_
28 28
29#include <drm/i915_pciids.h>
29#include <uapi/drm/i915_drm.h> 30#include <uapi/drm/i915_drm.h>
30 31
31/* For use by IPS driver */ 32/* For use by IPS driver */
@@ -34,4 +35,37 @@ extern bool i915_gpu_raise(void);
34extern bool i915_gpu_lower(void); 35extern bool i915_gpu_lower(void);
35extern bool i915_gpu_busy(void); 36extern bool i915_gpu_busy(void);
36extern bool i915_gpu_turbo_disable(void); 37extern bool i915_gpu_turbo_disable(void);
38
39/*
40 * The Bridge device's PCI config space has information about the
41 * fb aperture size and the amount of pre-reserved memory.
42 * This is all handled in the intel-gtt.ko module. i915.ko only
43 * cares about the vga bit for the vga rbiter.
44 */
45#define INTEL_GMCH_CTRL 0x52
46#define INTEL_GMCH_VGA_DISABLE (1 << 1)
47#define SNB_GMCH_CTRL 0x50
48#define SNB_GMCH_GGMS_SHIFT 8 /* GTT Graphics Memory Size */
49#define SNB_GMCH_GGMS_MASK 0x3
50#define SNB_GMCH_GMS_SHIFT 3 /* Graphics Mode Select */
51#define SNB_GMCH_GMS_MASK 0x1f
52
53#define I830_GMCH_CTRL 0x52
54
55#define I855_GMCH_GMS_MASK 0xF0
56#define I855_GMCH_GMS_STOLEN_0M 0x0
57#define I855_GMCH_GMS_STOLEN_1M (0x1 << 4)
58#define I855_GMCH_GMS_STOLEN_4M (0x2 << 4)
59#define I855_GMCH_GMS_STOLEN_8M (0x3 << 4)
60#define I855_GMCH_GMS_STOLEN_16M (0x4 << 4)
61#define I855_GMCH_GMS_STOLEN_32M (0x5 << 4)
62#define I915_GMCH_GMS_STOLEN_48M (0x6 << 4)
63#define I915_GMCH_GMS_STOLEN_64M (0x7 << 4)
64#define G33_GMCH_GMS_STOLEN_128M (0x8 << 4)
65#define G33_GMCH_GMS_STOLEN_256M (0x9 << 4)
66#define INTEL_GMCH_GMS_STOLEN_96M (0xa << 4)
67#define INTEL_GMCH_GMS_STOLEN_160M (0xb << 4)
68#define INTEL_GMCH_GMS_STOLEN_224M (0xc << 4)
69#define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4)
70
37#endif /* _I915_DRM_H_ */ 71#endif /* _I915_DRM_H_ */
diff --git a/include/drm/i915_pciids.h b/include/drm/i915_pciids.h
new file mode 100644
index 000000000000..8a10f5c354e6
--- /dev/null
+++ b/include/drm/i915_pciids.h
@@ -0,0 +1,211 @@
1/*
2 * Copyright 2013 Intel Corporation
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
24 */
25#ifndef _I915_PCIIDS_H
26#define _I915_PCIIDS_H
27
28/*
29 * A pci_device_id struct {
30 * __u32 vendor, device;
31 * __u32 subvendor, subdevice;
32 * __u32 class, class_mask;
33 * kernel_ulong_t driver_data;
34 * };
35 * Don't use C99 here because "class" is reserved and we want to
36 * give userspace flexibility.
37 */
38#define INTEL_VGA_DEVICE(id, info) { \
39 0x8086, id, \
40 ~0, ~0, \
41 0x030000, 0xff0000, \
42 (unsigned long) info }
43
44#define INTEL_QUANTA_VGA_DEVICE(info) { \
45 0x8086, 0x16a, \
46 0x152d, 0x8990, \
47 0x030000, 0xff0000, \
48 (unsigned long) info }
49
50#define INTEL_I830_IDS(info) \
51 INTEL_VGA_DEVICE(0x3577, info)
52
53#define INTEL_I845G_IDS(info) \
54 INTEL_VGA_DEVICE(0x2562, info)
55
56#define INTEL_I85X_IDS(info) \
57 INTEL_VGA_DEVICE(0x3582, info), /* I855_GM */ \
58 INTEL_VGA_DEVICE(0x358e, info)
59
60#define INTEL_I865G_IDS(info) \
61 INTEL_VGA_DEVICE(0x2572, info) /* I865_G */
62
63#define INTEL_I915G_IDS(info) \
64 INTEL_VGA_DEVICE(0x2582, info), /* I915_G */ \
65 INTEL_VGA_DEVICE(0x258a, info) /* E7221_G */
66
67#define INTEL_I915GM_IDS(info) \
68 INTEL_VGA_DEVICE(0x2592, info) /* I915_GM */
69
70#define INTEL_I945G_IDS(info) \
71 INTEL_VGA_DEVICE(0x2772, info) /* I945_G */
72
73#define INTEL_I945GM_IDS(info) \
74 INTEL_VGA_DEVICE(0x27a2, info), /* I945_GM */ \
75 INTEL_VGA_DEVICE(0x27ae, info) /* I945_GME */
76
77#define INTEL_I965G_IDS(info) \
78 INTEL_VGA_DEVICE(0x2972, info), /* I946_GZ */ \
79 INTEL_VGA_DEVICE(0x2982, info), /* G35_G */ \
80 INTEL_VGA_DEVICE(0x2992, info), /* I965_Q */ \
81 INTEL_VGA_DEVICE(0x29a2, info) /* I965_G */
82
83#define INTEL_G33_IDS(info) \
84 INTEL_VGA_DEVICE(0x29b2, info), /* Q35_G */ \
85 INTEL_VGA_DEVICE(0x29c2, info), /* G33_G */ \
86 INTEL_VGA_DEVICE(0x29d2, info) /* Q33_G */
87
88#define INTEL_I965GM_IDS(info) \
89 INTEL_VGA_DEVICE(0x2a02, info), /* I965_GM */ \
90 INTEL_VGA_DEVICE(0x2a12, info) /* I965_GME */
91
92#define INTEL_GM45_IDS(info) \
93 INTEL_VGA_DEVICE(0x2a42, info) /* GM45_G */
94
95#define INTEL_G45_IDS(info) \
96 INTEL_VGA_DEVICE(0x2e02, info), /* IGD_E_G */ \
97 INTEL_VGA_DEVICE(0x2e12, info), /* Q45_G */ \
98 INTEL_VGA_DEVICE(0x2e22, info), /* G45_G */ \
99 INTEL_VGA_DEVICE(0x2e32, info), /* G41_G */ \
100 INTEL_VGA_DEVICE(0x2e42, info), /* B43_G */ \
101 INTEL_VGA_DEVICE(0x2e92, info) /* B43_G.1 */
102
103#define INTEL_PINEVIEW_IDS(info) \
104 INTEL_VGA_DEVICE(0xa001, info), \
105 INTEL_VGA_DEVICE(0xa011, info)
106
107#define INTEL_IRONLAKE_D_IDS(info) \
108 INTEL_VGA_DEVICE(0x0042, info)
109
110#define INTEL_IRONLAKE_M_IDS(info) \
111 INTEL_VGA_DEVICE(0x0046, info)
112
113#define INTEL_SNB_D_IDS(info) \
114 INTEL_VGA_DEVICE(0x0102, info), \
115 INTEL_VGA_DEVICE(0x0112, info), \
116 INTEL_VGA_DEVICE(0x0122, info), \
117 INTEL_VGA_DEVICE(0x010A, info)
118
119#define INTEL_SNB_M_IDS(info) \
120 INTEL_VGA_DEVICE(0x0106, info), \
121 INTEL_VGA_DEVICE(0x0116, info), \
122 INTEL_VGA_DEVICE(0x0126, info)
123
124#define INTEL_IVB_M_IDS(info) \
125 INTEL_VGA_DEVICE(0x0156, info), /* GT1 mobile */ \
126 INTEL_VGA_DEVICE(0x0166, info) /* GT2 mobile */
127
128#define INTEL_IVB_D_IDS(info) \
129 INTEL_VGA_DEVICE(0x0152, info), /* GT1 desktop */ \
130 INTEL_VGA_DEVICE(0x0162, info), /* GT2 desktop */ \
131 INTEL_VGA_DEVICE(0x015a, info), /* GT1 server */ \
132 INTEL_VGA_DEVICE(0x016a, info) /* GT2 server */
133
134#define INTEL_IVB_Q_IDS(info) \
135 INTEL_QUANTA_VGA_DEVICE(info) /* Quanta transcode */
136
137#define INTEL_HSW_D_IDS(info) \
138 INTEL_VGA_DEVICE(0x0402, info), /* GT1 desktop */ \
139 INTEL_VGA_DEVICE(0x0412, info), /* GT2 desktop */ \
140 INTEL_VGA_DEVICE(0x0422, info), /* GT3 desktop */ \
141 INTEL_VGA_DEVICE(0x040a, info), /* GT1 server */ \
142 INTEL_VGA_DEVICE(0x041a, info), /* GT2 server */ \
143 INTEL_VGA_DEVICE(0x042a, info), /* GT3 server */ \
144 INTEL_VGA_DEVICE(0x040B, info), /* GT1 reserved */ \
145 INTEL_VGA_DEVICE(0x041B, info), /* GT2 reserved */ \
146 INTEL_VGA_DEVICE(0x042B, info), /* GT3 reserved */ \
147 INTEL_VGA_DEVICE(0x040E, info), /* GT1 reserved */ \
148 INTEL_VGA_DEVICE(0x041E, info), /* GT2 reserved */ \
149 INTEL_VGA_DEVICE(0x042E, info), /* GT3 reserved */ \
150 INTEL_VGA_DEVICE(0x0C02, info), /* SDV GT1 desktop */ \
151 INTEL_VGA_DEVICE(0x0C12, info), /* SDV GT2 desktop */ \
152 INTEL_VGA_DEVICE(0x0C22, info), /* SDV GT3 desktop */ \
153 INTEL_VGA_DEVICE(0x0C0A, info), /* SDV GT1 server */ \
154 INTEL_VGA_DEVICE(0x0C1A, info), /* SDV GT2 server */ \
155 INTEL_VGA_DEVICE(0x0C2A, info), /* SDV GT3 server */ \
156 INTEL_VGA_DEVICE(0x0C0B, info), /* SDV GT1 reserved */ \
157 INTEL_VGA_DEVICE(0x0C1B, info), /* SDV GT2 reserved */ \
158 INTEL_VGA_DEVICE(0x0C2B, info), /* SDV GT3 reserved */ \
159 INTEL_VGA_DEVICE(0x0C0E, info), /* SDV GT1 reserved */ \
160 INTEL_VGA_DEVICE(0x0C1E, info), /* SDV GT2 reserved */ \
161 INTEL_VGA_DEVICE(0x0C2E, info), /* SDV GT3 reserved */ \
162 INTEL_VGA_DEVICE(0x0A02, info), /* ULT GT1 desktop */ \
163 INTEL_VGA_DEVICE(0x0A12, info), /* ULT GT2 desktop */ \
164 INTEL_VGA_DEVICE(0x0A22, info), /* ULT GT3 desktop */ \
165 INTEL_VGA_DEVICE(0x0A0A, info), /* ULT GT1 server */ \
166 INTEL_VGA_DEVICE(0x0A1A, info), /* ULT GT2 server */ \
167 INTEL_VGA_DEVICE(0x0A2A, info), /* ULT GT3 server */ \
168 INTEL_VGA_DEVICE(0x0A0B, info), /* ULT GT1 reserved */ \
169 INTEL_VGA_DEVICE(0x0A1B, info), /* ULT GT2 reserved */ \
170 INTEL_VGA_DEVICE(0x0A2B, info), /* ULT GT3 reserved */ \
171 INTEL_VGA_DEVICE(0x0D02, info), /* CRW GT1 desktop */ \
172 INTEL_VGA_DEVICE(0x0D12, info), /* CRW GT2 desktop */ \
173 INTEL_VGA_DEVICE(0x0D22, info), /* CRW GT3 desktop */ \
174 INTEL_VGA_DEVICE(0x0D0A, info), /* CRW GT1 server */ \
175 INTEL_VGA_DEVICE(0x0D1A, info), /* CRW GT2 server */ \
176 INTEL_VGA_DEVICE(0x0D2A, info), /* CRW GT3 server */ \
177 INTEL_VGA_DEVICE(0x0D0B, info), /* CRW GT1 reserved */ \
178 INTEL_VGA_DEVICE(0x0D1B, info), /* CRW GT2 reserved */ \
179 INTEL_VGA_DEVICE(0x0D2B, info), /* CRW GT3 reserved */ \
180 INTEL_VGA_DEVICE(0x0D0E, info), /* CRW GT1 reserved */ \
181 INTEL_VGA_DEVICE(0x0D1E, info), /* CRW GT2 reserved */ \
182 INTEL_VGA_DEVICE(0x0D2E, info) /* CRW GT3 reserved */ \
183
184#define INTEL_HSW_M_IDS(info) \
185 INTEL_VGA_DEVICE(0x0406, info), /* GT1 mobile */ \
186 INTEL_VGA_DEVICE(0x0416, info), /* GT2 mobile */ \
187 INTEL_VGA_DEVICE(0x0426, info), /* GT2 mobile */ \
188 INTEL_VGA_DEVICE(0x0C06, info), /* SDV GT1 mobile */ \
189 INTEL_VGA_DEVICE(0x0C16, info), /* SDV GT2 mobile */ \
190 INTEL_VGA_DEVICE(0x0C26, info), /* SDV GT3 mobile */ \
191 INTEL_VGA_DEVICE(0x0A06, info), /* ULT GT1 mobile */ \
192 INTEL_VGA_DEVICE(0x0A16, info), /* ULT GT2 mobile */ \
193 INTEL_VGA_DEVICE(0x0A26, info), /* ULT GT3 mobile */ \
194 INTEL_VGA_DEVICE(0x0A0E, info), /* ULT GT1 reserved */ \
195 INTEL_VGA_DEVICE(0x0A1E, info), /* ULT GT2 reserved */ \
196 INTEL_VGA_DEVICE(0x0A2E, info), /* ULT GT3 reserved */ \
197 INTEL_VGA_DEVICE(0x0D06, info), /* CRW GT1 mobile */ \
198 INTEL_VGA_DEVICE(0x0D16, info), /* CRW GT2 mobile */ \
199 INTEL_VGA_DEVICE(0x0D26, info) /* CRW GT3 mobile */
200
201#define INTEL_VLV_M_IDS(info) \
202 INTEL_VGA_DEVICE(0x0f30, info), \
203 INTEL_VGA_DEVICE(0x0f31, info), \
204 INTEL_VGA_DEVICE(0x0f32, info), \
205 INTEL_VGA_DEVICE(0x0f33, info), \
206 INTEL_VGA_DEVICE(0x0157, info)
207
208#define INTEL_VLV_D_IDS(info) \
209 INTEL_VGA_DEVICE(0x0155, info)
210
211#endif /* _I915_PCIIDS_H */
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 8a6aa56ece52..751eaffbf0d5 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -32,12 +32,12 @@
32#define _TTM_BO_API_H_ 32#define _TTM_BO_API_H_
33 33
34#include <drm/drm_hashtab.h> 34#include <drm/drm_hashtab.h>
35#include <drm/drm_vma_manager.h>
35#include <linux/kref.h> 36#include <linux/kref.h>
36#include <linux/list.h> 37#include <linux/list.h>
37#include <linux/wait.h> 38#include <linux/wait.h>
38#include <linux/mutex.h> 39#include <linux/mutex.h>
39#include <linux/mm.h> 40#include <linux/mm.h>
40#include <linux/rbtree.h>
41#include <linux/bitmap.h> 41#include <linux/bitmap.h>
42#include <linux/reservation.h> 42#include <linux/reservation.h>
43 43
@@ -145,7 +145,6 @@ struct ttm_tt;
145 * @type: The bo type. 145 * @type: The bo type.
146 * @destroy: Destruction function. If NULL, kfree is used. 146 * @destroy: Destruction function. If NULL, kfree is used.
147 * @num_pages: Actual number of pages. 147 * @num_pages: Actual number of pages.
148 * @addr_space_offset: Address space offset.
149 * @acc_size: Accounted size for this object. 148 * @acc_size: Accounted size for this object.
150 * @kref: Reference count of this buffer object. When this refcount reaches 149 * @kref: Reference count of this buffer object. When this refcount reaches
151 * zero, the object is put on the delayed delete list. 150 * zero, the object is put on the delayed delete list.
@@ -166,8 +165,7 @@ struct ttm_tt;
166 * @swap: List head for swap LRU list. 165 * @swap: List head for swap LRU list.
167 * @sync_obj: Pointer to a synchronization object. 166 * @sync_obj: Pointer to a synchronization object.
168 * @priv_flags: Flags describing buffer object internal state. 167 * @priv_flags: Flags describing buffer object internal state.
169 * @vm_rb: Rb node for the vm rb tree. 168 * @vma_node: Address space manager node.
170 * @vm_node: Address space manager node.
171 * @offset: The current GPU offset, which can have different meanings 169 * @offset: The current GPU offset, which can have different meanings
172 * depending on the memory type. For SYSTEM type memory, it should be 0. 170 * depending on the memory type. For SYSTEM type memory, it should be 0.
173 * @cur_placement: Hint of current placement. 171 * @cur_placement: Hint of current placement.
@@ -194,7 +192,6 @@ struct ttm_buffer_object {
194 enum ttm_bo_type type; 192 enum ttm_bo_type type;
195 void (*destroy) (struct ttm_buffer_object *); 193 void (*destroy) (struct ttm_buffer_object *);
196 unsigned long num_pages; 194 unsigned long num_pages;
197 uint64_t addr_space_offset;
198 size_t acc_size; 195 size_t acc_size;
199 196
200 /** 197 /**
@@ -238,13 +235,7 @@ struct ttm_buffer_object {
238 void *sync_obj; 235 void *sync_obj;
239 unsigned long priv_flags; 236 unsigned long priv_flags;
240 237
241 /** 238 struct drm_vma_offset_node vma_node;
242 * Members protected by the bdev::vm_lock
243 */
244
245 struct rb_node vm_rb;
246 struct drm_mm_node *vm_node;
247
248 239
249 /** 240 /**
250 * Special members that are protected by the reserve lock 241 * Special members that are protected by the reserve lock
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 984fc2d571a1..8639c85d61c4 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -36,6 +36,7 @@
36#include <ttm/ttm_placement.h> 36#include <ttm/ttm_placement.h>
37#include <drm/drm_mm.h> 37#include <drm/drm_mm.h>
38#include <drm/drm_global.h> 38#include <drm/drm_global.h>
39#include <drm/drm_vma_manager.h>
39#include <linux/workqueue.h> 40#include <linux/workqueue.h>
40#include <linux/fs.h> 41#include <linux/fs.h>
41#include <linux/spinlock.h> 42#include <linux/spinlock.h>
@@ -519,7 +520,7 @@ struct ttm_bo_global {
519 * @man: An array of mem_type_managers. 520 * @man: An array of mem_type_managers.
520 * @fence_lock: Protects the synchronizing members on *all* bos belonging 521 * @fence_lock: Protects the synchronizing members on *all* bos belonging
521 * to this device. 522 * to this device.
522 * @addr_space_mm: Range manager for the device address space. 523 * @vma_manager: Address space manager
523 * lru_lock: Spinlock that protects the buffer+device lru lists and 524 * lru_lock: Spinlock that protects the buffer+device lru lists and
524 * ddestroy lists. 525 * ddestroy lists.
525 * @val_seq: Current validation sequence. 526 * @val_seq: Current validation sequence.
@@ -537,14 +538,13 @@ struct ttm_bo_device {
537 struct list_head device_list; 538 struct list_head device_list;
538 struct ttm_bo_global *glob; 539 struct ttm_bo_global *glob;
539 struct ttm_bo_driver *driver; 540 struct ttm_bo_driver *driver;
540 rwlock_t vm_lock;
541 struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES]; 541 struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES];
542 spinlock_t fence_lock; 542 spinlock_t fence_lock;
543
543 /* 544 /*
544 * Protected by the vm lock. 545 * Protected by internal locks.
545 */ 546 */
546 struct rb_root addr_space_rb; 547 struct drm_vma_offset_manager vma_manager;
547 struct drm_mm addr_space_mm;
548 548
549 /* 549 /*
550 * Protected by the global:lru lock. 550 * Protected by the global:lru lock.
diff --git a/include/dt-bindings/clock/samsung,s3c64xx-clock.h b/include/dt-bindings/clock/samsung,s3c64xx-clock.h
new file mode 100644
index 000000000000..ad95c7f50090
--- /dev/null
+++ b/include/dt-bindings/clock/samsung,s3c64xx-clock.h
@@ -0,0 +1,178 @@
1/*
2 * Copyright (c) 2013 Tomasz Figa <tomasz.figa at gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * Device Tree binding constants for Samsung S3C64xx clock controller.
9*/
10
11#ifndef _DT_BINDINGS_CLOCK_SAMSUNG_S3C64XX_CLOCK_H
12#define _DT_BINDINGS_CLOCK_SAMSUNG_S3C64XX_CLOCK_H
13
14/*
15 * Let each exported clock get a unique index, which is used on DT-enabled
16 * platforms to lookup the clock from a clock specifier. These indices are
17 * therefore considered an ABI and so must not be changed. This implies
18 * that new clocks should be added either in free spaces between clock groups
19 * or at the end.
20 */
21
22/* Core clocks. */
23#define CLK27M 1
24#define CLK48M 2
25#define FOUT_APLL 3
26#define FOUT_MPLL 4
27#define FOUT_EPLL 5
28#define ARMCLK 6
29#define HCLKX2 7
30#define HCLK 8
31#define PCLK 9
32
33/* HCLK bus clocks. */
34#define HCLK_3DSE 16
35#define HCLK_UHOST 17
36#define HCLK_SECUR 18
37#define HCLK_SDMA1 19
38#define HCLK_SDMA0 20
39#define HCLK_IROM 21
40#define HCLK_DDR1 22
41#define HCLK_MEM1 23
42#define HCLK_MEM0 24
43#define HCLK_USB 25
44#define HCLK_HSMMC2 26
45#define HCLK_HSMMC1 27
46#define HCLK_HSMMC0 28
47#define HCLK_MDP 29
48#define HCLK_DHOST 30
49#define HCLK_IHOST 31
50#define HCLK_DMA1 32
51#define HCLK_DMA0 33
52#define HCLK_JPEG 34
53#define HCLK_CAMIF 35
54#define HCLK_SCALER 36
55#define HCLK_2D 37
56#define HCLK_TV 38
57#define HCLK_POST0 39
58#define HCLK_ROT 40
59#define HCLK_LCD 41
60#define HCLK_TZIC 42
61#define HCLK_INTC 43
62#define HCLK_MFC 44
63#define HCLK_DDR0 45
64
65/* PCLK bus clocks. */
66#define PCLK_IIC1 48
67#define PCLK_IIS2 49
68#define PCLK_SKEY 50
69#define PCLK_CHIPID 51
70#define PCLK_SPI1 52
71#define PCLK_SPI0 53
72#define PCLK_HSIRX 54
73#define PCLK_HSITX 55
74#define PCLK_GPIO 56
75#define PCLK_IIC0 57
76#define PCLK_IIS1 58
77#define PCLK_IIS0 59
78#define PCLK_AC97 60
79#define PCLK_TZPC 61
80#define PCLK_TSADC 62
81#define PCLK_KEYPAD 63
82#define PCLK_IRDA 64
83#define PCLK_PCM1 65
84#define PCLK_PCM0 66
85#define PCLK_PWM 67
86#define PCLK_RTC 68
87#define PCLK_WDT 69
88#define PCLK_UART3 70
89#define PCLK_UART2 71
90#define PCLK_UART1 72
91#define PCLK_UART0 73
92#define PCLK_MFC 74
93
94/* Special clocks. */
95#define SCLK_UHOST 80
96#define SCLK_MMC2_48 81
97#define SCLK_MMC1_48 82
98#define SCLK_MMC0_48 83
99#define SCLK_MMC2 84
100#define SCLK_MMC1 85
101#define SCLK_MMC0 86
102#define SCLK_SPI1_48 87
103#define SCLK_SPI0_48 88
104#define SCLK_SPI1 89
105#define SCLK_SPI0 90
106#define SCLK_DAC27 91
107#define SCLK_TV27 92
108#define SCLK_SCALER27 93
109#define SCLK_SCALER 94
110#define SCLK_LCD27 95
111#define SCLK_LCD 96
112#define SCLK_FIMC 97
113#define SCLK_POST0_27 98
114#define SCLK_AUDIO2 99
115#define SCLK_POST0 100
116#define SCLK_AUDIO1 101
117#define SCLK_AUDIO0 102
118#define SCLK_SECUR 103
119#define SCLK_IRDA 104
120#define SCLK_UART 105
121#define SCLK_MFC 106
122#define SCLK_CAM 107
123#define SCLK_JPEG 108
124#define SCLK_ONENAND 109
125
126/* MEM0 bus clocks - S3C6410-specific. */
127#define MEM0_CFCON 112
128#define MEM0_ONENAND1 113
129#define MEM0_ONENAND0 114
130#define MEM0_NFCON 115
131#define MEM0_SROM 116
132
133/* Muxes. */
134#define MOUT_APLL 128
135#define MOUT_MPLL 129
136#define MOUT_EPLL 130
137#define MOUT_MFC 131
138#define MOUT_AUDIO0 132
139#define MOUT_AUDIO1 133
140#define MOUT_UART 134
141#define MOUT_SPI0 135
142#define MOUT_SPI1 136
143#define MOUT_MMC0 137
144#define MOUT_MMC1 138
145#define MOUT_MMC2 139
146#define MOUT_UHOST 140
147#define MOUT_IRDA 141
148#define MOUT_LCD 142
149#define MOUT_SCALER 143
150#define MOUT_DAC27 144
151#define MOUT_TV27 145
152#define MOUT_AUDIO2 146
153
154/* Dividers. */
155#define DOUT_MPLL 160
156#define DOUT_SECUR 161
157#define DOUT_CAM 162
158#define DOUT_JPEG 163
159#define DOUT_MFC 164
160#define DOUT_MMC0 165
161#define DOUT_MMC1 166
162#define DOUT_MMC2 167
163#define DOUT_LCD 168
164#define DOUT_SCALER 169
165#define DOUT_UHOST 170
166#define DOUT_SPI0 171
167#define DOUT_SPI1 172
168#define DOUT_AUDIO0 173
169#define DOUT_AUDIO1 174
170#define DOUT_UART 175
171#define DOUT_IRDA 176
172#define DOUT_FIMC 177
173#define DOUT_AUDIO2 178
174
175/* Total number of clocks. */
176#define NR_CLKS (DOUT_AUDIO2 + 1)
177
178#endif /* _DT_BINDINGS_CLOCK_SAMSUNG_S3C64XX_CLOCK_H */
diff --git a/include/dt-bindings/input/input.h b/include/dt-bindings/input/input.h
new file mode 100644
index 000000000000..042e7b3b6296
--- /dev/null
+++ b/include/dt-bindings/input/input.h
@@ -0,0 +1,525 @@
1/*
2 * This header provides constants for most input bindings.
3 *
4 * Most input bindings include key code, matrix key code format.
5 * In most cases, key code and matrix key code format uses
6 * the standard values/macro defined in this header.
7 */
8
9#ifndef _DT_BINDINGS_INPUT_INPUT_H
10#define _DT_BINDINGS_INPUT_INPUT_H
11
12#define KEY_RESERVED 0
13#define KEY_ESC 1
14#define KEY_1 2
15#define KEY_2 3
16#define KEY_3 4
17#define KEY_4 5
18#define KEY_5 6
19#define KEY_6 7
20#define KEY_7 8
21#define KEY_8 9
22#define KEY_9 10
23#define KEY_0 11
24#define KEY_MINUS 12
25#define KEY_EQUAL 13
26#define KEY_BACKSPACE 14
27#define KEY_TAB 15
28#define KEY_Q 16
29#define KEY_W 17
30#define KEY_E 18
31#define KEY_R 19
32#define KEY_T 20
33#define KEY_Y 21
34#define KEY_U 22
35#define KEY_I 23
36#define KEY_O 24
37#define KEY_P 25
38#define KEY_LEFTBRACE 26
39#define KEY_RIGHTBRACE 27
40#define KEY_ENTER 28
41#define KEY_LEFTCTRL 29
42#define KEY_A 30
43#define KEY_S 31
44#define KEY_D 32
45#define KEY_F 33
46#define KEY_G 34
47#define KEY_H 35
48#define KEY_J 36
49#define KEY_K 37
50#define KEY_L 38
51#define KEY_SEMICOLON 39
52#define KEY_APOSTROPHE 40
53#define KEY_GRAVE 41
54#define KEY_LEFTSHIFT 42
55#define KEY_BACKSLASH 43
56#define KEY_Z 44
57#define KEY_X 45
58#define KEY_C 46
59#define KEY_V 47
60#define KEY_B 48
61#define KEY_N 49
62#define KEY_M 50
63#define KEY_COMMA 51
64#define KEY_DOT 52
65#define KEY_SLASH 53
66#define KEY_RIGHTSHIFT 54
67#define KEY_KPASTERISK 55
68#define KEY_LEFTALT 56
69#define KEY_SPACE 57
70#define KEY_CAPSLOCK 58
71#define KEY_F1 59
72#define KEY_F2 60
73#define KEY_F3 61
74#define KEY_F4 62
75#define KEY_F5 63
76#define KEY_F6 64
77#define KEY_F7 65
78#define KEY_F8 66
79#define KEY_F9 67
80#define KEY_F10 68
81#define KEY_NUMLOCK 69
82#define KEY_SCROLLLOCK 70
83#define KEY_KP7 71
84#define KEY_KP8 72
85#define KEY_KP9 73
86#define KEY_KPMINUS 74
87#define KEY_KP4 75
88#define KEY_KP5 76
89#define KEY_KP6 77
90#define KEY_KPPLUS 78
91#define KEY_KP1 79
92#define KEY_KP2 80
93#define KEY_KP3 81
94#define KEY_KP0 82
95#define KEY_KPDOT 83
96
97#define KEY_ZENKAKUHANKAKU 85
98#define KEY_102ND 86
99#define KEY_F11 87
100#define KEY_F12 88
101#define KEY_RO 89
102#define KEY_KATAKANA 90
103#define KEY_HIRAGANA 91
104#define KEY_HENKAN 92
105#define KEY_KATAKANAHIRAGANA 93
106#define KEY_MUHENKAN 94
107#define KEY_KPJPCOMMA 95
108#define KEY_KPENTER 96
109#define KEY_RIGHTCTRL 97
110#define KEY_KPSLASH 98
111#define KEY_SYSRQ 99
112#define KEY_RIGHTALT 100
113#define KEY_LINEFEED 101
114#define KEY_HOME 102
115#define KEY_UP 103
116#define KEY_PAGEUP 104
117#define KEY_LEFT 105
118#define KEY_RIGHT 106
119#define KEY_END 107
120#define KEY_DOWN 108
121#define KEY_PAGEDOWN 109
122#define KEY_INSERT 110
123#define KEY_DELETE 111
124#define KEY_MACRO 112
125#define KEY_MUTE 113
126#define KEY_VOLUMEDOWN 114
127#define KEY_VOLUMEUP 115
128#define KEY_POWER 116 /* SC System Power Down */
129#define KEY_KPEQUAL 117
130#define KEY_KPPLUSMINUS 118
131#define KEY_PAUSE 119
132#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */
133
134#define KEY_KPCOMMA 121
135#define KEY_HANGEUL 122
136#define KEY_HANGUEL KEY_HANGEUL
137#define KEY_HANJA 123
138#define KEY_YEN 124
139#define KEY_LEFTMETA 125
140#define KEY_RIGHTMETA 126
141#define KEY_COMPOSE 127
142
143#define KEY_STOP 128 /* AC Stop */
144#define KEY_AGAIN 129
145#define KEY_PROPS 130 /* AC Properties */
146#define KEY_UNDO 131 /* AC Undo */
147#define KEY_FRONT 132
148#define KEY_COPY 133 /* AC Copy */
149#define KEY_OPEN 134 /* AC Open */
150#define KEY_PASTE 135 /* AC Paste */
151#define KEY_FIND 136 /* AC Search */
152#define KEY_CUT 137 /* AC Cut */
153#define KEY_HELP 138 /* AL Integrated Help Center */
154#define KEY_MENU 139 /* Menu (show menu) */
155#define KEY_CALC 140 /* AL Calculator */
156#define KEY_SETUP 141
157#define KEY_SLEEP 142 /* SC System Sleep */
158#define KEY_WAKEUP 143 /* System Wake Up */
159#define KEY_FILE 144 /* AL Local Machine Browser */
160#define KEY_SENDFILE 145
161#define KEY_DELETEFILE 146
162#define KEY_XFER 147
163#define KEY_PROG1 148
164#define KEY_PROG2 149
165#define KEY_WWW 150 /* AL Internet Browser */
166#define KEY_MSDOS 151
167#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */
168#define KEY_SCREENLOCK KEY_COFFEE
169#define KEY_DIRECTION 153
170#define KEY_CYCLEWINDOWS 154
171#define KEY_MAIL 155
172#define KEY_BOOKMARKS 156 /* AC Bookmarks */
173#define KEY_COMPUTER 157
174#define KEY_BACK 158 /* AC Back */
175#define KEY_FORWARD 159 /* AC Forward */
176#define KEY_CLOSECD 160
177#define KEY_EJECTCD 161
178#define KEY_EJECTCLOSECD 162
179#define KEY_NEXTSONG 163
180#define KEY_PLAYPAUSE 164
181#define KEY_PREVIOUSSONG 165
182#define KEY_STOPCD 166
183#define KEY_RECORD 167
184#define KEY_REWIND 168
185#define KEY_PHONE 169 /* Media Select Telephone */
186#define KEY_ISO 170
187#define KEY_CONFIG 171 /* AL Consumer Control Configuration */
188#define KEY_HOMEPAGE 172 /* AC Home */
189#define KEY_REFRESH 173 /* AC Refresh */
190#define KEY_EXIT 174 /* AC Exit */
191#define KEY_MOVE 175
192#define KEY_EDIT 176
193#define KEY_SCROLLUP 177
194#define KEY_SCROLLDOWN 178
195#define KEY_KPLEFTPAREN 179
196#define KEY_KPRIGHTPAREN 180
197#define KEY_NEW 181 /* AC New */
198#define KEY_REDO 182 /* AC Redo/Repeat */
199
200#define KEY_F13 183
201#define KEY_F14 184
202#define KEY_F15 185
203#define KEY_F16 186
204#define KEY_F17 187
205#define KEY_F18 188
206#define KEY_F19 189
207#define KEY_F20 190
208#define KEY_F21 191
209#define KEY_F22 192
210#define KEY_F23 193
211#define KEY_F24 194
212
213#define KEY_PLAYCD 200
214#define KEY_PAUSECD 201
215#define KEY_PROG3 202
216#define KEY_PROG4 203
217#define KEY_DASHBOARD 204 /* AL Dashboard */
218#define KEY_SUSPEND 205
219#define KEY_CLOSE 206 /* AC Close */
220#define KEY_PLAY 207
221#define KEY_FASTFORWARD 208
222#define KEY_BASSBOOST 209
223#define KEY_PRINT 210 /* AC Print */
224#define KEY_HP 211
225#define KEY_CAMERA 212
226#define KEY_SOUND 213
227#define KEY_QUESTION 214
228#define KEY_EMAIL 215
229#define KEY_CHAT 216
230#define KEY_SEARCH 217
231#define KEY_CONNECT 218
232#define KEY_FINANCE 219 /* AL Checkbook/Finance */
233#define KEY_SPORT 220
234#define KEY_SHOP 221
235#define KEY_ALTERASE 222
236#define KEY_CANCEL 223 /* AC Cancel */
237#define KEY_BRIGHTNESSDOWN 224
238#define KEY_BRIGHTNESSUP 225
239#define KEY_MEDIA 226
240
241#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video
242 outputs (Monitor/LCD/TV-out/etc) */
243#define KEY_KBDILLUMTOGGLE 228
244#define KEY_KBDILLUMDOWN 229
245#define KEY_KBDILLUMUP 230
246
247#define KEY_SEND 231 /* AC Send */
248#define KEY_REPLY 232 /* AC Reply */
249#define KEY_FORWARDMAIL 233 /* AC Forward Msg */
250#define KEY_SAVE 234 /* AC Save */
251#define KEY_DOCUMENTS 235
252
253#define KEY_BATTERY 236
254
255#define KEY_BLUETOOTH 237
256#define KEY_WLAN 238
257#define KEY_UWB 239
258
259#define KEY_UNKNOWN 240
260
261#define KEY_VIDEO_NEXT 241 /* drive next video source */
262#define KEY_VIDEO_PREV 242 /* drive previous video source */
263#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */
264#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */
265#define KEY_DISPLAY_OFF 245 /* display device to off state */
266
267#define KEY_WIMAX 246
268#define KEY_RFKILL 247 /* Key that controls all radios */
269
270#define KEY_MICMUTE 248 /* Mute / unmute the microphone */
271
272/* Code 255 is reserved for special needs of AT keyboard driver */
273
274#define BTN_MISC 0x100
275#define BTN_0 0x100
276#define BTN_1 0x101
277#define BTN_2 0x102
278#define BTN_3 0x103
279#define BTN_4 0x104
280#define BTN_5 0x105
281#define BTN_6 0x106
282#define BTN_7 0x107
283#define BTN_8 0x108
284#define BTN_9 0x109
285
286#define BTN_MOUSE 0x110
287#define BTN_LEFT 0x110
288#define BTN_RIGHT 0x111
289#define BTN_MIDDLE 0x112
290#define BTN_SIDE 0x113
291#define BTN_EXTRA 0x114
292#define BTN_FORWARD 0x115
293#define BTN_BACK 0x116
294#define BTN_TASK 0x117
295
296#define BTN_JOYSTICK 0x120
297#define BTN_TRIGGER 0x120
298#define BTN_THUMB 0x121
299#define BTN_THUMB2 0x122
300#define BTN_TOP 0x123
301#define BTN_TOP2 0x124
302#define BTN_PINKIE 0x125
303#define BTN_BASE 0x126
304#define BTN_BASE2 0x127
305#define BTN_BASE3 0x128
306#define BTN_BASE4 0x129
307#define BTN_BASE5 0x12a
308#define BTN_BASE6 0x12b
309#define BTN_DEAD 0x12f
310
311#define BTN_GAMEPAD 0x130
312#define BTN_SOUTH 0x130
313#define BTN_A BTN_SOUTH
314#define BTN_EAST 0x131
315#define BTN_B BTN_EAST
316#define BTN_C 0x132
317#define BTN_NORTH 0x133
318#define BTN_X BTN_NORTH
319#define BTN_WEST 0x134
320#define BTN_Y BTN_WEST
321#define BTN_Z 0x135
322#define BTN_TL 0x136
323#define BTN_TR 0x137
324#define BTN_TL2 0x138
325#define BTN_TR2 0x139
326#define BTN_SELECT 0x13a
327#define BTN_START 0x13b
328#define BTN_MODE 0x13c
329#define BTN_THUMBL 0x13d
330#define BTN_THUMBR 0x13e
331
332#define BTN_DIGI 0x140
333#define BTN_TOOL_PEN 0x140
334#define BTN_TOOL_RUBBER 0x141
335#define BTN_TOOL_BRUSH 0x142
336#define BTN_TOOL_PENCIL 0x143
337#define BTN_TOOL_AIRBRUSH 0x144
338#define BTN_TOOL_FINGER 0x145
339#define BTN_TOOL_MOUSE 0x146
340#define BTN_TOOL_LENS 0x147
341#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */
342#define BTN_TOUCH 0x14a
343#define BTN_STYLUS 0x14b
344#define BTN_STYLUS2 0x14c
345#define BTN_TOOL_DOUBLETAP 0x14d
346#define BTN_TOOL_TRIPLETAP 0x14e
347#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */
348
349#define BTN_WHEEL 0x150
350#define BTN_GEAR_DOWN 0x150
351#define BTN_GEAR_UP 0x151
352
353#define KEY_OK 0x160
354#define KEY_SELECT 0x161
355#define KEY_GOTO 0x162
356#define KEY_CLEAR 0x163
357#define KEY_POWER2 0x164
358#define KEY_OPTION 0x165
359#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */
360#define KEY_TIME 0x167
361#define KEY_VENDOR 0x168
362#define KEY_ARCHIVE 0x169
363#define KEY_PROGRAM 0x16a /* Media Select Program Guide */
364#define KEY_CHANNEL 0x16b
365#define KEY_FAVORITES 0x16c
366#define KEY_EPG 0x16d
367#define KEY_PVR 0x16e /* Media Select Home */
368#define KEY_MHP 0x16f
369#define KEY_LANGUAGE 0x170
370#define KEY_TITLE 0x171
371#define KEY_SUBTITLE 0x172
372#define KEY_ANGLE 0x173
373#define KEY_ZOOM 0x174
374#define KEY_MODE 0x175
375#define KEY_KEYBOARD 0x176
376#define KEY_SCREEN 0x177
377#define KEY_PC 0x178 /* Media Select Computer */
378#define KEY_TV 0x179 /* Media Select TV */
379#define KEY_TV2 0x17a /* Media Select Cable */
380#define KEY_VCR 0x17b /* Media Select VCR */
381#define KEY_VCR2 0x17c /* VCR Plus */
382#define KEY_SAT 0x17d /* Media Select Satellite */
383#define KEY_SAT2 0x17e
384#define KEY_CD 0x17f /* Media Select CD */
385#define KEY_TAPE 0x180 /* Media Select Tape */
386#define KEY_RADIO 0x181
387#define KEY_TUNER 0x182 /* Media Select Tuner */
388#define KEY_PLAYER 0x183
389#define KEY_TEXT 0x184
390#define KEY_DVD 0x185 /* Media Select DVD */
391#define KEY_AUX 0x186
392#define KEY_MP3 0x187
393#define KEY_AUDIO 0x188 /* AL Audio Browser */
394#define KEY_VIDEO 0x189 /* AL Movie Browser */
395#define KEY_DIRECTORY 0x18a
396#define KEY_LIST 0x18b
397#define KEY_MEMO 0x18c /* Media Select Messages */
398#define KEY_CALENDAR 0x18d
399#define KEY_RED 0x18e
400#define KEY_GREEN 0x18f
401#define KEY_YELLOW 0x190
402#define KEY_BLUE 0x191
403#define KEY_CHANNELUP 0x192 /* Channel Increment */
404#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */
405#define KEY_FIRST 0x194
406#define KEY_LAST 0x195 /* Recall Last */
407#define KEY_AB 0x196
408#define KEY_NEXT 0x197
409#define KEY_RESTART 0x198
410#define KEY_SLOW 0x199
411#define KEY_SHUFFLE 0x19a
412#define KEY_BREAK 0x19b
413#define KEY_PREVIOUS 0x19c
414#define KEY_DIGITS 0x19d
415#define KEY_TEEN 0x19e
416#define KEY_TWEN 0x19f
417#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */
418#define KEY_GAMES 0x1a1 /* Media Select Games */
419#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */
420#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */
421#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */
422#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */
423#define KEY_EDITOR 0x1a6 /* AL Text Editor */
424#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */
425#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */
426#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */
427#define KEY_DATABASE 0x1aa /* AL Database App */
428#define KEY_NEWS 0x1ab /* AL Newsreader */
429#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */
430#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */
431#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */
432#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */
433#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */
434#define KEY_LOGOFF 0x1b1 /* AL Logoff */
435
436#define KEY_DOLLAR 0x1b2
437#define KEY_EURO 0x1b3
438
439#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */
440#define KEY_FRAMEFORWARD 0x1b5
441#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */
442#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */
443#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */
444#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */
445#define KEY_IMAGES 0x1ba /* AL Image Browser */
446
447#define KEY_DEL_EOL 0x1c0
448#define KEY_DEL_EOS 0x1c1
449#define KEY_INS_LINE 0x1c2
450#define KEY_DEL_LINE 0x1c3
451
452#define KEY_FN 0x1d0
453#define KEY_FN_ESC 0x1d1
454#define KEY_FN_F1 0x1d2
455#define KEY_FN_F2 0x1d3
456#define KEY_FN_F3 0x1d4
457#define KEY_FN_F4 0x1d5
458#define KEY_FN_F5 0x1d6
459#define KEY_FN_F6 0x1d7
460#define KEY_FN_F7 0x1d8
461#define KEY_FN_F8 0x1d9
462#define KEY_FN_F9 0x1da
463#define KEY_FN_F10 0x1db
464#define KEY_FN_F11 0x1dc
465#define KEY_FN_F12 0x1dd
466#define KEY_FN_1 0x1de
467#define KEY_FN_2 0x1df
468#define KEY_FN_D 0x1e0
469#define KEY_FN_E 0x1e1
470#define KEY_FN_F 0x1e2
471#define KEY_FN_S 0x1e3
472#define KEY_FN_B 0x1e4
473
474#define KEY_BRL_DOT1 0x1f1
475#define KEY_BRL_DOT2 0x1f2
476#define KEY_BRL_DOT3 0x1f3
477#define KEY_BRL_DOT4 0x1f4
478#define KEY_BRL_DOT5 0x1f5
479#define KEY_BRL_DOT6 0x1f6
480#define KEY_BRL_DOT7 0x1f7
481#define KEY_BRL_DOT8 0x1f8
482#define KEY_BRL_DOT9 0x1f9
483#define KEY_BRL_DOT10 0x1fa
484
485#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */
486#define KEY_NUMERIC_1 0x201 /* and other keypads */
487#define KEY_NUMERIC_2 0x202
488#define KEY_NUMERIC_3 0x203
489#define KEY_NUMERIC_4 0x204
490#define KEY_NUMERIC_5 0x205
491#define KEY_NUMERIC_6 0x206
492#define KEY_NUMERIC_7 0x207
493#define KEY_NUMERIC_8 0x208
494#define KEY_NUMERIC_9 0x209
495#define KEY_NUMERIC_STAR 0x20a
496#define KEY_NUMERIC_POUND 0x20b
497
498#define KEY_CAMERA_FOCUS 0x210
499#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */
500
501#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */
502#define KEY_TOUCHPAD_ON 0x213
503#define KEY_TOUCHPAD_OFF 0x214
504
505#define KEY_CAMERA_ZOOMIN 0x215
506#define KEY_CAMERA_ZOOMOUT 0x216
507#define KEY_CAMERA_UP 0x217
508#define KEY_CAMERA_DOWN 0x218
509#define KEY_CAMERA_LEFT 0x219
510#define KEY_CAMERA_RIGHT 0x21a
511
512#define KEY_ATTENDANT_ON 0x21b
513#define KEY_ATTENDANT_OFF 0x21c
514#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */
515#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */
516
517#define BTN_DPAD_UP 0x220
518#define BTN_DPAD_DOWN 0x221
519#define BTN_DPAD_LEFT 0x222
520#define BTN_DPAD_RIGHT 0x223
521
522#define MATRIX_KEY(row, col, code) \
523 ((((row) & 0xFF) << 24) | (((col) & 0xFF) << 16) | ((code) & 0xFFFF))
524
525#endif /* _DT_BINDINGS_INPUT_INPUT_H */
diff --git a/include/dt-bindings/pinctrl/nomadik.h b/include/dt-bindings/pinctrl/nomadik.h
new file mode 100644
index 000000000000..638fb321a1cb
--- /dev/null
+++ b/include/dt-bindings/pinctrl/nomadik.h
@@ -0,0 +1,36 @@
1/*
2 * nomadik.h
3 *
4 * Copyright (C) ST-Ericsson SA 2013
5 * Author: Gabriel Fernandez <gabriel.fernandez@st.com> for ST-Ericsson.
6 * License terms: GNU General Public License (GPL), version 2
7 */
8
9#define INPUT_NOPULL 0
10#define INPUT_PULLUP 1
11#define INPUT_PULLDOWN 2
12
13#define OUTPUT_LOW 0
14#define OUTPUT_HIGH 1
15#define DIR_OUTPUT 2
16
17#define SLPM_DISABLED 0
18#define SLPM_ENABLED 1
19
20#define SLPM_INPUT_NOPULL 0
21#define SLPM_INPUT_PULLUP 1
22#define SLPM_INPUT_PULLDOWN 2
23#define SLPM_DIR_INPUT 3
24
25#define SLPM_OUTPUT_LOW 0
26#define SLPM_OUTPUT_HIGH 1
27#define SLPM_DIR_OUTPUT 2
28
29#define SLPM_WAKEUP_DISABLE 0
30#define SLPM_WAKEUP_ENABLE 1
31
32#define GPIOMODE_DISABLED 0
33#define GPIOMODE_ENABLED 1
34
35#define SLPM_PDIS_DISABLED 0
36#define SLPM_PDIS_ENABLED 1
diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h
index edbd250809cb..bed35e36fd27 100644
--- a/include/dt-bindings/pinctrl/omap.h
+++ b/include/dt-bindings/pinctrl/omap.h
@@ -23,7 +23,7 @@
23#define PULL_UP (1 << 4) 23#define PULL_UP (1 << 4)
24#define ALTELECTRICALSEL (1 << 5) 24#define ALTELECTRICALSEL (1 << 5)
25 25
26/* 34xx specific mux bit defines */ 26/* omap3/4/5 specific mux bit defines */
27#define INPUT_EN (1 << 8) 27#define INPUT_EN (1 << 8)
28#define OFF_EN (1 << 9) 28#define OFF_EN (1 << 9)
29#define OFFOUT_EN (1 << 10) 29#define OFFOUT_EN (1 << 10)
@@ -31,8 +31,6 @@
31#define OFF_PULL_EN (1 << 12) 31#define OFF_PULL_EN (1 << 12)
32#define OFF_PULL_UP (1 << 13) 32#define OFF_PULL_UP (1 << 13)
33#define WAKEUP_EN (1 << 14) 33#define WAKEUP_EN (1 << 14)
34
35/* 44xx specific mux bit defines */
36#define WAKEUP_EVENT (1 << 15) 34#define WAKEUP_EVENT (1 << 15)
37 35
38/* Active pin states */ 36/* Active pin states */
diff --git a/include/dt-bindings/pwm/pwm.h b/include/dt-bindings/pwm/pwm.h
new file mode 100644
index 000000000000..96f49e82253e
--- /dev/null
+++ b/include/dt-bindings/pwm/pwm.h
@@ -0,0 +1,14 @@
1/*
2 * This header provides constants for most PWM bindings.
3 *
4 * Most PWM bindings can include a flags cell as part of the PWM specifier.
5 * In most cases, the format of the flags cell uses the standard values
6 * defined in this header.
7 */
8
9#ifndef _DT_BINDINGS_PWM_PWM_H
10#define _DT_BINDINGS_PWM_PWM_H
11
12#define PWM_POLARITY_INVERTED (1 << 0)
13
14#endif
diff --git a/include/dt-bindings/sound/fsl-imx-audmux.h b/include/dt-bindings/sound/fsl-imx-audmux.h
new file mode 100644
index 000000000000..50b09e96f247
--- /dev/null
+++ b/include/dt-bindings/sound/fsl-imx-audmux.h
@@ -0,0 +1,56 @@
1#ifndef __DT_FSL_IMX_AUDMUX_H
2#define __DT_FSL_IMX_AUDMUX_H
3
4#define MX27_AUDMUX_HPCR1_SSI0 0
5#define MX27_AUDMUX_HPCR2_SSI1 1
6#define MX27_AUDMUX_HPCR3_SSI_PINS_4 2
7#define MX27_AUDMUX_PPCR1_SSI_PINS_1 3
8#define MX27_AUDMUX_PPCR2_SSI_PINS_2 4
9#define MX27_AUDMUX_PPCR3_SSI_PINS_3 5
10
11#define MX31_AUDMUX_PORT1_SSI0 0
12#define MX31_AUDMUX_PORT2_SSI1 1
13#define MX31_AUDMUX_PORT3_SSI_PINS_3 2
14#define MX31_AUDMUX_PORT4_SSI_PINS_4 3
15#define MX31_AUDMUX_PORT5_SSI_PINS_5 4
16#define MX31_AUDMUX_PORT6_SSI_PINS_6 5
17#define MX31_AUDMUX_PORT7_SSI_PINS_7 6
18
19#define MX51_AUDMUX_PORT1_SSI0 0
20#define MX51_AUDMUX_PORT2_SSI1 1
21#define MX51_AUDMUX_PORT3 2
22#define MX51_AUDMUX_PORT4 3
23#define MX51_AUDMUX_PORT5 4
24#define MX51_AUDMUX_PORT6 5
25#define MX51_AUDMUX_PORT7 6
26
27/* Register definitions for the i.MX21/27 Digital Audio Multiplexer */
28#define IMX_AUDMUX_V1_PCR_INMMASK(x) ((x) & 0xff)
29#define IMX_AUDMUX_V1_PCR_INMEN (1 << 8)
30#define IMX_AUDMUX_V1_PCR_TXRXEN (1 << 10)
31#define IMX_AUDMUX_V1_PCR_SYN (1 << 12)
32#define IMX_AUDMUX_V1_PCR_RXDSEL(x) (((x) & 0x7) << 13)
33#define IMX_AUDMUX_V1_PCR_RFCSEL(x) (((x) & 0xf) << 20)
34#define IMX_AUDMUX_V1_PCR_RCLKDIR (1 << 24)
35#define IMX_AUDMUX_V1_PCR_RFSDIR (1 << 25)
36#define IMX_AUDMUX_V1_PCR_TFCSEL(x) (((x) & 0xf) << 26)
37#define IMX_AUDMUX_V1_PCR_TCLKDIR (1 << 30)
38#define IMX_AUDMUX_V1_PCR_TFSDIR (1 << 31)
39
40/* Register definitions for the i.MX25/31/35/51 Digital Audio Multiplexer */
41#define IMX_AUDMUX_V2_PTCR_TFSDIR (1 << 31)
42#define IMX_AUDMUX_V2_PTCR_TFSEL(x) (((x) & 0xf) << 27)
43#define IMX_AUDMUX_V2_PTCR_TCLKDIR (1 << 26)
44#define IMX_AUDMUX_V2_PTCR_TCSEL(x) (((x) & 0xf) << 22)
45#define IMX_AUDMUX_V2_PTCR_RFSDIR (1 << 21)
46#define IMX_AUDMUX_V2_PTCR_RFSEL(x) (((x) & 0xf) << 17)
47#define IMX_AUDMUX_V2_PTCR_RCLKDIR (1 << 16)
48#define IMX_AUDMUX_V2_PTCR_RCSEL(x) (((x) & 0xf) << 12)
49#define IMX_AUDMUX_V2_PTCR_SYN (1 << 11)
50
51#define IMX_AUDMUX_V2_PDCR_RXDSEL(x) (((x) & 0x7) << 13)
52#define IMX_AUDMUX_V2_PDCR_TXRXEN (1 << 12)
53#define IMX_AUDMUX_V2_PDCR_MODE(x) (((x) & 0x3) << 8)
54#define IMX_AUDMUX_V2_PDCR_INMMASK(x) ((x) & 0xff)
55
56#endif /* __DT_FSL_IMX_AUDMUX_H */
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index 343744e4809c..7e2d15837b02 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -26,7 +26,7 @@
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/irqchip/arm-gic.h> 27#include <linux/irqchip/arm-gic.h>
28 28
29#define VGIC_NR_IRQS 128 29#define VGIC_NR_IRQS 256
30#define VGIC_NR_SGIS 16 30#define VGIC_NR_SGIS 16
31#define VGIC_NR_PPIS 16 31#define VGIC_NR_PPIS 16
32#define VGIC_NR_PRIVATE_IRQS (VGIC_NR_SGIS + VGIC_NR_PPIS) 32#define VGIC_NR_PRIVATE_IRQS (VGIC_NR_SGIS + VGIC_NR_PPIS)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 353ba256f368..a5db4aeefa36 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -481,6 +481,13 @@ void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state,
481 481
482acpi_status acpi_os_prepare_sleep(u8 sleep_state, 482acpi_status acpi_os_prepare_sleep(u8 sleep_state,
483 u32 pm1a_control, u32 pm1b_control); 483 u32 pm1a_control, u32 pm1b_control);
484
485void acpi_os_set_prepare_extended_sleep(int (*func)(u8 sleep_state,
486 u32 val_a, u32 val_b));
487
488acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state,
489 u32 val_a, u32 val_b);
490
484#ifdef CONFIG_X86 491#ifdef CONFIG_X86
485void arch_reserve_mem_area(acpi_physical_address addr, size_t size); 492void arch_reserve_mem_area(acpi_physical_address addr, size_t size);
486#else 493#else
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 1bdf965339f9..d9c92daa3944 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -27,15 +27,13 @@ struct kiocb;
27 */ 27 */
28#define KIOCB_CANCELLED ((void *) (~0ULL)) 28#define KIOCB_CANCELLED ((void *) (~0ULL))
29 29
30typedef int (kiocb_cancel_fn)(struct kiocb *, struct io_event *); 30typedef int (kiocb_cancel_fn)(struct kiocb *);
31 31
32struct kiocb { 32struct kiocb {
33 atomic_t ki_users;
34
35 struct file *ki_filp; 33 struct file *ki_filp;
36 struct kioctx *ki_ctx; /* NULL for sync ops */ 34 struct kioctx *ki_ctx; /* NULL for sync ops */
37 kiocb_cancel_fn *ki_cancel; 35 kiocb_cancel_fn *ki_cancel;
38 void (*ki_dtor)(struct kiocb *); 36 void *private;
39 37
40 union { 38 union {
41 void __user *user; 39 void __user *user;
@@ -44,17 +42,7 @@ struct kiocb {
44 42
45 __u64 ki_user_data; /* user's data for completion */ 43 __u64 ki_user_data; /* user's data for completion */
46 loff_t ki_pos; 44 loff_t ki_pos;
47 45 size_t ki_nbytes; /* copy of iocb->aio_nbytes */
48 void *private;
49 /* State that we remember to be able to restart/retry */
50 unsigned short ki_opcode;
51 size_t ki_nbytes; /* copy of iocb->aio_nbytes */
52 char __user *ki_buf; /* remaining iocb->aio_buf */
53 size_t ki_left; /* remaining bytes */
54 struct iovec ki_inline_vec; /* inline vector */
55 struct iovec *ki_iovec;
56 unsigned long ki_nr_segs;
57 unsigned long ki_cur_seg;
58 46
59 struct list_head ki_list; /* the aio core uses this 47 struct list_head ki_list; /* the aio core uses this
60 * for cancellation */ 48 * for cancellation */
@@ -74,7 +62,6 @@ static inline bool is_sync_kiocb(struct kiocb *kiocb)
74static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp) 62static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
75{ 63{
76 *kiocb = (struct kiocb) { 64 *kiocb = (struct kiocb) {
77 .ki_users = ATOMIC_INIT(1),
78 .ki_ctx = NULL, 65 .ki_ctx = NULL,
79 .ki_filp = filp, 66 .ki_filp = filp,
80 .ki_obj.tsk = current, 67 .ki_obj.tsk = current,
@@ -84,7 +71,6 @@ static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
84/* prototypes */ 71/* prototypes */
85#ifdef CONFIG_AIO 72#ifdef CONFIG_AIO
86extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb); 73extern ssize_t wait_on_sync_kiocb(struct kiocb *iocb);
87extern void aio_put_req(struct kiocb *iocb);
88extern void aio_complete(struct kiocb *iocb, long res, long res2); 74extern void aio_complete(struct kiocb *iocb, long res, long res2);
89struct mm_struct; 75struct mm_struct;
90extern void exit_aio(struct mm_struct *mm); 76extern void exit_aio(struct mm_struct *mm);
@@ -93,7 +79,6 @@ extern long do_io_submit(aio_context_t ctx_id, long nr,
93void kiocb_set_cancel_fn(struct kiocb *req, kiocb_cancel_fn *cancel); 79void kiocb_set_cancel_fn(struct kiocb *req, kiocb_cancel_fn *cancel);
94#else 80#else
95static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; } 81static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; }
96static inline void aio_put_req(struct kiocb *iocb) { }
97static inline void aio_complete(struct kiocb *iocb, long res, long res2) { } 82static inline void aio_complete(struct kiocb *iocb, long res, long res2) { }
98struct mm_struct; 83struct mm_struct;
99static inline void exit_aio(struct mm_struct *mm) { } 84static inline void exit_aio(struct mm_struct *mm) { }
diff --git a/include/linux/amba/pl080.h b/include/linux/amba/pl080.h
index 3e7b62fbefbd..91b84a7f0539 100644
--- a/include/linux/amba/pl080.h
+++ b/include/linux/amba/pl080.h
@@ -87,6 +87,7 @@
87#define PL080_CONTROL_SB_SIZE_MASK (0x7 << 12) 87#define PL080_CONTROL_SB_SIZE_MASK (0x7 << 12)
88#define PL080_CONTROL_SB_SIZE_SHIFT (12) 88#define PL080_CONTROL_SB_SIZE_SHIFT (12)
89#define PL080_CONTROL_TRANSFER_SIZE_MASK (0xfff << 0) 89#define PL080_CONTROL_TRANSFER_SIZE_MASK (0xfff << 0)
90#define PL080S_CONTROL_TRANSFER_SIZE_MASK (0x1ffffff << 0)
90#define PL080_CONTROL_TRANSFER_SIZE_SHIFT (0) 91#define PL080_CONTROL_TRANSFER_SIZE_SHIFT (0)
91 92
92#define PL080_BSIZE_1 (0x0) 93#define PL080_BSIZE_1 (0x0)
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h
index 8013a45242fe..cf573c22b81e 100644
--- a/include/linux/anon_inodes.h
+++ b/include/linux/anon_inodes.h
@@ -13,6 +13,9 @@ struct file_operations;
13struct file *anon_inode_getfile(const char *name, 13struct file *anon_inode_getfile(const char *name,
14 const struct file_operations *fops, 14 const struct file_operations *fops,
15 void *priv, int flags); 15 void *priv, int flags);
16struct file *anon_inode_getfile_private(const char *name,
17 const struct file_operations *fops,
18 void *priv, int flags);
16int anon_inode_getfd(const char *name, const struct file_operations *fops, 19int anon_inode_getfd(const char *name, const struct file_operations *fops,
17 void *priv, int flags); 20 void *priv, int flags);
18 21
diff --git a/include/linux/ata.h b/include/linux/ata.h
index ee0bd9524055..bf4c69ca76df 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -239,6 +239,8 @@ enum {
239 ATA_CMD_WRITE_QUEUED_FUA_EXT = 0x3E, 239 ATA_CMD_WRITE_QUEUED_FUA_EXT = 0x3E,
240 ATA_CMD_FPDMA_READ = 0x60, 240 ATA_CMD_FPDMA_READ = 0x60,
241 ATA_CMD_FPDMA_WRITE = 0x61, 241 ATA_CMD_FPDMA_WRITE = 0x61,
242 ATA_CMD_FPDMA_SEND = 0x64,
243 ATA_CMD_FPDMA_RECV = 0x65,
242 ATA_CMD_PIO_READ = 0x20, 244 ATA_CMD_PIO_READ = 0x20,
243 ATA_CMD_PIO_READ_EXT = 0x24, 245 ATA_CMD_PIO_READ_EXT = 0x24,
244 ATA_CMD_PIO_WRITE = 0x30, 246 ATA_CMD_PIO_WRITE = 0x30,
@@ -293,8 +295,13 @@ enum {
293 /* marked obsolete in the ATA/ATAPI-7 spec */ 295 /* marked obsolete in the ATA/ATAPI-7 spec */
294 ATA_CMD_RESTORE = 0x10, 296 ATA_CMD_RESTORE = 0x10,
295 297
298 /* Subcmds for ATA_CMD_FPDMA_SEND */
299 ATA_SUBCMD_FPDMA_SEND_DSM = 0x00,
300 ATA_SUBCMD_FPDMA_SEND_WR_LOG_DMA_EXT = 0x02,
301
296 /* READ_LOG_EXT pages */ 302 /* READ_LOG_EXT pages */
297 ATA_LOG_SATA_NCQ = 0x10, 303 ATA_LOG_SATA_NCQ = 0x10,
304 ATA_LOG_NCQ_SEND_RECV = 0x13,
298 ATA_LOG_SATA_ID_DEV_DATA = 0x30, 305 ATA_LOG_SATA_ID_DEV_DATA = 0x30,
299 ATA_LOG_SATA_SETTINGS = 0x08, 306 ATA_LOG_SATA_SETTINGS = 0x08,
300 ATA_LOG_DEVSLP_OFFSET = 0x30, 307 ATA_LOG_DEVSLP_OFFSET = 0x30,
@@ -305,6 +312,15 @@ enum {
305 ATA_LOG_DEVSLP_VALID = 0x07, 312 ATA_LOG_DEVSLP_VALID = 0x07,
306 ATA_LOG_DEVSLP_VALID_MASK = 0x80, 313 ATA_LOG_DEVSLP_VALID_MASK = 0x80,
307 314
315 /* NCQ send and receive log */
316 ATA_LOG_NCQ_SEND_RECV_SUBCMDS_OFFSET = 0x00,
317 ATA_LOG_NCQ_SEND_RECV_SUBCMDS_DSM = (1 << 0),
318 ATA_LOG_NCQ_SEND_RECV_DSM_OFFSET = 0x04,
319 ATA_LOG_NCQ_SEND_RECV_DSM_TRIM = (1 << 0),
320 ATA_LOG_NCQ_SEND_RECV_RD_LOG_OFFSET = 0x08,
321 ATA_LOG_NCQ_SEND_RECV_WR_LOG_OFFSET = 0x0C,
322 ATA_LOG_NCQ_SEND_RECV_SIZE = 0x10,
323
308 /* READ/WRITE LONG (obsolete) */ 324 /* READ/WRITE LONG (obsolete) */
309 ATA_CMD_READ_LONG = 0x22, 325 ATA_CMD_READ_LONG = 0x22,
310 ATA_CMD_READ_LONG_ONCE = 0x23, 326 ATA_CMD_READ_LONG_ONCE = 0x23,
@@ -446,22 +462,6 @@ enum {
446 SERR_TRANS_ST_ERROR = (1 << 24), /* Transport state trans. error */ 462 SERR_TRANS_ST_ERROR = (1 << 24), /* Transport state trans. error */
447 SERR_UNRECOG_FIS = (1 << 25), /* Unrecognized FIS */ 463 SERR_UNRECOG_FIS = (1 << 25), /* Unrecognized FIS */
448 SERR_DEV_XCHG = (1 << 26), /* device exchanged */ 464 SERR_DEV_XCHG = (1 << 26), /* device exchanged */
449
450 /* struct ata_taskfile flags */
451 ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */
452 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
453 ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */
454 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
455 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
456 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
457 ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
458
459 /* protocol flags */
460 ATA_PROT_FLAG_PIO = (1 << 0), /* is PIO */
461 ATA_PROT_FLAG_DMA = (1 << 1), /* is DMA */
462 ATA_PROT_FLAG_DATA = ATA_PROT_FLAG_PIO | ATA_PROT_FLAG_DMA,
463 ATA_PROT_FLAG_NCQ = (1 << 2), /* is NCQ */
464 ATA_PROT_FLAG_ATAPI = (1 << 3), /* is ATAPI */
465}; 465};
466 466
467enum ata_tf_protocols { 467enum ata_tf_protocols {
@@ -488,83 +488,6 @@ struct ata_bmdma_prd {
488 __le32 flags_len; 488 __le32 flags_len;
489}; 489};
490 490
491struct ata_taskfile {
492 unsigned long flags; /* ATA_TFLAG_xxx */
493 u8 protocol; /* ATA_PROT_xxx */
494
495 u8 ctl; /* control reg */
496
497 u8 hob_feature; /* additional data */
498 u8 hob_nsect; /* to support LBA48 */
499 u8 hob_lbal;
500 u8 hob_lbam;
501 u8 hob_lbah;
502
503 u8 feature;
504 u8 nsect;
505 u8 lbal;
506 u8 lbam;
507 u8 lbah;
508
509 u8 device;
510
511 u8 command; /* IO operation */
512};
513
514/*
515 * protocol tests
516 */
517static inline unsigned int ata_prot_flags(u8 prot)
518{
519 switch (prot) {
520 case ATA_PROT_NODATA:
521 return 0;
522 case ATA_PROT_PIO:
523 return ATA_PROT_FLAG_PIO;
524 case ATA_PROT_DMA:
525 return ATA_PROT_FLAG_DMA;
526 case ATA_PROT_NCQ:
527 return ATA_PROT_FLAG_DMA | ATA_PROT_FLAG_NCQ;
528 case ATAPI_PROT_NODATA:
529 return ATA_PROT_FLAG_ATAPI;
530 case ATAPI_PROT_PIO:
531 return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_PIO;
532 case ATAPI_PROT_DMA:
533 return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_DMA;
534 }
535 return 0;
536}
537
538static inline int ata_is_atapi(u8 prot)
539{
540 return ata_prot_flags(prot) & ATA_PROT_FLAG_ATAPI;
541}
542
543static inline int ata_is_nodata(u8 prot)
544{
545 return !(ata_prot_flags(prot) & ATA_PROT_FLAG_DATA);
546}
547
548static inline int ata_is_pio(u8 prot)
549{
550 return ata_prot_flags(prot) & ATA_PROT_FLAG_PIO;
551}
552
553static inline int ata_is_dma(u8 prot)
554{
555 return ata_prot_flags(prot) & ATA_PROT_FLAG_DMA;
556}
557
558static inline int ata_is_ncq(u8 prot)
559{
560 return ata_prot_flags(prot) & ATA_PROT_FLAG_NCQ;
561}
562
563static inline int ata_is_data(u8 prot)
564{
565 return ata_prot_flags(prot) & ATA_PROT_FLAG_DATA;
566}
567
568/* 491/*
569 * id tests 492 * id tests
570 */ 493 */
@@ -865,6 +788,11 @@ static inline int ata_id_rotation_rate(const u16 *id)
865 return val; 788 return val;
866} 789}
867 790
791static inline bool ata_id_has_ncq_send_and_recv(const u16 *id)
792{
793 return id[ATA_ID_SATA_CAPABILITY_2] & BIT(6);
794}
795
868static inline bool ata_id_has_trim(const u16 *id) 796static inline bool ata_id_has_trim(const u16 *id)
869{ 797{
870 if (ata_id_major_version(id) >= 7 && 798 if (ata_id_major_version(id) >= 7 &&
@@ -1060,15 +988,6 @@ static inline unsigned ata_set_lba_range_entries(void *_buffer,
1060 return used_bytes; 988 return used_bytes;
1061} 989}
1062 990
1063static inline int is_multi_taskfile(struct ata_taskfile *tf)
1064{
1065 return (tf->command == ATA_CMD_READ_MULTI) ||
1066 (tf->command == ATA_CMD_WRITE_MULTI) ||
1067 (tf->command == ATA_CMD_READ_MULTI_EXT) ||
1068 (tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
1069 (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
1070}
1071
1072static inline bool ata_ok(u8 status) 991static inline bool ata_ok(u8 status)
1073{ 992{
1074 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) 993 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
diff --git a/include/linux/atmel-ssc.h b/include/linux/atmel-ssc.h
index deb0ae58b99b..66a0e5384edd 100644
--- a/include/linux/atmel-ssc.h
+++ b/include/linux/atmel-ssc.h
@@ -11,7 +11,7 @@ struct atmel_ssc_platform_data {
11 11
12struct ssc_device { 12struct ssc_device {
13 struct list_head list; 13 struct list_head list;
14 resource_size_t phybase; 14 dma_addr_t phybase;
15 void __iomem *regs; 15 void __iomem *regs;
16 struct platform_device *pdev; 16 struct platform_device *pdev;
17 struct atmel_ssc_platform_data *pdata; 17 struct atmel_ssc_platform_data *pdata;
diff --git a/include/linux/atmel_serial.h b/include/linux/atmel_serial.h
index fd6833764d72..be201ca2990c 100644
--- a/include/linux/atmel_serial.h
+++ b/include/linux/atmel_serial.h
@@ -124,4 +124,6 @@
124#define ATMEL_US_NER 0x44 /* Number of Errors Register */ 124#define ATMEL_US_NER 0x44 /* Number of Errors Register */
125#define ATMEL_US_IF 0x4c /* IrDA Filter Register */ 125#define ATMEL_US_IF 0x4c /* IrDA Filter Register */
126 126
127#define ATMEL_US_NAME 0xf0 /* Ip Name */
128
127#endif 129#endif
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index c3881553f7d1..5f66d519a726 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -243,6 +243,8 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);
243 * BDI_CAP_EXEC_MAP: Can be mapped for execution 243 * BDI_CAP_EXEC_MAP: Can be mapped for execution
244 * 244 *
245 * BDI_CAP_SWAP_BACKED: Count shmem/tmpfs objects as swap-backed. 245 * BDI_CAP_SWAP_BACKED: Count shmem/tmpfs objects as swap-backed.
246 *
247 * BDI_CAP_STRICTLIMIT: Keep number of dirty pages below bdi threshold.
246 */ 248 */
247#define BDI_CAP_NO_ACCT_DIRTY 0x00000001 249#define BDI_CAP_NO_ACCT_DIRTY 0x00000001
248#define BDI_CAP_NO_WRITEBACK 0x00000002 250#define BDI_CAP_NO_WRITEBACK 0x00000002
@@ -254,6 +256,7 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);
254#define BDI_CAP_NO_ACCT_WB 0x00000080 256#define BDI_CAP_NO_ACCT_WB 0x00000080
255#define BDI_CAP_SWAP_BACKED 0x00000100 257#define BDI_CAP_SWAP_BACKED 0x00000100
256#define BDI_CAP_STABLE_WRITES 0x00000200 258#define BDI_CAP_STABLE_WRITES 0x00000200
259#define BDI_CAP_STRICTLIMIT 0x00000400
257 260
258#define BDI_CAP_VMFLAGS \ 261#define BDI_CAP_VMFLAGS \
259 (BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP) 262 (BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP)
diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon_compaction.h
index f7f1d7169b11..089743ade734 100644
--- a/include/linux/balloon_compaction.h
+++ b/include/linux/balloon_compaction.h
@@ -159,6 +159,26 @@ static inline bool balloon_page_movable(struct page *page)
159} 159}
160 160
161/* 161/*
162 * isolated_balloon_page - identify an isolated balloon page on private
163 * compaction/migration page lists.
164 *
165 * After a compaction thread isolates a balloon page for migration, it raises
166 * the page refcount to prevent concurrent compaction threads from re-isolating
167 * the same page. For that reason putback_movable_pages(), or other routines
168 * that need to identify isolated balloon pages on private pagelists, cannot
169 * rely on balloon_page_movable() to accomplish the task.
170 */
171static inline bool isolated_balloon_page(struct page *page)
172{
173 /* Already isolated balloon pages, by default, have a raised refcount */
174 if (page_flags_cleared(page) && !page_mapped(page) &&
175 page_count(page) >= 2)
176 return __is_movable_balloon_page(page);
177
178 return false;
179}
180
181/*
162 * balloon_page_insert - insert a page into the balloon's page list and make 182 * balloon_page_insert - insert a page into the balloon's page list and make
163 * the page->mapping assignment accordingly. 183 * the page->mapping assignment accordingly.
164 * @page : page to be assigned as a 'balloon page' 184 * @page : page to be assigned as a 'balloon page'
@@ -243,6 +263,11 @@ static inline bool balloon_page_movable(struct page *page)
243 return false; 263 return false;
244} 264}
245 265
266static inline bool isolated_balloon_page(struct page *page)
267{
268 return false;
269}
270
246static inline bool balloon_page_isolate(struct page *page) 271static inline bool balloon_page_isolate(struct page *page)
247{ 272{
248 return false; 273 return false;
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 622fc505d3e1..4d043c30216f 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -72,7 +72,19 @@ struct bcma_host_ops {
72/* Core-ID values. */ 72/* Core-ID values. */
73#define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */ 73#define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */
74#define BCMA_CORE_4706_CHIPCOMMON 0x500 74#define BCMA_CORE_4706_CHIPCOMMON 0x500
75#define BCMA_CORE_PCIEG2 0x501
76#define BCMA_CORE_DMA 0x502
77#define BCMA_CORE_SDIO3 0x503
78#define BCMA_CORE_USB20 0x504
79#define BCMA_CORE_USB30 0x505
80#define BCMA_CORE_A9JTAG 0x506
81#define BCMA_CORE_DDR23 0x507
82#define BCMA_CORE_ROM 0x508
83#define BCMA_CORE_NAND 0x509
84#define BCMA_CORE_QSPI 0x50A
85#define BCMA_CORE_CHIPCOMMON_B 0x50B
75#define BCMA_CORE_4706_SOC_RAM 0x50E 86#define BCMA_CORE_4706_SOC_RAM 0x50E
87#define BCMA_CORE_ARMCA9 0x510
76#define BCMA_CORE_4706_MAC_GBIT 0x52D 88#define BCMA_CORE_4706_MAC_GBIT 0x52D
77#define BCMA_CORE_AMEMC 0x52E /* DDR1/2 memory controller core */ 89#define BCMA_CORE_AMEMC 0x52E /* DDR1/2 memory controller core */
78#define BCMA_CORE_ALTA 0x534 /* I2S core */ 90#define BCMA_CORE_ALTA 0x534 /* I2S core */
@@ -177,6 +189,11 @@ struct bcma_host_ops {
177#define BCMA_PKG_ID_BCM5357 11 189#define BCMA_PKG_ID_BCM5357 11
178#define BCMA_CHIP_ID_BCM53572 53572 190#define BCMA_CHIP_ID_BCM53572 53572
179#define BCMA_PKG_ID_BCM47188 9 191#define BCMA_PKG_ID_BCM47188 9
192#define BCMA_CHIP_ID_BCM4707 53010
193#define BCMA_PKG_ID_BCM4707 1
194#define BCMA_PKG_ID_BCM4708 2
195#define BCMA_PKG_ID_BCM4709 0
196#define BCMA_CHIP_ID_BCM53018 53018
180 197
181/* Board types (on PCI usually equals to the subsystem dev id) */ 198/* Board types (on PCI usually equals to the subsystem dev id) */
182/* BCM4313 */ 199/* BCM4313 */
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index 424760f01b9d..0333e605ea0d 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -181,10 +181,31 @@ struct pci_dev;
181 181
182#define BCMA_CORE_PCI_CFG_DEVCTRL 0xd8 182#define BCMA_CORE_PCI_CFG_DEVCTRL 0xd8
183 183
184#define BCMA_CORE_PCI_
185
186/* MDIO devices (SERDES modules) */
187#define BCMA_CORE_PCI_MDIO_IEEE0 0x000
188#define BCMA_CORE_PCI_MDIO_IEEE1 0x001
189#define BCMA_CORE_PCI_MDIO_BLK0 0x800
190#define BCMA_CORE_PCI_MDIO_BLK1 0x801
191#define BCMA_CORE_PCI_MDIO_BLK1_MGMT0 0x16
192#define BCMA_CORE_PCI_MDIO_BLK1_MGMT1 0x17
193#define BCMA_CORE_PCI_MDIO_BLK1_MGMT2 0x18
194#define BCMA_CORE_PCI_MDIO_BLK1_MGMT3 0x19
195#define BCMA_CORE_PCI_MDIO_BLK1_MGMT4 0x1A
196#define BCMA_CORE_PCI_MDIO_BLK2 0x802
197#define BCMA_CORE_PCI_MDIO_BLK3 0x803
198#define BCMA_CORE_PCI_MDIO_BLK4 0x804
199#define BCMA_CORE_PCI_MDIO_TXPLL 0x808 /* TXPLL register block idx */
200#define BCMA_CORE_PCI_MDIO_TXCTRL0 0x820
201#define BCMA_CORE_PCI_MDIO_SERDESID 0x831
202#define BCMA_CORE_PCI_MDIO_RXCTRL0 0x840
203
184/* PCIE Root Capability Register bits (Host mode only) */ 204/* PCIE Root Capability Register bits (Host mode only) */
185#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001 205#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001
186 206
187struct bcma_drv_pci; 207struct bcma_drv_pci;
208struct bcma_bus;
188 209
189#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE 210#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
190struct bcma_drv_pci_host { 211struct bcma_drv_pci_host {
@@ -219,7 +240,9 @@ struct bcma_drv_pci {
219extern void bcma_core_pci_init(struct bcma_drv_pci *pc); 240extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
220extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, 241extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
221 struct bcma_device *core, bool enable); 242 struct bcma_device *core, bool enable);
222extern void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend); 243extern void bcma_core_pci_up(struct bcma_bus *bus);
244extern void bcma_core_pci_down(struct bcma_bus *bus);
245extern void bcma_core_pci_power_save(struct bcma_bus *bus, bool up);
223 246
224extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev); 247extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
225extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev); 248extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 70cf138690e9..e8112ae50531 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -31,7 +31,7 @@ struct linux_binprm {
31#ifdef __alpha__ 31#ifdef __alpha__
32 unsigned int taso:1; 32 unsigned int taso:1;
33#endif 33#endif
34 unsigned int recursion_depth; 34 unsigned int recursion_depth; /* only for search_binary_handler() */
35 struct file * file; 35 struct file * file;
36 struct cred *cred; /* new credentials */ 36 struct cred *cred; /* new credentials */
37 int unsafe; /* how unsafe this exec is (mask of LSM_UNSAFE_*) */ 37 int unsafe; /* how unsafe this exec is (mask of LSM_UNSAFE_*) */
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 2fdb4a451b49..0e6f765aa1f5 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -862,6 +862,17 @@ static inline unsigned int blk_rq_get_max_sectors(struct request *rq)
862 return blk_queue_get_max_sectors(q, rq->cmd_flags); 862 return blk_queue_get_max_sectors(q, rq->cmd_flags);
863} 863}
864 864
865static inline unsigned int blk_rq_count_bios(struct request *rq)
866{
867 unsigned int nr_bios = 0;
868 struct bio *bio;
869
870 __rq_for_each_bio(bio, rq)
871 nr_bios++;
872
873 return nr_bios;
874}
875
865/* 876/*
866 * Request issue related functions. 877 * Request issue related functions.
867 */ 878 */
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 91fa9a94ae92..d77797a52b7b 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -36,6 +36,7 @@ enum bh_state_bits {
36 BH_Quiet, /* Buffer Error Prinks to be quiet */ 36 BH_Quiet, /* Buffer Error Prinks to be quiet */
37 BH_Meta, /* Buffer contains metadata */ 37 BH_Meta, /* Buffer contains metadata */
38 BH_Prio, /* Buffer should be submitted with REQ_PRIO */ 38 BH_Prio, /* Buffer should be submitted with REQ_PRIO */
39 BH_Defer_Completion, /* Defer AIO completion to workqueue */
39 40
40 BH_PrivateStart,/* not a state bit, but the first bit available 41 BH_PrivateStart,/* not a state bit, but the first bit available
41 * for private allocation by other entities 42 * for private allocation by other entities
@@ -128,6 +129,7 @@ BUFFER_FNS(Write_EIO, write_io_error)
128BUFFER_FNS(Unwritten, unwritten) 129BUFFER_FNS(Unwritten, unwritten)
129BUFFER_FNS(Meta, meta) 130BUFFER_FNS(Meta, meta)
130BUFFER_FNS(Prio, prio) 131BUFFER_FNS(Prio, prio)
132BUFFER_FNS(Defer_Completion, defer_completion)
131 133
132#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) 134#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK)
133 135
diff --git a/include/linux/can/platform/mcp251x.h b/include/linux/can/platform/mcp251x.h
index 089fe43211a4..dc029dba7a03 100644
--- a/include/linux/can/platform/mcp251x.h
+++ b/include/linux/can/platform/mcp251x.h
@@ -9,26 +9,13 @@
9 9
10#include <linux/spi/spi.h> 10#include <linux/spi/spi.h>
11 11
12/** 12/*
13 * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data 13 * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data
14 * @oscillator_frequency: - oscillator frequency in Hz 14 * @oscillator_frequency: - oscillator frequency in Hz
15 * @irq_flags: - IRQF configuration flags
16 * @board_specific_setup: - called before probing the chip (power,reset)
17 * @transceiver_enable: - called to power on/off the transceiver
18 * @power_enable: - called to power on/off the mcp *and* the
19 * transceiver
20 *
21 * Please note that you should define power_enable or transceiver_enable or
22 * none of them. Defining both of them is no use.
23 *
24 */ 15 */
25 16
26struct mcp251x_platform_data { 17struct mcp251x_platform_data {
27 unsigned long oscillator_frequency; 18 unsigned long oscillator_frequency;
28 unsigned long irq_flags;
29 int (*board_specific_setup)(struct spi_device *spi);
30 int (*transceiver_enable)(int enable);
31 int (*power_enable) (int enable);
32}; 19};
33 20
34#endif /* __CAN_PLATFORM_MCP251X_H__ */ 21#endif /* __CAN_PLATFORM_MCP251X_H__ */
diff --git a/include/linux/capability.h b/include/linux/capability.h
index d9a4f7f40f32..a6ee1f9a5018 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -210,7 +210,6 @@ extern bool has_ns_capability_noaudit(struct task_struct *t,
210 struct user_namespace *ns, int cap); 210 struct user_namespace *ns, int cap);
211extern bool capable(int cap); 211extern bool capable(int cap);
212extern bool ns_capable(struct user_namespace *ns, int cap); 212extern bool ns_capable(struct user_namespace *ns, int cap);
213extern bool nsown_capable(int cap);
214extern bool inode_capable(const struct inode *inode, int cap); 213extern bool inode_capable(const struct inode *inode, int cap);
215extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap); 214extern bool file_ns_capable(const struct file *file, struct user_namespace *ns, int cap);
216 215
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index ce6df39f60ff..8f47625a0661 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -335,6 +335,8 @@ extern int ceph_osdc_wait_request(struct ceph_osd_client *osdc,
335 struct ceph_osd_request *req); 335 struct ceph_osd_request *req);
336extern void ceph_osdc_sync(struct ceph_osd_client *osdc); 336extern void ceph_osdc_sync(struct ceph_osd_client *osdc);
337 337
338extern void ceph_osdc_flush_notifies(struct ceph_osd_client *osdc);
339
338extern int ceph_osdc_readpages(struct ceph_osd_client *osdc, 340extern int ceph_osdc_readpages(struct ceph_osd_client *osdc,
339 struct ceph_vino vino, 341 struct ceph_vino vino,
340 struct ceph_file_layout *layout, 342 struct ceph_file_layout *layout,
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index e9ac882868c0..3561d305b1e0 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -66,22 +66,25 @@ enum cgroup_subsys_id {
66 66
67/* Per-subsystem/per-cgroup state maintained by the system. */ 67/* Per-subsystem/per-cgroup state maintained by the system. */
68struct cgroup_subsys_state { 68struct cgroup_subsys_state {
69 /* 69 /* the cgroup that this css is attached to */
70 * The cgroup that this subsystem is attached to. Useful
71 * for subsystems that want to know about the cgroup
72 * hierarchy structure
73 */
74 struct cgroup *cgroup; 70 struct cgroup *cgroup;
75 71
72 /* the cgroup subsystem that this css is attached to */
73 struct cgroup_subsys *ss;
74
76 /* reference count - access via css_[try]get() and css_put() */ 75 /* reference count - access via css_[try]get() and css_put() */
77 struct percpu_ref refcnt; 76 struct percpu_ref refcnt;
78 77
78 /* the parent css */
79 struct cgroup_subsys_state *parent;
80
79 unsigned long flags; 81 unsigned long flags;
80 /* ID for this css, if possible */ 82 /* ID for this css, if possible */
81 struct css_id __rcu *id; 83 struct css_id __rcu *id;
82 84
83 /* Used to put @cgroup->dentry on the last css_put() */ 85 /* percpu_ref killing and RCU release */
84 struct work_struct dput_work; 86 struct rcu_head rcu_head;
87 struct work_struct destroy_work;
85}; 88};
86 89
87/* bits in struct cgroup_subsys_state flags field */ 90/* bits in struct cgroup_subsys_state flags field */
@@ -161,7 +164,16 @@ struct cgroup_name {
161struct cgroup { 164struct cgroup {
162 unsigned long flags; /* "unsigned long" so bitops work */ 165 unsigned long flags; /* "unsigned long" so bitops work */
163 166
164 int id; /* ida allocated in-hierarchy ID */ 167 /*
168 * idr allocated in-hierarchy ID.
169 *
170 * The ID of the root cgroup is always 0, and a new cgroup
171 * will be assigned with a smallest available ID.
172 */
173 int id;
174
175 /* the number of attached css's */
176 int nr_css;
165 177
166 /* 178 /*
167 * We link our 'sibling' struct into our parent's 'children'. 179 * We link our 'sibling' struct into our parent's 'children'.
@@ -196,7 +208,7 @@ struct cgroup {
196 struct cgroup_name __rcu *name; 208 struct cgroup_name __rcu *name;
197 209
198 /* Private pointers for each registered subsystem */ 210 /* Private pointers for each registered subsystem */
199 struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; 211 struct cgroup_subsys_state __rcu *subsys[CGROUP_SUBSYS_COUNT];
200 212
201 struct cgroupfs_root *root; 213 struct cgroupfs_root *root;
202 214
@@ -220,10 +232,12 @@ struct cgroup {
220 struct list_head pidlists; 232 struct list_head pidlists;
221 struct mutex pidlist_mutex; 233 struct mutex pidlist_mutex;
222 234
235 /* dummy css with NULL ->ss, points back to this cgroup */
236 struct cgroup_subsys_state dummy_css;
237
223 /* For css percpu_ref killing and RCU-protected deletion */ 238 /* For css percpu_ref killing and RCU-protected deletion */
224 struct rcu_head rcu_head; 239 struct rcu_head rcu_head;
225 struct work_struct destroy_work; 240 struct work_struct destroy_work;
226 atomic_t css_kill_cnt;
227 241
228 /* List of events which userspace want to receive */ 242 /* List of events which userspace want to receive */
229 struct list_head event_list; 243 struct list_head event_list;
@@ -322,7 +336,7 @@ struct cgroupfs_root {
322 unsigned long flags; 336 unsigned long flags;
323 337
324 /* IDs for cgroups in this hierarchy */ 338 /* IDs for cgroups in this hierarchy */
325 struct ida cgroup_ida; 339 struct idr cgroup_idr;
326 340
327 /* The path to use for release notifications. */ 341 /* The path to use for release notifications. */
328 char release_agent_path[PATH_MAX]; 342 char release_agent_path[PATH_MAX];
@@ -394,9 +408,10 @@ struct cgroup_map_cb {
394 408
395/* cftype->flags */ 409/* cftype->flags */
396enum { 410enum {
397 CFTYPE_ONLY_ON_ROOT = (1 << 0), /* only create on root cg */ 411 CFTYPE_ONLY_ON_ROOT = (1 << 0), /* only create on root cgrp */
398 CFTYPE_NOT_ON_ROOT = (1 << 1), /* don't create on root cg */ 412 CFTYPE_NOT_ON_ROOT = (1 << 1), /* don't create on root cgrp */
399 CFTYPE_INSANE = (1 << 2), /* don't create if sane_behavior */ 413 CFTYPE_INSANE = (1 << 2), /* don't create if sane_behavior */
414 CFTYPE_NO_PREFIX = (1 << 3), /* (DON'T USE FOR NEW FILES) no subsys prefix */
400}; 415};
401 416
402#define MAX_CFTYPE_NAME 64 417#define MAX_CFTYPE_NAME 64
@@ -424,35 +439,41 @@ struct cftype {
424 /* CFTYPE_* flags */ 439 /* CFTYPE_* flags */
425 unsigned int flags; 440 unsigned int flags;
426 441
442 /*
443 * The subsys this file belongs to. Initialized automatically
444 * during registration. NULL for cgroup core files.
445 */
446 struct cgroup_subsys *ss;
447
427 int (*open)(struct inode *inode, struct file *file); 448 int (*open)(struct inode *inode, struct file *file);
428 ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft, 449 ssize_t (*read)(struct cgroup_subsys_state *css, struct cftype *cft,
429 struct file *file, 450 struct file *file,
430 char __user *buf, size_t nbytes, loff_t *ppos); 451 char __user *buf, size_t nbytes, loff_t *ppos);
431 /* 452 /*
432 * read_u64() is a shortcut for the common case of returning a 453 * read_u64() is a shortcut for the common case of returning a
433 * single integer. Use it in place of read() 454 * single integer. Use it in place of read()
434 */ 455 */
435 u64 (*read_u64)(struct cgroup *cgrp, struct cftype *cft); 456 u64 (*read_u64)(struct cgroup_subsys_state *css, struct cftype *cft);
436 /* 457 /*
437 * read_s64() is a signed version of read_u64() 458 * read_s64() is a signed version of read_u64()
438 */ 459 */
439 s64 (*read_s64)(struct cgroup *cgrp, struct cftype *cft); 460 s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft);
440 /* 461 /*
441 * read_map() is used for defining a map of key/value 462 * read_map() is used for defining a map of key/value
442 * pairs. It should call cb->fill(cb, key, value) for each 463 * pairs. It should call cb->fill(cb, key, value) for each
443 * entry. The key/value pairs (and their ordering) should not 464 * entry. The key/value pairs (and their ordering) should not
444 * change between reboots. 465 * change between reboots.
445 */ 466 */
446 int (*read_map)(struct cgroup *cgrp, struct cftype *cft, 467 int (*read_map)(struct cgroup_subsys_state *css, struct cftype *cft,
447 struct cgroup_map_cb *cb); 468 struct cgroup_map_cb *cb);
448 /* 469 /*
449 * read_seq_string() is used for outputting a simple sequence 470 * read_seq_string() is used for outputting a simple sequence
450 * using seqfile. 471 * using seqfile.
451 */ 472 */
452 int (*read_seq_string)(struct cgroup *cgrp, struct cftype *cft, 473 int (*read_seq_string)(struct cgroup_subsys_state *css,
453 struct seq_file *m); 474 struct cftype *cft, struct seq_file *m);
454 475
455 ssize_t (*write)(struct cgroup *cgrp, struct cftype *cft, 476 ssize_t (*write)(struct cgroup_subsys_state *css, struct cftype *cft,
456 struct file *file, 477 struct file *file,
457 const char __user *buf, size_t nbytes, loff_t *ppos); 478 const char __user *buf, size_t nbytes, loff_t *ppos);
458 479
@@ -461,18 +482,20 @@ struct cftype {
461 * a single integer (as parsed by simple_strtoull) from 482 * a single integer (as parsed by simple_strtoull) from
462 * userspace. Use in place of write(); return 0 or error. 483 * userspace. Use in place of write(); return 0 or error.
463 */ 484 */
464 int (*write_u64)(struct cgroup *cgrp, struct cftype *cft, u64 val); 485 int (*write_u64)(struct cgroup_subsys_state *css, struct cftype *cft,
486 u64 val);
465 /* 487 /*
466 * write_s64() is a signed version of write_u64() 488 * write_s64() is a signed version of write_u64()
467 */ 489 */
468 int (*write_s64)(struct cgroup *cgrp, struct cftype *cft, s64 val); 490 int (*write_s64)(struct cgroup_subsys_state *css, struct cftype *cft,
491 s64 val);
469 492
470 /* 493 /*
471 * write_string() is passed a nul-terminated kernelspace 494 * write_string() is passed a nul-terminated kernelspace
472 * buffer of maximum length determined by max_write_len. 495 * buffer of maximum length determined by max_write_len.
473 * Returns 0 or -ve error code. 496 * Returns 0 or -ve error code.
474 */ 497 */
475 int (*write_string)(struct cgroup *cgrp, struct cftype *cft, 498 int (*write_string)(struct cgroup_subsys_state *css, struct cftype *cft,
476 const char *buffer); 499 const char *buffer);
477 /* 500 /*
478 * trigger() callback can be used to get some kick from the 501 * trigger() callback can be used to get some kick from the
@@ -480,7 +503,7 @@ struct cftype {
480 * at all. The private field can be used to determine the 503 * at all. The private field can be used to determine the
481 * kick type for multiplexing. 504 * kick type for multiplexing.
482 */ 505 */
483 int (*trigger)(struct cgroup *cgrp, unsigned int event); 506 int (*trigger)(struct cgroup_subsys_state *css, unsigned int event);
484 507
485 int (*release)(struct inode *inode, struct file *file); 508 int (*release)(struct inode *inode, struct file *file);
486 509
@@ -490,16 +513,18 @@ struct cftype {
490 * you want to provide this functionality. Use eventfd_signal() 513 * you want to provide this functionality. Use eventfd_signal()
491 * on eventfd to send notification to userspace. 514 * on eventfd to send notification to userspace.
492 */ 515 */
493 int (*register_event)(struct cgroup *cgrp, struct cftype *cft, 516 int (*register_event)(struct cgroup_subsys_state *css,
494 struct eventfd_ctx *eventfd, const char *args); 517 struct cftype *cft, struct eventfd_ctx *eventfd,
518 const char *args);
495 /* 519 /*
496 * unregister_event() callback will be called when userspace 520 * unregister_event() callback will be called when userspace
497 * closes the eventfd or on cgroup removing. 521 * closes the eventfd or on cgroup removing.
498 * This callback must be implemented, if you want provide 522 * This callback must be implemented, if you want provide
499 * notification functionality. 523 * notification functionality.
500 */ 524 */
501 void (*unregister_event)(struct cgroup *cgrp, struct cftype *cft, 525 void (*unregister_event)(struct cgroup_subsys_state *css,
502 struct eventfd_ctx *eventfd); 526 struct cftype *cft,
527 struct eventfd_ctx *eventfd);
503}; 528};
504 529
505/* 530/*
@@ -512,15 +537,6 @@ struct cftype_set {
512 struct cftype *cfts; 537 struct cftype *cfts;
513}; 538};
514 539
515struct cgroup_scanner {
516 struct cgroup *cg;
517 int (*test_task)(struct task_struct *p, struct cgroup_scanner *scan);
518 void (*process_task)(struct task_struct *p,
519 struct cgroup_scanner *scan);
520 struct ptr_heap *heap;
521 void *data;
522};
523
524/* 540/*
525 * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This 541 * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This
526 * function can be called as long as @cgrp is accessible. 542 * function can be called as long as @cgrp is accessible.
@@ -537,7 +553,7 @@ static inline const char *cgroup_name(const struct cgroup *cgrp)
537} 553}
538 554
539int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); 555int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
540int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); 556int cgroup_rm_cftypes(struct cftype *cfts);
541 557
542bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor); 558bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor);
543 559
@@ -553,20 +569,22 @@ int cgroup_task_count(const struct cgroup *cgrp);
553struct cgroup_taskset; 569struct cgroup_taskset;
554struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset); 570struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset);
555struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset); 571struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset);
556struct cgroup *cgroup_taskset_cur_cgroup(struct cgroup_taskset *tset); 572struct cgroup_subsys_state *cgroup_taskset_cur_css(struct cgroup_taskset *tset,
573 int subsys_id);
557int cgroup_taskset_size(struct cgroup_taskset *tset); 574int cgroup_taskset_size(struct cgroup_taskset *tset);
558 575
559/** 576/**
560 * cgroup_taskset_for_each - iterate cgroup_taskset 577 * cgroup_taskset_for_each - iterate cgroup_taskset
561 * @task: the loop cursor 578 * @task: the loop cursor
562 * @skip_cgrp: skip if task's cgroup matches this, %NULL to iterate through all 579 * @skip_css: skip if task's css matches this, %NULL to iterate through all
563 * @tset: taskset to iterate 580 * @tset: taskset to iterate
564 */ 581 */
565#define cgroup_taskset_for_each(task, skip_cgrp, tset) \ 582#define cgroup_taskset_for_each(task, skip_css, tset) \
566 for ((task) = cgroup_taskset_first((tset)); (task); \ 583 for ((task) = cgroup_taskset_first((tset)); (task); \
567 (task) = cgroup_taskset_next((tset))) \ 584 (task) = cgroup_taskset_next((tset))) \
568 if (!(skip_cgrp) || \ 585 if (!(skip_css) || \
569 cgroup_taskset_cur_cgroup((tset)) != (skip_cgrp)) 586 cgroup_taskset_cur_css((tset), \
587 (skip_css)->ss->subsys_id) != (skip_css))
570 588
571/* 589/*
572 * Control Group subsystem type. 590 * Control Group subsystem type.
@@ -574,18 +592,22 @@ int cgroup_taskset_size(struct cgroup_taskset *tset);
574 */ 592 */
575 593
576struct cgroup_subsys { 594struct cgroup_subsys {
577 struct cgroup_subsys_state *(*css_alloc)(struct cgroup *cgrp); 595 struct cgroup_subsys_state *(*css_alloc)(struct cgroup_subsys_state *parent_css);
578 int (*css_online)(struct cgroup *cgrp); 596 int (*css_online)(struct cgroup_subsys_state *css);
579 void (*css_offline)(struct cgroup *cgrp); 597 void (*css_offline)(struct cgroup_subsys_state *css);
580 void (*css_free)(struct cgroup *cgrp); 598 void (*css_free)(struct cgroup_subsys_state *css);
581 599
582 int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 600 int (*can_attach)(struct cgroup_subsys_state *css,
583 void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 601 struct cgroup_taskset *tset);
584 void (*attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 602 void (*cancel_attach)(struct cgroup_subsys_state *css,
603 struct cgroup_taskset *tset);
604 void (*attach)(struct cgroup_subsys_state *css,
605 struct cgroup_taskset *tset);
585 void (*fork)(struct task_struct *task); 606 void (*fork)(struct task_struct *task);
586 void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp, 607 void (*exit)(struct cgroup_subsys_state *css,
608 struct cgroup_subsys_state *old_css,
587 struct task_struct *task); 609 struct task_struct *task);
588 void (*bind)(struct cgroup *root); 610 void (*bind)(struct cgroup_subsys_state *root_css);
589 611
590 int subsys_id; 612 int subsys_id;
591 int disabled; 613 int disabled;
@@ -641,10 +663,17 @@ struct cgroup_subsys {
641#undef IS_SUBSYS_ENABLED 663#undef IS_SUBSYS_ENABLED
642#undef SUBSYS 664#undef SUBSYS
643 665
644static inline struct cgroup_subsys_state *cgroup_subsys_state( 666/**
645 struct cgroup *cgrp, int subsys_id) 667 * css_parent - find the parent css
668 * @css: the target cgroup_subsys_state
669 *
670 * Return the parent css of @css. This function is guaranteed to return
671 * non-NULL parent as long as @css isn't the root.
672 */
673static inline
674struct cgroup_subsys_state *css_parent(struct cgroup_subsys_state *css)
646{ 675{
647 return cgrp->subsys[subsys_id]; 676 return css->parent;
648} 677}
649 678
650/** 679/**
@@ -672,7 +701,7 @@ extern struct mutex cgroup_mutex;
672#endif 701#endif
673 702
674/** 703/**
675 * task_subsys_state_check - obtain css for (task, subsys) w/ extra access conds 704 * task_css_check - obtain css for (task, subsys) w/ extra access conds
676 * @task: the target task 705 * @task: the target task
677 * @subsys_id: the target subsystem ID 706 * @subsys_id: the target subsystem ID
678 * @__c: extra condition expression to be passed to rcu_dereference_check() 707 * @__c: extra condition expression to be passed to rcu_dereference_check()
@@ -680,7 +709,7 @@ extern struct mutex cgroup_mutex;
680 * Return the cgroup_subsys_state for the (@task, @subsys_id) pair. The 709 * Return the cgroup_subsys_state for the (@task, @subsys_id) pair. The
681 * synchronization rules are the same as task_css_set_check(). 710 * synchronization rules are the same as task_css_set_check().
682 */ 711 */
683#define task_subsys_state_check(task, subsys_id, __c) \ 712#define task_css_check(task, subsys_id, __c) \
684 task_css_set_check((task), (__c))->subsys[(subsys_id)] 713 task_css_set_check((task), (__c))->subsys[(subsys_id)]
685 714
686/** 715/**
@@ -695,87 +724,92 @@ static inline struct css_set *task_css_set(struct task_struct *task)
695} 724}
696 725
697/** 726/**
698 * task_subsys_state - obtain css for (task, subsys) 727 * task_css - obtain css for (task, subsys)
699 * @task: the target task 728 * @task: the target task
700 * @subsys_id: the target subsystem ID 729 * @subsys_id: the target subsystem ID
701 * 730 *
702 * See task_subsys_state_check(). 731 * See task_css_check().
703 */ 732 */
704static inline struct cgroup_subsys_state * 733static inline struct cgroup_subsys_state *task_css(struct task_struct *task,
705task_subsys_state(struct task_struct *task, int subsys_id) 734 int subsys_id)
706{ 735{
707 return task_subsys_state_check(task, subsys_id, false); 736 return task_css_check(task, subsys_id, false);
708} 737}
709 738
710static inline struct cgroup* task_cgroup(struct task_struct *task, 739static inline struct cgroup *task_cgroup(struct task_struct *task,
711 int subsys_id) 740 int subsys_id)
712{ 741{
713 return task_subsys_state(task, subsys_id)->cgroup; 742 return task_css(task, subsys_id)->cgroup;
714} 743}
715 744
716struct cgroup *cgroup_next_sibling(struct cgroup *pos); 745struct cgroup_subsys_state *css_next_child(struct cgroup_subsys_state *pos,
746 struct cgroup_subsys_state *parent);
747
748struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss);
717 749
718/** 750/**
719 * cgroup_for_each_child - iterate through children of a cgroup 751 * css_for_each_child - iterate through children of a css
720 * @pos: the cgroup * to use as the loop cursor 752 * @pos: the css * to use as the loop cursor
721 * @cgrp: cgroup whose children to walk 753 * @parent: css whose children to walk
722 * 754 *
723 * Walk @cgrp's children. Must be called under rcu_read_lock(). A child 755 * Walk @parent's children. Must be called under rcu_read_lock(). A child
724 * cgroup which hasn't finished ->css_online() or already has finished 756 * css which hasn't finished ->css_online() or already has finished
725 * ->css_offline() may show up during traversal and it's each subsystem's 757 * ->css_offline() may show up during traversal and it's each subsystem's
726 * responsibility to verify that each @pos is alive. 758 * responsibility to verify that each @pos is alive.
727 * 759 *
728 * If a subsystem synchronizes against the parent in its ->css_online() and 760 * If a subsystem synchronizes against the parent in its ->css_online() and
729 * before starting iterating, a cgroup which finished ->css_online() is 761 * before starting iterating, a css which finished ->css_online() is
730 * guaranteed to be visible in the future iterations. 762 * guaranteed to be visible in the future iterations.
731 * 763 *
732 * It is allowed to temporarily drop RCU read lock during iteration. The 764 * It is allowed to temporarily drop RCU read lock during iteration. The
733 * caller is responsible for ensuring that @pos remains accessible until 765 * caller is responsible for ensuring that @pos remains accessible until
734 * the start of the next iteration by, for example, bumping the css refcnt. 766 * the start of the next iteration by, for example, bumping the css refcnt.
735 */ 767 */
736#define cgroup_for_each_child(pos, cgrp) \ 768#define css_for_each_child(pos, parent) \
737 for ((pos) = list_first_or_null_rcu(&(cgrp)->children, \ 769 for ((pos) = css_next_child(NULL, (parent)); (pos); \
738 struct cgroup, sibling); \ 770 (pos) = css_next_child((pos), (parent)))
739 (pos); (pos) = cgroup_next_sibling((pos))) 771
772struct cgroup_subsys_state *
773css_next_descendant_pre(struct cgroup_subsys_state *pos,
774 struct cgroup_subsys_state *css);
740 775
741struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos, 776struct cgroup_subsys_state *
742 struct cgroup *cgroup); 777css_rightmost_descendant(struct cgroup_subsys_state *pos);
743struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos);
744 778
745/** 779/**
746 * cgroup_for_each_descendant_pre - pre-order walk of a cgroup's descendants 780 * css_for_each_descendant_pre - pre-order walk of a css's descendants
747 * @pos: the cgroup * to use as the loop cursor 781 * @pos: the css * to use as the loop cursor
748 * @cgroup: cgroup whose descendants to walk 782 * @root: css whose descendants to walk
749 * 783 *
750 * Walk @cgroup's descendants. Must be called under rcu_read_lock(). A 784 * Walk @root's descendants. @root is included in the iteration and the
751 * descendant cgroup which hasn't finished ->css_online() or already has 785 * first node to be visited. Must be called under rcu_read_lock(). A
786 * descendant css which hasn't finished ->css_online() or already has
752 * finished ->css_offline() may show up during traversal and it's each 787 * finished ->css_offline() may show up during traversal and it's each
753 * subsystem's responsibility to verify that each @pos is alive. 788 * subsystem's responsibility to verify that each @pos is alive.
754 * 789 *
755 * If a subsystem synchronizes against the parent in its ->css_online() and 790 * If a subsystem synchronizes against the parent in its ->css_online() and
756 * before starting iterating, and synchronizes against @pos on each 791 * before starting iterating, and synchronizes against @pos on each
757 * iteration, any descendant cgroup which finished ->css_online() is 792 * iteration, any descendant css which finished ->css_online() is
758 * guaranteed to be visible in the future iterations. 793 * guaranteed to be visible in the future iterations.
759 * 794 *
760 * In other words, the following guarantees that a descendant can't escape 795 * In other words, the following guarantees that a descendant can't escape
761 * state updates of its ancestors. 796 * state updates of its ancestors.
762 * 797 *
763 * my_online(@cgrp) 798 * my_online(@css)
764 * { 799 * {
765 * Lock @cgrp->parent and @cgrp; 800 * Lock @css's parent and @css;
766 * Inherit state from @cgrp->parent; 801 * Inherit state from the parent;
767 * Unlock both. 802 * Unlock both.
768 * } 803 * }
769 * 804 *
770 * my_update_state(@cgrp) 805 * my_update_state(@css)
771 * { 806 * {
772 * Lock @cgrp; 807 * css_for_each_descendant_pre(@pos, @css) {
773 * Update @cgrp's state;
774 * Unlock @cgrp;
775 *
776 * cgroup_for_each_descendant_pre(@pos, @cgrp) {
777 * Lock @pos; 808 * Lock @pos;
778 * Verify @pos is alive and inherit state from @pos->parent; 809 * if (@pos == @css)
810 * Update @css's state;
811 * else
812 * Verify @pos is alive and inherit state from its parent;
779 * Unlock @pos; 813 * Unlock @pos;
780 * } 814 * }
781 * } 815 * }
@@ -786,8 +820,7 @@ struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos);
786 * visible by walking order and, as long as inheriting operations to the 820 * visible by walking order and, as long as inheriting operations to the
787 * same @pos are atomic to each other, multiple updates racing each other 821 * same @pos are atomic to each other, multiple updates racing each other
788 * still result in the correct state. It's guaranateed that at least one 822 * still result in the correct state. It's guaranateed that at least one
789 * inheritance happens for any cgroup after the latest update to its 823 * inheritance happens for any css after the latest update to its parent.
790 * parent.
791 * 824 *
792 * If checking parent's state requires locking the parent, each inheriting 825 * If checking parent's state requires locking the parent, each inheriting
793 * iteration should lock and unlock both @pos->parent and @pos. 826 * iteration should lock and unlock both @pos->parent and @pos.
@@ -800,52 +833,45 @@ struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos);
800 * caller is responsible for ensuring that @pos remains accessible until 833 * caller is responsible for ensuring that @pos remains accessible until
801 * the start of the next iteration by, for example, bumping the css refcnt. 834 * the start of the next iteration by, for example, bumping the css refcnt.
802 */ 835 */
803#define cgroup_for_each_descendant_pre(pos, cgroup) \ 836#define css_for_each_descendant_pre(pos, css) \
804 for (pos = cgroup_next_descendant_pre(NULL, (cgroup)); (pos); \ 837 for ((pos) = css_next_descendant_pre(NULL, (css)); (pos); \
805 pos = cgroup_next_descendant_pre((pos), (cgroup))) 838 (pos) = css_next_descendant_pre((pos), (css)))
806 839
807struct cgroup *cgroup_next_descendant_post(struct cgroup *pos, 840struct cgroup_subsys_state *
808 struct cgroup *cgroup); 841css_next_descendant_post(struct cgroup_subsys_state *pos,
842 struct cgroup_subsys_state *css);
809 843
810/** 844/**
811 * cgroup_for_each_descendant_post - post-order walk of a cgroup's descendants 845 * css_for_each_descendant_post - post-order walk of a css's descendants
812 * @pos: the cgroup * to use as the loop cursor 846 * @pos: the css * to use as the loop cursor
813 * @cgroup: cgroup whose descendants to walk 847 * @css: css whose descendants to walk
814 * 848 *
815 * Similar to cgroup_for_each_descendant_pre() but performs post-order 849 * Similar to css_for_each_descendant_pre() but performs post-order
816 * traversal instead. Note that the walk visibility guarantee described in 850 * traversal instead. @root is included in the iteration and the last
817 * pre-order walk doesn't apply the same to post-order walks. 851 * node to be visited. Note that the walk visibility guarantee described
852 * in pre-order walk doesn't apply the same to post-order walks.
818 */ 853 */
819#define cgroup_for_each_descendant_post(pos, cgroup) \ 854#define css_for_each_descendant_post(pos, css) \
820 for (pos = cgroup_next_descendant_post(NULL, (cgroup)); (pos); \ 855 for ((pos) = css_next_descendant_post(NULL, (css)); (pos); \
821 pos = cgroup_next_descendant_post((pos), (cgroup))) 856 (pos) = css_next_descendant_post((pos), (css)))
822 857
823/* A cgroup_iter should be treated as an opaque object */ 858/* A css_task_iter should be treated as an opaque object */
824struct cgroup_iter { 859struct css_task_iter {
825 struct list_head *cset_link; 860 struct cgroup_subsys_state *origin_css;
826 struct list_head *task; 861 struct list_head *cset_link;
862 struct list_head *task;
827}; 863};
828 864
829/* 865void css_task_iter_start(struct cgroup_subsys_state *css,
830 * To iterate across the tasks in a cgroup: 866 struct css_task_iter *it);
831 * 867struct task_struct *css_task_iter_next(struct css_task_iter *it);
832 * 1) call cgroup_iter_start to initialize an iterator 868void css_task_iter_end(struct css_task_iter *it);
833 * 869
834 * 2) call cgroup_iter_next() to retrieve member tasks until it 870int css_scan_tasks(struct cgroup_subsys_state *css,
835 * returns NULL or until you want to end the iteration 871 bool (*test)(struct task_struct *, void *),
836 * 872 void (*process)(struct task_struct *, void *),
837 * 3) call cgroup_iter_end() to destroy the iterator. 873 void *data, struct ptr_heap *heap);
838 * 874
839 * Or, call cgroup_scan_tasks() to iterate through every task in a
840 * cgroup - cgroup_scan_tasks() holds the css_set_lock when calling
841 * the test_task() callback, but not while calling the process_task()
842 * callback.
843 */
844void cgroup_iter_start(struct cgroup *cgrp, struct cgroup_iter *it);
845struct task_struct *cgroup_iter_next(struct cgroup *cgrp,
846 struct cgroup_iter *it);
847void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it);
848int cgroup_scan_tasks(struct cgroup_scanner *scan);
849int cgroup_attach_task_all(struct task_struct *from, struct task_struct *); 875int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
850int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from); 876int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);
851 877
@@ -878,7 +904,8 @@ bool css_is_ancestor(struct cgroup_subsys_state *cg,
878 904
879/* Get id and depth of css */ 905/* Get id and depth of css */
880unsigned short css_id(struct cgroup_subsys_state *css); 906unsigned short css_id(struct cgroup_subsys_state *css);
881struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id); 907struct cgroup_subsys_state *css_from_dir(struct dentry *dentry,
908 struct cgroup_subsys *ss);
882 909
883#else /* !CONFIG_CGROUPS */ 910#else /* !CONFIG_CGROUPS */
884 911
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
index dd7adff76e81..8138c94409f3 100644
--- a/include/linux/clk-private.h
+++ b/include/linux/clk-private.h
@@ -33,8 +33,11 @@ struct clk {
33 const char **parent_names; 33 const char **parent_names;
34 struct clk **parents; 34 struct clk **parents;
35 u8 num_parents; 35 u8 num_parents;
36 u8 new_parent_index;
36 unsigned long rate; 37 unsigned long rate;
37 unsigned long new_rate; 38 unsigned long new_rate;
39 struct clk *new_parent;
40 struct clk *new_child;
38 unsigned long flags; 41 unsigned long flags;
39 unsigned int enable_count; 42 unsigned int enable_count;
40 unsigned int prepare_count; 43 unsigned int prepare_count;
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 1ec14a732176..73bdb69f0c08 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -12,6 +12,7 @@
12#define __LINUX_CLK_PROVIDER_H 12#define __LINUX_CLK_PROVIDER_H
13 13
14#include <linux/clk.h> 14#include <linux/clk.h>
15#include <linux/io.h>
15 16
16#ifdef CONFIG_COMMON_CLK 17#ifdef CONFIG_COMMON_CLK
17 18
@@ -27,6 +28,7 @@
27#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */ 28#define CLK_IS_ROOT BIT(4) /* root clk, has no parent */
28#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */ 29#define CLK_IS_BASIC BIT(5) /* Basic clk, can't do a to_clk_foo() */
29#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */ 30#define CLK_GET_RATE_NOCACHE BIT(6) /* do not use the cached clk rate */
31#define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */
30 32
31struct clk_hw; 33struct clk_hw;
32 34
@@ -79,6 +81,10 @@ struct clk_hw;
79 * @round_rate: Given a target rate as input, returns the closest rate actually 81 * @round_rate: Given a target rate as input, returns the closest rate actually
80 * supported by the clock. 82 * supported by the clock.
81 * 83 *
84 * @determine_rate: Given a target rate as input, returns the closest rate
85 * actually supported by the clock, and optionally the parent clock
86 * that should be used to provide the clock rate.
87 *
82 * @get_parent: Queries the hardware to determine the parent of a clock. The 88 * @get_parent: Queries the hardware to determine the parent of a clock. The
83 * return value is a u8 which specifies the index corresponding to 89 * return value is a u8 which specifies the index corresponding to
84 * the parent clock. This index can be applied to either the 90 * the parent clock. This index can be applied to either the
@@ -126,6 +132,9 @@ struct clk_ops {
126 unsigned long parent_rate); 132 unsigned long parent_rate);
127 long (*round_rate)(struct clk_hw *hw, unsigned long, 133 long (*round_rate)(struct clk_hw *hw, unsigned long,
128 unsigned long *); 134 unsigned long *);
135 long (*determine_rate)(struct clk_hw *hw, unsigned long rate,
136 unsigned long *best_parent_rate,
137 struct clk **best_parent_clk);
129 int (*set_parent)(struct clk_hw *hw, u8 index); 138 int (*set_parent)(struct clk_hw *hw, u8 index);
130 u8 (*get_parent)(struct clk_hw *hw); 139 u8 (*get_parent)(struct clk_hw *hw);
131 int (*set_rate)(struct clk_hw *hw, unsigned long, 140 int (*set_rate)(struct clk_hw *hw, unsigned long,
@@ -327,8 +336,10 @@ struct clk_mux {
327#define CLK_MUX_INDEX_ONE BIT(0) 336#define CLK_MUX_INDEX_ONE BIT(0)
328#define CLK_MUX_INDEX_BIT BIT(1) 337#define CLK_MUX_INDEX_BIT BIT(1)
329#define CLK_MUX_HIWORD_MASK BIT(2) 338#define CLK_MUX_HIWORD_MASK BIT(2)
339#define CLK_MUX_READ_ONLY BIT(3) /* mux setting cannot be changed */
330 340
331extern const struct clk_ops clk_mux_ops; 341extern const struct clk_ops clk_mux_ops;
342extern const struct clk_ops clk_mux_ro_ops;
332 343
333struct clk *clk_register_mux(struct device *dev, const char *name, 344struct clk *clk_register_mux(struct device *dev, const char *name,
334 const char **parent_names, u8 num_parents, unsigned long flags, 345 const char **parent_names, u8 num_parents, unsigned long flags,
@@ -418,6 +429,7 @@ const char *__clk_get_name(struct clk *clk);
418struct clk_hw *__clk_get_hw(struct clk *clk); 429struct clk_hw *__clk_get_hw(struct clk *clk);
419u8 __clk_get_num_parents(struct clk *clk); 430u8 __clk_get_num_parents(struct clk *clk);
420struct clk *__clk_get_parent(struct clk *clk); 431struct clk *__clk_get_parent(struct clk *clk);
432struct clk *clk_get_parent_by_index(struct clk *clk, u8 index);
421unsigned int __clk_get_enable_count(struct clk *clk); 433unsigned int __clk_get_enable_count(struct clk *clk);
422unsigned int __clk_get_prepare_count(struct clk *clk); 434unsigned int __clk_get_prepare_count(struct clk *clk);
423unsigned long __clk_get_rate(struct clk *clk); 435unsigned long __clk_get_rate(struct clk *clk);
@@ -425,6 +437,9 @@ unsigned long __clk_get_flags(struct clk *clk);
425bool __clk_is_prepared(struct clk *clk); 437bool __clk_is_prepared(struct clk *clk);
426bool __clk_is_enabled(struct clk *clk); 438bool __clk_is_enabled(struct clk *clk);
427struct clk *__clk_lookup(const char *name); 439struct clk *__clk_lookup(const char *name);
440long __clk_mux_determine_rate(struct clk_hw *hw, unsigned long rate,
441 unsigned long *best_parent_rate,
442 struct clk **best_parent_p);
428 443
429/* 444/*
430 * FIXME clock api without lock protection 445 * FIXME clock api without lock protection
@@ -490,5 +505,21 @@ static inline const char *of_clk_get_parent_name(struct device_node *np,
490#define of_clk_init(matches) \ 505#define of_clk_init(matches) \
491 { while (0); } 506 { while (0); }
492#endif /* CONFIG_OF */ 507#endif /* CONFIG_OF */
508
509/*
510 * wrap access to peripherals in accessor routines
511 * for improved portability across platforms
512 */
513
514static inline u32 clk_readl(u32 __iomem *reg)
515{
516 return readl(reg);
517}
518
519static inline void clk_writel(u32 val, u32 __iomem *reg)
520{
521 writel(val, reg);
522}
523
493#endif /* CONFIG_COMMON_CLK */ 524#endif /* CONFIG_COMMON_CLK */
494#endif /* CLK_PROVIDER_H */ 525#endif /* CLK_PROVIDER_H */
diff --git a/include/linux/cmdline-parser.h b/include/linux/cmdline-parser.h
new file mode 100644
index 000000000000..98e892ef6d5a
--- /dev/null
+++ b/include/linux/cmdline-parser.h
@@ -0,0 +1,43 @@
1/*
2 * Parsing command line, get the partitions information.
3 *
4 * Written by Cai Zhiyong <caizhiyong@huawei.com>
5 *
6 */
7#ifndef CMDLINEPARSEH
8#define CMDLINEPARSEH
9
10#include <linux/blkdev.h>
11
12/* partition flags */
13#define PF_RDONLY 0x01 /* Device is read only */
14#define PF_POWERUP_LOCK 0x02 /* Always locked after reset */
15
16struct cmdline_subpart {
17 char name[BDEVNAME_SIZE]; /* partition name, such as 'rootfs' */
18 sector_t from;
19 sector_t size;
20 int flags;
21 struct cmdline_subpart *next_subpart;
22};
23
24struct cmdline_parts {
25 char name[BDEVNAME_SIZE]; /* block device, such as 'mmcblk0' */
26 unsigned int nr_subparts;
27 struct cmdline_subpart *subpart;
28 struct cmdline_parts *next_parts;
29};
30
31void cmdline_parts_free(struct cmdline_parts **parts);
32
33int cmdline_parts_parse(struct cmdline_parts **parts, const char *cmdline);
34
35struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
36 const char *bdev);
37
38void cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
39 int slot,
40 int (*add_part)(int, struct cmdline_subpart *, void *),
41 void *param);
42
43#endif /* CMDLINEPARSEH */
diff --git a/include/linux/coda.h b/include/linux/coda.h
index cff544f81105..d30209b9cef8 100644
--- a/include/linux/coda.h
+++ b/include/linux/coda.h
@@ -60,7 +60,6 @@ Mellon the rights to redistribute these changes without encumbrance.
60 60
61#if defined(__linux__) 61#if defined(__linux__)
62typedef unsigned long long u_quad_t; 62typedef unsigned long long u_quad_t;
63#else
64#endif 63#endif
65#include <uapi/linux/coda.h> 64#include <uapi/linux/coda.h>
66#endif 65#endif
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 7f0c1dd09079..345da00a86e0 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -43,6 +43,7 @@
43#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \ 43#define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
44 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ 44 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
45 static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));\ 45 static inline long C_SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
46 asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__));\
46 asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))\ 47 asmlinkage long compat_SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__))\
47 { \ 48 { \
48 return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \ 49 return C_SYSC##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__)); \
@@ -669,6 +670,13 @@ asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr,
669 670
670int compat_restore_altstack(const compat_stack_t __user *uss); 671int compat_restore_altstack(const compat_stack_t __user *uss);
671int __compat_save_altstack(compat_stack_t __user *, unsigned long); 672int __compat_save_altstack(compat_stack_t __user *, unsigned long);
673#define compat_save_altstack_ex(uss, sp) do { \
674 compat_stack_t __user *__uss = uss; \
675 struct task_struct *t = current; \
676 put_user_ex(ptr_to_compat((void __user *)t->sas_ss_sp), &__uss->ss_sp); \
677 put_user_ex(sas_ss_flags(sp), &__uss->ss_flags); \
678 put_user_ex(t->sas_ss_size, &__uss->ss_size); \
679} while (0);
672 680
673asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, 681asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid,
674 struct compat_timespec __user *interval); 682 struct compat_timespec __user *interval);
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
index 842de225055f..ded429966c1f 100644
--- a/include/linux/compiler-gcc4.h
+++ b/include/linux/compiler-gcc4.h
@@ -65,6 +65,21 @@
65#define __visible __attribute__((externally_visible)) 65#define __visible __attribute__((externally_visible))
66#endif 66#endif
67 67
68/*
69 * GCC 'asm goto' miscompiles certain code sequences:
70 *
71 * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
72 *
73 * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
74 * Fixed in GCC 4.8.2 and later versions.
75 *
76 * (asm goto is automatically volatile - the naming reflects this.)
77 */
78#if GCC_VERSION <= 40801
79# define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
80#else
81# define asm_volatile_goto(x...) do { asm goto(x); } while (0)
82#endif
68 83
69#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP 84#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
70#if GCC_VERSION >= 40400 85#if GCC_VERSION >= 40400
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
index fc09d7b0dacf..158158704c30 100644
--- a/include/linux/context_tracking.h
+++ b/include/linux/context_tracking.h
@@ -2,100 +2,110 @@
2#define _LINUX_CONTEXT_TRACKING_H 2#define _LINUX_CONTEXT_TRACKING_H
3 3
4#include <linux/sched.h> 4#include <linux/sched.h>
5#include <linux/percpu.h>
6#include <linux/vtime.h> 5#include <linux/vtime.h>
6#include <linux/context_tracking_state.h>
7#include <asm/ptrace.h> 7#include <asm/ptrace.h>
8 8
9struct context_tracking {
10 /*
11 * When active is false, probes are unset in order
12 * to minimize overhead: TIF flags are cleared
13 * and calls to user_enter/exit are ignored. This
14 * may be further optimized using static keys.
15 */
16 bool active;
17 enum ctx_state {
18 IN_KERNEL = 0,
19 IN_USER,
20 } state;
21};
22
23static inline void __guest_enter(void)
24{
25 /*
26 * This is running in ioctl context so we can avoid
27 * the call to vtime_account() with its unnecessary idle check.
28 */
29 vtime_account_system(current);
30 current->flags |= PF_VCPU;
31}
32
33static inline void __guest_exit(void)
34{
35 /*
36 * This is running in ioctl context so we can avoid
37 * the call to vtime_account() with its unnecessary idle check.
38 */
39 vtime_account_system(current);
40 current->flags &= ~PF_VCPU;
41}
42 9
43#ifdef CONFIG_CONTEXT_TRACKING 10#ifdef CONFIG_CONTEXT_TRACKING
44DECLARE_PER_CPU(struct context_tracking, context_tracking); 11extern void context_tracking_cpu_set(int cpu);
45 12
46static inline bool context_tracking_in_user(void) 13extern void context_tracking_user_enter(void);
14extern void context_tracking_user_exit(void);
15extern void __context_tracking_task_switch(struct task_struct *prev,
16 struct task_struct *next);
17
18static inline void user_enter(void)
47{ 19{
48 return __this_cpu_read(context_tracking.state) == IN_USER; 20 if (static_key_false(&context_tracking_enabled))
49} 21 context_tracking_user_enter();
50 22
51static inline bool context_tracking_active(void) 23}
24static inline void user_exit(void)
52{ 25{
53 return __this_cpu_read(context_tracking.active); 26 if (static_key_false(&context_tracking_enabled))
27 context_tracking_user_exit();
54} 28}
55 29
56extern void user_enter(void);
57extern void user_exit(void);
58
59extern void guest_enter(void);
60extern void guest_exit(void);
61
62static inline enum ctx_state exception_enter(void) 30static inline enum ctx_state exception_enter(void)
63{ 31{
64 enum ctx_state prev_ctx; 32 enum ctx_state prev_ctx;
65 33
34 if (!static_key_false(&context_tracking_enabled))
35 return 0;
36
66 prev_ctx = this_cpu_read(context_tracking.state); 37 prev_ctx = this_cpu_read(context_tracking.state);
67 user_exit(); 38 context_tracking_user_exit();
68 39
69 return prev_ctx; 40 return prev_ctx;
70} 41}
71 42
72static inline void exception_exit(enum ctx_state prev_ctx) 43static inline void exception_exit(enum ctx_state prev_ctx)
73{ 44{
74 if (prev_ctx == IN_USER) 45 if (static_key_false(&context_tracking_enabled)) {
75 user_enter(); 46 if (prev_ctx == IN_USER)
47 context_tracking_user_enter();
48 }
76} 49}
77 50
78extern void context_tracking_task_switch(struct task_struct *prev, 51static inline void context_tracking_task_switch(struct task_struct *prev,
79 struct task_struct *next); 52 struct task_struct *next)
53{
54 if (static_key_false(&context_tracking_enabled))
55 __context_tracking_task_switch(prev, next);
56}
80#else 57#else
81static inline bool context_tracking_in_user(void) { return false; }
82static inline void user_enter(void) { } 58static inline void user_enter(void) { }
83static inline void user_exit(void) { } 59static inline void user_exit(void) { }
60static inline enum ctx_state exception_enter(void) { return 0; }
61static inline void exception_exit(enum ctx_state prev_ctx) { }
62static inline void context_tracking_task_switch(struct task_struct *prev,
63 struct task_struct *next) { }
64#endif /* !CONFIG_CONTEXT_TRACKING */
65
66
67#ifdef CONFIG_CONTEXT_TRACKING_FORCE
68extern void context_tracking_init(void);
69#else
70static inline void context_tracking_init(void) { }
71#endif /* CONFIG_CONTEXT_TRACKING_FORCE */
72
84 73
74#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
85static inline void guest_enter(void) 75static inline void guest_enter(void)
86{ 76{
87 __guest_enter(); 77 if (vtime_accounting_enabled())
78 vtime_guest_enter(current);
79 else
80 current->flags |= PF_VCPU;
88} 81}
89 82
90static inline void guest_exit(void) 83static inline void guest_exit(void)
91{ 84{
92 __guest_exit(); 85 if (vtime_accounting_enabled())
86 vtime_guest_exit(current);
87 else
88 current->flags &= ~PF_VCPU;
93} 89}
94 90
95static inline enum ctx_state exception_enter(void) { return 0; } 91#else
96static inline void exception_exit(enum ctx_state prev_ctx) { } 92static inline void guest_enter(void)
97static inline void context_tracking_task_switch(struct task_struct *prev, 93{
98 struct task_struct *next) { } 94 /*
99#endif /* !CONFIG_CONTEXT_TRACKING */ 95 * This is running in ioctl context so its safe
96 * to assume that it's the stime pending cputime
97 * to flush.
98 */
99 vtime_account_system(current);
100 current->flags |= PF_VCPU;
101}
102
103static inline void guest_exit(void)
104{
105 /* Flush the guest cputime we spent on the guest */
106 vtime_account_system(current);
107 current->flags &= ~PF_VCPU;
108}
109#endif /* CONFIG_VIRT_CPU_ACCOUNTING_GEN */
100 110
101#endif 111#endif
diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h
new file mode 100644
index 000000000000..0f1979d0674f
--- /dev/null
+++ b/include/linux/context_tracking_state.h
@@ -0,0 +1,39 @@
1#ifndef _LINUX_CONTEXT_TRACKING_STATE_H
2#define _LINUX_CONTEXT_TRACKING_STATE_H
3
4#include <linux/percpu.h>
5#include <linux/static_key.h>
6
7struct context_tracking {
8 /*
9 * When active is false, probes are unset in order
10 * to minimize overhead: TIF flags are cleared
11 * and calls to user_enter/exit are ignored. This
12 * may be further optimized using static keys.
13 */
14 bool active;
15 enum ctx_state {
16 IN_KERNEL = 0,
17 IN_USER,
18 } state;
19};
20
21#ifdef CONFIG_CONTEXT_TRACKING
22extern struct static_key context_tracking_enabled;
23DECLARE_PER_CPU(struct context_tracking, context_tracking);
24
25static inline bool context_tracking_in_user(void)
26{
27 return __this_cpu_read(context_tracking.state) == IN_USER;
28}
29
30static inline bool context_tracking_active(void)
31{
32 return __this_cpu_read(context_tracking.active);
33}
34#else
35static inline bool context_tracking_in_user(void) { return false; }
36static inline bool context_tracking_active(void) { return false; }
37#endif /* CONFIG_CONTEXT_TRACKING */
38
39#endif
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index ab0eade73039..801ff9e73679 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -28,6 +28,7 @@ struct cpu {
28extern int register_cpu(struct cpu *cpu, int num); 28extern int register_cpu(struct cpu *cpu, int num);
29extern struct device *get_cpu_device(unsigned cpu); 29extern struct device *get_cpu_device(unsigned cpu);
30extern bool cpu_is_hotpluggable(unsigned cpu); 30extern bool cpu_is_hotpluggable(unsigned cpu);
31extern bool arch_match_cpu_phys_id(int cpu, u64 phys_id);
31 32
32extern int cpu_add_dev_attr(struct device_attribute *attr); 33extern int cpu_add_dev_attr(struct device_attribute *attr);
33extern void cpu_remove_dev_attr(struct device_attribute *attr); 34extern void cpu_remove_dev_attr(struct device_attribute *attr);
@@ -172,6 +173,8 @@ extern struct bus_type cpu_subsys;
172#ifdef CONFIG_HOTPLUG_CPU 173#ifdef CONFIG_HOTPLUG_CPU
173/* Stop CPUs going up and down. */ 174/* Stop CPUs going up and down. */
174 175
176extern void cpu_hotplug_begin(void);
177extern void cpu_hotplug_done(void);
175extern void get_online_cpus(void); 178extern void get_online_cpus(void);
176extern void put_online_cpus(void); 179extern void put_online_cpus(void);
177extern void cpu_hotplug_disable(void); 180extern void cpu_hotplug_disable(void);
@@ -197,6 +200,8 @@ static inline void cpu_hotplug_driver_unlock(void)
197 200
198#else /* CONFIG_HOTPLUG_CPU */ 201#else /* CONFIG_HOTPLUG_CPU */
199 202
203static inline void cpu_hotplug_begin(void) {}
204static inline void cpu_hotplug_done(void) {}
200#define get_online_cpus() do { } while (0) 205#define get_online_cpus() do { } while (0)
201#define put_online_cpus() do { } while (0) 206#define put_online_cpus() do { } while (0)
202#define cpu_hotplug_disable() do { } while (0) 207#define cpu_hotplug_disable() do { } while (0)
diff --git a/include/linux/cpu_rmap.h b/include/linux/cpu_rmap.h
index 1739510d8994..bdd18caa6c94 100644
--- a/include/linux/cpu_rmap.h
+++ b/include/linux/cpu_rmap.h
@@ -52,8 +52,6 @@ static inline void *cpu_rmap_lookup_obj(struct cpu_rmap *rmap, unsigned int cpu)
52 return rmap->obj[rmap->near[cpu].index]; 52 return rmap->obj[rmap->near[cpu].index];
53} 53}
54 54
55#ifdef CONFIG_GENERIC_HARDIRQS
56
57/** 55/**
58 * alloc_irq_cpu_rmap - allocate CPU affinity reverse-map for IRQs 56 * alloc_irq_cpu_rmap - allocate CPU affinity reverse-map for IRQs
59 * @size: Number of objects to be mapped 57 * @size: Number of objects to be mapped
@@ -68,5 +66,4 @@ extern void free_irq_cpu_rmap(struct cpu_rmap *rmap);
68 66
69extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq); 67extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq);
70 68
71#endif
72#endif /* __LINUX_CPU_RMAP_H */ 69#endif /* __LINUX_CPU_RMAP_H */
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 90d5a15120d5..fcabc42d66ab 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -11,71 +11,36 @@
11#ifndef _LINUX_CPUFREQ_H 11#ifndef _LINUX_CPUFREQ_H
12#define _LINUX_CPUFREQ_H 12#define _LINUX_CPUFREQ_H
13 13
14#include <asm/cputime.h> 14#include <linux/cpumask.h>
15#include <linux/mutex.h> 15#include <linux/completion.h>
16#include <linux/notifier.h>
17#include <linux/threads.h>
18#include <linux/kobject.h> 16#include <linux/kobject.h>
17#include <linux/notifier.h>
19#include <linux/sysfs.h> 18#include <linux/sysfs.h>
20#include <linux/completion.h>
21#include <linux/workqueue.h>
22#include <linux/cpumask.h>
23#include <asm/div64.h>
24
25#define CPUFREQ_NAME_LEN 16
26/* Print length for names. Extra 1 space for accomodating '\n' in prints */
27#define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1)
28 19
29/********************************************************************* 20/*********************************************************************
30 * CPUFREQ NOTIFIER INTERFACE * 21 * CPUFREQ INTERFACE *
31 *********************************************************************/ 22 *********************************************************************/
32 23/*
33#define CPUFREQ_TRANSITION_NOTIFIER (0) 24 * Frequency values here are CPU kHz
34#define CPUFREQ_POLICY_NOTIFIER (1) 25 *
35
36#ifdef CONFIG_CPU_FREQ
37int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);
38int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
39extern void disable_cpufreq(void);
40#else /* CONFIG_CPU_FREQ */
41static inline int cpufreq_register_notifier(struct notifier_block *nb,
42 unsigned int list)
43{
44 return 0;
45}
46static inline int cpufreq_unregister_notifier(struct notifier_block *nb,
47 unsigned int list)
48{
49 return 0;
50}
51static inline void disable_cpufreq(void) { }
52#endif /* CONFIG_CPU_FREQ */
53
54/* if (cpufreq_driver->target) exists, the ->governor decides what frequency
55 * within the limits is used. If (cpufreq_driver->setpolicy> exists, these
56 * two generic policies are available:
57 */
58
59#define CPUFREQ_POLICY_POWERSAVE (1)
60#define CPUFREQ_POLICY_PERFORMANCE (2)
61
62/* Frequency values here are CPU kHz so that hardware which doesn't run
63 * with some frequencies can complain without having to guess what per
64 * cent / per mille means.
65 * Maximum transition latency is in nanoseconds - if it's unknown, 26 * Maximum transition latency is in nanoseconds - if it's unknown,
66 * CPUFREQ_ETERNAL shall be used. 27 * CPUFREQ_ETERNAL shall be used.
67 */ 28 */
68 29
30#define CPUFREQ_ETERNAL (-1)
31#define CPUFREQ_NAME_LEN 16
32/* Print length for names. Extra 1 space for accomodating '\n' in prints */
33#define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1)
34
69struct cpufreq_governor; 35struct cpufreq_governor;
70 36
71/* /sys/devices/system/cpu/cpufreq: entry point for global variables */ 37struct cpufreq_freqs {
72extern struct kobject *cpufreq_global_kobject; 38 unsigned int cpu; /* cpu nr */
73int cpufreq_get_global_kobject(void); 39 unsigned int old;
74void cpufreq_put_global_kobject(void); 40 unsigned int new;
75int cpufreq_sysfs_create_file(const struct attribute *attr); 41 u8 flags; /* flags of cpufreq_driver, see below. */
76void cpufreq_sysfs_remove_file(const struct attribute *attr); 42};
77 43
78#define CPUFREQ_ETERNAL (-1)
79struct cpufreq_cpuinfo { 44struct cpufreq_cpuinfo {
80 unsigned int max_freq; 45 unsigned int max_freq;
81 unsigned int min_freq; 46 unsigned int min_freq;
@@ -117,123 +82,102 @@ struct cpufreq_policy {
117 82
118 struct cpufreq_real_policy user_policy; 83 struct cpufreq_real_policy user_policy;
119 84
85 struct list_head policy_list;
120 struct kobject kobj; 86 struct kobject kobj;
121 struct completion kobj_unregister; 87 struct completion kobj_unregister;
122 int transition_ongoing; /* Tracks transition status */
123}; 88};
124 89
125#define CPUFREQ_ADJUST (0)
126#define CPUFREQ_INCOMPATIBLE (1)
127#define CPUFREQ_NOTIFY (2)
128#define CPUFREQ_START (3)
129#define CPUFREQ_UPDATE_POLICY_CPU (4)
130
131/* Only for ACPI */ 90/* Only for ACPI */
132#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ 91#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */
133#define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ 92#define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */
134#define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */ 93#define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */
135#define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ 94#define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/
136 95
96struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);
97void cpufreq_cpu_put(struct cpufreq_policy *policy);
98
137static inline bool policy_is_shared(struct cpufreq_policy *policy) 99static inline bool policy_is_shared(struct cpufreq_policy *policy)
138{ 100{
139 return cpumask_weight(policy->cpus) > 1; 101 return cpumask_weight(policy->cpus) > 1;
140} 102}
141 103
142/******************** cpufreq transition notifiers *******************/ 104/* /sys/devices/system/cpu/cpufreq: entry point for global variables */
143 105extern struct kobject *cpufreq_global_kobject;
144#define CPUFREQ_PRECHANGE (0) 106int cpufreq_get_global_kobject(void);
145#define CPUFREQ_POSTCHANGE (1) 107void cpufreq_put_global_kobject(void);
146#define CPUFREQ_RESUMECHANGE (8) 108int cpufreq_sysfs_create_file(const struct attribute *attr);
147#define CPUFREQ_SUSPENDCHANGE (9) 109void cpufreq_sysfs_remove_file(const struct attribute *attr);
148 110
149struct cpufreq_freqs { 111#ifdef CONFIG_CPU_FREQ
150 unsigned int cpu; /* cpu nr */ 112unsigned int cpufreq_get(unsigned int cpu);
151 unsigned int old; 113unsigned int cpufreq_quick_get(unsigned int cpu);
152 unsigned int new; 114unsigned int cpufreq_quick_get_max(unsigned int cpu);
153 u8 flags; /* flags of cpufreq_driver, see below. */ 115void disable_cpufreq(void);
154};
155 116
156/** 117u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy);
157 * cpufreq_scale - "old * mult / div" calculation for large values (32-bit-arch 118int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
158 * safe) 119int cpufreq_update_policy(unsigned int cpu);
159 * @old: old value 120bool have_governor_per_policy(void);
160 * @div: divisor 121struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);
161 * @mult: multiplier 122#else
162 * 123static inline unsigned int cpufreq_get(unsigned int cpu)
163 *
164 * new = old * mult / div
165 */
166static inline unsigned long cpufreq_scale(unsigned long old, u_int div,
167 u_int mult)
168{ 124{
169#if BITS_PER_LONG == 32 125 return 0;
170 126}
171 u64 result = ((u64) old) * ((u64) mult); 127static inline unsigned int cpufreq_quick_get(unsigned int cpu)
172 do_div(result, div); 128{
173 return (unsigned long) result; 129 return 0;
174 130}
175#elif BITS_PER_LONG == 64 131static inline unsigned int cpufreq_quick_get_max(unsigned int cpu)
176 132{
177 unsigned long result = old * ((u64) mult); 133 return 0;
178 result /= div; 134}
179 return result; 135static inline void disable_cpufreq(void) { }
180
181#endif 136#endif
182};
183 137
184/********************************************************************* 138/*********************************************************************
185 * CPUFREQ GOVERNORS * 139 * CPUFREQ DRIVER INTERFACE *
186 *********************************************************************/ 140 *********************************************************************/
187 141
188#define CPUFREQ_GOV_START 1 142#define CPUFREQ_RELATION_L 0 /* lowest frequency at or above target */
189#define CPUFREQ_GOV_STOP 2 143#define CPUFREQ_RELATION_H 1 /* highest frequency below or at target */
190#define CPUFREQ_GOV_LIMITS 3
191#define CPUFREQ_GOV_POLICY_INIT 4
192#define CPUFREQ_GOV_POLICY_EXIT 5
193 144
194struct cpufreq_governor { 145struct freq_attr {
195 char name[CPUFREQ_NAME_LEN]; 146 struct attribute attr;
196 int initialized; 147 ssize_t (*show)(struct cpufreq_policy *, char *);
197 int (*governor) (struct cpufreq_policy *policy, 148 ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count);
198 unsigned int event);
199 ssize_t (*show_setspeed) (struct cpufreq_policy *policy,
200 char *buf);
201 int (*store_setspeed) (struct cpufreq_policy *policy,
202 unsigned int freq);
203 unsigned int max_transition_latency; /* HW must be able to switch to
204 next freq faster than this value in nano secs or we
205 will fallback to performance governor */
206 struct list_head governor_list;
207 struct module *owner;
208}; 149};
209 150
210/* 151#define cpufreq_freq_attr_ro(_name) \
211 * Pass a target to the cpufreq driver. 152static struct freq_attr _name = \
212 */ 153__ATTR(_name, 0444, show_##_name, NULL)
213extern int cpufreq_driver_target(struct cpufreq_policy *policy,
214 unsigned int target_freq,
215 unsigned int relation);
216extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
217 unsigned int target_freq,
218 unsigned int relation);
219 154
220extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy, 155#define cpufreq_freq_attr_ro_perm(_name, _perm) \
221 unsigned int cpu); 156static struct freq_attr _name = \
157__ATTR(_name, _perm, show_##_name, NULL)
222 158
223int cpufreq_register_governor(struct cpufreq_governor *governor); 159#define cpufreq_freq_attr_rw(_name) \
224void cpufreq_unregister_governor(struct cpufreq_governor *governor); 160static struct freq_attr _name = \
161__ATTR(_name, 0644, show_##_name, store_##_name)
225 162
226/********************************************************************* 163struct global_attr {
227 * CPUFREQ DRIVER INTERFACE * 164 struct attribute attr;
228 *********************************************************************/ 165 ssize_t (*show)(struct kobject *kobj,
166 struct attribute *attr, char *buf);
167 ssize_t (*store)(struct kobject *a, struct attribute *b,
168 const char *c, size_t count);
169};
229 170
230#define CPUFREQ_RELATION_L 0 /* lowest frequency at or above target */ 171#define define_one_global_ro(_name) \
231#define CPUFREQ_RELATION_H 1 /* highest frequency below or at target */ 172static struct global_attr _name = \
173__ATTR(_name, 0444, show_##_name, NULL)
174
175#define define_one_global_rw(_name) \
176static struct global_attr _name = \
177__ATTR(_name, 0644, show_##_name, store_##_name)
232 178
233struct freq_attr;
234 179
235struct cpufreq_driver { 180struct cpufreq_driver {
236 struct module *owner;
237 char name[CPUFREQ_NAME_LEN]; 181 char name[CPUFREQ_NAME_LEN];
238 u8 flags; 182 u8 flags;
239 /* 183 /*
@@ -258,8 +202,6 @@ struct cpufreq_driver {
258 unsigned int (*get) (unsigned int cpu); 202 unsigned int (*get) (unsigned int cpu);
259 203
260 /* optional */ 204 /* optional */
261 unsigned int (*getavg) (struct cpufreq_policy *policy,
262 unsigned int cpu);
263 int (*bios_limit) (int cpu, unsigned int *limit); 205 int (*bios_limit) (int cpu, unsigned int *limit);
264 206
265 int (*exit) (struct cpufreq_policy *policy); 207 int (*exit) (struct cpufreq_policy *policy);
@@ -269,7 +211,6 @@ struct cpufreq_driver {
269}; 211};
270 212
271/* flags */ 213/* flags */
272
273#define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if 214#define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if
274 * all ->init() calls failed */ 215 * all ->init() calls failed */
275#define CPUFREQ_CONST_LOOPS 0x02 /* loops_per_jiffy or other kernel 216#define CPUFREQ_CONST_LOOPS 0x02 /* loops_per_jiffy or other kernel
@@ -281,8 +222,7 @@ struct cpufreq_driver {
281int cpufreq_register_driver(struct cpufreq_driver *driver_data); 222int cpufreq_register_driver(struct cpufreq_driver *driver_data);
282int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); 223int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
283 224
284void cpufreq_notify_transition(struct cpufreq_policy *policy, 225const char *cpufreq_get_current_driver(void);
285 struct cpufreq_freqs *freqs, unsigned int state);
286 226
287static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, 227static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
288 unsigned int min, unsigned int max) 228 unsigned int min, unsigned int max)
@@ -300,87 +240,118 @@ static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
300 return; 240 return;
301} 241}
302 242
303struct freq_attr { 243/*********************************************************************
304 struct attribute attr; 244 * CPUFREQ NOTIFIER INTERFACE *
305 ssize_t (*show)(struct cpufreq_policy *, char *); 245 *********************************************************************/
306 ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count);
307};
308
309#define cpufreq_freq_attr_ro(_name) \
310static struct freq_attr _name = \
311__ATTR(_name, 0444, show_##_name, NULL)
312
313#define cpufreq_freq_attr_ro_perm(_name, _perm) \
314static struct freq_attr _name = \
315__ATTR(_name, _perm, show_##_name, NULL)
316
317#define cpufreq_freq_attr_rw(_name) \
318static struct freq_attr _name = \
319__ATTR(_name, 0644, show_##_name, store_##_name)
320 246
321struct global_attr { 247#define CPUFREQ_TRANSITION_NOTIFIER (0)
322 struct attribute attr; 248#define CPUFREQ_POLICY_NOTIFIER (1)
323 ssize_t (*show)(struct kobject *kobj,
324 struct attribute *attr, char *buf);
325 ssize_t (*store)(struct kobject *a, struct attribute *b,
326 const char *c, size_t count);
327};
328 249
329#define define_one_global_ro(_name) \ 250/* Transition notifiers */
330static struct global_attr _name = \ 251#define CPUFREQ_PRECHANGE (0)
331__ATTR(_name, 0444, show_##_name, NULL) 252#define CPUFREQ_POSTCHANGE (1)
253#define CPUFREQ_RESUMECHANGE (8)
254#define CPUFREQ_SUSPENDCHANGE (9)
332 255
333#define define_one_global_rw(_name) \ 256/* Policy Notifiers */
334static struct global_attr _name = \ 257#define CPUFREQ_ADJUST (0)
335__ATTR(_name, 0644, show_##_name, store_##_name) 258#define CPUFREQ_INCOMPATIBLE (1)
259#define CPUFREQ_NOTIFY (2)
260#define CPUFREQ_START (3)
261#define CPUFREQ_UPDATE_POLICY_CPU (4)
336 262
337struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); 263#ifdef CONFIG_CPU_FREQ
338void cpufreq_cpu_put(struct cpufreq_policy *data); 264int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);
339const char *cpufreq_get_current_driver(void); 265int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
340 266
341/********************************************************************* 267void cpufreq_notify_transition(struct cpufreq_policy *policy,
342 * CPUFREQ 2.6. INTERFACE * 268 struct cpufreq_freqs *freqs, unsigned int state);
343 *********************************************************************/
344u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy);
345int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
346int cpufreq_update_policy(unsigned int cpu);
347bool have_governor_per_policy(void);
348struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);
349 269
350#ifdef CONFIG_CPU_FREQ 270#else /* CONFIG_CPU_FREQ */
351/* 271static inline int cpufreq_register_notifier(struct notifier_block *nb,
352 * query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it 272 unsigned int list)
353 */
354unsigned int cpufreq_get(unsigned int cpu);
355#else
356static inline unsigned int cpufreq_get(unsigned int cpu)
357{ 273{
358 return 0; 274 return 0;
359} 275}
360#endif 276static inline int cpufreq_unregister_notifier(struct notifier_block *nb,
361 277 unsigned int list)
362/*
363 * query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it
364 */
365#ifdef CONFIG_CPU_FREQ
366unsigned int cpufreq_quick_get(unsigned int cpu);
367unsigned int cpufreq_quick_get_max(unsigned int cpu);
368#else
369static inline unsigned int cpufreq_quick_get(unsigned int cpu)
370{ 278{
371 return 0; 279 return 0;
372} 280}
373static inline unsigned int cpufreq_quick_get_max(unsigned int cpu) 281#endif /* !CONFIG_CPU_FREQ */
282
283/**
284 * cpufreq_scale - "old * mult / div" calculation for large values (32-bit-arch
285 * safe)
286 * @old: old value
287 * @div: divisor
288 * @mult: multiplier
289 *
290 *
291 * new = old * mult / div
292 */
293static inline unsigned long cpufreq_scale(unsigned long old, u_int div,
294 u_int mult)
374{ 295{
375 return 0; 296#if BITS_PER_LONG == 32
376} 297 u64 result = ((u64) old) * ((u64) mult);
298 do_div(result, div);
299 return (unsigned long) result;
300
301#elif BITS_PER_LONG == 64
302 unsigned long result = old * ((u64) mult);
303 result /= div;
304 return result;
377#endif 305#endif
306}
378 307
379/********************************************************************* 308/*********************************************************************
380 * CPUFREQ DEFAULT GOVERNOR * 309 * CPUFREQ GOVERNORS *
381 *********************************************************************/ 310 *********************************************************************/
382 311
383/* 312/*
313 * If (cpufreq_driver->target) exists, the ->governor decides what frequency
314 * within the limits is used. If (cpufreq_driver->setpolicy> exists, these
315 * two generic policies are available:
316 */
317#define CPUFREQ_POLICY_POWERSAVE (1)
318#define CPUFREQ_POLICY_PERFORMANCE (2)
319
320/* Governor Events */
321#define CPUFREQ_GOV_START 1
322#define CPUFREQ_GOV_STOP 2
323#define CPUFREQ_GOV_LIMITS 3
324#define CPUFREQ_GOV_POLICY_INIT 4
325#define CPUFREQ_GOV_POLICY_EXIT 5
326
327struct cpufreq_governor {
328 char name[CPUFREQ_NAME_LEN];
329 int initialized;
330 int (*governor) (struct cpufreq_policy *policy,
331 unsigned int event);
332 ssize_t (*show_setspeed) (struct cpufreq_policy *policy,
333 char *buf);
334 int (*store_setspeed) (struct cpufreq_policy *policy,
335 unsigned int freq);
336 unsigned int max_transition_latency; /* HW must be able to switch to
337 next freq faster than this value in nano secs or we
338 will fallback to performance governor */
339 struct list_head governor_list;
340 struct module *owner;
341};
342
343/* Pass a target to the cpufreq driver */
344int cpufreq_driver_target(struct cpufreq_policy *policy,
345 unsigned int target_freq,
346 unsigned int relation);
347int __cpufreq_driver_target(struct cpufreq_policy *policy,
348 unsigned int target_freq,
349 unsigned int relation);
350int cpufreq_register_governor(struct cpufreq_governor *governor);
351void cpufreq_unregister_governor(struct cpufreq_governor *governor);
352
353/* CPUFREQ DEFAULT GOVERNOR */
354/*
384 * Performance governor is fallback governor if any other gov failed to auto 355 * Performance governor is fallback governor if any other gov failed to auto
385 * load due latency restrictions 356 * load due latency restrictions
386 */ 357 */
@@ -428,18 +399,16 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
428 unsigned int relation, 399 unsigned int relation,
429 unsigned int *index); 400 unsigned int *index);
430 401
431/* the following 3 funtions are for cpufreq core use only */ 402void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy);
403ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
404
405/* the following funtion is for cpufreq core use only */
432struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); 406struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu);
433 407
434/* the following are really really optional */ 408/* the following are really really optional */
435extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; 409extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs;
436
437void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, 410void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
438 unsigned int cpu); 411 unsigned int cpu);
439void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy);
440
441void cpufreq_frequency_table_put_attr(unsigned int cpu); 412void cpufreq_frequency_table_put_attr(unsigned int cpu);
442 413
443ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
444
445#endif /* _LINUX_CPUFREQ_H */ 414#endif /* _LINUX_CPUFREQ_H */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 0bc4b74668e9..781addc66f03 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -13,8 +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/kobject.h>
17#include <linux/completion.h>
18#include <linux/hrtimer.h> 16#include <linux/hrtimer.h>
19 17
20#define CPUIDLE_STATE_MAX 10 18#define CPUIDLE_STATE_MAX 10
@@ -61,6 +59,10 @@ struct cpuidle_state {
61 59
62#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) 60#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
63 61
62struct cpuidle_device_kobj;
63struct cpuidle_state_kobj;
64struct cpuidle_driver_kobj;
65
64struct cpuidle_device { 66struct cpuidle_device {
65 unsigned int registered:1; 67 unsigned int registered:1;
66 unsigned int enabled:1; 68 unsigned int enabled:1;
@@ -71,9 +73,8 @@ struct cpuidle_device {
71 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX]; 73 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
72 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; 74 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
73 struct cpuidle_driver_kobj *kobj_driver; 75 struct cpuidle_driver_kobj *kobj_driver;
76 struct cpuidle_device_kobj *kobj_dev;
74 struct list_head device_list; 77 struct list_head device_list;
75 struct kobject kobj;
76 struct completion kobj_unregister;
77 78
78#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED 79#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
79 int safe_state_index; 80 int safe_state_index;
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
index 37e4f8da7cdf..fe68a5a98583 100644
--- a/include/linux/crash_dump.h
+++ b/include/linux/crash_dump.h
@@ -12,6 +12,15 @@
12extern unsigned long long elfcorehdr_addr; 12extern unsigned long long elfcorehdr_addr;
13extern unsigned long long elfcorehdr_size; 13extern unsigned long long elfcorehdr_size;
14 14
15extern int __weak elfcorehdr_alloc(unsigned long long *addr,
16 unsigned long long *size);
17extern void __weak elfcorehdr_free(unsigned long long addr);
18extern ssize_t __weak elfcorehdr_read(char *buf, size_t count, u64 *ppos);
19extern ssize_t __weak elfcorehdr_read_notes(char *buf, size_t count, u64 *ppos);
20extern int __weak remap_oldmem_pfn_range(struct vm_area_struct *vma,
21 unsigned long from, unsigned long pfn,
22 unsigned long size, pgprot_t prot);
23
15extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, 24extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
16 unsigned long, int); 25 unsigned long, int);
17 26
diff --git a/include/linux/crc-t10dif.h b/include/linux/crc-t10dif.h
index a9c96d865ee7..b3cb71f0d3b0 100644
--- a/include/linux/crc-t10dif.h
+++ b/include/linux/crc-t10dif.h
@@ -3,6 +3,10 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#define CRC_T10DIF_DIGEST_SIZE 2
7#define CRC_T10DIF_BLOCK_SIZE 1
8
9__u16 crc_t10dif_generic(__u16 crc, const unsigned char *buffer, size_t len);
6__u16 crc_t10dif(unsigned char const *, size_t); 10__u16 crc_t10dif(unsigned char const *, size_t);
7 11
8#endif 12#endif
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index efdc94434c30..59066e0b4ff1 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -55,11 +55,11 @@ struct qstr {
55#define hashlen_len(hashlen) ((u32)((hashlen) >> 32)) 55#define hashlen_len(hashlen) ((u32)((hashlen) >> 32))
56 56
57struct dentry_stat_t { 57struct dentry_stat_t {
58 int nr_dentry; 58 long nr_dentry;
59 int nr_unused; 59 long nr_unused;
60 int age_limit; /* age in seconds */ 60 long age_limit; /* age in seconds */
61 int want_pages; /* pages requested by system */ 61 long want_pages; /* pages requested by system */
62 int dummy[2]; 62 long dummy[2];
63}; 63};
64extern struct dentry_stat_t dentry_stat; 64extern struct dentry_stat_t dentry_stat;
65 65
@@ -208,11 +208,12 @@ struct dentry_operations {
208#define DCACHE_MANAGED_DENTRY \ 208#define DCACHE_MANAGED_DENTRY \
209 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) 209 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT)
210 210
211#define DCACHE_LRU_LIST 0x80000
211#define DCACHE_DENTRY_KILLED 0x100000 212#define DCACHE_DENTRY_KILLED 0x100000
212 213
213extern seqlock_t rename_lock; 214extern seqlock_t rename_lock;
214 215
215static inline int dname_external(struct dentry *dentry) 216static inline int dname_external(const struct dentry *dentry)
216{ 217{
217 return dentry->d_name.name != dentry->d_iname; 218 return dentry->d_name.name != dentry->d_iname;
218} 219}
@@ -253,6 +254,7 @@ extern void d_prune_aliases(struct inode *);
253 254
254/* test whether we have any submounts in a subdir tree */ 255/* test whether we have any submounts in a subdir tree */
255extern int have_submounts(struct dentry *); 256extern int have_submounts(struct dentry *);
257extern int check_submounts_and_drop(struct dentry *);
256 258
257/* 259/*
258 * This adds the entry to the hash queues. 260 * This adds the entry to the hash queues.
@@ -304,28 +306,6 @@ extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *);
304extern struct dentry *__d_lookup_rcu(const struct dentry *parent, 306extern struct dentry *__d_lookup_rcu(const struct dentry *parent,
305 const struct qstr *name, unsigned *seq); 307 const struct qstr *name, unsigned *seq);
306 308
307/**
308 * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok
309 * @dentry: dentry to take a ref on
310 * @seq: seqcount to verify against
311 * Returns: 0 on failure, else 1.
312 *
313 * __d_rcu_to_refcount operates on a dentry,seq pair that was returned
314 * by __d_lookup_rcu, to get a reference on an rcu-walk dentry.
315 */
316static inline int __d_rcu_to_refcount(struct dentry *dentry, unsigned seq)
317{
318 int ret = 0;
319
320 assert_spin_locked(&dentry->d_lock);
321 if (!read_seqcount_retry(&dentry->d_seq, seq)) {
322 ret = 1;
323 dentry->d_lockref.count++;
324 }
325
326 return ret;
327}
328
329static inline unsigned d_count(const struct dentry *dentry) 309static inline unsigned d_count(const struct dentry *dentry)
330{ 310{
331 return dentry->d_lockref.count; 311 return dentry->d_lockref.count;
@@ -379,17 +359,17 @@ extern struct dentry *dget_parent(struct dentry *dentry);
379 * Returns true if the dentry passed is not currently hashed. 359 * Returns true if the dentry passed is not currently hashed.
380 */ 360 */
381 361
382static inline int d_unhashed(struct dentry *dentry) 362static inline int d_unhashed(const struct dentry *dentry)
383{ 363{
384 return hlist_bl_unhashed(&dentry->d_hash); 364 return hlist_bl_unhashed(&dentry->d_hash);
385} 365}
386 366
387static inline int d_unlinked(struct dentry *dentry) 367static inline int d_unlinked(const struct dentry *dentry)
388{ 368{
389 return d_unhashed(dentry) && !IS_ROOT(dentry); 369 return d_unhashed(dentry) && !IS_ROOT(dentry);
390} 370}
391 371
392static inline int cant_mount(struct dentry *dentry) 372static inline int cant_mount(const struct dentry *dentry)
393{ 373{
394 return (dentry->d_flags & DCACHE_CANT_MOUNT); 374 return (dentry->d_flags & DCACHE_CANT_MOUNT);
395} 375}
@@ -403,16 +383,20 @@ static inline void dont_mount(struct dentry *dentry)
403 383
404extern void dput(struct dentry *); 384extern void dput(struct dentry *);
405 385
406static inline bool d_managed(struct dentry *dentry) 386static inline bool d_managed(const struct dentry *dentry)
407{ 387{
408 return dentry->d_flags & DCACHE_MANAGED_DENTRY; 388 return dentry->d_flags & DCACHE_MANAGED_DENTRY;
409} 389}
410 390
411static inline bool d_mountpoint(struct dentry *dentry) 391static inline bool d_mountpoint(const struct dentry *dentry)
412{ 392{
413 return dentry->d_flags & DCACHE_MOUNTED; 393 return dentry->d_flags & DCACHE_MOUNTED;
414} 394}
415 395
416extern int sysctl_vfs_cache_pressure; 396extern int sysctl_vfs_cache_pressure;
417 397
398static inline unsigned long vfs_pressure_ratio(unsigned long val)
399{
400 return mult_frac(val, sysctl_vfs_cache_pressure, 100);
401}
418#endif /* __LINUX_DCACHE_H */ 402#endif /* __LINUX_DCACHE_H */
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index d68b4ea7343c..263489d0788d 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -192,6 +192,13 @@ static inline struct dentry *debugfs_create_x32(const char *name, umode_t mode,
192 return ERR_PTR(-ENODEV); 192 return ERR_PTR(-ENODEV);
193} 193}
194 194
195static inline struct dentry *debugfs_create_x64(const char *name, umode_t mode,
196 struct dentry *parent,
197 u64 *value)
198{
199 return ERR_PTR(-ENODEV);
200}
201
195static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode, 202static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
196 struct dentry *parent, 203 struct dentry *parent,
197 size_t *value) 204 size_t *value)
diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h
index 0e5f5785d9f2..98ffcbd4888e 100644
--- a/include/linux/debugobjects.h
+++ b/include/linux/debugobjects.h
@@ -63,7 +63,7 @@ struct debug_obj_descr {
63extern void debug_object_init (void *addr, struct debug_obj_descr *descr); 63extern void debug_object_init (void *addr, struct debug_obj_descr *descr);
64extern void 64extern void
65debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr); 65debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr);
66extern void debug_object_activate (void *addr, struct debug_obj_descr *descr); 66extern int debug_object_activate (void *addr, struct debug_obj_descr *descr);
67extern void debug_object_deactivate(void *addr, struct debug_obj_descr *descr); 67extern void debug_object_deactivate(void *addr, struct debug_obj_descr *descr);
68extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr); 68extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr);
69extern void debug_object_free (void *addr, struct debug_obj_descr *descr); 69extern void debug_object_free (void *addr, struct debug_obj_descr *descr);
@@ -85,8 +85,8 @@ static inline void
85debug_object_init (void *addr, struct debug_obj_descr *descr) { } 85debug_object_init (void *addr, struct debug_obj_descr *descr) { }
86static inline void 86static inline void
87debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr) { } 87debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr) { }
88static inline void 88static inline int
89debug_object_activate (void *addr, struct debug_obj_descr *descr) { } 89debug_object_activate (void *addr, struct debug_obj_descr *descr) { return 0; }
90static inline void 90static inline void
91debug_object_deactivate(void *addr, struct debug_obj_descr *descr) { } 91debug_object_deactivate(void *addr, struct debug_obj_descr *descr) { }
92static inline void 92static inline void
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index e151d4c9298d..ed419c62dde1 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/math64.h>
13#include <linux/ratelimit.h> 14#include <linux/ratelimit.h>
14 15
15struct dm_dev; 16struct dm_dev;
@@ -405,13 +406,14 @@ int dm_noflush_suspending(struct dm_target *ti);
405union map_info *dm_get_mapinfo(struct bio *bio); 406union map_info *dm_get_mapinfo(struct bio *bio);
406union map_info *dm_get_rq_mapinfo(struct request *rq); 407union map_info *dm_get_rq_mapinfo(struct request *rq);
407 408
409struct queue_limits *dm_get_queue_limits(struct mapped_device *md);
410
408/* 411/*
409 * Geometry functions. 412 * Geometry functions.
410 */ 413 */
411int dm_get_geometry(struct mapped_device *md, struct hd_geometry *geo); 414int dm_get_geometry(struct mapped_device *md, struct hd_geometry *geo);
412int dm_set_geometry(struct mapped_device *md, struct hd_geometry *geo); 415int dm_set_geometry(struct mapped_device *md, struct hd_geometry *geo);
413 416
414
415/*----------------------------------------------------------------- 417/*-----------------------------------------------------------------
416 * Functions for manipulating device-mapper tables. 418 * Functions for manipulating device-mapper tables.
417 *---------------------------------------------------------------*/ 419 *---------------------------------------------------------------*/
@@ -550,6 +552,14 @@ extern struct ratelimit_state dm_ratelimit_state;
550#define DM_MAPIO_REMAPPED 1 552#define DM_MAPIO_REMAPPED 1
551#define DM_MAPIO_REQUEUE DM_ENDIO_REQUEUE 553#define DM_MAPIO_REQUEUE DM_ENDIO_REQUEUE
552 554
555#define dm_sector_div64(x, y)( \
556{ \
557 u64 _res; \
558 (x) = div64_u64_rem(x, y, &_res); \
559 _res; \
560} \
561)
562
553/* 563/*
554 * Ceiling(n / sz) 564 * Ceiling(n / sz)
555 */ 565 */
diff --git a/include/linux/device.h b/include/linux/device.h
index 22b546a58591..2a9d6ed59579 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -66,6 +66,9 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
66 * @bus_attrs: Default attributes of the bus. 66 * @bus_attrs: Default attributes of the bus.
67 * @dev_attrs: Default attributes of the devices on the bus. 67 * @dev_attrs: Default attributes of the devices on the bus.
68 * @drv_attrs: Default attributes of the device drivers on the bus. 68 * @drv_attrs: Default attributes of the device drivers on the bus.
69 * @bus_groups: Default attributes of the bus.
70 * @dev_groups: Default attributes of the devices on the bus.
71 * @drv_groups: Default attributes of the device drivers on the bus.
69 * @match: Called, perhaps multiple times, whenever a new device or driver 72 * @match: Called, perhaps multiple times, whenever a new device or driver
70 * is added for this bus. It should return a nonzero value if the 73 * is added for this bus. It should return a nonzero value if the
71 * given device can be handled by the given driver. 74 * given device can be handled by the given driver.
@@ -103,9 +106,12 @@ struct bus_type {
103 const char *name; 106 const char *name;
104 const char *dev_name; 107 const char *dev_name;
105 struct device *dev_root; 108 struct device *dev_root;
106 struct bus_attribute *bus_attrs; 109 struct bus_attribute *bus_attrs; /* use bus_groups instead */
107 struct device_attribute *dev_attrs; 110 struct device_attribute *dev_attrs; /* use dev_groups instead */
108 struct driver_attribute *drv_attrs; 111 struct driver_attribute *drv_attrs; /* use drv_groups instead */
112 const struct attribute_group **bus_groups;
113 const struct attribute_group **dev_groups;
114 const struct attribute_group **drv_groups;
109 115
110 int (*match)(struct device *dev, struct device_driver *drv); 116 int (*match)(struct device *dev, struct device_driver *drv);
111 int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 117 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
@@ -271,6 +277,8 @@ struct driver_attribute {
271 struct driver_attribute driver_attr_##_name = __ATTR_RW(_name) 277 struct driver_attribute driver_attr_##_name = __ATTR_RW(_name)
272#define DRIVER_ATTR_RO(_name) \ 278#define DRIVER_ATTR_RO(_name) \
273 struct driver_attribute driver_attr_##_name = __ATTR_RO(_name) 279 struct driver_attribute driver_attr_##_name = __ATTR_RO(_name)
280#define DRIVER_ATTR_WO(_name) \
281 struct driver_attribute driver_attr_##_name = __ATTR_WO(_name)
274 282
275extern int __must_check driver_create_file(struct device_driver *driver, 283extern int __must_check driver_create_file(struct device_driver *driver,
276 const struct driver_attribute *attr); 284 const struct driver_attribute *attr);
@@ -528,6 +536,8 @@ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
528 struct device_attribute dev_attr_##_name = __ATTR_RW(_name) 536 struct device_attribute dev_attr_##_name = __ATTR_RW(_name)
529#define DEVICE_ATTR_RO(_name) \ 537#define DEVICE_ATTR_RO(_name) \
530 struct device_attribute dev_attr_##_name = __ATTR_RO(_name) 538 struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
539#define DEVICE_ATTR_WO(_name) \
540 struct device_attribute dev_attr_##_name = __ATTR_WO(_name)
531#define DEVICE_ULONG_ATTR(_name, _mode, _var) \ 541#define DEVICE_ULONG_ATTR(_name, _mode, _var) \
532 struct dev_ext_attribute dev_attr_##_name = \ 542 struct dev_ext_attribute dev_attr_##_name = \
533 { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } 543 { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }
@@ -727,7 +737,7 @@ struct device {
727 737
728 struct dma_coherent_mem *dma_mem; /* internal for coherent mem 738 struct dma_coherent_mem *dma_mem; /* internal for coherent mem
729 override */ 739 override */
730#ifdef CONFIG_CMA 740#ifdef CONFIG_DMA_CMA
731 struct cma *cma_area; /* contiguous memory area for dma 741 struct cma *cma_area; /* contiguous memory area for dma
732 allocations */ 742 allocations */
733#endif 743#endif
@@ -895,6 +905,7 @@ static inline bool device_supports_offline(struct device *dev)
895 905
896extern void lock_device_hotplug(void); 906extern void lock_device_hotplug(void);
897extern void unlock_device_hotplug(void); 907extern void unlock_device_hotplug(void);
908extern int lock_device_hotplug_sysfs(void);
898extern int device_offline(struct device *dev); 909extern int device_offline(struct device *dev);
899extern int device_online(struct device *dev); 910extern int device_online(struct device *dev);
900/* 911/*
@@ -1099,7 +1110,8 @@ do { \
1099 dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__) 1110 dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__)
1100#define dev_info_ratelimited(dev, fmt, ...) \ 1111#define dev_info_ratelimited(dev, fmt, ...) \
1101 dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__) 1112 dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__)
1102#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG) 1113#if defined(CONFIG_DYNAMIC_DEBUG)
1114/* descriptor check is first to prevent flooding with "callbacks suppressed" */
1103#define dev_dbg_ratelimited(dev, fmt, ...) \ 1115#define dev_dbg_ratelimited(dev, fmt, ...) \
1104do { \ 1116do { \
1105 static DEFINE_RATELIMIT_STATE(_rs, \ 1117 static DEFINE_RATELIMIT_STATE(_rs, \
@@ -1108,8 +1120,17 @@ do { \
1108 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 1120 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
1109 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ 1121 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \
1110 __ratelimit(&_rs)) \ 1122 __ratelimit(&_rs)) \
1111 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \ 1123 __dynamic_dev_dbg(&descriptor, dev, fmt, \
1112 ##__VA_ARGS__); \ 1124 ##__VA_ARGS__); \
1125} while (0)
1126#elif defined(DEBUG)
1127#define dev_dbg_ratelimited(dev, fmt, ...) \
1128do { \
1129 static DEFINE_RATELIMIT_STATE(_rs, \
1130 DEFAULT_RATELIMIT_INTERVAL, \
1131 DEFAULT_RATELIMIT_BURST); \
1132 if (__ratelimit(&_rs)) \
1133 dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \
1113} while (0) 1134} while (0)
1114#else 1135#else
1115#define dev_dbg_ratelimited(dev, fmt, ...) \ 1136#define dev_dbg_ratelimited(dev, fmt, ...) \
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
index 96e87693d933..841925fbfe8a 100644
--- a/include/linux/dm9000.h
+++ b/include/linux/dm9000.h
@@ -14,6 +14,8 @@
14#ifndef __DM9000_PLATFORM_DATA 14#ifndef __DM9000_PLATFORM_DATA
15#define __DM9000_PLATFORM_DATA __FILE__ 15#define __DM9000_PLATFORM_DATA __FILE__
16 16
17#include <linux/if_ether.h>
18
17/* IO control flags */ 19/* IO control flags */
18 20
19#define DM9000_PLATF_8BITONLY (0x0001) 21#define DM9000_PLATF_8BITONLY (0x0001)
@@ -27,7 +29,7 @@
27 29
28struct dm9000_plat_data { 30struct dm9000_plat_data {
29 unsigned int flags; 31 unsigned int flags;
30 unsigned char dev_addr[6]; 32 unsigned char dev_addr[ETH_ALEN];
31 33
32 /* allow replacement IO routines */ 34 /* allow replacement IO routines */
33 35
diff --git a/include/linux/dma-contiguous.h b/include/linux/dma-contiguous.h
index 01b5c84be828..3b28f937d959 100644
--- a/include/linux/dma-contiguous.h
+++ b/include/linux/dma-contiguous.h
@@ -57,7 +57,7 @@ struct cma;
57struct page; 57struct page;
58struct device; 58struct device;
59 59
60#ifdef CONFIG_CMA 60#ifdef CONFIG_DMA_CMA
61 61
62/* 62/*
63 * There is always at least global CMA area and a few optional device 63 * There is always at least global CMA area and a few optional device
@@ -67,9 +67,53 @@ struct device;
67 67
68extern struct cma *dma_contiguous_default_area; 68extern struct cma *dma_contiguous_default_area;
69 69
70static inline struct cma *dev_get_cma_area(struct device *dev)
71{
72 if (dev && dev->cma_area)
73 return dev->cma_area;
74 return dma_contiguous_default_area;
75}
76
77static inline void dev_set_cma_area(struct device *dev, struct cma *cma)
78{
79 if (dev)
80 dev->cma_area = cma;
81}
82
83static inline void dma_contiguous_set_default(struct cma *cma)
84{
85 dma_contiguous_default_area = cma;
86}
87
70void dma_contiguous_reserve(phys_addr_t addr_limit); 88void dma_contiguous_reserve(phys_addr_t addr_limit);
71int dma_declare_contiguous(struct device *dev, phys_addr_t size, 89
72 phys_addr_t base, phys_addr_t limit); 90int __init dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base,
91 phys_addr_t limit, struct cma **res_cma);
92
93/**
94 * dma_declare_contiguous() - reserve area for contiguous memory handling
95 * for particular device
96 * @dev: Pointer to device structure.
97 * @size: Size of the reserved memory.
98 * @base: Start address of the reserved memory (optional, 0 for any).
99 * @limit: End address of the reserved memory (optional, 0 for any).
100 *
101 * This function reserves memory for specified device. It should be
102 * called by board specific code when early allocator (memblock or bootmem)
103 * is still activate.
104 */
105
106static inline int dma_declare_contiguous(struct device *dev, phys_addr_t size,
107 phys_addr_t base, phys_addr_t limit)
108{
109 struct cma *cma;
110 int ret;
111 ret = dma_contiguous_reserve_area(size, base, limit, &cma);
112 if (ret == 0)
113 dev_set_cma_area(dev, cma);
114
115 return ret;
116}
73 117
74struct page *dma_alloc_from_contiguous(struct device *dev, int count, 118struct page *dma_alloc_from_contiguous(struct device *dev, int count,
75 unsigned int order); 119 unsigned int order);
@@ -80,8 +124,22 @@ bool dma_release_from_contiguous(struct device *dev, struct page *pages,
80 124
81#define MAX_CMA_AREAS (0) 125#define MAX_CMA_AREAS (0)
82 126
127static inline struct cma *dev_get_cma_area(struct device *dev)
128{
129 return NULL;
130}
131
132static inline void dev_set_cma_area(struct device *dev, struct cma *cma) { }
133
134static inline void dma_contiguous_set_default(struct cma *cma) { }
135
83static inline void dma_contiguous_reserve(phys_addr_t limit) { } 136static inline void dma_contiguous_reserve(phys_addr_t limit) { }
84 137
138static inline int dma_contiguous_reserve_area(phys_addr_t size, phys_addr_t base,
139 phys_addr_t limit, struct cma **res_cma) {
140 return -ENOSYS;
141}
142
85static inline 143static inline
86int dma_declare_contiguous(struct device *dev, phys_addr_t size, 144int dma_declare_contiguous(struct device *dev, phys_addr_t size,
87 phys_addr_t base, phys_addr_t limit) 145 phys_addr_t base, phys_addr_t limit)
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 94af41858513..3a8d0a2af607 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -132,9 +132,8 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
132static inline void *dma_zalloc_coherent(struct device *dev, size_t size, 132static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
133 dma_addr_t *dma_handle, gfp_t flag) 133 dma_addr_t *dma_handle, gfp_t flag)
134{ 134{
135 void *ret = dma_alloc_coherent(dev, size, dma_handle, flag); 135 void *ret = dma_alloc_coherent(dev, size, dma_handle,
136 if (ret) 136 flag | __GFP_ZERO);
137 memset(ret, 0, size);
138 return ret; 137 return ret;
139} 138}
140 139
diff --git a/include/linux/dma/mmp-pdma.h b/include/linux/dma/mmp-pdma.h
new file mode 100644
index 000000000000..2dc9b2bc18fc
--- /dev/null
+++ b/include/linux/dma/mmp-pdma.h
@@ -0,0 +1,15 @@
1#ifndef _MMP_PDMA_H_
2#define _MMP_PDMA_H_
3
4struct dma_chan;
5
6#ifdef CONFIG_MMP_PDMA
7bool mmp_pdma_filter_fn(struct dma_chan *chan, void *param);
8#else
9static inline bool mmp_pdma_filter_fn(struct dma_chan *chan, void *param)
10{
11 return false;
12}
13#endif
14
15#endif /* _MMP_PDMA_H_ */
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index cb286b1acdb6..0bc727534108 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -38,7 +38,10 @@ typedef s32 dma_cookie_t;
38#define DMA_MIN_COOKIE 1 38#define DMA_MIN_COOKIE 1
39#define DMA_MAX_COOKIE INT_MAX 39#define DMA_MAX_COOKIE INT_MAX
40 40
41#define dma_submit_error(cookie) ((cookie) < 0 ? 1 : 0) 41static inline int dma_submit_error(dma_cookie_t cookie)
42{
43 return cookie < 0 ? cookie : 0;
44}
42 45
43/** 46/**
44 * enum dma_status - DMA transaction status 47 * enum dma_status - DMA transaction status
@@ -370,6 +373,25 @@ struct dma_slave_config {
370 unsigned int slave_id; 373 unsigned int slave_id;
371}; 374};
372 375
376/* struct dma_slave_caps - expose capabilities of a slave channel only
377 *
378 * @src_addr_widths: bit mask of src addr widths the channel supports
379 * @dstn_addr_widths: bit mask of dstn addr widths the channel supports
380 * @directions: bit mask of slave direction the channel supported
381 * since the enum dma_transfer_direction is not defined as bits for each
382 * type of direction, the dma controller should fill (1 << <TYPE>) and same
383 * should be checked by controller as well
384 * @cmd_pause: true, if pause and thereby resume is supported
385 * @cmd_terminate: true, if terminate cmd is supported
386 */
387struct dma_slave_caps {
388 u32 src_addr_widths;
389 u32 dstn_addr_widths;
390 u32 directions;
391 bool cmd_pause;
392 bool cmd_terminate;
393};
394
373static inline const char *dma_chan_name(struct dma_chan *chan) 395static inline const char *dma_chan_name(struct dma_chan *chan)
374{ 396{
375 return dev_name(&chan->dev->device); 397 return dev_name(&chan->dev->device);
@@ -532,6 +554,7 @@ struct dma_tx_state {
532 * struct with auxiliary transfer status information, otherwise the call 554 * struct with auxiliary transfer status information, otherwise the call
533 * will just return a simple status code 555 * will just return a simple status code
534 * @device_issue_pending: push pending transactions to hardware 556 * @device_issue_pending: push pending transactions to hardware
557 * @device_slave_caps: return the slave channel capabilities
535 */ 558 */
536struct dma_device { 559struct dma_device {
537 560
@@ -597,6 +620,7 @@ struct dma_device {
597 dma_cookie_t cookie, 620 dma_cookie_t cookie,
598 struct dma_tx_state *txstate); 621 struct dma_tx_state *txstate);
599 void (*device_issue_pending)(struct dma_chan *chan); 622 void (*device_issue_pending)(struct dma_chan *chan);
623 int (*device_slave_caps)(struct dma_chan *chan, struct dma_slave_caps *caps);
600}; 624};
601 625
602static inline int dmaengine_device_control(struct dma_chan *chan, 626static inline int dmaengine_device_control(struct dma_chan *chan,
@@ -670,6 +694,21 @@ static inline struct dma_async_tx_descriptor *dmaengine_prep_interleaved_dma(
670 return chan->device->device_prep_interleaved_dma(chan, xt, flags); 694 return chan->device->device_prep_interleaved_dma(chan, xt, flags);
671} 695}
672 696
697static inline int dma_get_slave_caps(struct dma_chan *chan, struct dma_slave_caps *caps)
698{
699 if (!chan || !caps)
700 return -EINVAL;
701
702 /* check if the channel supports slave transactions */
703 if (!test_bit(DMA_SLAVE, chan->device->cap_mask.bits))
704 return -ENXIO;
705
706 if (chan->device->device_slave_caps)
707 return chan->device->device_slave_caps(chan, caps);
708
709 return -ENXIO;
710}
711
673static inline int dmaengine_terminate_all(struct dma_chan *chan) 712static inline int dmaengine_terminate_all(struct dma_chan *chan)
674{ 713{
675 return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0); 714 return dmaengine_device_control(chan, DMA_TERMINATE_ALL, 0);
@@ -958,8 +997,9 @@ dma_set_tx_state(struct dma_tx_state *st, dma_cookie_t last, dma_cookie_t used,
958 } 997 }
959} 998}
960 999
961enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
962#ifdef CONFIG_DMA_ENGINE 1000#ifdef CONFIG_DMA_ENGINE
1001struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type);
1002enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
963enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); 1003enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
964void dma_issue_pending_all(void); 1004void dma_issue_pending_all(void);
965struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, 1005struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
@@ -967,6 +1007,14 @@ struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
967struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); 1007struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name);
968void dma_release_channel(struct dma_chan *chan); 1008void dma_release_channel(struct dma_chan *chan);
969#else 1009#else
1010static inline struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type)
1011{
1012 return NULL;
1013}
1014static inline enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie)
1015{
1016 return DMA_SUCCESS;
1017}
970static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) 1018static inline enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
971{ 1019{
972 return DMA_SUCCESS; 1020 return DMA_SUCCESS;
@@ -994,7 +1042,7 @@ static inline void dma_release_channel(struct dma_chan *chan)
994int dma_async_device_register(struct dma_device *device); 1042int dma_async_device_register(struct dma_device *device);
995void dma_async_device_unregister(struct dma_device *device); 1043void dma_async_device_unregister(struct dma_device *device);
996void dma_run_dependencies(struct dma_async_tx_descriptor *tx); 1044void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
997struct dma_chan *dma_find_channel(enum dma_transaction_type tx_type); 1045struct dma_chan *dma_get_slave_channel(struct dma_chan *chan);
998struct dma_chan *net_dma_find_channel(void); 1046struct dma_chan *net_dma_find_channel(void);
999#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) 1047#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
1000#define dma_request_slave_channel_compat(mask, x, y, dev, name) \ 1048#define dma_request_slave_channel_compat(mask, x, y, dev, name) \
diff --git a/include/linux/err.h b/include/linux/err.h
index 221fcfb676c4..15f92e072450 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -52,7 +52,7 @@ static inline void * __must_check ERR_CAST(__force const void *ptr)
52 return (void *) ptr; 52 return (void *) ptr;
53} 53}
54 54
55static inline int __must_check PTR_RET(__force const void *ptr) 55static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr)
56{ 56{
57 if (IS_ERR(ptr)) 57 if (IS_ERR(ptr))
58 return PTR_ERR(ptr); 58 return PTR_ERR(ptr);
@@ -60,6 +60,9 @@ static inline int __must_check PTR_RET(__force const void *ptr)
60 return 0; 60 return 0;
61} 61}
62 62
63/* Deprecated */
64#define PTR_RET(p) PTR_ERR_OR_ZERO(p)
65
63#endif 66#endif
64 67
65#endif /* _LINUX_ERR_H */ 68#endif /* _LINUX_ERR_H */
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index c623861964e4..d8b512496e50 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -199,6 +199,21 @@ static inline void eth_hw_addr_random(struct net_device *dev)
199} 199}
200 200
201/** 201/**
202 * eth_hw_addr_inherit - Copy dev_addr from another net_device
203 * @dst: pointer to net_device to copy dev_addr to
204 * @src: pointer to net_device to copy dev_addr from
205 *
206 * Copy the Ethernet address from one net_device to another along with
207 * the address attributes (addr_assign_type).
208 */
209static inline void eth_hw_addr_inherit(struct net_device *dst,
210 struct net_device *src)
211{
212 dst->addr_assign_type = src->addr_assign_type;
213 memcpy(dst->dev_addr, src->dev_addr, ETH_ALEN);
214}
215
216/**
202 * compare_ether_addr - Compare two Ethernet addresses 217 * compare_ether_addr - Compare two Ethernet addresses
203 * @addr1: Pointer to a six-byte array containing the Ethernet address 218 * @addr1: Pointer to a six-byte array containing the Ethernet address
204 * @addr2: Pointer other six-byte array containing the Ethernet address 219 * @addr2: Pointer other six-byte array containing the Ethernet address
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h
index cf5d2af61b81..ff0b981f078e 100644
--- a/include/linux/eventfd.h
+++ b/include/linux/eventfd.h
@@ -9,7 +9,6 @@
9#define _LINUX_EVENTFD_H 9#define _LINUX_EVENTFD_H
10 10
11#include <linux/fcntl.h> 11#include <linux/fcntl.h>
12#include <linux/file.h>
13#include <linux/wait.h> 12#include <linux/wait.h>
14 13
15/* 14/*
@@ -26,6 +25,8 @@
26#define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK) 25#define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK)
27#define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE) 26#define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE)
28 27
28struct file;
29
29#ifdef CONFIG_EVENTFD 30#ifdef CONFIG_EVENTFD
30 31
31struct file *eventfd_file_create(unsigned int count, int flags); 32struct file *eventfd_file_create(unsigned int count, int flags);
diff --git a/include/linux/extcon/of_extcon.h b/include/linux/extcon/of_extcon.h
new file mode 100644
index 000000000000..0ebfeff1b55d
--- /dev/null
+++ b/include/linux/extcon/of_extcon.h
@@ -0,0 +1,31 @@
1/*
2 * OF helpers for External connector (extcon) framework
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 * Kishon Vijay Abraham I <kishon@ti.com>
6 *
7 * Copyright (C) 2013 Samsung Electronics
8 * Chanwoo Choi <cw00.choi@samsung.com>
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
16#ifndef __LINUX_OF_EXTCON_H
17#define __LINUX_OF_EXTCON_H
18
19#include <linux/err.h>
20
21#if IS_ENABLED(CONFIG_OF_EXTCON)
22extern struct extcon_dev
23 *of_extcon_get_extcon_dev(struct device *dev, int index);
24#else
25static inline struct extcon_dev
26 *of_extcon_get_extcon_dev(struct device *dev, int index)
27{
28 return ERR_PTR(-ENOSYS);
29}
30#endif /* CONFIG_OF_EXTCON */
31#endif /* __LINUX_OF_EXTCON_H */
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index 383d5e39b280..bb942f6d5702 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -140,14 +140,24 @@ struct f2fs_extent {
140} __packed; 140} __packed;
141 141
142#define F2FS_NAME_LEN 255 142#define F2FS_NAME_LEN 255
143#define ADDRS_PER_INODE 923 /* Address Pointers in an Inode */ 143#define F2FS_INLINE_XATTR_ADDRS 50 /* 200 bytes for inline xattrs */
144#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */ 144#define DEF_ADDRS_PER_INODE 923 /* Address Pointers in an Inode */
145#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */ 145#define ADDRS_PER_INODE(fi) addrs_per_inode(fi)
146#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */
147#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */
148
149#define NODE_DIR1_BLOCK (DEF_ADDRS_PER_INODE + 1)
150#define NODE_DIR2_BLOCK (DEF_ADDRS_PER_INODE + 2)
151#define NODE_IND1_BLOCK (DEF_ADDRS_PER_INODE + 3)
152#define NODE_IND2_BLOCK (DEF_ADDRS_PER_INODE + 4)
153#define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5)
154
155#define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */
146 156
147struct f2fs_inode { 157struct f2fs_inode {
148 __le16 i_mode; /* file mode */ 158 __le16 i_mode; /* file mode */
149 __u8 i_advise; /* file hints */ 159 __u8 i_advise; /* file hints */
150 __u8 i_reserved; /* reserved */ 160 __u8 i_inline; /* file inline flags */
151 __le32 i_uid; /* user ID */ 161 __le32 i_uid; /* user ID */
152 __le32 i_gid; /* group ID */ 162 __le32 i_gid; /* group ID */
153 __le32 i_links; /* links count */ 163 __le32 i_links; /* links count */
@@ -170,7 +180,7 @@ struct f2fs_inode {
170 180
171 struct f2fs_extent i_ext; /* caching a largest extent */ 181 struct f2fs_extent i_ext; /* caching a largest extent */
172 182
173 __le32 i_addr[ADDRS_PER_INODE]; /* Pointers to data blocks */ 183 __le32 i_addr[DEF_ADDRS_PER_INODE]; /* Pointers to data blocks */
174 184
175 __le32 i_nid[5]; /* direct(2), indirect(2), 185 __le32 i_nid[5]; /* direct(2), indirect(2),
176 double_indirect(1) node id */ 186 double_indirect(1) node id */
diff --git a/include/linux/filter.h b/include/linux/filter.h
index a6ac84871d6d..ff4e40cd45b1 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -6,6 +6,7 @@
6 6
7#include <linux/atomic.h> 7#include <linux/atomic.h>
8#include <linux/compat.h> 8#include <linux/compat.h>
9#include <linux/workqueue.h>
9#include <uapi/linux/filter.h> 10#include <uapi/linux/filter.h>
10 11
11#ifdef CONFIG_COMPAT 12#ifdef CONFIG_COMPAT
@@ -25,15 +26,19 @@ struct sk_filter
25{ 26{
26 atomic_t refcnt; 27 atomic_t refcnt;
27 unsigned int len; /* Number of filter blocks */ 28 unsigned int len; /* Number of filter blocks */
29 struct rcu_head rcu;
28 unsigned int (*bpf_func)(const struct sk_buff *skb, 30 unsigned int (*bpf_func)(const struct sk_buff *skb,
29 const struct sock_filter *filter); 31 const struct sock_filter *filter);
30 struct rcu_head rcu; 32 union {
31 struct sock_filter insns[0]; 33 struct sock_filter insns[0];
34 struct work_struct work;
35 };
32}; 36};
33 37
34static inline unsigned int sk_filter_len(const struct sk_filter *fp) 38static inline unsigned int sk_filter_size(unsigned int proglen)
35{ 39{
36 return fp->len * sizeof(struct sock_filter) + sizeof(*fp); 40 return max(sizeof(struct sk_filter),
41 offsetof(struct sk_filter, insns[proglen]));
37} 42}
38 43
39extern int sk_filter(struct sock *sk, struct sk_buff *skb); 44extern int sk_filter(struct sock *sk, struct sk_buff *skb);
@@ -67,11 +72,13 @@ static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
67} 72}
68#define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns) 73#define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns)
69#else 74#else
75#include <linux/slab.h>
70static inline void bpf_jit_compile(struct sk_filter *fp) 76static inline void bpf_jit_compile(struct sk_filter *fp)
71{ 77{
72} 78}
73static inline void bpf_jit_free(struct sk_filter *fp) 79static inline void bpf_jit_free(struct sk_filter *fp)
74{ 80{
81 kfree(fp);
75} 82}
76#define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns) 83#define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns)
77#endif 84#endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 981874773e85..3f40547ba191 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -10,6 +10,7 @@
10#include <linux/stat.h> 10#include <linux/stat.h>
11#include <linux/cache.h> 11#include <linux/cache.h>
12#include <linux/list.h> 12#include <linux/list.h>
13#include <linux/list_lru.h>
13#include <linux/llist.h> 14#include <linux/llist.h>
14#include <linux/radix-tree.h> 15#include <linux/radix-tree.h>
15#include <linux/rbtree.h> 16#include <linux/rbtree.h>
@@ -46,6 +47,7 @@ struct vfsmount;
46struct cred; 47struct cred;
47struct swap_info_struct; 48struct swap_info_struct;
48struct seq_file; 49struct seq_file;
50struct workqueue_struct;
49 51
50extern void __init inode_init(void); 52extern void __init inode_init(void);
51extern void __init inode_init_early(void); 53extern void __init inode_init_early(void);
@@ -63,8 +65,7 @@ struct buffer_head;
63typedef int (get_block_t)(struct inode *inode, sector_t iblock, 65typedef int (get_block_t)(struct inode *inode, sector_t iblock,
64 struct buffer_head *bh_result, int create); 66 struct buffer_head *bh_result, int create);
65typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, 67typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
66 ssize_t bytes, void *private, int ret, 68 ssize_t bytes, void *private);
67 bool is_async);
68 69
69#define MAY_EXEC 0x00000001 70#define MAY_EXEC 0x00000001
70#define MAY_WRITE 0x00000002 71#define MAY_WRITE 0x00000002
@@ -1269,15 +1270,6 @@ struct super_block {
1269 struct list_head s_files; 1270 struct list_head s_files;
1270#endif 1271#endif
1271 struct list_head s_mounts; /* list of mounts; _not_ for fs use */ 1272 struct list_head s_mounts; /* list of mounts; _not_ for fs use */
1272 /* s_dentry_lru, s_nr_dentry_unused protected by dcache.c lru locks */
1273 struct list_head s_dentry_lru; /* unused dentry lru */
1274 int s_nr_dentry_unused; /* # of dentry on lru */
1275
1276 /* s_inode_lru_lock protects s_inode_lru and s_nr_inodes_unused */
1277 spinlock_t s_inode_lru_lock ____cacheline_aligned_in_smp;
1278 struct list_head s_inode_lru; /* unused inode lru */
1279 int s_nr_inodes_unused; /* # of inodes on lru */
1280
1281 struct block_device *s_bdev; 1273 struct block_device *s_bdev;
1282 struct backing_dev_info *s_bdi; 1274 struct backing_dev_info *s_bdi;
1283 struct mtd_info *s_mtd; 1275 struct mtd_info *s_mtd;
@@ -1328,11 +1320,17 @@ struct super_block {
1328 1320
1329 /* Being remounted read-only */ 1321 /* Being remounted read-only */
1330 int s_readonly_remount; 1322 int s_readonly_remount;
1331};
1332 1323
1333/* superblock cache pruning functions */ 1324 /* AIO completions deferred from interrupt context */
1334extern void prune_icache_sb(struct super_block *sb, int nr_to_scan); 1325 struct workqueue_struct *s_dio_done_wq;
1335extern void prune_dcache_sb(struct super_block *sb, int nr_to_scan); 1326
1327 /*
1328 * Keep the lru lists last in the structure so they always sit on their
1329 * own individual cachelines.
1330 */
1331 struct list_lru s_dentry_lru ____cacheline_aligned_in_smp;
1332 struct list_lru s_inode_lru ____cacheline_aligned_in_smp;
1333};
1336 1334
1337extern struct timespec current_fs_time(struct super_block *sb); 1335extern struct timespec current_fs_time(struct super_block *sb);
1338 1336
@@ -1626,8 +1624,8 @@ struct super_operations {
1626 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1624 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
1627#endif 1625#endif
1628 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); 1626 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
1629 int (*nr_cached_objects)(struct super_block *); 1627 long (*nr_cached_objects)(struct super_block *, int);
1630 void (*free_cached_objects)(struct super_block *, int); 1628 long (*free_cached_objects)(struct super_block *, long, int);
1631}; 1629};
1632 1630
1633/* 1631/*
@@ -1804,7 +1802,7 @@ enum file_time_flags {
1804 S_VERSION = 8, 1802 S_VERSION = 8,
1805}; 1803};
1806 1804
1807extern void touch_atime(struct path *); 1805extern void touch_atime(const struct path *);
1808static inline void file_accessed(struct file *file) 1806static inline void file_accessed(struct file *file)
1809{ 1807{
1810 if (!(file->f_flags & O_NOATIME)) 1808 if (!(file->f_flags & O_NOATIME))
@@ -1897,6 +1895,7 @@ extern int vfs_ustat(dev_t, struct kstatfs *);
1897extern int freeze_super(struct super_block *super); 1895extern int freeze_super(struct super_block *super);
1898extern int thaw_super(struct super_block *super); 1896extern int thaw_super(struct super_block *super);
1899extern bool our_mnt(struct vfsmount *mnt); 1897extern bool our_mnt(struct vfsmount *mnt);
1898extern bool fs_fully_visible(struct file_system_type *);
1900 1899
1901extern int current_umask(void); 1900extern int current_umask(void);
1902 1901
@@ -2070,6 +2069,7 @@ extern struct super_block *freeze_bdev(struct block_device *);
2070extern void emergency_thaw_all(void); 2069extern void emergency_thaw_all(void);
2071extern int thaw_bdev(struct block_device *bdev, struct super_block *sb); 2070extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
2072extern int fsync_bdev(struct block_device *); 2071extern int fsync_bdev(struct block_device *);
2072extern int sb_is_blkdev_sb(struct super_block *sb);
2073#else 2073#else
2074static inline void bd_forget(struct inode *inode) {} 2074static inline void bd_forget(struct inode *inode) {}
2075static inline int sync_blockdev(struct block_device *bdev) { return 0; } 2075static inline int sync_blockdev(struct block_device *bdev) { return 0; }
@@ -2089,6 +2089,11 @@ static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb)
2089static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg) 2089static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg)
2090{ 2090{
2091} 2091}
2092
2093static inline int sb_is_blkdev_sb(struct super_block *sb)
2094{
2095 return 0;
2096}
2092#endif 2097#endif
2093extern int sync_filesystem(struct super_block *); 2098extern int sync_filesystem(struct super_block *);
2094extern const struct file_operations def_blk_fops; 2099extern const struct file_operations def_blk_fops;
@@ -2490,7 +2495,6 @@ extern const struct file_operations generic_ro_fops;
2490#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) 2495#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
2491 2496
2492extern int vfs_readlink(struct dentry *, char __user *, int, const char *); 2497extern int vfs_readlink(struct dentry *, char __user *, int, const char *);
2493extern int vfs_follow_link(struct nameidata *, const char *);
2494extern int page_readlink(struct dentry *, char __user *, int); 2498extern int page_readlink(struct dentry *, char __user *, int);
2495extern void *page_follow_link_light(struct dentry *, struct nameidata *); 2499extern void *page_follow_link_light(struct dentry *, struct nameidata *);
2496extern void page_put_link(struct dentry *, struct nameidata *, void *); 2500extern void page_put_link(struct dentry *, struct nameidata *, void *);
@@ -2503,6 +2507,7 @@ extern void generic_fillattr(struct inode *, struct kstat *);
2503extern int vfs_getattr(struct path *, struct kstat *); 2507extern int vfs_getattr(struct path *, struct kstat *);
2504void __inode_add_bytes(struct inode *inode, loff_t bytes); 2508void __inode_add_bytes(struct inode *inode, loff_t bytes);
2505void inode_add_bytes(struct inode *inode, loff_t bytes); 2509void inode_add_bytes(struct inode *inode, loff_t bytes);
2510void __inode_sub_bytes(struct inode *inode, loff_t bytes);
2506void inode_sub_bytes(struct inode *inode, loff_t bytes); 2511void inode_sub_bytes(struct inode *inode, loff_t bytes);
2507loff_t inode_get_bytes(struct inode *inode); 2512loff_t inode_get_bytes(struct inode *inode);
2508void inode_set_bytes(struct inode *inode, loff_t bytes); 2513void inode_set_bytes(struct inode *inode, loff_t bytes);
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
index 51b793466ff3..efb05961bdd8 100644
--- a/include/linux/fs_enet_pd.h
+++ b/include/linux/fs_enet_pd.h
@@ -16,8 +16,10 @@
16#ifndef FS_ENET_PD_H 16#ifndef FS_ENET_PD_H
17#define FS_ENET_PD_H 17#define FS_ENET_PD_H
18 18
19#include <linux/clk.h>
19#include <linux/string.h> 20#include <linux/string.h>
20#include <linux/of_mdio.h> 21#include <linux/of_mdio.h>
22#include <linux/if_ether.h>
21#include <asm/types.h> 23#include <asm/types.h>
22 24
23#define FS_ENET_NAME "fs_enet" 25#define FS_ENET_NAME "fs_enet"
@@ -135,13 +137,15 @@ struct fs_platform_info {
135 const struct fs_mii_bus_info *bus_info; 137 const struct fs_mii_bus_info *bus_info;
136 138
137 int rx_ring, tx_ring; /* number of buffers on rx */ 139 int rx_ring, tx_ring; /* number of buffers on rx */
138 __u8 macaddr[6]; /* mac address */ 140 __u8 macaddr[ETH_ALEN]; /* mac address */
139 int rx_copybreak; /* limit we copy small frames */ 141 int rx_copybreak; /* limit we copy small frames */
140 int use_napi; /* use NAPI */ 142 int use_napi; /* use NAPI */
141 int napi_weight; /* NAPI weight */ 143 int napi_weight; /* NAPI weight */
142 144
143 int use_rmii; /* use RMII mode */ 145 int use_rmii; /* use RMII mode */
144 int has_phy; /* if the network is phy container as well...*/ 146 int has_phy; /* if the network is phy container as well...*/
147
148 struct clk *clk_per; /* 'per' clock for register access */
145}; 149};
146struct fs_mii_fec_platform_info { 150struct fs_mii_fec_platform_info {
147 u32 irq[32]; 151 u32 irq[32];
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 2b93a9a5a1e6..0efc3e62843a 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -39,17 +39,6 @@ static inline void get_fs_pwd(struct fs_struct *fs, struct path *pwd)
39 spin_unlock(&fs->lock); 39 spin_unlock(&fs->lock);
40} 40}
41 41
42static inline void get_fs_root_and_pwd(struct fs_struct *fs, struct path *root,
43 struct path *pwd)
44{
45 spin_lock(&fs->lock);
46 *root = fs->root;
47 path_get(root);
48 *pwd = fs->pwd;
49 path_get(pwd);
50 spin_unlock(&fs->lock);
51}
52
53extern bool current_chrooted(void); 42extern bool current_chrooted(void);
54 43
55#endif /* _LINUX_FS_STRUCT_H */ 44#endif /* _LINUX_FS_STRUCT_H */
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h
index a9ff9a36b86d..7823e9ef995e 100644
--- a/include/linux/fscache-cache.h
+++ b/include/linux/fscache-cache.h
@@ -251,6 +251,10 @@ struct fscache_cache_ops {
251 /* unpin an object in the cache */ 251 /* unpin an object in the cache */
252 void (*unpin_object)(struct fscache_object *object); 252 void (*unpin_object)(struct fscache_object *object);
253 253
254 /* check the consistency between the backing cache and the FS-Cache
255 * cookie */
256 bool (*check_consistency)(struct fscache_operation *op);
257
254 /* store the updated auxiliary data on an object */ 258 /* store the updated auxiliary data on an object */
255 void (*update_object)(struct fscache_object *object); 259 void (*update_object)(struct fscache_object *object);
256 260
diff --git a/include/linux/fscache.h b/include/linux/fscache.h
index 7a086235da4b..19b46458e4e8 100644
--- a/include/linux/fscache.h
+++ b/include/linux/fscache.h
@@ -183,6 +183,7 @@ extern struct fscache_cookie *__fscache_acquire_cookie(
183 const struct fscache_cookie_def *, 183 const struct fscache_cookie_def *,
184 void *); 184 void *);
185extern void __fscache_relinquish_cookie(struct fscache_cookie *, int); 185extern void __fscache_relinquish_cookie(struct fscache_cookie *, int);
186extern int __fscache_check_consistency(struct fscache_cookie *);
186extern void __fscache_update_cookie(struct fscache_cookie *); 187extern void __fscache_update_cookie(struct fscache_cookie *);
187extern int __fscache_attr_changed(struct fscache_cookie *); 188extern int __fscache_attr_changed(struct fscache_cookie *);
188extern void __fscache_invalidate(struct fscache_cookie *); 189extern void __fscache_invalidate(struct fscache_cookie *);
@@ -208,6 +209,8 @@ extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *,
208 gfp_t); 209 gfp_t);
209extern void __fscache_uncache_all_inode_pages(struct fscache_cookie *, 210extern void __fscache_uncache_all_inode_pages(struct fscache_cookie *,
210 struct inode *); 211 struct inode *);
212extern void __fscache_readpages_cancel(struct fscache_cookie *cookie,
213 struct list_head *pages);
211 214
212/** 215/**
213 * fscache_register_netfs - Register a filesystem as desiring caching services 216 * fscache_register_netfs - Register a filesystem as desiring caching services
@@ -326,6 +329,25 @@ void fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire)
326} 329}
327 330
328/** 331/**
332 * fscache_check_consistency - Request that if the cache is updated
333 * @cookie: The cookie representing the cache object
334 *
335 * Request an consistency check from fscache, which passes the request
336 * to the backing cache.
337 *
338 * Returns 0 if consistent and -ESTALE if inconsistent. May also
339 * return -ENOMEM and -ERESTARTSYS.
340 */
341static inline
342int fscache_check_consistency(struct fscache_cookie *cookie)
343{
344 if (fscache_cookie_valid(cookie))
345 return __fscache_check_consistency(cookie);
346 else
347 return 0;
348}
349
350/**
329 * fscache_update_cookie - Request that a cache object be updated 351 * fscache_update_cookie - Request that a cache object be updated
330 * @cookie: The cookie representing the cache object 352 * @cookie: The cookie representing the cache object
331 * 353 *
@@ -570,6 +592,26 @@ int fscache_alloc_page(struct fscache_cookie *cookie,
570} 592}
571 593
572/** 594/**
595 * fscache_readpages_cancel - Cancel read/alloc on pages
596 * @cookie: The cookie representing the inode's cache object.
597 * @pages: The netfs pages that we canceled write on in readpages()
598 *
599 * Uncache/unreserve the pages reserved earlier in readpages() via
600 * fscache_readpages_or_alloc() and similar. In most successful caches in
601 * readpages() this doesn't do anything. In cases when the underlying netfs's
602 * readahead failed we need to clean up the pagelist (unmark and uncache).
603 *
604 * This function may sleep as it may have to clean up disk state.
605 */
606static inline
607void fscache_readpages_cancel(struct fscache_cookie *cookie,
608 struct list_head *pages)
609{
610 if (fscache_cookie_valid(cookie))
611 __fscache_readpages_cancel(cookie, pages);
612}
613
614/**
573 * fscache_write_page - Request storage of a page in the cache 615 * fscache_write_page - Request storage of a page in the cache
574 * @cookie: The cookie representing the cache object 616 * @cookie: The cookie representing the cache object
575 * @page: The netfs page to store 617 * @page: The netfs page to store
diff --git a/include/linux/fsl/mxs-dma.h b/include/linux/fsl/mxs-dma.h
deleted file mode 100644
index 55d870238399..000000000000
--- a/include/linux/fsl/mxs-dma.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __MACH_MXS_DMA_H__
10#define __MACH_MXS_DMA_H__
11
12#include <linux/dmaengine.h>
13
14struct mxs_dma_data {
15 int chan_irq;
16};
17
18extern int mxs_dma_is_apbh(struct dma_chan *chan);
19extern int mxs_dma_is_apbx(struct dma_chan *chan);
20#endif /* __MACH_MXS_DMA_H__ */
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 120d57a1c3a5..5eaa746735ff 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -359,6 +359,40 @@ do { \
359 __trace_printk(ip, fmt, ##args); \ 359 __trace_printk(ip, fmt, ##args); \
360} while (0) 360} while (0)
361 361
362/**
363 * tracepoint_string - register constant persistent string to trace system
364 * @str - a constant persistent string that will be referenced in tracepoints
365 *
366 * If constant strings are being used in tracepoints, it is faster and
367 * more efficient to just save the pointer to the string and reference
368 * that with a printf "%s" instead of saving the string in the ring buffer
369 * and wasting space and time.
370 *
371 * The problem with the above approach is that userspace tools that read
372 * the binary output of the trace buffers do not have access to the string.
373 * Instead they just show the address of the string which is not very
374 * useful to users.
375 *
376 * With tracepoint_string(), the string will be registered to the tracing
377 * system and exported to userspace via the debugfs/tracing/printk_formats
378 * file that maps the string address to the string text. This way userspace
379 * tools that read the binary buffers have a way to map the pointers to
380 * the ASCII strings they represent.
381 *
382 * The @str used must be a constant string and persistent as it would not
383 * make sense to show a string that no longer exists. But it is still fine
384 * to be used with modules, because when modules are unloaded, if they
385 * had tracepoints, the ring buffers are cleared too. As long as the string
386 * does not change during the life of the module, it is fine to use
387 * tracepoint_string() within a module.
388 */
389#define tracepoint_string(str) \
390 ({ \
391 static const char *___tp_str __tracepoint_string = str; \
392 ___tp_str; \
393 })
394#define __tracepoint_string __attribute__((section("__tracepoint_str")))
395
362#ifdef CONFIG_PERF_EVENTS 396#ifdef CONFIG_PERF_EVENTS
363struct perf_event; 397struct perf_event;
364 398
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h
index 661d374aeb2d..f8d41cb1cbe0 100644
--- a/include/linux/genalloc.h
+++ b/include/linux/genalloc.h
@@ -66,8 +66,8 @@ struct gen_pool_chunk {
66 struct list_head next_chunk; /* next chunk in pool */ 66 struct list_head next_chunk; /* next chunk in pool */
67 atomic_t avail; 67 atomic_t avail;
68 phys_addr_t phys_addr; /* physical starting address of memory chunk */ 68 phys_addr_t phys_addr; /* physical starting address of memory chunk */
69 unsigned long start_addr; /* starting address of memory chunk */ 69 unsigned long start_addr; /* start address of memory chunk */
70 unsigned long end_addr; /* ending address of memory chunk */ 70 unsigned long end_addr; /* end address of memory chunk (inclusive) */
71 unsigned long bits[0]; /* bitmap for allocating memory chunk */ 71 unsigned long bits[0]; /* bitmap for allocating memory chunk */
72}; 72};
73 73
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 05bcc0903766..1e041063b226 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -1,132 +1,13 @@
1#ifndef LINUX_HARDIRQ_H 1#ifndef LINUX_HARDIRQ_H
2#define LINUX_HARDIRQ_H 2#define LINUX_HARDIRQ_H
3 3
4#include <linux/preempt.h> 4#include <linux/preempt_mask.h>
5#include <linux/lockdep.h> 5#include <linux/lockdep.h>
6#include <linux/ftrace_irq.h> 6#include <linux/ftrace_irq.h>
7#include <linux/vtime.h> 7#include <linux/vtime.h>
8#include <asm/hardirq.h>
9 8
10/*
11 * We put the hardirq and softirq counter into the preemption
12 * counter. The bitmask has the following meaning:
13 *
14 * - bits 0-7 are the preemption count (max preemption depth: 256)
15 * - bits 8-15 are the softirq count (max # of softirqs: 256)
16 *
17 * The hardirq count can in theory reach the same as NR_IRQS.
18 * In reality, the number of nested IRQS is limited to the stack
19 * size as well. For archs with over 1000 IRQS it is not practical
20 * to expect that they will all nest. We give a max of 10 bits for
21 * hardirq nesting. An arch may choose to give less than 10 bits.
22 * m68k expects it to be 8.
23 *
24 * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
25 * - bit 26 is the NMI_MASK
26 * - bit 27 is the PREEMPT_ACTIVE flag
27 *
28 * PREEMPT_MASK: 0x000000ff
29 * SOFTIRQ_MASK: 0x0000ff00
30 * HARDIRQ_MASK: 0x03ff0000
31 * NMI_MASK: 0x04000000
32 */
33#define PREEMPT_BITS 8
34#define SOFTIRQ_BITS 8
35#define NMI_BITS 1
36
37#define MAX_HARDIRQ_BITS 10
38
39#ifndef HARDIRQ_BITS
40# define HARDIRQ_BITS MAX_HARDIRQ_BITS
41#endif
42
43#if HARDIRQ_BITS > MAX_HARDIRQ_BITS
44#error HARDIRQ_BITS too high!
45#endif
46
47#define PREEMPT_SHIFT 0
48#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
49#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
50#define NMI_SHIFT (HARDIRQ_SHIFT + HARDIRQ_BITS)
51
52#define __IRQ_MASK(x) ((1UL << (x))-1)
53
54#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
55#define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
56#define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
57#define NMI_MASK (__IRQ_MASK(NMI_BITS) << NMI_SHIFT)
58 9
59#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
60#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
61#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
62#define NMI_OFFSET (1UL << NMI_SHIFT)
63
64#define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET)
65
66#ifndef PREEMPT_ACTIVE
67#define PREEMPT_ACTIVE_BITS 1
68#define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS)
69#define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
70#endif
71
72#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS))
73#error PREEMPT_ACTIVE is too low!
74#endif
75
76#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
77#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
78#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK \
79 | NMI_MASK))
80
81/*
82 * Are we doing bottom half or hardware interrupt processing?
83 * Are we in a softirq context? Interrupt context?
84 * in_softirq - Are we currently processing softirq or have bh disabled?
85 * in_serving_softirq - Are we currently processing softirq?
86 */
87#define in_irq() (hardirq_count())
88#define in_softirq() (softirq_count())
89#define in_interrupt() (irq_count())
90#define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET)
91
92/*
93 * Are we in NMI context?
94 */
95#define in_nmi() (preempt_count() & NMI_MASK)
96
97#if defined(CONFIG_PREEMPT_COUNT)
98# define PREEMPT_CHECK_OFFSET 1
99#else
100# define PREEMPT_CHECK_OFFSET 0
101#endif
102
103/*
104 * Are we running in atomic context? WARNING: this macro cannot
105 * always detect atomic context; in particular, it cannot know about
106 * held spinlocks in non-preemptible kernels. Thus it should not be
107 * used in the general case to determine whether sleeping is possible.
108 * Do not use in_atomic() in driver code.
109 */
110#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
111
112/*
113 * Check whether we were atomic before we did preempt_disable():
114 * (used by the scheduler, *after* releasing the kernel lock)
115 */
116#define in_atomic_preempt_off() \
117 ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)
118
119#ifdef CONFIG_PREEMPT_COUNT
120# define preemptible() (preempt_count() == 0 && !irqs_disabled())
121#else
122# define preemptible() 0
123#endif
124
125#if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS)
126extern void synchronize_irq(unsigned int irq); 10extern void synchronize_irq(unsigned int irq);
127#else
128# define synchronize_irq(irq) barrier()
129#endif
130 11
131#if defined(CONFIG_TINY_RCU) 12#if defined(CONFIG_TINY_RCU)
132 13
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index 3b589440ecfe..9231be9e90a2 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -18,11 +18,21 @@ enum hdmi_infoframe_type {
18 HDMI_INFOFRAME_TYPE_AUDIO = 0x84, 18 HDMI_INFOFRAME_TYPE_AUDIO = 0x84,
19}; 19};
20 20
21#define HDMI_IEEE_OUI 0x000c03
21#define HDMI_INFOFRAME_HEADER_SIZE 4 22#define HDMI_INFOFRAME_HEADER_SIZE 4
22#define HDMI_AVI_INFOFRAME_SIZE 13 23#define HDMI_AVI_INFOFRAME_SIZE 13
23#define HDMI_SPD_INFOFRAME_SIZE 25 24#define HDMI_SPD_INFOFRAME_SIZE 25
24#define HDMI_AUDIO_INFOFRAME_SIZE 10 25#define HDMI_AUDIO_INFOFRAME_SIZE 10
25 26
27#define HDMI_INFOFRAME_SIZE(type) \
28 (HDMI_INFOFRAME_HEADER_SIZE + HDMI_ ## type ## _INFOFRAME_SIZE)
29
30struct hdmi_any_infoframe {
31 enum hdmi_infoframe_type type;
32 unsigned char version;
33 unsigned char length;
34};
35
26enum hdmi_colorspace { 36enum hdmi_colorspace {
27 HDMI_COLORSPACE_RGB, 37 HDMI_COLORSPACE_RGB,
28 HDMI_COLORSPACE_YUV422, 38 HDMI_COLORSPACE_YUV422,
@@ -100,9 +110,6 @@ struct hdmi_avi_infoframe {
100 unsigned char version; 110 unsigned char version;
101 unsigned char length; 111 unsigned char length;
102 enum hdmi_colorspace colorspace; 112 enum hdmi_colorspace colorspace;
103 bool active_info_valid;
104 bool horizontal_bar_valid;
105 bool vertical_bar_valid;
106 enum hdmi_scan_mode scan_mode; 113 enum hdmi_scan_mode scan_mode;
107 enum hdmi_colorimetry colorimetry; 114 enum hdmi_colorimetry colorimetry;
108 enum hdmi_picture_aspect picture_aspect; 115 enum hdmi_picture_aspect picture_aspect;
@@ -218,14 +225,52 @@ int hdmi_audio_infoframe_init(struct hdmi_audio_infoframe *frame);
218ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame, 225ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame,
219 void *buffer, size_t size); 226 void *buffer, size_t size);
220 227
228enum hdmi_3d_structure {
229 HDMI_3D_STRUCTURE_INVALID = -1,
230 HDMI_3D_STRUCTURE_FRAME_PACKING = 0,
231 HDMI_3D_STRUCTURE_FIELD_ALTERNATIVE,
232 HDMI_3D_STRUCTURE_LINE_ALTERNATIVE,
233 HDMI_3D_STRUCTURE_SIDE_BY_SIDE_FULL,
234 HDMI_3D_STRUCTURE_L_DEPTH,
235 HDMI_3D_STRUCTURE_L_DEPTH_GFX_GFX_DEPTH,
236 HDMI_3D_STRUCTURE_TOP_AND_BOTTOM,
237 HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF = 8,
238};
239
240
221struct hdmi_vendor_infoframe { 241struct hdmi_vendor_infoframe {
222 enum hdmi_infoframe_type type; 242 enum hdmi_infoframe_type type;
223 unsigned char version; 243 unsigned char version;
224 unsigned char length; 244 unsigned char length;
225 u8 data[27]; 245 unsigned int oui;
246 u8 vic;
247 enum hdmi_3d_structure s3d_struct;
248 unsigned int s3d_ext_data;
226}; 249};
227 250
251int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame);
228ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame, 252ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame,
229 void *buffer, size_t size); 253 void *buffer, size_t size);
230 254
255union hdmi_vendor_any_infoframe {
256 struct {
257 enum hdmi_infoframe_type type;
258 unsigned char version;
259 unsigned char length;
260 unsigned int oui;
261 } any;
262 struct hdmi_vendor_infoframe hdmi;
263};
264
265union hdmi_infoframe {
266 struct hdmi_any_infoframe any;
267 struct hdmi_avi_infoframe avi;
268 struct hdmi_spd_infoframe spd;
269 union hdmi_vendor_any_infoframe vendor;
270 struct hdmi_audio_infoframe audio;
271};
272
273ssize_t
274hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size);
275
231#endif /* _DRM_HDMI_H */ 276#endif /* _DRM_HDMI_H */
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
index ecefb7311dd6..32ba45158d39 100644
--- a/include/linux/hid-sensor-hub.h
+++ b/include/linux/hid-sensor-hub.h
@@ -172,7 +172,7 @@ struct hid_sensor_common {
172 struct hid_sensor_hub_attribute_info sensitivity; 172 struct hid_sensor_hub_attribute_info sensitivity;
173}; 173};
174 174
175/*Convert from hid unit expo to regular exponent*/ 175/* Convert from hid unit expo to regular exponent */
176static inline int hid_sensor_convert_exponent(int unit_expo) 176static inline int hid_sensor_convert_exponent(int unit_expo)
177{ 177{
178 if (unit_expo < 0x08) 178 if (unit_expo < 0x08)
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h
index 6f24446e7669..4f945d3ed49f 100644
--- a/include/linux/hid-sensor-ids.h
+++ b/include/linux/hid-sensor-ids.h
@@ -37,7 +37,7 @@
37#define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 37#define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458
38#define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 38#define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459
39 39
40/*ORIENTATION: Compass 3D: (200083) */ 40/* ORIENTATION: Compass 3D: (200083) */
41#define HID_USAGE_SENSOR_COMPASS_3D 0x200083 41#define HID_USAGE_SENSOR_COMPASS_3D 0x200083
42#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 42#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471
43#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 43#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 0c48991b0402..31b9d299ef6c 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -252,6 +252,8 @@ struct hid_item {
252#define HID_OUTPUT_REPORT 1 252#define HID_OUTPUT_REPORT 1
253#define HID_FEATURE_REPORT 2 253#define HID_FEATURE_REPORT 2
254 254
255#define HID_REPORT_TYPES 3
256
255/* 257/*
256 * HID connect requests 258 * HID connect requests
257 */ 259 */
@@ -283,6 +285,7 @@ struct hid_item {
283#define HID_QUIRK_MULTI_INPUT 0x00000040 285#define HID_QUIRK_MULTI_INPUT 0x00000040
284#define HID_QUIRK_HIDINPUT_FORCE 0x00000080 286#define HID_QUIRK_HIDINPUT_FORCE 0x00000080
285#define HID_QUIRK_NO_EMPTY_INPUT 0x00000100 287#define HID_QUIRK_NO_EMPTY_INPUT 0x00000100
288#define HID_QUIRK_NO_INIT_INPUT_REPORTS 0x00000200
286#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 289#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
287#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 290#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
288#define HID_QUIRK_NO_INIT_REPORTS 0x20000000 291#define HID_QUIRK_NO_INIT_REPORTS 0x20000000
@@ -295,6 +298,7 @@ struct hid_item {
295#define HID_GROUP_GENERIC 0x0001 298#define HID_GROUP_GENERIC 0x0001
296#define HID_GROUP_MULTITOUCH 0x0002 299#define HID_GROUP_MULTITOUCH 0x0002
297#define HID_GROUP_SENSOR_HUB 0x0003 300#define HID_GROUP_SENSOR_HUB 0x0003
301#define HID_GROUP_MULTITOUCH_WIN_8 0x0004
298 302
299/* 303/*
300 * This is the global environment of the parser. This information is 304 * This is the global environment of the parser. This information is
@@ -393,14 +397,14 @@ struct hid_report {
393 struct hid_device *device; /* associated device */ 397 struct hid_device *device; /* associated device */
394}; 398};
395 399
400#define HID_MAX_IDS 256
401
396struct hid_report_enum { 402struct hid_report_enum {
397 unsigned numbered; 403 unsigned numbered;
398 struct list_head report_list; 404 struct list_head report_list;
399 struct hid_report *report_id_hash[256]; 405 struct hid_report *report_id_hash[HID_MAX_IDS];
400}; 406};
401 407
402#define HID_REPORT_TYPES 3
403
404#define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */ 408#define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */
405#define HID_MAX_BUFFER_SIZE 4096 /* 4kb */ 409#define HID_MAX_BUFFER_SIZE 4096 /* 4kb */
406#define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */ 410#define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */
@@ -456,6 +460,7 @@ struct hid_device { /* device report descriptor */
456 enum hid_type type; /* device type (mouse, kbd, ...) */ 460 enum hid_type type; /* device type (mouse, kbd, ...) */
457 unsigned country; /* HID country */ 461 unsigned country; /* HID country */
458 struct hid_report_enum report_enum[HID_REPORT_TYPES]; 462 struct hid_report_enum report_enum[HID_REPORT_TYPES];
463 struct work_struct led_work; /* delayed LED worker */
459 464
460 struct semaphore driver_lock; /* protects the current driver, except during input */ 465 struct semaphore driver_lock; /* protects the current driver, except during input */
461 struct semaphore driver_input_lock; /* protects the current driver */ 466 struct semaphore driver_input_lock; /* protects the current driver */
@@ -532,6 +537,8 @@ static inline void hid_set_drvdata(struct hid_device *hdev, void *data)
532#define HID_GLOBAL_STACK_SIZE 4 537#define HID_GLOBAL_STACK_SIZE 4
533#define HID_COLLECTION_STACK_SIZE 4 538#define HID_COLLECTION_STACK_SIZE 4
534 539
540#define HID_SCAN_FLAG_MT_WIN_8 0x00000001
541
535struct hid_parser { 542struct hid_parser {
536 struct hid_global global; 543 struct hid_global global;
537 struct hid_global global_stack[HID_GLOBAL_STACK_SIZE]; 544 struct hid_global global_stack[HID_GLOBAL_STACK_SIZE];
@@ -540,6 +547,7 @@ struct hid_parser {
540 unsigned collection_stack[HID_COLLECTION_STACK_SIZE]; 547 unsigned collection_stack[HID_COLLECTION_STACK_SIZE];
541 unsigned collection_stack_ptr; 548 unsigned collection_stack_ptr;
542 struct hid_device *device; 549 struct hid_device *device;
550 unsigned scan_flags;
543}; 551};
544 552
545struct hid_class_descriptor { 553struct hid_class_descriptor {
@@ -744,9 +752,14 @@ struct hid_field *hidinput_get_led_field(struct hid_device *hid);
744unsigned int hidinput_count_leds(struct hid_device *hid); 752unsigned int hidinput_count_leds(struct hid_device *hid);
745__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code); 753__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code);
746void hid_output_report(struct hid_report *report, __u8 *data); 754void hid_output_report(struct hid_report *report, __u8 *data);
755u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags);
747struct hid_device *hid_allocate_device(void); 756struct hid_device *hid_allocate_device(void);
748struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); 757struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id);
749int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); 758int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
759struct hid_report *hid_validate_values(struct hid_device *hid,
760 unsigned int type, unsigned int id,
761 unsigned int field_index,
762 unsigned int report_counts);
750int hid_open_report(struct hid_device *device); 763int hid_open_report(struct hid_device *device);
751int hid_check_keys_pressed(struct hid_device *hid); 764int hid_check_keys_pressed(struct hid_device *hid);
752int hid_connect(struct hid_device *hid, unsigned int connect_mask); 765int hid_connect(struct hid_device *hid, unsigned int connect_mask);
@@ -989,7 +1002,6 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
989u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); 1002u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct);
990int usbhid_quirks_init(char **quirks_param); 1003int usbhid_quirks_init(char **quirks_param);
991void usbhid_quirks_exit(void); 1004void usbhid_quirks_exit(void);
992void usbhid_set_leds(struct hid_device *hid);
993 1005
994#ifdef CONFIG_HID_PID 1006#ifdef CONFIG_HID_PID
995int hid_pidff_init(struct hid_device *hid); 1007int hid_pidff_init(struct hid_device *hid);
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h
index 2451662c728a..ddf52612eed8 100644
--- a/include/linux/hidraw.h
+++ b/include/linux/hidraw.h
@@ -23,6 +23,7 @@ struct hidraw {
23 wait_queue_head_t wait; 23 wait_queue_head_t wait;
24 struct hid_device *hid; 24 struct hid_device *hid;
25 struct device *dev; 25 struct device *dev;
26 spinlock_t list_lock;
26 struct list_head list; 27 struct list_head list;
27}; 28};
28 29
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index b60de92e2edc..3935428c57cf 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -96,9 +96,6 @@ extern int copy_pte_range(struct mm_struct *dst_mm, struct mm_struct *src_mm,
96 pmd_t *dst_pmd, pmd_t *src_pmd, 96 pmd_t *dst_pmd, pmd_t *src_pmd,
97 struct vm_area_struct *vma, 97 struct vm_area_struct *vma,
98 unsigned long addr, unsigned long end); 98 unsigned long addr, unsigned long end);
99extern int handle_pte_fault(struct mm_struct *mm,
100 struct vm_area_struct *vma, unsigned long address,
101 pte_t *pte, pmd_t *pmd, unsigned int flags);
102extern int split_huge_page_to_list(struct page *page, struct list_head *list); 99extern int split_huge_page_to_list(struct page *page, struct list_head *list);
103static inline int split_huge_page(struct page *page) 100static inline int split_huge_page(struct page *page)
104{ 101{
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index c2b1801a160b..0393270466c3 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -66,6 +66,9 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to,
66 vm_flags_t vm_flags); 66 vm_flags_t vm_flags);
67void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); 67void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
68int dequeue_hwpoisoned_huge_page(struct page *page); 68int dequeue_hwpoisoned_huge_page(struct page *page);
69bool isolate_huge_page(struct page *page, struct list_head *list);
70void putback_active_hugepage(struct page *page);
71bool is_hugepage_active(struct page *page);
69void copy_huge_page(struct page *dst, struct page *src); 72void copy_huge_page(struct page *dst, struct page *src);
70 73
71#ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE 74#ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE
@@ -134,6 +137,9 @@ static inline int dequeue_hwpoisoned_huge_page(struct page *page)
134 return 0; 137 return 0;
135} 138}
136 139
140#define isolate_huge_page(p, l) false
141#define putback_active_hugepage(p) do {} while (0)
142#define is_hugepage_active(x) false
137static inline void copy_huge_page(struct page *dst, struct page *src) 143static inline void copy_huge_page(struct page *dst, struct page *src)
138{ 144{
139} 145}
@@ -261,6 +267,8 @@ struct huge_bootmem_page {
261}; 267};
262 268
263struct page *alloc_huge_page_node(struct hstate *h, int nid); 269struct page *alloc_huge_page_node(struct hstate *h, int nid);
270struct page *alloc_huge_page_noerr(struct vm_area_struct *vma,
271 unsigned long addr, int avoid_reserve);
264 272
265/* arch callback */ 273/* arch callback */
266int __init alloc_bootmem_huge_page(struct hstate *h); 274int __init alloc_bootmem_huge_page(struct hstate *h);
@@ -371,9 +379,23 @@ static inline pgoff_t basepage_index(struct page *page)
371 return __basepage_index(page); 379 return __basepage_index(page);
372} 380}
373 381
382extern void dissolve_free_huge_pages(unsigned long start_pfn,
383 unsigned long end_pfn);
384int pmd_huge_support(void);
385/*
386 * Currently hugepage migration is enabled only for pmd-based hugepage.
387 * This function will be updated when hugepage migration is more widely
388 * supported.
389 */
390static inline int hugepage_migration_support(struct hstate *h)
391{
392 return pmd_huge_support() && (huge_page_shift(h) == PMD_SHIFT);
393}
394
374#else /* CONFIG_HUGETLB_PAGE */ 395#else /* CONFIG_HUGETLB_PAGE */
375struct hstate {}; 396struct hstate {};
376#define alloc_huge_page_node(h, nid) NULL 397#define alloc_huge_page_node(h, nid) NULL
398#define alloc_huge_page_noerr(v, a, r) NULL
377#define alloc_bootmem_huge_page(h) NULL 399#define alloc_bootmem_huge_page(h) NULL
378#define hstate_file(f) NULL 400#define hstate_file(f) NULL
379#define hstate_sizelog(s) NULL 401#define hstate_sizelog(s) NULL
@@ -396,6 +418,9 @@ static inline pgoff_t basepage_index(struct page *page)
396{ 418{
397 return page->index; 419 return page->index;
398} 420}
421#define dissolve_free_huge_pages(s, e) do {} while (0)
422#define pmd_huge_support() 0
423#define hugepage_migration_support(h) 0
399#endif /* CONFIG_HUGETLB_PAGE */ 424#endif /* CONFIG_HUGETLB_PAGE */
400 425
401#endif /* _LINUX_HUGETLB_H */ 426#endif /* _LINUX_HUGETLB_H */
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index fae8bac907ef..d98503bde7e9 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -27,6 +27,17 @@
27 27
28#include <linux/types.h> 28#include <linux/types.h>
29 29
30/*
31 * Framework version for util services.
32 */
33#define UTIL_FW_MINOR 0
34
35#define UTIL_WS2K8_FW_MAJOR 1
36#define UTIL_WS2K8_FW_VERSION (UTIL_WS2K8_FW_MAJOR << 16 | UTIL_FW_MINOR)
37
38#define UTIL_FW_MAJOR 3
39#define UTIL_FW_VERSION (UTIL_FW_MAJOR << 16 | UTIL_FW_MINOR)
40
30 41
31/* 42/*
32 * Implementation of host controlled snapshot of the guest. 43 * Implementation of host controlled snapshot of the guest.
@@ -455,27 +466,6 @@ hv_get_ringbuffer_availbytes(struct hv_ring_buffer_info *rbi,
455 *read = dsize - *write; 466 *read = dsize - *write;
456} 467}
457 468
458
459/*
460 * We use the same version numbering for all Hyper-V modules.
461 *
462 * Definition of versioning is as follows;
463 *
464 * Major Number Changes for these scenarios;
465 * 1. When a new version of Windows Hyper-V
466 * is released.
467 * 2. A Major change has occurred in the
468 * Linux IC's.
469 * (For example the merge for the first time
470 * into the kernel) Every time the Major Number
471 * changes, the Revision number is reset to 0.
472 * Minor Number Changes when new functionality is added
473 * to the Linux IC's that is not a bug fix.
474 *
475 * 3.1 - Added completed hv_utils driver. Shutdown/Heartbeat/Timesync
476 */
477#define HV_DRV_VERSION "3.1"
478
479/* 469/*
480 * VMBUS version is 32 bit entity broken up into 470 * VMBUS version is 32 bit entity broken up into
481 * two 16 bit quantities: major_number. minor_number. 471 * two 16 bit quantities: major_number. minor_number.
@@ -1494,7 +1484,7 @@ struct hyperv_service_callback {
1494}; 1484};
1495 1485
1496#define MAX_SRV_VER 0x7ffffff 1486#define MAX_SRV_VER 0x7ffffff
1497extern void vmbus_prep_negotiate_resp(struct icmsg_hdr *, 1487extern bool vmbus_prep_negotiate_resp(struct icmsg_hdr *,
1498 struct icmsg_negotiate *, u8 *, int, 1488 struct icmsg_negotiate *, u8 *, int,
1499 int); 1489 int);
1500 1490
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index e988fa935b3c..2ab11dc38077 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -447,11 +447,13 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
447static inline struct i2c_adapter * 447static inline struct i2c_adapter *
448i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) 448i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
449{ 449{
450#if IS_ENABLED(I2C_MUX)
450 struct device *parent = adapter->dev.parent; 451 struct device *parent = adapter->dev.parent;
451 452
452 if (parent != NULL && parent->type == &i2c_adapter_type) 453 if (parent != NULL && parent->type == &i2c_adapter_type)
453 return to_i2c_adapter(parent); 454 return to_i2c_adapter(parent);
454 else 455 else
456#endif
455 return NULL; 457 return NULL;
456} 458}
457 459
@@ -542,10 +544,24 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
542 544
543#endif /* I2C */ 545#endif /* I2C */
544 546
545#if IS_ENABLED(CONFIG_ACPI_I2C) 547#if IS_ENABLED(CONFIG_OF)
546extern void acpi_i2c_register_devices(struct i2c_adapter *adap); 548/* must call put_device() when done with returned i2c_client device */
549extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
550
551/* must call put_device() when done with returned i2c_adapter device */
552extern struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);
553
547#else 554#else
548static inline void acpi_i2c_register_devices(struct i2c_adapter *adap) {} 555
549#endif 556static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
557{
558 return NULL;
559}
560
561static inline struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node)
562{
563 return NULL;
564}
565#endif /* CONFIG_OF */
550 566
551#endif /* _LINUX_I2C_H */ 567#endif /* _LINUX_I2C_H */
diff --git a/include/linux/i2c/i2c-hid.h b/include/linux/i2c/i2c-hid.h
index 60e411d764d4..7aa901d92058 100644
--- a/include/linux/i2c/i2c-hid.h
+++ b/include/linux/i2c/i2c-hid.h
@@ -19,7 +19,8 @@
19 * @hid_descriptor_address: i2c register where the HID descriptor is stored. 19 * @hid_descriptor_address: i2c register where the HID descriptor is stored.
20 * 20 *
21 * Note that it is the responsibility of the platform driver (or the acpi 5.0 21 * Note that it is the responsibility of the platform driver (or the acpi 5.0
22 * driver) to setup the irq related to the gpio in the struct i2c_board_info. 22 * driver, or the flattened device tree) to setup the irq related to the gpio in
23 * the struct i2c_board_info.
23 * The platform driver should also setup the gpio according to the device: 24 * The platform driver should also setup the gpio according to the device:
24 * 25 *
25 * A typical example is the following: 26 * A typical example is the following:
diff --git a/include/linux/i2c/pxa-i2c.h b/include/linux/i2c/pxa-i2c.h
index 1a9f65e6ec0f..53aab243cbd8 100644
--- a/include/linux/i2c/pxa-i2c.h
+++ b/include/linux/i2c/pxa-i2c.h
@@ -67,6 +67,9 @@ struct i2c_pxa_platform_data {
67 unsigned int class; 67 unsigned int class;
68 unsigned int use_pio :1; 68 unsigned int use_pio :1;
69 unsigned int fast_mode :1; 69 unsigned int fast_mode :1;
70 unsigned int high_mode:1;
71 unsigned char master_code;
72 unsigned long rate;
70}; 73};
71 74
72extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info); 75extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info);
diff --git a/include/linux/i8042.h b/include/linux/i8042.h
index a986ff588944..0f9bafa17a02 100644
--- a/include/linux/i8042.h
+++ b/include/linux/i8042.h
@@ -31,6 +31,30 @@
31#define I8042_CMD_MUX_PFX 0x0090 31#define I8042_CMD_MUX_PFX 0x0090
32#define I8042_CMD_MUX_SEND 0x1090 32#define I8042_CMD_MUX_SEND 0x1090
33 33
34/*
35 * Status register bits.
36 */
37
38#define I8042_STR_PARITY 0x80
39#define I8042_STR_TIMEOUT 0x40
40#define I8042_STR_AUXDATA 0x20
41#define I8042_STR_KEYLOCK 0x10
42#define I8042_STR_CMDDAT 0x08
43#define I8042_STR_MUXERR 0x04
44#define I8042_STR_IBF 0x02
45#define I8042_STR_OBF 0x01
46
47/*
48 * Control register bits.
49 */
50
51#define I8042_CTR_KBDINT 0x01
52#define I8042_CTR_AUXINT 0x02
53#define I8042_CTR_IGNKEYLOCK 0x08
54#define I8042_CTR_KBDDIS 0x10
55#define I8042_CTR_AUXDIS 0x20
56#define I8042_CTR_XLATE 0x40
57
34struct serio; 58struct serio;
35 59
36#if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE) 60#if defined(CONFIG_SERIO_I8042) || defined(CONFIG_SERIO_I8042_MODULE)
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index b0dc87a2a376..a5b598a79bec 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -16,6 +16,7 @@
16#define LINUX_IEEE80211_H 16#define LINUX_IEEE80211_H
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/if_ether.h>
19#include <asm/byteorder.h> 20#include <asm/byteorder.h>
20 21
21/* 22/*
@@ -209,28 +210,28 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
209struct ieee80211_hdr { 210struct ieee80211_hdr {
210 __le16 frame_control; 211 __le16 frame_control;
211 __le16 duration_id; 212 __le16 duration_id;
212 u8 addr1[6]; 213 u8 addr1[ETH_ALEN];
213 u8 addr2[6]; 214 u8 addr2[ETH_ALEN];
214 u8 addr3[6]; 215 u8 addr3[ETH_ALEN];
215 __le16 seq_ctrl; 216 __le16 seq_ctrl;
216 u8 addr4[6]; 217 u8 addr4[ETH_ALEN];
217} __packed __aligned(2); 218} __packed __aligned(2);
218 219
219struct ieee80211_hdr_3addr { 220struct ieee80211_hdr_3addr {
220 __le16 frame_control; 221 __le16 frame_control;
221 __le16 duration_id; 222 __le16 duration_id;
222 u8 addr1[6]; 223 u8 addr1[ETH_ALEN];
223 u8 addr2[6]; 224 u8 addr2[ETH_ALEN];
224 u8 addr3[6]; 225 u8 addr3[ETH_ALEN];
225 __le16 seq_ctrl; 226 __le16 seq_ctrl;
226} __packed __aligned(2); 227} __packed __aligned(2);
227 228
228struct ieee80211_qos_hdr { 229struct ieee80211_qos_hdr {
229 __le16 frame_control; 230 __le16 frame_control;
230 __le16 duration_id; 231 __le16 duration_id;
231 u8 addr1[6]; 232 u8 addr1[ETH_ALEN];
232 u8 addr2[6]; 233 u8 addr2[ETH_ALEN];
233 u8 addr3[6]; 234 u8 addr3[ETH_ALEN];
234 __le16 seq_ctrl; 235 __le16 seq_ctrl;
235 __le16 qos_ctrl; 236 __le16 qos_ctrl;
236} __packed __aligned(2); 237} __packed __aligned(2);
@@ -608,8 +609,8 @@ struct ieee80211s_hdr {
608 u8 flags; 609 u8 flags;
609 u8 ttl; 610 u8 ttl;
610 __le32 seqnum; 611 __le32 seqnum;
611 u8 eaddr1[6]; 612 u8 eaddr1[ETH_ALEN];
612 u8 eaddr2[6]; 613 u8 eaddr2[ETH_ALEN];
613} __packed __aligned(2); 614} __packed __aligned(2);
614 615
615/* Mesh flags */ 616/* Mesh flags */
@@ -758,7 +759,7 @@ struct ieee80211_rann_ie {
758 u8 rann_flags; 759 u8 rann_flags;
759 u8 rann_hopcount; 760 u8 rann_hopcount;
760 u8 rann_ttl; 761 u8 rann_ttl;
761 u8 rann_addr[6]; 762 u8 rann_addr[ETH_ALEN];
762 __le32 rann_seq; 763 __le32 rann_seq;
763 __le32 rann_interval; 764 __le32 rann_interval;
764 __le32 rann_metric; 765 __le32 rann_metric;
@@ -802,9 +803,9 @@ enum ieee80211_vht_opmode_bits {
802struct ieee80211_mgmt { 803struct ieee80211_mgmt {
803 __le16 frame_control; 804 __le16 frame_control;
804 __le16 duration; 805 __le16 duration;
805 u8 da[6]; 806 u8 da[ETH_ALEN];
806 u8 sa[6]; 807 u8 sa[ETH_ALEN];
807 u8 bssid[6]; 808 u8 bssid[ETH_ALEN];
808 __le16 seq_ctrl; 809 __le16 seq_ctrl;
809 union { 810 union {
810 struct { 811 struct {
@@ -833,7 +834,7 @@ struct ieee80211_mgmt {
833 struct { 834 struct {
834 __le16 capab_info; 835 __le16 capab_info;
835 __le16 listen_interval; 836 __le16 listen_interval;
836 u8 current_ap[6]; 837 u8 current_ap[ETH_ALEN];
837 /* followed by SSID and Supported rates */ 838 /* followed by SSID and Supported rates */
838 u8 variable[0]; 839 u8 variable[0];
839 } __packed reassoc_req; 840 } __packed reassoc_req;
@@ -966,21 +967,21 @@ struct ieee80211_vendor_ie {
966struct ieee80211_rts { 967struct ieee80211_rts {
967 __le16 frame_control; 968 __le16 frame_control;
968 __le16 duration; 969 __le16 duration;
969 u8 ra[6]; 970 u8 ra[ETH_ALEN];
970 u8 ta[6]; 971 u8 ta[ETH_ALEN];
971} __packed __aligned(2); 972} __packed __aligned(2);
972 973
973struct ieee80211_cts { 974struct ieee80211_cts {
974 __le16 frame_control; 975 __le16 frame_control;
975 __le16 duration; 976 __le16 duration;
976 u8 ra[6]; 977 u8 ra[ETH_ALEN];
977} __packed __aligned(2); 978} __packed __aligned(2);
978 979
979struct ieee80211_pspoll { 980struct ieee80211_pspoll {
980 __le16 frame_control; 981 __le16 frame_control;
981 __le16 aid; 982 __le16 aid;
982 u8 bssid[6]; 983 u8 bssid[ETH_ALEN];
983 u8 ta[6]; 984 u8 ta[ETH_ALEN];
984} __packed __aligned(2); 985} __packed __aligned(2);
985 986
986/* TDLS */ 987/* TDLS */
@@ -989,14 +990,14 @@ struct ieee80211_pspoll {
989struct ieee80211_tdls_lnkie { 990struct ieee80211_tdls_lnkie {
990 u8 ie_type; /* Link Identifier IE */ 991 u8 ie_type; /* Link Identifier IE */
991 u8 ie_len; 992 u8 ie_len;
992 u8 bssid[6]; 993 u8 bssid[ETH_ALEN];
993 u8 init_sta[6]; 994 u8 init_sta[ETH_ALEN];
994 u8 resp_sta[6]; 995 u8 resp_sta[ETH_ALEN];
995} __packed; 996} __packed;
996 997
997struct ieee80211_tdls_data { 998struct ieee80211_tdls_data {
998 u8 da[6]; 999 u8 da[ETH_ALEN];
999 u8 sa[6]; 1000 u8 sa[ETH_ALEN];
1000 __be16 ether_type; 1001 __be16 ether_type;
1001 u8 payload_type; 1002 u8 payload_type;
1002 u8 category; 1003 u8 category;
@@ -1090,8 +1091,8 @@ struct ieee80211_p2p_noa_attr {
1090struct ieee80211_bar { 1091struct ieee80211_bar {
1091 __le16 frame_control; 1092 __le16 frame_control;
1092 __le16 duration; 1093 __le16 duration;
1093 __u8 ra[6]; 1094 __u8 ra[ETH_ALEN];
1094 __u8 ta[6]; 1095 __u8 ta[ETH_ALEN];
1095 __le16 control; 1096 __le16 control;
1096 __le16 start_seq_num; 1097 __le16 start_seq_num;
1097} __packed; 1098} __packed;
@@ -1709,6 +1710,10 @@ enum ieee80211_eid {
1709 WLAN_EID_OPMODE_NOTIF = 199, 1710 WLAN_EID_OPMODE_NOTIF = 199,
1710 WLAN_EID_WIDE_BW_CHANNEL_SWITCH = 194, 1711 WLAN_EID_WIDE_BW_CHANNEL_SWITCH = 194,
1711 WLAN_EID_CHANNEL_SWITCH_WRAPPER = 196, 1712 WLAN_EID_CHANNEL_SWITCH_WRAPPER = 196,
1713 WLAN_EID_EXTENDED_BSS_LOAD = 193,
1714 WLAN_EID_VHT_TX_POWER_ENVELOPE = 195,
1715 WLAN_EID_AID = 197,
1716 WLAN_EID_QUIET_CHANNEL = 198,
1712 1717
1713 /* 802.11ad */ 1718 /* 802.11ad */
1714 WLAN_EID_NON_TX_BSSID_CAP = 83, 1719 WLAN_EID_NON_TX_BSSID_CAP = 83,
@@ -1860,6 +1865,11 @@ enum ieee80211_tdls_actioncode {
1860 WLAN_TDLS_DISCOVERY_REQUEST = 10, 1865 WLAN_TDLS_DISCOVERY_REQUEST = 10,
1861}; 1866};
1862 1867
1868/* Interworking capabilities are set in 7th bit of 4th byte of the
1869 * @WLAN_EID_EXT_CAPABILITY information element
1870 */
1871#define WLAN_EXT_CAPA4_INTERWORKING_ENABLED BIT(7)
1872
1863/* 1873/*
1864 * TDLS capabililites to be enabled in the 5th byte of the 1874 * TDLS capabililites to be enabled in the 5th byte of the
1865 * @WLAN_EID_EXT_CAPABILITY information element 1875 * @WLAN_EID_EXT_CAPABILITY information element
@@ -2279,4 +2289,8 @@ static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,
2279 return !!(tim->virtual_map[index] & mask); 2289 return !!(tim->virtual_map[index] & mask);
2280} 2290}
2281 2291
2292/* convert time units */
2293#define TU_TO_JIFFIES(x) (usecs_to_jiffies((x) * 1024))
2294#define TU_TO_EXP_TIME(x) (jiffies + TU_TO_JIFFIES(x))
2295
2282#endif /* LINUX_IEEE80211_H */ 2296#endif /* LINUX_IEEE80211_H */
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index f6156f91eb1c..a899dc24be15 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -10,9 +10,9 @@
10#ifndef _LINUX_IF_TEAM_H_ 10#ifndef _LINUX_IF_TEAM_H_
11#define _LINUX_IF_TEAM_H_ 11#define _LINUX_IF_TEAM_H_
12 12
13
14#include <linux/netpoll.h> 13#include <linux/netpoll.h>
15#include <net/sch_generic.h> 14#include <net/sch_generic.h>
15#include <linux/types.h>
16#include <uapi/linux/if_team.h> 16#include <uapi/linux/if_team.h>
17 17
18struct team_pcpu_stats { 18struct team_pcpu_stats {
@@ -194,6 +194,18 @@ struct team {
194 bool user_carrier_enabled; 194 bool user_carrier_enabled;
195 bool queue_override_enabled; 195 bool queue_override_enabled;
196 struct list_head *qom_lists; /* array of queue override mapping lists */ 196 struct list_head *qom_lists; /* array of queue override mapping lists */
197 struct {
198 unsigned int count;
199 unsigned int interval; /* in ms */
200 atomic_t count_pending;
201 struct delayed_work dw;
202 } notify_peers;
203 struct {
204 unsigned int count;
205 unsigned int interval; /* in ms */
206 atomic_t count_pending;
207 struct delayed_work dw;
208 } mcast_rejoin;
197 long mode_priv[TEAM_MODE_PRIV_LONGS]; 209 long mode_priv[TEAM_MODE_PRIV_LONGS];
198}; 210};
199 211
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index e3362b5f13e8..f47550d75f85 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -129,6 +129,5 @@ extern void ip_mc_unmap(struct in_device *);
129extern void ip_mc_remap(struct in_device *); 129extern void ip_mc_remap(struct in_device *);
130extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); 130extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr);
131extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); 131extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
132extern void ip_mc_rejoin_groups(struct in_device *in_dev);
133 132
134#endif 133#endif
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
index 72b26940730d..e51f65480ea5 100644
--- a/include/linux/iio/common/st_sensors.h
+++ b/include/linux/iio/common/st_sensors.h
@@ -17,6 +17,8 @@
17#include <linux/iio/trigger.h> 17#include <linux/iio/trigger.h>
18#include <linux/bitops.h> 18#include <linux/bitops.h>
19 19
20#include <linux/platform_data/st_sensors_pdata.h>
21
20#define ST_SENSORS_TX_MAX_LENGTH 2 22#define ST_SENSORS_TX_MAX_LENGTH 2
21#define ST_SENSORS_RX_MAX_LENGTH 6 23#define ST_SENSORS_RX_MAX_LENGTH 6
22 24
@@ -118,14 +120,16 @@ struct st_sensor_bdu {
118/** 120/**
119 * struct st_sensor_data_ready_irq - ST sensor device data-ready interrupt 121 * struct st_sensor_data_ready_irq - ST sensor device data-ready interrupt
120 * @addr: address of the register. 122 * @addr: address of the register.
121 * @mask: mask to write the on/off value. 123 * @mask_int1: mask to enable/disable IRQ on INT1 pin.
124 * @mask_int2: mask to enable/disable IRQ on INT2 pin.
122 * struct ig1 - represents the Interrupt Generator 1 of sensors. 125 * struct ig1 - represents the Interrupt Generator 1 of sensors.
123 * @en_addr: address of the enable ig1 register. 126 * @en_addr: address of the enable ig1 register.
124 * @en_mask: mask to write the on/off value for enable. 127 * @en_mask: mask to write the on/off value for enable.
125 */ 128 */
126struct st_sensor_data_ready_irq { 129struct st_sensor_data_ready_irq {
127 u8 addr; 130 u8 addr;
128 u8 mask; 131 u8 mask_int1;
132 u8 mask_int2;
129 struct { 133 struct {
130 u8 en_addr; 134 u8 en_addr;
131 u8 en_mask; 135 u8 en_mask;
@@ -201,6 +205,7 @@ struct st_sensors {
201 * @buffer_data: Data used by buffer part. 205 * @buffer_data: Data used by buffer part.
202 * @odr: Output data rate of the sensor [Hz]. 206 * @odr: Output data rate of the sensor [Hz].
203 * num_data_channels: Number of data channels used in buffer. 207 * num_data_channels: Number of data channels used in buffer.
208 * @drdy_int_pin: Redirect DRDY on pin 1 (1) or pin 2 (2).
204 * @get_irq_data_ready: Function to get the IRQ used for data ready signal. 209 * @get_irq_data_ready: Function to get the IRQ used for data ready signal.
205 * @tf: Transfer function structure used by I/O operations. 210 * @tf: Transfer function structure used by I/O operations.
206 * @tb: Transfer buffers and mutex used by I/O operations. 211 * @tb: Transfer buffers and mutex used by I/O operations.
@@ -219,6 +224,8 @@ struct st_sensor_data {
219 unsigned int odr; 224 unsigned int odr;
220 unsigned int num_data_channels; 225 unsigned int num_data_channels;
221 226
227 u8 drdy_int_pin;
228
222 unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev); 229 unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev);
223 230
224 const struct st_sensor_transfer_function *tf; 231 const struct st_sensor_transfer_function *tf;
@@ -249,7 +256,8 @@ static inline void st_sensors_deallocate_trigger(struct iio_dev *indio_dev)
249} 256}
250#endif 257#endif
251 258
252int st_sensors_init_sensor(struct iio_dev *indio_dev); 259int st_sensors_init_sensor(struct iio_dev *indio_dev,
260 struct st_sensors_platform_data *pdata);
253 261
254int st_sensors_set_enable(struct iio_dev *indio_dev, bool enable); 262int st_sensors_set_enable(struct iio_dev *indio_dev, bool enable);
255 263
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 3d35b7023591..2103cc32a5fb 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -532,6 +532,60 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv)
532void iio_device_free(struct iio_dev *indio_dev); 532void iio_device_free(struct iio_dev *indio_dev);
533 533
534/** 534/**
535 * devm_iio_device_alloc - Resource-managed iio_device_alloc()
536 * @dev: Device to allocate iio_dev for
537 * @sizeof_priv: Space to allocate for private structure.
538 *
539 * Managed iio_device_alloc. iio_dev allocated with this function is
540 * automatically freed on driver detach.
541 *
542 * If an iio_dev allocated with this function needs to be freed separately,
543 * devm_iio_device_free() must be used.
544 *
545 * RETURNS:
546 * Pointer to allocated iio_dev on success, NULL on failure.
547 */
548struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv);
549
550/**
551 * devm_iio_device_free - Resource-managed iio_device_free()
552 * @dev: Device this iio_dev belongs to
553 * @indio_dev: the iio_dev associated with the device
554 *
555 * Free iio_dev allocated with devm_iio_device_alloc().
556 */
557void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev);
558
559/**
560 * devm_iio_trigger_alloc - Resource-managed iio_trigger_alloc()
561 * @dev: Device to allocate iio_trigger for
562 * @fmt: trigger name format. If it includes format
563 * specifiers, the additional arguments following
564 * format are formatted and inserted in the resulting
565 * string replacing their respective specifiers.
566 *
567 * Managed iio_trigger_alloc. iio_trigger allocated with this function is
568 * automatically freed on driver detach.
569 *
570 * If an iio_trigger allocated with this function needs to be freed separately,
571 * devm_iio_trigger_free() must be used.
572 *
573 * RETURNS:
574 * Pointer to allocated iio_trigger on success, NULL on failure.
575 */
576struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
577 const char *fmt, ...);
578
579/**
580 * devm_iio_trigger_free - Resource-managed iio_trigger_free()
581 * @dev: Device this iio_dev belongs to
582 * @iio_trig: the iio_trigger associated with the device
583 *
584 * Free iio_trigger allocated with devm_iio_trigger_alloc().
585 */
586void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);
587
588/**
535 * iio_buffer_enabled() - helper function to test if the buffer is enabled 589 * iio_buffer_enabled() - helper function to test if the buffer is enabled
536 * @indio_dev: IIO device structure for device 590 * @indio_dev: IIO device structure for device
537 **/ 591 **/
diff --git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h
index b7a934b9431b..2958c960003a 100644
--- a/include/linux/iio/sysfs.h
+++ b/include/linux/iio/sysfs.h
@@ -73,11 +73,6 @@ struct iio_const_attr {
73 .dev_attr = __ATTR(_name, S_IRUGO, iio_read_const_attr, NULL)} 73 .dev_attr = __ATTR(_name, S_IRUGO, iio_read_const_attr, NULL)}
74 74
75/* Generic attributes of onetype or another */ 75/* Generic attributes of onetype or another */
76/**
77 * IIO_DEV_ATTR_RESET: resets the device
78 **/
79#define IIO_DEV_ATTR_RESET(_store) \
80 IIO_DEVICE_ATTR(reset, S_IWUSR, NULL, _store, 0)
81 76
82/** 77/**
83 * IIO_DEV_ATTR_SAMP_FREQ - sets any internal clock frequency 78 * IIO_DEV_ATTR_SAMP_FREQ - sets any internal clock frequency
diff --git a/include/linux/init.h b/include/linux/init.h
index e73f2b708525..f1c27a71d03c 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -153,6 +153,7 @@ extern unsigned int reset_devices;
153void setup_arch(char **); 153void setup_arch(char **);
154void prepare_namespace(void); 154void prepare_namespace(void);
155void __init load_default_modules(void); 155void __init load_default_modules(void);
156int __init init_rootfs(void);
156 157
157extern void (*late_time_init)(void); 158extern void (*late_time_init)(void);
158 159
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index 78e2ada50cd5..d380c5e68008 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -55,7 +55,7 @@
55#define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */ 55#define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */
56#define DMAR_IQ_SHIFT 4 /* Invalidation queue head/tail shift */ 56#define DMAR_IQ_SHIFT 4 /* Invalidation queue head/tail shift */
57#define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */ 57#define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */
58#define DMAR_ICS_REG 0x98 /* Invalidation complete status register */ 58#define DMAR_ICS_REG 0x9c /* Invalidation complete status register */
59#define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */ 59#define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */
60 60
61#define OFFSET_STRIDE (9) 61#define OFFSET_STRIDE (9)
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 5fa5afeeb759..5e865b554940 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -120,7 +120,6 @@ struct irqaction {
120 120
121extern irqreturn_t no_action(int cpl, void *dev_id); 121extern irqreturn_t no_action(int cpl, void *dev_id);
122 122
123#ifdef CONFIG_GENERIC_HARDIRQS
124extern int __must_check 123extern int __must_check
125request_threaded_irq(unsigned int irq, irq_handler_t handler, 124request_threaded_irq(unsigned int irq, irq_handler_t handler,
126 irq_handler_t thread_fn, 125 irq_handler_t thread_fn,
@@ -140,40 +139,6 @@ request_any_context_irq(unsigned int irq, irq_handler_t handler,
140extern int __must_check 139extern int __must_check
141request_percpu_irq(unsigned int irq, irq_handler_t handler, 140request_percpu_irq(unsigned int irq, irq_handler_t handler,
142 const char *devname, void __percpu *percpu_dev_id); 141 const char *devname, void __percpu *percpu_dev_id);
143#else
144
145extern int __must_check
146request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
147 const char *name, void *dev);
148
149/*
150 * Special function to avoid ifdeffery in kernel/irq/devres.c which
151 * gets magically built by GENERIC_HARDIRQS=n architectures (sparc,
152 * m68k). I really love these $@%#!* obvious Makefile references:
153 * ../../../kernel/irq/devres.o
154 */
155static inline int __must_check
156request_threaded_irq(unsigned int irq, irq_handler_t handler,
157 irq_handler_t thread_fn,
158 unsigned long flags, const char *name, void *dev)
159{
160 return request_irq(irq, handler, flags, name, dev);
161}
162
163static inline int __must_check
164request_any_context_irq(unsigned int irq, irq_handler_t handler,
165 unsigned long flags, const char *name, void *dev_id)
166{
167 return request_irq(irq, handler, flags, name, dev_id);
168}
169
170static inline int __must_check
171request_percpu_irq(unsigned int irq, irq_handler_t handler,
172 const char *devname, void __percpu *percpu_dev_id)
173{
174 return request_irq(irq, handler, 0, devname, percpu_dev_id);
175}
176#endif
177 142
178extern void free_irq(unsigned int, void *); 143extern void free_irq(unsigned int, void *);
179extern void free_percpu_irq(unsigned int, void __percpu *); 144extern void free_percpu_irq(unsigned int, void __percpu *);
@@ -221,7 +186,6 @@ extern void enable_irq(unsigned int irq);
221extern void enable_percpu_irq(unsigned int irq, unsigned int type); 186extern void enable_percpu_irq(unsigned int irq, unsigned int type);
222 187
223/* The following three functions are for the core kernel use only. */ 188/* The following three functions are for the core kernel use only. */
224#ifdef CONFIG_GENERIC_HARDIRQS
225extern void suspend_device_irqs(void); 189extern void suspend_device_irqs(void);
226extern void resume_device_irqs(void); 190extern void resume_device_irqs(void);
227#ifdef CONFIG_PM_SLEEP 191#ifdef CONFIG_PM_SLEEP
@@ -229,13 +193,8 @@ extern int check_wakeup_irqs(void);
229#else 193#else
230static inline int check_wakeup_irqs(void) { return 0; } 194static inline int check_wakeup_irqs(void) { return 0; }
231#endif 195#endif
232#else
233static inline void suspend_device_irqs(void) { };
234static inline void resume_device_irqs(void) { };
235static inline int check_wakeup_irqs(void) { return 0; }
236#endif
237 196
238#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS) 197#if defined(CONFIG_SMP)
239 198
240extern cpumask_var_t irq_default_affinity; 199extern cpumask_var_t irq_default_affinity;
241 200
@@ -287,9 +246,8 @@ static inline int irq_set_affinity_hint(unsigned int irq,
287{ 246{
288 return -EINVAL; 247 return -EINVAL;
289} 248}
290#endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */ 249#endif /* CONFIG_SMP */
291 250
292#ifdef CONFIG_GENERIC_HARDIRQS
293/* 251/*
294 * Special lockdep variants of irq disabling/enabling. 252 * Special lockdep variants of irq disabling/enabling.
295 * These should be used for locking constructs that 253 * These should be used for locking constructs that
@@ -354,33 +312,6 @@ static inline int disable_irq_wake(unsigned int irq)
354 return irq_set_irq_wake(irq, 0); 312 return irq_set_irq_wake(irq, 0);
355} 313}
356 314
357#else /* !CONFIG_GENERIC_HARDIRQS */
358/*
359 * NOTE: non-genirq architectures, if they want to support the lock
360 * validator need to define the methods below in their asm/irq.h
361 * files, under an #ifdef CONFIG_LOCKDEP section.
362 */
363#ifndef CONFIG_LOCKDEP
364# define disable_irq_nosync_lockdep(irq) disable_irq_nosync(irq)
365# define disable_irq_nosync_lockdep_irqsave(irq, flags) \
366 disable_irq_nosync(irq)
367# define disable_irq_lockdep(irq) disable_irq(irq)
368# define enable_irq_lockdep(irq) enable_irq(irq)
369# define enable_irq_lockdep_irqrestore(irq, flags) \
370 enable_irq(irq)
371# endif
372
373static inline int enable_irq_wake(unsigned int irq)
374{
375 return 0;
376}
377
378static inline int disable_irq_wake(unsigned int irq)
379{
380 return 0;
381}
382#endif /* CONFIG_GENERIC_HARDIRQS */
383
384 315
385#ifdef CONFIG_IRQ_FORCED_THREADING 316#ifdef CONFIG_IRQ_FORCED_THREADING
386extern bool force_irqthreads; 317extern bool force_irqthreads;
@@ -655,7 +586,7 @@ void tasklet_hrtimer_cancel(struct tasklet_hrtimer *ttimer)
655 * if more than one irq occurred. 586 * if more than one irq occurred.
656 */ 587 */
657 588
658#if defined(CONFIG_GENERIC_HARDIRQS) && !defined(CONFIG_GENERIC_IRQ_PROBE) 589#if !defined(CONFIG_GENERIC_IRQ_PROBE)
659static inline unsigned long probe_irq_on(void) 590static inline unsigned long probe_irq_on(void)
660{ 591{
661 return 0; 592 return 0;
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 3aeb7305e2f5..7ea319e95b47 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -58,10 +58,26 @@ struct iommu_domain {
58#define IOMMU_CAP_CACHE_COHERENCY 0x1 58#define IOMMU_CAP_CACHE_COHERENCY 0x1
59#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ 59#define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */
60 60
61/*
62 * Following constraints are specifc to FSL_PAMUV1:
63 * -aperture must be power of 2, and naturally aligned
64 * -number of windows must be power of 2, and address space size
65 * of each window is determined by aperture size / # of windows
66 * -the actual size of the mapped region of a window must be power
67 * of 2 starting with 4KB and physical address must be naturally
68 * aligned.
69 * DOMAIN_ATTR_FSL_PAMUV1 corresponds to the above mentioned contraints.
70 * The caller can invoke iommu_domain_get_attr to check if the underlying
71 * iommu implementation supports these constraints.
72 */
73
61enum iommu_attr { 74enum iommu_attr {
62 DOMAIN_ATTR_GEOMETRY, 75 DOMAIN_ATTR_GEOMETRY,
63 DOMAIN_ATTR_PAGING, 76 DOMAIN_ATTR_PAGING,
64 DOMAIN_ATTR_WINDOWS, 77 DOMAIN_ATTR_WINDOWS,
78 DOMAIN_ATTR_FSL_PAMU_STASH,
79 DOMAIN_ATTR_FSL_PAMU_ENABLE,
80 DOMAIN_ATTR_FSL_PAMUV1,
65 DOMAIN_ATTR_MAX, 81 DOMAIN_ATTR_MAX,
66}; 82};
67 83
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
index c4d870b0d5e6..f6c82de12541 100644
--- a/include/linux/ipc_namespace.h
+++ b/include/linux/ipc_namespace.h
@@ -22,7 +22,7 @@ struct ipc_ids {
22 int in_use; 22 int in_use;
23 unsigned short seq; 23 unsigned short seq;
24 unsigned short seq_max; 24 unsigned short seq_max;
25 struct rw_semaphore rw_mutex; 25 struct rw_semaphore rwsem;
26 struct idr ipcs_idr; 26 struct idr ipcs_idr;
27 int next_id; 27 int next_id;
28}; 28};
@@ -34,9 +34,9 @@ struct ipc_namespace {
34 int sem_ctls[4]; 34 int sem_ctls[4];
35 int used_sems; 35 int used_sems;
36 36
37 int msg_ctlmax; 37 unsigned int msg_ctlmax;
38 int msg_ctlmnb; 38 unsigned int msg_ctlmnb;
39 int msg_ctlmni; 39 unsigned int msg_ctlmni;
40 atomic_t msg_bytes; 40 atomic_t msg_bytes;
41 atomic_t msg_hdrs; 41 atomic_t msg_hdrs;
42 int auto_msgmni; 42 int auto_msgmni;
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index b8b7dc755752..28ea38439313 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -19,6 +19,8 @@ struct ipv6_devconf {
19 __s32 rtr_solicit_interval; 19 __s32 rtr_solicit_interval;
20 __s32 rtr_solicit_delay; 20 __s32 rtr_solicit_delay;
21 __s32 force_mld_version; 21 __s32 force_mld_version;
22 __s32 mldv1_unsolicited_report_interval;
23 __s32 mldv2_unsolicited_report_interval;
22#ifdef CONFIG_IPV6_PRIVACY 24#ifdef CONFIG_IPV6_PRIVACY
23 __s32 use_tempaddr; 25 __s32 use_tempaddr;
24 __s32 temp_valid_lft; 26 __s32 temp_valid_lft;
@@ -48,6 +50,7 @@ struct ipv6_devconf {
48 __s32 accept_dad; 50 __s32 accept_dad;
49 __s32 force_tllao; 51 __s32 force_tllao;
50 __s32 ndisc_notify; 52 __s32 ndisc_notify;
53 __s32 suppress_frag_ndisc;
51 void *sysctl; 54 void *sysctl;
52}; 55};
53 56
diff --git a/include/linux/irq.h b/include/linux/irq.h
index f04d3ba335cb..56bb0dc8b7d4 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -382,8 +382,6 @@ extern void irq_cpu_online(void);
382extern void irq_cpu_offline(void); 382extern void irq_cpu_offline(void);
383extern int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *cpumask); 383extern int __irq_set_affinity_locked(struct irq_data *data, const struct cpumask *cpumask);
384 384
385#ifdef CONFIG_GENERIC_HARDIRQS
386
387#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ) 385#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ)
388void irq_move_irq(struct irq_data *data); 386void irq_move_irq(struct irq_data *data);
389void irq_move_masked_irq(struct irq_data *data); 387void irq_move_masked_irq(struct irq_data *data);
@@ -802,11 +800,4 @@ static inline void irq_gc_lock(struct irq_chip_generic *gc) { }
802static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } 800static inline void irq_gc_unlock(struct irq_chip_generic *gc) { }
803#endif 801#endif
804 802
805#else /* !CONFIG_GENERIC_HARDIRQS */
806
807extern struct msi_desc *irq_get_msi_desc(unsigned int irq);
808extern int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry);
809
810#endif /* CONFIG_GENERIC_HARDIRQS */
811
812#endif /* _LINUX_IRQ_H */ 803#endif /* _LINUX_IRQ_H */
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
index 3e203eb23cc7..0e5d9ecdb2b6 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -66,6 +66,7 @@ extern struct irq_chip gic_arch_extn;
66void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *, 66void gic_init_bases(unsigned int, int, void __iomem *, void __iomem *,
67 u32 offset, struct device_node *); 67 u32 offset, struct device_node *);
68void gic_cascade_irq(unsigned int gic_nr, unsigned int irq); 68void gic_cascade_irq(unsigned int gic_nr, unsigned int irq);
69void gic_cpu_if_down(void);
69 70
70static inline void gic_init(unsigned int nr, int start, 71static inline void gic_init(unsigned int nr, int start,
71 void __iomem *dist , void __iomem *cpu) 72 void __iomem *dist , void __iomem *cpu)
diff --git a/include/linux/irqchip/mmp.h b/include/linux/irqchip/mmp.h
new file mode 100644
index 000000000000..c78a8921185d
--- /dev/null
+++ b/include/linux/irqchip/mmp.h
@@ -0,0 +1,6 @@
1#ifndef __IRQCHIP_MMP_H
2#define __IRQCHIP_MMP_H
3
4extern struct irq_chip icu_irq_chip;
5
6#endif /* __IRQCHIP_MMP_H */
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 623325e2ff97..56fb646909dc 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -76,8 +76,6 @@ struct irq_desc {
76extern struct irq_desc irq_desc[NR_IRQS]; 76extern struct irq_desc irq_desc[NR_IRQS];
77#endif 77#endif
78 78
79#ifdef CONFIG_GENERIC_HARDIRQS
80
81static inline struct irq_data *irq_desc_get_irq_data(struct irq_desc *desc) 79static inline struct irq_data *irq_desc_get_irq_data(struct irq_desc *desc)
82{ 80{
83 return &desc->irq_data; 81 return &desc->irq_data;
@@ -173,6 +171,5 @@ __irq_set_preflow_handler(unsigned int irq, irq_preflow_handler_t handler)
173 desc->preflow_handler = handler; 171 desc->preflow_handler = handler;
174} 172}
175#endif 173#endif
176#endif
177 174
178#endif 175#endif
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h
index 0a2dc46cdaf6..fdd5cc16c9c4 100644
--- a/include/linux/irqnr.h
+++ b/include/linux/irqnr.h
@@ -4,23 +4,6 @@
4#include <uapi/linux/irqnr.h> 4#include <uapi/linux/irqnr.h>
5 5
6 6
7#ifndef CONFIG_GENERIC_HARDIRQS
8#include <asm/irq.h>
9
10/*
11 * Wrappers for non-genirq architectures:
12 */
13#define nr_irqs NR_IRQS
14#define irq_to_desc(irq) (&irq_desc[irq])
15
16# define for_each_irq_desc(irq, desc) \
17 for (irq = 0; irq < nr_irqs; irq++)
18
19# define for_each_irq_desc_reverse(irq, desc) \
20 for (irq = nr_irqs - 1; irq >= 0; irq--)
21
22#else /* CONFIG_GENERIC_HARDIRQS */
23
24extern int nr_irqs; 7extern int nr_irqs;
25extern struct irq_desc *irq_to_desc(unsigned int irq); 8extern struct irq_desc *irq_to_desc(unsigned int irq);
26unsigned int irq_get_next_irq(unsigned int offset); 9unsigned int irq_get_next_irq(unsigned int offset);
@@ -50,8 +33,6 @@ unsigned int irq_get_next_irq(unsigned int offset);
50 for (irq = irq_get_next_irq(0); irq < nr_irqs; \ 33 for (irq = irq_get_next_irq(0); irq < nr_irqs; \
51 irq = irq_get_next_irq(irq + 1)) 34 irq = irq_get_next_irq(irq + 1))
52 35
53#endif /* CONFIG_GENERIC_HARDIRQS */
54
55#define for_each_irq_nr(irq) \ 36#define for_each_irq_nr(irq) \
56 for (irq = 0; irq < nr_irqs; irq++) 37 for (irq = 0; irq < nr_irqs; irq++)
57 38
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 8685d1be12c7..31229e0be90b 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -57,16 +57,13 @@
57#define JBD_EXPENSIVE_CHECKING 57#define JBD_EXPENSIVE_CHECKING
58extern u8 journal_enable_debug; 58extern u8 journal_enable_debug;
59 59
60#define jbd_debug(n, f, a...) \ 60void __jbd_debug(int level, const char *file, const char *func,
61 do { \ 61 unsigned int line, const char *fmt, ...);
62 if ((n) <= journal_enable_debug) { \ 62
63 printk (KERN_DEBUG "(%s, %d): %s: ", \ 63#define jbd_debug(n, fmt, a...) \
64 __FILE__, __LINE__, __func__); \ 64 __jbd_debug((n), __FILE__, __func__, __LINE__, (fmt), ##a)
65 printk (f, ## a); \
66 } \
67 } while (0)
68#else 65#else
69#define jbd_debug(f, a...) /**/ 66#define jbd_debug(n, fmt, a...) /**/
70#endif 67#endif
71 68
72static inline void *jbd_alloc(size_t size, gfp_t flags) 69static inline void *jbd_alloc(size_t size, gfp_t flags)
@@ -77,7 +74,7 @@ static inline void *jbd_alloc(size_t size, gfp_t flags)
77static inline void jbd_free(void *ptr, size_t size) 74static inline void jbd_free(void *ptr, size_t size)
78{ 75{
79 free_pages((unsigned long)ptr, get_order(size)); 76 free_pages((unsigned long)ptr, get_order(size));
80}; 77}
81 78
82#define JFS_MIN_JOURNAL_BLOCKS 1024 79#define JFS_MIN_JOURNAL_BLOCKS 1024
83 80
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 97ba4e78a37e..d235e88cfd7c 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -101,13 +101,13 @@ static inline u64 get_jiffies_64(void)
101#define time_after(a,b) \ 101#define time_after(a,b) \
102 (typecheck(unsigned long, a) && \ 102 (typecheck(unsigned long, a) && \
103 typecheck(unsigned long, b) && \ 103 typecheck(unsigned long, b) && \
104 ((long)(b) - (long)(a) < 0)) 104 ((long)((b) - (a)) < 0))
105#define time_before(a,b) time_after(b,a) 105#define time_before(a,b) time_after(b,a)
106 106
107#define time_after_eq(a,b) \ 107#define time_after_eq(a,b) \
108 (typecheck(unsigned long, a) && \ 108 (typecheck(unsigned long, a) && \
109 typecheck(unsigned long, b) && \ 109 typecheck(unsigned long, b) && \
110 ((long)(a) - (long)(b) >= 0)) 110 ((long)((a) - (b)) >= 0))
111#define time_before_eq(a,b) time_after_eq(b,a) 111#define time_before_eq(a,b) time_after_eq(b,a)
112 112
113/* 113/*
@@ -130,13 +130,13 @@ static inline u64 get_jiffies_64(void)
130#define time_after64(a,b) \ 130#define time_after64(a,b) \
131 (typecheck(__u64, a) && \ 131 (typecheck(__u64, a) && \
132 typecheck(__u64, b) && \ 132 typecheck(__u64, b) && \
133 ((__s64)(b) - (__s64)(a) < 0)) 133 ((__s64)((b) - (a)) < 0))
134#define time_before64(a,b) time_after64(b,a) 134#define time_before64(a,b) time_after64(b,a)
135 135
136#define time_after_eq64(a,b) \ 136#define time_after_eq64(a,b) \
137 (typecheck(__u64, a) && \ 137 (typecheck(__u64, a) && \
138 typecheck(__u64, b) && \ 138 typecheck(__u64, b) && \
139 ((__s64)(a) - (__s64)(b) >= 0)) 139 ((__s64)((a) - (b)) >= 0))
140#define time_before_eq64(a,b) time_after_eq64(b,a) 140#define time_before_eq64(a,b) time_after_eq64(b,a)
141 141
142#define time_in_range64(a, b, c) \ 142#define time_in_range64(a, b, c) \
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 0976fc46d1e0..a5079072da66 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -48,7 +48,6 @@
48 48
49#include <linux/types.h> 49#include <linux/types.h>
50#include <linux/compiler.h> 50#include <linux/compiler.h>
51#include <linux/workqueue.h>
52 51
53#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) 52#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
54 53
@@ -61,12 +60,6 @@ struct static_key {
61#endif 60#endif
62}; 61};
63 62
64struct static_key_deferred {
65 struct static_key key;
66 unsigned long timeout;
67 struct delayed_work work;
68};
69
70# include <asm/jump_label.h> 63# include <asm/jump_label.h>
71# define HAVE_JUMP_LABEL 64# define HAVE_JUMP_LABEL
72#endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */ 65#endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */
@@ -78,6 +71,7 @@ enum jump_label_type {
78 71
79struct module; 72struct module;
80 73
74#include <linux/atomic.h>
81#ifdef HAVE_JUMP_LABEL 75#ifdef HAVE_JUMP_LABEL
82 76
83#define JUMP_LABEL_TRUE_BRANCH 1UL 77#define JUMP_LABEL_TRUE_BRANCH 1UL
@@ -119,10 +113,7 @@ extern void arch_jump_label_transform_static(struct jump_entry *entry,
119extern int jump_label_text_reserved(void *start, void *end); 113extern int jump_label_text_reserved(void *start, void *end);
120extern void static_key_slow_inc(struct static_key *key); 114extern void static_key_slow_inc(struct static_key *key);
121extern void static_key_slow_dec(struct static_key *key); 115extern void static_key_slow_dec(struct static_key *key);
122extern void static_key_slow_dec_deferred(struct static_key_deferred *key);
123extern void jump_label_apply_nops(struct module *mod); 116extern void jump_label_apply_nops(struct module *mod);
124extern void
125jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
126 117
127#define STATIC_KEY_INIT_TRUE ((struct static_key) \ 118#define STATIC_KEY_INIT_TRUE ((struct static_key) \
128 { .enabled = ATOMIC_INIT(1), .entries = (void *)1 }) 119 { .enabled = ATOMIC_INIT(1), .entries = (void *)1 })
@@ -131,8 +122,6 @@ jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
131 122
132#else /* !HAVE_JUMP_LABEL */ 123#else /* !HAVE_JUMP_LABEL */
133 124
134#include <linux/atomic.h>
135
136struct static_key { 125struct static_key {
137 atomic_t enabled; 126 atomic_t enabled;
138}; 127};
@@ -141,10 +130,6 @@ static __always_inline void jump_label_init(void)
141{ 130{
142} 131}
143 132
144struct static_key_deferred {
145 struct static_key key;
146};
147
148static __always_inline bool static_key_false(struct static_key *key) 133static __always_inline bool static_key_false(struct static_key *key)
149{ 134{
150 if (unlikely(atomic_read(&key->enabled)) > 0) 135 if (unlikely(atomic_read(&key->enabled)) > 0)
@@ -169,11 +154,6 @@ static inline void static_key_slow_dec(struct static_key *key)
169 atomic_dec(&key->enabled); 154 atomic_dec(&key->enabled);
170} 155}
171 156
172static inline void static_key_slow_dec_deferred(struct static_key_deferred *key)
173{
174 static_key_slow_dec(&key->key);
175}
176
177static inline int jump_label_text_reserved(void *start, void *end) 157static inline int jump_label_text_reserved(void *start, void *end)
178{ 158{
179 return 0; 159 return 0;
@@ -187,12 +167,6 @@ static inline int jump_label_apply_nops(struct module *mod)
187 return 0; 167 return 0;
188} 168}
189 169
190static inline void
191jump_label_rate_limit(struct static_key_deferred *key,
192 unsigned long rl)
193{
194}
195
196#define STATIC_KEY_INIT_TRUE ((struct static_key) \ 170#define STATIC_KEY_INIT_TRUE ((struct static_key) \
197 { .enabled = ATOMIC_INIT(1) }) 171 { .enabled = ATOMIC_INIT(1) })
198#define STATIC_KEY_INIT_FALSE ((struct static_key) \ 172#define STATIC_KEY_INIT_FALSE ((struct static_key) \
diff --git a/include/linux/jump_label_ratelimit.h b/include/linux/jump_label_ratelimit.h
new file mode 100644
index 000000000000..113788389b3d
--- /dev/null
+++ b/include/linux/jump_label_ratelimit.h
@@ -0,0 +1,34 @@
1#ifndef _LINUX_JUMP_LABEL_RATELIMIT_H
2#define _LINUX_JUMP_LABEL_RATELIMIT_H
3
4#include <linux/jump_label.h>
5#include <linux/workqueue.h>
6
7#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
8struct static_key_deferred {
9 struct static_key key;
10 unsigned long timeout;
11 struct delayed_work work;
12};
13#endif
14
15#ifdef HAVE_JUMP_LABEL
16extern void static_key_slow_dec_deferred(struct static_key_deferred *key);
17extern void
18jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
19
20#else /* !HAVE_JUMP_LABEL */
21struct static_key_deferred {
22 struct static_key key;
23};
24static inline void static_key_slow_dec_deferred(struct static_key_deferred *key)
25{
26 static_key_slow_dec(&key->key);
27}
28static inline void
29jump_label_rate_limit(struct static_key_deferred *key,
30 unsigned long rl)
31{
32}
33#endif /* HAVE_JUMP_LABEL */
34#endif /* _LINUX_JUMP_LABEL_RATELIMIT_H */
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index b7c8cdc1d422..cbfb171bbcba 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -36,10 +36,9 @@ struct kbd_struct {
36#define VC_CTRLRLOCK KG_CTRLR /* ctrlr lock mode */ 36#define VC_CTRLRLOCK KG_CTRLR /* ctrlr lock mode */
37 unsigned char slockstate; /* for `sticky' Shift, Ctrl, etc. */ 37 unsigned char slockstate; /* for `sticky' Shift, Ctrl, etc. */
38 38
39 unsigned char ledmode:2; /* one 2-bit value */ 39 unsigned char ledmode:1;
40#define LED_SHOW_FLAGS 0 /* traditional state */ 40#define LED_SHOW_FLAGS 0 /* traditional state */
41#define LED_SHOW_IOCTL 1 /* only change leds upon ioctl */ 41#define LED_SHOW_IOCTL 1 /* only change leds upon ioctl */
42#define LED_SHOW_MEM 2 /* `heartbeat': peek into memory */
43 42
44 unsigned char ledflagstate:4; /* flags, not lights */ 43 unsigned char ledflagstate:4; /* flags, not lights */
45 unsigned char default_ledflagstate:4; 44 unsigned char default_ledflagstate:4;
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 482ad2d84a32..672ddc4de4af 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -439,6 +439,17 @@ static inline char *hex_byte_pack(char *buf, u8 byte)
439 return buf; 439 return buf;
440} 440}
441 441
442extern const char hex_asc_upper[];
443#define hex_asc_upper_lo(x) hex_asc_upper[((x) & 0x0f)]
444#define hex_asc_upper_hi(x) hex_asc_upper[((x) & 0xf0) >> 4]
445
446static inline char *hex_byte_pack_upper(char *buf, u8 byte)
447{
448 *buf++ = hex_asc_upper_hi(byte);
449 *buf++ = hex_asc_upper_lo(byte);
450 return buf;
451}
452
442static inline char * __deprecated pack_hex_byte(char *buf, u8 byte) 453static inline char * __deprecated pack_hex_byte(char *buf, u8 byte)
443{ 454{
444 return hex_byte_pack(buf, byte); 455 return hex_byte_pack(buf, byte);
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index ed5f6ed6eb77..51c72be4a7c3 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -36,9 +36,6 @@ struct kernel_cpustat {
36}; 36};
37 37
38struct kernel_stat { 38struct kernel_stat {
39#ifndef CONFIG_GENERIC_HARDIRQS
40 unsigned int irqs[NR_IRQS];
41#endif
42 unsigned long irqs_sum; 39 unsigned long irqs_sum;
43 unsigned int softirqs[NR_SOFTIRQS]; 40 unsigned int softirqs[NR_SOFTIRQS];
44}; 41};
@@ -54,22 +51,6 @@ DECLARE_PER_CPU(struct kernel_cpustat, kernel_cpustat);
54 51
55extern unsigned long long nr_context_switches(void); 52extern unsigned long long nr_context_switches(void);
56 53
57#ifndef CONFIG_GENERIC_HARDIRQS
58
59struct irq_desc;
60
61static inline void kstat_incr_irqs_this_cpu(unsigned int irq,
62 struct irq_desc *desc)
63{
64 __this_cpu_inc(kstat.irqs[irq]);
65 __this_cpu_inc(kstat.irqs_sum);
66}
67
68static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu)
69{
70 return kstat_cpu(cpu).irqs[irq];
71}
72#else
73#include <linux/irq.h> 54#include <linux/irq.h>
74extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); 55extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu);
75 56
@@ -79,8 +60,6 @@ do { \
79 __this_cpu_inc(kstat.irqs_sum); \ 60 __this_cpu_inc(kstat.irqs_sum); \
80} while (0) 61} while (0)
81 62
82#endif
83
84static inline void kstat_incr_softirqs_this_cpu(unsigned int irq) 63static inline void kstat_incr_softirqs_this_cpu(unsigned int irq)
85{ 64{
86 __this_cpu_inc(kstat.softirqs[irq]); 65 __this_cpu_inc(kstat.softirqs[irq]);
@@ -94,20 +73,7 @@ static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu)
94/* 73/*
95 * Number of interrupts per specific IRQ source, since bootup 74 * Number of interrupts per specific IRQ source, since bootup
96 */ 75 */
97#ifndef CONFIG_GENERIC_HARDIRQS
98static inline unsigned int kstat_irqs(unsigned int irq)
99{
100 unsigned int sum = 0;
101 int cpu;
102
103 for_each_possible_cpu(cpu)
104 sum += kstat_irqs_cpu(irq, cpu);
105
106 return sum;
107}
108#else
109extern unsigned int kstat_irqs(unsigned int irq); 76extern unsigned int kstat_irqs(unsigned int irq);
110#endif
111 77
112/* 78/*
113 * Number of interrupts per cpu, since bootup 79 * Number of interrupts per cpu, since bootup
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 939b11268c86..de6dcbcc6ef7 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -26,6 +26,7 @@
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/wait.h> 27#include <linux/wait.h>
28#include <linux/atomic.h> 28#include <linux/atomic.h>
29#include <linux/workqueue.h>
29 30
30#define UEVENT_HELPER_PATH_LEN 256 31#define UEVENT_HELPER_PATH_LEN 256
31#define UEVENT_NUM_ENVP 32 /* number of env pointers */ 32#define UEVENT_NUM_ENVP 32 /* number of env pointers */
@@ -65,6 +66,9 @@ struct kobject {
65 struct kobj_type *ktype; 66 struct kobj_type *ktype;
66 struct sysfs_dirent *sd; 67 struct sysfs_dirent *sd;
67 struct kref kref; 68 struct kref kref;
69#ifdef CONFIG_DEBUG_KOBJECT_RELEASE
70 struct delayed_work release;
71#endif
68 unsigned int state_initialized:1; 72 unsigned int state_initialized:1;
69 unsigned int state_in_sysfs:1; 73 unsigned int state_in_sysfs:1;
70 unsigned int state_add_uevent_sent:1; 74 unsigned int state_add_uevent_sent:1;
diff --git a/include/linux/kobject_ns.h b/include/linux/kobject_ns.h
index f66b065a8b5f..df32d2508290 100644
--- a/include/linux/kobject_ns.h
+++ b/include/linux/kobject_ns.h
@@ -39,6 +39,7 @@ enum kobj_ns_type {
39 */ 39 */
40struct kobj_ns_type_operations { 40struct kobj_ns_type_operations {
41 enum kobj_ns_type type; 41 enum kobj_ns_type type;
42 bool (*current_may_mount)(void);
42 void *(*grab_current_ns)(void); 43 void *(*grab_current_ns)(void);
43 const void *(*netlink_ns)(struct sock *sk); 44 const void *(*netlink_ns)(struct sock *sk);
44 const void *(*initial_ns)(void); 45 const void *(*initial_ns)(void);
@@ -50,6 +51,7 @@ int kobj_ns_type_registered(enum kobj_ns_type type);
50const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent); 51const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent);
51const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj); 52const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj);
52 53
54bool kobj_ns_current_may_mount(enum kobj_ns_type type);
53void *kobj_ns_grab_current(enum kobj_ns_type type); 55void *kobj_ns_grab_current(enum kobj_ns_type type);
54const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk); 56const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
55const void *kobj_ns_initial(enum kobj_ns_type type); 57const void *kobj_ns_initial(enum kobj_ns_type type);
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index ca1d27a0d6a6..925eaf28fca9 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -264,10 +264,36 @@ extern void arch_arm_kprobe(struct kprobe *p);
264extern void arch_disarm_kprobe(struct kprobe *p); 264extern void arch_disarm_kprobe(struct kprobe *p);
265extern int arch_init_kprobes(void); 265extern int arch_init_kprobes(void);
266extern void show_registers(struct pt_regs *regs); 266extern void show_registers(struct pt_regs *regs);
267extern kprobe_opcode_t *get_insn_slot(void);
268extern void free_insn_slot(kprobe_opcode_t *slot, int dirty);
269extern void kprobes_inc_nmissed_count(struct kprobe *p); 267extern void kprobes_inc_nmissed_count(struct kprobe *p);
270 268
269struct kprobe_insn_cache {
270 struct mutex mutex;
271 void *(*alloc)(void); /* allocate insn page */
272 void (*free)(void *); /* free insn page */
273 struct list_head pages; /* list of kprobe_insn_page */
274 size_t insn_size; /* size of instruction slot */
275 int nr_garbage;
276};
277
278extern kprobe_opcode_t *__get_insn_slot(struct kprobe_insn_cache *c);
279extern void __free_insn_slot(struct kprobe_insn_cache *c,
280 kprobe_opcode_t *slot, int dirty);
281
282#define DEFINE_INSN_CACHE_OPS(__name) \
283extern struct kprobe_insn_cache kprobe_##__name##_slots; \
284 \
285static inline kprobe_opcode_t *get_##__name##_slot(void) \
286{ \
287 return __get_insn_slot(&kprobe_##__name##_slots); \
288} \
289 \
290static inline void free_##__name##_slot(kprobe_opcode_t *slot, int dirty)\
291{ \
292 __free_insn_slot(&kprobe_##__name##_slots, slot, dirty); \
293} \
294
295DEFINE_INSN_CACHE_OPS(insn);
296
271#ifdef CONFIG_OPTPROBES 297#ifdef CONFIG_OPTPROBES
272/* 298/*
273 * Internal structure for direct jump optimized probe 299 * Internal structure for direct jump optimized probe
@@ -287,13 +313,13 @@ extern void arch_optimize_kprobes(struct list_head *oplist);
287extern void arch_unoptimize_kprobes(struct list_head *oplist, 313extern void arch_unoptimize_kprobes(struct list_head *oplist,
288 struct list_head *done_list); 314 struct list_head *done_list);
289extern void arch_unoptimize_kprobe(struct optimized_kprobe *op); 315extern void arch_unoptimize_kprobe(struct optimized_kprobe *op);
290extern kprobe_opcode_t *get_optinsn_slot(void);
291extern void free_optinsn_slot(kprobe_opcode_t *slot, int dirty);
292extern int arch_within_optimized_kprobe(struct optimized_kprobe *op, 316extern int arch_within_optimized_kprobe(struct optimized_kprobe *op,
293 unsigned long addr); 317 unsigned long addr);
294 318
295extern void opt_pre_handler(struct kprobe *p, struct pt_regs *regs); 319extern void opt_pre_handler(struct kprobe *p, struct pt_regs *regs);
296 320
321DEFINE_INSN_CACHE_OPS(optinsn);
322
297#ifdef CONFIG_SYSCTL 323#ifdef CONFIG_SYSCTL
298extern int sysctl_kprobes_optimization; 324extern int sysctl_kprobes_optimization;
299extern int proc_kprobes_optimization_handler(struct ctl_table *table, 325extern int proc_kprobes_optimization_handler(struct ctl_table *table,
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index debf208b7611..31c0cd1c941a 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -69,7 +69,7 @@ typedef union ktime ktime_t; /* Kill this */
69 * @secs: seconds to set 69 * @secs: seconds to set
70 * @nsecs: nanoseconds to set 70 * @nsecs: nanoseconds to set
71 * 71 *
72 * Return the ktime_t representation of the value 72 * Return: The ktime_t representation of the value.
73 */ 73 */
74static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) 74static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
75{ 75{
@@ -151,7 +151,7 @@ static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
151 * @lhs: minuend 151 * @lhs: minuend
152 * @rhs: subtrahend 152 * @rhs: subtrahend
153 * 153 *
154 * Returns the remainder of the subtraction 154 * Return: The remainder of the subtraction.
155 */ 155 */
156static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs) 156static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs)
157{ 157{
@@ -169,7 +169,7 @@ static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs)
169 * @add1: addend1 169 * @add1: addend1
170 * @add2: addend2 170 * @add2: addend2
171 * 171 *
172 * Returns the sum of @add1 and @add2. 172 * Return: The sum of @add1 and @add2.
173 */ 173 */
174static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2) 174static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2)
175{ 175{
@@ -195,7 +195,7 @@ static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2)
195 * @kt: addend 195 * @kt: addend
196 * @nsec: the scalar nsec value to add 196 * @nsec: the scalar nsec value to add
197 * 197 *
198 * Returns the sum of @kt and @nsec in ktime_t format 198 * Return: The sum of @kt and @nsec in ktime_t format.
199 */ 199 */
200extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec); 200extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec);
201 201
@@ -204,7 +204,7 @@ extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec);
204 * @kt: minuend 204 * @kt: minuend
205 * @nsec: the scalar nsec value to subtract 205 * @nsec: the scalar nsec value to subtract
206 * 206 *
207 * Returns the subtraction of @nsec from @kt in ktime_t format 207 * Return: The subtraction of @nsec from @kt in ktime_t format.
208 */ 208 */
209extern ktime_t ktime_sub_ns(const ktime_t kt, u64 nsec); 209extern ktime_t ktime_sub_ns(const ktime_t kt, u64 nsec);
210 210
@@ -212,7 +212,7 @@ extern ktime_t ktime_sub_ns(const ktime_t kt, u64 nsec);
212 * timespec_to_ktime - convert a timespec to ktime_t format 212 * timespec_to_ktime - convert a timespec to ktime_t format
213 * @ts: the timespec variable to convert 213 * @ts: the timespec variable to convert
214 * 214 *
215 * Returns a ktime_t variable with the converted timespec value 215 * Return: A ktime_t variable with the converted timespec value.
216 */ 216 */
217static inline ktime_t timespec_to_ktime(const struct timespec ts) 217static inline ktime_t timespec_to_ktime(const struct timespec ts)
218{ 218{
@@ -224,7 +224,7 @@ static inline ktime_t timespec_to_ktime(const struct timespec ts)
224 * timeval_to_ktime - convert a timeval to ktime_t format 224 * timeval_to_ktime - convert a timeval to ktime_t format
225 * @tv: the timeval variable to convert 225 * @tv: the timeval variable to convert
226 * 226 *
227 * Returns a ktime_t variable with the converted timeval value 227 * Return: A ktime_t variable with the converted timeval value.
228 */ 228 */
229static inline ktime_t timeval_to_ktime(const struct timeval tv) 229static inline ktime_t timeval_to_ktime(const struct timeval tv)
230{ 230{
@@ -237,7 +237,7 @@ static inline ktime_t timeval_to_ktime(const struct timeval tv)
237 * ktime_to_timespec - convert a ktime_t variable to timespec format 237 * ktime_to_timespec - convert a ktime_t variable to timespec format
238 * @kt: the ktime_t variable to convert 238 * @kt: the ktime_t variable to convert
239 * 239 *
240 * Returns the timespec representation of the ktime value 240 * Return: The timespec representation of the ktime value.
241 */ 241 */
242static inline struct timespec ktime_to_timespec(const ktime_t kt) 242static inline struct timespec ktime_to_timespec(const ktime_t kt)
243{ 243{
@@ -249,7 +249,7 @@ static inline struct timespec ktime_to_timespec(const ktime_t kt)
249 * ktime_to_timeval - convert a ktime_t variable to timeval format 249 * ktime_to_timeval - convert a ktime_t variable to timeval format
250 * @kt: the ktime_t variable to convert 250 * @kt: the ktime_t variable to convert
251 * 251 *
252 * Returns the timeval representation of the ktime value 252 * Return: The timeval representation of the ktime value.
253 */ 253 */
254static inline struct timeval ktime_to_timeval(const ktime_t kt) 254static inline struct timeval ktime_to_timeval(const ktime_t kt)
255{ 255{
@@ -262,7 +262,7 @@ static inline struct timeval ktime_to_timeval(const ktime_t kt)
262 * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds 262 * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds
263 * @kt: the ktime_t variable to convert 263 * @kt: the ktime_t variable to convert
264 * 264 *
265 * Returns the scalar nanoseconds representation of @kt 265 * Return: The scalar nanoseconds representation of @kt.
266 */ 266 */
267static inline s64 ktime_to_ns(const ktime_t kt) 267static inline s64 ktime_to_ns(const ktime_t kt)
268{ 268{
@@ -276,7 +276,9 @@ static inline s64 ktime_to_ns(const ktime_t kt)
276 * @cmp1: comparable1 276 * @cmp1: comparable1
277 * @cmp2: comparable2 277 * @cmp2: comparable2
278 * 278 *
279 * Compare two ktime_t variables, returns 1 if equal 279 * Compare two ktime_t variables.
280 *
281 * Return: 1 if equal.
280 */ 282 */
281static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2) 283static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
282{ 284{
@@ -288,7 +290,7 @@ static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
288 * @cmp1: comparable1 290 * @cmp1: comparable1
289 * @cmp2: comparable2 291 * @cmp2: comparable2
290 * 292 *
291 * Returns ... 293 * Return: ...
292 * cmp1 < cmp2: return <0 294 * cmp1 < cmp2: return <0
293 * cmp1 == cmp2: return 0 295 * cmp1 == cmp2: return 0
294 * cmp1 > cmp2: return >0 296 * cmp1 > cmp2: return >0
@@ -342,7 +344,7 @@ extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
342 * @kt: the ktime_t variable to convert 344 * @kt: the ktime_t variable to convert
343 * @ts: the timespec variable to store the result in 345 * @ts: the timespec variable to store the result in
344 * 346 *
345 * Returns true if there was a successful conversion, false if kt was 0. 347 * Return: %true if there was a successful conversion, %false if kt was 0.
346 */ 348 */
347static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt, 349static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt,
348 struct timespec *ts) 350 struct timespec *ts)
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index a63d83ebd151..0fbbc7aa02cb 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -85,6 +85,12 @@ static inline bool is_noslot_pfn(pfn_t pfn)
85 return pfn == KVM_PFN_NOSLOT; 85 return pfn == KVM_PFN_NOSLOT;
86} 86}
87 87
88/*
89 * architectures with KVM_HVA_ERR_BAD other than PAGE_OFFSET (e.g. s390)
90 * provide own defines and kvm_is_error_hva
91 */
92#ifndef KVM_HVA_ERR_BAD
93
88#define KVM_HVA_ERR_BAD (PAGE_OFFSET) 94#define KVM_HVA_ERR_BAD (PAGE_OFFSET)
89#define KVM_HVA_ERR_RO_BAD (PAGE_OFFSET + PAGE_SIZE) 95#define KVM_HVA_ERR_RO_BAD (PAGE_OFFSET + PAGE_SIZE)
90 96
@@ -93,6 +99,8 @@ static inline bool kvm_is_error_hva(unsigned long addr)
93 return addr >= PAGE_OFFSET; 99 return addr >= PAGE_OFFSET;
94} 100}
95 101
102#endif
103
96#define KVM_ERR_PTR_BAD_PAGE (ERR_PTR(-ENOENT)) 104#define KVM_ERR_PTR_BAD_PAGE (ERR_PTR(-ENOENT))
97 105
98static inline bool is_error_page(struct page *page) 106static inline bool is_error_page(struct page *page)
@@ -160,8 +168,12 @@ enum kvm_bus {
160 168
161int kvm_io_bus_write(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, 169int kvm_io_bus_write(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
162 int len, const void *val); 170 int len, const void *val);
171int kvm_io_bus_write_cookie(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
172 int len, const void *val, long cookie);
163int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, 173int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len,
164 void *val); 174 void *val);
175int kvm_io_bus_read_cookie(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
176 int len, void *val, long cookie);
165int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, 177int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
166 int len, struct kvm_io_device *dev); 178 int len, struct kvm_io_device *dev);
167int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, 179int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
@@ -499,6 +511,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
499void kvm_arch_free_memslot(struct kvm_memory_slot *free, 511void kvm_arch_free_memslot(struct kvm_memory_slot *free,
500 struct kvm_memory_slot *dont); 512 struct kvm_memory_slot *dont);
501int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); 513int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages);
514void kvm_arch_memslots_updated(struct kvm *kvm);
502int kvm_arch_prepare_memory_region(struct kvm *kvm, 515int kvm_arch_prepare_memory_region(struct kvm *kvm,
503 struct kvm_memory_slot *memslot, 516 struct kvm_memory_slot *memslot,
504 struct kvm_userspace_memory_region *mem, 517 struct kvm_userspace_memory_region *mem,
@@ -520,6 +533,7 @@ int gfn_to_page_many_atomic(struct kvm *kvm, gfn_t gfn, struct page **pages,
520 533
521struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); 534struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn);
522unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn); 535unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn);
536unsigned long gfn_to_hva_prot(struct kvm *kvm, gfn_t gfn, bool *writable);
523unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn); 537unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn);
524void kvm_release_page_clean(struct page *page); 538void kvm_release_page_clean(struct page *page);
525void kvm_release_page_dirty(struct page *page); 539void kvm_release_page_dirty(struct page *page);
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 4ea55bb45deb..0e23c26485f4 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -138,6 +138,22 @@ enum {
138 ATA_SHT_THIS_ID = -1, 138 ATA_SHT_THIS_ID = -1,
139 ATA_SHT_USE_CLUSTERING = 1, 139 ATA_SHT_USE_CLUSTERING = 1,
140 140
141 /* struct ata_taskfile flags */
142 ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */
143 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
144 ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */
145 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
146 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
147 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
148 ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
149
150 /* protocol flags */
151 ATA_PROT_FLAG_PIO = (1 << 0), /* is PIO */
152 ATA_PROT_FLAG_DMA = (1 << 1), /* is DMA */
153 ATA_PROT_FLAG_DATA = ATA_PROT_FLAG_PIO | ATA_PROT_FLAG_DMA,
154 ATA_PROT_FLAG_NCQ = (1 << 2), /* is NCQ */
155 ATA_PROT_FLAG_ATAPI = (1 << 3), /* is ATAPI */
156
141 /* struct ata_device stuff */ 157 /* struct ata_device stuff */
142 ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */ 158 ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */
143 ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */ 159 ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */
@@ -156,6 +172,7 @@ enum {
156 ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ 172 ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */
157 ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */ 173 ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */
158 ATA_DFLAG_UNLOCK_HPA = (1 << 18), /* unlock HPA */ 174 ATA_DFLAG_UNLOCK_HPA = (1 << 18), /* unlock HPA */
175 ATA_DFLAG_NCQ_SEND_RECV = (1 << 19), /* device supports NCQ SEND and RECV */
159 ATA_DFLAG_INIT_MASK = (1 << 24) - 1, 176 ATA_DFLAG_INIT_MASK = (1 << 24) - 1,
160 177
161 ATA_DFLAG_DETACH = (1 << 24), 178 ATA_DFLAG_DETACH = (1 << 24),
@@ -207,6 +224,7 @@ enum {
207 ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ 224 ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */
208 ATA_FLAG_AN = (1 << 18), /* controller supports AN */ 225 ATA_FLAG_AN = (1 << 18), /* controller supports AN */
209 ATA_FLAG_PMP = (1 << 19), /* controller supports PMP */ 226 ATA_FLAG_PMP = (1 << 19), /* controller supports PMP */
227 ATA_FLAG_FPDMA_AUX = (1 << 20), /* controller supports H2DFIS aux field */
210 ATA_FLAG_EM = (1 << 21), /* driver supports enclosure 228 ATA_FLAG_EM = (1 << 21), /* driver supports enclosure
211 * management */ 229 * management */
212 ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity 230 ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity
@@ -518,6 +536,33 @@ enum sw_activity {
518 BLINK_OFF, 536 BLINK_OFF,
519}; 537};
520 538
539struct ata_taskfile {
540 unsigned long flags; /* ATA_TFLAG_xxx */
541 u8 protocol; /* ATA_PROT_xxx */
542
543 u8 ctl; /* control reg */
544
545 u8 hob_feature; /* additional data */
546 u8 hob_nsect; /* to support LBA48 */
547 u8 hob_lbal;
548 u8 hob_lbam;
549 u8 hob_lbah;
550
551 u8 feature;
552 u8 nsect;
553 u8 lbal;
554 u8 lbam;
555 u8 lbah;
556
557 u8 device;
558
559 u8 command; /* IO operation */
560
561 u32 auxiliary; /* auxiliary field */
562 /* from SATA 3.1 and */
563 /* ATA-8 ACS-3 */
564};
565
521#ifdef CONFIG_ATA_SFF 566#ifdef CONFIG_ATA_SFF
522struct ata_ioports { 567struct ata_ioports {
523 void __iomem *cmd_addr; 568 void __iomem *cmd_addr;
@@ -660,6 +705,9 @@ struct ata_device {
660 /* DEVSLP Timing Variables from Identify Device Data Log */ 705 /* DEVSLP Timing Variables from Identify Device Data Log */
661 u8 devslp_timing[ATA_LOG_DEVSLP_SIZE]; 706 u8 devslp_timing[ATA_LOG_DEVSLP_SIZE];
662 707
708 /* NCQ send and receive log subcommand support */
709 u8 ncq_send_recv_cmds[ATA_LOG_NCQ_SEND_RECV_SIZE];
710
663 /* error history */ 711 /* error history */
664 int spdn_cnt; 712 int spdn_cnt;
665 /* ering is CLEAR_END, read comment above CLEAR_END */ 713 /* ering is CLEAR_END, read comment above CLEAR_END */
@@ -959,6 +1007,69 @@ extern const unsigned long sata_deb_timing_long[];
959extern struct ata_port_operations ata_dummy_port_ops; 1007extern struct ata_port_operations ata_dummy_port_ops;
960extern const struct ata_port_info ata_dummy_port_info; 1008extern const struct ata_port_info ata_dummy_port_info;
961 1009
1010/*
1011 * protocol tests
1012 */
1013static inline unsigned int ata_prot_flags(u8 prot)
1014{
1015 switch (prot) {
1016 case ATA_PROT_NODATA:
1017 return 0;
1018 case ATA_PROT_PIO:
1019 return ATA_PROT_FLAG_PIO;
1020 case ATA_PROT_DMA:
1021 return ATA_PROT_FLAG_DMA;
1022 case ATA_PROT_NCQ:
1023 return ATA_PROT_FLAG_DMA | ATA_PROT_FLAG_NCQ;
1024 case ATAPI_PROT_NODATA:
1025 return ATA_PROT_FLAG_ATAPI;
1026 case ATAPI_PROT_PIO:
1027 return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_PIO;
1028 case ATAPI_PROT_DMA:
1029 return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_DMA;
1030 }
1031 return 0;
1032}
1033
1034static inline int ata_is_atapi(u8 prot)
1035{
1036 return ata_prot_flags(prot) & ATA_PROT_FLAG_ATAPI;
1037}
1038
1039static inline int ata_is_nodata(u8 prot)
1040{
1041 return !(ata_prot_flags(prot) & ATA_PROT_FLAG_DATA);
1042}
1043
1044static inline int ata_is_pio(u8 prot)
1045{
1046 return ata_prot_flags(prot) & ATA_PROT_FLAG_PIO;
1047}
1048
1049static inline int ata_is_dma(u8 prot)
1050{
1051 return ata_prot_flags(prot) & ATA_PROT_FLAG_DMA;
1052}
1053
1054static inline int ata_is_ncq(u8 prot)
1055{
1056 return ata_prot_flags(prot) & ATA_PROT_FLAG_NCQ;
1057}
1058
1059static inline int ata_is_data(u8 prot)
1060{
1061 return ata_prot_flags(prot) & ATA_PROT_FLAG_DATA;
1062}
1063
1064static inline int is_multi_taskfile(struct ata_taskfile *tf)
1065{
1066 return (tf->command == ATA_CMD_READ_MULTI) ||
1067 (tf->command == ATA_CMD_WRITE_MULTI) ||
1068 (tf->command == ATA_CMD_READ_MULTI_EXT) ||
1069 (tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
1070 (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
1071}
1072
962static inline const unsigned long * 1073static inline const unsigned long *
963sata_ehc_deb_timing(struct ata_eh_context *ehc) 1074sata_ehc_deb_timing(struct ata_eh_context *ehc)
964{ 1075{
@@ -1142,8 +1253,6 @@ int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm);
1142int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *stm); 1253int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *stm);
1143unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev, 1254unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev,
1144 const struct ata_acpi_gtm *gtm); 1255 const struct ata_acpi_gtm *gtm);
1145acpi_handle ata_ap_acpi_handle(struct ata_port *ap);
1146acpi_handle ata_dev_acpi_handle(struct ata_device *dev);
1147int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm); 1256int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm);
1148#else 1257#else
1149static inline const struct ata_acpi_gtm *ata_acpi_init_gtm(struct ata_port *ap) 1258static inline const struct ata_acpi_gtm *ata_acpi_init_gtm(struct ata_port *ap)
@@ -1497,6 +1606,13 @@ static inline int ata_ncq_enabled(struct ata_device *dev)
1497 ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ; 1606 ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ;
1498} 1607}
1499 1608
1609static inline bool ata_fpdma_dsm_supported(struct ata_device *dev)
1610{
1611 return (dev->flags & ATA_DFLAG_NCQ_SEND_RECV) &&
1612 (dev->ncq_send_recv_cmds[ATA_LOG_NCQ_SEND_RECV_DSM_OFFSET] &
1613 ATA_LOG_NCQ_SEND_RECV_DSM_TRIM);
1614}
1615
1500static inline void ata_qc_set_polling(struct ata_queued_cmd *qc) 1616static inline void ata_qc_set_polling(struct ata_queued_cmd *qc)
1501{ 1617{
1502 qc->tf.ctl |= ATA_NIEN; 1618 qc->tf.ctl |= ATA_NIEN;
diff --git a/include/linux/list_lru.h b/include/linux/list_lru.h
new file mode 100644
index 000000000000..3ce541753c88
--- /dev/null
+++ b/include/linux/list_lru.h
@@ -0,0 +1,131 @@
1/*
2 * Copyright (c) 2013 Red Hat, Inc. and Parallels Inc. All rights reserved.
3 * Authors: David Chinner and Glauber Costa
4 *
5 * Generic LRU infrastructure
6 */
7#ifndef _LRU_LIST_H
8#define _LRU_LIST_H
9
10#include <linux/list.h>
11#include <linux/nodemask.h>
12
13/* list_lru_walk_cb has to always return one of those */
14enum lru_status {
15 LRU_REMOVED, /* item removed from list */
16 LRU_ROTATE, /* item referenced, give another pass */
17 LRU_SKIP, /* item cannot be locked, skip */
18 LRU_RETRY, /* item not freeable. May drop the lock
19 internally, but has to return locked. */
20};
21
22struct list_lru_node {
23 spinlock_t lock;
24 struct list_head list;
25 /* kept as signed so we can catch imbalance bugs */
26 long nr_items;
27} ____cacheline_aligned_in_smp;
28
29struct list_lru {
30 struct list_lru_node *node;
31 nodemask_t active_nodes;
32};
33
34void list_lru_destroy(struct list_lru *lru);
35int list_lru_init(struct list_lru *lru);
36
37/**
38 * list_lru_add: add an element to the lru list's tail
39 * @list_lru: the lru pointer
40 * @item: the item to be added.
41 *
42 * If the element is already part of a list, this function returns doing
43 * nothing. Therefore the caller does not need to keep state about whether or
44 * not the element already belongs in the list and is allowed to lazy update
45 * it. Note however that this is valid for *a* list, not *this* list. If
46 * the caller organize itself in a way that elements can be in more than
47 * one type of list, it is up to the caller to fully remove the item from
48 * the previous list (with list_lru_del() for instance) before moving it
49 * to @list_lru
50 *
51 * Return value: true if the list was updated, false otherwise
52 */
53bool list_lru_add(struct list_lru *lru, struct list_head *item);
54
55/**
56 * list_lru_del: delete an element to the lru list
57 * @list_lru: the lru pointer
58 * @item: the item to be deleted.
59 *
60 * This function works analogously as list_lru_add in terms of list
61 * manipulation. The comments about an element already pertaining to
62 * a list are also valid for list_lru_del.
63 *
64 * Return value: true if the list was updated, false otherwise
65 */
66bool list_lru_del(struct list_lru *lru, struct list_head *item);
67
68/**
69 * list_lru_count_node: return the number of objects currently held by @lru
70 * @lru: the lru pointer.
71 * @nid: the node id to count from.
72 *
73 * Always return a non-negative number, 0 for empty lists. There is no
74 * guarantee that the list is not updated while the count is being computed.
75 * Callers that want such a guarantee need to provide an outer lock.
76 */
77unsigned long list_lru_count_node(struct list_lru *lru, int nid);
78static inline unsigned long list_lru_count(struct list_lru *lru)
79{
80 long count = 0;
81 int nid;
82
83 for_each_node_mask(nid, lru->active_nodes)
84 count += list_lru_count_node(lru, nid);
85
86 return count;
87}
88
89typedef enum lru_status
90(*list_lru_walk_cb)(struct list_head *item, spinlock_t *lock, void *cb_arg);
91/**
92 * list_lru_walk_node: walk a list_lru, isolating and disposing freeable items.
93 * @lru: the lru pointer.
94 * @nid: the node id to scan from.
95 * @isolate: callback function that is resposible for deciding what to do with
96 * the item currently being scanned
97 * @cb_arg: opaque type that will be passed to @isolate
98 * @nr_to_walk: how many items to scan.
99 *
100 * This function will scan all elements in a particular list_lru, calling the
101 * @isolate callback for each of those items, along with the current list
102 * spinlock and a caller-provided opaque. The @isolate callback can choose to
103 * drop the lock internally, but *must* return with the lock held. The callback
104 * will return an enum lru_status telling the list_lru infrastructure what to
105 * do with the object being scanned.
106 *
107 * Please note that nr_to_walk does not mean how many objects will be freed,
108 * just how many objects will be scanned.
109 *
110 * Return value: the number of objects effectively removed from the LRU.
111 */
112unsigned long list_lru_walk_node(struct list_lru *lru, int nid,
113 list_lru_walk_cb isolate, void *cb_arg,
114 unsigned long *nr_to_walk);
115
116static inline unsigned long
117list_lru_walk(struct list_lru *lru, list_lru_walk_cb isolate,
118 void *cb_arg, unsigned long nr_to_walk)
119{
120 long isolated = 0;
121 int nid;
122
123 for_each_node_mask(nid, lru->active_nodes) {
124 isolated += list_lru_walk_node(lru, nid, isolate,
125 cb_arg, &nr_to_walk);
126 if (nr_to_walk <= 0)
127 break;
128 }
129 return isolated;
130}
131#endif /* _LRU_LIST_H */
diff --git a/include/linux/llist.h b/include/linux/llist.h
index cdaa7f023899..8828a78dec9a 100644
--- a/include/linux/llist.h
+++ b/include/linux/llist.h
@@ -125,6 +125,29 @@ static inline void init_llist_head(struct llist_head *list)
125 (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member)) 125 (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member))
126 126
127/** 127/**
128 * llist_for_each_entry_safe - iterate over some deleted entries of lock-less list of given type
129 * safe against removal of list entry
130 * @pos: the type * to use as a loop cursor.
131 * @n: another type * to use as temporary storage
132 * @node: the first entry of deleted list entries.
133 * @member: the name of the llist_node with the struct.
134 *
135 * In general, some entries of the lock-less list can be traversed
136 * safely only after being removed from list, so start with an entry
137 * instead of list head.
138 *
139 * If being used on entries deleted from lock-less list directly, the
140 * traverse order is from the newest to the oldest added entry. If
141 * you want to traverse from the oldest to the newest, you must
142 * reverse the order by yourself before traversing.
143 */
144#define llist_for_each_entry_safe(pos, n, node, member) \
145 for (pos = llist_entry((node), typeof(*pos), member); \
146 &pos->member != NULL && \
147 (n = llist_entry(pos->member.next, typeof(*n), member), true); \
148 pos = n)
149
150/**
128 * llist_empty - tests whether a lock-less list is empty 151 * llist_empty - tests whether a lock-less list is empty
129 * @head: the list to test 152 * @head: the list to test
130 * 153 *
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index f1e877b79ed8..cfc2f119779a 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -365,7 +365,7 @@ extern void lockdep_trace_alloc(gfp_t mask);
365 365
366#define lockdep_recursing(tsk) ((tsk)->lockdep_recursion) 366#define lockdep_recursing(tsk) ((tsk)->lockdep_recursion)
367 367
368#else /* !LOCKDEP */ 368#else /* !CONFIG_LOCKDEP */
369 369
370static inline void lockdep_off(void) 370static inline void lockdep_off(void)
371{ 371{
@@ -479,82 +479,36 @@ static inline void print_irqtrace_events(struct task_struct *curr)
479 * on the per lock-class debug mode: 479 * on the per lock-class debug mode:
480 */ 480 */
481 481
482#ifdef CONFIG_DEBUG_LOCK_ALLOC 482#ifdef CONFIG_PROVE_LOCKING
483# ifdef CONFIG_PROVE_LOCKING 483 #define lock_acquire_exclusive(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i)
484# define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) 484 #define lock_acquire_shared(l, s, t, n, i) lock_acquire(l, s, t, 1, 2, n, i)
485# define spin_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i) 485 #define lock_acquire_shared_recursive(l, s, t, n, i) lock_acquire(l, s, t, 2, 2, n, i)
486# else
487# define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i)
488# define spin_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, NULL, i)
489# endif
490# define spin_release(l, n, i) lock_release(l, n, i)
491#else 486#else
492# define spin_acquire(l, s, t, i) do { } while (0) 487 #define lock_acquire_exclusive(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i)
493# define spin_release(l, n, i) do { } while (0) 488 #define lock_acquire_shared(l, s, t, n, i) lock_acquire(l, s, t, 1, 1, n, i)
489 #define lock_acquire_shared_recursive(l, s, t, n, i) lock_acquire(l, s, t, 2, 1, n, i)
494#endif 490#endif
495 491
496#ifdef CONFIG_DEBUG_LOCK_ALLOC 492#define spin_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
497# ifdef CONFIG_PROVE_LOCKING 493#define spin_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i)
498# define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) 494#define spin_release(l, n, i) lock_release(l, n, i)
499# define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 2, NULL, i)
500# else
501# define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i)
502# define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 1, NULL, i)
503# endif
504# define rwlock_release(l, n, i) lock_release(l, n, i)
505#else
506# define rwlock_acquire(l, s, t, i) do { } while (0)
507# define rwlock_acquire_read(l, s, t, i) do { } while (0)
508# define rwlock_release(l, n, i) do { } while (0)
509#endif
510 495
511#ifdef CONFIG_DEBUG_LOCK_ALLOC 496#define rwlock_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
512# ifdef CONFIG_PROVE_LOCKING 497#define rwlock_acquire_read(l, s, t, i) lock_acquire_shared_recursive(l, s, t, NULL, i)
513# define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) 498#define rwlock_release(l, n, i) lock_release(l, n, i)
514# define mutex_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i)
515# else
516# define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i)
517# define mutex_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i)
518# endif
519# define mutex_release(l, n, i) lock_release(l, n, i)
520#else
521# define mutex_acquire(l, s, t, i) do { } while (0)
522# define mutex_acquire_nest(l, s, t, n, i) do { } while (0)
523# define mutex_release(l, n, i) do { } while (0)
524#endif
525 499
526#ifdef CONFIG_DEBUG_LOCK_ALLOC 500#define mutex_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
527# ifdef CONFIG_PROVE_LOCKING 501#define mutex_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i)
528# define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) 502#define mutex_release(l, n, i) lock_release(l, n, i)
529# define rwsem_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i) 503
530# define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 2, NULL, i) 504#define rwsem_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
531# else 505#define rwsem_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i)
532# define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i) 506#define rwsem_acquire_read(l, s, t, i) lock_acquire_shared(l, s, t, NULL, i)
533# define rwsem_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i)
534# define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 1, NULL, i)
535# endif
536# define rwsem_release(l, n, i) lock_release(l, n, i) 507# define rwsem_release(l, n, i) lock_release(l, n, i)
537#else
538# define rwsem_acquire(l, s, t, i) do { } while (0)
539# define rwsem_acquire_nest(l, s, t, n, i) do { } while (0)
540# define rwsem_acquire_read(l, s, t, i) do { } while (0)
541# define rwsem_release(l, n, i) do { } while (0)
542#endif
543 508
544#ifdef CONFIG_DEBUG_LOCK_ALLOC 509#define lock_map_acquire(l) lock_acquire_exclusive(l, 0, 0, NULL, _THIS_IP_)
545# ifdef CONFIG_PROVE_LOCKING 510#define lock_map_acquire_read(l) lock_acquire_shared_recursive(l, 0, 0, NULL, _THIS_IP_)
546# define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 2, NULL, _THIS_IP_)
547# define lock_map_acquire_read(l) lock_acquire(l, 0, 0, 2, 2, NULL, _THIS_IP_)
548# else
549# define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_)
550# define lock_map_acquire_read(l) lock_acquire(l, 0, 0, 2, 1, NULL, _THIS_IP_)
551# endif
552# define lock_map_release(l) lock_release(l, 1, _THIS_IP_) 511# define lock_map_release(l) lock_release(l, 1, _THIS_IP_)
553#else
554# define lock_map_acquire(l) do { } while (0)
555# define lock_map_acquire_read(l) do { } while (0)
556# define lock_map_release(l) do { } while (0)
557#endif
558 512
559#ifdef CONFIG_PROVE_LOCKING 513#ifdef CONFIG_PROVE_LOCKING
560# define might_lock(lock) \ 514# define might_lock(lock) \
diff --git a/include/linux/lockref.h b/include/linux/lockref.h
index 01233e01627a..f279ed9a9163 100644
--- a/include/linux/lockref.h
+++ b/include/linux/lockref.h
@@ -17,55 +17,23 @@
17#include <linux/spinlock.h> 17#include <linux/spinlock.h>
18 18
19struct lockref { 19struct lockref {
20 spinlock_t lock; 20 union {
21 unsigned int count; 21#ifdef CONFIG_CMPXCHG_LOCKREF
22 aligned_u64 lock_count;
23#endif
24 struct {
25 spinlock_t lock;
26 unsigned int count;
27 };
28 };
22}; 29};
23 30
24/** 31extern void lockref_get(struct lockref *);
25 * lockref_get - Increments reference count unconditionally 32extern int lockref_get_not_zero(struct lockref *);
26 * @lockcnt: pointer to lockref structure 33extern int lockref_get_or_lock(struct lockref *);
27 * 34extern int lockref_put_or_lock(struct lockref *);
28 * This operation is only valid if you already hold a reference
29 * to the object, so you know the count cannot be zero.
30 */
31static inline void lockref_get(struct lockref *lockref)
32{
33 spin_lock(&lockref->lock);
34 lockref->count++;
35 spin_unlock(&lockref->lock);
36}
37
38/**
39 * lockref_get_not_zero - Increments count unless the count is 0
40 * @lockcnt: pointer to lockref structure
41 * Return: 1 if count updated successfully or 0 if count is 0
42 */
43static inline int lockref_get_not_zero(struct lockref *lockref)
44{
45 int retval = 0;
46
47 spin_lock(&lockref->lock);
48 if (lockref->count) {
49 lockref->count++;
50 retval = 1;
51 }
52 spin_unlock(&lockref->lock);
53 return retval;
54}
55 35
56/** 36extern void lockref_mark_dead(struct lockref *);
57 * lockref_put_or_lock - decrements count unless count <= 1 before decrement 37extern int lockref_get_not_dead(struct lockref *);
58 * @lockcnt: pointer to lockref structure
59 * Return: 1 if count updated successfully or 0 if count <= 1 and lock taken
60 */
61static inline int lockref_put_or_lock(struct lockref *lockref)
62{
63 spin_lock(&lockref->lock);
64 if (lockref->count <= 1)
65 return 0;
66 lockref->count--;
67 spin_unlock(&lockref->lock);
68 return 1;
69}
70 38
71#endif /* __LINUX_LOCKREF_H */ 39#endif /* __LINUX_LOCKREF_H */
diff --git a/include/linux/lz4.h b/include/linux/lz4.h
index d21c13f10a64..4356686b0a39 100644
--- a/include/linux/lz4.h
+++ b/include/linux/lz4.h
@@ -67,8 +67,8 @@ int lz4hc_compress(const unsigned char *src, size_t src_len,
67 * note : Destination buffer must be already allocated. 67 * note : Destination buffer must be already allocated.
68 * slightly faster than lz4_decompress_unknownoutputsize() 68 * slightly faster than lz4_decompress_unknownoutputsize()
69 */ 69 */
70int lz4_decompress(const char *src, size_t *src_len, char *dest, 70int lz4_decompress(const unsigned char *src, size_t *src_len,
71 size_t actual_dest_len); 71 unsigned char *dest, size_t actual_dest_len);
72 72
73/* 73/*
74 * lz4_decompress_unknownoutputsize() 74 * lz4_decompress_unknownoutputsize()
@@ -82,6 +82,6 @@ int lz4_decompress(const char *src, size_t *src_len, char *dest,
82 * Error if return (< 0) 82 * Error if return (< 0)
83 * note : Destination buffer must be already allocated. 83 * note : Destination buffer must be already allocated.
84 */ 84 */
85int lz4_decompress_unknownoutputsize(const char *src, size_t src_len, 85int lz4_decompress_unknownoutputsize(const unsigned char *src, size_t src_len,
86 char *dest, size_t *dest_len); 86 unsigned char *dest, size_t *dest_len);
87#endif 87#endif
diff --git a/include/linux/math64.h b/include/linux/math64.h
index 2913b86eb12a..69ed5f5e9f6e 100644
--- a/include/linux/math64.h
+++ b/include/linux/math64.h
@@ -31,6 +31,15 @@ static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder)
31} 31}
32 32
33/** 33/**
34 * div64_u64_rem - unsigned 64bit divide with 64bit divisor and remainder
35 */
36static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder)
37{
38 *remainder = dividend % divisor;
39 return dividend / divisor;
40}
41
42/**
34 * div64_u64 - unsigned 64bit divide with 64bit divisor 43 * div64_u64 - unsigned 64bit divide with 64bit divisor
35 */ 44 */
36static inline u64 div64_u64(u64 dividend, u64 divisor) 45static inline u64 div64_u64(u64 dividend, u64 divisor)
@@ -63,6 +72,10 @@ static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder)
63extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder); 72extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder);
64#endif 73#endif
65 74
75#ifndef div64_u64_rem
76extern u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder);
77#endif
78
66#ifndef div64_u64 79#ifndef div64_u64
67extern u64 div64_u64(u64 dividend, u64 divisor); 80extern u64 div64_u64(u64 dividend, u64 divisor);
68#endif 81#endif
diff --git a/include/linux/mbus.h b/include/linux/mbus.h
index dba482e31a13..345b8c53b897 100644
--- a/include/linux/mbus.h
+++ b/include/linux/mbus.h
@@ -11,6 +11,8 @@
11#ifndef __LINUX_MBUS_H 11#ifndef __LINUX_MBUS_H
12#define __LINUX_MBUS_H 12#define __LINUX_MBUS_H
13 13
14struct resource;
15
14struct mbus_dram_target_info 16struct mbus_dram_target_info
15{ 17{
16 /* 18 /*
@@ -59,14 +61,18 @@ static inline const struct mbus_dram_target_info *mv_mbus_dram_info(void)
59} 61}
60#endif 62#endif
61 63
62int mvebu_mbus_add_window_remap_flags(const char *devname, phys_addr_t base, 64void mvebu_mbus_get_pcie_mem_aperture(struct resource *res);
63 size_t size, phys_addr_t remap, 65void mvebu_mbus_get_pcie_io_aperture(struct resource *res);
64 unsigned int flags); 66int mvebu_mbus_add_window_remap_by_id(unsigned int target,
65int mvebu_mbus_add_window(const char *devname, phys_addr_t base, 67 unsigned int attribute,
66 size_t size); 68 phys_addr_t base, size_t size,
69 phys_addr_t remap);
70int mvebu_mbus_add_window_by_id(unsigned int target, unsigned int attribute,
71 phys_addr_t base, size_t size);
67int mvebu_mbus_del_window(phys_addr_t base, size_t size); 72int mvebu_mbus_del_window(phys_addr_t base, size_t size);
68int mvebu_mbus_init(const char *soc, phys_addr_t mbus_phys_base, 73int mvebu_mbus_init(const char *soc, phys_addr_t mbus_phys_base,
69 size_t mbus_size, phys_addr_t sdram_phys_base, 74 size_t mbus_size, phys_addr_t sdram_phys_base,
70 size_t sdram_size); 75 size_t sdram_size);
76int mvebu_mbus_dt_init(void);
71 77
72#endif /* __LINUX_MBUS_H */ 78#endif /* __LINUX_MBUS_H */
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index f388203db7e8..31e95acddb4d 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -60,6 +60,8 @@ int memblock_reserve(phys_addr_t base, phys_addr_t size);
60void memblock_trim_memory(phys_addr_t align); 60void memblock_trim_memory(phys_addr_t align);
61 61
62#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 62#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
63int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn,
64 unsigned long *end_pfn);
63void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, 65void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
64 unsigned long *out_end_pfn, int *out_nid); 66 unsigned long *out_end_pfn, int *out_nid);
65 67
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 7b4d9d79570b..b3e7a667e03c 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -30,9 +30,21 @@ struct page;
30struct mm_struct; 30struct mm_struct;
31struct kmem_cache; 31struct kmem_cache;
32 32
33/* Stats that can be updated by kernel. */ 33/*
34enum mem_cgroup_page_stat_item { 34 * The corresponding mem_cgroup_stat_names is defined in mm/memcontrol.c,
35 MEMCG_NR_FILE_MAPPED, /* # of pages charged as file rss */ 35 * These two lists should keep in accord with each other.
36 */
37enum mem_cgroup_stat_index {
38 /*
39 * For MEM_CONTAINER_TYPE_ALL, usage = pagecache + rss.
40 */
41 MEM_CGROUP_STAT_CACHE, /* # of pages charged as cache */
42 MEM_CGROUP_STAT_RSS, /* # of pages charged as anon rss */
43 MEM_CGROUP_STAT_RSS_HUGE, /* # of pages charged as anon huge */
44 MEM_CGROUP_STAT_FILE_MAPPED, /* # of pages charged as file rss */
45 MEM_CGROUP_STAT_WRITEBACK, /* # of pages under writeback */
46 MEM_CGROUP_STAT_SWAP, /* # of pages, swapped out */
47 MEM_CGROUP_STAT_NSTATS,
36}; 48};
37 49
38struct mem_cgroup_reclaim_cookie { 50struct mem_cgroup_reclaim_cookie {
@@ -85,7 +97,7 @@ extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
85extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm); 97extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm);
86 98
87extern struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg); 99extern struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg);
88extern struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont); 100extern struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css);
89 101
90static inline 102static inline
91bool mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *memcg) 103bool mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *memcg)
@@ -125,6 +137,25 @@ extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg,
125extern void mem_cgroup_replace_page_cache(struct page *oldpage, 137extern void mem_cgroup_replace_page_cache(struct page *oldpage,
126 struct page *newpage); 138 struct page *newpage);
127 139
140static inline void mem_cgroup_oom_enable(void)
141{
142 WARN_ON(current->memcg_oom.may_oom);
143 current->memcg_oom.may_oom = 1;
144}
145
146static inline void mem_cgroup_oom_disable(void)
147{
148 WARN_ON(!current->memcg_oom.may_oom);
149 current->memcg_oom.may_oom = 0;
150}
151
152static inline bool task_in_memcg_oom(struct task_struct *p)
153{
154 return p->memcg_oom.memcg;
155}
156
157bool mem_cgroup_oom_synchronize(bool wait);
158
128#ifdef CONFIG_MEMCG_SWAP 159#ifdef CONFIG_MEMCG_SWAP
129extern int do_swap_account; 160extern int do_swap_account;
130#endif 161#endif
@@ -165,17 +196,17 @@ static inline void mem_cgroup_end_update_page_stat(struct page *page,
165} 196}
166 197
167void mem_cgroup_update_page_stat(struct page *page, 198void mem_cgroup_update_page_stat(struct page *page,
168 enum mem_cgroup_page_stat_item idx, 199 enum mem_cgroup_stat_index idx,
169 int val); 200 int val);
170 201
171static inline void mem_cgroup_inc_page_stat(struct page *page, 202static inline void mem_cgroup_inc_page_stat(struct page *page,
172 enum mem_cgroup_page_stat_item idx) 203 enum mem_cgroup_stat_index idx)
173{ 204{
174 mem_cgroup_update_page_stat(page, idx, 1); 205 mem_cgroup_update_page_stat(page, idx, 1);
175} 206}
176 207
177static inline void mem_cgroup_dec_page_stat(struct page *page, 208static inline void mem_cgroup_dec_page_stat(struct page *page,
178 enum mem_cgroup_page_stat_item idx) 209 enum mem_cgroup_stat_index idx)
179{ 210{
180 mem_cgroup_update_page_stat(page, idx, -1); 211 mem_cgroup_update_page_stat(page, idx, -1);
181} 212}
@@ -348,13 +379,31 @@ static inline void mem_cgroup_end_update_page_stat(struct page *page,
348{ 379{
349} 380}
350 381
382static inline void mem_cgroup_oom_enable(void)
383{
384}
385
386static inline void mem_cgroup_oom_disable(void)
387{
388}
389
390static inline bool task_in_memcg_oom(struct task_struct *p)
391{
392 return false;
393}
394
395static inline bool mem_cgroup_oom_synchronize(bool wait)
396{
397 return false;
398}
399
351static inline void mem_cgroup_inc_page_stat(struct page *page, 400static inline void mem_cgroup_inc_page_stat(struct page *page,
352 enum mem_cgroup_page_stat_item idx) 401 enum mem_cgroup_stat_index idx)
353{ 402{
354} 403}
355 404
356static inline void mem_cgroup_dec_page_stat(struct page *page, 405static inline void mem_cgroup_dec_page_stat(struct page *page,
357 enum mem_cgroup_page_stat_item idx) 406 enum mem_cgroup_stat_index idx)
358{ 407{
359} 408}
360 409
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 85c31a8e2904..9a6bbf76452d 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -25,16 +25,9 @@
25struct memory_block { 25struct memory_block {
26 unsigned long start_section_nr; 26 unsigned long start_section_nr;
27 unsigned long end_section_nr; 27 unsigned long end_section_nr;
28 unsigned long state; 28 unsigned long state; /* serialized by the dev->lock */
29 int section_count; 29 int section_count; /* serialized by mem_sysfs_mutex */
30 30 int online_type; /* for passing data to online routine */
31 /*
32 * This serializes all state change requests. It isn't
33 * held during creation because the control files are
34 * created long after the critical areas during
35 * initialization.
36 */
37 struct mutex state_mutex;
38 int phys_device; /* to which fru does this belong? */ 31 int phys_device; /* to which fru does this belong? */
39 void *hw; /* optional pointer to fw/hw data */ 32 void *hw; /* optional pointer to fw/hw data */
40 int (*phys_callback)(struct memory_block *); 33 int (*phys_callback)(struct memory_block *);
@@ -125,7 +118,6 @@ extern struct memory_block *find_memory_block_hinted(struct mem_section *,
125 struct memory_block *); 118 struct memory_block *);
126extern struct memory_block *find_memory_block(struct mem_section *); 119extern struct memory_block *find_memory_block(struct mem_section *);
127#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) 120#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
128enum mem_add_context { BOOT, HOTPLUG };
129#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ 121#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
130 122
131#ifdef CONFIG_MEMORY_HOTPLUG 123#ifdef CONFIG_MEMORY_HOTPLUG
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 0d7df39a5885..da6716b9e3fe 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -91,7 +91,6 @@ static inline struct mempolicy *mpol_dup(struct mempolicy *pol)
91} 91}
92 92
93#define vma_policy(vma) ((vma)->vm_policy) 93#define vma_policy(vma) ((vma)->vm_policy)
94#define vma_set_policy(vma, pol) ((vma)->vm_policy = (pol))
95 94
96static inline void mpol_get(struct mempolicy *pol) 95static inline void mpol_get(struct mempolicy *pol)
97{ 96{
@@ -126,6 +125,7 @@ struct shared_policy {
126 spinlock_t lock; 125 spinlock_t lock;
127}; 126};
128 127
128int vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst);
129void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol); 129void mpol_shared_policy_init(struct shared_policy *sp, struct mempolicy *mpol);
130int mpol_set_shared_policy(struct shared_policy *info, 130int mpol_set_shared_policy(struct shared_policy *info,
131 struct vm_area_struct *vma, 131 struct vm_area_struct *vma,
@@ -173,7 +173,7 @@ extern int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol);
173/* Check if a vma is migratable */ 173/* Check if a vma is migratable */
174static inline int vma_migratable(struct vm_area_struct *vma) 174static inline int vma_migratable(struct vm_area_struct *vma)
175{ 175{
176 if (vma->vm_flags & (VM_IO | VM_HUGETLB | VM_PFNMAP)) 176 if (vma->vm_flags & (VM_IO | VM_PFNMAP))
177 return 0; 177 return 0;
178 /* 178 /*
179 * Migration allocates pages in the highest zone. If we cannot 179 * Migration allocates pages in the highest zone. If we cannot
@@ -240,7 +240,12 @@ mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx)
240} 240}
241 241
242#define vma_policy(vma) NULL 242#define vma_policy(vma) NULL
243#define vma_set_policy(vma, pol) do {} while(0) 243
244static inline int
245vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst)
246{
247 return 0;
248}
244 249
245static inline void numa_policy_init(void) 250static inline void numa_policy_init(void)
246{ 251{
diff --git a/include/linux/mfd/arizona/gpio.h b/include/linux/mfd/arizona/gpio.h
new file mode 100644
index 000000000000..d2146bb74f89
--- /dev/null
+++ b/include/linux/mfd/arizona/gpio.h
@@ -0,0 +1,96 @@
1/*
2 * GPIO configuration for Arizona devices
3 *
4 * Copyright 2013 Wolfson Microelectronics. PLC.
5 *
6 * Author: Charles Keepax <ckeepax@opensource.wolfsonmicro.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 _ARIZONA_GPIO_H
14#define _ARIZONA_GPIO_H
15
16#define ARIZONA_GP_FN_TXLRCLK 0x00
17#define ARIZONA_GP_FN_GPIO 0x01
18#define ARIZONA_GP_FN_IRQ1 0x02
19#define ARIZONA_GP_FN_IRQ2 0x03
20#define ARIZONA_GP_FN_OPCLK 0x04
21#define ARIZONA_GP_FN_FLL1_OUT 0x05
22#define ARIZONA_GP_FN_FLL2_OUT 0x06
23#define ARIZONA_GP_FN_PWM1 0x08
24#define ARIZONA_GP_FN_PWM2 0x09
25#define ARIZONA_GP_FN_SYSCLK_UNDERCLOCKED 0x0A
26#define ARIZONA_GP_FN_ASYNCCLK_UNDERCLOCKED 0x0B
27#define ARIZONA_GP_FN_FLL1_LOCK 0x0C
28#define ARIZONA_GP_FN_FLL2_LOCK 0x0D
29#define ARIZONA_GP_FN_FLL1_CLOCK_OK 0x0F
30#define ARIZONA_GP_FN_FLL2_CLOCK_OK 0x10
31#define ARIZONA_GP_FN_HEADPHONE_DET 0x12
32#define ARIZONA_GP_FN_MIC_DET 0x13
33#define ARIZONA_GP_FN_WSEQ_STATUS 0x15
34#define ARIZONA_GP_FN_CIF_ADDRESS_ERROR 0x16
35#define ARIZONA_GP_FN_ASRC1_LOCK 0x1A
36#define ARIZONA_GP_FN_ASRC2_LOCK 0x1B
37#define ARIZONA_GP_FN_ASRC_CONFIG_ERROR 0x1C
38#define ARIZONA_GP_FN_DRC1_SIGNAL_DETECT 0x1D
39#define ARIZONA_GP_FN_DRC1_ANTICLIP 0x1E
40#define ARIZONA_GP_FN_DRC1_DECAY 0x1F
41#define ARIZONA_GP_FN_DRC1_NOISE 0x20
42#define ARIZONA_GP_FN_DRC1_QUICK_RELEASE 0x21
43#define ARIZONA_GP_FN_DRC2_SIGNAL_DETECT 0x22
44#define ARIZONA_GP_FN_DRC2_ANTICLIP 0x23
45#define ARIZONA_GP_FN_DRC2_DECAY 0x24
46#define ARIZONA_GP_FN_DRC2_NOISE 0x25
47#define ARIZONA_GP_FN_DRC2_QUICK_RELEASE 0x26
48#define ARIZONA_GP_FN_MIXER_DROPPED_SAMPLE 0x27
49#define ARIZONA_GP_FN_AIF1_CONFIG_ERROR 0x28
50#define ARIZONA_GP_FN_AIF2_CONFIG_ERROR 0x29
51#define ARIZONA_GP_FN_AIF3_CONFIG_ERROR 0x2A
52#define ARIZONA_GP_FN_SPK_TEMP_SHUTDOWN 0x2B
53#define ARIZONA_GP_FN_SPK_TEMP_WARNING 0x2C
54#define ARIZONA_GP_FN_UNDERCLOCKED 0x2D
55#define ARIZONA_GP_FN_OVERCLOCKED 0x2E
56#define ARIZONA_GP_FN_DSP_IRQ1 0x35
57#define ARIZONA_GP_FN_DSP_IRQ2 0x36
58#define ARIZONA_GP_FN_ASYNC_OPCLK 0x3D
59#define ARIZONA_GP_FN_BOOT_DONE 0x44
60#define ARIZONA_GP_FN_DSP1_RAM_READY 0x45
61#define ARIZONA_GP_FN_SYSCLK_ENA_STATUS 0x4B
62#define ARIZONA_GP_FN_ASYNCCLK_ENA_STATUS 0x4C
63
64#define ARIZONA_GPN_DIR 0x8000 /* GPN_DIR */
65#define ARIZONA_GPN_DIR_MASK 0x8000 /* GPN_DIR */
66#define ARIZONA_GPN_DIR_SHIFT 15 /* GPN_DIR */
67#define ARIZONA_GPN_DIR_WIDTH 1 /* GPN_DIR */
68#define ARIZONA_GPN_PU 0x4000 /* GPN_PU */
69#define ARIZONA_GPN_PU_MASK 0x4000 /* GPN_PU */
70#define ARIZONA_GPN_PU_SHIFT 14 /* GPN_PU */
71#define ARIZONA_GPN_PU_WIDTH 1 /* GPN_PU */
72#define ARIZONA_GPN_PD 0x2000 /* GPN_PD */
73#define ARIZONA_GPN_PD_MASK 0x2000 /* GPN_PD */
74#define ARIZONA_GPN_PD_SHIFT 13 /* GPN_PD */
75#define ARIZONA_GPN_PD_WIDTH 1 /* GPN_PD */
76#define ARIZONA_GPN_LVL 0x0800 /* GPN_LVL */
77#define ARIZONA_GPN_LVL_MASK 0x0800 /* GPN_LVL */
78#define ARIZONA_GPN_LVL_SHIFT 11 /* GPN_LVL */
79#define ARIZONA_GPN_LVL_WIDTH 1 /* GPN_LVL */
80#define ARIZONA_GPN_POL 0x0400 /* GPN_POL */
81#define ARIZONA_GPN_POL_MASK 0x0400 /* GPN_POL */
82#define ARIZONA_GPN_POL_SHIFT 10 /* GPN_POL */
83#define ARIZONA_GPN_POL_WIDTH 1 /* GPN_POL */
84#define ARIZONA_GPN_OP_CFG 0x0200 /* GPN_OP_CFG */
85#define ARIZONA_GPN_OP_CFG_MASK 0x0200 /* GPN_OP_CFG */
86#define ARIZONA_GPN_OP_CFG_SHIFT 9 /* GPN_OP_CFG */
87#define ARIZONA_GPN_OP_CFG_WIDTH 1 /* GPN_OP_CFG */
88#define ARIZONA_GPN_DB 0x0100 /* GPN_DB */
89#define ARIZONA_GPN_DB_MASK 0x0100 /* GPN_DB */
90#define ARIZONA_GPN_DB_SHIFT 8 /* GPN_DB */
91#define ARIZONA_GPN_DB_WIDTH 1 /* GPN_DB */
92#define ARIZONA_GPN_FN_MASK 0x007F /* GPN_DB */
93#define ARIZONA_GPN_FN_SHIFT 0 /* GPN_DB */
94#define ARIZONA_GPN_FN_WIDTH 7 /* GPN_DB */
95
96#endif
diff --git a/include/linux/mfd/da9063/core.h b/include/linux/mfd/da9063/core.h
new file mode 100644
index 000000000000..2d2a0af675fd
--- /dev/null
+++ b/include/linux/mfd/da9063/core.h
@@ -0,0 +1,93 @@
1/*
2 * Definitions for DA9063 MFD driver
3 *
4 * Copyright 2012 Dialog Semiconductor Ltd.
5 *
6 * Author: Michal Hajduk <michal.hajduk@diasemi.com>
7 * Krystian Garbaciak <krystian.garbaciak@diasemi.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15
16#ifndef __MFD_DA9063_CORE_H__
17#define __MFD_DA9063_CORE_H__
18
19#include <linux/interrupt.h>
20#include <linux/mfd/da9063/registers.h>
21
22/* DA9063 modules */
23#define DA9063_DRVNAME_CORE "da9063-core"
24#define DA9063_DRVNAME_REGULATORS "da9063-regulators"
25#define DA9063_DRVNAME_LEDS "da9063-leds"
26#define DA9063_DRVNAME_WATCHDOG "da9063-watchdog"
27#define DA9063_DRVNAME_HWMON "da9063-hwmon"
28#define DA9063_DRVNAME_ONKEY "da9063-onkey"
29#define DA9063_DRVNAME_RTC "da9063-rtc"
30#define DA9063_DRVNAME_VIBRATION "da9063-vibration"
31
32enum da9063_models {
33 PMIC_DA9063 = 0x61,
34};
35
36/* Interrupts */
37enum da9063_irqs {
38 DA9063_IRQ_ONKEY = 0,
39 DA9063_IRQ_ALARM,
40 DA9063_IRQ_TICK,
41 DA9063_IRQ_ADC_RDY,
42 DA9063_IRQ_SEQ_RDY,
43 DA9063_IRQ_WAKE,
44 DA9063_IRQ_TEMP,
45 DA9063_IRQ_COMP_1V2,
46 DA9063_IRQ_LDO_LIM,
47 DA9063_IRQ_REG_UVOV,
48 DA9063_IRQ_VDD_MON,
49 DA9063_IRQ_WARN,
50 DA9063_IRQ_GPI0,
51 DA9063_IRQ_GPI1,
52 DA9063_IRQ_GPI2,
53 DA9063_IRQ_GPI3,
54 DA9063_IRQ_GPI4,
55 DA9063_IRQ_GPI5,
56 DA9063_IRQ_GPI6,
57 DA9063_IRQ_GPI7,
58 DA9063_IRQ_GPI8,
59 DA9063_IRQ_GPI9,
60 DA9063_IRQ_GPI10,
61 DA9063_IRQ_GPI11,
62 DA9063_IRQ_GPI12,
63 DA9063_IRQ_GPI13,
64 DA9063_IRQ_GPI14,
65 DA9063_IRQ_GPI15,
66};
67
68#define DA9063_IRQ_BASE_OFFSET 0
69#define DA9063_NUM_IRQ (DA9063_IRQ_GPI15 + 1 - DA9063_IRQ_BASE_OFFSET)
70
71struct da9063 {
72 /* Device */
73 struct device *dev;
74 unsigned short model;
75 unsigned short revision;
76 unsigned int flags;
77
78 /* Control interface */
79 struct regmap *regmap;
80
81 /* Interrupts */
82 int chip_irq;
83 unsigned int irq_base;
84 struct regmap_irq_chip_data *regmap_irq;
85};
86
87int da9063_device_init(struct da9063 *da9063, unsigned int irq);
88int da9063_irq_init(struct da9063 *da9063);
89
90void da9063_device_exit(struct da9063 *da9063);
91void da9063_irq_exit(struct da9063 *da9063);
92
93#endif /* __MFD_DA9063_CORE_H__ */
diff --git a/include/linux/mfd/da9063/pdata.h b/include/linux/mfd/da9063/pdata.h
new file mode 100644
index 000000000000..95c8742215a7
--- /dev/null
+++ b/include/linux/mfd/da9063/pdata.h
@@ -0,0 +1,111 @@
1/*
2 * Platform configuration options for DA9063
3 *
4 * Copyright 2012 Dialog Semiconductor Ltd.
5 *
6 * Author: Michal Hajduk <michal.hajduk@diasemi.com>
7 * Author: Krystian Garbaciak <krystian.garbaciak@diasemi.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15
16#ifndef __MFD_DA9063_PDATA_H__
17#define __MFD_DA9063_PDATA_H__
18
19#include <linux/regulator/machine.h>
20
21/*
22 * Regulator configuration
23 */
24/* DA9063 regulator IDs */
25enum {
26 /* BUCKs */
27 DA9063_ID_BCORE1,
28 DA9063_ID_BCORE2,
29 DA9063_ID_BPRO,
30 DA9063_ID_BMEM,
31 DA9063_ID_BIO,
32 DA9063_ID_BPERI,
33
34 /* BCORE1 and BCORE2 in merged mode */
35 DA9063_ID_BCORES_MERGED,
36 /* BMEM and BIO in merged mode */
37 DA9063_ID_BMEM_BIO_MERGED,
38 /* When two BUCKs are merged, they cannot be reused separately */
39
40 /* LDOs */
41 DA9063_ID_LDO1,
42 DA9063_ID_LDO2,
43 DA9063_ID_LDO3,
44 DA9063_ID_LDO4,
45 DA9063_ID_LDO5,
46 DA9063_ID_LDO6,
47 DA9063_ID_LDO7,
48 DA9063_ID_LDO8,
49 DA9063_ID_LDO9,
50 DA9063_ID_LDO10,
51 DA9063_ID_LDO11,
52};
53
54/* Regulators platform data */
55struct da9063_regulator_data {
56 int id;
57 struct regulator_init_data *initdata;
58};
59
60struct da9063_regulators_pdata {
61 unsigned n_regulators;
62 struct da9063_regulator_data *regulator_data;
63};
64
65
66/*
67 * RGB LED configuration
68 */
69/* LED IDs for flags in struct led_info. */
70enum {
71 DA9063_GPIO11_LED,
72 DA9063_GPIO14_LED,
73 DA9063_GPIO15_LED,
74
75 DA9063_LED_NUM
76};
77#define DA9063_LED_ID_MASK 0x3
78
79/* LED polarity for flags in struct led_info. */
80#define DA9063_LED_HIGH_LEVEL_ACTIVE 0x0
81#define DA9063_LED_LOW_LEVEL_ACTIVE 0x4
82
83
84/*
85 * General PMIC configuration
86 */
87/* HWMON ADC channels configuration */
88#define DA9063_FLG_FORCE_IN0_MANUAL_MODE 0x0010
89#define DA9063_FLG_FORCE_IN0_AUTO_MODE 0x0020
90#define DA9063_FLG_FORCE_IN1_MANUAL_MODE 0x0040
91#define DA9063_FLG_FORCE_IN1_AUTO_MODE 0x0080
92#define DA9063_FLG_FORCE_IN2_MANUAL_MODE 0x0100
93#define DA9063_FLG_FORCE_IN2_AUTO_MODE 0x0200
94#define DA9063_FLG_FORCE_IN3_MANUAL_MODE 0x0400
95#define DA9063_FLG_FORCE_IN3_AUTO_MODE 0x0800
96
97/* Disable register caching. */
98#define DA9063_FLG_NO_CACHE 0x0008
99
100struct da9063;
101
102/* DA9063 platform data */
103struct da9063_pdata {
104 int (*init)(struct da9063 *da9063);
105 int irq_base;
106 unsigned flags;
107 struct da9063_regulators_pdata *regulators_pdata;
108 struct led_platform_data *leds_pdata;
109};
110
111#endif /* __MFD_DA9063_PDATA_H__ */
diff --git a/include/linux/mfd/da9063/registers.h b/include/linux/mfd/da9063/registers.h
new file mode 100644
index 000000000000..5834813fb5f3
--- /dev/null
+++ b/include/linux/mfd/da9063/registers.h
@@ -0,0 +1,1028 @@
1/*
2 * Registers definition for DA9063 modules
3 *
4 * Copyright 2012 Dialog Semiconductor Ltd.
5 *
6 * Author: Michal Hajduk <michal.hajduk@diasemi.com>
7 * Krystian Garbaciak <krystian.garbaciak@diasemi.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 *
14 */
15
16#ifndef _DA9063_REG_H
17#define _DA9063_REG_H
18
19#define DA9063_I2C_PAGE_SEL_SHIFT 1
20
21#define DA9063_EVENT_REG_NUM 4
22#define DA9210_EVENT_REG_NUM 2
23#define DA9063_EXT_EVENT_REG_NUM (DA9063_EVENT_REG_NUM + \
24 DA9210_EVENT_REG_NUM)
25
26/* Page selection I2C or SPI always in the begining of any page. */
27/* Page 0 : I2C access 0x000 - 0x0FF SPI access 0x000 - 0x07F */
28/* Page 1 : SPI access 0x080 - 0x0FF */
29/* Page 2 : I2C access 0x100 - 0x1FF SPI access 0x100 - 0x17F */
30/* Page 3 : SPI access 0x180 - 0x1FF */
31#define DA9063_REG_PAGE_CON 0x00
32
33/* System Control and Event Registers */
34#define DA9063_REG_STATUS_A 0x01
35#define DA9063_REG_STATUS_B 0x02
36#define DA9063_REG_STATUS_C 0x03
37#define DA9063_REG_STATUS_D 0x04
38#define DA9063_REG_FAULT_LOG 0x05
39#define DA9063_REG_EVENT_A 0x06
40#define DA9063_REG_EVENT_B 0x07
41#define DA9063_REG_EVENT_C 0x08
42#define DA9063_REG_EVENT_D 0x09
43#define DA9063_REG_IRQ_MASK_A 0x0A
44#define DA9063_REG_IRQ_MASK_B 0x0B
45#define DA9063_REG_IRQ_MASK_C 0x0C
46#define DA9063_REG_IRQ_MASK_D 0x0D
47#define DA9063_REG_CONTROL_A 0x0E
48#define DA9063_REG_CONTROL_B 0x0F
49#define DA9063_REG_CONTROL_C 0x10
50#define DA9063_REG_CONTROL_D 0x11
51#define DA9063_REG_CONTROL_E 0x12
52#define DA9063_REG_CONTROL_F 0x13
53#define DA9063_REG_PD_DIS 0x14
54
55/* GPIO Control Registers */
56#define DA9063_REG_GPIO_0_1 0x15
57#define DA9063_REG_GPIO_2_3 0x16
58#define DA9063_REG_GPIO_4_5 0x17
59#define DA9063_REG_GPIO_6_7 0x18
60#define DA9063_REG_GPIO_8_9 0x19
61#define DA9063_REG_GPIO_10_11 0x1A
62#define DA9063_REG_GPIO_12_13 0x1B
63#define DA9063_REG_GPIO_14_15 0x1C
64#define DA9063_REG_GPIO_MODE_0_7 0x1D
65#define DA9063_REG_GPIO_MODE_8_15 0x1E
66#define DA9063_REG_GPIO_SWITCH_CONT 0x1F
67
68/* Regulator Control Registers */
69#define DA9063_REG_BCORE2_CONT 0x20
70#define DA9063_REG_BCORE1_CONT 0x21
71#define DA9063_REG_BPRO_CONT 0x22
72#define DA9063_REG_BMEM_CONT 0x23
73#define DA9063_REG_BIO_CONT 0x24
74#define DA9063_REG_BPERI_CONT 0x25
75#define DA9063_REG_LDO1_CONT 0x26
76#define DA9063_REG_LDO2_CONT 0x27
77#define DA9063_REG_LDO3_CONT 0x28
78#define DA9063_REG_LDO4_CONT 0x29
79#define DA9063_REG_LDO5_CONT 0x2A
80#define DA9063_REG_LDO6_CONT 0x2B
81#define DA9063_REG_LDO7_CONT 0x2C
82#define DA9063_REG_LDO8_CONT 0x2D
83#define DA9063_REG_LDO9_CONT 0x2E
84#define DA9063_REG_LDO10_CONT 0x2F
85#define DA9063_REG_LDO11_CONT 0x30
86#define DA9063_REG_VIB 0x31
87#define DA9063_REG_DVC_1 0x32
88#define DA9063_REG_DVC_2 0x33
89
90/* GP-ADC Control Registers */
91#define DA9063_REG_ADC_MAN 0x34
92#define DA9063_REG_ADC_CONT 0x35
93#define DA9063_REG_VSYS_MON 0x36
94#define DA9063_REG_ADC_RES_L 0x37
95#define DA9063_REG_ADC_RES_H 0x38
96#define DA9063_REG_VSYS_RES 0x39
97#define DA9063_REG_ADCIN1_RES 0x3A
98#define DA9063_REG_ADCIN2_RES 0x3B
99#define DA9063_REG_ADCIN3_RES 0x3C
100#define DA9063_REG_MON1_RES 0x3D
101#define DA9063_REG_MON2_RES 0x3E
102#define DA9063_REG_MON3_RES 0x3F
103
104/* RTC Calendar and Alarm Registers */
105#define DA9063_REG_COUNT_S 0x40
106#define DA9063_REG_COUNT_MI 0x41
107#define DA9063_REG_COUNT_H 0x42
108#define DA9063_REG_COUNT_D 0x43
109#define DA9063_REG_COUNT_MO 0x44
110#define DA9063_REG_COUNT_Y 0x45
111#define DA9063_REG_ALARM_MI 0x46
112#define DA9063_REG_ALARM_H 0x47
113#define DA9063_REG_ALARM_D 0x48
114#define DA9063_REG_ALARM_MO 0x49
115#define DA9063_REG_ALARM_Y 0x4A
116#define DA9063_REG_SECOND_A 0x4B
117#define DA9063_REG_SECOND_B 0x4C
118#define DA9063_REG_SECOND_C 0x4D
119#define DA9063_REG_SECOND_D 0x4E
120
121/* Sequencer Control Registers */
122#define DA9063_REG_SEQ 0x81
123#define DA9063_REG_SEQ_TIMER 0x82
124#define DA9063_REG_ID_2_1 0x83
125#define DA9063_REG_ID_4_3 0x84
126#define DA9063_REG_ID_6_5 0x85
127#define DA9063_REG_ID_8_7 0x86
128#define DA9063_REG_ID_10_9 0x87
129#define DA9063_REG_ID_12_11 0x88
130#define DA9063_REG_ID_14_13 0x89
131#define DA9063_REG_ID_16_15 0x8A
132#define DA9063_REG_ID_18_17 0x8B
133#define DA9063_REG_ID_20_19 0x8C
134#define DA9063_REG_ID_22_21 0x8D
135#define DA9063_REG_ID_24_23 0x8E
136#define DA9063_REG_ID_26_25 0x8F
137#define DA9063_REG_ID_28_27 0x90
138#define DA9063_REG_ID_30_29 0x91
139#define DA9063_REG_ID_32_31 0x92
140#define DA9063_REG_SEQ_A 0x95
141#define DA9063_REG_SEQ_B 0x96
142#define DA9063_REG_WAIT 0x97
143#define DA9063_REG_EN_32K 0x98
144#define DA9063_REG_RESET 0x99
145
146/* Regulator Setting Registers */
147#define DA9063_REG_BUCK_ILIM_A 0x9A
148#define DA9063_REG_BUCK_ILIM_B 0x9B
149#define DA9063_REG_BUCK_ILIM_C 0x9C
150#define DA9063_REG_BCORE2_CFG 0x9D
151#define DA9063_REG_BCORE1_CFG 0x9E
152#define DA9063_REG_BPRO_CFG 0x9F
153#define DA9063_REG_BIO_CFG 0xA0
154#define DA9063_REG_BMEM_CFG 0xA1
155#define DA9063_REG_BPERI_CFG 0xA2
156#define DA9063_REG_VBCORE2_A 0xA3
157#define DA9063_REG_VBCORE1_A 0xA4
158#define DA9063_REG_VBPRO_A 0xA5
159#define DA9063_REG_VBMEM_A 0xA6
160#define DA9063_REG_VBIO_A 0xA7
161#define DA9063_REG_VBPERI_A 0xA8
162#define DA9063_REG_VLDO1_A 0xA9
163#define DA9063_REG_VLDO2_A 0xAA
164#define DA9063_REG_VLDO3_A 0xAB
165#define DA9063_REG_VLDO4_A 0xAC
166#define DA9063_REG_VLDO5_A 0xAD
167#define DA9063_REG_VLDO6_A 0xAE
168#define DA9063_REG_VLDO7_A 0xAF
169#define DA9063_REG_VLDO8_A 0xB0
170#define DA9063_REG_VLDO9_A 0xB1
171#define DA9063_REG_VLDO10_A 0xB2
172#define DA9063_REG_VLDO11_A 0xB3
173#define DA9063_REG_VBCORE2_B 0xB4
174#define DA9063_REG_VBCORE1_B 0xB5
175#define DA9063_REG_VBPRO_B 0xB6
176#define DA9063_REG_VBMEM_B 0xB7
177#define DA9063_REG_VBIO_B 0xB8
178#define DA9063_REG_VBPERI_B 0xB9
179#define DA9063_REG_VLDO1_B 0xBA
180#define DA9063_REG_VLDO2_B 0xBB
181#define DA9063_REG_VLDO3_B 0xBC
182#define DA9063_REG_VLDO4_B 0xBD
183#define DA9063_REG_VLDO5_B 0xBE
184#define DA9063_REG_VLDO6_B 0xBF
185#define DA9063_REG_VLDO7_B 0xC0
186#define DA9063_REG_VLDO8_B 0xC1
187#define DA9063_REG_VLDO9_B 0xC2
188#define DA9063_REG_VLDO10_B 0xC3
189#define DA9063_REG_VLDO11_B 0xC4
190
191/* Backup Battery Charger Control Register */
192#define DA9063_REG_BBAT_CONT 0xC5
193
194/* GPIO PWM (LED) */
195#define DA9063_REG_GPO11_LED 0xC6
196#define DA9063_REG_GPO14_LED 0xC7
197#define DA9063_REG_GPO15_LED 0xC8
198
199/* GP-ADC Threshold Registers */
200#define DA9063_REG_ADC_CFG 0xC9
201#define DA9063_REG_AUTO1_HIGH 0xCA
202#define DA9063_REG_AUTO1_LOW 0xCB
203#define DA9063_REG_AUTO2_HIGH 0xCC
204#define DA9063_REG_AUTO2_LOW 0xCD
205#define DA9063_REG_AUTO3_HIGH 0xCE
206#define DA9063_REG_AUTO3_LOW 0xCF
207
208/* DA9063 Configuration registers */
209/* OTP */
210#define DA9063_REG_OPT_COUNT 0x101
211#define DA9063_REG_OPT_ADDR 0x102
212#define DA9063_REG_OPT_DATA 0x103
213
214/* Customer Trim and Configuration */
215#define DA9063_REG_T_OFFSET 0x104
216#define DA9063_REG_INTERFACE 0x105
217#define DA9063_REG_CONFIG_A 0x106
218#define DA9063_REG_CONFIG_B 0x107
219#define DA9063_REG_CONFIG_C 0x108
220#define DA9063_REG_CONFIG_D 0x109
221#define DA9063_REG_CONFIG_E 0x10A
222#define DA9063_REG_CONFIG_F 0x10B
223#define DA9063_REG_CONFIG_G 0x10C
224#define DA9063_REG_CONFIG_H 0x10D
225#define DA9063_REG_CONFIG_I 0x10E
226#define DA9063_REG_CONFIG_J 0x10F
227#define DA9063_REG_CONFIG_K 0x110
228#define DA9063_REG_CONFIG_L 0x111
229#define DA9063_REG_MON_REG_1 0x112
230#define DA9063_REG_MON_REG_2 0x113
231#define DA9063_REG_MON_REG_3 0x114
232#define DA9063_REG_MON_REG_4 0x115
233#define DA9063_REG_MON_REG_5 0x116
234#define DA9063_REG_MON_REG_6 0x117
235#define DA9063_REG_TRIM_CLDR 0x118
236
237/* General Purpose Registers */
238#define DA9063_REG_GP_ID_0 0x119
239#define DA9063_REG_GP_ID_1 0x11A
240#define DA9063_REG_GP_ID_2 0x11B
241#define DA9063_REG_GP_ID_3 0x11C
242#define DA9063_REG_GP_ID_4 0x11D
243#define DA9063_REG_GP_ID_5 0x11E
244#define DA9063_REG_GP_ID_6 0x11F
245#define DA9063_REG_GP_ID_7 0x120
246#define DA9063_REG_GP_ID_8 0x121
247#define DA9063_REG_GP_ID_9 0x122
248#define DA9063_REG_GP_ID_10 0x123
249#define DA9063_REG_GP_ID_11 0x124
250#define DA9063_REG_GP_ID_12 0x125
251#define DA9063_REG_GP_ID_13 0x126
252#define DA9063_REG_GP_ID_14 0x127
253#define DA9063_REG_GP_ID_15 0x128
254#define DA9063_REG_GP_ID_16 0x129
255#define DA9063_REG_GP_ID_17 0x12A
256#define DA9063_REG_GP_ID_18 0x12B
257#define DA9063_REG_GP_ID_19 0x12C
258
259/* Chip ID and variant */
260#define DA9063_REG_CHIP_ID 0x181
261#define DA9063_REG_CHIP_VARIANT 0x182
262
263/*
264 * PMIC registers bits
265 */
266/* DA9063_REG_PAGE_CON (addr=0x00) */
267#define DA9063_PEG_PAGE_SHIFT 0
268#define DA9063_REG_PAGE_MASK 0x07
269#define DA9063_REG_PAGE0 0x00
270#define DA9063_REG_PAGE2 0x02
271#define DA9063_PAGE_WRITE_MODE 0x00
272#define DA9063_REPEAT_WRITE_MODE 0x40
273#define DA9063_PAGE_REVERT 0x80
274
275/* DA9063_REG_STATUS_A (addr=0x01) */
276#define DA9063_NONKEY 0x01
277#define DA9063_WAKE 0x02
278#define DA9063_DVC_BUSY 0x04
279#define DA9063_COMP_1V2 0x08
280
281/* DA9063_REG_STATUS_B (addr=0x02) */
282#define DA9063_GPI0 0x01
283#define DA9063_GPI1 0x02
284#define DA9063_GPI2 0x04
285#define DA9063_GPI3 0x08
286#define DA9063_GPI4 0x10
287#define DA9063_GPI5 0x20
288#define DA9063_GPI6 0x40
289#define DA9063_GPI7 0x80
290
291/* DA9063_REG_STATUS_C (addr=0x03) */
292#define DA9063_GPI8 0x01
293#define DA9063_GPI9 0x02
294#define DA9063_GPI10 0x04
295#define DA9063_GPI11 0x08
296#define DA9063_GPI12 0x10
297#define DA9063_GPI13 0x20
298#define DA9063_GPI14 0x40
299#define DA9063_GPI15 0x80
300
301/* DA9063_REG_STATUS_D (addr=0x04) */
302#define DA9063_LDO3_LIM 0x08
303#define DA9063_LDO4_LIM 0x10
304#define DA9063_LDO7_LIM 0x20
305#define DA9063_LDO8_LIM 0x40
306#define DA9063_LDO11_LIM 0x80
307
308/* DA9063_REG_FAULT_LOG (addr=0x05) */
309#define DA9063_TWD_ERROR 0x01
310#define DA9063_POR 0x02
311#define DA9063_VDD_FAULT 0x04
312#define DA9063_VDD_START 0x08
313#define DA9063_TEMP_CRIT 0x10
314#define DA9063_KEY_RESET 0x20
315#define DA9063_NSHUTDOWN 0x40
316#define DA9063_WAIT_SHUT 0x80
317
318/* DA9063_REG_EVENT_A (addr=0x06) */
319#define DA9063_E_NONKEY 0x01
320#define DA9063_E_ALARM 0x02
321#define DA9063_E_TICK 0x04
322#define DA9063_E_ADC_RDY 0x08
323#define DA9063_E_SEQ_RDY 0x10
324#define DA9063_EVENTS_B 0x20
325#define DA9063_EVENTS_C 0x40
326#define DA9063_EVENTS_D 0x80
327
328/* DA9063_REG_EVENT_B (addr=0x07) */
329#define DA9063_E_WAKE 0x01
330#define DA9063_E_TEMP 0x02
331#define DA9063_E_COMP_1V2 0x04
332#define DA9063_E_LDO_LIM 0x08
333#define DA9063_E_REG_UVOV 0x10
334#define DA9063_E_DVC_RDY 0x20
335#define DA9063_E_VDD_MON 0x40
336#define DA9063_E_VDD_WARN 0x80
337
338/* DA9063_REG_EVENT_C (addr=0x08) */
339#define DA9063_E_GPI0 0x01
340#define DA9063_E_GPI1 0x02
341#define DA9063_E_GPI2 0x04
342#define DA9063_E_GPI3 0x08
343#define DA9063_E_GPI4 0x10
344#define DA9063_E_GPI5 0x20
345#define DA9063_E_GPI6 0x40
346#define DA9063_E_GPI7 0x80
347
348/* DA9063_REG_EVENT_D (addr=0x09) */
349#define DA9063_E_GPI8 0x01
350#define DA9063_E_GPI9 0x02
351#define DA9063_E_GPI10 0x04
352#define DA9063_E_GPI11 0x08
353#define DA9063_E_GPI12 0x10
354#define DA9063_E_GPI13 0x20
355#define DA9063_E_GPI14 0x40
356#define DA9063_E_GPI15 0x80
357
358/* DA9063_REG_IRQ_MASK_A (addr=0x0A) */
359#define DA9063_M_ONKEY 0x01
360#define DA9063_M_ALARM 0x02
361#define DA9063_M_TICK 0x04
362#define DA9063_M_ADC_RDY 0x08
363#define DA9063_M_SEQ_RDY 0x10
364
365/* DA9063_REG_IRQ_MASK_B (addr=0x0B) */
366#define DA9063_M_WAKE 0x01
367#define DA9063_M_TEMP 0x02
368#define DA9063_M_COMP_1V2 0x04
369#define DA9063_M_LDO_LIM 0x08
370#define DA9063_M_UVOV 0x10
371#define DA9063_M_DVC_RDY 0x20
372#define DA9063_M_VDD_MON 0x40
373#define DA9063_M_VDD_WARN 0x80
374
375/* DA9063_REG_IRQ_MASK_C (addr=0x0C) */
376#define DA9063_M_GPI0 0x01
377#define DA9063_M_GPI1 0x02
378#define DA9063_M_GPI2 0x04
379#define DA9063_M_GPI3 0x08
380#define DA9063_M_GPI4 0x10
381#define DA9063_M_GPI5 0x20
382#define DA9063_M_GPI6 0x40
383#define DA9063_M_GPI7 0x80
384
385/* DA9063_REG_IRQ_MASK_D (addr=0x0D) */
386#define DA9063_M_GPI8 0x01
387#define DA9063_M_GPI9 0x02
388#define DA9063_M_GPI10 0x04
389#define DA9063_M_GPI11 0x08
390#define DA9063_M_GPI12 0x10
391#define DA9063_M_GPI13 0x20
392#define DA9063_M_GPI14 0x40
393#define DA9063_M_GPI15 0x80
394
395/* DA9063_REG_CONTROL_A (addr=0x0E) */
396#define DA9063_SYSTEM_EN 0x01
397#define DA9063_POWER_EN 0x02
398#define DA9063_POWER1_EN 0x04
399#define DA9063_STANDBY 0x08
400#define DA9063_M_SYSTEM_EN 0x10
401#define DA9063_M_POWER_EN 0x20
402#define DA9063_M_POWER1_EN 0x40
403#define DA9063_CP_EN 0x80
404
405/* DA9063_REG_CONTROL_B (addr=0x0F) */
406#define DA9063_CHG_SEL 0x01
407#define DA9063_WATCHDOG_PD 0x02
408#define DA9063_NRES_MODE 0x08
409#define DA9063_NONKEY_LOCK 0x10
410
411/* DA9063_REG_CONTROL_C (addr=0x10) */
412#define DA9063_DEBOUNCING_MASK 0x07
413#define DA9063_DEBOUNCING_OFF 0x0
414#define DA9063_DEBOUNCING_0MS1 0x1
415#define DA9063_DEBOUNCING_1MS 0x2
416#define DA9063_DEBOUNCING_10MS24 0x3
417#define DA9063_DEBOUNCING_51MS2 0x4
418#define DA9063_DEBOUNCING_256MS 0x5
419#define DA9063_DEBOUNCING_512MS 0x6
420#define DA9063_DEBOUNCING_1024MS 0x7
421
422#define DA9063_AUTO_BOOT 0x08
423#define DA9063_OTPREAD_EN 0x10
424#define DA9063_SLEW_RATE_MASK 0x60
425#define DA9063_SLEW_RATE_4US 0x00
426#define DA9063_SLEW_RATE_3US 0x20
427#define DA9063_SLEW_RATE_1US 0x40
428#define DA9063_SLEW_RATE_0US5 0x60
429#define DA9063_DEF_SUPPLY 0x80
430
431/* DA9063_REG_CONTROL_D (addr=0x11) */
432#define DA9063_TWDSCALE_MASK 0x07
433#define DA9063_BLINK_FRQ_MASK 0x38
434#define DA9063_BLINK_FRQ_OFF 0x00
435#define DA9063_BLINK_FRQ_1S0 0x08
436#define DA9063_BLINK_FRQ_2S0 0x10
437#define DA9063_BLINK_FRQ_4S0 0x18
438#define DA9063_BLINK_FRQ_0S18 0x20
439#define DA9063_BLINK_FRQ_2S0_VDD 0x28
440#define DA9063_BLINK_FRQ_4S0_VDD 0x30
441#define DA9063_BLINK_FRQ_0S18_VDD 0x38
442
443#define DA9063_BLINK_DUR_MASK 0xC0
444#define DA9063_BLINK_DUR_10MS 0x00
445#define DA9063_BLINK_DUR_20MS 0x40
446#define DA9063_BLINK_DUR_40MS 0x80
447#define DA9063_BLINK_DUR_20MSDBL 0xC0
448
449/* DA9063_REG_CONTROL_E (addr=0x12) */
450#define DA9063_RTC_MODE_PD 0x01
451#define DA9063_RTC_MODE_SD 0x02
452#define DA9063_RTC_EN 0x04
453#define DA9063_ECO_MODE 0x08
454#define DA9063_PM_FB1_PIN 0x10
455#define DA9063_PM_FB2_PIN 0x20
456#define DA9063_PM_FB3_PIN 0x40
457#define DA9063_V_LOCK 0x80
458
459/* DA9063_REG_CONTROL_F (addr=0x13) */
460#define DA9063_WATCHDOG 0x01
461#define DA9063_SHUTDOWN 0x02
462#define DA9063_WAKE_UP 0x04
463
464/* DA9063_REG_PD_DIS (addr=0x14) */
465#define DA9063_GPI_DIS 0x01
466#define DA9063_GPADC_PAUSE 0x02
467#define DA9063_PMIF_DIS 0x04
468#define DA9063_HS2WIRE_DIS 0x08
469#define DA9063_BBAT_DIS 0x20
470#define DA9063_OUT_32K_PAUSE 0x40
471#define DA9063_PMCONT_DIS 0x80
472
473/* DA9063_REG_GPIO_0_1 (addr=0x15) */
474#define DA9063_GPIO0_PIN_MASK 0x03
475#define DA9063_GPIO0_PIN_ADCIN1 0x00
476#define DA9063_GPIO0_PIN_GPI 0x01
477#define DA9063_GPIO0_PIN_GPO_OD 0x02
478#define DA9063_GPIO0_PIN_GPO 0x03
479#define DA9063_GPIO0_TYPE 0x04
480#define DA9063_GPIO0_TYPE_GPI_ACT_LOW 0x00
481#define DA9063_GPIO0_TYPE_GPO_VDD_IO1 0x00
482#define DA9063_GPIO0_TYPE_GPI_ACT_HIGH 0x04
483#define DA9063_GPIO0_TYPE_GPO_VDD_IO2 0x04
484#define DA9063_GPIO0_NO_WAKEUP 0x08
485#define DA9063_GPIO1_PIN_MASK 0x30
486#define DA9063_GPIO1_PIN_ADCIN2_COMP 0x00
487#define DA9063_GPIO1_PIN_GPI 0x10
488#define DA9063_GPIO1_PIN_GPO_OD 0x20
489#define DA9063_GPIO1_PIN_GPO 0x30
490#define DA9063_GPIO1_TYPE 0x40
491#define DA9063_GPIO1_TYPE_GPI_ACT_LOW 0x00
492#define DA9063_GPIO1_TYPE_GPO_VDD_IO1 0x00
493#define DA9063_GPIO1_TYPE_GPI_ACT_HIGH 0x04
494#define DA9063_GPIO1_TYPE_GPO_VDD_IO2 0x04
495#define DA9063_GPIO1_NO_WAKEUP 0x80
496
497/* DA9063_REG_GPIO_2_3 (addr=0x16) */
498#define DA9063_GPIO2_PIN_MASK 0x03
499#define DA9063_GPIO2_PIN_ADCIN3 0x00
500#define DA9063_GPIO2_PIN_GPI 0x01
501#define DA9063_GPIO2_PIN_GPO_PSS 0x02
502#define DA9063_GPIO2_PIN_GPO 0x03
503#define DA9063_GPIO2_TYPE 0x04
504#define DA9063_GPIO2_TYPE_GPI_ACT_LOW 0x00
505#define DA9063_GPIO2_TYPE_GPO_VDD_IO1 0x00
506#define DA9063_GPIO2_TYPE_GPI_ACT_HIGH 0x04
507#define DA9063_GPIO2_TYPE_GPO_VDD_IO2 0x04
508#define DA9063_GPIO2_NO_WAKEUP 0x08
509#define DA9063_GPIO3_PIN_MASK 0x30
510#define DA9063_GPIO3_PIN_CORE_SW_G 0x00
511#define DA9063_GPIO3_PIN_GPI 0x10
512#define DA9063_GPIO3_PIN_GPO_OD 0x20
513#define DA9063_GPIO3_PIN_GPO 0x30
514#define DA9063_GPIO3_TYPE 0x40
515#define DA9063_GPIO3_TYPE_GPI_ACT_LOW 0x00
516#define DA9063_GPIO3_TYPE_GPO_VDD_IO1 0x00
517#define DA9063_GPIO3_TYPE_GPI_ACT_HIGH 0x04
518#define DA9063_GPIO3_TYPE_GPO_VDD_IO2 0x04
519#define DA9063_GPIO3_NO_WAKEUP 0x80
520
521/* DA9063_REG_GPIO_4_5 (addr=0x17) */
522#define DA9063_GPIO4_PIN_MASK 0x03
523#define DA9063_GPIO4_PIN_CORE_SW_S 0x00
524#define DA9063_GPIO4_PIN_GPI 0x01
525#define DA9063_GPIO4_PIN_GPO_OD 0x02
526#define DA9063_GPIO4_PIN_GPO 0x03
527#define DA9063_GPIO4_TYPE 0x04
528#define DA9063_GPIO4_TYPE_GPI_ACT_LOW 0x00
529#define DA9063_GPIO4_TYPE_GPO_VDD_IO1 0x00
530#define DA9063_GPIO4_TYPE_GPI_ACT_HIGH 0x04
531#define DA9063_GPIO4_TYPE_GPO_VDD_IO2 0x04
532#define DA9063_GPIO4_NO_WAKEUP 0x08
533#define DA9063_GPIO5_PIN_MASK 0x30
534#define DA9063_GPIO5_PIN_PERI_SW_G 0x00
535#define DA9063_GPIO5_PIN_GPI 0x10
536#define DA9063_GPIO5_PIN_GPO_OD 0x20
537#define DA9063_GPIO5_PIN_GPO 0x30
538#define DA9063_GPIO5_TYPE 0x40
539#define DA9063_GPIO5_TYPE_GPI_ACT_LOW 0x00
540#define DA9063_GPIO5_TYPE_GPO_VDD_IO1 0x00
541#define DA9063_GPIO5_TYPE_GPI_ACT_HIGH 0x04
542#define DA9063_GPIO5_TYPE_GPO_VDD_IO2 0x04
543#define DA9063_GPIO5_NO_WAKEUP 0x80
544
545/* DA9063_REG_GPIO_6_7 (addr=0x18) */
546#define DA9063_GPIO6_PIN_MASK 0x03
547#define DA9063_GPIO6_PIN_PERI_SW_S 0x00
548#define DA9063_GPIO6_PIN_GPI 0x01
549#define DA9063_GPIO6_PIN_GPO_OD 0x02
550#define DA9063_GPIO6_PIN_GPO 0x03
551#define DA9063_GPIO6_TYPE 0x04
552#define DA9063_GPIO6_TYPE_GPI_ACT_LOW 0x00
553#define DA9063_GPIO6_TYPE_GPO_VDD_IO1 0x00
554#define DA9063_GPIO6_TYPE_GPI_ACT_HIGH 0x04
555#define DA9063_GPIO6_TYPE_GPO_VDD_IO2 0x04
556#define DA9063_GPIO6_NO_WAKEUP 0x08
557#define DA9063_GPIO7_PIN_MASK 0x30
558#define DA9063_GPIO7_PIN_GPI 0x10
559#define DA9063_GPIO7_PIN_GPO_PSS 0x20
560#define DA9063_GPIO7_PIN_GPO 0x30
561#define DA9063_GPIO7_TYPE 0x40
562#define DA9063_GPIO7_TYPE_GPI_ACT_LOW 0x00
563#define DA9063_GPIO7_TYPE_GPO_VDD_IO1 0x00
564#define DA9063_GPIO7_TYPE_GPI_ACT_HIGH 0x04
565#define DA9063_GPIO7_TYPE_GPO_VDD_IO2 0x04
566#define DA9063_GPIO7_NO_WAKEUP 0x80
567
568/* DA9063_REG_GPIO_8_9 (addr=0x19) */
569#define DA9063_GPIO8_PIN_MASK 0x03
570#define DA9063_GPIO8_PIN_GPI_SYS_EN 0x00
571#define DA9063_GPIO8_PIN_GPI 0x01
572#define DA9063_GPIO8_PIN_GPO_PSS 0x02
573#define DA9063_GPIO8_PIN_GPO 0x03
574#define DA9063_GPIO8_TYPE 0x04
575#define DA9063_GPIO8_TYPE_GPI_ACT_LOW 0x00
576#define DA9063_GPIO8_TYPE_GPO_VDD_IO1 0x00
577#define DA9063_GPIO8_TYPE_GPI_ACT_HIGH 0x04
578#define DA9063_GPIO8_TYPE_GPO_VDD_IO2 0x04
579#define DA9063_GPIO8_NO_WAKEUP 0x08
580#define DA9063_GPIO9_PIN_MASK 0x30
581#define DA9063_GPIO9_PIN_GPI_PWR_EN 0x00
582#define DA9063_GPIO9_PIN_GPI 0x10
583#define DA9063_GPIO9_PIN_GPO_PSS 0x20
584#define DA9063_GPIO9_PIN_GPO 0x30
585#define DA9063_GPIO9_TYPE 0x40
586#define DA9063_GPIO9_TYPE_GPI_ACT_LOW 0x00
587#define DA9063_GPIO9_TYPE_GPO_VDD_IO1 0x00
588#define DA9063_GPIO9_TYPE_GPI_ACT_HIGH 0x04
589#define DA9063_GPIO9_TYPE_GPO_VDD_IO2 0x04
590#define DA9063_GPIO9_NO_WAKEUP 0x80
591
592/* DA9063_REG_GPIO_10_11 (addr=0x1A) */
593#define DA9063_GPIO10_PIN_MASK 0x03
594#define DA9063_GPIO10_PIN_GPI_PWR1_EN 0x00
595#define DA9063_GPIO10_PIN_GPI 0x01
596#define DA9063_GPIO10_PIN_GPO_OD 0x02
597#define DA9063_GPIO10_PIN_GPO 0x03
598#define DA9063_GPIO10_TYPE 0x04
599#define DA9063_GPIO10_TYPE_GPI_ACT_LOW 0x00
600#define DA9063_GPIO10_TYPE_GPO_VDD_IO1 0x00
601#define DA9063_GPIO10_TYPE_GPI_ACT_HIGH 0x04
602#define DA9063_GPIO10_TYPE_GPO_VDD_IO2 0x04
603#define DA9063_GPIO10_NO_WAKEUP 0x08
604#define DA9063_GPIO11_PIN_MASK 0x30
605#define DA9063_GPIO11_PIN_GPO_OD 0x00
606#define DA9063_GPIO11_PIN_GPI 0x10
607#define DA9063_GPIO11_PIN_GPO_PSS 0x20
608#define DA9063_GPIO11_PIN_GPO 0x30
609#define DA9063_GPIO11_TYPE 0x40
610#define DA9063_GPIO11_TYPE_GPI_ACT_LOW 0x00
611#define DA9063_GPIO11_TYPE_GPO_VDD_IO1 0x00
612#define DA9063_GPIO11_TYPE_GPI_ACT_HIGH 0x04
613#define DA9063_GPIO11_TYPE_GPO_VDD_IO2 0x04
614#define DA9063_GPIO11_NO_WAKEUP 0x80
615
616/* DA9063_REG_GPIO_12_13 (addr=0x1B) */
617#define DA9063_GPIO12_PIN_MASK 0x03
618#define DA9063_GPIO12_PIN_NVDDFLT_OUT 0x00
619#define DA9063_GPIO12_PIN_GPI 0x01
620#define DA9063_GPIO12_PIN_VSYSMON_OUT 0x02
621#define DA9063_GPIO12_PIN_GPO 0x03
622#define DA9063_GPIO12_TYPE 0x04
623#define DA9063_GPIO12_TYPE_GPI_ACT_LOW 0x00
624#define DA9063_GPIO12_TYPE_GPO_VDD_IO1 0x00
625#define DA9063_GPIO12_TYPE_GPI_ACT_HIGH 0x04
626#define DA9063_GPIO12_TYPE_GPO_VDD_IO2 0x04
627#define DA9063_GPIO12_NO_WAKEUP 0x08
628#define DA9063_GPIO13_PIN_MASK 0x30
629#define DA9063_GPIO13_PIN_GPFB1_OUT 0x00
630#define DA9063_GPIO13_PIN_GPI 0x10
631#define DA9063_GPIO13_PIN_GPFB1_OUTOD 0x20
632#define DA9063_GPIO13_PIN_GPO 0x30
633#define DA9063_GPIO13_TYPE 0x40
634#define DA9063_GPIO13_TYPE_GPFB1_OUT 0x00
635#define DA9063_GPIO13_TYPE_GPI 0x00
636#define DA9063_GPIO13_TYPE_GPFB1_OUTOD 0x04
637#define DA9063_GPIO13_TYPE_GPO 0x04
638#define DA9063_GPIO13_NO_WAKEUP 0x80
639
640/* DA9063_REG_GPIO_14_15 (addr=0x1C) */
641#define DA9063_GPIO14_PIN_MASK 0x03
642#define DA9063_GPIO14_PIN_GPO_OD 0x00
643#define DA9063_GPIO14_PIN_GPI 0x01
644#define DA9063_GPIO14_PIN_HS2DATA 0x02
645#define DA9063_GPIO14_PIN_GPO 0x03
646#define DA9063_GPIO14_TYPE 0x04
647#define DA9063_GPIO14_TYPE_GPI_ACT_LOW 0x00
648#define DA9063_GPIO14_TYPE_GPO_VDD_IO1 0x00
649#define DA9063_GPIO14_TYPE_GPI_ACT_HIGH 0x04
650#define DA9063_GPIO14_TYPE_GPO_VDD_IO2 0x04
651#define DA9063_GPIO14_NO_WAKEUP 0x08
652#define DA9063_GPIO15_PIN_MASK 0x30
653#define DA9063_GPIO15_PIN_GPO_OD 0x00
654#define DA9063_GPIO15_PIN_GPI 0x10
655#define DA9063_GPIO15_PIN_GPO 0x30
656#define DA9063_GPIO15_TYPE 0x40
657#define DA9063_GPIO15_TYPE_GPFB1_OUT 0x00
658#define DA9063_GPIO15_TYPE_GPI 0x00
659#define DA9063_GPIO15_TYPE_GPFB1_OUTOD 0x04
660#define DA9063_GPIO15_TYPE_GPO 0x04
661#define DA9063_GPIO15_NO_WAKEUP 0x80
662
663/* DA9063_REG_GPIO_MODE_0_7 (addr=0x1D) */
664#define DA9063_GPIO0_MODE 0x01
665#define DA9063_GPIO1_MODE 0x02
666#define DA9063_GPIO2_MODE 0x04
667#define DA9063_GPIO3_MODE 0x08
668#define DA9063_GPIO4_MODE 0x10
669#define DA9063_GPIO5_MODE 0x20
670#define DA9063_GPIO6_MODE 0x40
671#define DA9063_GPIO7_MODE 0x80
672
673/* DA9063_REG_GPIO_MODE_8_15 (addr=0x1E) */
674#define DA9063_GPIO8_MODE 0x01
675#define DA9063_GPIO9_MODE 0x02
676#define DA9063_GPIO10_MODE 0x04
677#define DA9063_GPIO11_MODE 0x08
678#define DA9063_GPIO11_MODE_LED_ACT_HIGH 0x00
679#define DA9063_GPIO11_MODE_LED_ACT_LOW 0x08
680#define DA9063_GPIO12_MODE 0x10
681#define DA9063_GPIO13_MODE 0x20
682#define DA9063_GPIO14_MODE 0x40
683#define DA9063_GPIO14_MODE_LED_ACT_HIGH 0x00
684#define DA9063_GPIO14_MODE_LED_ACT_LOW 0x40
685#define DA9063_GPIO15_MODE 0x80
686#define DA9063_GPIO15_MODE_LED_ACT_HIGH 0x00
687#define DA9063_GPIO15_MODE_LED_ACT_LOW 0x80
688
689/* DA9063_REG_SWITCH_CONT (addr=0x1F) */
690#define DA9063_CORE_SW_GPI_MASK 0x03
691#define DA9063_CORE_SW_GPI_OFF 0x00
692#define DA9063_CORE_SW_GPI_GPIO1 0x01
693#define DA9063_CORE_SW_GPI_GPIO2 0x02
694#define DA9063_CORE_SW_GPI_GPIO13 0x03
695#define DA9063_PERI_SW_GPI_MASK 0x0C
696#define DA9063_PERI_SW_GPI_OFF 0x00
697#define DA9063_PERI_SW_GPI_GPIO1 0x04
698#define DA9063_PERI_SW_GPI_GPIO2 0x08
699#define DA9063_PERI_SW_GPI_GPIO13 0x0C
700#define DA9063_SWITCH_SR_MASK 0x30
701#define DA9063_SWITCH_SR_1MV 0x00
702#define DA9063_SWITCH_SR_5MV 0x10
703#define DA9063_SWITCH_SR_10MV 0x20
704#define DA9063_SWITCH_SR_50MV 0x30
705#define DA9063_SWITCH_SR_DIS 0x40
706#define DA9063_CP_EN_MODE 0x80
707
708/* DA9063_REGL_Bxxxx_CONT common bits (addr=0x20-0x25) */
709#define DA9063_BUCK_EN 0x01
710#define DA9063_BUCK_GPI_MASK 0x06
711#define DA9063_BUCK_GPI_OFF 0x00
712#define DA9063_BUCK_GPI_GPIO1 0x02
713#define DA9063_BUCK_GPI_GPIO2 0x04
714#define DA9063_BUCK_GPI_GPIO13 0x06
715#define DA9063_BUCK_CONF 0x08
716#define DA9063_VBUCK_GPI_MASK 0x60
717#define DA9063_VBUCK_GPI_OFF 0x00
718#define DA9063_VBUCK_GPI_GPIO1 0x20
719#define DA9063_VBUCK_GPI_GPIO2 0x40
720#define DA9063_VBUCK_GPI_GPIO13 0x60
721
722/* DA9063_REG_BCORE1_CONT specific bits (addr=0x21) */
723#define DA9063_CORE_SW_EN 0x10
724#define DA9063_CORE_SW_CONF 0x80
725
726/* DA9063_REG_BPERI_CONT specific bits (addr=0x25) */
727#define DA9063_PERI_SW_EN 0x10
728#define DA9063_PERI_SW_CONF 0x80
729
730/* DA9063_REG_LDOx_CONT common bits (addr=0x26-0x30) */
731#define DA9063_LDO_EN 0x01
732#define DA9063_LDO_GPI_MASK 0x06
733#define DA9063_LDO_GPI_OFF 0x00
734#define DA9063_LDO_GPI_GPIO1 0x02
735#define DA9063_LDO_GPI_GPIO2 0x04
736#define DA9063_LDO_GPI_GPIO13 0x06
737#define DA9063_LDO_PD_DIS 0x08
738#define DA9063_VLDO_GPI_MASK 0x60
739#define DA9063_VLDO_GPI_OFF 0x00
740#define DA9063_VLDO_GPI_GPIO1 0x20
741#define DA9063_VLDO_GPI_GPIO2 0x40
742#define DA9063_VLDO_GPI_GPIO13 0x60
743#define DA9063_LDO_CONF 0x80
744
745/* DA9063_REG_LDO5_CONT specific bits (addr=0x2A) */
746#define DA9063_VLDO5_SEL 0x10
747
748/* DA9063_REG_LDO6_CONT specific bits (addr=0x2B) */
749#define DA9063_VLDO6_SEL 0x10
750
751/* DA9063_REG_LDO7_CONT specific bits (addr=0x2C) */
752#define DA9063_VLDO7_SEL 0x10
753
754/* DA9063_REG_LDO8_CONT specific bits (addr=0x2D) */
755#define DA9063_VLDO8_SEL 0x10
756
757/* DA9063_REG_LDO9_CONT specific bits (addr=0x2E) */
758#define DA9063_VLDO9_SEL 0x10
759
760/* DA9063_REG_LDO10_CONT specific bits (addr=0x2F) */
761#define DA9063_VLDO10_SEL 0x10
762
763/* DA9063_REG_LDO11_CONT specific bits (addr=0x30) */
764#define DA9063_VLDO11_SEL 0x10
765
766/* DA9063_REG_VIB (addr=0x31) */
767#define DA9063_VIB_SET_MASK 0x3F
768#define DA9063_VIB_SET_OFF 0
769#define DA9063_VIB_SET_MAX 0x3F
770
771/* DA9063_REG_DVC_1 (addr=0x32) */
772#define DA9063_VBCORE1_SEL 0x01
773#define DA9063_VBCORE2_SEL 0x02
774#define DA9063_VBPRO_SEL 0x04
775#define DA9063_VBMEM_SEL 0x08
776#define DA9063_VBPERI_SEL 0x10
777#define DA9063_VLDO1_SEL 0x20
778#define DA9063_VLDO2_SEL 0x40
779#define DA9063_VLDO3_SEL 0x80
780
781/* DA9063_REG_DVC_2 (addr=0x33) */
782#define DA9063_VBIO_SEL 0x01
783#define DA9063_VLDO4_SEL 0x80
784
785/* DA9063_REG_ADC_MAN (addr=0x34) */
786#define DA9063_ADC_MUX_MASK 0x0F
787#define DA9063_ADC_MUX_VSYS 0x00
788#define DA9063_ADC_MUX_ADCIN1 0x01
789#define DA9063_ADC_MUX_ADCIN2 0x02
790#define DA9063_ADC_MUX_ADCIN3 0x03
791#define DA9063_ADC_MUX_T_SENSE 0x04
792#define DA9063_ADC_MUX_VBBAT 0x05
793#define DA9063_ADC_MUX_LDO_G1 0x08
794#define DA9063_ADC_MUX_LDO_G2 0x09
795#define DA9063_ADC_MUX_LDO_G3 0x0A
796#define DA9063_ADC_MAN 0x10
797#define DA9063_ADC_MODE 0x20
798
799/* DA9063_REG_ADC_CONT (addr=0x35) */
800#define DA9063_ADC_AUTO_VSYS_EN 0x01
801#define DA9063_ADC_AUTO_AD1_EN 0x02
802#define DA9063_ADC_AUTO_AD2_EN 0x04
803#define DA9063_ADC_AUTO_AD3_EN 0x08
804#define DA9063_ADC_AD1_ISRC_EN 0x10
805#define DA9063_ADC_AD2_ISRC_EN 0x20
806#define DA9063_ADC_AD3_ISRC_EN 0x40
807#define DA9063_COMP1V2_EN 0x80
808
809/* DA9063_REG_VSYS_MON (addr=0x36) */
810#define DA9063_VSYS_VAL_MASK 0xFF
811#define DA9063_VSYS_VAL_BASE 0x00
812
813/* DA9063_REG_ADC_RES_L (addr=0x37) */
814#define DA9063_ADC_RES_L_BITS 2
815#define DA9063_ADC_RES_L_MASK 0xC0
816
817/* DA9063_REG_ADC_RES_H (addr=0x38) */
818#define DA9063_ADC_RES_M_BITS 8
819#define DA9063_ADC_RES_M_MASK 0xFF
820
821/* DA9063_REG_(xxx_RES/ADC_RES_H) (addr=0x39-0x3F) */
822#define DA9063_ADC_VAL_MASK 0xFF
823
824/* DA9063_REG_COUNT_S (addr=0x40) */
825#define DA9063_RTC_READ 0x80
826#define DA9063_COUNT_SEC_MASK 0x3F
827
828/* DA9063_REG_COUNT_MI (addr=0x41) */
829#define DA9063_COUNT_MIN_MASK 0x3F
830
831/* DA9063_REG_COUNT_H (addr=0x42) */
832#define DA9063_COUNT_HOUR_MASK 0x1F
833
834/* DA9063_REG_COUNT_D (addr=0x43) */
835#define DA9063_COUNT_DAY_MASK 0x1F
836
837/* DA9063_REG_COUNT_MO (addr=0x44) */
838#define DA9063_COUNT_MONTH_MASK 0x0F
839
840/* DA9063_REG_COUNT_Y (addr=0x45) */
841#define DA9063_COUNT_YEAR_MASK 0x3F
842#define DA9063_MONITOR 0x40
843
844/* DA9063_REG_ALARM_MI (addr=0x46) */
845#define DA9063_ALARM_STATUS_ALARM 0x80
846#define DA9063_ALARM_STATUS_TICK 0x40
847#define DA9063_ALARM_MIN_MASK 0x3F
848
849/* DA9063_REG_ALARM_H (addr=0x47) */
850#define DA9063_ALARM_HOUR_MASK 0x1F
851
852/* DA9063_REG_ALARM_D (addr=0x48) */
853#define DA9063_ALARM_DAY_MASK 0x1F
854
855/* DA9063_REG_ALARM_MO (addr=0x49) */
856#define DA9063_TICK_WAKE 0x20
857#define DA9063_TICK_TYPE 0x10
858#define DA9063_TICK_TYPE_SEC 0x00
859#define DA9063_TICK_TYPE_MIN 0x10
860#define DA9063_ALARM_MONTH_MASK 0x0F
861
862/* DA9063_REG_ALARM_Y (addr=0x4A) */
863#define DA9063_TICK_ON 0x80
864#define DA9063_ALARM_ON 0x40
865#define DA9063_ALARM_YEAR_MASK 0x3F
866
867/* DA9063_REG_WAIT (addr=0x97)*/
868#define DA9063_REG_WAIT_TIME_MASK 0xF
869#define DA9063_WAIT_TIME_0_US 0x0
870#define DA9063_WAIT_TIME_512_US 0x1
871#define DA9063_WAIT_TIME_1_MS 0x2
872#define DA9063_WAIT_TIME_2_MS 0x3
873#define DA9063_WAIT_TIME_4_1_MS 0x4
874#define DA9063_WAIT_TIME_8_2_MS 0x5
875#define DA9063_WAIT_TIME_16_4_MS 0x6
876#define DA9063_WAIT_TIME_32_8_MS 0x7
877#define DA9063_WAIT_TIME_65_5_MS 0x8
878#define DA9063_WAIT_TIME_128_MS 0x9
879#define DA9063_WAIT_TIME_256_MS 0xA
880#define DA9063_WAIT_TIME_512_MS 0xB
881#define DA9063_WAIT_TIME_1_S 0xC
882#define DA9063_WAIT_TIME_2_1_S 0xD
883
884/* DA9063_REG_EN_32K (addr=0x98)*/
885#define DA9063_STABILIZ_TIME_MASK 0x7
886#define DA9063_CRYSTAL 0x08
887#define DA9063_DELAY_MODE 0x10
888#define DA9063_OUT_CLOCK 0x20
889#define DA9063_RTC_CLOCK 0x40
890#define DA9063_OUT_32K_EN 0x80
891
892/* DA9063_REG_CHIP_VARIANT */
893#define DA9063_CHIP_VARIANT_SHIFT 4
894
895/* DA9063_REG_BUCK_ILIM_A (addr=0x9A) */
896#define DA9063_BIO_ILIM_MASK 0x0F
897#define DA9063_BMEM_ILIM_MASK 0xF0
898
899/* DA9063_REG_BUCK_ILIM_B (addr=0x9B) */
900#define DA9063_BPRO_ILIM_MASK 0x0F
901#define DA9063_BPERI_ILIM_MASK 0xF0
902
903/* DA9063_REG_BUCK_ILIM_C (addr=0x9C) */
904#define DA9063_BCORE1_ILIM_MASK 0x0F
905#define DA9063_BCORE2_ILIM_MASK 0xF0
906
907/* DA9063_REG_Bxxxx_CFG common bits (addr=0x9D-0xA2) */
908#define DA9063_BUCK_FB_MASK 0x07
909#define DA9063_BUCK_PD_DIS_SHIFT 5
910#define DA9063_BUCK_MODE_MASK 0xC0
911#define DA9063_BUCK_MODE_MANUAL 0x00
912#define DA9063_BUCK_MODE_SLEEP 0x40
913#define DA9063_BUCK_MODE_SYNC 0x80
914#define DA9063_BUCK_MODE_AUTO 0xC0
915
916/* DA9063_REG_BPRO_CFG (addr=0x9F) */
917#define DA9063_BPRO_VTTR_EN 0x08
918#define DA9063_BPRO_VTT_EN 0x10
919
920/* DA9063_REG_VBxxxx_A/B (addr=0xA3-0xA8, 0xB4-0xB9) */
921#define DA9063_VBUCK_MASK 0x7F
922#define DA9063_VBUCK_BIAS 0
923#define DA9063_BUCK_SL 0x80
924
925/* DA9063_REG_VLDOx_A/B (addr=0xA9-0x3, 0xBA-0xC4) */
926#define DA9063_LDO_SL 0x80
927
928/* DA9063_REG_VLDO1_A/B (addr=0xA9, 0xBA) */
929#define DA9063_VLDO1_MASK 0x3F
930#define DA9063_VLDO1_BIAS 0
931
932/* DA9063_REG_VLDO2_A/B (addr=0xAA, 0xBB) */
933#define DA9063_VLDO2_MASK 0x3F
934#define DA9063_VLDO2_BIAS 0
935
936/* DA9063_REG_VLDO3_A/B (addr=0xAB, 0xBC) */
937#define DA9063_VLDO3_MASK 0x7F
938#define DA9063_VLDO3_BIAS 0
939
940/* DA9063_REG_VLDO4_A/B (addr=0xAC, 0xBD) */
941#define DA9063_VLDO4_MASK 0x7F
942#define DA9063_VLDO4_BIAS 0
943
944/* DA9063_REG_VLDO5_A/B (addr=0xAD, 0xBE) */
945#define DA9063_VLDO5_MASK 0x3F
946#define DA9063_VLDO5_BIAS 2
947
948/* DA9063_REG_VLDO6_A/B (addr=0xAE, 0xBF) */
949#define DA9063_VLDO6_MASK 0x3F
950#define DA9063_VLDO6_BIAS 2
951
952/* DA9063_REG_VLDO7_A/B (addr=0xAF, 0xC0) */
953#define DA9063_VLDO7_MASK 0x3F
954#define DA9063_VLDO7_BIAS 2
955
956/* DA9063_REG_VLDO8_A/B (addr=0xB0, 0xC1) */
957#define DA9063_VLDO8_MASK 0x3F
958#define DA9063_VLDO8_BIAS 2
959
960/* DA9063_REG_VLDO9_A/B (addr=0xB1, 0xC2) */
961#define DA9063_VLDO9_MASK 0x3F
962#define DA9063_VLDO9_BIAS 3
963
964/* DA9063_REG_VLDO10_A/B (addr=0xB2, 0xC3) */
965#define DA9063_VLDO10_MASK 0x3F
966#define DA9063_VLDO10_BIAS 2
967
968/* DA9063_REG_VLDO11_A/B (addr=0xB3, 0xC4) */
969#define DA9063_VLDO11_MASK 0x3F
970#define DA9063_VLDO11_BIAS 2
971
972/* DA9063_REG_GPO11_LED (addr=0xC6) */
973/* DA9063_REG_GPO14_LED (addr=0xC7) */
974/* DA9063_REG_GPO15_LED (addr=0xC8) */
975#define DA9063_GPIO_DIM 0x80
976#define DA9063_GPIO_PWM_MASK 0x7F
977
978/* DA9063_REG_CONFIG_H (addr=0x10D) */
979#define DA9063_PWM_CLK_MASK 0x01
980#define DA9063_PWM_CLK_PWM2MHZ 0x00
981#define DA9063_PWM_CLK_PWM1MHZ 0x01
982#define DA9063_LDO8_MODE_MASK 0x02
983#define DA9063_LDO8_MODE_LDO 0
984#define DA9063_LDO8_MODE_VIBR 0x02
985#define DA9063_MERGE_SENSE_MASK 0x04
986#define DA9063_MERGE_SENSE_GP_FB2 0x00
987#define DA9063_MERGE_SENSE_GPIO4 0x04
988#define DA9063_BCORE_MERGE 0x08
989#define DA9063_BPRO_OD 0x10
990#define DA9063_BCORE2_OD 0x20
991#define DA9063_BCORE1_OD 0x40
992#define DA9063_BUCK_MERGE 0x80
993
994/* DA9063_REG_CONFIG_I (addr=0x10E) */
995#define DA9063_NONKEY_PIN_MASK 0x03
996#define DA9063_NONKEY_PIN_PORT 0x00
997#define DA9063_NONKEY_PIN_SWDOWN 0x01
998#define DA9063_NONKEY_PIN_AUTODOWN 0x02
999#define DA9063_NONKEY_PIN_AUTOFLPRT 0x03
1000
1001/* DA9063_REG_MON_REG_5 (addr=0x116) */
1002#define DA9063_MON_A8_IDX_MASK 0x07
1003#define DA9063_MON_A8_IDX_NONE 0x00
1004#define DA9063_MON_A8_IDX_BCORE1 0x01
1005#define DA9063_MON_A8_IDX_BCORE2 0x02
1006#define DA9063_MON_A8_IDX_BPRO 0x03
1007#define DA9063_MON_A8_IDX_LDO3 0x04
1008#define DA9063_MON_A8_IDX_LDO4 0x05
1009#define DA9063_MON_A8_IDX_LDO11 0x06
1010#define DA9063_MON_A9_IDX_MASK 0x70
1011#define DA9063_MON_A9_IDX_NONE 0x00
1012#define DA9063_MON_A9_IDX_BIO 0x01
1013#define DA9063_MON_A9_IDX_BMEM 0x02
1014#define DA9063_MON_A9_IDX_BPERI 0x03
1015#define DA9063_MON_A9_IDX_LDO1 0x04
1016#define DA9063_MON_A9_IDX_LDO2 0x05
1017#define DA9063_MON_A9_IDX_LDO5 0x06
1018
1019/* DA9063_REG_MON_REG_6 (addr=0x117) */
1020#define DA9063_MON_A10_IDX_MASK 0x07
1021#define DA9063_MON_A10_IDX_NONE 0x00
1022#define DA9063_MON_A10_IDX_LDO6 0x01
1023#define DA9063_MON_A10_IDX_LDO7 0x02
1024#define DA9063_MON_A10_IDX_LDO8 0x03
1025#define DA9063_MON_A10_IDX_LDO9 0x04
1026#define DA9063_MON_A10_IDX_LDO10 0x05
1027
1028#endif /* _DA9063_REG_H */
diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h
index 13a1ee95a233..5166935ce66d 100644
--- a/include/linux/mfd/davinci_voicecodec.h
+++ b/include/linux/mfd/davinci_voicecodec.h
@@ -30,6 +30,8 @@
30 30
31#include <mach/hardware.h> 31#include <mach/hardware.h>
32 32
33struct regmap;
34
33/* 35/*
34 * Register values. 36 * Register values.
35 */ 37 */
@@ -113,6 +115,7 @@ struct davinci_vc {
113 115
114 /* Memory resources */ 116 /* Memory resources */
115 void __iomem *base; 117 void __iomem *base;
118 struct regmap *regmap;
116 119
117 /* MFD cells */ 120 /* MFD cells */
118 struct mfd_cell cells[DAVINCI_VC_CELLS]; 121 struct mfd_cell cells[DAVINCI_VC_CELLS];
diff --git a/include/linux/mfd/mcp.h b/include/linux/mfd/mcp.h
index a9e8bd157673..f682953043ba 100644
--- a/include/linux/mfd/mcp.h
+++ b/include/linux/mfd/mcp.h
@@ -10,6 +10,8 @@
10#ifndef MCP_H 10#ifndef MCP_H
11#define MCP_H 11#define MCP_H
12 12
13#include <linux/device.h>
14
13struct mcp_ops; 15struct mcp_ops;
14 16
15struct mcp { 17struct mcp {
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 1a8dd7afe084..9974e387e483 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -160,7 +160,8 @@ enum palmas_regulators {
160 PALMAS_REG_SMPS7, 160 PALMAS_REG_SMPS7,
161 PALMAS_REG_SMPS8, 161 PALMAS_REG_SMPS8,
162 PALMAS_REG_SMPS9, 162 PALMAS_REG_SMPS9,
163 PALMAS_REG_SMPS10, 163 PALMAS_REG_SMPS10_OUT2,
164 PALMAS_REG_SMPS10_OUT1,
164 /* LDO regulators */ 165 /* LDO regulators */
165 PALMAS_REG_LDO1, 166 PALMAS_REG_LDO1,
166 PALMAS_REG_LDO2, 167 PALMAS_REG_LDO2,
@@ -183,6 +184,50 @@ enum palmas_regulators {
183 PALMAS_NUM_REGS, 184 PALMAS_NUM_REGS,
184}; 185};
185 186
187/* External controll signal name */
188enum {
189 PALMAS_EXT_CONTROL_ENABLE1 = 0x1,
190 PALMAS_EXT_CONTROL_ENABLE2 = 0x2,
191 PALMAS_EXT_CONTROL_NSLEEP = 0x4,
192};
193
194/*
195 * Palmas device resources can be controlled externally for
196 * enabling/disabling it rather than register write through i2c.
197 * Add the external controlled requestor ID for different resources.
198 */
199enum palmas_external_requestor_id {
200 PALMAS_EXTERNAL_REQSTR_ID_REGEN1,
201 PALMAS_EXTERNAL_REQSTR_ID_REGEN2,
202 PALMAS_EXTERNAL_REQSTR_ID_SYSEN1,
203 PALMAS_EXTERNAL_REQSTR_ID_SYSEN2,
204 PALMAS_EXTERNAL_REQSTR_ID_CLK32KG,
205 PALMAS_EXTERNAL_REQSTR_ID_CLK32KGAUDIO,
206 PALMAS_EXTERNAL_REQSTR_ID_REGEN3,
207 PALMAS_EXTERNAL_REQSTR_ID_SMPS12,
208 PALMAS_EXTERNAL_REQSTR_ID_SMPS3,
209 PALMAS_EXTERNAL_REQSTR_ID_SMPS45,
210 PALMAS_EXTERNAL_REQSTR_ID_SMPS6,
211 PALMAS_EXTERNAL_REQSTR_ID_SMPS7,
212 PALMAS_EXTERNAL_REQSTR_ID_SMPS8,
213 PALMAS_EXTERNAL_REQSTR_ID_SMPS9,
214 PALMAS_EXTERNAL_REQSTR_ID_SMPS10,
215 PALMAS_EXTERNAL_REQSTR_ID_LDO1,
216 PALMAS_EXTERNAL_REQSTR_ID_LDO2,
217 PALMAS_EXTERNAL_REQSTR_ID_LDO3,
218 PALMAS_EXTERNAL_REQSTR_ID_LDO4,
219 PALMAS_EXTERNAL_REQSTR_ID_LDO5,
220 PALMAS_EXTERNAL_REQSTR_ID_LDO6,
221 PALMAS_EXTERNAL_REQSTR_ID_LDO7,
222 PALMAS_EXTERNAL_REQSTR_ID_LDO8,
223 PALMAS_EXTERNAL_REQSTR_ID_LDO9,
224 PALMAS_EXTERNAL_REQSTR_ID_LDOLN,
225 PALMAS_EXTERNAL_REQSTR_ID_LDOUSB,
226
227 /* Last entry */
228 PALMAS_EXTERNAL_REQSTR_ID_MAX,
229};
230
186struct palmas_pmic_platform_data { 231struct palmas_pmic_platform_data {
187 /* An array of pointers to regulator init data indexed by regulator 232 /* An array of pointers to regulator init data indexed by regulator
188 * ID 233 * ID
@@ -258,6 +303,7 @@ struct palmas_platform_data {
258 */ 303 */
259 int mux_from_pdata; 304 int mux_from_pdata;
260 u8 pad1, pad2; 305 u8 pad1, pad2;
306 bool pm_off;
261 307
262 struct palmas_pmic_platform_data *pmic_pdata; 308 struct palmas_pmic_platform_data *pmic_pdata;
263 struct palmas_gpadc_platform_data *gpadc_pdata; 309 struct palmas_gpadc_platform_data *gpadc_pdata;
@@ -355,9 +401,9 @@ struct palmas_pmic {
355 int smps123; 401 int smps123;
356 int smps457; 402 int smps457;
357 403
358 int range[PALMAS_REG_SMPS10]; 404 int range[PALMAS_REG_SMPS10_OUT1];
359 unsigned int ramp_delay[PALMAS_REG_SMPS10]; 405 unsigned int ramp_delay[PALMAS_REG_SMPS10_OUT1];
360 unsigned int current_reg_mode[PALMAS_REG_SMPS10]; 406 unsigned int current_reg_mode[PALMAS_REG_SMPS10_OUT1];
361}; 407};
362 408
363struct palmas_resource { 409struct palmas_resource {
@@ -371,17 +417,15 @@ struct palmas_usb {
371 417
372 struct extcon_dev edev; 418 struct extcon_dev edev;
373 419
374 /* used to set vbus, in atomic path */
375 struct work_struct set_vbus_work;
376
377 int id_otg_irq; 420 int id_otg_irq;
378 int id_irq; 421 int id_irq;
379 int vbus_otg_irq; 422 int vbus_otg_irq;
380 int vbus_irq; 423 int vbus_irq;
381 424
382 int vbus_enable;
383
384 enum palmas_usb_state linkstat; 425 enum palmas_usb_state linkstat;
426 int wakeup;
427 bool enable_vbus_detection;
428 bool enable_id_detection;
385}; 429};
386 430
387#define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator) 431#define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator)
@@ -449,7 +493,7 @@ enum usb_irq_events {
449#define PALMAS_DVFS_BASE 0x180 493#define PALMAS_DVFS_BASE 0x180
450#define PALMAS_PMU_CONTROL_BASE 0x1A0 494#define PALMAS_PMU_CONTROL_BASE 0x1A0
451#define PALMAS_RESOURCE_BASE 0x1D4 495#define PALMAS_RESOURCE_BASE 0x1D4
452#define PALMAS_PU_PD_OD_BASE 0x1F4 496#define PALMAS_PU_PD_OD_BASE 0x1F0
453#define PALMAS_LED_BASE 0x200 497#define PALMAS_LED_BASE 0x200
454#define PALMAS_INTERRUPT_BASE 0x210 498#define PALMAS_INTERRUPT_BASE 0x210
455#define PALMAS_USB_OTG_BASE 0x250 499#define PALMAS_USB_OTG_BASE 0x250
@@ -1734,16 +1778,20 @@ enum usb_irq_events {
1734#define PALMAS_REGEN3_CTRL_MODE_ACTIVE_SHIFT 0 1778#define PALMAS_REGEN3_CTRL_MODE_ACTIVE_SHIFT 0
1735 1779
1736/* Registers for function PAD_CONTROL */ 1780/* Registers for function PAD_CONTROL */
1737#define PALMAS_PU_PD_INPUT_CTRL1 0x0 1781#define PALMAS_OD_OUTPUT_CTRL2 0x2
1738#define PALMAS_PU_PD_INPUT_CTRL2 0x1 1782#define PALMAS_POLARITY_CTRL2 0x3
1739#define PALMAS_PU_PD_INPUT_CTRL3 0x2 1783#define PALMAS_PU_PD_INPUT_CTRL1 0x4
1740#define PALMAS_OD_OUTPUT_CTRL 0x4 1784#define PALMAS_PU_PD_INPUT_CTRL2 0x5
1741#define PALMAS_POLARITY_CTRL 0x5 1785#define PALMAS_PU_PD_INPUT_CTRL3 0x6
1742#define PALMAS_PRIMARY_SECONDARY_PAD1 0x6 1786#define PALMAS_PU_PD_INPUT_CTRL5 0x7
1743#define PALMAS_PRIMARY_SECONDARY_PAD2 0x7 1787#define PALMAS_OD_OUTPUT_CTRL 0x8
1744#define PALMAS_I2C_SPI 0x8 1788#define PALMAS_POLARITY_CTRL 0x9
1745#define PALMAS_PU_PD_INPUT_CTRL4 0x9 1789#define PALMAS_PRIMARY_SECONDARY_PAD1 0xA
1746#define PALMAS_PRIMARY_SECONDARY_PAD3 0xA 1790#define PALMAS_PRIMARY_SECONDARY_PAD2 0xB
1791#define PALMAS_I2C_SPI 0xC
1792#define PALMAS_PU_PD_INPUT_CTRL4 0xD
1793#define PALMAS_PRIMARY_SECONDARY_PAD3 0xE
1794#define PALMAS_PRIMARY_SECONDARY_PAD4 0xF
1747 1795
1748/* Bit definitions for PU_PD_INPUT_CTRL1 */ 1796/* Bit definitions for PU_PD_INPUT_CTRL1 */
1749#define PALMAS_PU_PD_INPUT_CTRL1_RESET_IN_PD 0x40 1797#define PALMAS_PU_PD_INPUT_CTRL1_RESET_IN_PD 0x40
@@ -2501,6 +2549,15 @@ enum usb_irq_events {
2501#define PALMAS_PU_PD_GPIO_CTRL1 0x6 2549#define PALMAS_PU_PD_GPIO_CTRL1 0x6
2502#define PALMAS_PU_PD_GPIO_CTRL2 0x7 2550#define PALMAS_PU_PD_GPIO_CTRL2 0x7
2503#define PALMAS_OD_OUTPUT_GPIO_CTRL 0x8 2551#define PALMAS_OD_OUTPUT_GPIO_CTRL 0x8
2552#define PALMAS_GPIO_DATA_IN2 0x9
2553#define PALMAS_GPIO_DATA_DIR2 0x0A
2554#define PALMAS_GPIO_DATA_OUT2 0x0B
2555#define PALMAS_GPIO_DEBOUNCE_EN2 0x0C
2556#define PALMAS_GPIO_CLEAR_DATA_OUT2 0x0D
2557#define PALMAS_GPIO_SET_DATA_OUT2 0x0E
2558#define PALMAS_PU_PD_GPIO_CTRL3 0x0F
2559#define PALMAS_PU_PD_GPIO_CTRL4 0x10
2560#define PALMAS_OD_OUTPUT_GPIO_CTRL2 0x11
2504 2561
2505/* Bit definitions for GPIO_DATA_IN */ 2562/* Bit definitions for GPIO_DATA_IN */
2506#define PALMAS_GPIO_DATA_IN_GPIO_7_IN 0x80 2563#define PALMAS_GPIO_DATA_IN_GPIO_7_IN 0x80
@@ -2866,4 +2923,9 @@ static inline int palmas_irq_get_virq(struct palmas *palmas, int irq)
2866 return regmap_irq_get_virq(palmas->irq_data, irq); 2923 return regmap_irq_get_virq(palmas->irq_data, irq);
2867} 2924}
2868 2925
2926
2927int palmas_ext_control_req_config(struct palmas *palmas,
2928 enum palmas_external_requestor_id ext_control_req_id,
2929 int ext_ctrl, bool enable);
2930
2869#endif /* __LINUX_MFD_PALMAS_H */ 2931#endif /* __LINUX_MFD_PALMAS_H */
diff --git a/include/linux/mfd/rtsx_common.h b/include/linux/mfd/rtsx_common.h
index 2b13970596f5..443176ee1ab0 100644
--- a/include/linux/mfd/rtsx_common.h
+++ b/include/linux/mfd/rtsx_common.h
@@ -1,6 +1,6 @@
1/* Driver for Realtek driver-based card reader 1/* Driver for Realtek driver-based card reader
2 * 2 *
3 * Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved. 3 * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the 6 * under the terms of the GNU General Public License as published by the
@@ -17,7 +17,6 @@
17 * 17 *
18 * Author: 18 * Author:
19 * Wei WANG <wei_wang@realsil.com.cn> 19 * Wei WANG <wei_wang@realsil.com.cn>
20 * No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
21 */ 20 */
22 21
23#ifndef __RTSX_COMMON_H 22#ifndef __RTSX_COMMON_H
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
index 7a9f7089435d..d1382dfbeff0 100644
--- a/include/linux/mfd/rtsx_pci.h
+++ b/include/linux/mfd/rtsx_pci.h
@@ -1,6 +1,6 @@
1/* Driver for Realtek PCI-Express card reader 1/* Driver for Realtek PCI-Express card reader
2 * 2 *
3 * Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved. 3 * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the 6 * under the terms of the GNU General Public License as published by the
@@ -17,7 +17,6 @@
17 * 17 *
18 * Author: 18 * Author:
19 * Wei WANG <wei_wang@realsil.com.cn> 19 * Wei WANG <wei_wang@realsil.com.cn>
20 * No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
21 */ 20 */
22 21
23#ifndef __RTSX_PCI_H 22#ifndef __RTSX_PCI_H
@@ -25,8 +24,7 @@
25 24
26#include <linux/sched.h> 25#include <linux/sched.h>
27#include <linux/pci.h> 26#include <linux/pci.h>
28 27#include <linux/mfd/rtsx_common.h>
29#include "rtsx_common.h"
30 28
31#define MAX_RW_REG_CNT 1024 29#define MAX_RW_REG_CNT 1024
32 30
@@ -184,11 +182,26 @@
184#define CARD_SHARE_BAROSSA_SD 0x01 182#define CARD_SHARE_BAROSSA_SD 0x01
185#define CARD_SHARE_BAROSSA_MS 0x02 183#define CARD_SHARE_BAROSSA_MS 0x02
186 184
185/* CARD_DRIVE_SEL */
186#define MS_DRIVE_8mA (0x01 << 6)
187#define MMC_DRIVE_8mA (0x01 << 4)
188#define XD_DRIVE_8mA (0x01 << 2)
189#define GPIO_DRIVE_8mA 0x01
190#define RTS5209_CARD_DRIVE_DEFAULT (MS_DRIVE_8mA | MMC_DRIVE_8mA |\
191 XD_DRIVE_8mA | GPIO_DRIVE_8mA)
192#define RTL8411_CARD_DRIVE_DEFAULT (MS_DRIVE_8mA | MMC_DRIVE_8mA |\
193 XD_DRIVE_8mA)
194#define RTSX_CARD_DRIVE_DEFAULT (MS_DRIVE_8mA | GPIO_DRIVE_8mA)
195
187/* SD30_DRIVE_SEL */ 196/* SD30_DRIVE_SEL */
188#define DRIVER_TYPE_A 0x05 197#define DRIVER_TYPE_A 0x05
189#define DRIVER_TYPE_B 0x03 198#define DRIVER_TYPE_B 0x03
190#define DRIVER_TYPE_C 0x02 199#define DRIVER_TYPE_C 0x02
191#define DRIVER_TYPE_D 0x01 200#define DRIVER_TYPE_D 0x01
201#define CFG_DRIVER_TYPE_A 0x02
202#define CFG_DRIVER_TYPE_B 0x03
203#define CFG_DRIVER_TYPE_C 0x01
204#define CFG_DRIVER_TYPE_D 0x00
192 205
193/* FPDCTL */ 206/* FPDCTL */
194#define SSC_POWER_DOWN 0x01 207#define SSC_POWER_DOWN 0x01
@@ -521,6 +534,10 @@
521#define SAMPLE_VAR_CLK0 (0x01 << 4) 534#define SAMPLE_VAR_CLK0 (0x01 << 4)
522#define SAMPLE_VAR_CLK1 (0x02 << 4) 535#define SAMPLE_VAR_CLK1 (0x02 << 4)
523 536
537/* HOST_SLEEP_STATE */
538#define HOST_ENTER_S1 1
539#define HOST_ENTER_S3 2
540
524#define MS_CFG 0xFD40 541#define MS_CFG 0xFD40
525#define MS_TPC 0xFD41 542#define MS_TPC 0xFD41
526#define MS_TRANS_CFG 0xFD42 543#define MS_TRANS_CFG 0xFD42
@@ -669,6 +686,7 @@
669#define PME_FORCE_CTL 0xFE56 686#define PME_FORCE_CTL 0xFE56
670#define ASPM_FORCE_CTL 0xFE57 687#define ASPM_FORCE_CTL 0xFE57
671#define PM_CLK_FORCE_CTL 0xFE58 688#define PM_CLK_FORCE_CTL 0xFE58
689#define FUNC_FORCE_CTL 0xFE59
672#define PERST_GLITCH_WIDTH 0xFE5C 690#define PERST_GLITCH_WIDTH 0xFE5C
673#define CHANGE_LINK_STATE 0xFE5B 691#define CHANGE_LINK_STATE 0xFE5B
674#define RESET_LOAD_REG 0xFE5E 692#define RESET_LOAD_REG 0xFE5E
@@ -684,6 +702,13 @@
684 702
685#define DUMMY_REG_RESET_0 0xFE90 703#define DUMMY_REG_RESET_0 0xFE90
686 704
705#define AUTOLOAD_CFG_BASE 0xFF00
706
707#define PM_CTRL1 0xFF44
708#define PM_CTRL2 0xFF45
709#define PM_CTRL3 0xFF46
710#define PM_CTRL4 0xFF47
711
687/* Memory mapping */ 712/* Memory mapping */
688#define SRAM_BASE 0xE600 713#define SRAM_BASE 0xE600
689#define RBUF_BASE 0xF400 714#define RBUF_BASE 0xF400
@@ -726,6 +751,11 @@
726#define PHY_FLD4 0x1E 751#define PHY_FLD4 0x1E
727#define PHY_DUM_REG 0x1F 752#define PHY_DUM_REG 0x1F
728 753
754#define LCTLR 0x80
755#define PCR_SETTING_REG1 0x724
756#define PCR_SETTING_REG2 0x814
757#define PCR_SETTING_REG3 0x747
758
729#define rtsx_pci_init_cmd(pcr) ((pcr)->ci = 0) 759#define rtsx_pci_init_cmd(pcr) ((pcr)->ci = 0)
730 760
731struct rtsx_pcr; 761struct rtsx_pcr;
@@ -747,6 +777,8 @@ struct pcr_ops {
747 u8 voltage); 777 u8 voltage);
748 unsigned int (*cd_deglitch)(struct rtsx_pcr *pcr); 778 unsigned int (*cd_deglitch)(struct rtsx_pcr *pcr);
749 int (*conv_clk_and_div_n)(int clk, int dir); 779 int (*conv_clk_and_div_n)(int clk, int dir);
780 void (*fetch_vendor_settings)(struct rtsx_pcr *pcr);
781 void (*force_power_down)(struct rtsx_pcr *pcr, u8 pm_state);
750}; 782};
751 783
752enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN}; 784enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN};
@@ -788,7 +820,6 @@ struct rtsx_pcr {
788 struct completion *finish_me; 820 struct completion *finish_me;
789 821
790 unsigned int cur_clock; 822 unsigned int cur_clock;
791 bool ms_pmos;
792 bool remove_pci; 823 bool remove_pci;
793 bool msi_en; 824 bool msi_en;
794 825
@@ -806,6 +837,19 @@ struct rtsx_pcr {
806#define IC_VER_D 3 837#define IC_VER_D 3
807 u8 ic_version; 838 u8 ic_version;
808 839
840 u8 sd30_drive_sel_1v8;
841 u8 sd30_drive_sel_3v3;
842 u8 card_drive_sel;
843#define ASPM_L1_EN 0x02
844 u8 aspm_en;
845
846#define PCR_MS_PMOS (1 << 0)
847#define PCR_REVERSE_SOCKET (1 << 1)
848 u32 flags;
849
850 u32 tx_initial_phase;
851 u32 rx_initial_phase;
852
809 const u32 *sd_pull_ctl_enable_tbl; 853 const u32 *sd_pull_ctl_enable_tbl;
810 const u32 *sd_pull_ctl_disable_tbl; 854 const u32 *sd_pull_ctl_disable_tbl;
811 const u32 *ms_pull_ctl_enable_tbl; 855 const u32 *ms_pull_ctl_enable_tbl;
@@ -822,6 +866,18 @@ struct rtsx_pcr {
822#define PCI_VID(pcr) ((pcr)->pci->vendor) 866#define PCI_VID(pcr) ((pcr)->pci->vendor)
823#define PCI_PID(pcr) ((pcr)->pci->device) 867#define PCI_PID(pcr) ((pcr)->pci->device)
824 868
869#define SDR104_PHASE(val) ((val) & 0xFF)
870#define SDR50_PHASE(val) (((val) >> 8) & 0xFF)
871#define DDR50_PHASE(val) (((val) >> 16) & 0xFF)
872#define SDR104_TX_PHASE(pcr) SDR104_PHASE((pcr)->tx_initial_phase)
873#define SDR50_TX_PHASE(pcr) SDR50_PHASE((pcr)->tx_initial_phase)
874#define DDR50_TX_PHASE(pcr) DDR50_PHASE((pcr)->tx_initial_phase)
875#define SDR104_RX_PHASE(pcr) SDR104_PHASE((pcr)->rx_initial_phase)
876#define SDR50_RX_PHASE(pcr) SDR50_PHASE((pcr)->rx_initial_phase)
877#define DDR50_RX_PHASE(pcr) DDR50_PHASE((pcr)->rx_initial_phase)
878#define SET_CLOCK_PHASE(sdr104, sdr50, ddr50) \
879 (((ddr50) << 16) | ((sdr50) << 8) | (sdr104))
880
825void rtsx_pci_start_run(struct rtsx_pcr *pcr); 881void rtsx_pci_start_run(struct rtsx_pcr *pcr);
826int rtsx_pci_write_register(struct rtsx_pcr *pcr, u16 addr, u8 mask, u8 data); 882int rtsx_pci_write_register(struct rtsx_pcr *pcr, u16 addr, u8 mask, u8 data);
827int rtsx_pci_read_register(struct rtsx_pcr *pcr, u16 addr, u8 *data); 883int rtsx_pci_read_register(struct rtsx_pcr *pcr, u16 addr, u8 *data);
diff --git a/include/linux/mfd/samsung/s2mps11.h b/include/linux/mfd/samsung/s2mps11.h
index 4e94dc65f987..b3ddf98dec37 100644
--- a/include/linux/mfd/samsung/s2mps11.h
+++ b/include/linux/mfd/samsung/s2mps11.h
@@ -167,11 +167,8 @@ enum s2mps11_regulators {
167 S2MPS11_BUCK8, 167 S2MPS11_BUCK8,
168 S2MPS11_BUCK9, 168 S2MPS11_BUCK9,
169 S2MPS11_BUCK10, 169 S2MPS11_BUCK10,
170 S2MPS11_AP_EN32KHZ,
171 S2MPS11_CP_EN32KHZ,
172 S2MPS11_BT_EN32KHZ,
173 170
174 S2MPS11_REG_MAX, 171 S2MPS11_REGULATOR_MAX,
175}; 172};
176 173
177#define S2MPS11_BUCK_MIN1 600000 174#define S2MPS11_BUCK_MIN1 600000
@@ -191,7 +188,17 @@ enum s2mps11_regulators {
191#define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1) 188#define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1)
192#define S2MPS11_RAMP_DELAY 25000 /* uV/us */ 189#define S2MPS11_RAMP_DELAY 25000 /* uV/us */
193 190
191
192#define S2MPS11_BUCK2_RAMP_SHIFT 6
193#define S2MPS11_BUCK34_RAMP_SHIFT 4
194#define S2MPS11_BUCK5_RAMP_SHIFT 6
195#define S2MPS11_BUCK16_RAMP_SHIFT 4
196#define S2MPS11_BUCK7810_RAMP_SHIFT 2
197#define S2MPS11_BUCK9_RAMP_SHIFT 0
198#define S2MPS11_BUCK2_RAMP_EN_SHIFT 3
199#define S2MPS11_BUCK3_RAMP_EN_SHIFT 2
200#define S2MPS11_BUCK4_RAMP_EN_SHIFT 1
201#define S2MPS11_BUCK6_RAMP_EN_SHIFT 0
194#define S2MPS11_PMIC_EN_SHIFT 6 202#define S2MPS11_PMIC_EN_SHIFT 6
195#define S2MPS11_REGULATOR_MAX (S2MPS11_REG_MAX - 3)
196 203
197#endif /* __LINUX_MFD_S2MPS11_H */ 204#endif /* __LINUX_MFD_S2MPS11_H */
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
index db1791bb997a..25f2c611ab01 100644
--- a/include/linux/mfd/ti_am335x_tscadc.h
+++ b/include/linux/mfd/ti_am335x_tscadc.h
@@ -121,7 +121,6 @@
121#define SEQ_STATUS BIT(5) 121#define SEQ_STATUS BIT(5)
122 122
123#define ADC_CLK 3000000 123#define ADC_CLK 3000000
124#define MAX_CLK_DIV 7
125#define TOTAL_STEPS 16 124#define TOTAL_STEPS 16
126#define TOTAL_CHANNELS 8 125#define TOTAL_CHANNELS 8
127 126
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index ce3511326f80..b22883d60500 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -108,7 +108,6 @@ struct tmio_mmc_data {
108 unsigned int cd_gpio; 108 unsigned int cd_gpio;
109 void (*set_pwr)(struct platform_device *host, int state); 109 void (*set_pwr)(struct platform_device *host, int state);
110 void (*set_clk_div)(struct platform_device *host, int state); 110 void (*set_clk_div)(struct platform_device *host, int state);
111 int (*get_cd)(struct platform_device *host);
112 int (*write16_hook)(struct tmio_mmc_host *host, int addr); 111 int (*write16_hook)(struct tmio_mmc_host *host, int addr);
113 /* clock management callbacks */ 112 /* clock management callbacks */
114 int (*clk_enable)(struct platform_device *pdev, unsigned int *f); 113 int (*clk_enable)(struct platform_device *pdev, unsigned int *f);
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
index 29eab2bd3dfa..a5a7f0130e96 100644
--- a/include/linux/mfd/tps65217.h
+++ b/include/linux/mfd/tps65217.h
@@ -244,24 +244,6 @@ struct tps65217_board {
244}; 244};
245 245
246/** 246/**
247 * struct tps_info - packages regulator constraints
248 * @name: Voltage regulator name
249 * @min_uV: minimum micro volts
250 * @max_uV: minimum micro volts
251 * @vsel_to_uv: Function pointer to get voltage from selector
252 * @uv_to_vsel: Function pointer to get selector from voltage
253 *
254 * This data is used to check the regualtor voltage limits while setting.
255 */
256struct tps_info {
257 const char *name;
258 int min_uV;
259 int max_uV;
260 int (*vsel_to_uv)(unsigned int vsel);
261 int (*uv_to_vsel)(int uV, unsigned int *vsel);
262};
263
264/**
265 * struct tps65217 - tps65217 sub-driver chip access routines 247 * struct tps65217 - tps65217 sub-driver chip access routines
266 * 248 *
267 * Device data may be used to access the TPS65217 chip 249 * Device data may be used to access the TPS65217 chip
@@ -273,7 +255,6 @@ struct tps65217 {
273 unsigned int id; 255 unsigned int id;
274 struct regulator_desc desc[TPS65217_NUM_REGULATOR]; 256 struct regulator_desc desc[TPS65217_NUM_REGULATOR];
275 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; 257 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR];
276 struct tps_info *info[TPS65217_NUM_REGULATOR];
277 struct regmap *regmap; 258 struct regmap *regmap;
278}; 259};
279 260
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h
index 7e7fbce7a308..81f639bc1ae6 100644
--- a/include/linux/mfd/twl6040.h
+++ b/include/linux/mfd/twl6040.h
@@ -185,6 +185,7 @@
185 185
186#define TWL6040_GPO_MAX 3 186#define TWL6040_GPO_MAX 3
187 187
188/* TODO: All platform data struct can be removed */
188struct twl6040_codec_data { 189struct twl6040_codec_data {
189 u16 hs_left_step; 190 u16 hs_left_step;
190 u16 hs_right_step; 191 u16 hs_right_step;
@@ -229,7 +230,6 @@ struct twl6040 {
229 int audpwron; 230 int audpwron;
230 int power_count; 231 int power_count;
231 int rev; 232 int rev;
232 u8 vibra_ctrl_cache[2];
233 233
234 /* PLL configuration */ 234 /* PLL configuration */
235 int pll; 235 int pll;
diff --git a/include/linux/mfd/ucb1x00.h b/include/linux/mfd/ucb1x00.h
index 28af41756360..88f90cbf8e6a 100644
--- a/include/linux/mfd/ucb1x00.h
+++ b/include/linux/mfd/ucb1x00.h
@@ -10,6 +10,7 @@
10#ifndef UCB1200_H 10#ifndef UCB1200_H
11#define UCB1200_H 11#define UCB1200_H
12 12
13#include <linux/device.h>
13#include <linux/mfd/mcp.h> 14#include <linux/mfd/mcp.h>
14#include <linux/gpio.h> 15#include <linux/gpio.h>
15#include <linux/mutex.h> 16#include <linux/mutex.h>
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index 8752dbbc6135..ad05ce60c1c9 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -17,6 +17,7 @@
17 17
18#define PHY_ID_KSZ8873MLL 0x000e7237 18#define PHY_ID_KSZ8873MLL 0x000e7237
19#define PHY_ID_KSZ9021 0x00221610 19#define PHY_ID_KSZ9021 0x00221610
20#define PHY_ID_KSZ9021RLRN 0x00221611
20#define PHY_ID_KS8737 0x00221720 21#define PHY_ID_KS8737 0x00221720
21#define PHY_ID_KSZ8021 0x00221555 22#define PHY_ID_KSZ8021 0x00221555
22#define PHY_ID_KSZ8031 0x00221556 23#define PHY_ID_KSZ8031 0x00221556
@@ -35,4 +36,9 @@
35/* struct phy_device dev_flags definitions */ 36/* struct phy_device dev_flags definitions */
36#define MICREL_PHY_50MHZ_CLK 0x00000001 37#define MICREL_PHY_50MHZ_CLK 0x00000001
37 38
39#define MICREL_KSZ9021_EXTREG_CTRL 0xB
40#define MICREL_KSZ9021_EXTREG_DATA_WRITE 0xC
41#define MICREL_KSZ9021_RGMII_CLK_CTRL_PAD_SCEW 0x104
42#define MICREL_KSZ9021_RGMII_RX_DATA_PAD_SCEW 0x105
43
38#endif /* _MICREL_PHY_H */ 44#endif /* _MICREL_PHY_H */
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index a405d3dc0f61..8d3c57fdf221 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -41,8 +41,6 @@ extern int migrate_page(struct address_space *,
41 struct page *, struct page *, enum migrate_mode); 41 struct page *, struct page *, enum migrate_mode);
42extern int migrate_pages(struct list_head *l, new_page_t x, 42extern int migrate_pages(struct list_head *l, new_page_t x,
43 unsigned long private, enum migrate_mode mode, int reason); 43 unsigned long private, enum migrate_mode mode, int reason);
44extern int migrate_huge_page(struct page *, new_page_t x,
45 unsigned long private, enum migrate_mode mode);
46 44
47extern int fail_migrate_page(struct address_space *, 45extern int fail_migrate_page(struct address_space *,
48 struct page *, struct page *); 46 struct page *, struct page *);
@@ -55,6 +53,9 @@ extern int migrate_vmas(struct mm_struct *mm,
55extern void migrate_page_copy(struct page *newpage, struct page *page); 53extern void migrate_page_copy(struct page *newpage, struct page *page);
56extern int migrate_huge_page_move_mapping(struct address_space *mapping, 54extern int migrate_huge_page_move_mapping(struct address_space *mapping,
57 struct page *newpage, struct page *page); 55 struct page *newpage, struct page *page);
56extern int migrate_page_move_mapping(struct address_space *mapping,
57 struct page *newpage, struct page *page,
58 struct buffer_head *head, enum migrate_mode mode);
58#else 59#else
59 60
60static inline void putback_lru_pages(struct list_head *l) {} 61static inline void putback_lru_pages(struct list_head *l) {}
@@ -62,9 +63,6 @@ static inline void putback_movable_pages(struct list_head *l) {}
62static inline int migrate_pages(struct list_head *l, new_page_t x, 63static inline int migrate_pages(struct list_head *l, new_page_t x,
63 unsigned long private, enum migrate_mode mode, int reason) 64 unsigned long private, enum migrate_mode mode, int reason)
64 { return -ENOSYS; } 65 { return -ENOSYS; }
65static inline int migrate_huge_page(struct page *page, new_page_t x,
66 unsigned long private, enum migrate_mode mode)
67 { return -ENOSYS; }
68 66
69static inline int migrate_prep(void) { return -ENOSYS; } 67static inline int migrate_prep(void) { return -ENOSYS; }
70static inline int migrate_prep_local(void) { return -ENOSYS; } 68static inline int migrate_prep_local(void) { return -ENOSYS; }
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 09c2300ddb37..cb358355ef43 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -45,6 +45,7 @@
45#define MAPPER_CTRL_MINOR 236 45#define MAPPER_CTRL_MINOR 236
46#define LOOP_CTRL_MINOR 237 46#define LOOP_CTRL_MINOR 237
47#define VHOST_NET_MINOR 238 47#define VHOST_NET_MINOR 238
48#define UHID_MINOR 239
48#define MISC_DYNAMIC_MINOR 255 49#define MISC_DYNAMIC_MINOR 255
49 50
50struct device; 51struct device;
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index bb1c8096a7eb..cd1fdf75103b 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -69,6 +69,7 @@ enum {
69 MLX4_CMD_SET_ICM_SIZE = 0xffd, 69 MLX4_CMD_SET_ICM_SIZE = 0xffd,
70 /*master notify fw on finish for slave's flr*/ 70 /*master notify fw on finish for slave's flr*/
71 MLX4_CMD_INFORM_FLR_DONE = 0x5b, 71 MLX4_CMD_INFORM_FLR_DONE = 0x5b,
72 MLX4_CMD_GET_OP_REQ = 0x59,
72 73
73 /* TPT commands */ 74 /* TPT commands */
74 MLX4_CMD_SW2HW_MPT = 0xd, 75 MLX4_CMD_SW2HW_MPT = 0xd,
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 52c23a892bab..24ce6bdd540e 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -33,6 +33,7 @@
33#ifndef MLX4_DEVICE_H 33#ifndef MLX4_DEVICE_H
34#define MLX4_DEVICE_H 34#define MLX4_DEVICE_H
35 35
36#include <linux/if_ether.h>
36#include <linux/pci.h> 37#include <linux/pci.h>
37#include <linux/completion.h> 38#include <linux/completion.h>
38#include <linux/radix-tree.h> 39#include <linux/radix-tree.h>
@@ -207,6 +208,7 @@ enum mlx4_event {
207 MLX4_EVENT_TYPE_CMD = 0x0a, 208 MLX4_EVENT_TYPE_CMD = 0x0a,
208 MLX4_EVENT_TYPE_VEP_UPDATE = 0x19, 209 MLX4_EVENT_TYPE_VEP_UPDATE = 0x19,
209 MLX4_EVENT_TYPE_COMM_CHANNEL = 0x18, 210 MLX4_EVENT_TYPE_COMM_CHANNEL = 0x18,
211 MLX4_EVENT_TYPE_OP_REQUIRED = 0x1a,
210 MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, 212 MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b,
211 MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, 213 MLX4_EVENT_TYPE_FLR_EVENT = 0x1c,
212 MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d, 214 MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d,
@@ -619,7 +621,7 @@ struct mlx4_eth_av {
619 u8 dgid[16]; 621 u8 dgid[16];
620 u32 reserved4[2]; 622 u32 reserved4[2];
621 __be16 vlan; 623 __be16 vlan;
622 u8 mac[6]; 624 u8 mac[ETH_ALEN];
623}; 625};
624 626
625union mlx4_ext_av { 627union mlx4_ext_av {
@@ -913,10 +915,10 @@ enum mlx4_net_trans_promisc_mode {
913}; 915};
914 916
915struct mlx4_spec_eth { 917struct mlx4_spec_eth {
916 u8 dst_mac[6]; 918 u8 dst_mac[ETH_ALEN];
917 u8 dst_mac_msk[6]; 919 u8 dst_mac_msk[ETH_ALEN];
918 u8 src_mac[6]; 920 u8 src_mac[ETH_ALEN];
919 u8 src_mac_msk[6]; 921 u8 src_mac_msk[ETH_ALEN];
920 u8 ether_type_enable; 922 u8 ether_type_enable;
921 __be16 ether_type; 923 __be16 ether_type;
922 __be16 vlan_id_msk; 924 __be16 vlan_id_msk;
@@ -1052,11 +1054,6 @@ struct _rule_hw {
1052 }; 1054 };
1053}; 1055};
1054 1056
1055/* translating DMFS verbs sniffer rule to the FW API would need two reg IDs */
1056struct mlx4_flow_handle {
1057 u64 reg_id[2];
1058};
1059
1060int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn, 1057int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn,
1061 enum mlx4_net_trans_promisc_mode mode); 1058 enum mlx4_net_trans_promisc_mode mode);
1062int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port, 1059int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port,
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 262deac02c9e..6d351473c292 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -34,6 +34,7 @@
34#define MLX4_QP_H 34#define MLX4_QP_H
35 35
36#include <linux/types.h> 36#include <linux/types.h>
37#include <linux/if_ether.h>
37 38
38#include <linux/mlx4/device.h> 39#include <linux/mlx4/device.h>
39 40
@@ -143,7 +144,7 @@ struct mlx4_qp_path {
143 u8 feup; 144 u8 feup;
144 u8 fvl_rx; 145 u8 fvl_rx;
145 u8 reserved4[2]; 146 u8 reserved4[2];
146 u8 dmac[6]; 147 u8 dmac[ETH_ALEN];
147}; 148};
148 149
149enum { /* fl */ 150enum { /* fl */
@@ -318,7 +319,7 @@ struct mlx4_wqe_datagram_seg {
318 __be32 dqpn; 319 __be32 dqpn;
319 __be32 qkey; 320 __be32 qkey;
320 __be16 vlan; 321 __be16 vlan;
321 u8 mac[6]; 322 u8 mac[ETH_ALEN];
322}; 323};
323 324
324struct mlx4_wqe_lso_seg { 325struct mlx4_wqe_lso_seg {
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 68029b30c3dc..5eb4e31af22b 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -181,7 +181,7 @@ enum {
181 MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39, 181 MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39,
182 MLX5_DEV_CAP_FLAG_SIG_HAND_OVER = 1LL << 40, 182 MLX5_DEV_CAP_FLAG_SIG_HAND_OVER = 1LL << 40,
183 MLX5_DEV_CAP_FLAG_DCT = 1LL << 41, 183 MLX5_DEV_CAP_FLAG_DCT = 1LL << 41,
184 MLX5_DEV_CAP_FLAG_CMDIF_CSUM = 1LL << 46, 184 MLX5_DEV_CAP_FLAG_CMDIF_CSUM = 3LL << 46,
185}; 185};
186 186
187enum { 187enum {
@@ -417,7 +417,7 @@ struct mlx5_init_seg {
417 struct health_buffer health; 417 struct health_buffer health;
418 __be32 rsvd2[884]; 418 __be32 rsvd2[884];
419 __be32 health_counter; 419 __be32 health_counter;
420 __be32 rsvd3[1023]; 420 __be32 rsvd3[1019];
421 __be64 ieee1588_clk; 421 __be64 ieee1588_clk;
422 __be32 ieee1588_clk_type; 422 __be32 ieee1588_clk_type;
423 __be32 clr_intx; 423 __be32 clr_intx;
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 8888381fc150..6b8c496572c8 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -82,7 +82,7 @@ enum {
82}; 82};
83 83
84enum { 84enum {
85 MLX5_MAX_EQ_NAME = 20 85 MLX5_MAX_EQ_NAME = 32
86}; 86};
87 87
88enum { 88enum {
@@ -747,8 +747,7 @@ static inline u32 mlx5_idx_to_mkey(u32 mkey_idx)
747 747
748enum { 748enum {
749 MLX5_PROF_MASK_QP_SIZE = (u64)1 << 0, 749 MLX5_PROF_MASK_QP_SIZE = (u64)1 << 0,
750 MLX5_PROF_MASK_CMDIF_CSUM = (u64)1 << 1, 750 MLX5_PROF_MASK_MR_CACHE = (u64)1 << 1,
751 MLX5_PROF_MASK_MR_CACHE = (u64)1 << 2,
752}; 751};
753 752
754enum { 753enum {
@@ -758,7 +757,6 @@ enum {
758struct mlx5_profile { 757struct mlx5_profile {
759 u64 mask; 758 u64 mask;
760 u32 log_max_qp; 759 u32 log_max_qp;
761 int cmdif_csum;
762 struct { 760 struct {
763 int size; 761 int size;
764 int limit; 762 int limit;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index f0224608d15e..8b6e55ee8855 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -115,6 +115,12 @@ extern unsigned int kobjsize(const void *objp);
115#define VM_ARCH_1 0x01000000 /* Architecture-specific flag */ 115#define VM_ARCH_1 0x01000000 /* Architecture-specific flag */
116#define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */ 116#define VM_DONTDUMP 0x04000000 /* Do not include in the core dump */
117 117
118#ifdef CONFIG_MEM_SOFT_DIRTY
119# define VM_SOFTDIRTY 0x08000000 /* Not soft dirty clean area */
120#else
121# define VM_SOFTDIRTY 0
122#endif
123
118#define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */ 124#define VM_MIXEDMAP 0x10000000 /* Can contain "struct page" and pure PFN pages */
119#define VM_HUGEPAGE 0x20000000 /* MADV_HUGEPAGE marked this vma */ 125#define VM_HUGEPAGE 0x20000000 /* MADV_HUGEPAGE marked this vma */
120#define VM_NOHUGEPAGE 0x40000000 /* MADV_NOHUGEPAGE marked this vma */ 126#define VM_NOHUGEPAGE 0x40000000 /* MADV_NOHUGEPAGE marked this vma */
@@ -170,6 +176,7 @@ extern pgprot_t protection_map[16];
170#define FAULT_FLAG_RETRY_NOWAIT 0x10 /* Don't drop mmap_sem and wait when retrying */ 176#define FAULT_FLAG_RETRY_NOWAIT 0x10 /* Don't drop mmap_sem and wait when retrying */
171#define FAULT_FLAG_KILLABLE 0x20 /* The fault task is in SIGKILL killable region */ 177#define FAULT_FLAG_KILLABLE 0x20 /* The fault task is in SIGKILL killable region */
172#define FAULT_FLAG_TRIED 0x40 /* second try */ 178#define FAULT_FLAG_TRIED 0x40 /* second try */
179#define FAULT_FLAG_USER 0x80 /* The fault originated in userspace */
173 180
174/* 181/*
175 * vm_fault is filled by the the pagefault handler and passed to the vma's 182 * vm_fault is filled by the the pagefault handler and passed to the vma's
@@ -489,20 +496,6 @@ static inline int compound_order(struct page *page)
489 return (unsigned long)page[1].lru.prev; 496 return (unsigned long)page[1].lru.prev;
490} 497}
491 498
492static inline int compound_trans_order(struct page *page)
493{
494 int order;
495 unsigned long flags;
496
497 if (!PageHead(page))
498 return 0;
499
500 flags = compound_lock_irqsave(page);
501 order = compound_order(page);
502 compound_unlock_irqrestore(page, flags);
503 return order;
504}
505
506static inline void set_compound_order(struct page *page, unsigned long order) 499static inline void set_compound_order(struct page *page, unsigned long order)
507{ 500{
508 page[1].lru.prev = (void *)order; 501 page[1].lru.prev = (void *)order;
@@ -637,12 +630,12 @@ static inline enum zone_type page_zonenum(const struct page *page)
637#endif 630#endif
638 631
639/* 632/*
640 * The identification function is only used by the buddy allocator for 633 * The identification function is mainly used by the buddy allocator for
641 * determining if two pages could be buddies. We are not really 634 * determining if two pages could be buddies. We are not really identifying
642 * identifying a zone since we could be using a the section number 635 * the zone since we could be using the section number id if we do not have
643 * id if we have not node id available in page flags. 636 * node id available in page flags.
644 * We guarantee only that it will return the same value for two 637 * We only guarantee that it will return the same value for two combinable
645 * combinable pages in a zone. 638 * pages in a zone.
646 */ 639 */
647static inline int page_zone_id(struct page *page) 640static inline int page_zone_id(struct page *page)
648{ 641{
@@ -884,11 +877,12 @@ static inline int page_mapped(struct page *page)
884#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */ 877#define VM_FAULT_NOPAGE 0x0100 /* ->fault installed the pte, not return page */
885#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */ 878#define VM_FAULT_LOCKED 0x0200 /* ->fault locked the returned page */
886#define VM_FAULT_RETRY 0x0400 /* ->fault blocked, must retry */ 879#define VM_FAULT_RETRY 0x0400 /* ->fault blocked, must retry */
880#define VM_FAULT_FALLBACK 0x0800 /* huge page fault failed, fall back to small */
887 881
888#define VM_FAULT_HWPOISON_LARGE_MASK 0xf000 /* encodes hpage index for large hwpoison */ 882#define VM_FAULT_HWPOISON_LARGE_MASK 0xf000 /* encodes hpage index for large hwpoison */
889 883
890#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON | \ 884#define VM_FAULT_ERROR (VM_FAULT_OOM | VM_FAULT_SIGBUS | VM_FAULT_HWPOISON | \
891 VM_FAULT_HWPOISON_LARGE) 885 VM_FAULT_FALLBACK | VM_FAULT_HWPOISON_LARGE)
892 886
893/* Encode hstate index for a hwpoisoned large page */ 887/* Encode hstate index for a hwpoisoned large page */
894#define VM_FAULT_SET_HINDEX(x) ((x) << 12) 888#define VM_FAULT_SET_HINDEX(x) ((x) << 12)
@@ -992,7 +986,7 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
992 unmap_mapping_range(mapping, holebegin, holelen, 0); 986 unmap_mapping_range(mapping, holebegin, holelen, 0);
993} 987}
994 988
995extern void truncate_pagecache(struct inode *inode, loff_t old, loff_t new); 989extern void truncate_pagecache(struct inode *inode, loff_t new);
996extern void truncate_setsize(struct inode *inode, loff_t newsize); 990extern void truncate_setsize(struct inode *inode, loff_t newsize);
997void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end); 991void truncate_pagecache_range(struct inode *inode, loff_t offset, loff_t end);
998int truncate_inode_page(struct address_space *mapping, struct page *page); 992int truncate_inode_page(struct address_space *mapping, struct page *page);
@@ -1798,6 +1792,7 @@ enum mf_flags {
1798 MF_COUNT_INCREASED = 1 << 0, 1792 MF_COUNT_INCREASED = 1 << 0,
1799 MF_ACTION_REQUIRED = 1 << 1, 1793 MF_ACTION_REQUIRED = 1 << 1,
1800 MF_MUST_KILL = 1 << 2, 1794 MF_MUST_KILL = 1 << 2,
1795 MF_SOFT_OFFLINE = 1 << 3,
1801}; 1796};
1802extern int memory_failure(unsigned long pfn, int trapno, int flags); 1797extern int memory_failure(unsigned long pfn, int trapno, int flags);
1803extern void memory_failure_queue(unsigned long pfn, int trapno, int flags); 1798extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index 1397ccf81e91..cf55945c83fb 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -2,6 +2,7 @@
2#define LINUX_MM_INLINE_H 2#define LINUX_MM_INLINE_H
3 3
4#include <linux/huge_mm.h> 4#include <linux/huge_mm.h>
5#include <linux/swap.h>
5 6
6/** 7/**
7 * page_is_file_cache - should the page be on a file LRU or anon LRU? 8 * page_is_file_cache - should the page be on a file LRU or anon LRU?
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index faf4b7c1ad12..d9851eeb6e1d 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -322,6 +322,7 @@ struct mm_rss_stat {
322 atomic_long_t count[NR_MM_COUNTERS]; 322 atomic_long_t count[NR_MM_COUNTERS];
323}; 323};
324 324
325struct kioctx_table;
325struct mm_struct { 326struct mm_struct {
326 struct vm_area_struct * mmap; /* list of VMAs */ 327 struct vm_area_struct * mmap; /* list of VMAs */
327 struct rb_root mm_rb; 328 struct rb_root mm_rb;
@@ -383,8 +384,8 @@ struct mm_struct {
383 384
384 struct core_state *core_state; /* coredumping support */ 385 struct core_state *core_state; /* coredumping support */
385#ifdef CONFIG_AIO 386#ifdef CONFIG_AIO
386 spinlock_t ioctx_lock; 387 spinlock_t ioctx_lock;
387 struct hlist_head ioctx_list; 388 struct kioctx_table __rcu *ioctx_table;
388#endif 389#endif
389#ifdef CONFIG_MM_OWNER 390#ifdef CONFIG_MM_OWNER
390 /* 391 /*
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 443243b241d5..da51bec578c3 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -208,6 +208,8 @@ static inline void mmc_claim_host(struct mmc_host *host)
208 __mmc_claim_host(host, NULL); 208 __mmc_claim_host(host, NULL);
209} 209}
210 210
211struct device_node;
211extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max); 212extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
213extern int mmc_of_parse_voltage(struct device_node *np, u32 *mask);
212 214
213#endif /* LINUX_MMC_CORE_H */ 215#endif /* LINUX_MMC_CORE_H */
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index e3c6a74d980a..3e781b8c0be7 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -171,6 +171,7 @@ struct sdhci_host {
171 unsigned int ocr_avail_sdio; /* OCR bit masks */ 171 unsigned int ocr_avail_sdio; /* OCR bit masks */
172 unsigned int ocr_avail_sd; 172 unsigned int ocr_avail_sd;
173 unsigned int ocr_avail_mmc; 173 unsigned int ocr_avail_mmc;
174 u32 ocr_mask; /* available voltages */
174 175
175 wait_queue_head_t buf_ready_int; /* Waitqueue for Buffer Read Ready interrupt */ 176 wait_queue_head_t buf_ready_int; /* Waitqueue for Buffer Read Ready interrupt */
176 unsigned int tuning_done; /* Condition flag set when CMD19 succeeds */ 177 unsigned int tuning_done; /* Condition flag set when CMD19 succeeds */
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index e7d5dd67bb74..ccd8fb2cad52 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -16,7 +16,6 @@
16 16
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/sh_dma.h>
20 19
21/* 20/*
22 * MMCIF : CE_CLK_CTRL [19:16] 21 * MMCIF : CE_CLK_CTRL [19:16]
@@ -33,12 +32,12 @@
33 */ 32 */
34 33
35struct sh_mmcif_plat_data { 34struct sh_mmcif_plat_data {
36 void (*set_pwr)(struct platform_device *pdev, int state);
37 void (*down_pwr)(struct platform_device *pdev);
38 int (*get_cd)(struct platform_device *pdef); 35 int (*get_cd)(struct platform_device *pdef);
39 unsigned int slave_id_tx; /* embedded slave_id_[tr]x */ 36 unsigned int slave_id_tx; /* embedded slave_id_[tr]x */
40 unsigned int slave_id_rx; 37 unsigned int slave_id_rx;
41 bool use_cd_gpio : 1; 38 bool use_cd_gpio : 1;
39 bool ccs_unsupported : 1;
40 bool clk_ctrl2_present : 1;
42 unsigned int cd_gpio; 41 unsigned int cd_gpio;
43 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ 42 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */
44 unsigned long caps; 43 unsigned long caps;
@@ -62,6 +61,7 @@ struct sh_mmcif_plat_data {
62#define MMCIF_CE_INT_MASK 0x00000044 61#define MMCIF_CE_INT_MASK 0x00000044
63#define MMCIF_CE_HOST_STS1 0x00000048 62#define MMCIF_CE_HOST_STS1 0x00000048
64#define MMCIF_CE_HOST_STS2 0x0000004C 63#define MMCIF_CE_HOST_STS2 0x0000004C
64#define MMCIF_CE_CLK_CTRL2 0x00000070
65#define MMCIF_CE_VERSION 0x0000007C 65#define MMCIF_CE_VERSION 0x0000007C
66 66
67/* CE_BUF_ACC */ 67/* CE_BUF_ACC */
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
index b76bcf0621f6..68927ae50845 100644
--- a/include/linux/mmc/sh_mobile_sdhi.h
+++ b/include/linux/mmc/sh_mobile_sdhi.h
@@ -25,8 +25,6 @@ struct sh_mobile_sdhi_info {
25 unsigned long tmio_caps2; 25 unsigned long tmio_caps2;
26 u32 tmio_ocr_mask; /* available MMC voltages */ 26 u32 tmio_ocr_mask; /* available MMC voltages */
27 unsigned int cd_gpio; 27 unsigned int cd_gpio;
28 void (*set_pwr)(struct platform_device *pdev, int state);
29 int (*get_cd)(struct platform_device *pdev);
30 28
31 /* callbacks for board specific setup code */ 29 /* callbacks for board specific setup code */
32 int (*init)(struct platform_device *pdev, 30 int (*init)(struct platform_device *pdev,
diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h
index 7d88d27bfafa..b0c73e4cacea 100644
--- a/include/linux/mmc/slot-gpio.h
+++ b/include/linux/mmc/slot-gpio.h
@@ -18,7 +18,8 @@ int mmc_gpio_request_ro(struct mmc_host *host, unsigned int gpio);
18void mmc_gpio_free_ro(struct mmc_host *host); 18void mmc_gpio_free_ro(struct mmc_host *host);
19 19
20int mmc_gpio_get_cd(struct mmc_host *host); 20int mmc_gpio_get_cd(struct mmc_host *host);
21int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio); 21int mmc_gpio_request_cd(struct mmc_host *host, unsigned int gpio,
22 unsigned int debounce);
22void mmc_gpio_free_cd(struct mmc_host *host); 23void mmc_gpio_free_cd(struct mmc_host *host);
23 24
24#endif 25#endif
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index af4a3b77a8de..bd791e452ad7 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -105,6 +105,7 @@ struct zone_padding {
105enum zone_stat_item { 105enum zone_stat_item {
106 /* First 128 byte cacheline (assuming 64 bit words) */ 106 /* First 128 byte cacheline (assuming 64 bit words) */
107 NR_FREE_PAGES, 107 NR_FREE_PAGES,
108 NR_ALLOC_BATCH,
108 NR_LRU_BASE, 109 NR_LRU_BASE,
109 NR_INACTIVE_ANON = NR_LRU_BASE, /* must match order of LRU_[IN]ACTIVE */ 110 NR_INACTIVE_ANON = NR_LRU_BASE, /* must match order of LRU_[IN]ACTIVE */
110 NR_ACTIVE_ANON, /* " " " " " */ 111 NR_ACTIVE_ANON, /* " " " " " */
@@ -352,7 +353,6 @@ struct zone {
352 * free areas of different sizes 353 * free areas of different sizes
353 */ 354 */
354 spinlock_t lock; 355 spinlock_t lock;
355 int all_unreclaimable; /* All pages pinned */
356#if defined CONFIG_COMPACTION || defined CONFIG_CMA 356#if defined CONFIG_COMPACTION || defined CONFIG_CMA
357 /* Set to true when the PG_migrate_skip bits should be cleared */ 357 /* Set to true when the PG_migrate_skip bits should be cleared */
358 bool compact_blockskip_flush; 358 bool compact_blockskip_flush;
diff --git a/include/linux/module.h b/include/linux/module.h
index 46f1ea01e6f6..05f2447f8c15 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -42,6 +42,7 @@ struct module_kobject {
42 struct module *mod; 42 struct module *mod;
43 struct kobject *drivers_dir; 43 struct kobject *drivers_dir;
44 struct module_param_attrs *mp; 44 struct module_param_attrs *mp;
45 struct completion *kobj_completion;
45}; 46};
46 47
47struct module_attribute { 48struct module_attribute {
@@ -97,6 +98,11 @@ extern const struct gtype##_id __mod_##gtype##_table \
97/* For userspace: you can also call me... */ 98/* For userspace: you can also call me... */
98#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) 99#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
99 100
101/* Soft module dependencies. See man modprobe.d for details.
102 * Example: MODULE_SOFTDEP("pre: module-foo module-bar post: module-baz")
103 */
104#define MODULE_SOFTDEP(_softdep) MODULE_INFO(softdep, _softdep)
105
100/* 106/*
101 * The following license idents are currently accepted as indicating free 107 * The following license idents are currently accepted as indicating free
102 * software modules 108 * software modules
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 27d9da3f86ff..c3eb102a9cc8 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -36,7 +36,18 @@ static const char __UNIQUE_ID(name)[] \
36 36
37struct kernel_param; 37struct kernel_param;
38 38
39/*
40 * Flags available for kernel_param_ops
41 *
42 * NOARG - the parameter allows for no argument (foo instead of foo=1)
43 */
44enum {
45 KERNEL_PARAM_FL_NOARG = (1 << 0)
46};
47
39struct kernel_param_ops { 48struct kernel_param_ops {
49 /* How the ops should behave */
50 unsigned int flags;
40 /* Returns 0, or -errno. arg is in kp->arg. */ 51 /* Returns 0, or -errno. arg is in kp->arg. */
41 int (*set)(const char *val, const struct kernel_param *kp); 52 int (*set)(const char *val, const struct kernel_param *kp);
42 /* Returns length written or -errno. Buffer is 4k (ie. be short!) */ 53 /* Returns length written or -errno. Buffer is 4k (ie. be short!) */
@@ -187,7 +198,7 @@ struct kparam_array
187/* Obsolete - use module_param_cb() */ 198/* Obsolete - use module_param_cb() */
188#define module_param_call(name, set, get, arg, perm) \ 199#define module_param_call(name, set, get, arg, perm) \
189 static struct kernel_param_ops __param_ops_##name = \ 200 static struct kernel_param_ops __param_ops_##name = \
190 { (void *)set, (void *)get }; \ 201 { 0, (void *)set, (void *)get }; \
191 __module_param_call(MODULE_PARAM_PREFIX, \ 202 __module_param_call(MODULE_PARAM_PREFIX, \
192 name, &__param_ops_##name, arg, \ 203 name, &__param_ops_##name, arg, \
193 (perm) + sizeof(__check_old_set_param(set))*0, -1) 204 (perm) + sizeof(__check_old_set_param(set))*0, -1)
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 73005f9957ea..38cd98f112a0 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -48,6 +48,7 @@ struct mnt_namespace;
48#define MNT_INTERNAL 0x4000 48#define MNT_INTERNAL 0x4000
49 49
50#define MNT_LOCK_READONLY 0x400000 50#define MNT_LOCK_READONLY 0x400000
51#define MNT_LOCKED 0x800000
51 52
52struct vfsmount { 53struct vfsmount {
53 struct dentry *mnt_root; /* root of the mounted tree */ 54 struct dentry *mnt_root; /* root of the mounted tree */
diff --git a/include/linux/msi.h b/include/linux/msi.h
index ee66f3a12fb6..b17ead818aec 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -51,12 +51,31 @@ struct msi_desc {
51}; 51};
52 52
53/* 53/*
54 * The arch hook for setup up msi irqs 54 * The arch hooks to setup up msi irqs. Those functions are
55 * implemented as weak symbols so that they /can/ be overriden by
56 * architecture specific code if needed.
55 */ 57 */
56int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc); 58int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc);
57void arch_teardown_msi_irq(unsigned int irq); 59void arch_teardown_msi_irq(unsigned int irq);
58int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type); 60int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type);
59void arch_teardown_msi_irqs(struct pci_dev *dev); 61void arch_teardown_msi_irqs(struct pci_dev *dev);
60int arch_msi_check_device(struct pci_dev* dev, int nvec, int type); 62int arch_msi_check_device(struct pci_dev* dev, int nvec, int type);
63void arch_restore_msi_irqs(struct pci_dev *dev, int irq);
64
65void default_teardown_msi_irqs(struct pci_dev *dev);
66void default_restore_msi_irqs(struct pci_dev *dev, int irq);
67
68struct msi_chip {
69 struct module *owner;
70 struct device *dev;
71 struct device_node *of_node;
72 struct list_head list;
73
74 int (*setup_irq)(struct msi_chip *chip, struct pci_dev *dev,
75 struct msi_desc *desc);
76 void (*teardown_irq)(struct msi_chip *chip, unsigned int irq);
77 int (*check_device)(struct msi_chip *chip, struct pci_dev *dev,
78 int nvec, int type);
79};
61 80
62#endif /* LINUX_MSI_H */ 81#endif /* LINUX_MSI_H */
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
index 211ff67e8b0d..95fc482cef36 100644
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
@@ -93,8 +93,6 @@ struct nand_bbt_descr {
93#define NAND_BBT_CREATE_EMPTY 0x00000400 93#define NAND_BBT_CREATE_EMPTY 0x00000400
94/* Search good / bad pattern through all pages of a block */ 94/* Search good / bad pattern through all pages of a block */
95#define NAND_BBT_SCANALLPAGES 0x00000800 95#define NAND_BBT_SCANALLPAGES 0x00000800
96/* Scan block empty during good / bad block scan */
97#define NAND_BBT_SCANEMPTY 0x00001000
98/* Write bbt if neccecary */ 96/* Write bbt if neccecary */
99#define NAND_BBT_WRITE 0x00002000 97#define NAND_BBT_WRITE 0x00002000
100/* Read and write back block contents when writing bbt */ 98/* Read and write back block contents when writing bbt */
diff --git a/include/linux/mtd/fsmc.h b/include/linux/mtd/fsmc.h
index d6ed61ef451d..c8be32e9fc49 100644
--- a/include/linux/mtd/fsmc.h
+++ b/include/linux/mtd/fsmc.h
@@ -137,6 +137,7 @@ enum access_mode {
137 137
138/** 138/**
139 * fsmc_nand_platform_data - platform specific NAND controller config 139 * fsmc_nand_platform_data - platform specific NAND controller config
140 * @nand_timings: timing setup for the physical NAND interface
140 * @partitions: partition table for the platform, use a default fallback 141 * @partitions: partition table for the platform, use a default fallback
141 * if this is NULL 142 * if this is NULL
142 * @nr_partitions: the number of partitions in the previous entry 143 * @nr_partitions: the number of partitions in the previous entry
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index a5cf4e8d6818..f9bfe526d310 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -173,6 +173,9 @@ struct mtd_info {
173 /* ECC layout structure pointer - read only! */ 173 /* ECC layout structure pointer - read only! */
174 struct nand_ecclayout *ecclayout; 174 struct nand_ecclayout *ecclayout;
175 175
176 /* the ecc step size. */
177 unsigned int ecc_step_size;
178
176 /* max number of correctible bit errors per ecc step */ 179 /* max number of correctible bit errors per ecc step */
177 unsigned int ecc_strength; 180 unsigned int ecc_strength;
178 181
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index ab6363443ce8..ac8e89d5a792 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -56,7 +56,7 @@ extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
56 * is supported now. If you add a chip with bigger oobsize/page 56 * is supported now. If you add a chip with bigger oobsize/page
57 * adjust this accordingly. 57 * adjust this accordingly.
58 */ 58 */
59#define NAND_MAX_OOBSIZE 640 59#define NAND_MAX_OOBSIZE 744
60#define NAND_MAX_PAGESIZE 8192 60#define NAND_MAX_PAGESIZE 8192
61 61
62/* 62/*
@@ -202,6 +202,10 @@ typedef enum {
202/* Keep gcc happy */ 202/* Keep gcc happy */
203struct nand_chip; 203struct nand_chip;
204 204
205/* ONFI features */
206#define ONFI_FEATURE_16_BIT_BUS (1 << 0)
207#define ONFI_FEATURE_EXT_PARAM_PAGE (1 << 7)
208
205/* ONFI timing mode, used in both asynchronous and synchronous mode */ 209/* ONFI timing mode, used in both asynchronous and synchronous mode */
206#define ONFI_TIMING_MODE_0 (1 << 0) 210#define ONFI_TIMING_MODE_0 (1 << 0)
207#define ONFI_TIMING_MODE_1 (1 << 1) 211#define ONFI_TIMING_MODE_1 (1 << 1)
@@ -217,6 +221,9 @@ struct nand_chip;
217/* ONFI subfeature parameters length */ 221/* ONFI subfeature parameters length */
218#define ONFI_SUBFEATURE_PARAM_LEN 4 222#define ONFI_SUBFEATURE_PARAM_LEN 4
219 223
224/* ONFI optional commands SET/GET FEATURES supported? */
225#define ONFI_OPT_CMD_SET_GET_FEATURES (1 << 2)
226
220struct nand_onfi_params { 227struct nand_onfi_params {
221 /* rev info and features block */ 228 /* rev info and features block */
222 /* 'O' 'N' 'F' 'I' */ 229 /* 'O' 'N' 'F' 'I' */
@@ -224,7 +231,10 @@ struct nand_onfi_params {
224 __le16 revision; 231 __le16 revision;
225 __le16 features; 232 __le16 features;
226 __le16 opt_cmd; 233 __le16 opt_cmd;
227 u8 reserved[22]; 234 u8 reserved0[2];
235 __le16 ext_param_page_length; /* since ONFI 2.1 */
236 u8 num_of_param_pages; /* since ONFI 2.1 */
237 u8 reserved1[17];
228 238
229 /* manufacturer information block */ 239 /* manufacturer information block */
230 char manufacturer[12]; 240 char manufacturer[12];
@@ -281,6 +291,40 @@ struct nand_onfi_params {
281 291
282#define ONFI_CRC_BASE 0x4F4E 292#define ONFI_CRC_BASE 0x4F4E
283 293
294/* Extended ECC information Block Definition (since ONFI 2.1) */
295struct onfi_ext_ecc_info {
296 u8 ecc_bits;
297 u8 codeword_size;
298 __le16 bb_per_lun;
299 __le16 block_endurance;
300 u8 reserved[2];
301} __packed;
302
303#define ONFI_SECTION_TYPE_0 0 /* Unused section. */
304#define ONFI_SECTION_TYPE_1 1 /* for additional sections. */
305#define ONFI_SECTION_TYPE_2 2 /* for ECC information. */
306struct onfi_ext_section {
307 u8 type;
308 u8 length;
309} __packed;
310
311#define ONFI_EXT_SECTION_MAX 8
312
313/* Extended Parameter Page Definition (since ONFI 2.1) */
314struct onfi_ext_param_page {
315 __le16 crc;
316 u8 sig[4]; /* 'E' 'P' 'P' 'S' */
317 u8 reserved0[10];
318 struct onfi_ext_section sections[ONFI_EXT_SECTION_MAX];
319
320 /*
321 * The actual size of the Extended Parameter Page is in
322 * @ext_param_page_length of nand_onfi_params{}.
323 * The following are the variable length sections.
324 * So we do not add any fields below. Please see the ONFI spec.
325 */
326} __packed;
327
284/** 328/**
285 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices 329 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices
286 * @lock: protection lock 330 * @lock: protection lock
@@ -390,8 +434,8 @@ struct nand_buffers {
390 * @write_buf: [REPLACEABLE] write data from the buffer to the chip 434 * @write_buf: [REPLACEABLE] write data from the buffer to the chip
391 * @read_buf: [REPLACEABLE] read data from the chip into the buffer 435 * @read_buf: [REPLACEABLE] read data from the chip into the buffer
392 * @select_chip: [REPLACEABLE] select chip nr 436 * @select_chip: [REPLACEABLE] select chip nr
393 * @block_bad: [REPLACEABLE] check, if the block is bad 437 * @block_bad: [REPLACEABLE] check if a block is bad, using OOB markers
394 * @block_markbad: [REPLACEABLE] mark the block bad 438 * @block_markbad: [REPLACEABLE] mark a block bad
395 * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific function for controlling 439 * @cmd_ctrl: [BOARDSPECIFIC] hardwarespecific function for controlling
396 * ALE/CLE/nCE. Also used to write command and address 440 * ALE/CLE/nCE. Also used to write command and address
397 * @init_size: [BOARDSPECIFIC] hardwarespecific function for setting 441 * @init_size: [BOARDSPECIFIC] hardwarespecific function for setting
@@ -434,6 +478,12 @@ struct nand_buffers {
434 * bad block marker position; i.e., BBM == 11110111b is 478 * bad block marker position; i.e., BBM == 11110111b is
435 * not bad when badblockbits == 7 479 * not bad when badblockbits == 7
436 * @cellinfo: [INTERN] MLC/multichip data from chip ident 480 * @cellinfo: [INTERN] MLC/multichip data from chip ident
481 * @ecc_strength_ds: [INTERN] ECC correctability from the datasheet.
482 * Minimum amount of bit errors per @ecc_step_ds guaranteed
483 * to be correctable. If unknown, set to zero.
484 * @ecc_step_ds: [INTERN] ECC step required by the @ecc_strength_ds,
485 * also from the datasheet. It is the recommended ECC step
486 * size, if known; if unknown, set to zero.
437 * @numchips: [INTERN] number of physical chips 487 * @numchips: [INTERN] number of physical chips
438 * @chipsize: [INTERN] the size of one chip for multichip arrays 488 * @chipsize: [INTERN] the size of one chip for multichip arrays
439 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 489 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
@@ -510,6 +560,8 @@ struct nand_chip {
510 unsigned int pagebuf_bitflips; 560 unsigned int pagebuf_bitflips;
511 int subpagesize; 561 int subpagesize;
512 uint8_t cellinfo; 562 uint8_t cellinfo;
563 uint16_t ecc_strength_ds;
564 uint16_t ecc_step_ds;
513 int badblockpos; 565 int badblockpos;
514 int badblockbits; 566 int badblockbits;
515 567
@@ -576,6 +628,11 @@ struct nand_chip {
576 { .name = (nm), {{ .dev_id = (devid) }}, .chipsize = (chipsz), \ 628 { .name = (nm), {{ .dev_id = (devid) }}, .chipsize = (chipsz), \
577 .options = (opts) } 629 .options = (opts) }
578 630
631#define NAND_ECC_INFO(_strength, _step) \
632 { .strength_ds = (_strength), .step_ds = (_step) }
633#define NAND_ECC_STRENGTH(type) ((type)->ecc.strength_ds)
634#define NAND_ECC_STEP(type) ((type)->ecc.step_ds)
635
579/** 636/**
580 * struct nand_flash_dev - NAND Flash Device ID Structure 637 * struct nand_flash_dev - NAND Flash Device ID Structure
581 * @name: a human-readable name of the NAND chip 638 * @name: a human-readable name of the NAND chip
@@ -593,6 +650,12 @@ struct nand_chip {
593 * @options: stores various chip bit options 650 * @options: stores various chip bit options
594 * @id_len: The valid length of the @id. 651 * @id_len: The valid length of the @id.
595 * @oobsize: OOB size 652 * @oobsize: OOB size
653 * @ecc.strength_ds: The ECC correctability from the datasheet, same as the
654 * @ecc_strength_ds in nand_chip{}.
655 * @ecc.step_ds: The ECC step required by the @ecc.strength_ds, same as the
656 * @ecc_step_ds in nand_chip{}, also from the datasheet.
657 * For example, the "4bit ECC for each 512Byte" can be set with
658 * NAND_ECC_INFO(4, 512).
596 */ 659 */
597struct nand_flash_dev { 660struct nand_flash_dev {
598 char *name; 661 char *name;
@@ -609,6 +672,10 @@ struct nand_flash_dev {
609 unsigned int options; 672 unsigned int options;
610 uint16_t id_len; 673 uint16_t id_len;
611 uint16_t oobsize; 674 uint16_t oobsize;
675 struct {
676 uint16_t strength_ds;
677 uint16_t step_ds;
678 } ecc;
612}; 679};
613 680
614/** 681/**
@@ -625,8 +692,8 @@ extern struct nand_flash_dev nand_flash_ids[];
625extern struct nand_manufacturers nand_manuf_ids[]; 692extern struct nand_manufacturers nand_manuf_ids[];
626 693
627extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd); 694extern int nand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd);
628extern int nand_update_bbt(struct mtd_info *mtd, loff_t offs);
629extern int nand_default_bbt(struct mtd_info *mtd); 695extern int nand_default_bbt(struct mtd_info *mtd);
696extern int nand_markbad_bbt(struct mtd_info *mtd, loff_t offs);
630extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt); 697extern int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt);
631extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr, 698extern int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
632 int allowbbt); 699 int allowbbt);
@@ -708,6 +775,12 @@ struct platform_nand_chip *get_platform_nandchip(struct mtd_info *mtd)
708 return chip->priv; 775 return chip->priv;
709} 776}
710 777
778/* return the supported features. */
779static inline int onfi_feature(struct nand_chip *chip)
780{
781 return chip->onfi_version ? le16_to_cpu(chip->onfi_params.features) : 0;
782}
783
711/* return the supported asynchronous timing mode. */ 784/* return the supported asynchronous timing mode. */
712static inline int onfi_get_async_timing_mode(struct nand_chip *chip) 785static inline int onfi_get_async_timing_mode(struct nand_chip *chip)
713{ 786{
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index ccd4260834c5..bab49da8a0f0 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -15,8 +15,8 @@
15#include <linux/spinlock_types.h> 15#include <linux/spinlock_types.h>
16#include <linux/linkage.h> 16#include <linux/linkage.h>
17#include <linux/lockdep.h> 17#include <linux/lockdep.h>
18
19#include <linux/atomic.h> 18#include <linux/atomic.h>
19#include <asm/processor.h>
20 20
21/* 21/*
22 * Simple, straightforward mutexes with strict semantics: 22 * Simple, straightforward mutexes with strict semantics:
@@ -175,8 +175,8 @@ extern void mutex_unlock(struct mutex *lock);
175 175
176extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock); 176extern int atomic_dec_and_mutex_lock(atomic_t *cnt, struct mutex *lock);
177 177
178#ifndef CONFIG_HAVE_ARCH_MUTEX_CPU_RELAX 178#ifndef arch_mutex_cpu_relax
179#define arch_mutex_cpu_relax() cpu_relax() 179# define arch_mutex_cpu_relax() cpu_relax()
180#endif 180#endif
181 181
182#endif 182#endif
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index 6e8215b15998..61a0da38d0cb 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -6,6 +6,7 @@
6#define __LINUX_MV643XX_ETH_H 6#define __LINUX_MV643XX_ETH_H
7 7
8#include <linux/mbus.h> 8#include <linux/mbus.h>
9#include <linux/if_ether.h>
9 10
10#define MV643XX_ETH_SHARED_NAME "mv643xx_eth" 11#define MV643XX_ETH_SHARED_NAME "mv643xx_eth"
11#define MV643XX_ETH_NAME "mv643xx_eth_port" 12#define MV643XX_ETH_NAME "mv643xx_eth_port"
@@ -48,7 +49,7 @@ struct mv643xx_eth_platform_data {
48 * Use this MAC address if it is valid, overriding the 49 * Use this MAC address if it is valid, overriding the
49 * address that is already in the hardware. 50 * address that is already in the hardware.
50 */ 51 */
51 u8 mac_addr[6]; 52 u8 mac_addr[ETH_ALEN];
52 53
53 /* 54 /*
54 * If speed is 0, autonegotiation is enabled. 55 * If speed is 0, autonegotiation is enabled.
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 5a5ff57ceed4..8e47bc7a1665 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -70,8 +70,7 @@ extern struct dentry *kern_path_create(int, const char *, struct path *, unsigne
70extern struct dentry *user_path_create(int, const char __user *, struct path *, unsigned int); 70extern struct dentry *user_path_create(int, const char __user *, struct path *, unsigned int);
71extern void done_path_create(struct path *, struct dentry *); 71extern void done_path_create(struct path *, struct dentry *);
72extern struct dentry *kern_path_locked(const char *, struct path *); 72extern struct dentry *kern_path_locked(const char *, struct path *);
73extern int vfs_path_lookup(struct dentry *, struct vfsmount *, 73extern int kern_path_mountpoint(int, const char *, struct path *, unsigned int);
74 const char *, unsigned int, struct path *);
75 74
76extern struct dentry *lookup_one_len(const char *, struct dentry *, int); 75extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
77 76
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9a4156845e93..25f5d2d11e7c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -728,6 +728,16 @@ struct netdev_fcoe_hbainfo {
728}; 728};
729#endif 729#endif
730 730
731#define MAX_PHYS_PORT_ID_LEN 32
732
733/* This structure holds a unique identifier to identify the
734 * physical port used by a netdevice.
735 */
736struct netdev_phys_port_id {
737 unsigned char id[MAX_PHYS_PORT_ID_LEN];
738 unsigned char id_len;
739};
740
731/* 741/*
732 * This structure defines the management hooks for network devices. 742 * This structure defines the management hooks for network devices.
733 * The following hooks can be defined; unless noted otherwise, they are 743 * The following hooks can be defined; unless noted otherwise, they are
@@ -932,6 +942,25 @@ struct netdev_fcoe_hbainfo {
932 * that determine carrier state from physical hardware properties (eg 942 * that determine carrier state from physical hardware properties (eg
933 * network cables) or protocol-dependent mechanisms (eg 943 * network cables) or protocol-dependent mechanisms (eg
934 * USB_CDC_NOTIFY_NETWORK_CONNECTION) should NOT implement this function. 944 * USB_CDC_NOTIFY_NETWORK_CONNECTION) should NOT implement this function.
945 *
946 * int (*ndo_get_phys_port_id)(struct net_device *dev,
947 * struct netdev_phys_port_id *ppid);
948 * Called to get ID of physical port of this device. If driver does
949 * not implement this, it is assumed that the hw is not able to have
950 * multiple net devices on single physical port.
951 *
952 * void (*ndo_add_vxlan_port)(struct net_device *dev,
953 * sa_family_t sa_family, __be16 port);
954 * Called by vxlan to notiy a driver about the UDP port and socket
955 * address family that vxlan is listnening to. It is called only when
956 * a new port starts listening. The operation is protected by the
957 * vxlan_net->sock_lock.
958 *
959 * void (*ndo_del_vxlan_port)(struct net_device *dev,
960 * sa_family_t sa_family, __be16 port);
961 * Called by vxlan to notify the driver about a UDP port and socket
962 * address family that vxlan is not listening to anymore. The operation
963 * is protected by the vxlan_net->sock_lock.
935 */ 964 */
936struct net_device_ops { 965struct net_device_ops {
937 int (*ndo_init)(struct net_device *dev); 966 int (*ndo_init)(struct net_device *dev);
@@ -1060,6 +1089,14 @@ struct net_device_ops {
1060 struct nlmsghdr *nlh); 1089 struct nlmsghdr *nlh);
1061 int (*ndo_change_carrier)(struct net_device *dev, 1090 int (*ndo_change_carrier)(struct net_device *dev,
1062 bool new_carrier); 1091 bool new_carrier);
1092 int (*ndo_get_phys_port_id)(struct net_device *dev,
1093 struct netdev_phys_port_id *ppid);
1094 void (*ndo_add_vxlan_port)(struct net_device *dev,
1095 sa_family_t sa_family,
1096 __be16 port);
1097 void (*ndo_del_vxlan_port)(struct net_device *dev,
1098 sa_family_t sa_family,
1099 __be16 port);
1063}; 1100};
1064 1101
1065/* 1102/*
@@ -1107,6 +1144,7 @@ struct net_device {
1107 struct list_head napi_list; 1144 struct list_head napi_list;
1108 struct list_head unreg_list; 1145 struct list_head unreg_list;
1109 struct list_head upper_dev_list; /* List of upper devices */ 1146 struct list_head upper_dev_list; /* List of upper devices */
1147 struct list_head lower_dev_list;
1110 1148
1111 1149
1112 /* currently active device features */ 1150 /* currently active device features */
@@ -1633,6 +1671,7 @@ struct packet_offload {
1633#define NETDEV_NOTIFY_PEERS 0x0013 1671#define NETDEV_NOTIFY_PEERS 0x0013
1634#define NETDEV_JOIN 0x0014 1672#define NETDEV_JOIN 0x0014
1635#define NETDEV_CHANGEUPPER 0x0015 1673#define NETDEV_CHANGEUPPER 0x0015
1674#define NETDEV_RESEND_IGMP 0x0016
1636 1675
1637extern int register_netdevice_notifier(struct notifier_block *nb); 1676extern int register_netdevice_notifier(struct notifier_block *nb);
1638extern int unregister_netdevice_notifier(struct notifier_block *nb); 1677extern int unregister_netdevice_notifier(struct notifier_block *nb);
@@ -1665,9 +1704,6 @@ extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1665 1704
1666extern rwlock_t dev_base_lock; /* Device list lock */ 1705extern rwlock_t dev_base_lock; /* Device list lock */
1667 1706
1668extern seqcount_t devnet_rename_seq; /* Device rename seq */
1669
1670
1671#define for_each_netdev(net, d) \ 1707#define for_each_netdev(net, d) \
1672 list_for_each_entry(d, &(net)->dev_base_head, dev_list) 1708 list_for_each_entry(d, &(net)->dev_base_head, dev_list)
1673#define for_each_netdev_reverse(net, d) \ 1709#define for_each_netdev_reverse(net, d) \
@@ -2065,6 +2101,15 @@ static inline void netdev_tx_sent_queue(struct netdev_queue *dev_queue,
2065#endif 2101#endif
2066} 2102}
2067 2103
2104/**
2105 * netdev_sent_queue - report the number of bytes queued to hardware
2106 * @dev: network device
2107 * @bytes: number of bytes queued to the hardware device queue
2108 *
2109 * Report the number of bytes queued for sending/completion to the network
2110 * device hardware queue. @bytes should be a good approximation and should
2111 * exactly match netdev_completed_queue() @bytes
2112 */
2068static inline void netdev_sent_queue(struct net_device *dev, unsigned int bytes) 2113static inline void netdev_sent_queue(struct net_device *dev, unsigned int bytes)
2069{ 2114{
2070 netdev_tx_sent_queue(netdev_get_tx_queue(dev, 0), bytes); 2115 netdev_tx_sent_queue(netdev_get_tx_queue(dev, 0), bytes);
@@ -2094,6 +2139,16 @@ static inline void netdev_tx_completed_queue(struct netdev_queue *dev_queue,
2094#endif 2139#endif
2095} 2140}
2096 2141
2142/**
2143 * netdev_completed_queue - report bytes and packets completed by device
2144 * @dev: network device
2145 * @pkts: actual number of packets sent over the medium
2146 * @bytes: actual number of bytes sent over the medium
2147 *
2148 * Report the number of bytes and packets transmitted by the network device
2149 * hardware queue over the physical medium, @bytes must exactly match the
2150 * @bytes amount passed to netdev_sent_queue()
2151 */
2097static inline void netdev_completed_queue(struct net_device *dev, 2152static inline void netdev_completed_queue(struct net_device *dev,
2098 unsigned int pkts, unsigned int bytes) 2153 unsigned int pkts, unsigned int bytes)
2099{ 2154{
@@ -2108,6 +2163,13 @@ static inline void netdev_tx_reset_queue(struct netdev_queue *q)
2108#endif 2163#endif
2109} 2164}
2110 2165
2166/**
2167 * netdev_reset_queue - reset the packets and bytes count of a network device
2168 * @dev_queue: network device
2169 *
2170 * Reset the bytes and packet count of a network device and clear the
2171 * software flow control OFF bit for this network device
2172 */
2111static inline void netdev_reset_queue(struct net_device *dev_queue) 2173static inline void netdev_reset_queue(struct net_device *dev_queue)
2112{ 2174{
2113 netdev_tx_reset_queue(netdev_get_tx_queue(dev_queue, 0)); 2175 netdev_tx_reset_queue(netdev_get_tx_queue(dev_queue, 0));
@@ -2202,11 +2264,12 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
2202} 2264}
2203 2265
2204#ifdef CONFIG_XPS 2266#ifdef CONFIG_XPS
2205extern int netif_set_xps_queue(struct net_device *dev, struct cpumask *mask, 2267extern int netif_set_xps_queue(struct net_device *dev,
2268 const struct cpumask *mask,
2206 u16 index); 2269 u16 index);
2207#else 2270#else
2208static inline int netif_set_xps_queue(struct net_device *dev, 2271static inline int netif_set_xps_queue(struct net_device *dev,
2209 struct cpumask *mask, 2272 const struct cpumask *mask,
2210 u16 index) 2273 u16 index)
2211{ 2274{
2212 return 0; 2275 return 0;
@@ -2317,6 +2380,8 @@ extern int dev_set_mac_address(struct net_device *,
2317 struct sockaddr *); 2380 struct sockaddr *);
2318extern int dev_change_carrier(struct net_device *, 2381extern int dev_change_carrier(struct net_device *,
2319 bool new_carrier); 2382 bool new_carrier);
2383extern int dev_get_phys_port_id(struct net_device *dev,
2384 struct netdev_phys_port_id *ppid);
2320extern int dev_hard_start_xmit(struct sk_buff *skb, 2385extern int dev_hard_start_xmit(struct sk_buff *skb,
2321 struct net_device *dev, 2386 struct net_device *dev,
2322 struct netdev_queue *txq); 2387 struct netdev_queue *txq);
@@ -2749,6 +2814,16 @@ extern int bpf_jit_enable;
2749extern bool netdev_has_upper_dev(struct net_device *dev, 2814extern bool netdev_has_upper_dev(struct net_device *dev,
2750 struct net_device *upper_dev); 2815 struct net_device *upper_dev);
2751extern bool netdev_has_any_upper_dev(struct net_device *dev); 2816extern bool netdev_has_any_upper_dev(struct net_device *dev);
2817extern struct net_device *netdev_upper_get_next_dev_rcu(struct net_device *dev,
2818 struct list_head **iter);
2819
2820/* iterate through upper list, must be called under RCU read lock */
2821#define netdev_for_each_upper_dev_rcu(dev, upper, iter) \
2822 for (iter = &(dev)->upper_dev_list, \
2823 upper = netdev_upper_get_next_dev_rcu(dev, &(iter)); \
2824 upper; \
2825 upper = netdev_upper_get_next_dev_rcu(dev, &(iter)))
2826
2752extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev); 2827extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
2753extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); 2828extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
2754extern int netdev_upper_dev_link(struct net_device *dev, 2829extern int netdev_upper_dev_link(struct net_device *dev,
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index de70f7b45b68..708fe72ab913 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -314,25 +314,24 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
314#endif /*CONFIG_NETFILTER*/ 314#endif /*CONFIG_NETFILTER*/
315 315
316#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 316#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
317extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu; 317extern void (*ip_ct_attach)(struct sk_buff *, const struct sk_buff *) __rcu;
318extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); 318extern void nf_ct_attach(struct sk_buff *, const struct sk_buff *);
319extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu; 319extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu;
320 320
321struct nf_conn; 321struct nf_conn;
322enum ip_conntrack_info;
322struct nlattr; 323struct nlattr;
323 324
324struct nfq_ct_hook { 325struct nfq_ct_hook {
325 size_t (*build_size)(const struct nf_conn *ct); 326 size_t (*build_size)(const struct nf_conn *ct);
326 int (*build)(struct sk_buff *skb, struct nf_conn *ct); 327 int (*build)(struct sk_buff *skb, struct nf_conn *ct);
327 int (*parse)(const struct nlattr *attr, struct nf_conn *ct); 328 int (*parse)(const struct nlattr *attr, struct nf_conn *ct);
328}; 329 int (*attach_expect)(const struct nlattr *attr, struct nf_conn *ct,
329extern struct nfq_ct_hook __rcu *nfq_ct_hook; 330 u32 portid, u32 report);
330
331struct nfq_ct_nat_hook {
332 void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct, 331 void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct,
333 u32 ctinfo, int off); 332 enum ip_conntrack_info ctinfo, s32 off);
334}; 333};
335extern struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook; 334extern struct nfq_ct_hook __rcu *nfq_ct_hook;
336#else 335#else
337static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} 336static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
338#endif 337#endif
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index d80e2753847c..9ac9fbde7b61 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -296,10 +296,12 @@ ip_set_eexist(int ret, u32 flags)
296 296
297/* Match elements marked with nomatch */ 297/* Match elements marked with nomatch */
298static inline bool 298static inline bool
299ip_set_enomatch(int ret, u32 flags, enum ipset_adt adt) 299ip_set_enomatch(int ret, u32 flags, enum ipset_adt adt, struct ip_set *set)
300{ 300{
301 return adt == IPSET_TEST && 301 return adt == IPSET_TEST &&
302 ret == -ENOTEMPTY && ((flags >> 16) & IPSET_FLAG_NOMATCH); 302 (set->type->features & IPSET_TYPE_NOMATCH) &&
303 ((flags >> 16) & IPSET_FLAG_NOMATCH) &&
304 (ret > 0 || ret == -ENOTEMPTY);
303} 305}
304 306
305/* Check the NLA_F_NET_BYTEORDER flag */ 307/* Check the NLA_F_NET_BYTEORDER flag */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 7125cef74164..3ea4cde8701c 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -524,6 +524,7 @@ static inline void nfs4_label_free(void *label) {}
524 * linux/fs/nfs/unlink.c 524 * linux/fs/nfs/unlink.c
525 */ 525 */
526extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); 526extern void nfs_complete_unlink(struct dentry *dentry, struct inode *);
527extern void nfs_wait_on_sillyrename(struct dentry *dentry);
527extern void nfs_block_sillyrename(struct dentry *dentry); 528extern void nfs_block_sillyrename(struct dentry *dentry);
528extern void nfs_unblock_sillyrename(struct dentry *dentry); 529extern void nfs_unblock_sillyrename(struct dentry *dentry);
529extern int nfs_sillyrename(struct inode *dir, struct dentry *dentry); 530extern int nfs_sillyrename(struct inode *dir, struct dentry *dentry);
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index d2212432c456..b8cedced50c9 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -56,6 +56,7 @@ struct nfs_client {
56 struct rpc_cred *cl_machine_cred; 56 struct rpc_cred *cl_machine_cred;
57 57
58#if IS_ENABLED(CONFIG_NFS_V4) 58#if IS_ENABLED(CONFIG_NFS_V4)
59 struct list_head cl_ds_clients; /* auth flavor data servers */
59 u64 cl_clientid; /* constant */ 60 u64 cl_clientid; /* constant */
60 nfs4_verifier cl_confirm; /* Clientid verifier */ 61 nfs4_verifier cl_confirm; /* Clientid verifier */
61 unsigned long cl_state; 62 unsigned long cl_state;
@@ -78,6 +79,9 @@ struct nfs_client {
78 u32 cl_cb_ident; /* v4.0 callback identifier */ 79 u32 cl_cb_ident; /* v4.0 callback identifier */
79 const struct nfs4_minor_version_ops *cl_mvops; 80 const struct nfs4_minor_version_ops *cl_mvops;
80 81
82 /* NFSv4.0 transport blocking */
83 struct nfs4_slot_table *cl_slot_tbl;
84
81 /* The sequence id to use for the next CREATE_SESSION */ 85 /* The sequence id to use for the next CREATE_SESSION */
82 u32 cl_seqid; 86 u32 cl_seqid;
83 /* The flags used for obtaining the clientid during EXCHANGE_ID */ 87 /* The flags used for obtaining the clientid during EXCHANGE_ID */
@@ -87,6 +91,15 @@ struct nfs_client {
87 struct nfs41_server_owner *cl_serverowner; 91 struct nfs41_server_owner *cl_serverowner;
88 struct nfs41_server_scope *cl_serverscope; 92 struct nfs41_server_scope *cl_serverscope;
89 struct nfs41_impl_id *cl_implid; 93 struct nfs41_impl_id *cl_implid;
94 /* nfs 4.1+ state protection modes: */
95 unsigned long cl_sp4_flags;
96#define NFS_SP4_MACH_CRED_MINIMAL 1 /* Minimal sp4_mach_cred - state ops
97 * must use machine cred */
98#define NFS_SP4_MACH_CRED_CLEANUP 2 /* CLOSE and LOCKU */
99#define NFS_SP4_MACH_CRED_SECINFO 3 /* SECINFO and SECINFO_NO_NAME */
100#define NFS_SP4_MACH_CRED_STATEID 4 /* TEST_STATEID and FREE_STATEID */
101#define NFS_SP4_MACH_CRED_WRITE 5 /* WRITE */
102#define NFS_SP4_MACH_CRED_COMMIT 6 /* COMMIT */
90#endif /* CONFIG_NFS_V4 */ 103#endif /* CONFIG_NFS_V4 */
91 104
92#ifdef CONFIG_NFS_FSCACHE 105#ifdef CONFIG_NFS_FSCACHE
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 8651574a305b..49f52c8f4422 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1107,6 +1107,23 @@ struct pnfs_ds_commit_info {
1107 struct pnfs_commit_bucket *buckets; 1107 struct pnfs_commit_bucket *buckets;
1108}; 1108};
1109 1109
1110#define NFS4_OP_MAP_NUM_LONGS \
1111 DIV_ROUND_UP(LAST_NFS4_OP, 8 * sizeof(unsigned long))
1112#define NFS4_OP_MAP_NUM_WORDS \
1113 (NFS4_OP_MAP_NUM_LONGS * sizeof(unsigned long) / sizeof(u32))
1114struct nfs4_op_map {
1115 union {
1116 unsigned long longs[NFS4_OP_MAP_NUM_LONGS];
1117 u32 words[NFS4_OP_MAP_NUM_WORDS];
1118 } u;
1119};
1120
1121struct nfs41_state_protection {
1122 u32 how;
1123 struct nfs4_op_map enforce;
1124 struct nfs4_op_map allow;
1125};
1126
1110#define NFS4_EXCHANGE_ID_LEN (48) 1127#define NFS4_EXCHANGE_ID_LEN (48)
1111struct nfs41_exchange_id_args { 1128struct nfs41_exchange_id_args {
1112 struct nfs_client *client; 1129 struct nfs_client *client;
@@ -1114,6 +1131,7 @@ struct nfs41_exchange_id_args {
1114 unsigned int id_len; 1131 unsigned int id_len;
1115 char id[NFS4_EXCHANGE_ID_LEN]; 1132 char id[NFS4_EXCHANGE_ID_LEN];
1116 u32 flags; 1133 u32 flags;
1134 struct nfs41_state_protection state_protect;
1117}; 1135};
1118 1136
1119struct nfs41_server_owner { 1137struct nfs41_server_owner {
@@ -1146,6 +1164,7 @@ struct nfs41_exchange_id_res {
1146 struct nfs41_server_owner *server_owner; 1164 struct nfs41_server_owner *server_owner;
1147 struct nfs41_server_scope *server_scope; 1165 struct nfs41_server_scope *server_scope;
1148 struct nfs41_impl_id *impl_id; 1166 struct nfs41_impl_id *impl_id;
1167 struct nfs41_state_protection state_protect;
1149}; 1168};
1150 1169
1151struct nfs41_create_session_args { 1170struct nfs41_create_session_args {
@@ -1419,12 +1438,12 @@ struct nfs_rpc_ops {
1419 void (*read_setup) (struct nfs_read_data *, struct rpc_message *); 1438 void (*read_setup) (struct nfs_read_data *, struct rpc_message *);
1420 void (*read_pageio_init)(struct nfs_pageio_descriptor *, struct inode *, 1439 void (*read_pageio_init)(struct nfs_pageio_descriptor *, struct inode *,
1421 const struct nfs_pgio_completion_ops *); 1440 const struct nfs_pgio_completion_ops *);
1422 void (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *); 1441 int (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *);
1423 int (*read_done) (struct rpc_task *, struct nfs_read_data *); 1442 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
1424 void (*write_setup) (struct nfs_write_data *, struct rpc_message *); 1443 void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
1425 void (*write_pageio_init)(struct nfs_pageio_descriptor *, struct inode *, int, 1444 void (*write_pageio_init)(struct nfs_pageio_descriptor *, struct inode *, int,
1426 const struct nfs_pgio_completion_ops *); 1445 const struct nfs_pgio_completion_ops *);
1427 void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *); 1446 int (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *);
1428 int (*write_done) (struct rpc_task *, struct nfs_write_data *); 1447 int (*write_done) (struct rpc_task *, struct nfs_write_data *);
1429 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *); 1448 void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *);
1430 void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *); 1449 void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *);
@@ -1436,13 +1455,14 @@ struct nfs_rpc_ops {
1436 struct inode * (*open_context) (struct inode *dir, 1455 struct inode * (*open_context) (struct inode *dir,
1437 struct nfs_open_context *ctx, 1456 struct nfs_open_context *ctx,
1438 int open_flags, 1457 int open_flags,
1439 struct iattr *iattr); 1458 struct iattr *iattr,
1459 int *);
1440 int (*have_delegation)(struct inode *, fmode_t); 1460 int (*have_delegation)(struct inode *, fmode_t);
1441 int (*return_delegation)(struct inode *); 1461 int (*return_delegation)(struct inode *);
1442 struct nfs_client *(*alloc_client) (const struct nfs_client_initdata *); 1462 struct nfs_client *(*alloc_client) (const struct nfs_client_initdata *);
1443 struct nfs_client * 1463 struct nfs_client *
1444 (*init_client) (struct nfs_client *, const struct rpc_timeout *, 1464 (*init_client) (struct nfs_client *, const struct rpc_timeout *,
1445 const char *, rpc_authflavor_t); 1465 const char *);
1446 void (*free_client) (struct nfs_client *); 1466 void (*free_client) (struct nfs_client *);
1447 struct nfs_server *(*create_server)(struct nfs_mount_info *, struct nfs_subversion *); 1467 struct nfs_server *(*create_server)(struct nfs_mount_info *, struct nfs_subversion *);
1448 struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *, 1468 struct nfs_server *(*clone_server)(struct nfs_server *, struct nfs_fh *,
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 4e2cbfa640b7..58b9a02c38d2 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -98,8 +98,17 @@
98typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t; 98typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;
99extern nodemask_t _unused_nodemask_arg_; 99extern nodemask_t _unused_nodemask_arg_;
100 100
101/*
102 * The inline keyword gives the compiler room to decide to inline, or
103 * not inline a function as it sees best. However, as these functions
104 * are called in both __init and non-__init functions, if they are not
105 * inlined we will end up with a section mis-match error (of the type of
106 * freeable items not being freed). So we must use __always_inline here
107 * to fix the problem. If other functions in the future also end up in
108 * this situation they will also need to be annotated as __always_inline
109 */
101#define node_set(node, dst) __node_set((node), &(dst)) 110#define node_set(node, dst) __node_set((node), &(dst))
102static inline void __node_set(int node, volatile nodemask_t *dstp) 111static __always_inline void __node_set(int node, volatile nodemask_t *dstp)
103{ 112{
104 set_bit(node, dstp->bits); 113 set_bit(node, dstp->bits);
105} 114}
diff --git a/include/linux/nvme.h b/include/linux/nvme.h
index f451c8d6e231..26ebcf41c213 100644
--- a/include/linux/nvme.h
+++ b/include/linux/nvme.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * Definitions for the NVM Express interface 2 * Definitions for the NVM Express interface
3 * Copyright (c) 2011, Intel Corporation. 3 * Copyright (c) 2011-2013, Intel Corporation.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 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, 6 * under the terms and conditions of the GNU General Public License,
@@ -19,7 +19,10 @@
19#ifndef _LINUX_NVME_H 19#ifndef _LINUX_NVME_H
20#define _LINUX_NVME_H 20#define _LINUX_NVME_H
21 21
22#include <linux/types.h> 22#include <uapi/linux/nvme.h>
23#include <linux/pci.h>
24#include <linux/miscdevice.h>
25#include <linux/kref.h>
23 26
24struct nvme_bar { 27struct nvme_bar {
25 __u64 cap; /* Controller Capabilities */ 28 __u64 cap; /* Controller Capabilities */
@@ -50,6 +53,7 @@ enum {
50 NVME_CC_SHN_NONE = 0 << 14, 53 NVME_CC_SHN_NONE = 0 << 14,
51 NVME_CC_SHN_NORMAL = 1 << 14, 54 NVME_CC_SHN_NORMAL = 1 << 14,
52 NVME_CC_SHN_ABRUPT = 2 << 14, 55 NVME_CC_SHN_ABRUPT = 2 << 14,
56 NVME_CC_SHN_MASK = 3 << 14,
53 NVME_CC_IOSQES = 6 << 16, 57 NVME_CC_IOSQES = 6 << 16,
54 NVME_CC_IOCQES = 4 << 20, 58 NVME_CC_IOCQES = 4 << 20,
55 NVME_CSTS_RDY = 1 << 0, 59 NVME_CSTS_RDY = 1 << 0,
@@ -57,462 +61,11 @@ enum {
57 NVME_CSTS_SHST_NORMAL = 0 << 2, 61 NVME_CSTS_SHST_NORMAL = 0 << 2,
58 NVME_CSTS_SHST_OCCUR = 1 << 2, 62 NVME_CSTS_SHST_OCCUR = 1 << 2,
59 NVME_CSTS_SHST_CMPLT = 2 << 2, 63 NVME_CSTS_SHST_CMPLT = 2 << 2,
60}; 64 NVME_CSTS_SHST_MASK = 3 << 2,
61
62struct nvme_id_power_state {
63 __le16 max_power; /* centiwatts */
64 __u16 rsvd2;
65 __le32 entry_lat; /* microseconds */
66 __le32 exit_lat; /* microseconds */
67 __u8 read_tput;
68 __u8 read_lat;
69 __u8 write_tput;
70 __u8 write_lat;
71 __u8 rsvd16[16];
72}; 65};
73 66
74#define NVME_VS(major, minor) (major << 16 | minor) 67#define NVME_VS(major, minor) (major << 16 | minor)
75 68
76struct nvme_id_ctrl {
77 __le16 vid;
78 __le16 ssvid;
79 char sn[20];
80 char mn[40];
81 char fr[8];
82 __u8 rab;
83 __u8 ieee[3];
84 __u8 mic;
85 __u8 mdts;
86 __u8 rsvd78[178];
87 __le16 oacs;
88 __u8 acl;
89 __u8 aerl;
90 __u8 frmw;
91 __u8 lpa;
92 __u8 elpe;
93 __u8 npss;
94 __u8 rsvd264[248];
95 __u8 sqes;
96 __u8 cqes;
97 __u8 rsvd514[2];
98 __le32 nn;
99 __le16 oncs;
100 __le16 fuses;
101 __u8 fna;
102 __u8 vwc;
103 __le16 awun;
104 __le16 awupf;
105 __u8 rsvd530[1518];
106 struct nvme_id_power_state psd[32];
107 __u8 vs[1024];
108};
109
110enum {
111 NVME_CTRL_ONCS_COMPARE = 1 << 0,
112 NVME_CTRL_ONCS_WRITE_UNCORRECTABLE = 1 << 1,
113 NVME_CTRL_ONCS_DSM = 1 << 2,
114};
115
116struct nvme_lbaf {
117 __le16 ms;
118 __u8 ds;
119 __u8 rp;
120};
121
122struct nvme_id_ns {
123 __le64 nsze;
124 __le64 ncap;
125 __le64 nuse;
126 __u8 nsfeat;
127 __u8 nlbaf;
128 __u8 flbas;
129 __u8 mc;
130 __u8 dpc;
131 __u8 dps;
132 __u8 rsvd30[98];
133 struct nvme_lbaf lbaf[16];
134 __u8 rsvd192[192];
135 __u8 vs[3712];
136};
137
138enum {
139 NVME_NS_FEAT_THIN = 1 << 0,
140 NVME_LBAF_RP_BEST = 0,
141 NVME_LBAF_RP_BETTER = 1,
142 NVME_LBAF_RP_GOOD = 2,
143 NVME_LBAF_RP_DEGRADED = 3,
144};
145
146struct nvme_smart_log {
147 __u8 critical_warning;
148 __u8 temperature[2];
149 __u8 avail_spare;
150 __u8 spare_thresh;
151 __u8 percent_used;
152 __u8 rsvd6[26];
153 __u8 data_units_read[16];
154 __u8 data_units_written[16];
155 __u8 host_reads[16];
156 __u8 host_writes[16];
157 __u8 ctrl_busy_time[16];
158 __u8 power_cycles[16];
159 __u8 power_on_hours[16];
160 __u8 unsafe_shutdowns[16];
161 __u8 media_errors[16];
162 __u8 num_err_log_entries[16];
163 __u8 rsvd192[320];
164};
165
166enum {
167 NVME_SMART_CRIT_SPARE = 1 << 0,
168 NVME_SMART_CRIT_TEMPERATURE = 1 << 1,
169 NVME_SMART_CRIT_RELIABILITY = 1 << 2,
170 NVME_SMART_CRIT_MEDIA = 1 << 3,
171 NVME_SMART_CRIT_VOLATILE_MEMORY = 1 << 4,
172};
173
174struct nvme_lba_range_type {
175 __u8 type;
176 __u8 attributes;
177 __u8 rsvd2[14];
178 __u64 slba;
179 __u64 nlb;
180 __u8 guid[16];
181 __u8 rsvd48[16];
182};
183
184enum {
185 NVME_LBART_TYPE_FS = 0x01,
186 NVME_LBART_TYPE_RAID = 0x02,
187 NVME_LBART_TYPE_CACHE = 0x03,
188 NVME_LBART_TYPE_SWAP = 0x04,
189
190 NVME_LBART_ATTRIB_TEMP = 1 << 0,
191 NVME_LBART_ATTRIB_HIDE = 1 << 1,
192};
193
194/* I/O commands */
195
196enum nvme_opcode {
197 nvme_cmd_flush = 0x00,
198 nvme_cmd_write = 0x01,
199 nvme_cmd_read = 0x02,
200 nvme_cmd_write_uncor = 0x04,
201 nvme_cmd_compare = 0x05,
202 nvme_cmd_dsm = 0x09,
203};
204
205struct nvme_common_command {
206 __u8 opcode;
207 __u8 flags;
208 __u16 command_id;
209 __le32 nsid;
210 __le32 cdw2[2];
211 __le64 metadata;
212 __le64 prp1;
213 __le64 prp2;
214 __le32 cdw10[6];
215};
216
217struct nvme_rw_command {
218 __u8 opcode;
219 __u8 flags;
220 __u16 command_id;
221 __le32 nsid;
222 __u64 rsvd2;
223 __le64 metadata;
224 __le64 prp1;
225 __le64 prp2;
226 __le64 slba;
227 __le16 length;
228 __le16 control;
229 __le32 dsmgmt;
230 __le32 reftag;
231 __le16 apptag;
232 __le16 appmask;
233};
234
235enum {
236 NVME_RW_LR = 1 << 15,
237 NVME_RW_FUA = 1 << 14,
238 NVME_RW_DSM_FREQ_UNSPEC = 0,
239 NVME_RW_DSM_FREQ_TYPICAL = 1,
240 NVME_RW_DSM_FREQ_RARE = 2,
241 NVME_RW_DSM_FREQ_READS = 3,
242 NVME_RW_DSM_FREQ_WRITES = 4,
243 NVME_RW_DSM_FREQ_RW = 5,
244 NVME_RW_DSM_FREQ_ONCE = 6,
245 NVME_RW_DSM_FREQ_PREFETCH = 7,
246 NVME_RW_DSM_FREQ_TEMP = 8,
247 NVME_RW_DSM_LATENCY_NONE = 0 << 4,
248 NVME_RW_DSM_LATENCY_IDLE = 1 << 4,
249 NVME_RW_DSM_LATENCY_NORM = 2 << 4,
250 NVME_RW_DSM_LATENCY_LOW = 3 << 4,
251 NVME_RW_DSM_SEQ_REQ = 1 << 6,
252 NVME_RW_DSM_COMPRESSED = 1 << 7,
253};
254
255struct nvme_dsm_cmd {
256 __u8 opcode;
257 __u8 flags;
258 __u16 command_id;
259 __le32 nsid;
260 __u64 rsvd2[2];
261 __le64 prp1;
262 __le64 prp2;
263 __le32 nr;
264 __le32 attributes;
265 __u32 rsvd12[4];
266};
267
268enum {
269 NVME_DSMGMT_IDR = 1 << 0,
270 NVME_DSMGMT_IDW = 1 << 1,
271 NVME_DSMGMT_AD = 1 << 2,
272};
273
274struct nvme_dsm_range {
275 __le32 cattr;
276 __le32 nlb;
277 __le64 slba;
278};
279
280/* Admin commands */
281
282enum nvme_admin_opcode {
283 nvme_admin_delete_sq = 0x00,
284 nvme_admin_create_sq = 0x01,
285 nvme_admin_get_log_page = 0x02,
286 nvme_admin_delete_cq = 0x04,
287 nvme_admin_create_cq = 0x05,
288 nvme_admin_identify = 0x06,
289 nvme_admin_abort_cmd = 0x08,
290 nvme_admin_set_features = 0x09,
291 nvme_admin_get_features = 0x0a,
292 nvme_admin_async_event = 0x0c,
293 nvme_admin_activate_fw = 0x10,
294 nvme_admin_download_fw = 0x11,
295 nvme_admin_format_nvm = 0x80,
296 nvme_admin_security_send = 0x81,
297 nvme_admin_security_recv = 0x82,
298};
299
300enum {
301 NVME_QUEUE_PHYS_CONTIG = (1 << 0),
302 NVME_CQ_IRQ_ENABLED = (1 << 1),
303 NVME_SQ_PRIO_URGENT = (0 << 1),
304 NVME_SQ_PRIO_HIGH = (1 << 1),
305 NVME_SQ_PRIO_MEDIUM = (2 << 1),
306 NVME_SQ_PRIO_LOW = (3 << 1),
307 NVME_FEAT_ARBITRATION = 0x01,
308 NVME_FEAT_POWER_MGMT = 0x02,
309 NVME_FEAT_LBA_RANGE = 0x03,
310 NVME_FEAT_TEMP_THRESH = 0x04,
311 NVME_FEAT_ERR_RECOVERY = 0x05,
312 NVME_FEAT_VOLATILE_WC = 0x06,
313 NVME_FEAT_NUM_QUEUES = 0x07,
314 NVME_FEAT_IRQ_COALESCE = 0x08,
315 NVME_FEAT_IRQ_CONFIG = 0x09,
316 NVME_FEAT_WRITE_ATOMIC = 0x0a,
317 NVME_FEAT_ASYNC_EVENT = 0x0b,
318 NVME_FEAT_SW_PROGRESS = 0x0c,
319 NVME_FWACT_REPL = (0 << 3),
320 NVME_FWACT_REPL_ACTV = (1 << 3),
321 NVME_FWACT_ACTV = (2 << 3),
322};
323
324struct nvme_identify {
325 __u8 opcode;
326 __u8 flags;
327 __u16 command_id;
328 __le32 nsid;
329 __u64 rsvd2[2];
330 __le64 prp1;
331 __le64 prp2;
332 __le32 cns;
333 __u32 rsvd11[5];
334};
335
336struct nvme_features {
337 __u8 opcode;
338 __u8 flags;
339 __u16 command_id;
340 __le32 nsid;
341 __u64 rsvd2[2];
342 __le64 prp1;
343 __le64 prp2;
344 __le32 fid;
345 __le32 dword11;
346 __u32 rsvd12[4];
347};
348
349struct nvme_create_cq {
350 __u8 opcode;
351 __u8 flags;
352 __u16 command_id;
353 __u32 rsvd1[5];
354 __le64 prp1;
355 __u64 rsvd8;
356 __le16 cqid;
357 __le16 qsize;
358 __le16 cq_flags;
359 __le16 irq_vector;
360 __u32 rsvd12[4];
361};
362
363struct nvme_create_sq {
364 __u8 opcode;
365 __u8 flags;
366 __u16 command_id;
367 __u32 rsvd1[5];
368 __le64 prp1;
369 __u64 rsvd8;
370 __le16 sqid;
371 __le16 qsize;
372 __le16 sq_flags;
373 __le16 cqid;
374 __u32 rsvd12[4];
375};
376
377struct nvme_delete_queue {
378 __u8 opcode;
379 __u8 flags;
380 __u16 command_id;
381 __u32 rsvd1[9];
382 __le16 qid;
383 __u16 rsvd10;
384 __u32 rsvd11[5];
385};
386
387struct nvme_download_firmware {
388 __u8 opcode;
389 __u8 flags;
390 __u16 command_id;
391 __u32 rsvd1[5];
392 __le64 prp1;
393 __le64 prp2;
394 __le32 numd;
395 __le32 offset;
396 __u32 rsvd12[4];
397};
398
399struct nvme_format_cmd {
400 __u8 opcode;
401 __u8 flags;
402 __u16 command_id;
403 __le32 nsid;
404 __u64 rsvd2[4];
405 __le32 cdw10;
406 __u32 rsvd11[5];
407};
408
409struct nvme_command {
410 union {
411 struct nvme_common_command common;
412 struct nvme_rw_command rw;
413 struct nvme_identify identify;
414 struct nvme_features features;
415 struct nvme_create_cq create_cq;
416 struct nvme_create_sq create_sq;
417 struct nvme_delete_queue delete_queue;
418 struct nvme_download_firmware dlfw;
419 struct nvme_format_cmd format;
420 struct nvme_dsm_cmd dsm;
421 };
422};
423
424enum {
425 NVME_SC_SUCCESS = 0x0,
426 NVME_SC_INVALID_OPCODE = 0x1,
427 NVME_SC_INVALID_FIELD = 0x2,
428 NVME_SC_CMDID_CONFLICT = 0x3,
429 NVME_SC_DATA_XFER_ERROR = 0x4,
430 NVME_SC_POWER_LOSS = 0x5,
431 NVME_SC_INTERNAL = 0x6,
432 NVME_SC_ABORT_REQ = 0x7,
433 NVME_SC_ABORT_QUEUE = 0x8,
434 NVME_SC_FUSED_FAIL = 0x9,
435 NVME_SC_FUSED_MISSING = 0xa,
436 NVME_SC_INVALID_NS = 0xb,
437 NVME_SC_CMD_SEQ_ERROR = 0xc,
438 NVME_SC_LBA_RANGE = 0x80,
439 NVME_SC_CAP_EXCEEDED = 0x81,
440 NVME_SC_NS_NOT_READY = 0x82,
441 NVME_SC_CQ_INVALID = 0x100,
442 NVME_SC_QID_INVALID = 0x101,
443 NVME_SC_QUEUE_SIZE = 0x102,
444 NVME_SC_ABORT_LIMIT = 0x103,
445 NVME_SC_ABORT_MISSING = 0x104,
446 NVME_SC_ASYNC_LIMIT = 0x105,
447 NVME_SC_FIRMWARE_SLOT = 0x106,
448 NVME_SC_FIRMWARE_IMAGE = 0x107,
449 NVME_SC_INVALID_VECTOR = 0x108,
450 NVME_SC_INVALID_LOG_PAGE = 0x109,
451 NVME_SC_INVALID_FORMAT = 0x10a,
452 NVME_SC_BAD_ATTRIBUTES = 0x180,
453 NVME_SC_WRITE_FAULT = 0x280,
454 NVME_SC_READ_ERROR = 0x281,
455 NVME_SC_GUARD_CHECK = 0x282,
456 NVME_SC_APPTAG_CHECK = 0x283,
457 NVME_SC_REFTAG_CHECK = 0x284,
458 NVME_SC_COMPARE_FAILED = 0x285,
459 NVME_SC_ACCESS_DENIED = 0x286,
460};
461
462struct nvme_completion {
463 __le32 result; /* Used by admin commands to return data */
464 __u32 rsvd;
465 __le16 sq_head; /* how much of this queue may be reclaimed */
466 __le16 sq_id; /* submission queue that generated this entry */
467 __u16 command_id; /* of the command which completed */
468 __le16 status; /* did the command fail, and if so, why? */
469};
470
471struct nvme_user_io {
472 __u8 opcode;
473 __u8 flags;
474 __u16 control;
475 __u16 nblocks;
476 __u16 rsvd;
477 __u64 metadata;
478 __u64 addr;
479 __u64 slba;
480 __u32 dsmgmt;
481 __u32 reftag;
482 __u16 apptag;
483 __u16 appmask;
484};
485
486struct nvme_admin_cmd {
487 __u8 opcode;
488 __u8 flags;
489 __u16 rsvd1;
490 __u32 nsid;
491 __u32 cdw2;
492 __u32 cdw3;
493 __u64 metadata;
494 __u64 addr;
495 __u32 metadata_len;
496 __u32 data_len;
497 __u32 cdw10;
498 __u32 cdw11;
499 __u32 cdw12;
500 __u32 cdw13;
501 __u32 cdw14;
502 __u32 cdw15;
503 __u32 timeout_ms;
504 __u32 result;
505};
506
507#define NVME_IOCTL_ID _IO('N', 0x40)
508#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
509#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
510
511#ifdef __KERNEL__
512#include <linux/pci.h>
513#include <linux/miscdevice.h>
514#include <linux/kref.h>
515
516#define NVME_IO_TIMEOUT (5 * HZ) 69#define NVME_IO_TIMEOUT (5 * HZ)
517 70
518/* 71/*
@@ -553,7 +106,7 @@ struct nvme_ns {
553 struct request_queue *queue; 106 struct request_queue *queue;
554 struct gendisk *disk; 107 struct gendisk *disk;
555 108
556 int ns_id; 109 unsigned ns_id;
557 int lba_shift; 110 int lba_shift;
558 int ms; 111 int ms;
559 u64 mode_select_num_blocks; 112 u64 mode_select_num_blocks;
@@ -572,6 +125,7 @@ struct nvme_iod {
572 int offset; /* Of PRP list */ 125 int offset; /* Of PRP list */
573 int nents; /* Used in scatterlist */ 126 int nents; /* Used in scatterlist */
574 int length; /* Of data, in bytes */ 127 int length; /* Of data, in bytes */
128 unsigned long start_time;
575 dma_addr_t first_dma; 129 dma_addr_t first_dma;
576 struct scatterlist sg[0]; 130 struct scatterlist sg[0];
577}; 131};
@@ -613,6 +167,4 @@ struct sg_io_hdr;
613int nvme_sg_io(struct nvme_ns *ns, struct sg_io_hdr __user *u_hdr); 167int nvme_sg_io(struct nvme_ns *ns, struct sg_io_hdr __user *u_hdr);
614int nvme_sg_get_version_num(int __user *ip); 168int nvme_sg_get_version_num(int __user *ip);
615 169
616#endif
617
618#endif /* _LINUX_NVME_H */ 170#endif /* _LINUX_NVME_H */
diff --git a/include/linux/of.h b/include/linux/of.h
index 1fd08ca23106..f95aee391e30 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -266,6 +266,7 @@ extern int of_device_is_available(const struct device_node *device);
266extern const void *of_get_property(const struct device_node *node, 266extern const void *of_get_property(const struct device_node *node,
267 const char *name, 267 const char *name,
268 int *lenp); 268 int *lenp);
269extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
269#define for_each_property_of_node(dn, pp) \ 270#define for_each_property_of_node(dn, pp) \
270 for (pp = dn->properties; pp != NULL; pp = pp->next) 271 for (pp = dn->properties; pp != NULL; pp = pp->next)
271 272
@@ -280,6 +281,9 @@ extern struct device_node *of_parse_phandle(const struct device_node *np,
280extern int of_parse_phandle_with_args(const struct device_node *np, 281extern int of_parse_phandle_with_args(const struct device_node *np,
281 const char *list_name, const char *cells_name, int index, 282 const char *list_name, const char *cells_name, int index,
282 struct of_phandle_args *out_args); 283 struct of_phandle_args *out_args);
284extern int of_parse_phandle_with_fixed_args(const struct device_node *np,
285 const char *list_name, int cells_count, int index,
286 struct of_phandle_args *out_args);
283extern int of_count_phandle_with_args(const struct device_node *np, 287extern int of_count_phandle_with_args(const struct device_node *np,
284 const char *list_name, const char *cells_name); 288 const char *list_name, const char *cells_name);
285 289
@@ -323,12 +327,6 @@ extern int of_detach_node(struct device_node *);
323 */ 327 */
324const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur, 328const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
325 u32 *pu); 329 u32 *pu);
326#define of_property_for_each_u32(np, propname, prop, p, u) \
327 for (prop = of_find_property(np, propname, NULL), \
328 p = of_prop_next_u32(prop, NULL, &u); \
329 p; \
330 p = of_prop_next_u32(prop, p, &u))
331
332/* 330/*
333 * struct property *prop; 331 * struct property *prop;
334 * const char *s; 332 * const char *s;
@@ -337,11 +335,8 @@ const __be32 *of_prop_next_u32(struct property *prop, const __be32 *cur,
337 * printk("String value: %s\n", s); 335 * printk("String value: %s\n", s);
338 */ 336 */
339const char *of_prop_next_string(struct property *prop, const char *cur); 337const char *of_prop_next_string(struct property *prop, const char *cur);
340#define of_property_for_each_string(np, propname, prop, s) \ 338
341 for (prop = of_find_property(np, propname, NULL), \ 339int of_device_is_stdout_path(struct device_node *dn);
342 s = of_prop_next_string(prop, NULL); \
343 s; \
344 s = of_prop_next_string(prop, s))
345 340
346#else /* CONFIG_OF */ 341#else /* CONFIG_OF */
347 342
@@ -459,6 +454,12 @@ static inline const void *of_get_property(const struct device_node *node,
459 return NULL; 454 return NULL;
460} 455}
461 456
457static inline struct device_node *of_get_cpu_node(int cpu,
458 unsigned int *thread)
459{
460 return NULL;
461}
462
462static inline int of_property_read_u64(const struct device_node *np, 463static inline int of_property_read_u64(const struct device_node *np,
463 const char *propname, u64 *out_value) 464 const char *propname, u64 *out_value)
464{ 465{
@@ -488,6 +489,13 @@ static inline int of_parse_phandle_with_args(struct device_node *np,
488 return -ENOSYS; 489 return -ENOSYS;
489} 490}
490 491
492static inline int of_parse_phandle_with_fixed_args(const struct device_node *np,
493 const char *list_name, int cells_count, int index,
494 struct of_phandle_args *out_args)
495{
496 return -ENOSYS;
497}
498
491static inline int of_count_phandle_with_args(struct device_node *np, 499static inline int of_count_phandle_with_args(struct device_node *np,
492 const char *list_name, 500 const char *list_name,
493 const char *cells_name) 501 const char *cells_name)
@@ -505,12 +513,25 @@ static inline int of_machine_is_compatible(const char *compat)
505 return 0; 513 return 0;
506} 514}
507 515
516static inline int of_device_is_stdout_path(struct device_node *dn)
517{
518 return 0;
519}
520
521static inline const __be32 *of_prop_next_u32(struct property *prop,
522 const __be32 *cur, u32 *pu)
523{
524 return NULL;
525}
526
527static inline const char *of_prop_next_string(struct property *prop,
528 const char *cur)
529{
530 return NULL;
531}
532
508#define of_match_ptr(_ptr) NULL 533#define of_match_ptr(_ptr) NULL
509#define of_match_node(_matches, _node) NULL 534#define of_match_node(_matches, _node) NULL
510#define of_property_for_each_u32(np, propname, prop, p, u) \
511 while (0)
512#define of_property_for_each_string(np, propname, prop, s) \
513 while (0)
514#endif /* CONFIG_OF */ 535#endif /* CONFIG_OF */
515 536
516#ifndef of_node_to_nid 537#ifndef of_node_to_nid
@@ -559,6 +580,18 @@ static inline int of_property_read_u32(const struct device_node *np,
559 return of_property_read_u32_array(np, propname, out_value, 1); 580 return of_property_read_u32_array(np, propname, out_value, 1);
560} 581}
561 582
583#define of_property_for_each_u32(np, propname, prop, p, u) \
584 for (prop = of_find_property(np, propname, NULL), \
585 p = of_prop_next_u32(prop, NULL, &u); \
586 p; \
587 p = of_prop_next_u32(prop, p, &u))
588
589#define of_property_for_each_string(np, propname, prop, s) \
590 for (prop = of_find_property(np, propname, NULL), \
591 s = of_prop_next_string(prop, NULL); \
592 s; \
593 s = of_prop_next_string(prop, s))
594
562#if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE) 595#if defined(CONFIG_PROC_FS) && defined(CONFIG_PROC_DEVICETREE)
563extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *); 596extern void proc_device_tree_add_node(struct device_node *, struct proc_dir_entry *);
564extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop); 597extern void proc_device_tree_add_prop(struct proc_dir_entry *pde, struct property *prop);
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 9d27475feec1..82ce324fdce7 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_OF_DEVICE_H 1#ifndef _LINUX_OF_DEVICE_H
2#define _LINUX_OF_DEVICE_H 2#define _LINUX_OF_DEVICE_H
3 3
4#include <linux/cpu.h>
4#include <linux/platform_device.h> 5#include <linux/platform_device.h>
5#include <linux/of_platform.h> /* temporary until merge */ 6#include <linux/of_platform.h> /* temporary until merge */
6 7
@@ -43,6 +44,15 @@ static inline void of_device_node_put(struct device *dev)
43 of_node_put(dev->of_node); 44 of_node_put(dev->of_node);
44} 45}
45 46
47static inline struct device_node *of_cpu_device_node_get(int cpu)
48{
49 struct device *cpu_dev;
50 cpu_dev = get_cpu_device(cpu);
51 if (!cpu_dev)
52 return NULL;
53 return of_node_get(cpu_dev->of_node);
54}
55
46#else /* CONFIG_OF */ 56#else /* CONFIG_OF */
47 57
48static inline int of_driver_match_device(struct device *dev, 58static inline int of_driver_match_device(struct device *dev,
@@ -67,6 +77,11 @@ static inline const struct of_device_id *of_match_device(
67{ 77{
68 return NULL; 78 return NULL;
69} 79}
80
81static inline struct device_node *of_cpu_device_node_get(int cpu)
82{
83 return NULL;
84}
70#endif /* CONFIG_OF */ 85#endif /* CONFIG_OF */
71 86
72#endif /* _LINUX_OF_DEVICE_H */ 87#endif /* _LINUX_OF_DEVICE_H */
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index ed136ad698ce..a478c62a2aab 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -90,6 +90,9 @@ extern void *of_get_flat_dt_prop(unsigned long node, const char *name,
90extern int of_flat_dt_is_compatible(unsigned long node, const char *name); 90extern int of_flat_dt_is_compatible(unsigned long node, const char *name);
91extern int of_flat_dt_match(unsigned long node, const char *const *matches); 91extern int of_flat_dt_match(unsigned long node, const char *const *matches);
92extern unsigned long of_get_flat_dt_root(void); 92extern unsigned long of_get_flat_dt_root(void);
93extern int of_scan_flat_dt_by_path(const char *path,
94 int (*it)(unsigned long node, const char *name, int depth, void *data),
95 void *data);
93 96
94extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, 97extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
95 int depth, void *data); 98 int depth, void *data);
@@ -106,8 +109,7 @@ extern u64 dt_mem_next_cell(int s, __be32 **cellp);
106 * physical addresses. 109 * physical addresses.
107 */ 110 */
108#ifdef CONFIG_BLK_DEV_INITRD 111#ifdef CONFIG_BLK_DEV_INITRD
109extern void early_init_dt_setup_initrd_arch(unsigned long start, 112extern void early_init_dt_setup_initrd_arch(u64 start, u64 end);
110 unsigned long end);
111#endif 113#endif
112 114
113/* Early flat tree scan hooks */ 115/* Early flat tree scan hooks */
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h
deleted file mode 100644
index cfb545cd86b5..000000000000
--- a/include/linux/of_i2c.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * Generic I2C API implementation for PowerPC.
3 *
4 * Copyright (c) 2008 Jochen Friedrich <jochen@scram.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __LINUX_OF_I2C_H
13#define __LINUX_OF_I2C_H
14
15#if defined(CONFIG_OF_I2C) || defined(CONFIG_OF_I2C_MODULE)
16#include <linux/i2c.h>
17
18extern void of_i2c_register_devices(struct i2c_adapter *adap);
19
20/* must call put_device() when done with returned i2c_client device */
21extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
22
23/* must call put_device() when done with returned i2c_adapter device */
24extern struct i2c_adapter *of_find_i2c_adapter_by_node(
25 struct device_node *node);
26
27#else
28static inline void of_i2c_register_devices(struct i2c_adapter *adap)
29{
30 return;
31}
32
33static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
34{
35 return NULL;
36}
37
38/* must call put_device() when done with returned i2c_adapter device */
39static inline struct i2c_adapter *of_find_i2c_adapter_by_node(
40 struct device_node *node)
41{
42 return NULL;
43}
44#endif /* CONFIG_OF_I2C */
45
46#endif /* __LINUX_OF_I2C_H */
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index 535cecf1e02f..fcd63baee5f2 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -1,8 +1,6 @@
1#ifndef __OF_IRQ_H 1#ifndef __OF_IRQ_H
2#define __OF_IRQ_H 2#define __OF_IRQ_H
3 3
4#if defined(CONFIG_OF)
5struct of_irq;
6#include <linux/types.h> 4#include <linux/types.h>
7#include <linux/errno.h> 5#include <linux/errno.h>
8#include <linux/irq.h> 6#include <linux/irq.h>
@@ -10,14 +8,6 @@ struct of_irq;
10#include <linux/ioport.h> 8#include <linux/ioport.h>
11#include <linux/of.h> 9#include <linux/of.h>
12 10
13/*
14 * irq_of_parse_and_map() is used by all OF enabled platforms; but SPARC
15 * implements it differently. However, the prototype is the same for all,
16 * so declare it here regardless of the CONFIG_OF_IRQ setting.
17 */
18extern unsigned int irq_of_parse_and_map(struct device_node *node, int index);
19
20#if defined(CONFIG_OF_IRQ)
21/** 11/**
22 * of_irq - container for device_node/irq_specifier pair for an irq controller 12 * of_irq - container for device_node/irq_specifier pair for an irq controller
23 * @controller: pointer to interrupt controller device tree node 13 * @controller: pointer to interrupt controller device tree node
@@ -71,11 +61,17 @@ extern int of_irq_to_resource(struct device_node *dev, int index,
71extern int of_irq_count(struct device_node *dev); 61extern int of_irq_count(struct device_node *dev);
72extern int of_irq_to_resource_table(struct device_node *dev, 62extern int of_irq_to_resource_table(struct device_node *dev,
73 struct resource *res, int nr_irqs); 63 struct resource *res, int nr_irqs);
74extern struct device_node *of_irq_find_parent(struct device_node *child);
75 64
76extern void of_irq_init(const struct of_device_id *matches); 65extern void of_irq_init(const struct of_device_id *matches);
77 66
78#endif /* CONFIG_OF_IRQ */ 67#if defined(CONFIG_OF)
68/*
69 * irq_of_parse_and_map() is used by all OF enabled platforms; but SPARC
70 * implements it differently. However, the prototype is the same for all,
71 * so declare it here regardless of the CONFIG_OF_IRQ setting.
72 */
73extern unsigned int irq_of_parse_and_map(struct device_node *node, int index);
74extern struct device_node *of_irq_find_parent(struct device_node *child);
79 75
80#else /* !CONFIG_OF */ 76#else /* !CONFIG_OF */
81static inline unsigned int irq_of_parse_and_map(struct device_node *dev, 77static inline unsigned int irq_of_parse_and_map(struct device_node *dev,
diff --git a/include/linux/of_net.h b/include/linux/of_net.h
index 61bf53b02779..34597c8c1a4c 100644
--- a/include/linux/of_net.h
+++ b/include/linux/of_net.h
@@ -9,10 +9,10 @@
9 9
10#ifdef CONFIG_OF_NET 10#ifdef CONFIG_OF_NET
11#include <linux/of.h> 11#include <linux/of.h>
12extern const int of_get_phy_mode(struct device_node *np); 12extern int of_get_phy_mode(struct device_node *np);
13extern const void *of_get_mac_address(struct device_node *np); 13extern const void *of_get_mac_address(struct device_node *np);
14#else 14#else
15static inline const int of_get_phy_mode(struct device_node *np) 15static inline int of_get_phy_mode(struct device_node *np)
16{ 16{
17 return -ENODEV; 17 return -ENODEV;
18} 18}
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h
index 7a04826018c0..fd9c408631a0 100644
--- a/include/linux/of_pci.h
+++ b/include/linux/of_pci.h
@@ -2,6 +2,7 @@
2#define __OF_PCI_H 2#define __OF_PCI_H
3 3
4#include <linux/pci.h> 4#include <linux/pci.h>
5#include <linux/msi.h>
5 6
6struct pci_dev; 7struct pci_dev;
7struct of_irq; 8struct of_irq;
@@ -13,4 +14,15 @@ struct device_node *of_pci_find_child_device(struct device_node *parent,
13int of_pci_get_devfn(struct device_node *np); 14int of_pci_get_devfn(struct device_node *np);
14int of_pci_parse_bus_range(struct device_node *node, struct resource *res); 15int of_pci_parse_bus_range(struct device_node *node, struct resource *res);
15 16
17#if defined(CONFIG_OF) && defined(CONFIG_PCI_MSI)
18int of_pci_msi_chip_add(struct msi_chip *chip);
19void of_pci_msi_chip_remove(struct msi_chip *chip);
20struct msi_chip *of_pci_find_msi_chip_by_node(struct device_node *of_node);
21#else
22static inline int of_pci_msi_chip_add(struct msi_chip *chip) { return -EINVAL; }
23static inline void of_pci_msi_chip_remove(struct msi_chip *chip) { }
24static inline struct msi_chip *
25of_pci_find_msi_chip_by_node(struct device_node *of_node) { return NULL; }
26#endif
27
16#endif 28#endif
diff --git a/include/linux/olpc-ec.h b/include/linux/olpc-ec.h
index 5bb6e760aa61..2925df3ce78a 100644
--- a/include/linux/olpc-ec.h
+++ b/include/linux/olpc-ec.h
@@ -6,6 +6,7 @@
6#define EC_WRITE_SCI_MASK 0x1b 6#define EC_WRITE_SCI_MASK 0x1b
7#define EC_WAKE_UP_WLAN 0x24 7#define EC_WAKE_UP_WLAN 0x24
8#define EC_WLAN_LEAVE_RESET 0x25 8#define EC_WLAN_LEAVE_RESET 0x25
9#define EC_DCON_POWER_MODE 0x26
9#define EC_READ_EB_MODE 0x2a 10#define EC_READ_EB_MODE 0x2a
10#define EC_SET_SCI_INHIBIT 0x32 11#define EC_SET_SCI_INHIBIT 0x32
11#define EC_SET_SCI_INHIBIT_RELEASE 0x34 12#define EC_SET_SCI_INHIBIT_RELEASE 0x34
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index a4c562453f6b..b2a0f15f11fe 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -42,7 +42,6 @@
42#define IBS_FETCH_CODE 13 42#define IBS_FETCH_CODE 13
43#define IBS_OP_CODE 14 43#define IBS_OP_CODE 14
44 44
45struct super_block;
46struct dentry; 45struct dentry;
47struct file_operations; 46struct file_operations;
48struct pt_regs; 47struct pt_regs;
@@ -51,7 +50,7 @@ struct pt_regs;
51struct oprofile_operations { 50struct oprofile_operations {
52 /* create any necessary configuration files in the oprofile fs. 51 /* create any necessary configuration files in the oprofile fs.
53 * Optional. */ 52 * Optional. */
54 int (*create_files)(struct super_block * sb, struct dentry * root); 53 int (*create_files)(struct dentry * root);
55 /* Do any necessary interrupt setup. Optional. */ 54 /* Do any necessary interrupt setup. Optional. */
56 int (*setup)(void); 55 int (*setup)(void);
57 /* Do any necessary interrupt shutdown. Optional. */ 56 /* Do any necessary interrupt shutdown. Optional. */
@@ -125,27 +124,26 @@ void oprofile_add_trace(unsigned long eip);
125 * Create a file of the given name as a child of the given root, with 124 * Create a file of the given name as a child of the given root, with
126 * the specified file operations. 125 * the specified file operations.
127 */ 126 */
128int oprofilefs_create_file(struct super_block * sb, struct dentry * root, 127int oprofilefs_create_file(struct dentry * root,
129 char const * name, const struct file_operations * fops); 128 char const * name, const struct file_operations * fops);
130 129
131int oprofilefs_create_file_perm(struct super_block * sb, struct dentry * root, 130int oprofilefs_create_file_perm(struct dentry * root,
132 char const * name, const struct file_operations * fops, int perm); 131 char const * name, const struct file_operations * fops, int perm);
133 132
134/** Create a file for read/write access to an unsigned long. */ 133/** Create a file for read/write access to an unsigned long. */
135int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root, 134int oprofilefs_create_ulong(struct dentry * root,
136 char const * name, ulong * val); 135 char const * name, ulong * val);
137 136
138/** Create a file for read-only access to an unsigned long. */ 137/** Create a file for read-only access to an unsigned long. */
139int oprofilefs_create_ro_ulong(struct super_block * sb, struct dentry * root, 138int oprofilefs_create_ro_ulong(struct dentry * root,
140 char const * name, ulong * val); 139 char const * name, ulong * val);
141 140
142/** Create a file for read-only access to an atomic_t. */ 141/** Create a file for read-only access to an atomic_t. */
143int oprofilefs_create_ro_atomic(struct super_block * sb, struct dentry * root, 142int oprofilefs_create_ro_atomic(struct dentry * root,
144 char const * name, atomic_t * val); 143 char const * name, atomic_t * val);
145 144
146/** create a directory */ 145/** create a directory */
147struct dentry * oprofilefs_mkdir(struct super_block * sb, struct dentry * root, 146struct dentry *oprofilefs_mkdir(struct dentry *parent, char const *name);
148 char const * name);
149 147
150/** 148/**
151 * Write the given asciz string to the given user buffer @buf, updating *offset 149 * Write the given asciz string to the given user buffer @buf, updating *offset
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 170447977278..d006f0ca60f4 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -47,24 +47,22 @@ void acpi_pci_remove_bus(struct pci_bus *bus);
47 47
48#ifdef CONFIG_ACPI_PCI_SLOT 48#ifdef CONFIG_ACPI_PCI_SLOT
49void acpi_pci_slot_init(void); 49void acpi_pci_slot_init(void);
50void acpi_pci_slot_enumerate(struct pci_bus *bus, acpi_handle handle); 50void acpi_pci_slot_enumerate(struct pci_bus *bus);
51void acpi_pci_slot_remove(struct pci_bus *bus); 51void acpi_pci_slot_remove(struct pci_bus *bus);
52#else 52#else
53static inline void acpi_pci_slot_init(void) { } 53static inline void acpi_pci_slot_init(void) { }
54static inline void acpi_pci_slot_enumerate(struct pci_bus *bus, 54static inline void acpi_pci_slot_enumerate(struct pci_bus *bus) { }
55 acpi_handle handle) { }
56static inline void acpi_pci_slot_remove(struct pci_bus *bus) { } 55static inline void acpi_pci_slot_remove(struct pci_bus *bus) { }
57#endif 56#endif
58 57
59#ifdef CONFIG_HOTPLUG_PCI_ACPI 58#ifdef CONFIG_HOTPLUG_PCI_ACPI
60void acpiphp_init(void); 59void acpiphp_init(void);
61void acpiphp_enumerate_slots(struct pci_bus *bus, acpi_handle handle); 60void acpiphp_enumerate_slots(struct pci_bus *bus);
62void acpiphp_remove_slots(struct pci_bus *bus); 61void acpiphp_remove_slots(struct pci_bus *bus);
63void acpiphp_check_host_bridge(acpi_handle handle); 62void acpiphp_check_host_bridge(acpi_handle handle);
64#else 63#else
65static inline void acpiphp_init(void) { } 64static inline void acpiphp_init(void) { }
66static inline void acpiphp_enumerate_slots(struct pci_bus *bus, 65static inline void acpiphp_enumerate_slots(struct pci_bus *bus) { }
67 acpi_handle handle) { }
68static inline void acpiphp_remove_slots(struct pci_bus *bus) { } 66static inline void acpiphp_remove_slots(struct pci_bus *bus) { }
69static inline void acpiphp_check_host_bridge(acpi_handle handle) { } 67static inline void acpiphp_check_host_bridge(acpi_handle handle) { }
70#endif 68#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 0fd1f1582fa1..da172f956ad6 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -183,6 +183,19 @@ enum pci_bus_flags {
183 PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2, 183 PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2,
184}; 184};
185 185
186/* These values come from the PCI Express Spec */
187enum pcie_link_width {
188 PCIE_LNK_WIDTH_RESRV = 0x00,
189 PCIE_LNK_X1 = 0x01,
190 PCIE_LNK_X2 = 0x02,
191 PCIE_LNK_X4 = 0x04,
192 PCIE_LNK_X8 = 0x08,
193 PCIE_LNK_X12 = 0x0C,
194 PCIE_LNK_X16 = 0x10,
195 PCIE_LNK_X32 = 0x20,
196 PCIE_LNK_WIDTH_UNKNOWN = 0xFF,
197};
198
186/* Based on the PCI Hotplug Spec, but some values are made up by us */ 199/* Based on the PCI Hotplug Spec, but some values are made up by us */
187enum pci_bus_speed { 200enum pci_bus_speed {
188 PCI_SPEED_33MHz = 0x00, 201 PCI_SPEED_33MHz = 0x00,
@@ -433,6 +446,7 @@ struct pci_bus {
433 struct resource busn_res; /* bus numbers routed to this bus */ 446 struct resource busn_res; /* bus numbers routed to this bus */
434 447
435 struct pci_ops *ops; /* configuration access functions */ 448 struct pci_ops *ops; /* configuration access functions */
449 struct msi_chip *msi; /* MSI controller */
436 void *sysdata; /* hook for sys-specific extension */ 450 void *sysdata; /* hook for sys-specific extension */
437 struct proc_dir_entry *procdir; /* directory entry in /proc/bus/pci */ 451 struct proc_dir_entry *procdir; /* directory entry in /proc/bus/pci */
438 452
@@ -675,7 +689,7 @@ struct pci_driver {
675/* these external functions are only available when PCI support is enabled */ 689/* these external functions are only available when PCI support is enabled */
676#ifdef CONFIG_PCI 690#ifdef CONFIG_PCI
677 691
678void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss); 692void pcie_bus_configure_settings(struct pci_bus *bus);
679 693
680enum pcie_bus_config_types { 694enum pcie_bus_config_types {
681 PCIE_BUS_TUNE_OFF, 695 PCIE_BUS_TUNE_OFF,
@@ -914,6 +928,7 @@ bool pci_check_and_unmask_intx(struct pci_dev *dev);
914void pci_msi_off(struct pci_dev *dev); 928void pci_msi_off(struct pci_dev *dev);
915int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); 929int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size);
916int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); 930int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask);
931int pci_wait_for_pending_transaction(struct pci_dev *dev);
917int pcix_get_max_mmrbc(struct pci_dev *dev); 932int pcix_get_max_mmrbc(struct pci_dev *dev);
918int pcix_get_mmrbc(struct pci_dev *dev); 933int pcix_get_mmrbc(struct pci_dev *dev);
919int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); 934int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
@@ -921,9 +936,16 @@ int pcie_get_readrq(struct pci_dev *dev);
921int pcie_set_readrq(struct pci_dev *dev, int rq); 936int pcie_set_readrq(struct pci_dev *dev, int rq);
922int pcie_get_mps(struct pci_dev *dev); 937int pcie_get_mps(struct pci_dev *dev);
923int pcie_set_mps(struct pci_dev *dev, int mps); 938int pcie_set_mps(struct pci_dev *dev, int mps);
939int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
940 enum pcie_link_width *width);
924int __pci_reset_function(struct pci_dev *dev); 941int __pci_reset_function(struct pci_dev *dev);
925int __pci_reset_function_locked(struct pci_dev *dev); 942int __pci_reset_function_locked(struct pci_dev *dev);
926int pci_reset_function(struct pci_dev *dev); 943int pci_reset_function(struct pci_dev *dev);
944int pci_probe_reset_slot(struct pci_slot *slot);
945int pci_reset_slot(struct pci_slot *slot);
946int pci_probe_reset_bus(struct pci_bus *bus);
947int pci_reset_bus(struct pci_bus *bus);
948void pci_reset_bridge_secondary_bus(struct pci_dev *dev);
927void pci_update_resource(struct pci_dev *dev, int resno); 949void pci_update_resource(struct pci_dev *dev, int resno);
928int __must_check pci_assign_resource(struct pci_dev *dev, int i); 950int __must_check pci_assign_resource(struct pci_dev *dev, int i);
929int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); 951int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align);
@@ -1003,6 +1025,7 @@ int pci_claim_resource(struct pci_dev *, int);
1003void pci_assign_unassigned_resources(void); 1025void pci_assign_unassigned_resources(void);
1004void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); 1026void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge);
1005void pci_assign_unassigned_bus_resources(struct pci_bus *bus); 1027void pci_assign_unassigned_bus_resources(struct pci_bus *bus);
1028void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus);
1006void pdev_enable_device(struct pci_dev *); 1029void pdev_enable_device(struct pci_dev *);
1007int pci_enable_resources(struct pci_dev *, int mask); 1030int pci_enable_resources(struct pci_dev *, int mask);
1008void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), 1031void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
@@ -1043,7 +1066,6 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
1043 resource_size_t, 1066 resource_size_t,
1044 resource_size_t), 1067 resource_size_t),
1045 void *alignf_data); 1068 void *alignf_data);
1046void pci_enable_bridges(struct pci_bus *bus);
1047 1069
1048/* Proper probing supporting hot-pluggable devices */ 1070/* Proper probing supporting hot-pluggable devices */
1049int __must_check __pci_register_driver(struct pci_driver *, struct module *, 1071int __must_check __pci_register_driver(struct pci_driver *, struct module *,
@@ -1648,6 +1670,10 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev,
1648int pcibios_add_device(struct pci_dev *dev); 1670int pcibios_add_device(struct pci_dev *dev);
1649void pcibios_release_device(struct pci_dev *dev); 1671void pcibios_release_device(struct pci_dev *dev);
1650 1672
1673#ifdef CONFIG_HIBERNATE_CALLBACKS
1674extern struct dev_pm_ops pcibios_pm_ops;
1675#endif
1676
1651#ifdef CONFIG_PCI_MMCONFIG 1677#ifdef CONFIG_PCI_MMCONFIG
1652void __init pci_mmcfg_early_init(void); 1678void __init pci_mmcfg_early_init(void);
1653void __init pci_mmcfg_late_init(void); 1679void __init pci_mmcfg_late_init(void);
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 8db71dcd6337..430dd963707b 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -28,19 +28,6 @@
28#ifndef _PCI_HOTPLUG_H 28#ifndef _PCI_HOTPLUG_H
29#define _PCI_HOTPLUG_H 29#define _PCI_HOTPLUG_H
30 30
31/* These values come from the PCI Express Spec */
32enum pcie_link_width {
33 PCIE_LNK_WIDTH_RESRV = 0x00,
34 PCIE_LNK_X1 = 0x01,
35 PCIE_LNK_X2 = 0x02,
36 PCIE_LNK_X4 = 0x04,
37 PCIE_LNK_X8 = 0x08,
38 PCIE_LNK_X12 = 0x0C,
39 PCIE_LNK_X16 = 0x10,
40 PCIE_LNK_X32 = 0x20,
41 PCIE_LNK_WIDTH_UNKNOWN = 0xFF,
42};
43
44/** 31/**
45 * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use 32 * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use
46 * @owner: The module owner of this structure 33 * @owner: The module owner of this structure
@@ -63,6 +50,9 @@ enum pcie_link_width {
63 * @get_adapter_status: Called to get see if an adapter is present in the slot or not. 50 * @get_adapter_status: Called to get see if an adapter is present in the slot or not.
64 * If this field is NULL, the value passed in the struct hotplug_slot_info 51 * If this field is NULL, the value passed in the struct hotplug_slot_info
65 * will be used when this value is requested by a user. 52 * will be used when this value is requested by a user.
53 * @reset_slot: Optional interface to allow override of a bus reset for the
54 * slot for cases where a secondary bus reset can result in spurious
55 * hotplug events or where a slot can be reset independent of the bus.
66 * 56 *
67 * The table of function pointers that is passed to the hotplug pci core by a 57 * The table of function pointers that is passed to the hotplug pci core by a
68 * hotplug pci driver. These functions are called by the hotplug pci core when 58 * hotplug pci driver. These functions are called by the hotplug pci core when
@@ -80,6 +70,7 @@ struct hotplug_slot_ops {
80 int (*get_attention_status) (struct hotplug_slot *slot, u8 *value); 70 int (*get_attention_status) (struct hotplug_slot *slot, u8 *value);
81 int (*get_latch_status) (struct hotplug_slot *slot, u8 *value); 71 int (*get_latch_status) (struct hotplug_slot *slot, u8 *value);
82 int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value); 72 int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value);
73 int (*reset_slot) (struct hotplug_slot *slot, int probe);
83}; 74};
84 75
85/** 76/**
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 3bed2e89611b..97fbecdd7a40 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -518,6 +518,8 @@
518#define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303 518#define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303
519#define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304 519#define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304
520#define PCI_DEVICE_ID_AMD_15H_M10H_F3 0x1403 520#define PCI_DEVICE_ID_AMD_15H_M10H_F3 0x1403
521#define PCI_DEVICE_ID_AMD_15H_M30H_NB_F3 0x141d
522#define PCI_DEVICE_ID_AMD_15H_M30H_NB_F4 0x141e
521#define PCI_DEVICE_ID_AMD_15H_NB_F0 0x1600 523#define PCI_DEVICE_ID_AMD_15H_NB_F0 0x1600
522#define PCI_DEVICE_ID_AMD_15H_NB_F1 0x1601 524#define PCI_DEVICE_ID_AMD_15H_NB_F1 0x1601
523#define PCI_DEVICE_ID_AMD_15H_NB_F2 0x1602 525#define PCI_DEVICE_ID_AMD_15H_NB_F2 0x1602
@@ -756,6 +758,7 @@
756#define PCI_DEVICE_ID_HP_CISSE 0x323a 758#define PCI_DEVICE_ID_HP_CISSE 0x323a
757#define PCI_DEVICE_ID_HP_CISSF 0x323b 759#define PCI_DEVICE_ID_HP_CISSF 0x323b
758#define PCI_DEVICE_ID_HP_CISSH 0x323c 760#define PCI_DEVICE_ID_HP_CISSH 0x323c
761#define PCI_DEVICE_ID_HP_CISSI 0x3239
759#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031 762#define PCI_DEVICE_ID_HP_ZX2_IOC 0x4031
760 763
761#define PCI_VENDOR_ID_PCTECH 0x1042 764#define PCI_VENDOR_ID_PCTECH 0x1042
@@ -1311,6 +1314,8 @@
1311#define PCI_DEVICE_ID_IMS_TT128 0x9128 1314#define PCI_DEVICE_ID_IMS_TT128 0x9128
1312#define PCI_DEVICE_ID_IMS_TT3D 0x9135 1315#define PCI_DEVICE_ID_IMS_TT3D 0x9135
1313 1316
1317#define PCI_VENDOR_ID_AMCC 0x10e8
1318
1314#define PCI_VENDOR_ID_INTERG 0x10ea 1319#define PCI_VENDOR_ID_INTERG 0x10ea
1315#define PCI_DEVICE_ID_INTERG_1682 0x1682 1320#define PCI_DEVICE_ID_INTERG_1682 0x1682
1316#define PCI_DEVICE_ID_INTERG_2000 0x2000 1321#define PCI_DEVICE_ID_INTERG_2000 0x2000
@@ -2256,12 +2261,10 @@
2256/* 2261/*
2257 * ADDI-DATA GmbH communication cards <info@addi-data.com> 2262 * ADDI-DATA GmbH communication cards <info@addi-data.com>
2258 */ 2263 */
2259#define PCI_VENDOR_ID_ADDIDATA_OLD 0x10E8
2260#define PCI_VENDOR_ID_ADDIDATA 0x15B8 2264#define PCI_VENDOR_ID_ADDIDATA 0x15B8
2261#define PCI_DEVICE_ID_ADDIDATA_APCI7500 0x7000 2265#define PCI_DEVICE_ID_ADDIDATA_APCI7500 0x7000
2262#define PCI_DEVICE_ID_ADDIDATA_APCI7420 0x7001 2266#define PCI_DEVICE_ID_ADDIDATA_APCI7420 0x7001
2263#define PCI_DEVICE_ID_ADDIDATA_APCI7300 0x7002 2267#define PCI_DEVICE_ID_ADDIDATA_APCI7300 0x7002
2264#define PCI_DEVICE_ID_ADDIDATA_APCI7800 0x818E
2265#define PCI_DEVICE_ID_ADDIDATA_APCI7500_2 0x7009 2268#define PCI_DEVICE_ID_ADDIDATA_APCI7500_2 0x7009
2266#define PCI_DEVICE_ID_ADDIDATA_APCI7420_2 0x700A 2269#define PCI_DEVICE_ID_ADDIDATA_APCI7420_2 0x700A
2267#define PCI_DEVICE_ID_ADDIDATA_APCI7300_2 0x700B 2270#define PCI_DEVICE_ID_ADDIDATA_APCI7300_2 0x700B
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 27ef6b190ea6..57e890abe1f0 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -22,9 +22,12 @@
22 * Macro which verifies @ptr is a percpu pointer without evaluating 22 * Macro which verifies @ptr is a percpu pointer without evaluating
23 * @ptr. This is to be used in percpu accessors to verify that the 23 * @ptr. This is to be used in percpu accessors to verify that the
24 * input parameter is a percpu pointer. 24 * input parameter is a percpu pointer.
25 *
26 * + 0 is required in order to convert the pointer type from a
27 * potential array type to a pointer to a single item of the array.
25 */ 28 */
26#define __verify_pcpu_ptr(ptr) do { \ 29#define __verify_pcpu_ptr(ptr) do { \
27 const void __percpu *__vpp_verify = (typeof(ptr))NULL; \ 30 const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
28 (void)__vpp_verify; \ 31 (void)__vpp_verify; \
29} while (0) 32} while (0)
30 33
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index cc88172c7d9a..c74088ab103b 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -332,7 +332,7 @@ do { \
332#endif 332#endif
333 333
334#ifndef this_cpu_sub 334#ifndef this_cpu_sub
335# define this_cpu_sub(pcp, val) this_cpu_add((pcp), -(val)) 335# define this_cpu_sub(pcp, val) this_cpu_add((pcp), -(typeof(pcp))(val))
336#endif 336#endif
337 337
338#ifndef this_cpu_inc 338#ifndef this_cpu_inc
@@ -418,7 +418,7 @@ do { \
418# define this_cpu_add_return(pcp, val) __pcpu_size_call_return2(this_cpu_add_return_, pcp, val) 418# define this_cpu_add_return(pcp, val) __pcpu_size_call_return2(this_cpu_add_return_, pcp, val)
419#endif 419#endif
420 420
421#define this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(val)) 421#define this_cpu_sub_return(pcp, val) this_cpu_add_return(pcp, -(typeof(pcp))(val))
422#define this_cpu_inc_return(pcp) this_cpu_add_return(pcp, 1) 422#define this_cpu_inc_return(pcp) this_cpu_add_return(pcp, 1)
423#define this_cpu_dec_return(pcp) this_cpu_add_return(pcp, -1) 423#define this_cpu_dec_return(pcp) this_cpu_add_return(pcp, -1)
424 424
@@ -586,7 +586,7 @@ do { \
586#endif 586#endif
587 587
588#ifndef __this_cpu_sub 588#ifndef __this_cpu_sub
589# define __this_cpu_sub(pcp, val) __this_cpu_add((pcp), -(val)) 589# define __this_cpu_sub(pcp, val) __this_cpu_add((pcp), -(typeof(pcp))(val))
590#endif 590#endif
591 591
592#ifndef __this_cpu_inc 592#ifndef __this_cpu_inc
@@ -668,7 +668,7 @@ do { \
668 __pcpu_size_call_return2(__this_cpu_add_return_, pcp, val) 668 __pcpu_size_call_return2(__this_cpu_add_return_, pcp, val)
669#endif 669#endif
670 670
671#define __this_cpu_sub_return(pcp, val) __this_cpu_add_return(pcp, -(val)) 671#define __this_cpu_sub_return(pcp, val) __this_cpu_add_return(pcp, -(typeof(pcp))(val))
672#define __this_cpu_inc_return(pcp) __this_cpu_add_return(pcp, 1) 672#define __this_cpu_inc_return(pcp) __this_cpu_add_return(pcp, 1)
673#define __this_cpu_dec_return(pcp) __this_cpu_add_return(pcp, -1) 673#define __this_cpu_dec_return(pcp) __this_cpu_add_return(pcp, -1)
674 674
diff --git a/include/linux/percpu_ida.h b/include/linux/percpu_ida.h
new file mode 100644
index 000000000000..0b23edbee309
--- /dev/null
+++ b/include/linux/percpu_ida.h
@@ -0,0 +1,60 @@
1#ifndef __PERCPU_IDA_H__
2#define __PERCPU_IDA_H__
3
4#include <linux/types.h>
5#include <linux/bitops.h>
6#include <linux/init.h>
7#include <linux/spinlock_types.h>
8#include <linux/wait.h>
9#include <linux/cpumask.h>
10
11struct percpu_ida_cpu;
12
13struct percpu_ida {
14 /*
15 * number of tags available to be allocated, as passed to
16 * percpu_ida_init()
17 */
18 unsigned nr_tags;
19
20 struct percpu_ida_cpu __percpu *tag_cpu;
21
22 /*
23 * Bitmap of cpus that (may) have tags on their percpu freelists:
24 * steal_tags() uses this to decide when to steal tags, and which cpus
25 * to try stealing from.
26 *
27 * It's ok for a freelist to be empty when its bit is set - steal_tags()
28 * will just keep looking - but the bitmap _must_ be set whenever a
29 * percpu freelist does have tags.
30 */
31 cpumask_t cpus_have_tags;
32
33 struct {
34 spinlock_t lock;
35 /*
36 * When we go to steal tags from another cpu (see steal_tags()),
37 * we want to pick a cpu at random. Cycling through them every
38 * time we steal is a bit easier and more or less equivalent:
39 */
40 unsigned cpu_last_stolen;
41
42 /* For sleeping on allocation failure */
43 wait_queue_head_t wait;
44
45 /*
46 * Global freelist - it's a stack where nr_free points to the
47 * top
48 */
49 unsigned nr_free;
50 unsigned *freelist;
51 } ____cacheline_aligned_in_smp;
52};
53
54int percpu_ida_alloc(struct percpu_ida *pool, gfp_t gfp);
55void percpu_ida_free(struct percpu_ida *pool, unsigned tag);
56
57void percpu_ida_destroy(struct percpu_ida *pool);
58int percpu_ida_init(struct percpu_ida *pool, unsigned long nr_tags);
59
60#endif /* __PERCPU_IDA_H__ */
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index c43f6eabad5b..c8ba627c1d60 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -48,6 +48,7 @@ struct perf_guest_info_callbacks {
48#include <linux/cpu.h> 48#include <linux/cpu.h>
49#include <linux/irq_work.h> 49#include <linux/irq_work.h>
50#include <linux/static_key.h> 50#include <linux/static_key.h>
51#include <linux/jump_label_ratelimit.h>
51#include <linux/atomic.h> 52#include <linux/atomic.h>
52#include <linux/sysfs.h> 53#include <linux/sysfs.h>
53#include <linux/perf_regs.h> 54#include <linux/perf_regs.h>
@@ -64,30 +65,6 @@ struct perf_raw_record {
64}; 65};
65 66
66/* 67/*
67 * single taken branch record layout:
68 *
69 * from: source instruction (may not always be a branch insn)
70 * to: branch target
71 * mispred: branch target was mispredicted
72 * predicted: branch target was predicted
73 *
74 * support for mispred, predicted is optional. In case it
75 * is not supported mispred = predicted = 0.
76 *
77 * in_tx: running in a hardware transaction
78 * abort: aborting a hardware transaction
79 */
80struct perf_branch_entry {
81 __u64 from;
82 __u64 to;
83 __u64 mispred:1, /* target mispredicted */
84 predicted:1,/* target predicted */
85 in_tx:1, /* in transaction */
86 abort:1, /* transaction abort */
87 reserved:60;
88};
89
90/*
91 * branch stack layout: 68 * branch stack layout:
92 * nr: number of taken branches stored in entries[] 69 * nr: number of taken branches stored in entries[]
93 * 70 *
@@ -317,9 +294,31 @@ struct ring_buffer;
317 */ 294 */
318struct perf_event { 295struct perf_event {
319#ifdef CONFIG_PERF_EVENTS 296#ifdef CONFIG_PERF_EVENTS
320 struct list_head group_entry; 297 /*
298 * entry onto perf_event_context::event_list;
299 * modifications require ctx->lock
300 * RCU safe iterations.
301 */
321 struct list_head event_entry; 302 struct list_head event_entry;
303
304 /*
305 * XXX: group_entry and sibling_list should be mutually exclusive;
306 * either you're a sibling on a group, or you're the group leader.
307 * Rework the code to always use the same list element.
308 *
309 * Locked for modification by both ctx->mutex and ctx->lock; holding
310 * either sufficies for read.
311 */
312 struct list_head group_entry;
322 struct list_head sibling_list; 313 struct list_head sibling_list;
314
315 /*
316 * We need storage to track the entries in perf_pmu_migrate_context; we
317 * cannot use the event_entry because of RCU and we want to keep the
318 * group in tact which avoids us using the other two entries.
319 */
320 struct list_head migrate_entry;
321
323 struct hlist_node hlist_entry; 322 struct hlist_node hlist_entry;
324 int nr_siblings; 323 int nr_siblings;
325 int group_flags; 324 int group_flags;
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index bf7e989abcb5..fb90ef5eb038 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -137,6 +137,39 @@ static inline unsigned long pinconf_to_config_packed(enum pin_config_param param
137 return PIN_CONF_PACKED(param, argument); 137 return PIN_CONF_PACKED(param, argument);
138} 138}
139 139
140#ifdef CONFIG_OF
141
142#include <linux/device.h>
143#include <linux/pinctrl/machine.h>
144struct pinctrl_dev;
145struct pinctrl_map;
146
147int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
148 struct device_node *np, struct pinctrl_map **map,
149 unsigned *reserved_maps, unsigned *num_maps,
150 enum pinctrl_map_type type);
151int pinconf_generic_dt_node_to_map(struct pinctrl_dev *pctldev,
152 struct device_node *np_config, struct pinctrl_map **map,
153 unsigned *num_maps, enum pinctrl_map_type type);
154
155static inline int pinconf_generic_dt_node_to_map_group(
156 struct pinctrl_dev *pctldev, struct device_node *np_config,
157 struct pinctrl_map **map, unsigned *num_maps)
158{
159 return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps,
160 PIN_MAP_TYPE_CONFIGS_GROUP);
161}
162
163static inline int pinconf_generic_dt_node_to_map_pin(
164 struct pinctrl_dev *pctldev, struct device_node *np_config,
165 struct pinctrl_map **map, unsigned *num_maps)
166{
167 return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps,
168 PIN_MAP_TYPE_CONFIGS_PIN);
169}
170
171#endif
172
140#endif /* CONFIG_GENERIC_PINCONF */ 173#endif /* CONFIG_GENERIC_PINCONF */
141 174
142#endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */ 175#endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */
diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h
index f6998692bdc9..09eb80f2574a 100644
--- a/include/linux/pinctrl/pinconf.h
+++ b/include/linux/pinctrl/pinconf.h
@@ -47,13 +47,15 @@ struct pinconf_ops {
47 unsigned long *config); 47 unsigned long *config);
48 int (*pin_config_set) (struct pinctrl_dev *pctldev, 48 int (*pin_config_set) (struct pinctrl_dev *pctldev,
49 unsigned pin, 49 unsigned pin,
50 unsigned long config); 50 unsigned long *configs,
51 unsigned num_configs);
51 int (*pin_config_group_get) (struct pinctrl_dev *pctldev, 52 int (*pin_config_group_get) (struct pinctrl_dev *pctldev,
52 unsigned selector, 53 unsigned selector,
53 unsigned long *config); 54 unsigned long *config);
54 int (*pin_config_group_set) (struct pinctrl_dev *pctldev, 55 int (*pin_config_group_set) (struct pinctrl_dev *pctldev,
55 unsigned selector, 56 unsigned selector,
56 unsigned long config); 57 unsigned long *configs,
58 unsigned num_configs);
57 int (*pin_config_dbg_parse_modify) (struct pinctrl_dev *pctldev, 59 int (*pin_config_dbg_parse_modify) (struct pinctrl_dev *pctldev,
58 const char *arg, 60 const char *arg,
59 unsigned long *config); 61 unsigned long *config);
diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h
index 88272591a895..9efc04dd255a 100644
--- a/include/linux/platform_data/asoc-s3c.h
+++ b/include/linux/platform_data/asoc-s3c.h
@@ -36,6 +36,7 @@ struct samsung_i2s {
36 */ 36 */
37#define QUIRK_NO_MUXPSR (1 << 2) 37#define QUIRK_NO_MUXPSR (1 << 2)
38#define QUIRK_NEED_RSTCLR (1 << 3) 38#define QUIRK_NEED_RSTCLR (1 << 3)
39#define QUIRK_SUPPORTS_TDM (1 << 4)
39 /* Quirks of the I2S controller */ 40 /* Quirks of the I2S controller */
40 u32 quirks; 41 u32 quirks;
41 dma_addr_t idma_addr; 42 dma_addr_t idma_addr;
diff --git a/include/linux/platform_data/at91_adc.h b/include/linux/platform_data/at91_adc.h
index e15745b4f3a5..b3ca1e94e0c8 100644
--- a/include/linux/platform_data/at91_adc.h
+++ b/include/linux/platform_data/at91_adc.h
@@ -14,12 +14,16 @@
14 (Interruptions registers mostly) 14 (Interruptions registers mostly)
15 * @status_register: Offset of the Interrupt Status Register 15 * @status_register: Offset of the Interrupt Status Register
16 * @trigger_register: Offset of the Trigger setup register 16 * @trigger_register: Offset of the Trigger setup register
17 * @mr_prescal_mask: Mask of the PRESCAL field in the adc MR register
18 * @mr_startup_mask: Mask of the STARTUP field in the adc MR register
17 */ 19 */
18struct at91_adc_reg_desc { 20struct at91_adc_reg_desc {
19 u8 channel_base; 21 u8 channel_base;
20 u32 drdy_mask; 22 u32 drdy_mask;
21 u8 status_register; 23 u8 status_register;
22 u8 trigger_register; 24 u8 trigger_register;
25 u32 mr_prescal_mask;
26 u32 mr_startup_mask;
23}; 27};
24 28
25/** 29/**
diff --git a/include/linux/platform_data/atmel.h b/include/linux/platform_data/atmel.h
index 6a293b7fff3b..cea9f70133c5 100644
--- a/include/linux/platform_data/atmel.h
+++ b/include/linux/platform_data/atmel.h
@@ -71,6 +71,10 @@ struct atmel_nand_data {
71 u8 on_flash_bbt; /* bbt on flash */ 71 u8 on_flash_bbt; /* bbt on flash */
72 struct mtd_partition *parts; 72 struct mtd_partition *parts;
73 unsigned int num_parts; 73 unsigned int num_parts;
74 bool has_dma; /* support dma transfer */
75
76 /* default is false, only for at32ap7000 chip is true */
77 bool need_reset_workaround;
74}; 78};
75 79
76 /* Serial */ 80 /* Serial */
diff --git a/include/linux/platform_data/bd6107.h b/include/linux/platform_data/bd6107.h
new file mode 100644
index 000000000000..671d6502d241
--- /dev/null
+++ b/include/linux/platform_data/bd6107.h
@@ -0,0 +1,19 @@
1/*
2 * bd6107.h - Rohm BD6107 LEDs Driver
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#ifndef __BD6107_H__
9#define __BD6107_H__
10
11struct device;
12
13struct bd6107_platform_data {
14 struct device *fbdev;
15 int reset; /* Reset GPIO */
16 unsigned int def_value;
17};
18
19#endif
diff --git a/include/linux/platform_data/brcmfmac-sdio.h b/include/linux/platform_data/brcmfmac-sdio.h
index b7174998c24a..e75dcbf2b230 100644
--- a/include/linux/platform_data/brcmfmac-sdio.h
+++ b/include/linux/platform_data/brcmfmac-sdio.h
@@ -94,6 +94,10 @@ void __init brcmfmac_init_pdata(void)
94 * Set this to true if the SDIO host controller has higher align requirement 94 * Set this to true if the SDIO host controller has higher align requirement
95 * than 32 bytes for each scatterlist item. 95 * than 32 bytes for each scatterlist item.
96 * 96 *
97 * sd_head_align: alignment requirement for start of data buffer
98 *
99 * sd_sgentry_align: length alignment requirement for each sg entry
100 *
97 * power_on: This function is called by the brcmfmac when the module gets 101 * power_on: This function is called by the brcmfmac when the module gets
98 * loaded. This can be particularly useful for low power devices. The platform 102 * loaded. This can be particularly useful for low power devices. The platform
99 * spcific routine may for example decide to power up the complete device. 103 * spcific routine may for example decide to power up the complete device.
@@ -121,6 +125,8 @@ struct brcmfmac_sdio_platform_data {
121 unsigned int oob_irq_nr; 125 unsigned int oob_irq_nr;
122 unsigned long oob_irq_flags; 126 unsigned long oob_irq_flags;
123 bool broken_sg_support; 127 bool broken_sg_support;
128 unsigned short sd_head_align;
129 unsigned short sd_sgentry_align;
124 void (*power_on)(void); 130 void (*power_on)(void);
125 void (*power_off)(void); 131 void (*power_off)(void);
126 void (*reset)(void); 132 void (*reset)(void);
diff --git a/include/linux/platform_data/camera-mx3.h b/include/linux/platform_data/camera-mx3.h
index f226ee3777e1..a910dadc8258 100644
--- a/include/linux/platform_data/camera-mx3.h
+++ b/include/linux/platform_data/camera-mx3.h
@@ -33,6 +33,8 @@
33#define MX3_CAMERA_DATAWIDTH_MASK (MX3_CAMERA_DATAWIDTH_4 | MX3_CAMERA_DATAWIDTH_8 | \ 33#define MX3_CAMERA_DATAWIDTH_MASK (MX3_CAMERA_DATAWIDTH_4 | MX3_CAMERA_DATAWIDTH_8 | \
34 MX3_CAMERA_DATAWIDTH_10 | MX3_CAMERA_DATAWIDTH_15) 34 MX3_CAMERA_DATAWIDTH_10 | MX3_CAMERA_DATAWIDTH_15)
35 35
36struct v4l2_async_subdev;
37
36/** 38/**
37 * struct mx3_camera_pdata - i.MX3x camera platform data 39 * struct mx3_camera_pdata - i.MX3x camera platform data
38 * @flags: MX3_CAMERA_* flags 40 * @flags: MX3_CAMERA_* flags
@@ -43,6 +45,8 @@ struct mx3_camera_pdata {
43 unsigned long flags; 45 unsigned long flags;
44 unsigned long mclk_10khz; 46 unsigned long mclk_10khz;
45 struct device *dma_dev; 47 struct device *dma_dev;
48 struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
49 int *asd_sizes; /* 0-terminated array of asd group sizes */
46}; 50};
47 51
48#endif 52#endif
diff --git a/include/linux/platform_data/camera-rcar.h b/include/linux/platform_data/camera-rcar.h
new file mode 100644
index 000000000000..dfc83c581593
--- /dev/null
+++ b/include/linux/platform_data/camera-rcar.h
@@ -0,0 +1,25 @@
1/*
2 * Platform data for Renesas R-Car VIN soc-camera driver
3 *
4 * Copyright (C) 2011-2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Cogent Embedded, Inc., <source@cogentembedded.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 as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef __CAMERA_RCAR_H_
14#define __CAMERA_RCAR_H_
15
16#define RCAR_VIN_HSYNC_ACTIVE_LOW (1 << 0)
17#define RCAR_VIN_VSYNC_ACTIVE_LOW (1 << 1)
18#define RCAR_VIN_BT601 (1 << 2)
19#define RCAR_VIN_BT656 (1 << 3)
20
21struct rcar_vin_platform_data {
22 unsigned int flags;
23};
24
25#endif /* __CAMERA_RCAR_H_ */
diff --git a/include/linux/platform_data/cpsw.h b/include/linux/platform_data/cpsw.h
deleted file mode 100644
index bb3cd58d71e3..000000000000
--- a/include/linux/platform_data/cpsw.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * Texas Instruments Ethernet Switch Driver
3 *
4 * Copyright (C) 2012 Texas Instruments
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#ifndef __CPSW_H__
16#define __CPSW_H__
17
18#include <linux/if_ether.h>
19
20struct cpsw_slave_data {
21 char phy_id[MII_BUS_ID_SIZE];
22 int phy_if;
23 u8 mac_addr[ETH_ALEN];
24 u16 dual_emac_res_vlan; /* Reserved VLAN for DualEMAC */
25
26};
27
28struct cpsw_platform_data {
29 u32 ss_reg_ofs; /* Subsystem control register offset */
30 u32 channels; /* number of cpdma channels (symmetric) */
31 u32 slaves; /* number of slave cpgmac ports */
32 struct cpsw_slave_data *slave_data;
33 u32 active_slave; /* time stamping, ethtool and SIOCGMIIPHY slave */
34 u32 cpts_clock_mult; /* convert input clock ticks to nanoseconds */
35 u32 cpts_clock_shift; /* convert input clock ticks to nanoseconds */
36 u32 ale_entries; /* ale table size */
37 u32 bd_ram_size; /*buffer descriptor ram size */
38 u32 rx_descs; /* Number of Rx Descriptios */
39 u32 mac_control; /* Mac control register */
40 u16 default_vlan; /* Def VLAN for ALE lookup in VLAN aware mode*/
41 bool dual_emac; /* Enable Dual EMAC mode */
42};
43
44#endif /* __CPSW_H__ */
diff --git a/include/linux/platform_data/dma-rcar-hpbdma.h b/include/linux/platform_data/dma-rcar-hpbdma.h
new file mode 100644
index 000000000000..648b8ea61a22
--- /dev/null
+++ b/include/linux/platform_data/dma-rcar-hpbdma.h
@@ -0,0 +1,103 @@
1/*
2 * Copyright (C) 2011-2013 Renesas Electronics Corporation
3 * Copyright (C) 2013 Cogent Embedded, Inc.
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation.
8 */
9
10#ifndef __DMA_RCAR_HPBDMA_H
11#define __DMA_RCAR_HPBDMA_H
12
13#include <linux/bitops.h>
14#include <linux/types.h>
15
16/* Transmit sizes and respective register values */
17enum {
18 XMIT_SZ_8BIT = 0,
19 XMIT_SZ_16BIT = 1,
20 XMIT_SZ_32BIT = 2,
21 XMIT_SZ_MAX
22};
23
24/* DMA control register (DCR) bits */
25#define HPB_DMAE_DCR_DTAMD (1u << 26)
26#define HPB_DMAE_DCR_DTAC (1u << 25)
27#define HPB_DMAE_DCR_DTAU (1u << 24)
28#define HPB_DMAE_DCR_DTAU1 (1u << 23)
29#define HPB_DMAE_DCR_SWMD (1u << 22)
30#define HPB_DMAE_DCR_BTMD (1u << 21)
31#define HPB_DMAE_DCR_PKMD (1u << 20)
32#define HPB_DMAE_DCR_CT (1u << 18)
33#define HPB_DMAE_DCR_ACMD (1u << 17)
34#define HPB_DMAE_DCR_DIP (1u << 16)
35#define HPB_DMAE_DCR_SMDL (1u << 13)
36#define HPB_DMAE_DCR_SPDAM (1u << 12)
37#define HPB_DMAE_DCR_SDRMD_MASK (3u << 10)
38#define HPB_DMAE_DCR_SDRMD_MOD (0u << 10)
39#define HPB_DMAE_DCR_SDRMD_AUTO (1u << 10)
40#define HPB_DMAE_DCR_SDRMD_TIMER (2u << 10)
41#define HPB_DMAE_DCR_SPDS_MASK (3u << 8)
42#define HPB_DMAE_DCR_SPDS_8BIT (0u << 8)
43#define HPB_DMAE_DCR_SPDS_16BIT (1u << 8)
44#define HPB_DMAE_DCR_SPDS_32BIT (2u << 8)
45#define HPB_DMAE_DCR_DMDL (1u << 5)
46#define HPB_DMAE_DCR_DPDAM (1u << 4)
47#define HPB_DMAE_DCR_DDRMD_MASK (3u << 2)
48#define HPB_DMAE_DCR_DDRMD_MOD (0u << 2)
49#define HPB_DMAE_DCR_DDRMD_AUTO (1u << 2)
50#define HPB_DMAE_DCR_DDRMD_TIMER (2u << 2)
51#define HPB_DMAE_DCR_DPDS_MASK (3u << 0)
52#define HPB_DMAE_DCR_DPDS_8BIT (0u << 0)
53#define HPB_DMAE_DCR_DPDS_16BIT (1u << 0)
54#define HPB_DMAE_DCR_DPDS_32BIT (2u << 0)
55
56/* Asynchronous reset register (ASYNCRSTR) bits */
57#define HPB_DMAE_ASYNCRSTR_ASRST41 BIT(10)
58#define HPB_DMAE_ASYNCRSTR_ASRST40 BIT(9)
59#define HPB_DMAE_ASYNCRSTR_ASRST39 BIT(8)
60#define HPB_DMAE_ASYNCRSTR_ASRST27 BIT(7)
61#define HPB_DMAE_ASYNCRSTR_ASRST26 BIT(6)
62#define HPB_DMAE_ASYNCRSTR_ASRST25 BIT(5)
63#define HPB_DMAE_ASYNCRSTR_ASRST24 BIT(4)
64#define HPB_DMAE_ASYNCRSTR_ASRST23 BIT(3)
65#define HPB_DMAE_ASYNCRSTR_ASRST22 BIT(2)
66#define HPB_DMAE_ASYNCRSTR_ASRST21 BIT(1)
67#define HPB_DMAE_ASYNCRSTR_ASRST20 BIT(0)
68
69struct hpb_dmae_slave_config {
70 unsigned int id;
71 dma_addr_t addr;
72 u32 dcr;
73 u32 port;
74 u32 rstr;
75 u32 mdr;
76 u32 mdm;
77 u32 flags;
78#define HPB_DMAE_SET_ASYNC_RESET BIT(0)
79#define HPB_DMAE_SET_ASYNC_MODE BIT(1)
80 u32 dma_ch;
81};
82
83#define HPB_DMAE_CHANNEL(_irq, _s_id) \
84{ \
85 .ch_irq = _irq, \
86 .s_id = _s_id, \
87}
88
89struct hpb_dmae_channel {
90 unsigned int ch_irq;
91 unsigned int s_id;
92};
93
94struct hpb_dmae_pdata {
95 const struct hpb_dmae_slave_config *slaves;
96 int num_slaves;
97 const struct hpb_dmae_channel *channels;
98 int num_channels;
99 const unsigned int ts_shift[XMIT_SZ_MAX];
100 int num_hw_channels;
101};
102
103#endif
diff --git a/include/linux/platform_data/edma.h b/include/linux/platform_data/edma.h
index 57300fd7cc03..179fb91bb5f2 100644
--- a/include/linux/platform_data/edma.h
+++ b/include/linux/platform_data/edma.h
@@ -180,4 +180,6 @@ struct edma_soc_info {
180 const s16 (*xbar_chans)[2]; 180 const s16 (*xbar_chans)[2];
181}; 181};
182 182
183int edma_trigger_channel(unsigned);
184
183#endif 185#endif
diff --git a/include/linux/platform_data/efm32-spi.h b/include/linux/platform_data/efm32-spi.h
new file mode 100644
index 000000000000..31b19ca1d73a
--- /dev/null
+++ b/include/linux/platform_data/efm32-spi.h
@@ -0,0 +1,14 @@
1#ifndef __LINUX_PLATFORM_DATA_EFM32_SPI_H__
2#define __LINUX_PLATFORM_DATA_EFM32_SPI_H__
3
4#include <linux/types.h>
5
6/**
7 * struct efm32_spi_pdata
8 * @location: pinmux location for the I/O pins (to be written to the ROUTE
9 * register)
10 */
11struct efm32_spi_pdata {
12 u8 location;
13};
14#endif /* ifndef __LINUX_PLATFORM_DATA_EFM32_SPI_H__ */
diff --git a/include/linux/platform_data/exynos_thermal.h b/include/linux/platform_data/exynos_thermal.h
deleted file mode 100644
index da7e6274b175..000000000000
--- a/include/linux/platform_data/exynos_thermal.h
+++ /dev/null
@@ -1,119 +0,0 @@
1/*
2 * exynos_thermal.h - Samsung EXYNOS 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_EXYNOS_THERMAL_H
23#define _LINUX_EXYNOS_THERMAL_H
24#include <linux/cpu_cooling.h>
25
26enum calibration_type {
27 TYPE_ONE_POINT_TRIMMING,
28 TYPE_TWO_POINT_TRIMMING,
29 TYPE_NONE,
30};
31
32enum soc_type {
33 SOC_ARCH_EXYNOS4210 = 1,
34 SOC_ARCH_EXYNOS,
35};
36/**
37 * struct freq_clip_table
38 * @freq_clip_max: maximum frequency allowed for this cooling state.
39 * @temp_level: Temperature level at which the temperature clipping will
40 * happen.
41 * @mask_val: cpumask of the allowed cpu's where the clipping will take place.
42 *
43 * This structure is required to be filled and passed to the
44 * cpufreq_cooling_unregister function.
45 */
46struct freq_clip_table {
47 unsigned int freq_clip_max;
48 unsigned int temp_level;
49 const struct cpumask *mask_val;
50};
51
52/**
53 * struct exynos_tmu_platform_data
54 * @threshold: basic temperature for generating interrupt
55 * 25 <= threshold <= 125 [unit: degree Celsius]
56 * @threshold_falling: differntial value for setting threshold
57 * of temperature falling interrupt.
58 * @trigger_levels: array for each interrupt levels
59 * [unit: degree Celsius]
60 * 0: temperature for trigger_level0 interrupt
61 * condition for trigger_level0 interrupt:
62 * current temperature > threshold + trigger_levels[0]
63 * 1: temperature for trigger_level1 interrupt
64 * condition for trigger_level1 interrupt:
65 * current temperature > threshold + trigger_levels[1]
66 * 2: temperature for trigger_level2 interrupt
67 * condition for trigger_level2 interrupt:
68 * current temperature > threshold + trigger_levels[2]
69 * 3: temperature for trigger_level3 interrupt
70 * condition for trigger_level3 interrupt:
71 * current temperature > threshold + trigger_levels[3]
72 * @trigger_level0_en:
73 * 1 = enable trigger_level0 interrupt,
74 * 0 = disable trigger_level0 interrupt
75 * @trigger_level1_en:
76 * 1 = enable trigger_level1 interrupt,
77 * 0 = disable trigger_level1 interrupt
78 * @trigger_level2_en:
79 * 1 = enable trigger_level2 interrupt,
80 * 0 = disable trigger_level2 interrupt
81 * @trigger_level3_en:
82 * 1 = enable trigger_level3 interrupt,
83 * 0 = disable trigger_level3 interrupt
84 * @gain: gain of amplifier in the positive-TC generator block
85 * 0 <= gain <= 15
86 * @reference_voltage: reference voltage of amplifier
87 * in the positive-TC generator block
88 * 0 <= reference_voltage <= 31
89 * @noise_cancel_mode: noise cancellation mode
90 * 000, 100, 101, 110 and 111 can be different modes
91 * @type: determines the type of SOC
92 * @efuse_value: platform defined fuse value
93 * @cal_type: calibration type for temperature
94 * @freq_clip_table: Table representing frequency reduction percentage.
95 * @freq_tab_count: Count of the above table as frequency reduction may
96 * applicable to only some of the trigger levels.
97 *
98 * This structure is required for configuration of exynos_tmu driver.
99 */
100struct exynos_tmu_platform_data {
101 u8 threshold;
102 u8 threshold_falling;
103 u8 trigger_levels[4];
104 bool trigger_level0_en;
105 bool trigger_level1_en;
106 bool trigger_level2_en;
107 bool trigger_level3_en;
108
109 u8 gain;
110 u8 reference_voltage;
111 u8 noise_cancel_mode;
112 u32 efuse_value;
113
114 enum calibration_type cal_type;
115 enum soc_type type;
116 struct freq_clip_table freq_tab[4];
117 unsigned int freq_tab_count;
118};
119#endif /* _LINUX_EXYNOS_THERMAL_H */
diff --git a/include/linux/platform_data/gpio-em.h b/include/linux/platform_data/gpio-em.h
index 573edfb046c4..7c5a519d2dcd 100644
--- a/include/linux/platform_data/gpio-em.h
+++ b/include/linux/platform_data/gpio-em.h
@@ -5,6 +5,7 @@ struct gpio_em_config {
5 unsigned int gpio_base; 5 unsigned int gpio_base;
6 unsigned int irq_base; 6 unsigned int irq_base;
7 unsigned int number_of_pins; 7 unsigned int number_of_pins;
8 const char *pctl_name;
8}; 9};
9 10
10#endif /* __GPIO_EM_H__ */ 11#endif /* __GPIO_EM_H__ */
diff --git a/include/linux/platform_data/gpio_backlight.h b/include/linux/platform_data/gpio_backlight.h
new file mode 100644
index 000000000000..5ae0d9c80d4d
--- /dev/null
+++ b/include/linux/platform_data/gpio_backlight.h
@@ -0,0 +1,21 @@
1/*
2 * gpio_backlight.h - Simple GPIO-controlled backlight
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#ifndef __GPIO_BACKLIGHT_H__
9#define __GPIO_BACKLIGHT_H__
10
11struct device;
12
13struct gpio_backlight_platform_data {
14 struct device *fbdev;
15 int gpio;
16 int def_value;
17 bool active_low;
18 const char *name;
19};
20
21#endif
diff --git a/include/linux/platform_data/leds-lp55xx.h b/include/linux/platform_data/leds-lp55xx.h
index 202e290faea8..51a2ff579d60 100644
--- a/include/linux/platform_data/leds-lp55xx.h
+++ b/include/linux/platform_data/leds-lp55xx.h
@@ -36,6 +36,13 @@ struct lp55xx_predef_pattern {
36 u8 size_b; 36 u8 size_b;
37}; 37};
38 38
39enum lp8501_pwr_sel {
40 LP8501_ALL_VDD, /* D1~9 are connected to VDD */
41 LP8501_6VDD_3VOUT, /* D1~6 with VDD, D7~9 with VOUT */
42 LP8501_3VDD_6VOUT, /* D1~6 with VOUT, D7~9 with VDD */
43 LP8501_ALL_VOUT, /* D1~9 are connected to VOUT */
44};
45
39/* 46/*
40 * struct lp55xx_platform_data 47 * struct lp55xx_platform_data
41 * @led_config : Configurable led class device 48 * @led_config : Configurable led class device
@@ -67,6 +74,9 @@ struct lp55xx_platform_data {
67 /* Predefined pattern data */ 74 /* Predefined pattern data */
68 struct lp55xx_predef_pattern *patterns; 75 struct lp55xx_predef_pattern *patterns;
69 unsigned int num_patterns; 76 unsigned int num_patterns;
77
78 /* LP8501 specific */
79 enum lp8501_pwr_sel pwr_sel;
70}; 80};
71 81
72#endif /* _LEDS_LP55XX_H */ 82#endif /* _LEDS_LP55XX_H */
diff --git a/include/linux/platform_data/leds-pca9633.h b/include/linux/platform_data/leds-pca963x.h
index c5bf29b6fa7f..e731f0036329 100644
--- a/include/linux/platform_data/leds-pca9633.h
+++ b/include/linux/platform_data/leds-pca963x.h
@@ -1,7 +1,8 @@
1/* 1/*
2 * PCA9633 LED chip driver. 2 * PCA963X LED chip driver.
3 * 3 *
4 * Copyright 2012 bct electronic GmbH 4 * Copyright 2012 bct electronic GmbH
5 * Copyright 2013 Qtechnology A/S
5 * 6 *
6 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License 8 * modify it under the terms of the GNU General Public License
@@ -18,18 +19,24 @@
18 * 02110-1301 USA 19 * 02110-1301 USA
19 */ 20 */
20 21
21#ifndef __LINUX_PCA9633_H 22#ifndef __LINUX_PCA963X_H
22#define __LINUX_PCA9633_H 23#define __LINUX_PCA963X_H
23#include <linux/leds.h> 24#include <linux/leds.h>
24 25
25enum pca9633_outdrv { 26enum pca963x_outdrv {
26 PCA9633_OPEN_DRAIN, 27 PCA963X_OPEN_DRAIN,
27 PCA9633_TOTEM_POLE, /* aka push-pull */ 28 PCA963X_TOTEM_POLE, /* aka push-pull */
28}; 29};
29 30
30struct pca9633_platform_data { 31enum pca963x_blink_type {
32 PCA963X_SW_BLINK,
33 PCA963X_HW_BLINK,
34};
35
36struct pca963x_platform_data {
31 struct led_platform_data leds; 37 struct led_platform_data leds;
32 enum pca9633_outdrv outdrv; 38 enum pca963x_outdrv outdrv;
39 enum pca963x_blink_type blink_type;
33}; 40};
34 41
35#endif /* __LINUX_PCA9633_H*/ 42#endif /* __LINUX_PCA963X_H*/
diff --git a/include/linux/platform_data/leds-renesas-tpu.h b/include/linux/platform_data/leds-renesas-tpu.h
deleted file mode 100644
index 055387086fc1..000000000000
--- a/include/linux/platform_data/leds-renesas-tpu.h
+++ /dev/null
@@ -1,14 +0,0 @@
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/lv5207lp.h b/include/linux/platform_data/lv5207lp.h
new file mode 100644
index 000000000000..7dc4d9a219a6
--- /dev/null
+++ b/include/linux/platform_data/lv5207lp.h
@@ -0,0 +1,19 @@
1/*
2 * lv5207lp.h - Sanyo LV5207LP LEDs Driver
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8#ifndef __LV5207LP_H__
9#define __LV5207LP_H__
10
11struct device;
12
13struct lv5207lp_platform_data {
14 struct device *fbdev;
15 unsigned int max_value;
16 unsigned int def_value;
17};
18
19#endif
diff --git a/include/linux/platform_data/max310x.h b/include/linux/platform_data/max310x.h
index 91648bf5fc5c..dd11dcd1a184 100644
--- a/include/linux/platform_data/max310x.h
+++ b/include/linux/platform_data/max310x.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Maxim (Dallas) MAX3107/8 serial driver 2 * Maxim (Dallas) MAX3107/8/9, MAX14830 serial driver
3 * 3 *
4 * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru> 4 * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru>
5 * 5 *
@@ -37,14 +37,13 @@
37 * }; 37 * };
38 */ 38 */
39 39
40#define MAX310X_MAX_UARTS 1 40#define MAX310X_MAX_UARTS 4
41 41
42/* MAX310X platform data structure */ 42/* MAX310X platform data structure */
43struct max310x_pdata { 43struct max310x_pdata {
44 /* Flags global to driver */ 44 /* Flags global to driver */
45 const u8 driver_flags:2; 45 const u8 driver_flags;
46#define MAX310X_EXT_CLK (0x00000001) /* External clock enable */ 46#define MAX310X_EXT_CLK (0x00000001) /* External clock enable */
47#define MAX310X_AUTOSLEEP (0x00000002) /* Enable AutoSleep mode */
48 /* Flags global to UART port */ 47 /* Flags global to UART port */
49 const u8 uart_flags[MAX310X_MAX_UARTS]; 48 const u8 uart_flags[MAX310X_MAX_UARTS];
50#define MAX310X_LOOPBACK (0x00000001) /* Loopback mode enable */ 49#define MAX310X_LOOPBACK (0x00000001) /* Loopback mode enable */
@@ -60,8 +59,6 @@ struct max310x_pdata {
60 void (*init)(void); 59 void (*init)(void);
61 /* Called before finish */ 60 /* Called before finish */
62 void (*exit)(void); 61 void (*exit)(void);
63 /* Suspend callback */
64 void (*suspend)(int do_suspend);
65}; 62};
66 63
67#endif 64#endif
diff --git a/include/linux/platform_data/mtd-nand-pxa3xx.h b/include/linux/platform_data/mtd-nand-pxa3xx.h
index c42f39f20195..ffb801998e5d 100644
--- a/include/linux/platform_data/mtd-nand-pxa3xx.h
+++ b/include/linux/platform_data/mtd-nand-pxa3xx.h
@@ -16,19 +16,6 @@ struct pxa3xx_nand_timing {
16 unsigned int tAR; /* ND_ALE low to ND_nRE low delay */ 16 unsigned int tAR; /* ND_ALE low to ND_nRE low delay */
17}; 17};
18 18
19struct pxa3xx_nand_cmdset {
20 uint16_t read1;
21 uint16_t read2;
22 uint16_t program;
23 uint16_t read_status;
24 uint16_t read_id;
25 uint16_t erase;
26 uint16_t reset;
27 uint16_t lock;
28 uint16_t unlock;
29 uint16_t lock_status;
30};
31
32struct pxa3xx_nand_flash { 19struct pxa3xx_nand_flash {
33 char *name; 20 char *name;
34 uint32_t chip_id; 21 uint32_t chip_id;
diff --git a/include/linux/platform_data/omap-abe-twl6040.h b/include/linux/platform_data/omap-abe-twl6040.h
deleted file mode 100644
index 5d298ac10fc2..000000000000
--- a/include/linux/platform_data/omap-abe-twl6040.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/**
2 * omap-abe-twl6040.h - ASoC machine driver OMAP4+ devices, header.
3 *
4 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
5 * All rights reserved.
6 *
7 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * 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., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 */
23
24#ifndef _OMAP_ABE_TWL6040_H_
25#define _OMAP_ABE_TWL6040_H_
26
27/* To select if only one channel is connected in a stereo port */
28#define ABE_TWL6040_LEFT (1 << 0)
29#define ABE_TWL6040_RIGHT (1 << 1)
30
31struct omap_abe_twl6040_data {
32 char *card_name;
33 /* Feature flags for connected audio pins */
34 u8 has_hs;
35 u8 has_hf;
36 bool has_ep;
37 u8 has_aux;
38 u8 has_vibra;
39 bool has_dmic;
40 bool has_hsmic;
41 bool has_mainmic;
42 bool has_submic;
43 u8 has_afm;
44 /* Other features */
45 bool jack_detection; /* board can detect jack events */
46 int mclk_freq; /* MCLK frequency speed for twl6040 */
47};
48
49#endif /* _OMAP_ABE_TWL6040_H_ */
diff --git a/include/linux/i2c/pca953x.h b/include/linux/platform_data/pca953x.h
index 3c98dd4f901f..3c98dd4f901f 100644
--- a/include/linux/i2c/pca953x.h
+++ b/include/linux/platform_data/pca953x.h
diff --git a/include/linux/platform_data/pinctrl-nomadik.h b/include/linux/platform_data/pinctrl-nomadik.h
index f73b2f0c55b7..abf5bed84df3 100644
--- a/include/linux/platform_data/pinctrl-nomadik.h
+++ b/include/linux/platform_data/pinctrl-nomadik.h
@@ -226,30 +226,6 @@ enum nmk_gpio_slpm {
226 NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE, 226 NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE,
227}; 227};
228 228
229/* Older deprecated pin config API that should go away soon */
230extern int nmk_config_pin(pin_cfg_t cfg, bool sleep);
231extern int nmk_config_pins(pin_cfg_t *cfgs, int num);
232extern int nmk_config_pins_sleep(pin_cfg_t *cfgs, int num);
233extern int nmk_gpio_set_slpm(int gpio, enum nmk_gpio_slpm mode);
234extern int nmk_gpio_set_pull(int gpio, enum nmk_gpio_pull pull);
235#ifdef CONFIG_PINCTRL_NOMADIK
236extern int nmk_gpio_set_mode(int gpio, int gpio_mode);
237#else
238static inline int nmk_gpio_set_mode(int gpio, int gpio_mode)
239{
240 return -ENODEV;
241}
242#endif
243extern int nmk_gpio_get_mode(int gpio);
244
245extern void nmk_gpio_wakeups_suspend(void);
246extern void nmk_gpio_wakeups_resume(void);
247
248extern void nmk_gpio_clocks_enable(void);
249extern void nmk_gpio_clocks_disable(void);
250
251extern void nmk_gpio_read_pull(int gpio_bank, u32 *pull_up);
252
253/* 229/*
254 * Platform data to register a block: only the initial gpio/irq number. 230 * Platform data to register a block: only the initial gpio/irq number.
255 */ 231 */
diff --git a/include/linux/platform_data/rcar-du.h b/include/linux/platform_data/rcar-du.h
index 80587fdbba3e..1a2e9901a22e 100644
--- a/include/linux/platform_data/rcar-du.h
+++ b/include/linux/platform_data/rcar-du.h
@@ -16,8 +16,18 @@
16 16
17#include <drm/drm_mode.h> 17#include <drm/drm_mode.h>
18 18
19enum rcar_du_output {
20 RCAR_DU_OUTPUT_DPAD0,
21 RCAR_DU_OUTPUT_DPAD1,
22 RCAR_DU_OUTPUT_LVDS0,
23 RCAR_DU_OUTPUT_LVDS1,
24 RCAR_DU_OUTPUT_TCON,
25 RCAR_DU_OUTPUT_MAX,
26};
27
19enum rcar_du_encoder_type { 28enum rcar_du_encoder_type {
20 RCAR_DU_ENCODER_UNUSED = 0, 29 RCAR_DU_ENCODER_UNUSED = 0,
30 RCAR_DU_ENCODER_NONE,
21 RCAR_DU_ENCODER_VGA, 31 RCAR_DU_ENCODER_VGA,
22 RCAR_DU_ENCODER_LVDS, 32 RCAR_DU_ENCODER_LVDS,
23}; 33};
@@ -28,22 +38,32 @@ struct rcar_du_panel_data {
28 struct drm_mode_modeinfo mode; 38 struct drm_mode_modeinfo mode;
29}; 39};
30 40
31struct rcar_du_encoder_lvds_data { 41struct rcar_du_connector_lvds_data {
32 struct rcar_du_panel_data panel; 42 struct rcar_du_panel_data panel;
33}; 43};
34 44
35struct rcar_du_encoder_vga_data { 45struct rcar_du_connector_vga_data {
36 /* TODO: Add DDC information for EDID retrieval */ 46 /* TODO: Add DDC information for EDID retrieval */
37}; 47};
38 48
49/*
50 * struct rcar_du_encoder_data - Encoder platform data
51 * @type: the encoder type (RCAR_DU_ENCODER_*)
52 * @output: the DU output the connector is connected to (RCAR_DU_OUTPUT_*)
53 * @connector.lvds: platform data for LVDS connectors
54 * @connector.vga: platform data for VGA connectors
55 *
56 * Encoder platform data describes an on-board encoder, its associated DU SoC
57 * output, and the connector.
58 */
39struct rcar_du_encoder_data { 59struct rcar_du_encoder_data {
40 enum rcar_du_encoder_type encoder; 60 enum rcar_du_encoder_type type;
41 unsigned int output; 61 enum rcar_du_output output;
42 62
43 union { 63 union {
44 struct rcar_du_encoder_lvds_data lvds; 64 struct rcar_du_connector_lvds_data lvds;
45 struct rcar_du_encoder_vga_data vga; 65 struct rcar_du_connector_vga_data vga;
46 } u; 66 } connector;
47}; 67};
48 68
49struct rcar_du_platform_data { 69struct rcar_du_platform_data {
diff --git a/include/linux/platform_data/serial-sccnxp.h b/include/linux/platform_data/serial-sccnxp.h
index bdc510d03245..af0c8c3b89ae 100644
--- a/include/linux/platform_data/serial-sccnxp.h
+++ b/include/linux/platform_data/serial-sccnxp.h
@@ -60,7 +60,6 @@
60 * }; 60 * };
61 * 61 *
62 * static struct sccnxp_pdata sc2892_info = { 62 * static struct sccnxp_pdata sc2892_info = {
63 * .frequency = 3686400,
64 * .mctrl_cfg[0] = MCTRL_SIG(DIR_OP, LINE_OP0), 63 * .mctrl_cfg[0] = MCTRL_SIG(DIR_OP, LINE_OP0),
65 * .mctrl_cfg[1] = MCTRL_SIG(DIR_OP, LINE_OP1), 64 * .mctrl_cfg[1] = MCTRL_SIG(DIR_OP, LINE_OP1),
66 * }; 65 * };
@@ -78,8 +77,6 @@
78 77
79/* SCCNXP platform data structure */ 78/* SCCNXP platform data structure */
80struct sccnxp_pdata { 79struct sccnxp_pdata {
81 /* Frequency (extrenal clock or crystal) */
82 int frequency;
83 /* Shift for A0 line */ 80 /* Shift for A0 line */
84 const u8 reg_shift; 81 const u8 reg_shift;
85 /* Modem control lines configuration */ 82 /* Modem control lines configuration */
diff --git a/include/linux/platform_data/simplefb.h b/include/linux/platform_data/simplefb.h
new file mode 100644
index 000000000000..077303cedbf4
--- /dev/null
+++ b/include/linux/platform_data/simplefb.h
@@ -0,0 +1,64 @@
1/*
2 * simplefb.h - Simple Framebuffer Device
3 *
4 * Copyright (C) 2013 David Herrmann <dh.herrmann@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __PLATFORM_DATA_SIMPLEFB_H__
13#define __PLATFORM_DATA_SIMPLEFB_H__
14
15#include <drm/drm_fourcc.h>
16#include <linux/fb.h>
17#include <linux/kernel.h>
18
19/* format array, use it to initialize a "struct simplefb_format" array */
20#define SIMPLEFB_FORMATS \
21{ \
22 { "r5g6b5", 16, {11, 5}, {5, 6}, {0, 5}, {0, 0}, DRM_FORMAT_RGB565 }, \
23 { "x1r5g5b5", 16, {10, 5}, {5, 5}, {0, 5}, {0, 0}, DRM_FORMAT_XRGB1555 }, \
24 { "a1r5g5b5", 16, {10, 5}, {5, 5}, {0, 5}, {15, 1}, DRM_FORMAT_ARGB1555 }, \
25 { "r8g8b8", 24, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_RGB888 }, \
26 { "x8r8g8b8", 32, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_XRGB8888 }, \
27 { "a8r8g8b8", 32, {16, 8}, {8, 8}, {0, 8}, {24, 8}, DRM_FORMAT_ARGB8888 }, \
28 { "a8b8g8r8", 32, {0, 8}, {8, 8}, {16, 8}, {24, 8}, DRM_FORMAT_ABGR8888 }, \
29 { "x2r10g10b10", 32, {20, 10}, {10, 10}, {0, 10}, {0, 0}, DRM_FORMAT_XRGB2101010 }, \
30 { "a2r10g10b10", 32, {20, 10}, {10, 10}, {0, 10}, {30, 2}, DRM_FORMAT_ARGB2101010 }, \
31}
32
33/*
34 * Data-Format for Simple-Framebuffers
35 * @name: unique 0-terminated name that can be used to identify the mode
36 * @red,green,blue: Offsets and sizes of the single RGB parts
37 * @transp: Offset and size of the alpha bits. length=0 means no alpha
38 * @fourcc: 32bit DRM four-CC code (see drm_fourcc.h)
39 */
40struct simplefb_format {
41 const char *name;
42 u32 bits_per_pixel;
43 struct fb_bitfield red;
44 struct fb_bitfield green;
45 struct fb_bitfield blue;
46 struct fb_bitfield transp;
47 u32 fourcc;
48};
49
50/*
51 * Simple-Framebuffer description
52 * If the arch-boot code creates simple-framebuffers without DT support, it
53 * can pass the width, height, stride and format via this platform-data object.
54 * The framebuffer location must be given as IORESOURCE_MEM resource.
55 * @format must be a format as described in "struct simplefb_format" above.
56 */
57struct simplefb_platform_data {
58 u32 width;
59 u32 height;
60 u32 stride;
61 const char *format;
62};
63
64#endif /* __PLATFORM_DATA_SIMPLEFB_H__ */
diff --git a/include/linux/platform_data/st_sensors_pdata.h b/include/linux/platform_data/st_sensors_pdata.h
new file mode 100644
index 000000000000..753839187ba0
--- /dev/null
+++ b/include/linux/platform_data/st_sensors_pdata.h
@@ -0,0 +1,24 @@
1/*
2 * STMicroelectronics sensors platform-data driver
3 *
4 * Copyright 2013 STMicroelectronics Inc.
5 *
6 * Denis Ciocca <denis.ciocca@st.com>
7 *
8 * Licensed under the GPL-2.
9 */
10
11#ifndef ST_SENSORS_PDATA_H
12#define ST_SENSORS_PDATA_H
13
14/**
15 * struct st_sensors_platform_data - Platform data for the ST sensors
16 * @drdy_int_pin: Redirect DRDY on pin 1 (1) or pin 2 (2).
17 * Available only for accelerometer and pressure sensors.
18 * Accelerometer DRDY on LSM330 available only on pin 1 (see datasheet).
19 */
20struct st_sensors_platform_data {
21 u8 drdy_int_pin;
22};
23
24#endif /* ST_SENSORS_PDATA_H */
diff --git a/include/linux/platform_data/tegra_usb.h b/include/linux/platform_data/tegra_usb.h
deleted file mode 100644
index 66c673fef408..000000000000
--- a/include/linux/platform_data/tegra_usb.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * Copyright (C) 2010 Google, Inc.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef _TEGRA_USB_H_
16#define _TEGRA_USB_H_
17
18enum tegra_usb_operating_modes {
19 TEGRA_USB_DEVICE,
20 TEGRA_USB_HOST,
21 TEGRA_USB_OTG,
22};
23
24struct tegra_ehci_platform_data {
25 enum tegra_usb_operating_modes operating_mode;
26 /* power down the phy on bus suspend */
27 int power_down_on_bus_suspend;
28 void *phy_config;
29 int vbus_gpio;
30};
31
32#endif /* _TEGRA_USB_H_ */
diff --git a/include/linux/platform_data/vsp1.h b/include/linux/platform_data/vsp1.h
new file mode 100644
index 000000000000..a73a456d7f11
--- /dev/null
+++ b/include/linux/platform_data/vsp1.h
@@ -0,0 +1,25 @@
1/*
2 * vsp1.h -- R-Car VSP1 Platform Data
3 *
4 * Copyright (C) 2013 Renesas Corporation
5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.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 as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13#ifndef __PLATFORM_VSP1_H__
14#define __PLATFORM_VSP1_H__
15
16#define VSP1_HAS_LIF (1 << 0)
17
18struct vsp1_platform_data {
19 unsigned int features;
20 unsigned int rpf_count;
21 unsigned int uds_count;
22 unsigned int wpf_count;
23};
24
25#endif /* __PLATFORM_VSP1_H__ */
diff --git a/include/linux/power/bq24190_charger.h b/include/linux/power/bq24190_charger.h
new file mode 100644
index 000000000000..9f0283721cbc
--- /dev/null
+++ b/include/linux/power/bq24190_charger.h
@@ -0,0 +1,16 @@
1/*
2 * Platform data for the TI bq24190 battery charger driver.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef _BQ24190_CHARGER_H_
10#define _BQ24190_CHARGER_H_
11
12struct bq24190_platform_data {
13 unsigned int gpio_int; /* GPIO pin that's connected to INT# */
14};
15
16#endif
diff --git a/include/linux/power/twl4030_madc_battery.h b/include/linux/power/twl4030_madc_battery.h
new file mode 100644
index 000000000000..23110dc77726
--- /dev/null
+++ b/include/linux/power/twl4030_madc_battery.h
@@ -0,0 +1,39 @@
1/*
2 * Dumb driver for LiIon batteries using TWL4030 madc.
3 *
4 * Copyright 2013 Golden Delicious Computers
5 * Nikolaus Schaller <hns@goldelico.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 as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 *
12 * You should have received a copy of the GNU General Public License along
13 * with this program; if not, write to the Free Software Foundation, Inc.,
14 * 675 Mass Ave, Cambridge, MA 02139, USA.
15 *
16 */
17
18#ifndef __TWL4030_MADC_BATTERY_H
19#define __TWL4030_MADC_BATTERY_H
20
21/*
22 * Usually we can assume 100% @ 4.15V and 0% @ 3.3V but curves differ for
23 * charging and discharging!
24 */
25
26struct twl4030_madc_bat_calibration {
27 short voltage; /* in mV - specify -1 for end of list */
28 short level; /* in percent (0 .. 100%) */
29};
30
31struct twl4030_madc_bat_platform_data {
32 unsigned int capacity; /* total capacity in uAh */
33 struct twl4030_madc_bat_calibration *charging;
34 int charging_size;
35 struct twl4030_madc_bat_calibration *discharging;
36 int discharging_size;
37};
38
39#endif
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 804b90643a85..5c2600630dc9 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -15,6 +15,7 @@
15 15
16#include <linux/workqueue.h> 16#include <linux/workqueue.h>
17#include <linux/leds.h> 17#include <linux/leds.h>
18#include <linux/spinlock.h>
18 19
19struct device; 20struct device;
20 21
@@ -194,6 +195,8 @@ struct power_supply {
194 /* private */ 195 /* private */
195 struct device *dev; 196 struct device *dev;
196 struct work_struct changed_work; 197 struct work_struct changed_work;
198 spinlock_t changed_lock;
199 bool changed;
197#ifdef CONFIG_THERMAL 200#ifdef CONFIG_THERMAL
198 struct thermal_zone_device *tzd; 201 struct thermal_zone_device *tzd;
199 struct thermal_cooling_device *tcd; 202 struct thermal_cooling_device *tcd;
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h
index 7db3eb93a079..1d2cd21242e8 100644
--- a/include/linux/pps_kernel.h
+++ b/include/linux/pps_kernel.h
@@ -80,7 +80,7 @@ struct pps_device {
80 * Global variables 80 * Global variables
81 */ 81 */
82 82
83extern struct device_attribute pps_attrs[]; 83extern const struct attribute_group *pps_groups[];
84 84
85/* 85/*
86 * Internal functions. 86 * Internal functions.
diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h
new file mode 100644
index 000000000000..931bc616219f
--- /dev/null
+++ b/include/linux/preempt_mask.h
@@ -0,0 +1,122 @@
1#ifndef LINUX_PREEMPT_MASK_H
2#define LINUX_PREEMPT_MASK_H
3
4#include <linux/preempt.h>
5#include <asm/hardirq.h>
6
7/*
8 * We put the hardirq and softirq counter into the preemption
9 * counter. The bitmask has the following meaning:
10 *
11 * - bits 0-7 are the preemption count (max preemption depth: 256)
12 * - bits 8-15 are the softirq count (max # of softirqs: 256)
13 *
14 * The hardirq count can in theory reach the same as NR_IRQS.
15 * In reality, the number of nested IRQS is limited to the stack
16 * size as well. For archs with over 1000 IRQS it is not practical
17 * to expect that they will all nest. We give a max of 10 bits for
18 * hardirq nesting. An arch may choose to give less than 10 bits.
19 * m68k expects it to be 8.
20 *
21 * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
22 * - bit 26 is the NMI_MASK
23 * - bit 27 is the PREEMPT_ACTIVE flag
24 *
25 * PREEMPT_MASK: 0x000000ff
26 * SOFTIRQ_MASK: 0x0000ff00
27 * HARDIRQ_MASK: 0x03ff0000
28 * NMI_MASK: 0x04000000
29 */
30#define PREEMPT_BITS 8
31#define SOFTIRQ_BITS 8
32#define NMI_BITS 1
33
34#define MAX_HARDIRQ_BITS 10
35
36#ifndef HARDIRQ_BITS
37# define HARDIRQ_BITS MAX_HARDIRQ_BITS
38#endif
39
40#if HARDIRQ_BITS > MAX_HARDIRQ_BITS
41#error HARDIRQ_BITS too high!
42#endif
43
44#define PREEMPT_SHIFT 0
45#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
46#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
47#define NMI_SHIFT (HARDIRQ_SHIFT + HARDIRQ_BITS)
48
49#define __IRQ_MASK(x) ((1UL << (x))-1)
50
51#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
52#define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
53#define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
54#define NMI_MASK (__IRQ_MASK(NMI_BITS) << NMI_SHIFT)
55
56#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
57#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
58#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
59#define NMI_OFFSET (1UL << NMI_SHIFT)
60
61#define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET)
62
63#ifndef PREEMPT_ACTIVE
64#define PREEMPT_ACTIVE_BITS 1
65#define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS)
66#define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
67#endif
68
69#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS))
70#error PREEMPT_ACTIVE is too low!
71#endif
72
73#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
74#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
75#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK \
76 | NMI_MASK))
77
78/*
79 * Are we doing bottom half or hardware interrupt processing?
80 * Are we in a softirq context? Interrupt context?
81 * in_softirq - Are we currently processing softirq or have bh disabled?
82 * in_serving_softirq - Are we currently processing softirq?
83 */
84#define in_irq() (hardirq_count())
85#define in_softirq() (softirq_count())
86#define in_interrupt() (irq_count())
87#define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET)
88
89/*
90 * Are we in NMI context?
91 */
92#define in_nmi() (preempt_count() & NMI_MASK)
93
94#if defined(CONFIG_PREEMPT_COUNT)
95# define PREEMPT_CHECK_OFFSET 1
96#else
97# define PREEMPT_CHECK_OFFSET 0
98#endif
99
100/*
101 * Are we running in atomic context? WARNING: this macro cannot
102 * always detect atomic context; in particular, it cannot know about
103 * held spinlocks in non-preemptible kernels. Thus it should not be
104 * used in the general case to determine whether sleeping is possible.
105 * Do not use in_atomic() in driver code.
106 */
107#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
108
109/*
110 * Check whether we were atomic before we did preempt_disable():
111 * (used by the scheduler, *after* releasing the kernel lock)
112 */
113#define in_atomic_preempt_off() \
114 ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)
115
116#ifdef CONFIG_PREEMPT_COUNT
117# define preemptible() (preempt_count() == 0 && !irqs_disabled())
118#else
119# define preemptible() 0
120#endif
121
122#endif /* LINUX_PREEMPT_MASK_H */
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 22c7052e9372..e6131a782481 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -200,7 +200,7 @@ static inline void show_regs_print_info(const char *log_lvl)
200} 200}
201#endif 201#endif
202 202
203extern void dump_stack(void) __cold; 203extern asmlinkage void dump_stack(void) __cold;
204 204
205#ifndef pr_fmt 205#ifndef pr_fmt
206#define pr_fmt(fmt) fmt 206#define pr_fmt(fmt) fmt
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index 4aa80ba830a2..abd437d0a8a7 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -55,14 +55,14 @@ struct pstore_info {
55 int (*close)(struct pstore_info *psi); 55 int (*close)(struct pstore_info *psi);
56 ssize_t (*read)(u64 *id, enum pstore_type_id *type, 56 ssize_t (*read)(u64 *id, enum pstore_type_id *type,
57 int *count, struct timespec *time, char **buf, 57 int *count, struct timespec *time, char **buf,
58 struct pstore_info *psi); 58 bool *compressed, struct pstore_info *psi);
59 int (*write)(enum pstore_type_id type, 59 int (*write)(enum pstore_type_id type,
60 enum kmsg_dump_reason reason, u64 *id, 60 enum kmsg_dump_reason reason, u64 *id,
61 unsigned int part, int count, size_t hsize, 61 unsigned int part, int count, bool compressed,
62 size_t size, struct pstore_info *psi); 62 size_t size, struct pstore_info *psi);
63 int (*write_buf)(enum pstore_type_id type, 63 int (*write_buf)(enum pstore_type_id type,
64 enum kmsg_dump_reason reason, u64 *id, 64 enum kmsg_dump_reason reason, u64 *id,
65 unsigned int part, const char *buf, size_t hsize, 65 unsigned int part, const char *buf, bool compressed,
66 size_t size, struct pstore_info *psi); 66 size_t size, struct pstore_info *psi);
67 int (*erase)(enum pstore_type_id type, u64 id, 67 int (*erase)(enum pstore_type_id type, u64 id,
68 int count, struct timespec time, 68 int count, struct timespec time,
diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h
index 467cc6307b62..49444203328a 100644
--- a/include/linux/pxa2xx_ssp.h
+++ b/include/linux/pxa2xx_ssp.h
@@ -21,6 +21,8 @@
21 21
22#include <linux/list.h> 22#include <linux/list.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/of.h>
25
24 26
25/* 27/*
26 * SSP Serial Port Registers 28 * SSP Serial Port Registers
@@ -190,6 +192,8 @@ struct ssp_device {
190 int irq; 192 int irq;
191 int drcmr_rx; 193 int drcmr_rx;
192 int drcmr_tx; 194 int drcmr_tx;
195
196 struct device_node *of_node;
193}; 197};
194 198
195/** 199/**
@@ -218,11 +222,18 @@ static inline u32 pxa_ssp_read_reg(struct ssp_device *dev, u32 reg)
218#ifdef CONFIG_ARCH_PXA 222#ifdef CONFIG_ARCH_PXA
219struct ssp_device *pxa_ssp_request(int port, const char *label); 223struct ssp_device *pxa_ssp_request(int port, const char *label);
220void pxa_ssp_free(struct ssp_device *); 224void pxa_ssp_free(struct ssp_device *);
225struct ssp_device *pxa_ssp_request_of(const struct device_node *of_node,
226 const char *label);
221#else 227#else
222static inline struct ssp_device *pxa_ssp_request(int port, const char *label) 228static inline struct ssp_device *pxa_ssp_request(int port, const char *label)
223{ 229{
224 return NULL; 230 return NULL;
225} 231}
232static inline struct ssp_device *pxa_ssp_request_of(const struct device_node *n,
233 const char *name)
234{
235 return NULL;
236}
226static inline void pxa_ssp_free(struct ssp_device *ssp) {} 237static inline void pxa_ssp_free(struct ssp_device *ssp) {}
227#endif 238#endif
228 239
diff --git a/include/linux/quota.h b/include/linux/quota.h
index d13371134c59..cc7494a35429 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -328,6 +328,7 @@ struct quotactl_ops {
328 int (*set_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *); 328 int (*set_dqblk)(struct super_block *, struct kqid, struct fs_disk_quota *);
329 int (*get_xstate)(struct super_block *, struct fs_quota_stat *); 329 int (*get_xstate)(struct super_block *, struct fs_quota_stat *);
330 int (*set_xstate)(struct super_block *, unsigned int, int); 330 int (*set_xstate)(struct super_block *, unsigned int, int);
331 int (*get_xstatev)(struct super_block *, struct fs_quota_statv *);
331}; 332};
332 333
333struct quota_format_type { 334struct quota_format_type {
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 1c50093ae656..6965fe394c3b 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -41,6 +41,7 @@ void __quota_error(struct super_block *sb, const char *func,
41void inode_add_rsv_space(struct inode *inode, qsize_t number); 41void inode_add_rsv_space(struct inode *inode, qsize_t number);
42void inode_claim_rsv_space(struct inode *inode, qsize_t number); 42void inode_claim_rsv_space(struct inode *inode, qsize_t number);
43void inode_sub_rsv_space(struct inode *inode, qsize_t number); 43void inode_sub_rsv_space(struct inode *inode, qsize_t number);
44void inode_reclaim_rsv_space(struct inode *inode, qsize_t number);
44 45
45void dquot_initialize(struct inode *inode); 46void dquot_initialize(struct inode *inode);
46void dquot_drop(struct inode *inode); 47void dquot_drop(struct inode *inode);
@@ -59,6 +60,7 @@ int dquot_alloc_inode(const struct inode *inode);
59 60
60int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); 61int dquot_claim_space_nodirty(struct inode *inode, qsize_t number);
61void dquot_free_inode(const struct inode *inode); 62void dquot_free_inode(const struct inode *inode);
63void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number);
62 64
63int dquot_disable(struct super_block *sb, int type, unsigned int flags); 65int dquot_disable(struct super_block *sb, int type, unsigned int flags);
64/* Suspend quotas on remount RO */ 66/* Suspend quotas on remount RO */
@@ -238,6 +240,13 @@ static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
238 return 0; 240 return 0;
239} 241}
240 242
243static inline int dquot_reclaim_space_nodirty(struct inode *inode,
244 qsize_t number)
245{
246 inode_sub_bytes(inode, number);
247 return 0;
248}
249
241static inline int dquot_disable(struct super_block *sb, int type, 250static inline int dquot_disable(struct super_block *sb, int type,
242 unsigned int flags) 251 unsigned int flags)
243{ 252{
@@ -336,6 +345,12 @@ static inline int dquot_claim_block(struct inode *inode, qsize_t nr)
336 return ret; 345 return ret;
337} 346}
338 347
348static inline void dquot_reclaim_block(struct inode *inode, qsize_t nr)
349{
350 dquot_reclaim_space_nodirty(inode, nr << inode->i_blkbits);
351 mark_inode_dirty_sync(inode);
352}
353
339static inline void dquot_free_space_nodirty(struct inode *inode, qsize_t nr) 354static inline void dquot_free_space_nodirty(struct inode *inode, qsize_t nr)
340{ 355{
341 __dquot_free_space(inode, nr, 0); 356 __dquot_free_space(inode, nr, 0);
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index ffc444c38b0a..403940787be1 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -231,6 +231,7 @@ unsigned long radix_tree_next_hole(struct radix_tree_root *root,
231unsigned long radix_tree_prev_hole(struct radix_tree_root *root, 231unsigned long radix_tree_prev_hole(struct radix_tree_root *root,
232 unsigned long index, unsigned long max_scan); 232 unsigned long index, unsigned long max_scan);
233int radix_tree_preload(gfp_t gfp_mask); 233int radix_tree_preload(gfp_t gfp_mask);
234int radix_tree_maybe_preload(gfp_t gfp_mask);
234void radix_tree_init(void); 235void radix_tree_init(void);
235void *radix_tree_tag_set(struct radix_tree_root *root, 236void *radix_tree_tag_set(struct radix_tree_root *root,
236 unsigned long index, unsigned int tag); 237 unsigned long index, unsigned int tag);
diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h
index 8dfaa2ce2e95..73069cb6c54a 100644
--- a/include/linux/raid/pq.h
+++ b/include/linux/raid/pq.h
@@ -101,6 +101,7 @@ extern const struct raid6_calls raid6_altivec8;
101extern const struct raid6_calls raid6_avx2x1; 101extern const struct raid6_calls raid6_avx2x1;
102extern const struct raid6_calls raid6_avx2x2; 102extern const struct raid6_calls raid6_avx2x2;
103extern const struct raid6_calls raid6_avx2x4; 103extern const struct raid6_calls raid6_avx2x4;
104extern const struct raid6_calls raid6_tilegx8;
104 105
105struct raid6_recov_calls { 106struct raid6_recov_calls {
106 void (*data2)(int, size_t, int, int, void **); 107 void (*data2)(int, size_t, int, int, void **);
@@ -114,6 +115,11 @@ extern const struct raid6_recov_calls raid6_recov_intx1;
114extern const struct raid6_recov_calls raid6_recov_ssse3; 115extern const struct raid6_recov_calls raid6_recov_ssse3;
115extern const struct raid6_recov_calls raid6_recov_avx2; 116extern const struct raid6_recov_calls raid6_recov_avx2;
116 117
118extern const struct raid6_calls raid6_neonx1;
119extern const struct raid6_calls raid6_neonx2;
120extern const struct raid6_calls raid6_neonx4;
121extern const struct raid6_calls raid6_neonx8;
122
117/* Algorithm list */ 123/* Algorithm list */
118extern const struct raid6_calls * const raid6_algos[]; 124extern const struct raid6_calls * const raid6_algos[];
119extern const struct raid6_recov_calls *const raid6_recov_algos[]; 125extern const struct raid6_recov_calls *const raid6_recov_algos[];
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 69e37c2d1ea5..753207c8ce20 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -25,7 +25,7 @@ extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma);
25 25
26extern const struct file_operations ramfs_file_operations; 26extern const struct file_operations ramfs_file_operations;
27extern const struct vm_operations_struct generic_file_vm_ops; 27extern const struct vm_operations_struct generic_file_vm_ops;
28extern int __init init_rootfs(void); 28extern int __init init_ramfs_fs(void);
29 29
30int ramfs_fill_super(struct super_block *sb, void *data, int silent); 30int ramfs_fill_super(struct super_block *sb, void *data, int silent);
31 31
diff --git a/include/linux/random.h b/include/linux/random.h
index 3b9377d6b7a5..6312dd9ba449 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -17,6 +17,7 @@ extern void add_interrupt_randomness(int irq, int irq_flags);
17extern void get_random_bytes(void *buf, int nbytes); 17extern void get_random_bytes(void *buf, int nbytes);
18extern void get_random_bytes_arch(void *buf, int nbytes); 18extern void get_random_bytes_arch(void *buf, int nbytes);
19void generate_random_uuid(unsigned char uuid_out[16]); 19void generate_random_uuid(unsigned char uuid_out[16]);
20extern int random_int_secret_init(void);
20 21
21#ifndef MODULE 22#ifndef MODULE
22extern const struct file_operations random_fops, urandom_fops; 23extern const struct file_operations random_fops, urandom_fops;
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index 0022c1bb1e26..aa870a4ddf54 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -68,6 +68,10 @@ extern struct rb_node *rb_prev(const struct rb_node *);
68extern struct rb_node *rb_first(const struct rb_root *); 68extern struct rb_node *rb_first(const struct rb_root *);
69extern struct rb_node *rb_last(const struct rb_root *); 69extern struct rb_node *rb_last(const struct rb_root *);
70 70
71/* Postorder iteration - always visit the parent after its children */
72extern struct rb_node *rb_first_postorder(const struct rb_root *);
73extern struct rb_node *rb_next_postorder(const struct rb_node *);
74
71/* Fast replacement of a single node without remove/rebalance/add/rebalance */ 75/* Fast replacement of a single node without remove/rebalance/add/rebalance */
72extern void rb_replace_node(struct rb_node *victim, struct rb_node *new, 76extern void rb_replace_node(struct rb_node *victim, struct rb_node *new,
73 struct rb_root *root); 77 struct rb_root *root);
@@ -81,4 +85,22 @@ static inline void rb_link_node(struct rb_node * node, struct rb_node * parent,
81 *rb_link = node; 85 *rb_link = node;
82} 86}
83 87
88/**
89 * rbtree_postorder_for_each_entry_safe - iterate over rb_root in post order of
90 * given type safe against removal of rb_node entry
91 *
92 * @pos: the 'type *' to use as a loop cursor.
93 * @n: another 'type *' to use as temporary storage
94 * @root: 'rb_root *' of the rbtree.
95 * @field: the name of the rb_node field within 'type'.
96 */
97#define rbtree_postorder_for_each_entry_safe(pos, n, root, field) \
98 for (pos = rb_entry(rb_first_postorder(root), typeof(*pos), field),\
99 n = rb_entry(rb_next_postorder(&pos->field), \
100 typeof(*pos), field); \
101 &pos->field; \
102 pos = n, \
103 n = rb_entry(rb_next_postorder(&pos->field), \
104 typeof(*pos), field))
105
84#endif /* _LINUX_RBTREE_H */ 106#endif /* _LINUX_RBTREE_H */
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index f4b1001a4676..4106721c4e5e 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -267,8 +267,9 @@ static inline void list_splice_init_rcu(struct list_head *list,
267 */ 267 */
268#define list_first_or_null_rcu(ptr, type, member) \ 268#define list_first_or_null_rcu(ptr, type, member) \
269 ({struct list_head *__ptr = (ptr); \ 269 ({struct list_head *__ptr = (ptr); \
270 struct list_head __rcu *__next = list_next_rcu(__ptr); \ 270 struct list_head *__next = ACCESS_ONCE(__ptr->next); \
271 likely(__ptr != __next) ? container_of(__next, type, member) : NULL; \ 271 likely(__ptr != __next) ? \
272 list_entry_rcu(__next, type, member) : NULL; \
272 }) 273 })
273 274
274/** 275/**
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 4b14bdc911d7..f1f1bc39346b 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -52,7 +52,7 @@ extern int rcutorture_runnable; /* for sysctl */
52#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 52#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
53extern void rcutorture_record_test_transition(void); 53extern void rcutorture_record_test_transition(void);
54extern void rcutorture_record_progress(unsigned long vernum); 54extern void rcutorture_record_progress(unsigned long vernum);
55extern void do_trace_rcu_torture_read(char *rcutorturename, 55extern void do_trace_rcu_torture_read(const char *rcutorturename,
56 struct rcu_head *rhp, 56 struct rcu_head *rhp,
57 unsigned long secs, 57 unsigned long secs,
58 unsigned long c_old, 58 unsigned long c_old,
@@ -65,7 +65,7 @@ static inline void rcutorture_record_progress(unsigned long vernum)
65{ 65{
66} 66}
67#ifdef CONFIG_RCU_TRACE 67#ifdef CONFIG_RCU_TRACE
68extern void do_trace_rcu_torture_read(char *rcutorturename, 68extern void do_trace_rcu_torture_read(const char *rcutorturename,
69 struct rcu_head *rhp, 69 struct rcu_head *rhp,
70 unsigned long secs, 70 unsigned long secs,
71 unsigned long c_old, 71 unsigned long c_old,
@@ -229,13 +229,9 @@ extern void rcu_irq_exit(void);
229#ifdef CONFIG_RCU_USER_QS 229#ifdef CONFIG_RCU_USER_QS
230extern void rcu_user_enter(void); 230extern void rcu_user_enter(void);
231extern void rcu_user_exit(void); 231extern void rcu_user_exit(void);
232extern void rcu_user_enter_after_irq(void);
233extern void rcu_user_exit_after_irq(void);
234#else 232#else
235static inline void rcu_user_enter(void) { } 233static inline void rcu_user_enter(void) { }
236static inline void rcu_user_exit(void) { } 234static inline void rcu_user_exit(void) { }
237static inline void rcu_user_enter_after_irq(void) { }
238static inline void rcu_user_exit_after_irq(void) { }
239static inline void rcu_user_hooks_switch(struct task_struct *prev, 235static inline void rcu_user_hooks_switch(struct task_struct *prev,
240 struct task_struct *next) { } 236 struct task_struct *next) { }
241#endif /* CONFIG_RCU_USER_QS */ 237#endif /* CONFIG_RCU_USER_QS */
@@ -1015,4 +1011,22 @@ static inline bool rcu_is_nocb_cpu(int cpu) { return false; }
1015#endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ 1011#endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */
1016 1012
1017 1013
1014/* Only for use by adaptive-ticks code. */
1015#ifdef CONFIG_NO_HZ_FULL_SYSIDLE
1016extern bool rcu_sys_is_idle(void);
1017extern void rcu_sysidle_force_exit(void);
1018#else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */
1019
1020static inline bool rcu_sys_is_idle(void)
1021{
1022 return false;
1023}
1024
1025static inline void rcu_sysidle_force_exit(void)
1026{
1027}
1028
1029#endif /* #else #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */
1030
1031
1018#endif /* __LINUX_RCUPDATE_H */ 1032#endif /* __LINUX_RCUPDATE_H */
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 6d91fcb4c5cb..a10380bfbeac 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -472,6 +472,9 @@ struct regmap_irq {
472 * @ack_base: Base ack address. If zero then the chip is clear on read. 472 * @ack_base: Base ack address. If zero then the chip is clear on read.
473 * @wake_base: Base address for wake enables. If zero unsupported. 473 * @wake_base: Base address for wake enables. If zero unsupported.
474 * @irq_reg_stride: Stride to use for chips where registers are not contiguous. 474 * @irq_reg_stride: Stride to use for chips where registers are not contiguous.
475 * @init_ack_masked: Ack all masked interrupts once during initalization.
476 * @mask_invert: Inverted mask register: cleared bits are masked out.
477 * @wake_invert: Inverted wake register: cleared bits are wake enabled.
475 * @runtime_pm: Hold a runtime PM lock on the device when accessing it. 478 * @runtime_pm: Hold a runtime PM lock on the device when accessing it.
476 * 479 *
477 * @num_regs: Number of registers in each control bank. 480 * @num_regs: Number of registers in each control bank.
@@ -487,9 +490,10 @@ struct regmap_irq_chip {
487 unsigned int ack_base; 490 unsigned int ack_base;
488 unsigned int wake_base; 491 unsigned int wake_base;
489 unsigned int irq_reg_stride; 492 unsigned int irq_reg_stride;
490 unsigned int mask_invert; 493 bool init_ack_masked:1;
491 unsigned int wake_invert; 494 bool mask_invert:1;
492 bool runtime_pm; 495 bool wake_invert:1;
496 bool runtime_pm:1;
493 497
494 int num_regs; 498 int num_regs;
495 499
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 3a76389c6aaa..27be915caa96 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -137,6 +137,12 @@ struct regulator *__must_check devm_regulator_get(struct device *dev,
137 const char *id); 137 const char *id);
138struct regulator *__must_check regulator_get_exclusive(struct device *dev, 138struct regulator *__must_check regulator_get_exclusive(struct device *dev,
139 const char *id); 139 const char *id);
140struct regulator *__must_check devm_regulator_get_exclusive(struct device *dev,
141 const char *id);
142struct regulator *__must_check regulator_get_optional(struct device *dev,
143 const char *id);
144struct regulator *__must_check devm_regulator_get_optional(struct device *dev,
145 const char *id);
140void regulator_put(struct regulator *regulator); 146void regulator_put(struct regulator *regulator);
141void devm_regulator_put(struct regulator *regulator); 147void devm_regulator_put(struct regulator *regulator);
142 148
@@ -217,6 +223,25 @@ devm_regulator_get(struct device *dev, const char *id)
217 return NULL; 223 return NULL;
218} 224}
219 225
226static inline struct regulator *__must_check
227regulator_get_exclusive(struct device *dev, const char *id)
228{
229 return NULL;
230}
231
232static inline struct regulator *__must_check
233regulator_get_optional(struct device *dev, const char *id)
234{
235 return NULL;
236}
237
238
239static inline struct regulator *__must_check
240devm_regulator_get_optional(struct device *dev, const char *id)
241{
242 return NULL;
243}
244
220static inline void regulator_put(struct regulator *regulator) 245static inline void regulator_put(struct regulator *regulator)
221{ 246{
222} 247}
@@ -369,8 +394,11 @@ static inline int regulator_count_voltages(struct regulator *regulator)
369static inline int regulator_set_voltage_tol(struct regulator *regulator, 394static inline int regulator_set_voltage_tol(struct regulator *regulator,
370 int new_uV, int tol_uV) 395 int new_uV, int tol_uV)
371{ 396{
372 return regulator_set_voltage(regulator, 397 if (regulator_set_voltage(regulator, new_uV, new_uV + tol_uV) == 0)
373 new_uV - tol_uV, new_uV + tol_uV); 398 return 0;
399 else
400 return regulator_set_voltage(regulator,
401 new_uV - tol_uV, new_uV + tol_uV);
374} 402}
375 403
376static inline int regulator_is_supported_voltage_tol(struct regulator *regulator, 404static inline int regulator_is_supported_voltage_tol(struct regulator *regulator,
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 6700cc94bdd1..9bdad43ad228 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -40,6 +40,26 @@ enum regulator_status {
40}; 40};
41 41
42/** 42/**
43 * struct regulator_linear_range - specify linear voltage ranges
44 *
45 * Specify a range of voltages for regulator_map_linar_range() and
46 * regulator_list_linear_range().
47 *
48 * @min_uV: Lowest voltage in range
49 * @max_uV: Highest voltage in range
50 * @min_sel: Lowest selector for range
51 * @max_sel: Highest selector for range
52 * @uV_step: Step size
53 */
54struct regulator_linear_range {
55 unsigned int min_uV;
56 unsigned int max_uV;
57 unsigned int min_sel;
58 unsigned int max_sel;
59 unsigned int uV_step;
60};
61
62/**
43 * struct regulator_ops - regulator operations. 63 * struct regulator_ops - regulator operations.
44 * 64 *
45 * @enable: Configure the regulator as enabled. 65 * @enable: Configure the regulator as enabled.
@@ -223,6 +243,9 @@ struct regulator_desc {
223 unsigned int linear_min_sel; 243 unsigned int linear_min_sel;
224 unsigned int ramp_delay; 244 unsigned int ramp_delay;
225 245
246 const struct regulator_linear_range *linear_ranges;
247 int n_linear_ranges;
248
226 const unsigned int *volt_table; 249 const unsigned int *volt_table;
227 250
228 unsigned int vsel_reg; 251 unsigned int vsel_reg;
@@ -326,10 +349,14 @@ int regulator_mode_to_status(unsigned int);
326 349
327int regulator_list_voltage_linear(struct regulator_dev *rdev, 350int regulator_list_voltage_linear(struct regulator_dev *rdev,
328 unsigned int selector); 351 unsigned int selector);
352int regulator_list_voltage_linear_range(struct regulator_dev *rdev,
353 unsigned int selector);
329int regulator_list_voltage_table(struct regulator_dev *rdev, 354int regulator_list_voltage_table(struct regulator_dev *rdev,
330 unsigned int selector); 355 unsigned int selector);
331int regulator_map_voltage_linear(struct regulator_dev *rdev, 356int regulator_map_voltage_linear(struct regulator_dev *rdev,
332 int min_uV, int max_uV); 357 int min_uV, int max_uV);
358int regulator_map_voltage_linear_range(struct regulator_dev *rdev,
359 int min_uV, int max_uV);
333int regulator_map_voltage_iterate(struct regulator_dev *rdev, 360int regulator_map_voltage_iterate(struct regulator_dev *rdev,
334 int min_uV, int max_uV); 361 int min_uV, int max_uV);
335int regulator_map_voltage_ascend(struct regulator_dev *rdev, 362int regulator_map_voltage_ascend(struct regulator_dev *rdev,
diff --git a/include/linux/regulator/fan53555.h b/include/linux/regulator/fan53555.h
index 5c45c85d52ca..f13880e84d85 100644
--- a/include/linux/regulator/fan53555.h
+++ b/include/linux/regulator/fan53555.h
@@ -11,6 +11,7 @@
11 */ 11 */
12 12
13#ifndef __FAN53555_H__ 13#ifndef __FAN53555_H__
14#define __FAN53555_H__
14 15
15/* VSEL ID */ 16/* VSEL ID */
16enum { 17enum {
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 36adbc82de6a..999b20ce06cf 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -134,6 +134,7 @@ struct regulation_constraints {
134 unsigned always_on:1; /* regulator never off when system is on */ 134 unsigned always_on:1; /* regulator never off when system is on */
135 unsigned boot_on:1; /* bootloader/firmware enabled regulator */ 135 unsigned boot_on:1; /* bootloader/firmware enabled regulator */
136 unsigned apply_uV:1; /* apply uV constraint if min == max */ 136 unsigned apply_uV:1; /* apply uV constraint if min == max */
137 unsigned ramp_disable:1; /* disable ramp delay */
137}; 138};
138 139
139/** 140/**
diff --git a/include/linux/regulator/max8660.h b/include/linux/regulator/max8660.h
index 9936763621c7..f8a6a4844864 100644
--- a/include/linux/regulator/max8660.h
+++ b/include/linux/regulator/max8660.h
@@ -39,7 +39,7 @@ enum {
39 */ 39 */
40struct max8660_subdev_data { 40struct max8660_subdev_data {
41 int id; 41 int id;
42 char *name; 42 const char *name;
43 struct regulator_init_data *platform_data; 43 struct regulator_init_data *platform_data;
44}; 44};
45 45
diff --git a/include/linux/regulator/pfuze100.h b/include/linux/regulator/pfuze100.h
new file mode 100644
index 000000000000..65d550bf3954
--- /dev/null
+++ b/include/linux/regulator/pfuze100.h
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18#ifndef __LINUX_REG_PFUZE100_H
19#define __LINUX_REG_PFUZE100_H
20
21#define PFUZE100_SW1AB 0
22#define PFUZE100_SW1C 1
23#define PFUZE100_SW2 2
24#define PFUZE100_SW3A 3
25#define PFUZE100_SW3B 4
26#define PFUZE100_SW4 5
27#define PFUZE100_SWBST 6
28#define PFUZE100_VSNVS 7
29#define PFUZE100_VREFDDR 8
30#define PFUZE100_VGEN1 9
31#define PFUZE100_VGEN2 10
32#define PFUZE100_VGEN3 11
33#define PFUZE100_VGEN4 12
34#define PFUZE100_VGEN5 13
35#define PFUZE100_VGEN6 14
36#define PFUZE100_MAX_REGULATOR 15
37
38struct regulator_init_data;
39
40struct pfuze_regulator_platform_data {
41 struct regulator_init_data *init_data[PFUZE100_MAX_REGULATOR];
42};
43
44#endif /* __LINUX_REG_PFUZE100_H */
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h
index 96a509b6be04..201a69749659 100644
--- a/include/linux/res_counter.h
+++ b/include/linux/res_counter.h
@@ -54,7 +54,7 @@ struct res_counter {
54 struct res_counter *parent; 54 struct res_counter *parent;
55}; 55};
56 56
57#define RESOURCE_MAX (unsigned long long)LLONG_MAX 57#define RES_COUNTER_MAX ULLONG_MAX
58 58
59/** 59/**
60 * Helpers to interact with userspace 60 * Helpers to interact with userspace
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 078066daffd4..e27baeeda3f4 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -107,14 +107,6 @@ extern unsigned long this_cpu_load(void);
107extern void calc_global_load(unsigned long ticks); 107extern void calc_global_load(unsigned long ticks);
108extern void update_cpu_load_nohz(void); 108extern void update_cpu_load_nohz(void);
109 109
110/* Notifier for when a task gets migrated to a new CPU */
111struct task_migration_notifier {
112 struct task_struct *task;
113 int from_cpu;
114 int to_cpu;
115};
116extern void register_task_migration_notifier(struct notifier_block *n);
117
118extern unsigned long get_parent_ip(unsigned long addr); 110extern unsigned long get_parent_ip(unsigned long addr);
119 111
120extern void dump_cpu_task(int cpu); 112extern void dump_cpu_task(int cpu);
@@ -1034,6 +1026,9 @@ struct task_struct {
1034#ifdef CONFIG_SMP 1026#ifdef CONFIG_SMP
1035 struct llist_node wake_entry; 1027 struct llist_node wake_entry;
1036 int on_cpu; 1028 int on_cpu;
1029 struct task_struct *last_wakee;
1030 unsigned long wakee_flips;
1031 unsigned long wakee_flip_decay_ts;
1037#endif 1032#endif
1038 int on_rq; 1033 int on_rq;
1039 1034
@@ -1398,6 +1393,12 @@ struct task_struct {
1398 unsigned long memsw_nr_pages; /* uncharged mem+swap usage */ 1393 unsigned long memsw_nr_pages; /* uncharged mem+swap usage */
1399 } memcg_batch; 1394 } memcg_batch;
1400 unsigned int memcg_kmem_skip_account; 1395 unsigned int memcg_kmem_skip_account;
1396 struct memcg_oom_info {
1397 struct mem_cgroup *memcg;
1398 gfp_t gfp_mask;
1399 int order;
1400 unsigned int may_oom:1;
1401 } memcg_oom;
1401#endif 1402#endif
1402#ifdef CONFIG_UPROBES 1403#ifdef CONFIG_UPROBES
1403 struct uprobe_task *utask; 1404 struct uprobe_task *utask;
@@ -2174,15 +2175,15 @@ static inline bool thread_group_leader(struct task_struct *p)
2174 * all we care about is that we have a task with the appropriate 2175 * all we care about is that we have a task with the appropriate
2175 * pid, we don't actually care if we have the right task. 2176 * pid, we don't actually care if we have the right task.
2176 */ 2177 */
2177static inline int has_group_leader_pid(struct task_struct *p) 2178static inline bool has_group_leader_pid(struct task_struct *p)
2178{ 2179{
2179 return p->pid == p->tgid; 2180 return task_pid(p) == p->signal->leader_pid;
2180} 2181}
2181 2182
2182static inline 2183static inline
2183int same_thread_group(struct task_struct *p1, struct task_struct *p2) 2184bool same_thread_group(struct task_struct *p1, struct task_struct *p2)
2184{ 2185{
2185 return p1->tgid == p2->tgid; 2186 return p1->signal == p2->signal;
2186} 2187}
2187 2188
2188static inline struct task_struct *next_thread(const struct task_struct *p) 2189static inline struct task_struct *next_thread(const struct task_struct *p)
diff --git a/include/linux/security.h b/include/linux/security.h
index 8d23951a3805..5623a7f965b7 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1500,7 +1500,7 @@ struct security_operations {
1500 int (*inode_alloc_security) (struct inode *inode); 1500 int (*inode_alloc_security) (struct inode *inode);
1501 void (*inode_free_security) (struct inode *inode); 1501 void (*inode_free_security) (struct inode *inode);
1502 int (*inode_init_security) (struct inode *inode, struct inode *dir, 1502 int (*inode_init_security) (struct inode *inode, struct inode *dir,
1503 const struct qstr *qstr, char **name, 1503 const struct qstr *qstr, const char **name,
1504 void **value, size_t *len); 1504 void **value, size_t *len);
1505 int (*inode_create) (struct inode *dir, 1505 int (*inode_create) (struct inode *dir,
1506 struct dentry *dentry, umode_t mode); 1506 struct dentry *dentry, umode_t mode);
@@ -1780,7 +1780,7 @@ int security_inode_init_security(struct inode *inode, struct inode *dir,
1780 const struct qstr *qstr, 1780 const struct qstr *qstr,
1781 initxattrs initxattrs, void *fs_data); 1781 initxattrs initxattrs, void *fs_data);
1782int security_old_inode_init_security(struct inode *inode, struct inode *dir, 1782int security_old_inode_init_security(struct inode *inode, struct inode *dir,
1783 const struct qstr *qstr, char **name, 1783 const struct qstr *qstr, const char **name,
1784 void **value, size_t *len); 1784 void **value, size_t *len);
1785int security_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode); 1785int security_inode_create(struct inode *dir, struct dentry *dentry, umode_t mode);
1786int security_inode_link(struct dentry *old_dentry, struct inode *dir, 1786int security_inode_link(struct dentry *old_dentry, struct inode *dir,
@@ -2104,8 +2104,8 @@ static inline int security_inode_init_security(struct inode *inode,
2104static inline int security_old_inode_init_security(struct inode *inode, 2104static inline int security_old_inode_init_security(struct inode *inode,
2105 struct inode *dir, 2105 struct inode *dir,
2106 const struct qstr *qstr, 2106 const struct qstr *qstr,
2107 char **name, void **value, 2107 const char **name,
2108 size_t *len) 2108 void **value, size_t *len)
2109{ 2109{
2110 return -EOPNOTSUPP; 2110 return -EOPNOTSUPP;
2111} 2111}
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index 18299057402f..21a209336e79 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -3,15 +3,21 @@
3/* 3/*
4 * Reader/writer consistent mechanism without starving writers. This type of 4 * Reader/writer consistent mechanism without starving writers. This type of
5 * lock for data where the reader wants a consistent set of information 5 * lock for data where the reader wants a consistent set of information
6 * and is willing to retry if the information changes. Readers never 6 * and is willing to retry if the information changes. There are two types
7 * block but they may have to retry if a writer is in 7 * of readers:
8 * progress. Writers do not wait for readers. 8 * 1. Sequence readers which never block a writer but they may have to retry
9 * if a writer is in progress by detecting change in sequence number.
10 * Writers do not wait for a sequence reader.
11 * 2. Locking readers which will wait if a writer or another locking reader
12 * is in progress. A locking reader in progress will also block a writer
13 * from going forward. Unlike the regular rwlock, the read lock here is
14 * exclusive so that only one locking reader can get it.
9 * 15 *
10 * This is not as cache friendly as brlock. Also, this will not work 16 * This is not as cache friendly as brlock. Also, this may not work well
11 * for data that contains pointers, because any writer could 17 * for data that contains pointers, because any writer could
12 * invalidate a pointer that a reader was following. 18 * invalidate a pointer that a reader was following.
13 * 19 *
14 * Expected reader usage: 20 * Expected non-blocking reader usage:
15 * do { 21 * do {
16 * seq = read_seqbegin(&foo); 22 * seq = read_seqbegin(&foo);
17 * ... 23 * ...
@@ -268,4 +274,56 @@ write_sequnlock_irqrestore(seqlock_t *sl, unsigned long flags)
268 spin_unlock_irqrestore(&sl->lock, flags); 274 spin_unlock_irqrestore(&sl->lock, flags);
269} 275}
270 276
277/*
278 * A locking reader exclusively locks out other writers and locking readers,
279 * but doesn't update the sequence number. Acts like a normal spin_lock/unlock.
280 * Don't need preempt_disable() because that is in the spin_lock already.
281 */
282static inline void read_seqlock_excl(seqlock_t *sl)
283{
284 spin_lock(&sl->lock);
285}
286
287static inline void read_sequnlock_excl(seqlock_t *sl)
288{
289 spin_unlock(&sl->lock);
290}
291
292static inline void read_seqlock_excl_bh(seqlock_t *sl)
293{
294 spin_lock_bh(&sl->lock);
295}
296
297static inline void read_sequnlock_excl_bh(seqlock_t *sl)
298{
299 spin_unlock_bh(&sl->lock);
300}
301
302static inline void read_seqlock_excl_irq(seqlock_t *sl)
303{
304 spin_lock_irq(&sl->lock);
305}
306
307static inline void read_sequnlock_excl_irq(seqlock_t *sl)
308{
309 spin_unlock_irq(&sl->lock);
310}
311
312static inline unsigned long __read_seqlock_excl_irqsave(seqlock_t *sl)
313{
314 unsigned long flags;
315
316 spin_lock_irqsave(&sl->lock, flags);
317 return flags;
318}
319
320#define read_seqlock_excl_irqsave(lock, flags) \
321 do { flags = __read_seqlock_excl_irqsave(lock); } while (0)
322
323static inline void
324read_sequnlock_excl_irqrestore(seqlock_t *sl, unsigned long flags)
325{
326 spin_unlock_irqrestore(&sl->lock, flags);
327}
328
271#endif /* __LINUX_SEQLOCK_H */ 329#endif /* __LINUX_SEQLOCK_H */
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
index 4e83f3e034f3..b7b43b82231e 100644
--- a/include/linux/sh_dma.h
+++ b/include/linux/sh_dma.h
@@ -33,13 +33,44 @@ struct sh_dmae_slave_config {
33 char mid_rid; 33 char mid_rid;
34}; 34};
35 35
36/**
37 * struct sh_dmae_channel - DMAC channel platform data
38 * @offset: register offset within the main IOMEM resource
39 * @dmars: channel DMARS register offset
40 * @chclr_offset: channel CHCLR register offset
41 * @dmars_bit: channel DMARS field offset within the register
42 * @chclr_bit: bit position, to be set to reset the channel
43 */
36struct sh_dmae_channel { 44struct sh_dmae_channel {
37 unsigned int offset; 45 unsigned int offset;
38 unsigned int dmars; 46 unsigned int dmars;
39 unsigned int dmars_bit;
40 unsigned int chclr_offset; 47 unsigned int chclr_offset;
48 unsigned char dmars_bit;
49 unsigned char chclr_bit;
41}; 50};
42 51
52/**
53 * struct sh_dmae_pdata - DMAC platform data
54 * @slave: array of slaves
55 * @slave_num: number of slaves in the above array
56 * @channel: array of DMA channels
57 * @channel_num: number of channels in the above array
58 * @ts_low_shift: shift of the low part of the TS field
59 * @ts_low_mask: low TS field mask
60 * @ts_high_shift: additional shift of the high part of the TS field
61 * @ts_high_mask: high TS field mask
62 * @ts_shift: array of Transfer Size shifts, indexed by TS value
63 * @ts_shift_num: number of shifts in the above array
64 * @dmaor_init: DMAOR initialisation value
65 * @chcr_offset: CHCR address offset
66 * @chcr_ie_bit: CHCR Interrupt Enable bit
67 * @dmaor_is_32bit: DMAOR is a 32-bit register
68 * @needs_tend_set: the TEND register has to be set
69 * @no_dmars: DMAC has no DMARS registers
70 * @chclr_present: DMAC has one or several CHCLR registers
71 * @chclr_bitwise: channel CHCLR registers are bitwise
72 * @slave_only: DMAC cannot be used for MEMCPY
73 */
43struct sh_dmae_pdata { 74struct sh_dmae_pdata {
44 const struct sh_dmae_slave_config *slave; 75 const struct sh_dmae_slave_config *slave;
45 int slave_num; 76 int slave_num;
@@ -59,42 +90,22 @@ struct sh_dmae_pdata {
59 unsigned int needs_tend_set:1; 90 unsigned int needs_tend_set:1;
60 unsigned int no_dmars:1; 91 unsigned int no_dmars:1;
61 unsigned int chclr_present:1; 92 unsigned int chclr_present:1;
93 unsigned int chclr_bitwise:1;
62 unsigned int slave_only:1; 94 unsigned int slave_only:1;
63}; 95};
64 96
65/* DMA register */
66#define SAR 0x00
67#define DAR 0x04
68#define TCR 0x08
69#define CHCR 0x0C
70#define DMAOR 0x40
71
72#define TEND 0x18 /* USB-DMAC */
73
74/* DMAOR definitions */ 97/* DMAOR definitions */
75#define DMAOR_AE 0x00000004 98#define DMAOR_AE 0x00000004
76#define DMAOR_NMIF 0x00000002 99#define DMAOR_NMIF 0x00000002
77#define DMAOR_DME 0x00000001 100#define DMAOR_DME 0x00000001
78 101
79/* Definitions for the SuperH DMAC */ 102/* Definitions for the SuperH DMAC */
80#define REQ_L 0x00000000
81#define REQ_E 0x00080000
82#define RACK_H 0x00000000
83#define RACK_L 0x00040000
84#define ACK_R 0x00000000
85#define ACK_W 0x00020000
86#define ACK_H 0x00000000
87#define ACK_L 0x00010000
88#define DM_INC 0x00004000 103#define DM_INC 0x00004000
89#define DM_DEC 0x00008000 104#define DM_DEC 0x00008000
90#define DM_FIX 0x0000c000 105#define DM_FIX 0x0000c000
91#define SM_INC 0x00001000 106#define SM_INC 0x00001000
92#define SM_DEC 0x00002000 107#define SM_DEC 0x00002000
93#define SM_FIX 0x00003000 108#define SM_FIX 0x00003000
94#define RS_IN 0x00000200
95#define RS_OUT 0x00000300
96#define TS_BLK 0x00000040
97#define TM_BUR 0x00000020
98#define CHCR_DE 0x00000001 109#define CHCR_DE 0x00000001
99#define CHCR_TE 0x00000002 110#define CHCR_TE 0x00000002
100#define CHCR_IE 0x00000004 111#define CHCR_IE 0x00000004
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
index fc305713fc6d..90b5e30c2f22 100644
--- a/include/linux/sh_eth.h
+++ b/include/linux/sh_eth.h
@@ -2,23 +2,17 @@
2#define __ASM_SH_ETH_H__ 2#define __ASM_SH_ETH_H__
3 3
4#include <linux/phy.h> 4#include <linux/phy.h>
5#include <linux/if_ether.h>
5 6
6enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN}; 7enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
7enum {
8 SH_ETH_REG_GIGABIT,
9 SH_ETH_REG_FAST_RCAR,
10 SH_ETH_REG_FAST_SH4,
11 SH_ETH_REG_FAST_SH3_SH2
12};
13 8
14struct sh_eth_plat_data { 9struct sh_eth_plat_data {
15 int phy; 10 int phy;
16 int edmac_endian; 11 int edmac_endian;
17 int register_type;
18 phy_interface_t phy_interface; 12 phy_interface_t phy_interface;
19 void (*set_mdio_gate)(void *addr); 13 void (*set_mdio_gate)(void *addr);
20 14
21 unsigned char mac_addr[6]; 15 unsigned char mac_addr[ETH_ALEN];
22 unsigned no_ether_link:1; 16 unsigned no_ether_link:1;
23 unsigned ether_link_active_low:1; 17 unsigned ether_link_active_low:1;
24 unsigned needs_init:1; 18 unsigned needs_init:1;
diff --git a/include/linux/shdma-base.h b/include/linux/shdma-base.h
index 5b1c9848124c..f92c0a43c54c 100644
--- a/include/linux/shdma-base.h
+++ b/include/linux/shdma-base.h
@@ -96,7 +96,7 @@ struct shdma_ops {
96 dma_addr_t (*slave_addr)(struct shdma_chan *); 96 dma_addr_t (*slave_addr)(struct shdma_chan *);
97 int (*desc_setup)(struct shdma_chan *, struct shdma_desc *, 97 int (*desc_setup)(struct shdma_chan *, struct shdma_desc *,
98 dma_addr_t, dma_addr_t, size_t *); 98 dma_addr_t, dma_addr_t, size_t *);
99 int (*set_slave)(struct shdma_chan *, int, bool); 99 int (*set_slave)(struct shdma_chan *, int, dma_addr_t, bool);
100 void (*setup_xfer)(struct shdma_chan *, int); 100 void (*setup_xfer)(struct shdma_chan *, int);
101 void (*start_xfer)(struct shdma_chan *, struct shdma_desc *); 101 void (*start_xfer)(struct shdma_chan *, struct shdma_desc *);
102 struct shdma_desc *(*embedded_desc)(void *, int); 102 struct shdma_desc *(*embedded_desc)(void *, int);
@@ -116,7 +116,6 @@ struct shdma_dev {
116 116
117int shdma_request_irq(struct shdma_chan *, int, 117int shdma_request_irq(struct shdma_chan *, int,
118 unsigned long, const char *); 118 unsigned long, const char *);
119void shdma_free_irq(struct shdma_chan *);
120bool shdma_reset(struct shdma_dev *sdev); 119bool shdma_reset(struct shdma_dev *sdev);
121void shdma_chan_probe(struct shdma_dev *sdev, 120void shdma_chan_probe(struct shdma_dev *sdev,
122 struct shdma_chan *schan, int id); 121 struct shdma_chan *schan, int id);
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
index ac6b8ee07825..68c097077ef0 100644
--- a/include/linux/shrinker.h
+++ b/include/linux/shrinker.h
@@ -4,39 +4,67 @@
4/* 4/*
5 * This struct is used to pass information from page reclaim to the shrinkers. 5 * This struct is used to pass information from page reclaim to the shrinkers.
6 * We consolidate the values for easier extention later. 6 * We consolidate the values for easier extention later.
7 *
8 * The 'gfpmask' refers to the allocation we are currently trying to
9 * fulfil.
7 */ 10 */
8struct shrink_control { 11struct shrink_control {
9 gfp_t gfp_mask; 12 gfp_t gfp_mask;
10 13
11 /* How many slab objects shrinker() should scan and try to reclaim */ 14 /*
15 * How many objects scan_objects should scan and try to reclaim.
16 * This is reset before every call, so it is safe for callees
17 * to modify.
18 */
12 unsigned long nr_to_scan; 19 unsigned long nr_to_scan;
20
21 /* shrink from these nodes */
22 nodemask_t nodes_to_scan;
23 /* current node being shrunk (for NUMA aware shrinkers) */
24 int nid;
13}; 25};
14 26
27#define SHRINK_STOP (~0UL)
15/* 28/*
16 * A callback you can register to apply pressure to ageable caches. 29 * A callback you can register to apply pressure to ageable caches.
17 * 30 *
18 * 'sc' is passed shrink_control which includes a count 'nr_to_scan' 31 * @count_objects should return the number of freeable items in the cache. If
19 * and a 'gfpmask'. It should look through the least-recently-used 32 * there are no objects to free or the number of freeable items cannot be
20 * 'nr_to_scan' entries and attempt to free them up. It should return 33 * determined, it should return 0. No deadlock checks should be done during the
21 * the number of objects which remain in the cache. If it returns -1, it means 34 * count callback - the shrinker relies on aggregating scan counts that couldn't
22 * it cannot do any scanning at this time (eg. there is a risk of deadlock). 35 * be executed due to potential deadlocks to be run at a later call when the
36 * deadlock condition is no longer pending.
23 * 37 *
24 * The 'gfpmask' refers to the allocation we are currently trying to 38 * @scan_objects will only be called if @count_objects returned a non-zero
25 * fulfil. 39 * value for the number of freeable objects. The callout should scan the cache
40 * and attempt to free items from the cache. It should then return the number
41 * of objects freed during the scan, or SHRINK_STOP if progress cannot be made
42 * due to potential deadlocks. If SHRINK_STOP is returned, then no further
43 * attempts to call the @scan_objects will be made from the current reclaim
44 * context.
26 * 45 *
27 * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is 46 * @flags determine the shrinker abilities, like numa awareness
28 * querying the cache size, so a fastpath for that case is appropriate.
29 */ 47 */
30struct shrinker { 48struct shrinker {
31 int (*shrink)(struct shrinker *, struct shrink_control *sc); 49 unsigned long (*count_objects)(struct shrinker *,
50 struct shrink_control *sc);
51 unsigned long (*scan_objects)(struct shrinker *,
52 struct shrink_control *sc);
53
32 int seeks; /* seeks to recreate an obj */ 54 int seeks; /* seeks to recreate an obj */
33 long batch; /* reclaim batch size, 0 = default */ 55 long batch; /* reclaim batch size, 0 = default */
56 unsigned long flags;
34 57
35 /* These are for internal use */ 58 /* These are for internal use */
36 struct list_head list; 59 struct list_head list;
37 atomic_long_t nr_in_batch; /* objs pending delete */ 60 /* objs pending delete, per node */
61 atomic_long_t *nr_deferred;
38}; 62};
39#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */ 63#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
40extern void register_shrinker(struct shrinker *); 64
65/* Flags */
66#define SHRINKER_NUMA_AWARE (1 << 0)
67
68extern int register_shrinker(struct shrinker *);
41extern void unregister_shrinker(struct shrinker *); 69extern void unregister_shrinker(struct shrinker *);
42#endif 70#endif
diff --git a/include/linux/signal.h b/include/linux/signal.h
index d897484730c0..2ac423bdb676 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -434,6 +434,14 @@ void signals_init(void);
434int restore_altstack(const stack_t __user *); 434int restore_altstack(const stack_t __user *);
435int __save_altstack(stack_t __user *, unsigned long); 435int __save_altstack(stack_t __user *, unsigned long);
436 436
437#define save_altstack_ex(uss, sp) do { \
438 stack_t __user *__uss = uss; \
439 struct task_struct *t = current; \
440 put_user_ex((void __user *)t->sas_ss_sp, &__uss->ss_sp); \
441 put_user_ex(sas_ss_flags(sp), &__uss->ss_flags); \
442 put_user_ex(t->sas_ss_size, &__uss->ss_size); \
443} while (0);
444
437#ifdef CONFIG_PROC_FS 445#ifdef CONFIG_PROC_FS
438struct seq_file; 446struct seq_file;
439extern void render_sigset_t(struct seq_file *, const char *, sigset_t *); 447extern void render_sigset_t(struct seq_file *, const char *, sigset_t *);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 3b71a4e83642..c2d89335f637 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -498,7 +498,7 @@ struct sk_buff {
498 * headers if needed 498 * headers if needed
499 */ 499 */
500 __u8 encapsulation:1; 500 __u8 encapsulation:1;
501 /* 7/9 bit hole (depending on ndisc_nodetype presence) */ 501 /* 6/8 bit hole (depending on ndisc_nodetype presence) */
502 kmemcheck_bitfield_end(flags2); 502 kmemcheck_bitfield_end(flags2);
503 503
504#if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL 504#if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL
@@ -1805,10 +1805,13 @@ static inline void pskb_trim_unique(struct sk_buff *skb, unsigned int len)
1805 */ 1805 */
1806static inline void skb_orphan(struct sk_buff *skb) 1806static inline void skb_orphan(struct sk_buff *skb)
1807{ 1807{
1808 if (skb->destructor) 1808 if (skb->destructor) {
1809 skb->destructor(skb); 1809 skb->destructor(skb);
1810 skb->destructor = NULL; 1810 skb->destructor = NULL;
1811 skb->sk = NULL; 1811 skb->sk = NULL;
1812 } else {
1813 BUG_ON(skb->sk);
1814 }
1812} 1815}
1813 1816
1814/** 1817/**
@@ -1902,8 +1905,8 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
1902 return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC); 1905 return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC);
1903} 1906}
1904 1907
1905/* 1908/**
1906 * __skb_alloc_page - allocate pages for ps-rx on a skb and preserve pfmemalloc data 1909 * __skb_alloc_pages - allocate pages for ps-rx on a skb and preserve pfmemalloc data
1907 * @gfp_mask: alloc_pages_node mask. Set __GFP_NOMEMALLOC if not for network packet RX 1910 * @gfp_mask: alloc_pages_node mask. Set __GFP_NOMEMALLOC if not for network packet RX
1908 * @skb: skb to set pfmemalloc on if __GFP_MEMALLOC is used 1911 * @skb: skb to set pfmemalloc on if __GFP_MEMALLOC is used
1909 * @order: size of the allocation 1912 * @order: size of the allocation
@@ -2356,6 +2359,10 @@ extern int skb_copy_datagram_from_iovec(struct sk_buff *skb,
2356 const struct iovec *from, 2359 const struct iovec *from,
2357 int from_offset, 2360 int from_offset,
2358 int len); 2361 int len);
2362extern int zerocopy_sg_from_iovec(struct sk_buff *skb,
2363 const struct iovec *frm,
2364 int offset,
2365 size_t count);
2359extern int skb_copy_datagram_const_iovec(const struct sk_buff *from, 2366extern int skb_copy_datagram_const_iovec(const struct sk_buff *from,
2360 int offset, 2367 int offset,
2361 const struct iovec *to, 2368 const struct iovec *to,
@@ -2385,7 +2392,7 @@ extern void skb_split(struct sk_buff *skb,
2385 struct sk_buff *skb1, const u32 len); 2392 struct sk_buff *skb1, const u32 len);
2386extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, 2393extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb,
2387 int shiftlen); 2394 int shiftlen);
2388extern void skb_scrub_packet(struct sk_buff *skb); 2395extern void skb_scrub_packet(struct sk_buff *skb, bool xnet);
2389 2396
2390extern struct sk_buff *skb_segment(struct sk_buff *skb, 2397extern struct sk_buff *skb_segment(struct sk_buff *skb,
2391 netdev_features_t features); 2398 netdev_features_t features);
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 6c5cc0ea8713..74f105847d13 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -4,6 +4,8 @@
4 * (C) SGI 2006, Christoph Lameter 4 * (C) SGI 2006, Christoph Lameter
5 * Cleaned up and restructured to ease the addition of alternative 5 * Cleaned up and restructured to ease the addition of alternative
6 * implementations of SLAB allocators. 6 * implementations of SLAB allocators.
7 * (C) Linux Foundation 2008-2013
8 * Unified interface for all slab allocators
7 */ 9 */
8 10
9#ifndef _LINUX_SLAB_H 11#ifndef _LINUX_SLAB_H
@@ -94,6 +96,7 @@
94#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= \ 96#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= \
95 (unsigned long)ZERO_SIZE_PTR) 97 (unsigned long)ZERO_SIZE_PTR)
96 98
99#include <linux/kmemleak.h>
97 100
98struct mem_cgroup; 101struct mem_cgroup;
99/* 102/*
@@ -289,6 +292,57 @@ static __always_inline int kmalloc_index(size_t size)
289} 292}
290#endif /* !CONFIG_SLOB */ 293#endif /* !CONFIG_SLOB */
291 294
295void *__kmalloc(size_t size, gfp_t flags);
296void *kmem_cache_alloc(struct kmem_cache *, gfp_t flags);
297
298#ifdef CONFIG_NUMA
299void *__kmalloc_node(size_t size, gfp_t flags, int node);
300void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
301#else
302static __always_inline void *__kmalloc_node(size_t size, gfp_t flags, int node)
303{
304 return __kmalloc(size, flags);
305}
306
307static __always_inline void *kmem_cache_alloc_node(struct kmem_cache *s, gfp_t flags, int node)
308{
309 return kmem_cache_alloc(s, flags);
310}
311#endif
312
313#ifdef CONFIG_TRACING
314extern void *kmem_cache_alloc_trace(struct kmem_cache *, gfp_t, size_t);
315
316#ifdef CONFIG_NUMA
317extern void *kmem_cache_alloc_node_trace(struct kmem_cache *s,
318 gfp_t gfpflags,
319 int node, size_t size);
320#else
321static __always_inline void *
322kmem_cache_alloc_node_trace(struct kmem_cache *s,
323 gfp_t gfpflags,
324 int node, size_t size)
325{
326 return kmem_cache_alloc_trace(s, gfpflags, size);
327}
328#endif /* CONFIG_NUMA */
329
330#else /* CONFIG_TRACING */
331static __always_inline void *kmem_cache_alloc_trace(struct kmem_cache *s,
332 gfp_t flags, size_t size)
333{
334 return kmem_cache_alloc(s, flags);
335}
336
337static __always_inline void *
338kmem_cache_alloc_node_trace(struct kmem_cache *s,
339 gfp_t gfpflags,
340 int node, size_t size)
341{
342 return kmem_cache_alloc_node(s, gfpflags, node);
343}
344#endif /* CONFIG_TRACING */
345
292#ifdef CONFIG_SLAB 346#ifdef CONFIG_SLAB
293#include <linux/slab_def.h> 347#include <linux/slab_def.h>
294#endif 348#endif
@@ -297,9 +351,60 @@ static __always_inline int kmalloc_index(size_t size)
297#include <linux/slub_def.h> 351#include <linux/slub_def.h>
298#endif 352#endif
299 353
300#ifdef CONFIG_SLOB 354static __always_inline void *
301#include <linux/slob_def.h> 355kmalloc_order(size_t size, gfp_t flags, unsigned int order)
356{
357 void *ret;
358
359 flags |= (__GFP_COMP | __GFP_KMEMCG);
360 ret = (void *) __get_free_pages(flags, order);
361 kmemleak_alloc(ret, size, 1, flags);
362 return ret;
363}
364
365#ifdef CONFIG_TRACING
366extern void *kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order);
367#else
368static __always_inline void *
369kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order)
370{
371 return kmalloc_order(size, flags, order);
372}
373#endif
374
375static __always_inline void *kmalloc_large(size_t size, gfp_t flags)
376{
377 unsigned int order = get_order(size);
378 return kmalloc_order_trace(size, flags, order);
379}
380
381/**
382 * kmalloc - allocate memory
383 * @size: how many bytes of memory are required.
384 * @flags: the type of memory to allocate (see kcalloc).
385 *
386 * kmalloc is the normal method of allocating memory
387 * for objects smaller than page size in the kernel.
388 */
389static __always_inline void *kmalloc(size_t size, gfp_t flags)
390{
391 if (__builtin_constant_p(size)) {
392 if (size > KMALLOC_MAX_CACHE_SIZE)
393 return kmalloc_large(size, flags);
394#ifndef CONFIG_SLOB
395 if (!(flags & GFP_DMA)) {
396 int index = kmalloc_index(size);
397
398 if (!index)
399 return ZERO_SIZE_PTR;
400
401 return kmem_cache_alloc_trace(kmalloc_caches[index],
402 flags, size);
403 }
302#endif 404#endif
405 }
406 return __kmalloc(size, flags);
407}
303 408
304/* 409/*
305 * Determine size used for the nth kmalloc cache. 410 * Determine size used for the nth kmalloc cache.
@@ -321,6 +426,23 @@ static __always_inline int kmalloc_size(int n)
321 return 0; 426 return 0;
322} 427}
323 428
429static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
430{
431#ifndef CONFIG_SLOB
432 if (__builtin_constant_p(size) &&
433 size <= KMALLOC_MAX_CACHE_SIZE && !(flags & GFP_DMA)) {
434 int i = kmalloc_index(size);
435
436 if (!i)
437 return ZERO_SIZE_PTR;
438
439 return kmem_cache_alloc_node_trace(kmalloc_caches[i],
440 flags, node, size);
441 }
442#endif
443 return __kmalloc_node(size, flags, node);
444}
445
324/* 446/*
325 * Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment. 447 * Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment.
326 * Intended for arches that get misalignment faults even for 64 bit integer 448 * Intended for arches that get misalignment faults even for 64 bit integer
@@ -451,36 +573,6 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
451 return kmalloc_array(n, size, flags | __GFP_ZERO); 573 return kmalloc_array(n, size, flags | __GFP_ZERO);
452} 574}
453 575
454#if !defined(CONFIG_NUMA) && !defined(CONFIG_SLOB)
455/**
456 * kmalloc_node - allocate memory from a specific node
457 * @size: how many bytes of memory are required.
458 * @flags: the type of memory to allocate (see kmalloc).
459 * @node: node to allocate from.
460 *
461 * kmalloc() for non-local nodes, used to allocate from a specific node
462 * if available. Equivalent to kmalloc() in the non-NUMA single-node
463 * case.
464 */
465static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
466{
467 return kmalloc(size, flags);
468}
469
470static inline void *__kmalloc_node(size_t size, gfp_t flags, int node)
471{
472 return __kmalloc(size, flags);
473}
474
475void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
476
477static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
478 gfp_t flags, int node)
479{
480 return kmem_cache_alloc(cachep, flags);
481}
482#endif /* !CONFIG_NUMA && !CONFIG_SLOB */
483
484/* 576/*
485 * kmalloc_track_caller is a special version of kmalloc that records the 577 * kmalloc_track_caller is a special version of kmalloc that records the
486 * calling function of the routine calling it for slab leak tracking instead 578 * calling function of the routine calling it for slab leak tracking instead
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index cd401580bdd3..e9346b4f1ef4 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -3,20 +3,6 @@
3 3
4/* 4/*
5 * Definitions unique to the original Linux SLAB allocator. 5 * Definitions unique to the original Linux SLAB allocator.
6 *
7 * What we provide here is a way to optimize the frequent kmalloc
8 * calls in the kernel by selecting the appropriate general cache
9 * if kmalloc was called with a size that can be established at
10 * compile time.
11 */
12
13#include <linux/init.h>
14#include <linux/compiler.h>
15
16/*
17 * struct kmem_cache
18 *
19 * manages a cache.
20 */ 6 */
21 7
22struct kmem_cache { 8struct kmem_cache {
@@ -102,96 +88,4 @@ struct kmem_cache {
102 */ 88 */
103}; 89};
104 90
105void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
106void *__kmalloc(size_t size, gfp_t flags);
107
108#ifdef CONFIG_TRACING
109extern void *kmem_cache_alloc_trace(struct kmem_cache *, gfp_t, size_t);
110#else
111static __always_inline void *
112kmem_cache_alloc_trace(struct kmem_cache *cachep, gfp_t flags, size_t size)
113{
114 return kmem_cache_alloc(cachep, flags);
115}
116#endif
117
118static __always_inline void *kmalloc(size_t size, gfp_t flags)
119{
120 struct kmem_cache *cachep;
121 void *ret;
122
123 if (__builtin_constant_p(size)) {
124 int i;
125
126 if (!size)
127 return ZERO_SIZE_PTR;
128
129 if (WARN_ON_ONCE(size > KMALLOC_MAX_SIZE))
130 return NULL;
131
132 i = kmalloc_index(size);
133
134#ifdef CONFIG_ZONE_DMA
135 if (flags & GFP_DMA)
136 cachep = kmalloc_dma_caches[i];
137 else
138#endif
139 cachep = kmalloc_caches[i];
140
141 ret = kmem_cache_alloc_trace(cachep, flags, size);
142
143 return ret;
144 }
145 return __kmalloc(size, flags);
146}
147
148#ifdef CONFIG_NUMA
149extern void *__kmalloc_node(size_t size, gfp_t flags, int node);
150extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
151
152#ifdef CONFIG_TRACING
153extern void *kmem_cache_alloc_node_trace(struct kmem_cache *cachep,
154 gfp_t flags,
155 int nodeid,
156 size_t size);
157#else
158static __always_inline void *
159kmem_cache_alloc_node_trace(struct kmem_cache *cachep,
160 gfp_t flags,
161 int nodeid,
162 size_t size)
163{
164 return kmem_cache_alloc_node(cachep, flags, nodeid);
165}
166#endif
167
168static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
169{
170 struct kmem_cache *cachep;
171
172 if (__builtin_constant_p(size)) {
173 int i;
174
175 if (!size)
176 return ZERO_SIZE_PTR;
177
178 if (WARN_ON_ONCE(size > KMALLOC_MAX_SIZE))
179 return NULL;
180
181 i = kmalloc_index(size);
182
183#ifdef CONFIG_ZONE_DMA
184 if (flags & GFP_DMA)
185 cachep = kmalloc_dma_caches[i];
186 else
187#endif
188 cachep = kmalloc_caches[i];
189
190 return kmem_cache_alloc_node_trace(cachep, flags, node, size);
191 }
192 return __kmalloc_node(size, flags, node);
193}
194
195#endif /* CONFIG_NUMA */
196
197#endif /* _LINUX_SLAB_DEF_H */ 91#endif /* _LINUX_SLAB_DEF_H */
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h
deleted file mode 100644
index 095a5a4a8516..000000000000
--- a/include/linux/slob_def.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef __LINUX_SLOB_DEF_H
2#define __LINUX_SLOB_DEF_H
3
4#include <linux/numa.h>
5
6void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
7
8static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep,
9 gfp_t flags)
10{
11 return kmem_cache_alloc_node(cachep, flags, NUMA_NO_NODE);
12}
13
14void *__kmalloc_node(size_t size, gfp_t flags, int node);
15
16static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
17{
18 return __kmalloc_node(size, flags, node);
19}
20
21static __always_inline void *kmalloc(size_t size, gfp_t flags)
22{
23 return __kmalloc_node(size, flags, NUMA_NO_NODE);
24}
25
26static __always_inline void *__kmalloc(size_t size, gfp_t flags)
27{
28 return kmalloc(size, flags);
29}
30
31#endif /* __LINUX_SLOB_DEF_H */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 027276fa8713..cc0b67eada42 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -6,14 +6,8 @@
6 * 6 *
7 * (C) 2007 SGI, Christoph Lameter 7 * (C) 2007 SGI, Christoph Lameter
8 */ 8 */
9#include <linux/types.h>
10#include <linux/gfp.h>
11#include <linux/bug.h>
12#include <linux/workqueue.h>
13#include <linux/kobject.h> 9#include <linux/kobject.h>
14 10
15#include <linux/kmemleak.h>
16
17enum stat_item { 11enum stat_item {
18 ALLOC_FASTPATH, /* Allocation from cpu slab */ 12 ALLOC_FASTPATH, /* Allocation from cpu slab */
19 ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */ 13 ALLOC_SLOWPATH, /* Allocation by getting a new cpu slab */
@@ -104,108 +98,4 @@ struct kmem_cache {
104 struct kmem_cache_node *node[MAX_NUMNODES]; 98 struct kmem_cache_node *node[MAX_NUMNODES];
105}; 99};
106 100
107void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
108void *__kmalloc(size_t size, gfp_t flags);
109
110static __always_inline void *
111kmalloc_order(size_t size, gfp_t flags, unsigned int order)
112{
113 void *ret;
114
115 flags |= (__GFP_COMP | __GFP_KMEMCG);
116 ret = (void *) __get_free_pages(flags, order);
117 kmemleak_alloc(ret, size, 1, flags);
118 return ret;
119}
120
121/**
122 * Calling this on allocated memory will check that the memory
123 * is expected to be in use, and print warnings if not.
124 */
125#ifdef CONFIG_SLUB_DEBUG
126extern bool verify_mem_not_deleted(const void *x);
127#else
128static inline bool verify_mem_not_deleted(const void *x)
129{
130 return true;
131}
132#endif
133
134#ifdef CONFIG_TRACING
135extern void *
136kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size);
137extern void *kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order);
138#else
139static __always_inline void *
140kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size)
141{
142 return kmem_cache_alloc(s, gfpflags);
143}
144
145static __always_inline void *
146kmalloc_order_trace(size_t size, gfp_t flags, unsigned int order)
147{
148 return kmalloc_order(size, flags, order);
149}
150#endif
151
152static __always_inline void *kmalloc_large(size_t size, gfp_t flags)
153{
154 unsigned int order = get_order(size);
155 return kmalloc_order_trace(size, flags, order);
156}
157
158static __always_inline void *kmalloc(size_t size, gfp_t flags)
159{
160 if (__builtin_constant_p(size)) {
161 if (size > KMALLOC_MAX_CACHE_SIZE)
162 return kmalloc_large(size, flags);
163
164 if (!(flags & GFP_DMA)) {
165 int index = kmalloc_index(size);
166
167 if (!index)
168 return ZERO_SIZE_PTR;
169
170 return kmem_cache_alloc_trace(kmalloc_caches[index],
171 flags, size);
172 }
173 }
174 return __kmalloc(size, flags);
175}
176
177#ifdef CONFIG_NUMA
178void *__kmalloc_node(size_t size, gfp_t flags, int node);
179void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
180
181#ifdef CONFIG_TRACING
182extern void *kmem_cache_alloc_node_trace(struct kmem_cache *s,
183 gfp_t gfpflags,
184 int node, size_t size);
185#else
186static __always_inline void *
187kmem_cache_alloc_node_trace(struct kmem_cache *s,
188 gfp_t gfpflags,
189 int node, size_t size)
190{
191 return kmem_cache_alloc_node(s, gfpflags, node);
192}
193#endif
194
195static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
196{
197 if (__builtin_constant_p(size) &&
198 size <= KMALLOC_MAX_CACHE_SIZE && !(flags & GFP_DMA)) {
199 int index = kmalloc_index(size);
200
201 if (!index)
202 return ZERO_SIZE_PTR;
203
204 return kmem_cache_alloc_node_trace(kmalloc_caches[index],
205 flags, node, size);
206 }
207 return __kmalloc_node(size, flags, node);
208}
209#endif
210
211#endif /* _LINUX_SLUB_DEF_H */ 101#endif /* _LINUX_SLUB_DEF_H */
diff --git a/include/linux/smp.h b/include/linux/smp.h
index c181399f2c20..731f5237d5f4 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -28,6 +28,27 @@ extern unsigned int total_cpus;
28int smp_call_function_single(int cpuid, smp_call_func_t func, void *info, 28int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
29 int wait); 29 int wait);
30 30
31/*
32 * Call a function on all processors
33 */
34int on_each_cpu(smp_call_func_t func, void *info, int wait);
35
36/*
37 * Call a function on processors specified by mask, which might include
38 * the local one.
39 */
40void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func,
41 void *info, bool wait);
42
43/*
44 * Call a function on each processor for which the supplied function
45 * cond_func returns a positive value. This may include the local
46 * processor.
47 */
48void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info),
49 smp_call_func_t func, void *info, bool wait,
50 gfp_t gfp_flags);
51
31#ifdef CONFIG_SMP 52#ifdef CONFIG_SMP
32 53
33#include <linux/preempt.h> 54#include <linux/preempt.h>
@@ -95,27 +116,6 @@ static inline void call_function_init(void) { }
95#endif 116#endif
96 117
97/* 118/*
98 * Call a function on all processors
99 */
100int on_each_cpu(smp_call_func_t func, void *info, int wait);
101
102/*
103 * Call a function on processors specified by mask, which might include
104 * the local one.
105 */
106void on_each_cpu_mask(const struct cpumask *mask, smp_call_func_t func,
107 void *info, bool wait);
108
109/*
110 * Call a function on each processor for which the supplied function
111 * cond_func returns a positive value. This may include the local
112 * processor.
113 */
114void on_each_cpu_cond(bool (*cond_func)(int cpu, void *info),
115 smp_call_func_t func, void *info, bool wait,
116 gfp_t gfp_flags);
117
118/*
119 * Mark the boot cpu "online" so that it can call console drivers in 119 * Mark the boot cpu "online" so that it can call console drivers in
120 * printk() and can access its per-cpu storage. 120 * printk() and can access its per-cpu storage.
121 */ 121 */
@@ -139,43 +139,6 @@ static inline int up_smp_call_function(smp_call_func_t func, void *info)
139} 139}
140#define smp_call_function(func, info, wait) \ 140#define smp_call_function(func, info, wait) \
141 (up_smp_call_function(func, info)) 141 (up_smp_call_function(func, info))
142#define on_each_cpu(func, info, wait) \
143 ({ \
144 unsigned long __flags; \
145 local_irq_save(__flags); \
146 func(info); \
147 local_irq_restore(__flags); \
148 0; \
149 })
150/*
151 * Note we still need to test the mask even for UP
152 * because we actually can get an empty mask from
153 * code that on SMP might call us without the local
154 * CPU in the mask.
155 */
156#define on_each_cpu_mask(mask, func, info, wait) \
157 do { \
158 if (cpumask_test_cpu(0, (mask))) { \
159 local_irq_disable(); \
160 (func)(info); \
161 local_irq_enable(); \
162 } \
163 } while (0)
164/*
165 * Preemption is disabled here to make sure the cond_func is called under the
166 * same condtions in UP and SMP.
167 */
168#define on_each_cpu_cond(cond_func, func, info, wait, gfp_flags)\
169 do { \
170 void *__info = (info); \
171 preempt_disable(); \
172 if ((cond_func)(0, __info)) { \
173 local_irq_disable(); \
174 (func)(__info); \
175 local_irq_enable(); \
176 } \
177 preempt_enable(); \
178 } while (0)
179 142
180static inline void smp_send_reschedule(int cpu) { } 143static inline void smp_send_reschedule(int cpu) { }
181#define smp_prepare_boot_cpu() do {} while (0) 144#define smp_prepare_boot_cpu() do {} while (0)
@@ -192,6 +155,12 @@ smp_call_function_any(const struct cpumask *mask, smp_call_func_t func,
192 155
193static inline void kick_all_cpus_sync(void) { } 156static inline void kick_all_cpus_sync(void) { }
194 157
158static inline void __smp_call_function_single(int cpuid,
159 struct call_single_data *data, int wait)
160{
161 on_each_cpu(data->func, data->info, wait);
162}
163
195#endif /* !SMP */ 164#endif /* !SMP */
196 165
197/* 166/*
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h
index 4dde70e74822..eec3efd19beb 100644
--- a/include/linux/smsc911x.h
+++ b/include/linux/smsc911x.h
@@ -22,6 +22,7 @@
22#define __LINUX_SMSC911X_H__ 22#define __LINUX_SMSC911X_H__
23 23
24#include <linux/phy.h> 24#include <linux/phy.h>
25#include <linux/if_ether.h>
25 26
26/* platform_device configuration data, should be assigned to 27/* platform_device configuration data, should be assigned to
27 * the platform_device's dev.platform_data */ 28 * the platform_device's dev.platform_data */
@@ -31,7 +32,7 @@ struct smsc911x_platform_config {
31 unsigned int flags; 32 unsigned int flags;
32 unsigned int shift; 33 unsigned int shift;
33 phy_interface_t phy_interface; 34 phy_interface_t phy_interface;
34 unsigned char mac[6]; 35 unsigned char mac[ETH_ALEN];
35}; 36};
36 37
37/* Constants for platform_device irq polarity configuration */ 38/* Constants for platform_device irq polarity configuration */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 230c04bda3e2..445ef7519dc2 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -313,6 +313,8 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
313 struct iovec *iov, 313 struct iovec *iov,
314 int offset, 314 int offset,
315 unsigned int len, __wsum *csump); 315 unsigned int len, __wsum *csump);
316extern unsigned long iov_pages(const struct iovec *iov, int offset,
317 unsigned long nr_segs);
316 318
317extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *address, int mode); 319extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *address, int mode);
318extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, 320extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,
diff --git a/include/linux/spi/mmc_spi.h b/include/linux/spi/mmc_spi.h
index 32be8dbdf191..274bc0fa00af 100644
--- a/include/linux/spi/mmc_spi.h
+++ b/include/linux/spi/mmc_spi.h
@@ -7,6 +7,11 @@
7struct device; 7struct device;
8struct mmc_host; 8struct mmc_host;
9 9
10#define MMC_SPI_USE_CD_GPIO (1 << 0)
11#define MMC_SPI_USE_RO_GPIO (1 << 1)
12#define MMC_SPI_CD_GPIO_ACTIVE_LOW (1 << 2)
13#define MMC_SPI_RO_GPIO_ACTIVE_LOW (1 << 3)
14
10/* Put this in platform_data of a device being used to manage an MMC/SD 15/* Put this in platform_data of a device being used to manage an MMC/SD
11 * card slot. (Modeled after PXA mmc glue; see that for usage examples.) 16 * card slot. (Modeled after PXA mmc glue; see that for usage examples.)
12 * 17 *
@@ -21,17 +26,19 @@ struct mmc_spi_platform_data {
21 void *); 26 void *);
22 void (*exit)(struct device *, void *); 27 void (*exit)(struct device *, void *);
23 28
24 /* sense switch on sd cards */
25 int (*get_ro)(struct device *);
26
27 /* 29 /*
28 * If board does not use CD interrupts, driver can optimize polling 30 * Card Detect and Read Only GPIOs. To enable debouncing on the card
29 * using this function. 31 * detect GPIO, set the cd_debounce to the debounce time in
32 * microseconds.
30 */ 33 */
31 int (*get_cd)(struct device *); 34 unsigned int flags;
35 unsigned int cd_gpio;
36 unsigned int cd_debounce;
37 unsigned int ro_gpio;
32 38
33 /* Capabilities to pass into mmc core (e.g. MMC_CAP_NEEDS_POLL). */ 39 /* Capabilities to pass into mmc core (e.g. MMC_CAP_NEEDS_POLL). */
34 unsigned long caps; 40 unsigned long caps;
41 unsigned long caps2;
35 42
36 /* how long to debounce card detect, in msecs */ 43 /* how long to debounce card detect, in msecs */
37 u16 detect_delay; 44 u16 detect_delay;
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 28e440be1c07..887116dbce2c 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -74,7 +74,7 @@ struct spi_device {
74 struct spi_master *master; 74 struct spi_master *master;
75 u32 max_speed_hz; 75 u32 max_speed_hz;
76 u8 chip_select; 76 u8 chip_select;
77 u8 mode; 77 u16 mode;
78#define SPI_CPHA 0x01 /* clock phase */ 78#define SPI_CPHA 0x01 /* clock phase */
79#define SPI_CPOL 0x02 /* clock polarity */ 79#define SPI_CPOL 0x02 /* clock polarity */
80#define SPI_MODE_0 (0|0) /* (original MicroWire) */ 80#define SPI_MODE_0 (0|0) /* (original MicroWire) */
@@ -87,6 +87,10 @@ struct spi_device {
87#define SPI_LOOP 0x20 /* loopback mode */ 87#define SPI_LOOP 0x20 /* loopback mode */
88#define SPI_NO_CS 0x40 /* 1 dev/bus, no chipselect */ 88#define SPI_NO_CS 0x40 /* 1 dev/bus, no chipselect */
89#define SPI_READY 0x80 /* slave pulls low to pause */ 89#define SPI_READY 0x80 /* slave pulls low to pause */
90#define SPI_TX_DUAL 0x100 /* transmit with 2 wires */
91#define SPI_TX_QUAD 0x200 /* transmit with 4 wires */
92#define SPI_RX_DUAL 0x400 /* receive with 2 wires */
93#define SPI_RX_QUAD 0x800 /* receive with 4 wires */
90 u8 bits_per_word; 94 u8 bits_per_word;
91 int irq; 95 int irq;
92 void *controller_state; 96 void *controller_state;
@@ -233,6 +237,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
233 * suported. If set, the SPI core will reject any transfer with an 237 * suported. If set, the SPI core will reject any transfer with an
234 * unsupported bits_per_word. If not set, this value is simply ignored, 238 * unsupported bits_per_word. If not set, this value is simply ignored,
235 * and it's up to the individual driver to perform any validation. 239 * and it's up to the individual driver to perform any validation.
240 * @min_speed_hz: Lowest supported transfer speed
241 * @max_speed_hz: Highest supported transfer speed
236 * @flags: other constraints relevant to this driver 242 * @flags: other constraints relevant to this driver
237 * @bus_lock_spinlock: spinlock for SPI bus locking 243 * @bus_lock_spinlock: spinlock for SPI bus locking
238 * @bus_lock_mutex: mutex for SPI bus locking 244 * @bus_lock_mutex: mutex for SPI bus locking
@@ -254,6 +260,9 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
254 * @busy: message pump is busy 260 * @busy: message pump is busy
255 * @running: message pump is running 261 * @running: message pump is running
256 * @rt: whether this queue is set to run as a realtime task 262 * @rt: whether this queue is set to run as a realtime task
263 * @auto_runtime_pm: the core should ensure a runtime PM reference is held
264 * while the hardware is prepared, using the parent
265 * device for the spidev
257 * @prepare_transfer_hardware: a message will soon arrive from the queue 266 * @prepare_transfer_hardware: a message will soon arrive from the queue
258 * so the subsystem requests the driver to prepare the transfer hardware 267 * so the subsystem requests the driver to prepare the transfer hardware
259 * by issuing this call 268 * by issuing this call
@@ -309,9 +318,13 @@ struct spi_master {
309 /* bitmask of supported bits_per_word for transfers */ 318 /* bitmask of supported bits_per_word for transfers */
310 u32 bits_per_word_mask; 319 u32 bits_per_word_mask;
311#define SPI_BPW_MASK(bits) BIT((bits) - 1) 320#define SPI_BPW_MASK(bits) BIT((bits) - 1)
312#define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0UL : (BIT(bits) - 1)) 321#define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0U : (BIT(bits) - 1))
313#define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - SPI_BIT_MASK(min - 1)) 322#define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - SPI_BIT_MASK(min - 1))
314 323
324 /* limits on transfer speed */
325 u32 min_speed_hz;
326 u32 max_speed_hz;
327
315 /* other constraints relevant to this driver */ 328 /* other constraints relevant to this driver */
316 u16 flags; 329 u16 flags;
317#define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ 330#define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */
@@ -374,11 +387,13 @@ struct spi_master {
374 bool busy; 387 bool busy;
375 bool running; 388 bool running;
376 bool rt; 389 bool rt;
390 bool auto_runtime_pm;
377 391
378 int (*prepare_transfer_hardware)(struct spi_master *master); 392 int (*prepare_transfer_hardware)(struct spi_master *master);
379 int (*transfer_one_message)(struct spi_master *master, 393 int (*transfer_one_message)(struct spi_master *master,
380 struct spi_message *mesg); 394 struct spi_message *mesg);
381 int (*unprepare_transfer_hardware)(struct spi_master *master); 395 int (*unprepare_transfer_hardware)(struct spi_master *master);
396
382 /* gpio chip select */ 397 /* gpio chip select */
383 int *cs_gpios; 398 int *cs_gpios;
384}; 399};
@@ -448,6 +463,10 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
448 * @rx_buf: data to be read (dma-safe memory), or NULL 463 * @rx_buf: data to be read (dma-safe memory), or NULL
449 * @tx_dma: DMA address of tx_buf, if @spi_message.is_dma_mapped 464 * @tx_dma: DMA address of tx_buf, if @spi_message.is_dma_mapped
450 * @rx_dma: DMA address of rx_buf, if @spi_message.is_dma_mapped 465 * @rx_dma: DMA address of rx_buf, if @spi_message.is_dma_mapped
466 * @tx_nbits: number of bits used for writting. If 0 the default
467 * (SPI_NBITS_SINGLE) is used.
468 * @rx_nbits: number of bits used for reading. If 0 the default
469 * (SPI_NBITS_SINGLE) is used.
451 * @len: size of rx and tx buffers (in bytes) 470 * @len: size of rx and tx buffers (in bytes)
452 * @speed_hz: Select a speed other than the device default for this 471 * @speed_hz: Select a speed other than the device default for this
453 * transfer. If 0 the default (from @spi_device) is used. 472 * transfer. If 0 the default (from @spi_device) is used.
@@ -502,6 +521,11 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
502 * by the results of previous messages and where the whole transaction 521 * by the results of previous messages and where the whole transaction
503 * ends when the chipselect goes intactive. 522 * ends when the chipselect goes intactive.
504 * 523 *
524 * When SPI can transfer in 1x,2x or 4x. It can get this tranfer information
525 * from device through @tx_nbits and @rx_nbits. In Bi-direction, these
526 * two should both be set. User can set transfer mode with SPI_NBITS_SINGLE(1x)
527 * SPI_NBITS_DUAL(2x) and SPI_NBITS_QUAD(4x) to support these three transfer.
528 *
505 * The code that submits an spi_message (and its spi_transfers) 529 * The code that submits an spi_message (and its spi_transfers)
506 * to the lower layers is responsible for managing its memory. 530 * to the lower layers is responsible for managing its memory.
507 * Zero-initialize every field you don't set up explicitly, to 531 * Zero-initialize every field you don't set up explicitly, to
@@ -522,6 +546,11 @@ struct spi_transfer {
522 dma_addr_t rx_dma; 546 dma_addr_t rx_dma;
523 547
524 unsigned cs_change:1; 548 unsigned cs_change:1;
549 u8 tx_nbits;
550 u8 rx_nbits;
551#define SPI_NBITS_SINGLE 0x01 /* 1bit transfer */
552#define SPI_NBITS_DUAL 0x02 /* 2bits transfer */
553#define SPI_NBITS_QUAD 0x04 /* 4bits transfer */
525 u8 bits_per_word; 554 u8 bits_per_word;
526 u16 delay_usecs; 555 u16 delay_usecs;
527 u32 speed_hz; 556 u32 speed_hz;
@@ -578,6 +607,7 @@ struct spi_message {
578 /* completion is reported through a callback */ 607 /* completion is reported through a callback */
579 void (*complete)(void *context); 608 void (*complete)(void *context);
580 void *context; 609 void *context;
610 unsigned frame_length;
581 unsigned actual_length; 611 unsigned actual_length;
582 int status; 612 int status;
583 613
@@ -869,7 +899,7 @@ struct spi_board_info {
869 /* mode becomes spi_device.mode, and is essential for chips 899 /* mode becomes spi_device.mode, and is essential for chips
870 * where the default of SPI_CS_HIGH = 0 is wrong. 900 * where the default of SPI_CS_HIGH = 0 is wrong.
871 */ 901 */
872 u8 mode; 902 u16 mode;
873 903
874 /* ... may need additional spi_device chip config data here. 904 /* ... may need additional spi_device chip config data here.
875 * avoid stuff protocol drivers can set; but include stuff 905 * avoid stuff protocol drivers can set; but include stuff
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h
index f987a2bee16a..daebaba886aa 100644
--- a/include/linux/spi/spi_bitbang.h
+++ b/include/linux/spi/spi_bitbang.h
@@ -4,11 +4,7 @@
4#include <linux/workqueue.h> 4#include <linux/workqueue.h>
5 5
6struct spi_bitbang { 6struct spi_bitbang {
7 struct workqueue_struct *workqueue;
8 struct work_struct work;
9
10 spinlock_t lock; 7 spinlock_t lock;
11 struct list_head queue;
12 u8 busy; 8 u8 busy;
13 u8 use_dma; 9 u8 use_dma;
14 u8 flags; /* extra spi->mode support */ 10 u8 flags; /* extra spi->mode support */
@@ -41,7 +37,6 @@ struct spi_bitbang {
41 */ 37 */
42extern int spi_bitbang_setup(struct spi_device *spi); 38extern int spi_bitbang_setup(struct spi_device *spi);
43extern void spi_bitbang_cleanup(struct spi_device *spi); 39extern void spi_bitbang_cleanup(struct spi_device *spi);
44extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m);
45extern int spi_bitbang_setup_transfer(struct spi_device *spi, 40extern int spi_bitbang_setup_transfer(struct spi_device *spi,
46 struct spi_transfer *t); 41 struct spi_transfer *t);
47 42
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 9e495d31516e..bb5deb0feb6b 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -108,6 +108,7 @@ struct plat_stmmacenet_data {
108 int bugged_jumbo; 108 int bugged_jumbo;
109 int pmt; 109 int pmt;
110 int force_sf_dma_mode; 110 int force_sf_dma_mode;
111 int force_thresh_dma_mode;
111 int riwt_off; 112 int riwt_off;
112 void (*fix_mac_speed)(void *priv, unsigned int speed); 113 void (*fix_mac_speed)(void *priv, unsigned int speed);
113 void (*bus_setup)(void __iomem *ioaddr); 114 void (*bus_setup)(void __iomem *ioaddr);
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 0dd00f4f6810..790be1472792 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -24,12 +24,21 @@
24 24
25struct rpcsec_gss_info; 25struct rpcsec_gss_info;
26 26
27/* auth_cred ac_flags bits */
28enum {
29 RPC_CRED_NO_CRKEY_TIMEOUT = 0, /* underlying cred has no key timeout */
30 RPC_CRED_KEY_EXPIRE_SOON = 1, /* underlying cred key will expire soon */
31 RPC_CRED_NOTIFY_TIMEOUT = 2, /* nofity generic cred when underlying
32 key will expire soon */
33};
34
27/* Work around the lack of a VFS credential */ 35/* Work around the lack of a VFS credential */
28struct auth_cred { 36struct auth_cred {
29 kuid_t uid; 37 kuid_t uid;
30 kgid_t gid; 38 kgid_t gid;
31 struct group_info *group_info; 39 struct group_info *group_info;
32 const char *principal; 40 const char *principal;
41 unsigned long ac_flags;
33 unsigned char machine_cred : 1; 42 unsigned char machine_cred : 1;
34}; 43};
35 44
@@ -87,6 +96,11 @@ struct rpc_auth {
87 /* per-flavor data */ 96 /* per-flavor data */
88}; 97};
89 98
99struct rpc_auth_create_args {
100 rpc_authflavor_t pseudoflavor;
101 const char *target_name;
102};
103
90/* Flags for rpcauth_lookupcred() */ 104/* Flags for rpcauth_lookupcred() */
91#define RPCAUTH_LOOKUP_NEW 0x01 /* Accept an uninitialised cred */ 105#define RPCAUTH_LOOKUP_NEW 0x01 /* Accept an uninitialised cred */
92 106
@@ -97,17 +111,17 @@ struct rpc_authops {
97 struct module *owner; 111 struct module *owner;
98 rpc_authflavor_t au_flavor; /* flavor (RPC_AUTH_*) */ 112 rpc_authflavor_t au_flavor; /* flavor (RPC_AUTH_*) */
99 char * au_name; 113 char * au_name;
100 struct rpc_auth * (*create)(struct rpc_clnt *, rpc_authflavor_t); 114 struct rpc_auth * (*create)(struct rpc_auth_create_args *, struct rpc_clnt *);
101 void (*destroy)(struct rpc_auth *); 115 void (*destroy)(struct rpc_auth *);
102 116
103 struct rpc_cred * (*lookup_cred)(struct rpc_auth *, struct auth_cred *, int); 117 struct rpc_cred * (*lookup_cred)(struct rpc_auth *, struct auth_cred *, int);
104 struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int); 118 struct rpc_cred * (*crcreate)(struct rpc_auth*, struct auth_cred *, int);
105 int (*pipes_create)(struct rpc_auth *);
106 void (*pipes_destroy)(struct rpc_auth *);
107 int (*list_pseudoflavors)(rpc_authflavor_t *, int); 119 int (*list_pseudoflavors)(rpc_authflavor_t *, int);
108 rpc_authflavor_t (*info2flavor)(struct rpcsec_gss_info *); 120 rpc_authflavor_t (*info2flavor)(struct rpcsec_gss_info *);
109 int (*flavor2info)(rpc_authflavor_t, 121 int (*flavor2info)(rpc_authflavor_t,
110 struct rpcsec_gss_info *); 122 struct rpcsec_gss_info *);
123 int (*key_timeout)(struct rpc_auth *,
124 struct rpc_cred *);
111}; 125};
112 126
113struct rpc_credops { 127struct rpc_credops {
@@ -124,6 +138,8 @@ struct rpc_credops {
124 void *, __be32 *, void *); 138 void *, __be32 *, void *);
125 int (*crunwrap_resp)(struct rpc_task *, kxdrdproc_t, 139 int (*crunwrap_resp)(struct rpc_task *, kxdrdproc_t,
126 void *, __be32 *, void *); 140 void *, __be32 *, void *);
141 int (*crkey_timeout)(struct rpc_cred *);
142 bool (*crkey_to_expire)(struct rpc_cred *);
127}; 143};
128 144
129extern const struct rpc_authops authunix_ops; 145extern const struct rpc_authops authunix_ops;
@@ -140,7 +156,8 @@ struct rpc_cred * rpc_lookup_cred(void);
140struct rpc_cred * rpc_lookup_machine_cred(const char *service_name); 156struct rpc_cred * rpc_lookup_machine_cred(const char *service_name);
141int rpcauth_register(const struct rpc_authops *); 157int rpcauth_register(const struct rpc_authops *);
142int rpcauth_unregister(const struct rpc_authops *); 158int rpcauth_unregister(const struct rpc_authops *);
143struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); 159struct rpc_auth * rpcauth_create(struct rpc_auth_create_args *,
160 struct rpc_clnt *);
144void rpcauth_release(struct rpc_auth *); 161void rpcauth_release(struct rpc_auth *);
145rpc_authflavor_t rpcauth_get_pseudoflavor(rpc_authflavor_t, 162rpc_authflavor_t rpcauth_get_pseudoflavor(rpc_authflavor_t,
146 struct rpcsec_gss_info *); 163 struct rpcsec_gss_info *);
@@ -162,6 +179,9 @@ int rpcauth_uptodatecred(struct rpc_task *);
162int rpcauth_init_credcache(struct rpc_auth *); 179int rpcauth_init_credcache(struct rpc_auth *);
163void rpcauth_destroy_credcache(struct rpc_auth *); 180void rpcauth_destroy_credcache(struct rpc_auth *);
164void rpcauth_clear_credcache(struct rpc_cred_cache *); 181void rpcauth_clear_credcache(struct rpc_cred_cache *);
182int rpcauth_key_timeout_notify(struct rpc_auth *,
183 struct rpc_cred *);
184bool rpcauth_cred_key_to_expire(struct rpc_cred *);
165 185
166static inline 186static inline
167struct rpc_cred * get_rpccred(struct rpc_cred *cred) 187struct rpc_cred * get_rpccred(struct rpc_cred *cred)
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 6ce690de447f..437ddb6c4aef 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -264,12 +264,30 @@ static inline int get_uint(char **bpp, unsigned int *anint)
264 return 0; 264 return 0;
265} 265}
266 266
267static inline int get_time(char **bpp, time_t *time)
268{
269 char buf[50];
270 long long ll;
271 int len = qword_get(bpp, buf, sizeof(buf));
272
273 if (len < 0)
274 return -EINVAL;
275 if (len == 0)
276 return -ENOENT;
277
278 if (kstrtoll(buf, 0, &ll))
279 return -EINVAL;
280
281 *time = (time_t)ll;
282 return 0;
283}
284
267static inline time_t get_expiry(char **bpp) 285static inline time_t get_expiry(char **bpp)
268{ 286{
269 int rv; 287 time_t rv;
270 struct timespec boot; 288 struct timespec boot;
271 289
272 if (get_int(bpp, &rv)) 290 if (get_time(bpp, &rv))
273 return 0; 291 return 0;
274 if (rv < 0) 292 if (rv < 0)
275 return 0; 293 return 0;
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index bfe11be81f6f..6740801aa71a 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -21,6 +21,7 @@
21#include <linux/sunrpc/stats.h> 21#include <linux/sunrpc/stats.h>
22#include <linux/sunrpc/xdr.h> 22#include <linux/sunrpc/xdr.h>
23#include <linux/sunrpc/timer.h> 23#include <linux/sunrpc/timer.h>
24#include <linux/sunrpc/rpc_pipe_fs.h>
24#include <asm/signal.h> 25#include <asm/signal.h>
25#include <linux/path.h> 26#include <linux/path.h>
26#include <net/ipv6.h> 27#include <net/ipv6.h>
@@ -32,6 +33,7 @@ struct rpc_inode;
32 */ 33 */
33struct rpc_clnt { 34struct rpc_clnt {
34 atomic_t cl_count; /* Number of references */ 35 atomic_t cl_count; /* Number of references */
36 unsigned int cl_clid; /* client id */
35 struct list_head cl_clients; /* Global list of clients */ 37 struct list_head cl_clients; /* Global list of clients */
36 struct list_head cl_tasks; /* List of tasks */ 38 struct list_head cl_tasks; /* List of tasks */
37 spinlock_t cl_lock; /* spinlock */ 39 spinlock_t cl_lock; /* spinlock */
@@ -41,7 +43,6 @@ struct rpc_clnt {
41 cl_vers, /* RPC version number */ 43 cl_vers, /* RPC version number */
42 cl_maxproc; /* max procedure number */ 44 cl_maxproc; /* max procedure number */
43 45
44 const char * cl_protname; /* protocol name */
45 struct rpc_auth * cl_auth; /* authenticator */ 46 struct rpc_auth * cl_auth; /* authenticator */
46 struct rpc_stat * cl_stats; /* per-program statistics */ 47 struct rpc_stat * cl_stats; /* per-program statistics */
47 struct rpc_iostats * cl_metrics; /* per-client statistics */ 48 struct rpc_iostats * cl_metrics; /* per-client statistics */
@@ -56,12 +57,11 @@ struct rpc_clnt {
56 57
57 int cl_nodelen; /* nodename length */ 58 int cl_nodelen; /* nodename length */
58 char cl_nodename[UNX_MAXNODENAME]; 59 char cl_nodename[UNX_MAXNODENAME];
59 struct dentry * cl_dentry; 60 struct rpc_pipe_dir_head cl_pipedir_objects;
60 struct rpc_clnt * cl_parent; /* Points to parent of clones */ 61 struct rpc_clnt * cl_parent; /* Points to parent of clones */
61 struct rpc_rtt cl_rtt_default; 62 struct rpc_rtt cl_rtt_default;
62 struct rpc_timeout cl_timeout_default; 63 struct rpc_timeout cl_timeout_default;
63 const struct rpc_program *cl_program; 64 const struct rpc_program *cl_program;
64 char *cl_principal; /* target to authenticate to */
65}; 65};
66 66
67/* 67/*
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index aa5b582cc471..a353e0300b54 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -5,6 +5,26 @@
5 5
6#include <linux/workqueue.h> 6#include <linux/workqueue.h>
7 7
8struct rpc_pipe_dir_head {
9 struct list_head pdh_entries;
10 struct dentry *pdh_dentry;
11};
12
13struct rpc_pipe_dir_object_ops;
14struct rpc_pipe_dir_object {
15 struct list_head pdo_head;
16 const struct rpc_pipe_dir_object_ops *pdo_ops;
17
18 void *pdo_data;
19};
20
21struct rpc_pipe_dir_object_ops {
22 int (*create)(struct dentry *dir,
23 struct rpc_pipe_dir_object *pdo);
24 void (*destroy)(struct dentry *dir,
25 struct rpc_pipe_dir_object *pdo);
26};
27
8struct rpc_pipe_msg { 28struct rpc_pipe_msg {
9 struct list_head list; 29 struct list_head list;
10 void *data; 30 void *data;
@@ -74,7 +94,24 @@ extern int rpc_queue_upcall(struct rpc_pipe *, struct rpc_pipe_msg *);
74 94
75struct rpc_clnt; 95struct rpc_clnt;
76extern struct dentry *rpc_create_client_dir(struct dentry *, const char *, struct rpc_clnt *); 96extern struct dentry *rpc_create_client_dir(struct dentry *, const char *, struct rpc_clnt *);
77extern int rpc_remove_client_dir(struct dentry *); 97extern int rpc_remove_client_dir(struct rpc_clnt *);
98
99extern void rpc_init_pipe_dir_head(struct rpc_pipe_dir_head *pdh);
100extern void rpc_init_pipe_dir_object(struct rpc_pipe_dir_object *pdo,
101 const struct rpc_pipe_dir_object_ops *pdo_ops,
102 void *pdo_data);
103extern int rpc_add_pipe_dir_object(struct net *net,
104 struct rpc_pipe_dir_head *pdh,
105 struct rpc_pipe_dir_object *pdo);
106extern void rpc_remove_pipe_dir_object(struct net *net,
107 struct rpc_pipe_dir_head *pdh,
108 struct rpc_pipe_dir_object *pdo);
109extern struct rpc_pipe_dir_object *rpc_find_or_alloc_pipe_dir_object(
110 struct net *net,
111 struct rpc_pipe_dir_head *pdh,
112 int (*match)(struct rpc_pipe_dir_object *, void *),
113 struct rpc_pipe_dir_object *(*alloc)(void *),
114 void *data);
78 115
79struct cache_detail; 116struct cache_detail;
80extern struct dentry *rpc_create_cache_dir(struct dentry *, 117extern struct dentry *rpc_create_cache_dir(struct dentry *,
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 1821445708d6..096ee58be11a 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -79,7 +79,7 @@ struct rpc_task {
79 unsigned short tk_flags; /* misc flags */ 79 unsigned short tk_flags; /* misc flags */
80 unsigned short tk_timeouts; /* maj timeouts */ 80 unsigned short tk_timeouts; /* maj timeouts */
81 81
82#ifdef RPC_DEBUG 82#if defined(RPC_DEBUG) || defined(RPC_TRACEPOINTS)
83 unsigned short tk_pid; /* debugging aid */ 83 unsigned short tk_pid; /* debugging aid */
84#endif 84#endif
85 unsigned char tk_priority : 2,/* Task priority */ 85 unsigned char tk_priority : 2,/* Task priority */
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 1f0216b9a6c9..6eecfc2e4f98 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -243,7 +243,6 @@ struct svc_rqst {
243 struct xdr_buf rq_res; 243 struct xdr_buf rq_res;
244 struct page * rq_pages[RPCSVC_MAXPAGES]; 244 struct page * rq_pages[RPCSVC_MAXPAGES];
245 struct page * *rq_respages; /* points into rq_pages */ 245 struct page * *rq_respages; /* points into rq_pages */
246 int rq_resused; /* number of pages used for result */
247 struct page * *rq_next_page; /* next reply page to use */ 246 struct page * *rq_next_page; /* next reply page to use */
248 247
249 struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */ 248 struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index d95cde5e257d..46ba0c6c219f 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -182,6 +182,33 @@ enum {
182#define SWAP_MAP_SHMEM 0xbf /* Owned by shmem/tmpfs, in first swap_map */ 182#define SWAP_MAP_SHMEM 0xbf /* Owned by shmem/tmpfs, in first swap_map */
183 183
184/* 184/*
185 * We use this to track usage of a cluster. A cluster is a block of swap disk
186 * space with SWAPFILE_CLUSTER pages long and naturally aligns in disk. All
187 * free clusters are organized into a list. We fetch an entry from the list to
188 * get a free cluster.
189 *
190 * The data field stores next cluster if the cluster is free or cluster usage
191 * counter otherwise. The flags field determines if a cluster is free. This is
192 * protected by swap_info_struct.lock.
193 */
194struct swap_cluster_info {
195 unsigned int data:24;
196 unsigned int flags:8;
197};
198#define CLUSTER_FLAG_FREE 1 /* This cluster is free */
199#define CLUSTER_FLAG_NEXT_NULL 2 /* This cluster has no next cluster */
200
201/*
202 * We assign a cluster to each CPU, so each CPU can allocate swap entry from
203 * its own cluster and swapout sequentially. The purpose is to optimize swapout
204 * throughput.
205 */
206struct percpu_cluster {
207 struct swap_cluster_info index; /* Current cluster index */
208 unsigned int next; /* Likely next allocation offset */
209};
210
211/*
185 * The in-memory structure used to track swap areas. 212 * The in-memory structure used to track swap areas.
186 */ 213 */
187struct swap_info_struct { 214struct swap_info_struct {
@@ -191,14 +218,16 @@ struct swap_info_struct {
191 signed char next; /* next type on the swap list */ 218 signed char next; /* next type on the swap list */
192 unsigned int max; /* extent of the swap_map */ 219 unsigned int max; /* extent of the swap_map */
193 unsigned char *swap_map; /* vmalloc'ed array of usage counts */ 220 unsigned char *swap_map; /* vmalloc'ed array of usage counts */
221 struct swap_cluster_info *cluster_info; /* cluster info. Only for SSD */
222 struct swap_cluster_info free_cluster_head; /* free cluster list head */
223 struct swap_cluster_info free_cluster_tail; /* free cluster list tail */
194 unsigned int lowest_bit; /* index of first free in swap_map */ 224 unsigned int lowest_bit; /* index of first free in swap_map */
195 unsigned int highest_bit; /* index of last free in swap_map */ 225 unsigned int highest_bit; /* index of last free in swap_map */
196 unsigned int pages; /* total of usable pages of swap */ 226 unsigned int pages; /* total of usable pages of swap */
197 unsigned int inuse_pages; /* number of those currently in use */ 227 unsigned int inuse_pages; /* number of those currently in use */
198 unsigned int cluster_next; /* likely index for next allocation */ 228 unsigned int cluster_next; /* likely index for next allocation */
199 unsigned int cluster_nr; /* countdown to next cluster search */ 229 unsigned int cluster_nr; /* countdown to next cluster search */
200 unsigned int lowest_alloc; /* while preparing discard cluster */ 230 struct percpu_cluster __percpu *percpu_cluster; /* per cpu's swap location */
201 unsigned int highest_alloc; /* while preparing discard cluster */
202 struct swap_extent *curr_swap_extent; 231 struct swap_extent *curr_swap_extent;
203 struct swap_extent first_swap_extent; 232 struct swap_extent first_swap_extent;
204 struct block_device *bdev; /* swap device or bdev of swap file */ 233 struct block_device *bdev; /* swap device or bdev of swap file */
@@ -212,14 +241,18 @@ struct swap_info_struct {
212 * protect map scan related fields like 241 * protect map scan related fields like
213 * swap_map, lowest_bit, highest_bit, 242 * swap_map, lowest_bit, highest_bit,
214 * inuse_pages, cluster_next, 243 * inuse_pages, cluster_next,
215 * cluster_nr, lowest_alloc and 244 * cluster_nr, lowest_alloc,
216 * highest_alloc. other fields are only 245 * highest_alloc, free/discard cluster
217 * changed at swapon/swapoff, so are 246 * list. other fields are only changed
218 * protected by swap_lock. changing 247 * at swapon/swapoff, so are protected
219 * flags need hold this lock and 248 * by swap_lock. changing flags need
220 * swap_lock. If both locks need hold, 249 * hold this lock and swap_lock. If
221 * hold swap_lock first. 250 * both locks need hold, hold swap_lock
251 * first.
222 */ 252 */
253 struct work_struct discard_work; /* discard worker */
254 struct swap_cluster_info discard_cluster_head; /* list head of discard clusters */
255 struct swap_cluster_info discard_cluster_tail; /* list tail of discard clusters */
223}; 256};
224 257
225struct swap_list_t { 258struct swap_list_t {
@@ -247,7 +280,7 @@ extern void activate_page(struct page *);
247extern void mark_page_accessed(struct page *); 280extern void mark_page_accessed(struct page *);
248extern void lru_add_drain(void); 281extern void lru_add_drain(void);
249extern void lru_add_drain_cpu(int cpu); 282extern void lru_add_drain_cpu(int cpu);
250extern int lru_add_drain_all(void); 283extern void lru_add_drain_all(void);
251extern void rotate_reclaimable_page(struct page *page); 284extern void rotate_reclaimable_page(struct page *page);
252extern void deactivate_page(struct page *page); 285extern void deactivate_page(struct page *page);
253extern void swap_setup(void); 286extern void swap_setup(void);
@@ -414,6 +447,7 @@ mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout)
414 447
415#else /* CONFIG_SWAP */ 448#else /* CONFIG_SWAP */
416 449
450#define swap_address_space(entry) (NULL)
417#define get_nr_swap_pages() 0L 451#define get_nr_swap_pages() 0L
418#define total_swap_pages 0L 452#define total_swap_pages 0L
419#define total_swapcache_pages() 0UL 453#define total_swapcache_pages() 0UL
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 84662ecc7b51..7fac04e7ff6e 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -186,6 +186,7 @@ extern struct trace_event_functions exit_syscall_print_funcs;
186#define __SYSCALL_DEFINEx(x, name, ...) \ 186#define __SYSCALL_DEFINEx(x, name, ...) \
187 asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ 187 asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
188 static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ 188 static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
189 asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
189 asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ 190 asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
190 { \ 191 { \
191 long ret = SYSC##name(__MAP(x,__SC_CAST,__VA_ARGS__)); \ 192 long ret = SYSC##name(__MAP(x,__SC_CAST,__VA_ARGS__)); \
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 9e8a9b555ad6..11baec7c9b26 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -51,9 +51,9 @@ do { \
51 static struct lock_class_key __key; \ 51 static struct lock_class_key __key; \
52 \ 52 \
53 (attr)->key = &__key; \ 53 (attr)->key = &__key; \
54} while(0) 54} while (0)
55#else 55#else
56#define sysfs_attr_init(attr) do {} while(0) 56#define sysfs_attr_init(attr) do {} while (0)
57#endif 57#endif
58 58
59struct attribute_group { 59struct attribute_group {
@@ -69,7 +69,7 @@ struct attribute_group {
69 * for examples.. 69 * for examples..
70 */ 70 */
71 71
72#define __ATTR(_name,_mode,_show,_store) { \ 72#define __ATTR(_name, _mode, _show, _store) { \
73 .attr = {.name = __stringify(_name), .mode = _mode }, \ 73 .attr = {.name = __stringify(_name), .mode = _mode }, \
74 .show = _show, \ 74 .show = _show, \
75 .store = _store, \ 75 .store = _store, \
@@ -80,6 +80,11 @@ struct attribute_group {
80 .show = _name##_show, \ 80 .show = _name##_show, \
81} 81}
82 82
83#define __ATTR_WO(_name) { \
84 .attr = { .name = __stringify(_name), .mode = S_IWUSR }, \
85 .store = _name##_store, \
86}
87
83#define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO), \ 88#define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO), \
84 _name##_show, _name##_store) 89 _name##_show, _name##_store)
85 90
@@ -108,8 +113,6 @@ static const struct attribute_group _name##_group = { \
108}; \ 113}; \
109__ATTRIBUTE_GROUPS(_name) 114__ATTRIBUTE_GROUPS(_name)
110 115
111#define attr_name(_attr) (_attr).attr.name
112
113struct file; 116struct file;
114struct vm_area_struct; 117struct vm_area_struct;
115 118
@@ -119,7 +122,7 @@ struct bin_attribute {
119 void *private; 122 void *private;
120 ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *, 123 ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *,
121 char *, loff_t, size_t); 124 char *, loff_t, size_t);
122 ssize_t (*write)(struct file *,struct kobject *, struct bin_attribute *, 125 ssize_t (*write)(struct file *, struct kobject *, struct bin_attribute *,
123 char *, loff_t, size_t); 126 char *, loff_t, size_t);
124 int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr, 127 int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr,
125 struct vm_area_struct *vma); 128 struct vm_area_struct *vma);
@@ -153,7 +156,7 @@ struct bin_attribute {
153 156
154#define __BIN_ATTR_RW(_name, _size) __BIN_ATTR(_name, \ 157#define __BIN_ATTR_RW(_name, _size) __BIN_ATTR(_name, \
155 (S_IWUSR | S_IRUGO), _name##_read, \ 158 (S_IWUSR | S_IRUGO), _name##_read, \
156 _name##_write) 159 _name##_write, _size)
157 160
158#define __BIN_ATTR_NULL __ATTR_NULL 161#define __BIN_ATTR_NULL __ATTR_NULL
159 162
@@ -168,8 +171,8 @@ struct bin_attribute bin_attr_##_name = __BIN_ATTR_RO(_name, _size)
168struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size) 171struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size)
169 172
170struct sysfs_ops { 173struct sysfs_ops {
171 ssize_t (*show)(struct kobject *, struct attribute *,char *); 174 ssize_t (*show)(struct kobject *, struct attribute *, char *);
172 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); 175 ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t);
173 const void *(*namespace)(struct kobject *, const struct attribute *); 176 const void *(*namespace)(struct kobject *, const struct attribute *);
174}; 177};
175 178
@@ -215,10 +218,14 @@ void sysfs_delete_link(struct kobject *dir, struct kobject *targ,
215 218
216int __must_check sysfs_create_group(struct kobject *kobj, 219int __must_check sysfs_create_group(struct kobject *kobj,
217 const struct attribute_group *grp); 220 const struct attribute_group *grp);
221int __must_check sysfs_create_groups(struct kobject *kobj,
222 const struct attribute_group **groups);
218int sysfs_update_group(struct kobject *kobj, 223int sysfs_update_group(struct kobject *kobj,
219 const struct attribute_group *grp); 224 const struct attribute_group *grp);
220void sysfs_remove_group(struct kobject *kobj, 225void sysfs_remove_group(struct kobject *kobj,
221 const struct attribute_group *grp); 226 const struct attribute_group *grp);
227void sysfs_remove_groups(struct kobject *kobj,
228 const struct attribute_group **groups);
222int sysfs_add_file_to_group(struct kobject *kobj, 229int sysfs_add_file_to_group(struct kobject *kobj,
223 const struct attribute *attr, const char *group); 230 const struct attribute *attr, const char *group);
224void sysfs_remove_file_from_group(struct kobject *kobj, 231void sysfs_remove_file_from_group(struct kobject *kobj,
@@ -343,6 +350,12 @@ static inline int sysfs_create_group(struct kobject *kobj,
343 return 0; 350 return 0;
344} 351}
345 352
353static inline int sysfs_create_groups(struct kobject *kobj,
354 const struct attribute_group **groups)
355{
356 return 0;
357}
358
346static inline int sysfs_update_group(struct kobject *kobj, 359static inline int sysfs_update_group(struct kobject *kobj,
347 const struct attribute_group *grp) 360 const struct attribute_group *grp)
348{ 361{
@@ -354,6 +367,11 @@ static inline void sysfs_remove_group(struct kobject *kobj,
354{ 367{
355} 368}
356 369
370static inline void sysfs_remove_groups(struct kobject *kobj,
371 const struct attribute_group **groups)
372{
373}
374
357static inline int sysfs_add_file_to_group(struct kobject *kobj, 375static inline int sysfs_add_file_to_group(struct kobject *kobj,
358 const struct attribute *attr, const char *group) 376 const struct attribute *attr, const char *group)
359{ 377{
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 472120b4fac5..d68633452d9b 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -107,7 +107,6 @@ static inline void tcp_clear_options(struct tcp_options_received *rx_opt)
107 * only four options will fit in a standard TCP header */ 107 * only four options will fit in a standard TCP header */
108#define TCP_NUM_SACKS 4 108#define TCP_NUM_SACKS 4
109 109
110struct tcp_cookie_values;
111struct tcp_request_sock_ops; 110struct tcp_request_sock_ops;
112 111
113struct tcp_request_sock { 112struct tcp_request_sock {
@@ -238,6 +237,7 @@ struct tcp_sock {
238 237
239 u32 rcv_wnd; /* Current receiver window */ 238 u32 rcv_wnd; /* Current receiver window */
240 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ 239 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */
240 u32 notsent_lowat; /* TCP_NOTSENT_LOWAT */
241 u32 pushed_seq; /* Last pushed seq, required to talk to windows */ 241 u32 pushed_seq; /* Last pushed seq, required to talk to windows */
242 u32 lost_out; /* Lost packets */ 242 u32 lost_out; /* Lost packets */
243 u32 sacked_out; /* SACK'd packets */ 243 u32 sacked_out; /* SACK'd packets */
diff --git a/include/linux/tegra-cpuidle.h b/include/linux/tegra-cpuidle.h
new file mode 100644
index 000000000000..9c6286bbf662
--- /dev/null
+++ b/include/linux/tegra-cpuidle.h
@@ -0,0 +1,25 @@
1/*
2 * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 */
13
14#ifndef __LINUX_TEGRA_CPUIDLE_H__
15#define __LINUX_TEGRA_CPUIDLE_H__
16
17#ifdef CONFIG_CPU_IDLE
18void tegra_cpuidle_pcie_irqs_in_use(void);
19#else
20static inline void tegra_cpuidle_pcie_irqs_in_use(void)
21{
22}
23#endif
24
25#endif
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index a386a1cbb6e1..b268d3cf7ae3 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -207,6 +207,16 @@ struct thermal_bind_params {
207 * See Documentation/thermal/sysfs-api.txt for more information. 207 * See Documentation/thermal/sysfs-api.txt for more information.
208 */ 208 */
209 int trip_mask; 209 int trip_mask;
210
211 /*
212 * This is an array of cooling state limits. Must have exactly
213 * 2 * thermal_zone.number_of_trip_points. It is an array consisting
214 * of tuples <lower-state upper-state> of state limits. Each trip
215 * will be associated with one state limit tuple when binding.
216 * A NULL pointer means <THERMAL_NO_LIMITS THERMAL_NO_LIMITS>
217 * on all trips.
218 */
219 unsigned long *binding_limits;
210 int (*match) (struct thermal_zone_device *tz, 220 int (*match) (struct thermal_zone_device *tz,
211 struct thermal_cooling_device *cdev); 221 struct thermal_cooling_device *cdev);
212}; 222};
@@ -214,6 +224,14 @@ struct thermal_bind_params {
214/* Structure to define Thermal Zone parameters */ 224/* Structure to define Thermal Zone parameters */
215struct thermal_zone_params { 225struct thermal_zone_params {
216 char governor_name[THERMAL_NAME_LENGTH]; 226 char governor_name[THERMAL_NAME_LENGTH];
227
228 /*
229 * a boolean to indicate if the thermal to hwmon sysfs interface
230 * is required. when no_hwmon == false, a hwmon sysfs interface
231 * will be created. when no_hwmon == true, nothing will be done
232 */
233 bool no_hwmon;
234
217 int num_tbps; /* Number of tbp entries */ 235 int num_tbps; /* Number of tbp entries */
218 struct thermal_bind_params *tbp; 236 struct thermal_bind_params *tbp;
219}; 237};
diff --git a/include/linux/tick.h b/include/linux/tick.h
index 62bd8b72873c..5128d33bbb39 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -10,6 +10,8 @@
10#include <linux/irqflags.h> 10#include <linux/irqflags.h>
11#include <linux/percpu.h> 11#include <linux/percpu.h>
12#include <linux/hrtimer.h> 12#include <linux/hrtimer.h>
13#include <linux/context_tracking_state.h>
14#include <linux/cpumask.h>
13 15
14#ifdef CONFIG_GENERIC_CLOCKEVENTS 16#ifdef CONFIG_GENERIC_CLOCKEVENTS
15 17
@@ -158,20 +160,51 @@ static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; }
158# endif /* !CONFIG_NO_HZ_COMMON */ 160# endif /* !CONFIG_NO_HZ_COMMON */
159 161
160#ifdef CONFIG_NO_HZ_FULL 162#ifdef CONFIG_NO_HZ_FULL
163extern bool tick_nohz_full_running;
164extern cpumask_var_t tick_nohz_full_mask;
165
166static inline bool tick_nohz_full_enabled(void)
167{
168 if (!static_key_false(&context_tracking_enabled))
169 return false;
170
171 return tick_nohz_full_running;
172}
173
174static inline bool tick_nohz_full_cpu(int cpu)
175{
176 if (!tick_nohz_full_enabled())
177 return false;
178
179 return cpumask_test_cpu(cpu, tick_nohz_full_mask);
180}
181
161extern void tick_nohz_init(void); 182extern void tick_nohz_init(void);
162extern int tick_nohz_full_cpu(int cpu); 183extern void __tick_nohz_full_check(void);
163extern void tick_nohz_full_check(void);
164extern void tick_nohz_full_kick(void); 184extern void tick_nohz_full_kick(void);
165extern void tick_nohz_full_kick_all(void); 185extern void tick_nohz_full_kick_all(void);
166extern void tick_nohz_task_switch(struct task_struct *tsk); 186extern void __tick_nohz_task_switch(struct task_struct *tsk);
167#else 187#else
168static inline void tick_nohz_init(void) { } 188static inline void tick_nohz_init(void) { }
169static inline int tick_nohz_full_cpu(int cpu) { return 0; } 189static inline bool tick_nohz_full_enabled(void) { return false; }
170static inline void tick_nohz_full_check(void) { } 190static inline bool tick_nohz_full_cpu(int cpu) { return false; }
191static inline void __tick_nohz_full_check(void) { }
171static inline void tick_nohz_full_kick(void) { } 192static inline void tick_nohz_full_kick(void) { }
172static inline void tick_nohz_full_kick_all(void) { } 193static inline void tick_nohz_full_kick_all(void) { }
173static inline void tick_nohz_task_switch(struct task_struct *tsk) { } 194static inline void __tick_nohz_task_switch(struct task_struct *tsk) { }
174#endif 195#endif
175 196
197static inline void tick_nohz_full_check(void)
198{
199 if (tick_nohz_full_enabled())
200 __tick_nohz_full_check();
201}
202
203static inline void tick_nohz_task_switch(struct task_struct *tsk)
204{
205 if (tick_nohz_full_enabled())
206 __tick_nohz_task_switch(tsk);
207}
208
176 209
177#endif 210#endif
diff --git a/include/linux/time-armada-370-xp.h b/include/linux/time-armada-370-xp.h
deleted file mode 100644
index dfdfdc03115b..000000000000
--- a/include/linux/time-armada-370-xp.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * Marvell Armada 370/XP SoC timer handling.
3 *
4 * Copyright (C) 2012 Marvell
5 *
6 * Lior Amsalem <alior@marvell.com>
7 * Gregory CLEMENT <gregory.clement@free-electrons.com>
8 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
9 *
10 */
11#ifndef __TIME_ARMADA_370_XPPRCMU_H
12#define __TIME_ARMADA_370_XPPRCMU_H
13
14#include <linux/init.h>
15
16void __init armada_370_xp_timer_init(void);
17
18#endif
diff --git a/include/linux/timex.h b/include/linux/timex.h
index b3726e61368e..9d3f1a5b6178 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -64,6 +64,20 @@
64 64
65#include <asm/timex.h> 65#include <asm/timex.h>
66 66
67#ifndef random_get_entropy
68/*
69 * The random_get_entropy() function is used by the /dev/random driver
70 * in order to extract entropy via the relative unpredictability of
71 * when an interrupt takes places versus a high speed, fine-grained
72 * timing source or cycle counter. Since it will be occurred on every
73 * single interrupt, it must have a very low cost/overhead.
74 *
75 * By default we use get_cycles() for this purpose, but individual
76 * architectures may override this in their asm/timex.h header file.
77 */
78#define random_get_entropy() get_cycles()
79#endif
80
67/* 81/*
68 * SHIFT_PLL is used as a dampening factor to define how much we 82 * SHIFT_PLL is used as a dampening factor to define how much we
69 * adjust the frequency correction for a given offset in PLL mode. 83 * adjust the frequency correction for a given offset in PLL mode.
@@ -141,6 +155,7 @@ extern int do_adjtimex(struct timex *);
141extern void hardpps(const struct timespec *, const struct timespec *); 155extern void hardpps(const struct timespec *, const struct timespec *);
142 156
143int read_current_timer(unsigned long *timer_val); 157int read_current_timer(unsigned long *timer_val);
158void ntp_notify_cmos_timer(void);
144 159
145/* The clock frequency of the i8253/i8254 PIT */ 160/* The clock frequency of the i8253/i8254 PIT */
146#define PIT_TICK_RATE 1193182ul 161#define PIT_TICK_RATE 1193182ul
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 01ac30efd6a6..64f864651d86 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -10,6 +10,8 @@
10#include <linux/mutex.h> 10#include <linux/mutex.h>
11#include <linux/tty_flags.h> 11#include <linux/tty_flags.h>
12#include <uapi/linux/tty.h> 12#include <uapi/linux/tty.h>
13#include <linux/rwsem.h>
14#include <linux/llist.h>
13 15
14 16
15 17
@@ -29,9 +31,10 @@
29#define __DISABLED_CHAR '\0' 31#define __DISABLED_CHAR '\0'
30 32
31struct tty_buffer { 33struct tty_buffer {
32 struct tty_buffer *next; 34 union {
33 char *char_buf_ptr; 35 struct tty_buffer *next;
34 unsigned char *flag_buf_ptr; 36 struct llist_node free;
37 };
35 int used; 38 int used;
36 int size; 39 int size;
37 int commit; 40 int commit;
@@ -40,25 +43,25 @@ struct tty_buffer {
40 unsigned long data[0]; 43 unsigned long data[0];
41}; 44};
42 45
43/* 46static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs)
44 * We default to dicing tty buffer allocations to this many characters 47{
45 * in order to avoid multiple page allocations. We know the size of 48 return ((unsigned char *)b->data) + ofs;
46 * tty_buffer itself but it must also be taken into account that the 49}
47 * the buffer is 256 byte aligned. See tty_buffer_find for the allocation
48 * logic this must match
49 */
50
51#define TTY_BUFFER_PAGE (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~0xFF)
52 50
51static inline char *flag_buf_ptr(struct tty_buffer *b, int ofs)
52{
53 return (char *)char_buf_ptr(b, ofs) + b->size;
54}
53 55
54struct tty_bufhead { 56struct tty_bufhead {
55 struct work_struct work;
56 spinlock_t lock;
57 struct tty_buffer *head; /* Queue head */ 57 struct tty_buffer *head; /* Queue head */
58 struct work_struct work;
59 struct mutex lock;
60 atomic_t priority;
61 struct tty_buffer sentinel;
62 struct llist_head free; /* Free queue head */
63 atomic_t memory_used; /* In-use buffers excluding free list */
58 struct tty_buffer *tail; /* Active buffer */ 64 struct tty_buffer *tail; /* Active buffer */
59 struct tty_buffer *free; /* Free queue head */
60 int memory_used; /* Buffer space used excluding
61 free queue */
62}; 65};
63/* 66/*
64 * When a break, frame error, or parity error happens, these codes are 67 * When a break, frame error, or parity error happens, these codes are
@@ -199,9 +202,6 @@ struct tty_port {
199 wait_queue_head_t close_wait; /* Close waiters */ 202 wait_queue_head_t close_wait; /* Close waiters */
200 wait_queue_head_t delta_msr_wait; /* Modem status change */ 203 wait_queue_head_t delta_msr_wait; /* Modem status change */
201 unsigned long flags; /* TTY flags ASY_*/ 204 unsigned long flags; /* TTY flags ASY_*/
202 unsigned long iflags; /* TTYP_ internal flags */
203#define TTYP_FLUSHING 1 /* Flushing to ldisc in progress */
204#define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */
205 unsigned char console:1, /* port is a console */ 205 unsigned char console:1, /* port is a console */
206 low_latency:1; /* direct buffer flush */ 206 low_latency:1; /* direct buffer flush */
207 struct mutex mutex; /* Locking */ 207 struct mutex mutex; /* Locking */
@@ -238,14 +238,16 @@ struct tty_struct {
238 int index; 238 int index;
239 239
240 /* Protects ldisc changes: Lock tty not pty */ 240 /* Protects ldisc changes: Lock tty not pty */
241 struct mutex ldisc_mutex; 241 struct ld_semaphore ldisc_sem;
242 struct tty_ldisc *ldisc; 242 struct tty_ldisc *ldisc;
243 243
244 struct mutex atomic_write_lock; 244 struct mutex atomic_write_lock;
245 struct mutex legacy_mutex; 245 struct mutex legacy_mutex;
246 struct mutex termios_mutex; 246 struct mutex throttle_mutex;
247 struct rw_semaphore termios_rwsem;
248 struct mutex winsize_mutex;
247 spinlock_t ctrl_lock; 249 spinlock_t ctrl_lock;
248 /* Termios values are protected by the termios mutex */ 250 /* Termios values are protected by the termios rwsem */
249 struct ktermios termios, termios_locked; 251 struct ktermios termios, termios_locked;
250 struct termiox *termiox; /* May be NULL for unsupported */ 252 struct termiox *termiox; /* May be NULL for unsupported */
251 char name[64]; 253 char name[64];
@@ -253,7 +255,7 @@ struct tty_struct {
253 struct pid *session; 255 struct pid *session;
254 unsigned long flags; 256 unsigned long flags;
255 int count; 257 int count;
256 struct winsize winsize; /* termios mutex */ 258 struct winsize winsize; /* winsize_mutex */
257 unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; 259 unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1;
258 unsigned char ctrl_status; /* ctrl_lock */ 260 unsigned char ctrl_status; /* ctrl_lock */
259 unsigned int receive_room; /* Bytes free for queue */ 261 unsigned int receive_room; /* Bytes free for queue */
@@ -303,10 +305,7 @@ struct tty_file_private {
303#define TTY_EXCLUSIVE 3 /* Exclusive open mode */ 305#define TTY_EXCLUSIVE 3 /* Exclusive open mode */
304#define TTY_DEBUG 4 /* Debugging */ 306#define TTY_DEBUG 4 /* Debugging */
305#define TTY_DO_WRITE_WAKEUP 5 /* Call write_wakeup after queuing new */ 307#define TTY_DO_WRITE_WAKEUP 5 /* Call write_wakeup after queuing new */
306#define TTY_PUSH 6 /* n_tty private */
307#define TTY_CLOSING 7 /* ->close() in progress */ 308#define TTY_CLOSING 7 /* ->close() in progress */
308#define TTY_LDISC 9 /* Line discipline attached */
309#define TTY_LDISC_CHANGING 10 /* Line discipline changing */
310#define TTY_LDISC_OPEN 11 /* Line discipline is open */ 309#define TTY_LDISC_OPEN 11 /* Line discipline is open */
311#define TTY_PTY_LOCK 16 /* pty private */ 310#define TTY_PTY_LOCK 16 /* pty private */
312#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ 311#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */
@@ -559,6 +558,19 @@ extern void tty_ldisc_init(struct tty_struct *tty);
559extern void tty_ldisc_deinit(struct tty_struct *tty); 558extern void tty_ldisc_deinit(struct tty_struct *tty);
560extern void tty_ldisc_begin(void); 559extern void tty_ldisc_begin(void);
561 560
561static inline int tty_ldisc_receive_buf(struct tty_ldisc *ld, unsigned char *p,
562 char *f, int count)
563{
564 if (ld->ops->receive_buf2)
565 count = ld->ops->receive_buf2(ld->tty, p, f, count);
566 else {
567 count = min_t(int, count, ld->tty->receive_room);
568 if (count)
569 ld->ops->receive_buf(ld->tty, p, f, count);
570 }
571 return count;
572}
573
562 574
563/* n_tty.c */ 575/* n_tty.c */
564extern struct tty_ldisc_ops tty_ldisc_N_TTY; 576extern struct tty_ldisc_ops tty_ldisc_N_TTY;
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index e0f252633b47..21ddd7d9ea1f 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_TTY_FLIP_H 1#ifndef _LINUX_TTY_FLIP_H
2#define _LINUX_TTY_FLIP_H 2#define _LINUX_TTY_FLIP_H
3 3
4extern int tty_buffer_space_avail(struct tty_port *port);
4extern int tty_buffer_request_room(struct tty_port *port, size_t size); 5extern int tty_buffer_request_room(struct tty_port *port, size_t size);
5extern int tty_insert_flip_string_flags(struct tty_port *port, 6extern int tty_insert_flip_string_flags(struct tty_port *port,
6 const unsigned char *chars, const char *flags, size_t size); 7 const unsigned char *chars, const char *flags, size_t size);
@@ -18,8 +19,8 @@ static inline int tty_insert_flip_char(struct tty_port *port,
18{ 19{
19 struct tty_buffer *tb = port->buf.tail; 20 struct tty_buffer *tb = port->buf.tail;
20 if (tb && tb->used < tb->size) { 21 if (tb && tb->used < tb->size) {
21 tb->flag_buf_ptr[tb->used] = flag; 22 *flag_buf_ptr(tb, tb->used) = flag;
22 tb->char_buf_ptr[tb->used++] = ch; 23 *char_buf_ptr(tb, tb->used++) = ch;
23 return 1; 24 return 1;
24 } 25 }
25 return tty_insert_flip_string_flags(port, &ch, &flag, 1); 26 return tty_insert_flip_string_flags(port, &ch, &flag, 1);
@@ -31,4 +32,7 @@ static inline int tty_insert_flip_string(struct tty_port *port,
31 return tty_insert_flip_string_fixed_flag(port, chars, TTY_NORMAL, size); 32 return tty_insert_flip_string_fixed_flag(port, chars, TTY_NORMAL, size);
32} 33}
33 34
35extern void tty_buffer_lock_exclusive(struct tty_port *port);
36extern void tty_buffer_unlock_exclusive(struct tty_port *port);
37
34#endif /* _LINUX_TTY_FLIP_H */ 38#endif /* _LINUX_TTY_FLIP_H */
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index a1b048999821..f15c898ff462 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -109,6 +109,17 @@
109 * 109 *
110 * Tells the discipline that the DCD pin has changed its status. 110 * Tells the discipline that the DCD pin has changed its status.
111 * Used exclusively by the N_PPS (Pulse-Per-Second) line discipline. 111 * Used exclusively by the N_PPS (Pulse-Per-Second) line discipline.
112 *
113 * int (*receive_buf2)(struct tty_struct *, const unsigned char *cp,
114 * char *fp, int count);
115 *
116 * This function is called by the low-level tty driver to send
117 * characters received by the hardware to the line discpline for
118 * processing. <cp> is a pointer to the buffer of input
119 * character received by the device. <fp> is a pointer to a
120 * pointer of flag bytes which indicate whether a character was
121 * received with a parity error, etc.
122 * If assigned, prefer this function for automatic flow control.
112 */ 123 */
113 124
114#include <linux/fs.h> 125#include <linux/fs.h>
@@ -195,6 +206,8 @@ struct tty_ldisc_ops {
195 void (*write_wakeup)(struct tty_struct *); 206 void (*write_wakeup)(struct tty_struct *);
196 void (*dcd_change)(struct tty_struct *, unsigned int); 207 void (*dcd_change)(struct tty_struct *, unsigned int);
197 void (*fasync)(struct tty_struct *tty, int on); 208 void (*fasync)(struct tty_struct *tty, int on);
209 int (*receive_buf2)(struct tty_struct *, const unsigned char *cp,
210 char *fp, int count);
198 211
199 struct module *owner; 212 struct module *owner;
200 213
@@ -203,8 +216,7 @@ struct tty_ldisc_ops {
203 216
204struct tty_ldisc { 217struct tty_ldisc {
205 struct tty_ldisc_ops *ops; 218 struct tty_ldisc_ops *ops;
206 atomic_t users; 219 struct tty_struct *tty;
207 wait_queue_head_t wq_idle;
208}; 220};
209 221
210#define TTY_LDISC_MAGIC 0x5403 222#define TTY_LDISC_MAGIC 0x5403
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 0eec2689b955..001629cd1a97 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -337,6 +337,7 @@ struct usb_bus {
337 * the ep queue on a short transfer 337 * the ep queue on a short transfer
338 * with the URB_SHORT_NOT_OK flag set. 338 * with the URB_SHORT_NOT_OK flag set.
339 */ 339 */
340 unsigned no_sg_constraint:1; /* no sg constraint */
340 unsigned sg_tablesize; /* 0 or largest number of sg list entries */ 341 unsigned sg_tablesize; /* 0 or largest number of sg list entries */
341 342
342 int devnum_next; /* Next open device number in 343 int devnum_next; /* Next open device number in
@@ -684,6 +685,11 @@ static inline bool usb_device_supports_ltm(struct usb_device *udev)
684 return udev->bos->ss_cap->bmAttributes & USB_LTM_SUPPORT; 685 return udev->bos->ss_cap->bmAttributes & USB_LTM_SUPPORT;
685} 686}
686 687
688static inline bool usb_device_no_sg_constraint(struct usb_device *udev)
689{
690 return udev && udev->bus && udev->bus->no_sg_constraint;
691}
692
687 693
688/*-------------------------------------------------------------------------*/ 694/*-------------------------------------------------------------------------*/
689 695
@@ -708,7 +714,10 @@ extern int usb_driver_claim_interface(struct usb_driver *driver,
708 * usb_interface_claimed - returns true iff an interface is claimed 714 * usb_interface_claimed - returns true iff an interface is claimed
709 * @iface: the interface being checked 715 * @iface: the interface being checked
710 * 716 *
711 * Returns true (nonzero) iff the interface is claimed, else false (zero). 717 * Return: %true (nonzero) iff the interface is claimed, else %false
718 * (zero).
719 *
720 * Note:
712 * Callers must own the driver model's usb bus readlock. So driver 721 * Callers must own the driver model's usb bus readlock. So driver
713 * probe() entries don't need extra locking, but other call contexts 722 * probe() entries don't need extra locking, but other call contexts
714 * may need to explicitly claim that lock. 723 * may need to explicitly claim that lock.
@@ -745,8 +754,9 @@ extern struct usb_host_interface *usb_find_alt_setting(
745 * @buf: where to put the string 754 * @buf: where to put the string
746 * @size: how big is "buf"? 755 * @size: how big is "buf"?
747 * 756 *
748 * Returns length of the string (> 0) or negative if size was too small. 757 * Return: Length of the string (> 0) or negative if size was too small.
749 * 758 *
759 * Note:
750 * This identifier is intended to be "stable", reflecting physical paths in 760 * This identifier is intended to be "stable", reflecting physical paths in
751 * hardware such as physical bus addresses for host controllers or ports on 761 * hardware such as physical bus addresses for host controllers or ports on
752 * USB hubs. That makes it stay the same until systems are physically 762 * USB hubs. That makes it stay the same until systems are physically
@@ -1247,7 +1257,9 @@ typedef void (*usb_complete_t)(struct urb *);
1247 * the device driver is saying that it provided this DMA address, 1257 * the device driver is saying that it provided this DMA address,
1248 * which the host controller driver should use in preference to the 1258 * which the host controller driver should use in preference to the
1249 * transfer_buffer. 1259 * transfer_buffer.
1250 * @sg: scatter gather buffer list 1260 * @sg: scatter gather buffer list, the buffer size of each element in
1261 * the list (except the last) must be divisible by the endpoint's
1262 * max packet size if no_sg_constraint isn't set in 'struct usb_bus'
1251 * @num_mapped_sgs: (internal) number of mapped sg entries 1263 * @num_mapped_sgs: (internal) number of mapped sg entries
1252 * @num_sgs: number of entries in the sg list 1264 * @num_sgs: number of entries in the sg list
1253 * @transfer_buffer_length: How big is transfer_buffer. The transfer may 1265 * @transfer_buffer_length: How big is transfer_buffer. The transfer may
@@ -1534,10 +1546,16 @@ static inline void usb_fill_int_urb(struct urb *urb,
1534 urb->transfer_buffer_length = buffer_length; 1546 urb->transfer_buffer_length = buffer_length;
1535 urb->complete = complete_fn; 1547 urb->complete = complete_fn;
1536 urb->context = context; 1548 urb->context = context;
1537 if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) 1549
1550 if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) {
1551 /* make sure interval is within allowed range */
1552 interval = clamp(interval, 1, 16);
1553
1538 urb->interval = 1 << (interval - 1); 1554 urb->interval = 1 << (interval - 1);
1539 else 1555 } else {
1540 urb->interval = interval; 1556 urb->interval = interval;
1557 }
1558
1541 urb->start_frame = -1; 1559 urb->start_frame = -1;
1542} 1560}
1543 1561
@@ -1570,7 +1588,7 @@ extern int usb_anchor_empty(struct usb_anchor *anchor);
1570 * usb_urb_dir_in - check if an URB describes an IN transfer 1588 * usb_urb_dir_in - check if an URB describes an IN transfer
1571 * @urb: URB to be checked 1589 * @urb: URB to be checked
1572 * 1590 *
1573 * Returns 1 if @urb describes an IN transfer (device-to-host), 1591 * Return: 1 if @urb describes an IN transfer (device-to-host),
1574 * otherwise 0. 1592 * otherwise 0.
1575 */ 1593 */
1576static inline int usb_urb_dir_in(struct urb *urb) 1594static inline int usb_urb_dir_in(struct urb *urb)
@@ -1582,7 +1600,7 @@ static inline int usb_urb_dir_in(struct urb *urb)
1582 * usb_urb_dir_out - check if an URB describes an OUT transfer 1600 * usb_urb_dir_out - check if an URB describes an OUT transfer
1583 * @urb: URB to be checked 1601 * @urb: URB to be checked
1584 * 1602 *
1585 * Returns 1 if @urb describes an OUT transfer (host-to-device), 1603 * Return: 1 if @urb describes an OUT transfer (host-to-device),
1586 * otherwise 0. 1604 * otherwise 0.
1587 */ 1605 */
1588static inline int usb_urb_dir_out(struct urb *urb) 1606static inline int usb_urb_dir_out(struct urb *urb)
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index 25629948c842..7d399671a566 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -18,12 +18,17 @@ struct ci_hdrc_platform_data {
18 unsigned long flags; 18 unsigned long flags;
19#define CI_HDRC_REGS_SHARED BIT(0) 19#define CI_HDRC_REGS_SHARED BIT(0)
20#define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1) 20#define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1)
21#define CI_HDRC_PULLUP_ON_VBUS BIT(2)
22#define CI_HDRC_DISABLE_STREAMING BIT(3) 21#define CI_HDRC_DISABLE_STREAMING BIT(3)
22 /*
23 * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1,
24 * but otg is not supported (no register otgsc).
25 */
26#define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4)
23 enum usb_dr_mode dr_mode; 27 enum usb_dr_mode dr_mode;
24#define CI_HDRC_CONTROLLER_RESET_EVENT 0 28#define CI_HDRC_CONTROLLER_RESET_EVENT 0
25#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 29#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
26 void (*notify_event) (struct ci_hdrc *ci, unsigned event); 30 void (*notify_event) (struct ci_hdrc *ci, unsigned event);
31 struct regulator *reg_vbus;
27}; 32};
28 33
29/* Default offset of capability registers */ 34/* Default offset of capability registers */
diff --git a/include/linux/usb/dwc3-omap.h b/include/linux/usb/dwc3-omap.h
deleted file mode 100644
index 5615f4d82724..000000000000
--- a/include/linux/usb/dwc3-omap.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Copyright (C) 2013 by Texas Instruments
3 *
4 * The Inventra Controller Driver for Linux is free software; you
5 * can redistribute it and/or modify it under the terms of the GNU
6 * General Public License version 2 as published by the Free Software
7 * Foundation.
8 */
9
10#ifndef __DWC3_OMAP_H__
11#define __DWC3_OMAP_H__
12
13enum omap_dwc3_vbus_id_status {
14 OMAP_DWC3_UNKNOWN = 0,
15 OMAP_DWC3_ID_GROUND,
16 OMAP_DWC3_ID_FLOAT,
17 OMAP_DWC3_VBUS_VALID,
18 OMAP_DWC3_VBUS_OFF,
19};
20
21#if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE))
22extern int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status);
23#else
24static inline int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status)
25{
26 return -ENODEV;
27}
28#endif
29
30#endif /* __DWC3_OMAP_H__ */
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index f1b0dca60f12..942ef5e053bf 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -22,6 +22,7 @@
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/scatterlist.h> 23#include <linux/scatterlist.h>
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/workqueue.h>
25#include <linux/usb/ch9.h> 26#include <linux/usb/ch9.h>
26 27
27struct usb_ep; 28struct usb_ep;
@@ -475,6 +476,7 @@ struct usb_gadget_ops {
475 476
476/** 477/**
477 * struct usb_gadget - represents a usb slave device 478 * struct usb_gadget - represents a usb slave device
479 * @work: (internal use) Workqueue to be used for sysfs_notify()
478 * @ops: Function pointers used to access hardware-specific operations. 480 * @ops: Function pointers used to access hardware-specific operations.
479 * @ep0: Endpoint zero, used when reading or writing responses to 481 * @ep0: Endpoint zero, used when reading or writing responses to
480 * driver setup() requests 482 * driver setup() requests
@@ -520,6 +522,7 @@ struct usb_gadget_ops {
520 * device is acting as a B-Peripheral (so is_a_peripheral is false). 522 * device is acting as a B-Peripheral (so is_a_peripheral is false).
521 */ 523 */
522struct usb_gadget { 524struct usb_gadget {
525 struct work_struct work;
523 /* readonly to gadget driver */ 526 /* readonly to gadget driver */
524 const struct usb_gadget_ops *ops; 527 const struct usb_gadget_ops *ops;
525 struct usb_ep *ep0; 528 struct usb_ep *ep0;
@@ -538,6 +541,7 @@ struct usb_gadget {
538 unsigned out_epnum; 541 unsigned out_epnum;
539 unsigned in_epnum; 542 unsigned in_epnum;
540}; 543};
544#define work_to_gadget(w) (container_of((w), struct usb_gadget, work))
541 545
542static inline void set_gadget_data(struct usb_gadget *gadget, void *data) 546static inline void set_gadget_data(struct usb_gadget *gadget, void *data)
543 { dev_set_drvdata(&gadget->dev, data); } 547 { dev_set_drvdata(&gadget->dev, data); }
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 1e88377e22f4..75efc45eaa2f 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -22,6 +22,7 @@
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23 23
24#include <linux/rwsem.h> 24#include <linux/rwsem.h>
25#include <linux/interrupt.h>
25 26
26#define MAX_TOPO_LEVEL 6 27#define MAX_TOPO_LEVEL 6
27 28
@@ -67,6 +68,13 @@
67 68
68/*-------------------------------------------------------------------------*/ 69/*-------------------------------------------------------------------------*/
69 70
71struct giveback_urb_bh {
72 bool running;
73 spinlock_t lock;
74 struct list_head head;
75 struct tasklet_struct bh;
76};
77
70struct usb_hcd { 78struct usb_hcd {
71 79
72 /* 80 /*
@@ -139,6 +147,9 @@ struct usb_hcd {
139 resource_size_t rsrc_len; /* memory/io resource length */ 147 resource_size_t rsrc_len; /* memory/io resource length */
140 unsigned power_budget; /* in mA, 0 = no limit */ 148 unsigned power_budget; /* in mA, 0 = no limit */
141 149
150 struct giveback_urb_bh high_prio_bh;
151 struct giveback_urb_bh low_prio_bh;
152
142 /* bandwidth_mutex should be taken before adding or removing 153 /* bandwidth_mutex should be taken before adding or removing
143 * any new bus bandwidth constraints: 154 * any new bus bandwidth constraints:
144 * 1. Before adding a configuration for a new device. 155 * 1. Before adding a configuration for a new device.
@@ -221,6 +232,7 @@ struct hc_driver {
221#define HCD_USB25 0x0030 /* Wireless USB 1.0 (USB 2.5)*/ 232#define HCD_USB25 0x0030 /* Wireless USB 1.0 (USB 2.5)*/
222#define HCD_USB3 0x0040 /* USB 3.0 */ 233#define HCD_USB3 0x0040 /* USB 3.0 */
223#define HCD_MASK 0x0070 234#define HCD_MASK 0x0070
235#define HCD_BH 0x0100 /* URB complete in BH context */
224 236
225 /* called to init HCD and root hub */ 237 /* called to init HCD and root hub */
226 int (*reset) (struct usb_hcd *hcd); 238 int (*reset) (struct usb_hcd *hcd);
@@ -361,6 +373,11 @@ struct hc_driver {
361 int (*find_raw_port_number)(struct usb_hcd *, int); 373 int (*find_raw_port_number)(struct usb_hcd *, int);
362}; 374};
363 375
376static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd)
377{
378 return hcd->driver->flags & HCD_BH;
379}
380
364extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); 381extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
365extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb, 382extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb,
366 int status); 383 int status);
@@ -411,7 +428,7 @@ extern int usb_hcd_pci_probe(struct pci_dev *dev,
411extern void usb_hcd_pci_remove(struct pci_dev *dev); 428extern void usb_hcd_pci_remove(struct pci_dev *dev);
412extern void usb_hcd_pci_shutdown(struct pci_dev *dev); 429extern void usb_hcd_pci_shutdown(struct pci_dev *dev);
413 430
414#ifdef CONFIG_PM_SLEEP 431#ifdef CONFIG_PM
415extern const struct dev_pm_ops usb_hcd_pci_pm_ops; 432extern const struct dev_pm_ops usb_hcd_pci_pm_ops;
416#endif 433#endif
417#endif /* CONFIG_PCI */ 434#endif /* CONFIG_PCI */
diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h
index a0ef405368b8..8c38aa26b3bb 100644
--- a/include/linux/usb/of.h
+++ b/include/linux/usb/of.h
@@ -7,19 +7,27 @@
7#ifndef __LINUX_USB_OF_H 7#ifndef __LINUX_USB_OF_H
8#define __LINUX_USB_OF_H 8#define __LINUX_USB_OF_H
9 9
10#include <linux/usb/ch9.h>
10#include <linux/usb/otg.h> 11#include <linux/usb/otg.h>
11#include <linux/usb/phy.h> 12#include <linux/usb/phy.h>
12 13
13#if IS_ENABLED(CONFIG_OF) 14#if IS_ENABLED(CONFIG_OF)
14enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np); 15enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np);
16enum usb_device_speed of_usb_get_maximum_speed(struct device_node *np);
15#else 17#else
16static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np) 18static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np)
17{ 19{
18 return USB_DR_MODE_UNKNOWN; 20 return USB_DR_MODE_UNKNOWN;
19} 21}
22
23static inline enum usb_device_speed
24of_usb_get_maximum_speed(struct device_node *np)
25{
26 return USB_SPEED_UNKNOWN;
27}
20#endif 28#endif
21 29
22#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_PHY) 30#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_SUPPORT)
23enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np); 31enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np);
24#else 32#else
25static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np) 33static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np)
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 44036808bf0f..6c0b1c513db7 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -142,7 +142,7 @@ extern void usb_remove_phy(struct usb_phy *);
142/* helpers for direct access thru low-level io interface */ 142/* helpers for direct access thru low-level io interface */
143static inline int usb_phy_io_read(struct usb_phy *x, u32 reg) 143static inline int usb_phy_io_read(struct usb_phy *x, u32 reg)
144{ 144{
145 if (x->io_ops && x->io_ops->read) 145 if (x && x->io_ops && x->io_ops->read)
146 return x->io_ops->read(x, reg); 146 return x->io_ops->read(x, reg);
147 147
148 return -EINVAL; 148 return -EINVAL;
@@ -150,7 +150,7 @@ static inline int usb_phy_io_read(struct usb_phy *x, u32 reg)
150 150
151static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg) 151static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg)
152{ 152{
153 if (x->io_ops && x->io_ops->write) 153 if (x && x->io_ops && x->io_ops->write)
154 return x->io_ops->write(x, val, reg); 154 return x->io_ops->write(x, val, reg);
155 155
156 return -EINVAL; 156 return -EINVAL;
@@ -159,7 +159,7 @@ static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg)
159static inline int 159static inline int
160usb_phy_init(struct usb_phy *x) 160usb_phy_init(struct usb_phy *x)
161{ 161{
162 if (x->init) 162 if (x && x->init)
163 return x->init(x); 163 return x->init(x);
164 164
165 return 0; 165 return 0;
@@ -168,14 +168,14 @@ usb_phy_init(struct usb_phy *x)
168static inline void 168static inline void
169usb_phy_shutdown(struct usb_phy *x) 169usb_phy_shutdown(struct usb_phy *x)
170{ 170{
171 if (x->shutdown) 171 if (x && x->shutdown)
172 x->shutdown(x); 172 x->shutdown(x);
173} 173}
174 174
175static inline int 175static inline int
176usb_phy_vbus_on(struct usb_phy *x) 176usb_phy_vbus_on(struct usb_phy *x)
177{ 177{
178 if (!x->set_vbus) 178 if (!x || !x->set_vbus)
179 return 0; 179 return 0;
180 180
181 return x->set_vbus(x, true); 181 return x->set_vbus(x, true);
@@ -184,7 +184,7 @@ usb_phy_vbus_on(struct usb_phy *x)
184static inline int 184static inline int
185usb_phy_vbus_off(struct usb_phy *x) 185usb_phy_vbus_off(struct usb_phy *x)
186{ 186{
187 if (!x->set_vbus) 187 if (!x || !x->set_vbus)
188 return 0; 188 return 0;
189 189
190 return x->set_vbus(x, false); 190 return x->set_vbus(x, false);
@@ -258,7 +258,7 @@ usb_phy_set_power(struct usb_phy *x, unsigned mA)
258static inline int 258static inline int
259usb_phy_set_suspend(struct usb_phy *x, int suspend) 259usb_phy_set_suspend(struct usb_phy *x, int suspend)
260{ 260{
261 if (x->set_suspend != NULL) 261 if (x && x->set_suspend != NULL)
262 return x->set_suspend(x, suspend); 262 return x->set_suspend(x, suspend);
263 else 263 else
264 return 0; 264 return 0;
@@ -267,7 +267,7 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
267static inline int 267static inline int
268usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed) 268usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
269{ 269{
270 if (x->notify_connect) 270 if (x && x->notify_connect)
271 return x->notify_connect(x, speed); 271 return x->notify_connect(x, speed);
272 else 272 else
273 return 0; 273 return 0;
@@ -276,7 +276,7 @@ usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
276static inline int 276static inline int
277usb_phy_notify_disconnect(struct usb_phy *x, enum usb_device_speed speed) 277usb_phy_notify_disconnect(struct usb_phy *x, enum usb_device_speed speed)
278{ 278{
279 if (x->notify_disconnect) 279 if (x && x->notify_disconnect)
280 return x->notify_disconnect(x, speed); 280 return x->notify_disconnect(x, speed);
281 else 281 else
282 return 0; 282 return 0;
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h
index d2ca919a5b73..1de16c324ec8 100644
--- a/include/linux/usb/tegra_usb_phy.h
+++ b/include/linux/usb/tegra_usb_phy.h
@@ -18,19 +18,36 @@
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/usb/otg.h> 19#include <linux/usb/otg.h>
20 20
21/*
22 * utmi_pll_config_in_car_module: true if the UTMI PLL configuration registers
23 * should be set up by clk-tegra, false if by the PHY code
24 * has_hostpc: true if the USB controller has the HOSTPC extension, which
25 * changes the location of the PHCD and PTS fields
26 * requires_usbmode_setup: true if the USBMODE register needs to be set to
27 * enter host mode
28 * requires_extra_tuning_parameters: true if xcvr_hsslew, hssquelch_level
29 * and hsdiscon_level should be set for adequate signal quality
30 */
31
32struct tegra_phy_soc_config {
33 bool utmi_pll_config_in_car_module;
34 bool has_hostpc;
35 bool requires_usbmode_setup;
36 bool requires_extra_tuning_parameters;
37};
38
21struct tegra_utmip_config { 39struct tegra_utmip_config {
22 u8 hssync_start_delay; 40 u8 hssync_start_delay;
23 u8 elastic_limit; 41 u8 elastic_limit;
24 u8 idle_wait_delay; 42 u8 idle_wait_delay;
25 u8 term_range_adj; 43 u8 term_range_adj;
44 bool xcvr_setup_use_fuses;
26 u8 xcvr_setup; 45 u8 xcvr_setup;
27 u8 xcvr_lsfslew; 46 u8 xcvr_lsfslew;
28 u8 xcvr_lsrslew; 47 u8 xcvr_lsrslew;
29}; 48 u8 xcvr_hsslew;
30 49 u8 hssquelch_level;
31struct tegra_ulpi_config { 50 u8 hsdiscon_level;
32 int reset_gpio;
33 const char *clk;
34}; 51};
35 52
36enum tegra_usb_phy_port_speed { 53enum tegra_usb_phy_port_speed {
@@ -39,12 +56,6 @@ enum tegra_usb_phy_port_speed {
39 TEGRA_USB_PHY_PORT_SPEED_HIGH, 56 TEGRA_USB_PHY_PORT_SPEED_HIGH,
40}; 57};
41 58
42enum tegra_usb_phy_mode {
43 TEGRA_USB_PHY_MODE_DEVICE,
44 TEGRA_USB_PHY_MODE_HOST,
45 TEGRA_USB_PHY_MODE_OTG,
46};
47
48struct tegra_xtal_freq; 59struct tegra_xtal_freq;
49 60
50struct tegra_usb_phy { 61struct tegra_usb_phy {
@@ -55,18 +66,17 @@ struct tegra_usb_phy {
55 struct clk *clk; 66 struct clk *clk;
56 struct clk *pll_u; 67 struct clk *pll_u;
57 struct clk *pad_clk; 68 struct clk *pad_clk;
58 enum tegra_usb_phy_mode mode; 69 struct regulator *vbus;
70 enum usb_dr_mode mode;
59 void *config; 71 void *config;
72 const struct tegra_phy_soc_config *soc_config;
60 struct usb_phy *ulpi; 73 struct usb_phy *ulpi;
61 struct usb_phy u_phy; 74 struct usb_phy u_phy;
62 struct device *dev;
63 bool is_legacy_phy; 75 bool is_legacy_phy;
64 bool is_ulpi_phy; 76 bool is_ulpi_phy;
65 int reset_gpio; 77 int reset_gpio;
66}; 78};
67 79
68struct usb_phy *tegra_usb_get_phy(struct device_node *dn);
69
70void tegra_usb_phy_preresume(struct usb_phy *phy); 80void tegra_usb_phy_preresume(struct usb_phy *phy);
71 81
72void tegra_usb_phy_postresume(struct usb_phy *phy); 82void tegra_usb_phy_postresume(struct usb_phy *phy);
diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/usb_phy_gen_xceiv.h
index 148d35171aac..11d85b9c1b08 100644
--- a/include/linux/usb/nop-usb-xceiv.h
+++ b/include/linux/usb/usb_phy_gen_xceiv.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/usb/otg.h> 4#include <linux/usb/otg.h>
5 5
6struct nop_usb_xceiv_platform_data { 6struct usb_phy_gen_xceiv_platform_data {
7 enum usb_phy_type type; 7 enum usb_phy_type type;
8 unsigned long clk_rate; 8 unsigned long clk_rate;
9 9
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index f18d64129f99..e303eef94dd5 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -34,12 +34,15 @@ struct usbnet {
34 struct mutex phy_mutex; 34 struct mutex phy_mutex;
35 unsigned char suspend_count; 35 unsigned char suspend_count;
36 unsigned char pkt_cnt, pkt_err; 36 unsigned char pkt_cnt, pkt_err;
37 unsigned short rx_qlen, tx_qlen;
38 unsigned can_dma_sg:1;
37 39
38 /* i/o info: pipes etc */ 40 /* i/o info: pipes etc */
39 unsigned in, out; 41 unsigned in, out;
40 struct usb_host_endpoint *status; 42 struct usb_host_endpoint *status;
41 unsigned maxpacket; 43 unsigned maxpacket;
42 struct timer_list delay; 44 struct timer_list delay;
45 const char *padding_pkt;
43 46
44 /* protocol/interface state */ 47 /* protocol/interface state */
45 struct net_device *net; 48 struct net_device *net;
@@ -253,4 +256,6 @@ extern void usbnet_link_change(struct usbnet *, bool, bool);
253extern int usbnet_status_start(struct usbnet *dev, gfp_t mem_flags); 256extern int usbnet_status_start(struct usbnet *dev, gfp_t mem_flags);
254extern void usbnet_status_stop(struct usbnet *dev); 257extern void usbnet_status_stop(struct usbnet *dev);
255 258
259extern void usbnet_update_max_qlen(struct usbnet *dev);
260
256#endif /* __LINUX_USB_USBNET_H */ 261#endif /* __LINUX_USB_USBNET_H */
diff --git a/include/linux/usb/wusb-wa.h b/include/linux/usb/wusb-wa.h
index 6be985b2a434..4ff744e2b678 100644
--- a/include/linux/usb/wusb-wa.h
+++ b/include/linux/usb/wusb-wa.h
@@ -66,6 +66,7 @@ enum {
66 WA_ENABLE = 0x01, 66 WA_ENABLE = 0x01,
67 WA_RESET = 0x02, 67 WA_RESET = 0x02,
68 RPIPE_PAUSE = 0x1, 68 RPIPE_PAUSE = 0x1,
69 RPIPE_STALL = 0x2,
69}; 70};
70 71
71/* Responses from Get Status request ([WUSB] section 8.3.1.6) */ 72/* Responses from Get Status request ([WUSB] section 8.3.1.6) */
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index bf99cd01be20..630356866030 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -66,7 +66,9 @@
66 US_FLAG(INITIAL_READ10, 0x00100000) \ 66 US_FLAG(INITIAL_READ10, 0x00100000) \
67 /* Initial READ(10) (and others) must be retried */ \ 67 /* Initial READ(10) (and others) must be retried */ \
68 US_FLAG(WRITE_CACHE, 0x00200000) \ 68 US_FLAG(WRITE_CACHE, 0x00200000) \
69 /* Write Cache status is not available */ 69 /* Write Cache status is not available */ \
70 US_FLAG(NEEDS_CAP16, 0x00400000)
71 /* cannot handle READ_CAPACITY_10 */
70 72
71#define US_FLAG(name, value) US_FL_##name = value , 73#define US_FLAG(name, value) US_FL_##name = value ,
72enum { US_DO_ALL_FLAGS }; 74enum { US_DO_ALL_FLAGS };
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index 14105c26a836..4db29859464f 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -27,8 +27,6 @@ struct user_namespace {
27 kuid_t owner; 27 kuid_t owner;
28 kgid_t group; 28 kgid_t group;
29 unsigned int proc_inum; 29 unsigned int proc_inum;
30 bool may_mount_sysfs;
31 bool may_mount_proc;
32}; 30};
33 31
34extern struct user_namespace init_user_ns; 32extern struct user_namespace init_user_ns;
@@ -85,6 +83,4 @@ static inline void put_user_ns(struct user_namespace *ns)
85 83
86#endif 84#endif
87 85
88void update_mnt_policy(struct user_namespace *userns);
89
90#endif /* _LINUX_USER_H */ 86#endif /* _LINUX_USER_H */
diff --git a/include/linux/uwb/spec.h b/include/linux/uwb/spec.h
index b52e44f1bd33..0df24bfcdb38 100644
--- a/include/linux/uwb/spec.h
+++ b/include/linux/uwb/spec.h
@@ -32,6 +32,7 @@
32 32
33#include <linux/types.h> 33#include <linux/types.h>
34#include <linux/bitmap.h> 34#include <linux/bitmap.h>
35#include <linux/if_ether.h>
35 36
36#define i1480_FW 0x00000303 37#define i1480_FW 0x00000303
37/* #define i1480_FW 0x00000302 */ 38/* #define i1480_FW 0x00000302 */
@@ -130,7 +131,7 @@ enum { UWB_DRP_BACKOFF_WIN_MAX = 16 };
130 * it is also used to define headers sent down and up the wire/radio). 131 * it is also used to define headers sent down and up the wire/radio).
131 */ 132 */
132struct uwb_mac_addr { 133struct uwb_mac_addr {
133 u8 data[6]; 134 u8 data[ETH_ALEN];
134} __attribute__((packed)); 135} __attribute__((packed));
135 136
136 137
@@ -568,7 +569,7 @@ struct uwb_rc_evt_confirm {
568/* Device Address Management event. [WHCI] section 3.1.3.2. */ 569/* Device Address Management event. [WHCI] section 3.1.3.2. */
569struct uwb_rc_evt_dev_addr_mgmt { 570struct uwb_rc_evt_dev_addr_mgmt {
570 struct uwb_rceb rceb; 571 struct uwb_rceb rceb;
571 u8 baAddr[6]; 572 u8 baAddr[ETH_ALEN];
572 u8 bResultCode; 573 u8 bResultCode;
573} __attribute__((packed)); 574} __attribute__((packed));
574 575
diff --git a/include/linux/vfio.h b/include/linux/vfio.h
index ac8d488e4372..24579a0312a0 100644
--- a/include/linux/vfio.h
+++ b/include/linux/vfio.h
@@ -90,4 +90,11 @@ extern void vfio_unregister_iommu_driver(
90 TYPE tmp; \ 90 TYPE tmp; \
91 offsetof(TYPE, MEMBER) + sizeof(tmp.MEMBER); }) \ 91 offsetof(TYPE, MEMBER) + sizeof(tmp.MEMBER); }) \
92 92
93/*
94 * External user API
95 */
96extern struct vfio_group *vfio_group_get_external_user(struct file *filep);
97extern void vfio_group_put_external_user(struct vfio_group *group);
98extern int vfio_external_user_iommu_id(struct vfio_group *group);
99
93#endif /* VFIO_H */ 100#endif /* VFIO_H */
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h
index ddb419cf4530..502073a53dd3 100644
--- a/include/linux/vga_switcheroo.h
+++ b/include/linux/vga_switcheroo.h
@@ -45,7 +45,8 @@ struct vga_switcheroo_client_ops {
45#if defined(CONFIG_VGA_SWITCHEROO) 45#if defined(CONFIG_VGA_SWITCHEROO)
46void vga_switcheroo_unregister_client(struct pci_dev *dev); 46void vga_switcheroo_unregister_client(struct pci_dev *dev);
47int vga_switcheroo_register_client(struct pci_dev *dev, 47int vga_switcheroo_register_client(struct pci_dev *dev,
48 const struct vga_switcheroo_client_ops *ops); 48 const struct vga_switcheroo_client_ops *ops,
49 bool driver_power_control);
49int vga_switcheroo_register_audio_client(struct pci_dev *pdev, 50int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
50 const struct vga_switcheroo_client_ops *ops, 51 const struct vga_switcheroo_client_ops *ops,
51 int id, bool active); 52 int id, bool active);
@@ -60,11 +61,15 @@ int vga_switcheroo_process_delayed_switch(void);
60 61
61int vga_switcheroo_get_client_state(struct pci_dev *dev); 62int vga_switcheroo_get_client_state(struct pci_dev *dev);
62 63
64void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic);
65
66int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain);
67int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain);
63#else 68#else
64 69
65static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {} 70static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {}
66static inline int vga_switcheroo_register_client(struct pci_dev *dev, 71static inline int vga_switcheroo_register_client(struct pci_dev *dev,
67 const struct vga_switcheroo_client_ops *ops) { return 0; } 72 const struct vga_switcheroo_client_ops *ops, bool driver_power_control) { return 0; }
68static inline void vga_switcheroo_client_fb_set(struct pci_dev *dev, struct fb_info *info) {} 73static inline void vga_switcheroo_client_fb_set(struct pci_dev *dev, struct fb_info *info) {}
69static inline int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler) { return 0; } 74static inline int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler) { return 0; }
70static inline int vga_switcheroo_register_audio_client(struct pci_dev *pdev, 75static inline int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
@@ -74,6 +79,10 @@ static inline void vga_switcheroo_unregister_handler(void) {}
74static inline int vga_switcheroo_process_delayed_switch(void) { return 0; } 79static inline int vga_switcheroo_process_delayed_switch(void) { return 0; }
75static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return VGA_SWITCHEROO_ON; } 80static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return VGA_SWITCHEROO_ON; }
76 81
82static inline void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic) {}
83
84static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
85static inline int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
77 86
78#endif 87#endif
79#endif /* _LINUX_VGA_SWITCHEROO_H_ */ 88#endif /* _LINUX_VGA_SWITCHEROO_H_ */
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index bd6cf61142be..1855f0a22add 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -70,6 +70,12 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
70 THP_ZERO_PAGE_ALLOC, 70 THP_ZERO_PAGE_ALLOC,
71 THP_ZERO_PAGE_ALLOC_FAILED, 71 THP_ZERO_PAGE_ALLOC_FAILED,
72#endif 72#endif
73#ifdef CONFIG_SMP
74 NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */
75 NR_TLB_REMOTE_FLUSH_RECEIVED,/* cpu received ipi for flush */
76#endif
77 NR_TLB_LOCAL_FLUSH_ALL,
78 NR_TLB_LOCAL_FLUSH_ONE,
73 NR_VM_EVENT_ITEMS 79 NR_VM_EVENT_ITEMS
74}; 80};
75 81
diff --git a/include/linux/vmpressure.h b/include/linux/vmpressure.h
index 7dc17e2456de..3f3788d49362 100644
--- a/include/linux/vmpressure.h
+++ b/include/linux/vmpressure.h
@@ -34,10 +34,12 @@ extern void vmpressure_cleanup(struct vmpressure *vmpr);
34extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); 34extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg);
35extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); 35extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr);
36extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); 36extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css);
37extern int vmpressure_register_event(struct cgroup *cg, struct cftype *cft, 37extern int vmpressure_register_event(struct cgroup_subsys_state *css,
38 struct cftype *cft,
38 struct eventfd_ctx *eventfd, 39 struct eventfd_ctx *eventfd,
39 const char *args); 40 const char *args);
40extern void vmpressure_unregister_event(struct cgroup *cg, struct cftype *cft, 41extern void vmpressure_unregister_event(struct cgroup_subsys_state *css,
42 struct cftype *cft,
41 struct eventfd_ctx *eventfd); 43 struct eventfd_ctx *eventfd);
42#else 44#else
43static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, 45static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index c586679b6fef..e4b948080d20 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -143,7 +143,6 @@ static inline unsigned long zone_page_state_snapshot(struct zone *zone,
143} 143}
144 144
145extern unsigned long global_reclaimable_pages(void); 145extern unsigned long global_reclaimable_pages(void);
146extern unsigned long zone_reclaimable_pages(struct zone *zone);
147 146
148#ifdef CONFIG_NUMA 147#ifdef CONFIG_NUMA
149/* 148/*
@@ -198,7 +197,7 @@ extern void __inc_zone_state(struct zone *, enum zone_stat_item);
198extern void dec_zone_state(struct zone *, enum zone_stat_item); 197extern void dec_zone_state(struct zone *, enum zone_stat_item);
199extern void __dec_zone_state(struct zone *, enum zone_stat_item); 198extern void __dec_zone_state(struct zone *, enum zone_stat_item);
200 199
201void refresh_cpu_vm_stats(int); 200void cpu_vm_stats_fold(int cpu);
202void refresh_zone_stat_thresholds(void); 201void refresh_zone_stat_thresholds(void);
203 202
204void drain_zonestat(struct zone *zone, struct per_cpu_pageset *); 203void drain_zonestat(struct zone *zone, struct per_cpu_pageset *);
@@ -255,6 +254,7 @@ static inline void __dec_zone_page_state(struct page *page,
255 254
256static inline void refresh_cpu_vm_stats(int cpu) { } 255static inline void refresh_cpu_vm_stats(int cpu) { }
257static inline void refresh_zone_stat_thresholds(void) { } 256static inline void refresh_zone_stat_thresholds(void) { }
257static inline void cpu_vm_stats_fold(int cpu) { }
258 258
259static inline void drain_zonestat(struct zone *zone, 259static inline void drain_zonestat(struct zone *zone,
260 struct per_cpu_pageset *pset) { } 260 struct per_cpu_pageset *pset) { }
diff --git a/include/linux/vtime.h b/include/linux/vtime.h
index b1dd2db80076..f5b72b364bda 100644
--- a/include/linux/vtime.h
+++ b/include/linux/vtime.h
@@ -1,18 +1,68 @@
1#ifndef _LINUX_KERNEL_VTIME_H 1#ifndef _LINUX_KERNEL_VTIME_H
2#define _LINUX_KERNEL_VTIME_H 2#define _LINUX_KERNEL_VTIME_H
3 3
4#include <linux/context_tracking_state.h>
5#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
6#include <asm/vtime.h>
7#endif
8
9
4struct task_struct; 10struct task_struct;
5 11
12/*
13 * vtime_accounting_enabled() definitions/declarations
14 */
15#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
16static inline bool vtime_accounting_enabled(void) { return true; }
17#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
18
19#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
20static inline bool vtime_accounting_enabled(void)
21{
22 if (static_key_false(&context_tracking_enabled)) {
23 if (context_tracking_active())
24 return true;
25 }
26
27 return false;
28}
29#endif /* CONFIG_VIRT_CPU_ACCOUNTING_GEN */
30
31#ifndef CONFIG_VIRT_CPU_ACCOUNTING
32static inline bool vtime_accounting_enabled(void) { return false; }
33#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
34
35
36/*
37 * Common vtime APIs
38 */
6#ifdef CONFIG_VIRT_CPU_ACCOUNTING 39#ifdef CONFIG_VIRT_CPU_ACCOUNTING
40
41#ifdef __ARCH_HAS_VTIME_TASK_SWITCH
7extern void vtime_task_switch(struct task_struct *prev); 42extern void vtime_task_switch(struct task_struct *prev);
43#else
44extern void vtime_common_task_switch(struct task_struct *prev);
45static inline void vtime_task_switch(struct task_struct *prev)
46{
47 if (vtime_accounting_enabled())
48 vtime_common_task_switch(prev);
49}
50#endif /* __ARCH_HAS_VTIME_TASK_SWITCH */
51
8extern void vtime_account_system(struct task_struct *tsk); 52extern void vtime_account_system(struct task_struct *tsk);
9extern void vtime_account_idle(struct task_struct *tsk); 53extern void vtime_account_idle(struct task_struct *tsk);
10extern void vtime_account_user(struct task_struct *tsk); 54extern void vtime_account_user(struct task_struct *tsk);
11extern void vtime_account_irq_enter(struct task_struct *tsk);
12 55
13#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE 56#ifdef __ARCH_HAS_VTIME_ACCOUNT
14static inline bool vtime_accounting_enabled(void) { return true; } 57extern void vtime_account_irq_enter(struct task_struct *tsk);
15#endif 58#else
59extern void vtime_common_account_irq_enter(struct task_struct *tsk);
60static inline void vtime_account_irq_enter(struct task_struct *tsk)
61{
62 if (vtime_accounting_enabled())
63 vtime_common_account_irq_enter(tsk);
64}
65#endif /* __ARCH_HAS_VTIME_ACCOUNT */
16 66
17#else /* !CONFIG_VIRT_CPU_ACCOUNTING */ 67#else /* !CONFIG_VIRT_CPU_ACCOUNTING */
18 68
@@ -20,14 +70,20 @@ static inline void vtime_task_switch(struct task_struct *prev) { }
20static inline void vtime_account_system(struct task_struct *tsk) { } 70static inline void vtime_account_system(struct task_struct *tsk) { }
21static inline void vtime_account_user(struct task_struct *tsk) { } 71static inline void vtime_account_user(struct task_struct *tsk) { }
22static inline void vtime_account_irq_enter(struct task_struct *tsk) { } 72static inline void vtime_account_irq_enter(struct task_struct *tsk) { }
23static inline bool vtime_accounting_enabled(void) { return false; } 73#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
24#endif
25 74
26#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN 75#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
27extern void arch_vtime_task_switch(struct task_struct *tsk); 76extern void arch_vtime_task_switch(struct task_struct *tsk);
28extern void vtime_account_irq_exit(struct task_struct *tsk); 77extern void vtime_gen_account_irq_exit(struct task_struct *tsk);
29extern bool vtime_accounting_enabled(void); 78
79static inline void vtime_account_irq_exit(struct task_struct *tsk)
80{
81 if (vtime_accounting_enabled())
82 vtime_gen_account_irq_exit(tsk);
83}
84
30extern void vtime_user_enter(struct task_struct *tsk); 85extern void vtime_user_enter(struct task_struct *tsk);
86
31static inline void vtime_user_exit(struct task_struct *tsk) 87static inline void vtime_user_exit(struct task_struct *tsk)
32{ 88{
33 vtime_account_user(tsk); 89 vtime_account_user(tsk);
@@ -35,7 +91,7 @@ static inline void vtime_user_exit(struct task_struct *tsk)
35extern void vtime_guest_enter(struct task_struct *tsk); 91extern void vtime_guest_enter(struct task_struct *tsk);
36extern void vtime_guest_exit(struct task_struct *tsk); 92extern void vtime_guest_exit(struct task_struct *tsk);
37extern void vtime_init_idle(struct task_struct *tsk, int cpu); 93extern void vtime_init_idle(struct task_struct *tsk, int cpu);
38#else 94#else /* !CONFIG_VIRT_CPU_ACCOUNTING_GEN */
39static inline void vtime_account_irq_exit(struct task_struct *tsk) 95static inline void vtime_account_irq_exit(struct task_struct *tsk)
40{ 96{
41 /* On hard|softirq exit we always account to hard|softirq cputime */ 97 /* On hard|softirq exit we always account to hard|softirq cputime */
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index a0ed78ab54d7..594521ba0d43 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -295,7 +295,12 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
295 * Documentation/workqueue.txt. 295 * Documentation/workqueue.txt.
296 */ 296 */
297enum { 297enum {
298 WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ 298 /*
299 * All wqs are now non-reentrant making the following flag
300 * meaningless. Will be removed.
301 */
302 WQ_NON_REENTRANT = 1 << 0, /* DEPRECATED */
303
299 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ 304 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */
300 WQ_FREEZABLE = 1 << 2, /* freeze during suspend */ 305 WQ_FREEZABLE = 1 << 2, /* freeze during suspend */
301 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ 306 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 4e198ca1f685..021b8a319b9e 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -98,8 +98,6 @@ int try_to_writeback_inodes_sb(struct super_block *, enum wb_reason reason);
98int try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr, 98int try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr,
99 enum wb_reason reason); 99 enum wb_reason reason);
100void sync_inodes_sb(struct super_block *); 100void sync_inodes_sb(struct super_block *);
101long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages,
102 enum wb_reason reason);
103void wakeup_flusher_threads(long nr_pages, enum wb_reason reason); 101void wakeup_flusher_threads(long nr_pages, enum wb_reason reason);
104void inode_wait_for_writeback(struct inode *inode); 102void inode_wait_for_writeback(struct inode *inode);
105 103
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index fdbafc6841cf..91b0a68d38dc 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -31,7 +31,7 @@ struct xattr_handler {
31}; 31};
32 32
33struct xattr { 33struct xattr {
34 char *name; 34 const char *name;
35 void *value; 35 void *value;
36 size_t value_len; 36 size_t value_len;
37}; 37};
diff --git a/include/linux/yam.h b/include/linux/yam.h
index 7fe28228b274..512cdc2fb80f 100644
--- a/include/linux/yam.h
+++ b/include/linux/yam.h
@@ -77,6 +77,6 @@ struct yamdrv_ioctl_cfg {
77 77
78struct yamdrv_ioctl_mcs { 78struct yamdrv_ioctl_mcs {
79 int cmd; 79 int cmd;
80 int bitrate; 80 unsigned int bitrate;
81 unsigned char bits[YAM_FPGA_SIZE]; 81 unsigned char bits[YAM_FPGA_SIZE];
82}; 82};
diff --git a/include/media/adv7343.h b/include/media/adv7343.h
index 944757be49bb..e4142b1ef8cd 100644
--- a/include/media/adv7343.h
+++ b/include/media/adv7343.h
@@ -28,12 +28,7 @@
28 * @pll_control: PLL and oversampling control. This control allows internal 28 * @pll_control: PLL and oversampling control. This control allows internal
29 * PLL 1 circuit to be powered down and the oversampling to be 29 * PLL 1 circuit to be powered down and the oversampling to be
30 * switched off. 30 * switched off.
31 * @dac_1: power on/off DAC 1. 31 * @dac: array to configure power on/off DAC's 1..6
32 * @dac_2: power on/off DAC 2.
33 * @dac_3: power on/off DAC 3.
34 * @dac_4: power on/off DAC 4.
35 * @dac_5: power on/off DAC 5.
36 * @dac_6: power on/off DAC 6.
37 * 32 *
38 * Power mode register (Register 0x0), for more info refer REGISTER MAP ACCESS 33 * Power mode register (Register 0x0), for more info refer REGISTER MAP ACCESS
39 * section of datasheet[1], table 17 page no 30. 34 * section of datasheet[1], table 17 page no 30.
@@ -43,23 +38,16 @@
43struct adv7343_power_mode { 38struct adv7343_power_mode {
44 bool sleep_mode; 39 bool sleep_mode;
45 bool pll_control; 40 bool pll_control;
46 bool dac_1; 41 u32 dac[6];
47 bool dac_2;
48 bool dac_3;
49 bool dac_4;
50 bool dac_5;
51 bool dac_6;
52}; 42};
53 43
54/** 44/**
55 * struct adv7343_sd_config - SD Only Output Configuration. 45 * struct adv7343_sd_config - SD Only Output Configuration.
56 * @sd_dac_out1: Configure SD DAC Output 1. 46 * @sd_dac_out: array configuring SD DAC Outputs 1 and 2
57 * @sd_dac_out2: Configure SD DAC Output 2.
58 */ 47 */
59struct adv7343_sd_config { 48struct adv7343_sd_config {
60 /* SD only Output Configuration */ 49 /* SD only Output Configuration */
61 bool sd_dac_out1; 50 u32 sd_dac_out[2];
62 bool sd_dac_out2;
63}; 51};
64 52
65/** 53/**
diff --git a/include/media/adv7511.h b/include/media/adv7511.h
new file mode 100644
index 000000000000..bb78bed9a5b8
--- /dev/null
+++ b/include/media/adv7511.h
@@ -0,0 +1,48 @@
1/*
2 * Analog Devices ADV7511 HDMI Transmitter Device Driver
3 *
4 * Copyright 2013 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
5 *
6 * This program is free software; you may redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
12 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
13 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
14 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
15 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17 * SOFTWARE.
18 */
19
20#ifndef ADV7511_H
21#define ADV7511_H
22
23/* notify events */
24#define ADV7511_MONITOR_DETECT 0
25#define ADV7511_EDID_DETECT 1
26
27
28struct adv7511_monitor_detect {
29 int present;
30};
31
32struct adv7511_edid_detect {
33 int present;
34 int segment;
35};
36
37struct adv7511_cec_arg {
38 void *arg;
39 u32 f_flags;
40};
41
42struct adv7511_platform_data {
43 uint8_t i2c_edid;
44 uint8_t i2c_cec;
45 uint32_t cec_clk;
46};
47
48#endif
diff --git a/include/media/adv7842.h b/include/media/adv7842.h
new file mode 100644
index 000000000000..c02201d1c092
--- /dev/null
+++ b/include/media/adv7842.h
@@ -0,0 +1,226 @@
1/*
2 * adv7842 - Analog Devices ADV7842 video decoder driver
3 *
4 * Copyright 2013 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
5 *
6 * This program is free software; you may redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
12 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
13 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
14 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
15 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17 * SOFTWARE.
18 *
19 */
20
21#ifndef _ADV7842_
22#define _ADV7842_
23
24/* Analog input muxing modes (AFE register 0x02, [2:0]) */
25enum adv7842_ain_sel {
26 ADV7842_AIN1_2_3_NC_SYNC_1_2 = 0,
27 ADV7842_AIN4_5_6_NC_SYNC_2_1 = 1,
28 ADV7842_AIN7_8_9_NC_SYNC_3_1 = 2,
29 ADV7842_AIN10_11_12_NC_SYNC_4_1 = 3,
30 ADV7842_AIN9_4_5_6_SYNC_2_1 = 4,
31};
32
33/* Bus rotation and reordering (IO register 0x04, [7:5]) */
34enum adv7842_op_ch_sel {
35 ADV7842_OP_CH_SEL_GBR = 0,
36 ADV7842_OP_CH_SEL_GRB = 1,
37 ADV7842_OP_CH_SEL_BGR = 2,
38 ADV7842_OP_CH_SEL_RGB = 3,
39 ADV7842_OP_CH_SEL_BRG = 4,
40 ADV7842_OP_CH_SEL_RBG = 5,
41};
42
43/* Mode of operation */
44enum adv7842_mode {
45 ADV7842_MODE_SDP,
46 ADV7842_MODE_COMP,
47 ADV7842_MODE_RGB,
48 ADV7842_MODE_HDMI
49};
50
51/* Video standard select (IO register 0x00, [5:0]) */
52enum adv7842_vid_std_select {
53 /* SDP */
54 ADV7842_SDP_VID_STD_CVBS_SD_4x1 = 0x01,
55 ADV7842_SDP_VID_STD_YC_SD4_x1 = 0x09,
56 /* RGB */
57 ADV7842_RGB_VID_STD_AUTO_GRAPH_MODE = 0x07,
58 /* HDMI GR */
59 ADV7842_HDMI_GR_VID_STD_AUTO_GRAPH_MODE = 0x02,
60 /* HDMI COMP */
61 ADV7842_HDMI_COMP_VID_STD_HD_1250P = 0x1e,
62};
63
64/* Input Color Space (IO register 0x02, [7:4]) */
65enum adv7842_inp_color_space {
66 ADV7842_INP_COLOR_SPACE_LIM_RGB = 0,
67 ADV7842_INP_COLOR_SPACE_FULL_RGB = 1,
68 ADV7842_INP_COLOR_SPACE_LIM_YCbCr_601 = 2,
69 ADV7842_INP_COLOR_SPACE_LIM_YCbCr_709 = 3,
70 ADV7842_INP_COLOR_SPACE_XVYCC_601 = 4,
71 ADV7842_INP_COLOR_SPACE_XVYCC_709 = 5,
72 ADV7842_INP_COLOR_SPACE_FULL_YCbCr_601 = 6,
73 ADV7842_INP_COLOR_SPACE_FULL_YCbCr_709 = 7,
74 ADV7842_INP_COLOR_SPACE_AUTO = 0xf,
75};
76
77/* Select output format (IO register 0x03, [7:0]) */
78enum adv7842_op_format_sel {
79 ADV7842_OP_FORMAT_SEL_SDR_ITU656_8 = 0x00,
80 ADV7842_OP_FORMAT_SEL_SDR_ITU656_10 = 0x01,
81 ADV7842_OP_FORMAT_SEL_SDR_ITU656_12_MODE0 = 0x02,
82 ADV7842_OP_FORMAT_SEL_SDR_ITU656_12_MODE1 = 0x06,
83 ADV7842_OP_FORMAT_SEL_SDR_ITU656_12_MODE2 = 0x0a,
84 ADV7842_OP_FORMAT_SEL_DDR_422_8 = 0x20,
85 ADV7842_OP_FORMAT_SEL_DDR_422_10 = 0x21,
86 ADV7842_OP_FORMAT_SEL_DDR_422_12_MODE0 = 0x22,
87 ADV7842_OP_FORMAT_SEL_DDR_422_12_MODE1 = 0x23,
88 ADV7842_OP_FORMAT_SEL_DDR_422_12_MODE2 = 0x24,
89 ADV7842_OP_FORMAT_SEL_SDR_444_24 = 0x40,
90 ADV7842_OP_FORMAT_SEL_SDR_444_30 = 0x41,
91 ADV7842_OP_FORMAT_SEL_SDR_444_36_MODE0 = 0x42,
92 ADV7842_OP_FORMAT_SEL_DDR_444_24 = 0x60,
93 ADV7842_OP_FORMAT_SEL_DDR_444_30 = 0x61,
94 ADV7842_OP_FORMAT_SEL_DDR_444_36 = 0x62,
95 ADV7842_OP_FORMAT_SEL_SDR_ITU656_16 = 0x80,
96 ADV7842_OP_FORMAT_SEL_SDR_ITU656_20 = 0x81,
97 ADV7842_OP_FORMAT_SEL_SDR_ITU656_24_MODE0 = 0x82,
98 ADV7842_OP_FORMAT_SEL_SDR_ITU656_24_MODE1 = 0x86,
99 ADV7842_OP_FORMAT_SEL_SDR_ITU656_24_MODE2 = 0x8a,
100};
101
102enum adv7842_select_input {
103 ADV7842_SELECT_HDMI_PORT_A,
104 ADV7842_SELECT_HDMI_PORT_B,
105 ADV7842_SELECT_VGA_RGB,
106 ADV7842_SELECT_VGA_COMP,
107 ADV7842_SELECT_SDP_CVBS,
108 ADV7842_SELECT_SDP_YC,
109};
110
111struct adv7842_sdp_csc_coeff {
112 bool manual;
113 uint16_t scaling;
114 uint16_t A1;
115 uint16_t A2;
116 uint16_t A3;
117 uint16_t A4;
118 uint16_t B1;
119 uint16_t B2;
120 uint16_t B3;
121 uint16_t B4;
122 uint16_t C1;
123 uint16_t C2;
124 uint16_t C3;
125 uint16_t C4;
126};
127
128struct adv7842_sdp_io_sync_adjustment {
129 bool adjust;
130 uint16_t hs_beg;
131 uint16_t hs_width;
132 uint16_t de_beg;
133 uint16_t de_end;
134};
135
136/* Platform dependent definition */
137struct adv7842_platform_data {
138 /* connector - HDMI or DVI? */
139 unsigned connector_hdmi:1;
140
141 /* chip reset during probe */
142 unsigned chip_reset:1;
143
144 /* DIS_PWRDNB: 1 if the PWRDNB pin is unused and unconnected */
145 unsigned disable_pwrdnb:1;
146
147 /* DIS_CABLE_DET_RST: 1 if the 5V pins are unused and unconnected */
148 unsigned disable_cable_det_rst:1;
149
150 /* Analog input muxing mode */
151 enum adv7842_ain_sel ain_sel;
152
153 /* Bus rotation and reordering */
154 enum adv7842_op_ch_sel op_ch_sel;
155
156 /* Default mode */
157 enum adv7842_mode mode;
158
159 /* Video standard */
160 enum adv7842_vid_std_select vid_std_select;
161
162 /* Input Color Space */
163 enum adv7842_inp_color_space inp_color_space;
164
165 /* Select output format */
166 enum adv7842_op_format_sel op_format_sel;
167
168 /* IO register 0x02 */
169 unsigned alt_gamma:1;
170 unsigned op_656_range:1;
171 unsigned rgb_out:1;
172 unsigned alt_data_sat:1;
173
174 /* IO register 0x05 */
175 unsigned blank_data:1;
176 unsigned insert_av_codes:1;
177 unsigned replicate_av_codes:1;
178 unsigned invert_cbcr:1;
179
180 /* IO register 0x30 */
181 unsigned output_bus_lsb_to_msb:1;
182
183 /* IO register 0x14 */
184 struct {
185 unsigned data:2;
186 unsigned clock:2;
187 unsigned sync:2;
188 } drive_strength;
189
190 /* External RAM for 3-D comb or frame synchronizer */
191 unsigned sd_ram_size; /* ram size in MB */
192 unsigned sd_ram_ddr:1; /* ddr or sdr sdram */
193
194 /* Free run */
195 unsigned hdmi_free_run_mode;
196
197 struct adv7842_sdp_csc_coeff sdp_csc_coeff;
198
199 struct adv7842_sdp_io_sync_adjustment sdp_io_sync;
200
201 /* i2c addresses */
202 u8 i2c_sdp_io;
203 u8 i2c_sdp;
204 u8 i2c_cp;
205 u8 i2c_vdp;
206 u8 i2c_afe;
207 u8 i2c_hdmi;
208 u8 i2c_repeater;
209 u8 i2c_edid;
210 u8 i2c_infoframe;
211 u8 i2c_cec;
212 u8 i2c_avlink;
213};
214
215#define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000)
216#define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001)
217#define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002)
218
219/* notify events */
220#define ADV7842_FMT_CHANGE 1
221
222/* custom ioctl, used to test the external RAM that's used by the
223 * deinterlacer. */
224#define ADV7842_CMD_RAM_TEST _IO('V', BASE_VIDIOC_PRIVATE)
225
226#endif
diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h
index 3882e0675ccf..3cb1704a0650 100644
--- a/include/media/davinci/vpif_types.h
+++ b/include/media/davinci/vpif_types.h
@@ -59,6 +59,8 @@ struct vpif_display_config {
59 int subdev_count; 59 int subdev_count;
60 struct vpif_display_chan_config chan_config[VPIF_DISPLAY_MAX_CHANNELS]; 60 struct vpif_display_chan_config chan_config[VPIF_DISPLAY_MAX_CHANNELS];
61 const char *card_name; 61 const char *card_name;
62 struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
63 int *asd_sizes; /* 0-terminated array of asd group sizes */
62}; 64};
63 65
64struct vpif_input { 66struct vpif_input {
@@ -81,5 +83,7 @@ struct vpif_capture_config {
81 struct vpif_subdev_info *subdev_info; 83 struct vpif_subdev_info *subdev_info;
82 int subdev_count; 84 int subdev_count;
83 const char *card_name; 85 const char *card_name;
86 struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
87 int *asd_sizes; /* 0-terminated array of asd group sizes */
84}; 88};
85#endif /* _VPIF_TYPES_H */ 89#endif /* _VPIF_TYPES_H */
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
index 168dd0b1bae2..78f0637ca68d 100644
--- a/include/media/lirc_dev.h
+++ b/include/media/lirc_dev.h
@@ -139,6 +139,7 @@ struct lirc_driver {
139 struct lirc_buffer *rbuf; 139 struct lirc_buffer *rbuf;
140 int (*set_use_inc) (void *data); 140 int (*set_use_inc) (void *data);
141 void (*set_use_dec) (void *data); 141 void (*set_use_dec) (void *data);
142 struct rc_dev *rdev;
142 const struct file_operations *fops; 143 const struct file_operations *fops;
143 struct device *dev; 144 struct device *dev;
144 struct module *owner; 145 struct module *owner;
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 06bacf937d61..10df55187981 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -23,6 +23,7 @@
23#ifndef _MEDIA_ENTITY_H 23#ifndef _MEDIA_ENTITY_H
24#define _MEDIA_ENTITY_H 24#define _MEDIA_ENTITY_H
25 25
26#include <linux/bitops.h>
26#include <linux/list.h> 27#include <linux/list.h>
27#include <linux/media.h> 28#include <linux/media.h>
28 29
@@ -113,12 +114,15 @@ static inline u32 media_entity_subtype(struct media_entity *entity)
113} 114}
114 115
115#define MEDIA_ENTITY_ENUM_MAX_DEPTH 16 116#define MEDIA_ENTITY_ENUM_MAX_DEPTH 16
117#define MEDIA_ENTITY_ENUM_MAX_ID 64
116 118
117struct media_entity_graph { 119struct media_entity_graph {
118 struct { 120 struct {
119 struct media_entity *entity; 121 struct media_entity *entity;
120 int link; 122 int link;
121 } stack[MEDIA_ENTITY_ENUM_MAX_DEPTH]; 123 } stack[MEDIA_ENTITY_ENUM_MAX_DEPTH];
124
125 DECLARE_BITMAP(entities, MEDIA_ENTITY_ENUM_MAX_ID);
122 int top; 126 int top;
123}; 127};
124 128
diff --git a/include/media/mt9v032.h b/include/media/mt9v032.h
index 78fd39eac219..12175a63c5b2 100644
--- a/include/media/mt9v032.h
+++ b/include/media/mt9v032.h
@@ -1,13 +1,9 @@
1#ifndef _MEDIA_MT9V032_H 1#ifndef _MEDIA_MT9V032_H
2#define _MEDIA_MT9V032_H 2#define _MEDIA_MT9V032_H
3 3
4struct v4l2_subdev;
5
6struct mt9v032_platform_data { 4struct mt9v032_platform_data {
7 unsigned int clk_pol:1; 5 unsigned int clk_pol:1;
8 6
9 void (*set_clock)(struct v4l2_subdev *subdev, unsigned int rate);
10
11 const s64 *link_freqs; 7 const s64 *link_freqs;
12 s64 link_def_freq; 8 s64 link_def_freq;
13}; 9};
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index 06a75deff553..2f6f1f78d958 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -101,6 +101,7 @@ struct rc_dev {
101 bool idle; 101 bool idle;
102 u64 allowed_protos; 102 u64 allowed_protos;
103 u64 enabled_protocols; 103 u64 enabled_protocols;
104 u32 users;
104 u32 scanmask; 105 u32 scanmask;
105 void *priv; 106 void *priv;
106 spinlock_t keylock; 107 spinlock_t keylock;
@@ -142,6 +143,9 @@ void rc_free_device(struct rc_dev *dev);
142int rc_register_device(struct rc_dev *dev); 143int rc_register_device(struct rc_dev *dev);
143void rc_unregister_device(struct rc_dev *dev); 144void rc_unregister_device(struct rc_dev *dev);
144 145
146int rc_open(struct rc_dev *rdev);
147void rc_close(struct rc_dev *rdev);
148
145void rc_repeat(struct rc_dev *dev); 149void rc_repeat(struct rc_dev *dev);
146void rc_keydown(struct rc_dev *dev, int scancode, u8 toggle); 150void rc_keydown(struct rc_dev *dev, int scancode, u8 toggle);
147void rc_keydown_notimeout(struct rc_dev *dev, int scancode, u8 toggle); 151void rc_keydown_notimeout(struct rc_dev *dev, int scancode, u8 toggle);
diff --git a/include/media/saa7115.h b/include/media/saa7115.h
index 407918625c80..76911e71de17 100644
--- a/include/media/saa7115.h
+++ b/include/media/saa7115.h
@@ -47,9 +47,11 @@
47#define SAA7111_FMT_YUV411 0xc0 47#define SAA7111_FMT_YUV411 0xc0
48 48
49/* config flags */ 49/* config flags */
50/* Register 0x85 should set bit 0 to 0 (it's 1 by default). This bit 50/*
51 * Register 0x85 should set bit 0 to 0 (it's 1 by default). This bit
51 * controls the IDQ signal polarity which is set to 'inverted' if the bit 52 * controls the IDQ signal polarity which is set to 'inverted' if the bit
52 * it 1 and to 'default' if it is 0. */ 53 * it 1 and to 'default' if it is 0.
54 */
53#define SAA7115_IDQ_IS_DEFAULT (1 << 0) 55#define SAA7115_IDQ_IS_DEFAULT (1 << 0)
54 56
55/* s_crystal_freq values and flags */ 57/* s_crystal_freq values and flags */
@@ -64,5 +66,76 @@
64#define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */ 66#define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */
65#define SAA7115_FREQ_FL_DOUBLE_ASCLK (1 << 3) /* SA 39, LRDIV, SAA7114/5 only */ 67#define SAA7115_FREQ_FL_DOUBLE_ASCLK (1 << 3) /* SA 39, LRDIV, SAA7114/5 only */
66 68
69/* ===== SAA7113 Config enums ===== */
70
71/* Register 0x08 "Horizontal time constant" [Bit 3..4]:
72 * Should be set to "Fast Locking Mode" according to the datasheet,
73 * and that is the default setting in the gm7113c_init table.
74 * saa7113_init sets this value to "VTR Mode". */
75enum saa7113_r08_htc {
76 SAA7113_HTC_TV_MODE = 0x00,
77 SAA7113_HTC_VTR_MODE, /* Default for saa7113_init */
78 SAA7113_HTC_FAST_LOCKING_MODE = 0x03 /* Default for gm7113c_init */
79};
80
81/* Register 0x10 "Output format selection" [Bit 6..7]:
82 * Defaults to ITU_656 as specified in datasheet. */
83enum saa7113_r10_ofts {
84 SAA7113_OFTS_ITU_656 = 0x0, /* Default */
85 SAA7113_OFTS_VFLAG_BY_VREF,
86 SAA7113_OFTS_VFLAG_BY_DATA_TYPE
87};
88
89/*
90 * Register 0x12 "Output control" [Bit 0..3 Or Bit 4..7]:
91 * This is used to select what data is output on the RTS0 and RTS1 pins.
92 * RTS1 [Bit 4..7] Defaults to DOT_IN. (This value can not be set for RTS0)
93 * RTS0 [Bit 0..3] Defaults to VIPB in gm7113c_init as specified
94 * in the datasheet, but is set to HREF_HS in the saa7113_init table.
95 */
96enum saa7113_r12_rts {
97 SAA7113_RTS_DOT_IN = 0, /* OBS: Only for RTS1 (Default RTS1) */
98 SAA7113_RTS_VIPB, /* Default RTS0 For gm7113c_init */
99 SAA7113_RTS_GPSW,
100 SAA7115_RTS_HL,
101 SAA7113_RTS_VL,
102 SAA7113_RTS_DL,
103 SAA7113_RTS_PLIN,
104 SAA7113_RTS_HREF_HS, /* Default RTS0 For saa7113_init */
105 SAA7113_RTS_HS,
106 SAA7113_RTS_HQ,
107 SAA7113_RTS_ODD,
108 SAA7113_RTS_VS,
109 SAA7113_RTS_V123,
110 SAA7113_RTS_VGATE,
111 SAA7113_RTS_VREF,
112 SAA7113_RTS_FID
113};
114
115/**
116 * struct saa7115_platform_data - Allow overriding default initialization
117 *
118 * @saa7113_force_gm7113c_init: Force the use of the gm7113c_init table
119 * instead of saa7113_init table
120 * (saa7113 only)
121 * @saa7113_r08_htc: [R_08 - Bit 3..4]
122 * @saa7113_r10_vrln: [R_10 - Bit 3]
123 * default: Disabled for gm7113c_init
124 * Enabled for saa7113c_init
125 * @saa7113_r10_ofts: [R_10 - Bit 6..7]
126 * @saa7113_r12_rts0: [R_12 - Bit 0..3]
127 * @saa7113_r12_rts1: [R_12 - Bit 4..7]
128 * @saa7113_r13_adlsb: [R_13 - Bit 7] - default: disabled
129 */
130struct saa7115_platform_data {
131 bool saa7113_force_gm7113c_init;
132 enum saa7113_r08_htc *saa7113_r08_htc;
133 bool *saa7113_r10_vrln;
134 enum saa7113_r10_ofts *saa7113_r10_ofts;
135 enum saa7113_r12_rts *saa7113_r12_rts0;
136 enum saa7113_r12_rts *saa7113_r12_rts1;
137 bool *saa7113_r13_adlsb;
138};
139
67#endif 140#endif
68 141
diff --git a/include/media/smiapp.h b/include/media/smiapp.h
index 07f96a89e189..0b8f124a630c 100644
--- a/include/media/smiapp.h
+++ b/include/media/smiapp.h
@@ -77,7 +77,6 @@ struct smiapp_platform_data {
77 struct smiapp_flash_strobe_parms *strobe_setup; 77 struct smiapp_flash_strobe_parms *strobe_setup;
78 78
79 int (*set_xclk)(struct v4l2_subdev *sd, int hz); 79 int (*set_xclk)(struct v4l2_subdev *sd, int hz);
80 char *ext_clk_name;
81 int xshutdown; /* gpio or SMIAPP_NO_XSHUTDOWN */ 80 int xshutdown; /* gpio or SMIAPP_NO_XSHUTDOWN */
82}; 81};
83 82
diff --git a/include/sound/tea575x-tuner.h b/include/media/tea575x.h
index 098c4de44945..2d4fa59db902 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/media/tea575x.h
@@ -71,6 +71,7 @@ struct snd_tea575x {
71 int (*ext_init)(struct snd_tea575x *tea); 71 int (*ext_init)(struct snd_tea575x *tea);
72}; 72};
73 73
74int snd_tea575x_hw_init(struct snd_tea575x *tea);
74int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner); 75int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner);
75void snd_tea575x_exit(struct snd_tea575x *tea); 76void snd_tea575x_exit(struct snd_tea575x *tea);
76void snd_tea575x_set_freq(struct snd_tea575x *tea); 77void snd_tea575x_set_freq(struct snd_tea575x *tea);
diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h
index 4a1191abd936..f7119ee3977b 100644
--- a/include/media/tveeprom.h
+++ b/include/media/tveeprom.h
@@ -12,6 +12,8 @@ enum tveeprom_audio_processor {
12 TVEEPROM_AUDPROC_OTHER, 12 TVEEPROM_AUDPROC_OTHER,
13}; 13};
14 14
15#include <linux/if_ether.h>
16
15struct tveeprom { 17struct tveeprom {
16 u32 has_radio; 18 u32 has_radio;
17 /* If has_ir == 0, then it is unknown what the IR capabilities are, 19 /* If has_ir == 0, then it is unknown what the IR capabilities are,
@@ -40,7 +42,7 @@ struct tveeprom {
40 u32 revision; 42 u32 revision;
41 u32 serial_number; 43 u32 serial_number;
42 char rev_str[5]; 44 char rev_str[5];
43 u8 MAC_address[6]; 45 u8 MAC_address[ETH_ALEN];
44}; 46};
45 47
46void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, 48void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h
index c3ec6ac75f7e..768356917bea 100644
--- a/include/media/v4l2-async.h
+++ b/include/media/v4l2-async.h
@@ -15,6 +15,7 @@
15#include <linux/mutex.h> 15#include <linux/mutex.h>
16 16
17struct device; 17struct device;
18struct device_node;
18struct v4l2_device; 19struct v4l2_device;
19struct v4l2_subdev; 20struct v4l2_subdev;
20struct v4l2_async_notifier; 21struct v4l2_async_notifier;
@@ -22,10 +23,11 @@ struct v4l2_async_notifier;
22/* A random max subdevice number, used to allocate an array on stack */ 23/* A random max subdevice number, used to allocate an array on stack */
23#define V4L2_MAX_SUBDEVS 128U 24#define V4L2_MAX_SUBDEVS 128U
24 25
25enum v4l2_async_bus_type { 26enum v4l2_async_match_type {
26 V4L2_ASYNC_BUS_CUSTOM, 27 V4L2_ASYNC_MATCH_CUSTOM,
27 V4L2_ASYNC_BUS_PLATFORM, 28 V4L2_ASYNC_MATCH_DEVNAME,
28 V4L2_ASYNC_BUS_I2C, 29 V4L2_ASYNC_MATCH_I2C,
30 V4L2_ASYNC_MATCH_OF,
29}; 31};
30 32
31/** 33/**
@@ -36,11 +38,14 @@ enum v4l2_async_bus_type {
36 * probed, to a notifier->waiting list 38 * probed, to a notifier->waiting list
37 */ 39 */
38struct v4l2_async_subdev { 40struct v4l2_async_subdev {
39 enum v4l2_async_bus_type bus_type; 41 enum v4l2_async_match_type match_type;
40 union { 42 union {
41 struct { 43 struct {
44 const struct device_node *node;
45 } of;
46 struct {
42 const char *name; 47 const char *name;
43 } platform; 48 } device_name;
44 struct { 49 struct {
45 int adapter_id; 50 int adapter_id;
46 unsigned short address; 51 unsigned short address;
@@ -57,25 +62,12 @@ struct v4l2_async_subdev {
57}; 62};
58 63
59/** 64/**
60 * v4l2_async_subdev_list - provided by subdevices
61 * @list: links struct v4l2_async_subdev_list objects to a global list
62 * before probing, and onto notifier->done after probing
63 * @asd: pointer to respective struct v4l2_async_subdev
64 * @notifier: pointer to managing notifier
65 */
66struct v4l2_async_subdev_list {
67 struct list_head list;
68 struct v4l2_async_subdev *asd;
69 struct v4l2_async_notifier *notifier;
70};
71
72/**
73 * v4l2_async_notifier - v4l2_device notifier data 65 * v4l2_async_notifier - v4l2_device notifier data
74 * @num_subdevs:number of subdevices 66 * @num_subdevs:number of subdevices
75 * @subdev: array of pointers to subdevice descriptors 67 * @subdevs: array of pointers to subdevice descriptors
76 * @v4l2_dev: pointer to struct v4l2_device 68 * @v4l2_dev: pointer to struct v4l2_device
77 * @waiting: list of struct v4l2_async_subdev, waiting for their drivers 69 * @waiting: list of struct v4l2_async_subdev, waiting for their drivers
78 * @done: list of struct v4l2_async_subdev_list, already probed 70 * @done: list of struct v4l2_subdev, already probed
79 * @list: member in a global list of notifiers 71 * @list: member in a global list of notifiers
80 * @bound: a subdevice driver has successfully probed one of subdevices 72 * @bound: a subdevice driver has successfully probed one of subdevices
81 * @complete: all subdevices have been probed successfully 73 * @complete: all subdevices have been probed successfully
@@ -83,7 +75,7 @@ struct v4l2_async_subdev_list {
83 */ 75 */
84struct v4l2_async_notifier { 76struct v4l2_async_notifier {
85 unsigned int num_subdevs; 77 unsigned int num_subdevs;
86 struct v4l2_async_subdev **subdev; 78 struct v4l2_async_subdev **subdevs;
87 struct v4l2_device *v4l2_dev; 79 struct v4l2_device *v4l2_dev;
88 struct list_head waiting; 80 struct list_head waiting;
89 struct list_head done; 81 struct list_head done;
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 015ff82da73c..16550c439008 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -86,6 +86,7 @@ int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl,
86 const char * const *menu_items); 86 const char * const *menu_items);
87const char *v4l2_ctrl_get_name(u32 id); 87const char *v4l2_ctrl_get_name(u32 id);
88const char * const *v4l2_ctrl_get_menu(u32 id); 88const char * const *v4l2_ctrl_get_menu(u32 id);
89const s64 const *v4l2_ctrl_get_int_menu(u32 id, u32 *len);
89int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); 90int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def);
90int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, 91int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu,
91 struct v4l2_queryctrl *qctrl, const char * const *menu_items); 92 struct v4l2_queryctrl *qctrl, const char * const *menu_items);
@@ -201,19 +202,6 @@ const struct v4l2_frmsize_discrete *v4l2_find_nearest_format(
201 const struct v4l2_discrete_probe *probe, 202 const struct v4l2_discrete_probe *probe,
202 s32 width, s32 height); 203 s32 width, s32 height);
203 204
204bool v4l_match_dv_timings(const struct v4l2_dv_timings *t1,
205 const struct v4l2_dv_timings *t2,
206 unsigned pclock_delta);
207
208bool v4l2_detect_cvt(unsigned frame_height, unsigned hfreq, unsigned vsync,
209 u32 polarities, struct v4l2_dv_timings *fmt);
210
211bool v4l2_detect_gtf(unsigned frame_height, unsigned hfreq, unsigned vsync,
212 u32 polarities, struct v4l2_fract aspect,
213 struct v4l2_dv_timings *fmt);
214
215struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait);
216
217void v4l2_get_timestamp(struct timeval *tv); 205void v4l2_get_timestamp(struct timeval *tv);
218 206
219#endif /* V4L2_COMMON_H_ */ 207#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-dv-timings.h b/include/media/v4l2-dv-timings.h
new file mode 100644
index 000000000000..4becc6716393
--- /dev/null
+++ b/include/media/v4l2-dv-timings.h
@@ -0,0 +1,161 @@
1/*
2 * v4l2-dv-timings - Internal header with dv-timings helper functions
3 *
4 * Copyright 2013 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
5 *
6 * This program is free software; you may redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
12 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
13 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
14 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
15 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17 * SOFTWARE.
18 *
19 */
20
21#ifndef __V4L2_DV_TIMINGS_H
22#define __V4L2_DV_TIMINGS_H
23
24#include <linux/videodev2.h>
25
26/** v4l2_dv_timings_presets: list of all dv_timings presets.
27 */
28extern const struct v4l2_dv_timings v4l2_dv_timings_presets[];
29
30/** v4l2_check_dv_timings_fnc - timings check callback
31 * @t: the v4l2_dv_timings struct.
32 * @handle: a handle from the driver.
33 *
34 * Returns true if the given timings are valid.
35 */
36typedef bool v4l2_check_dv_timings_fnc(const struct v4l2_dv_timings *t, void *handle);
37
38/** v4l2_valid_dv_timings() - are these timings valid?
39 * @t: the v4l2_dv_timings struct.
40 * @cap: the v4l2_dv_timings_cap capabilities.
41 * @fnc: callback to check if this timing is OK. May be NULL.
42 * @fnc_handle: a handle that is passed on to @fnc.
43 *
44 * Returns true if the given dv_timings struct is supported by the
45 * hardware capabilities and the callback function (if non-NULL), returns
46 * false otherwise.
47 */
48bool v4l2_valid_dv_timings(const struct v4l2_dv_timings *t,
49 const struct v4l2_dv_timings_cap *cap,
50 v4l2_check_dv_timings_fnc fnc,
51 void *fnc_handle);
52
53/** v4l2_enum_dv_timings_cap() - Helper function to enumerate possible DV timings based on capabilities
54 * @t: the v4l2_enum_dv_timings struct.
55 * @cap: the v4l2_dv_timings_cap capabilities.
56 * @fnc: callback to check if this timing is OK. May be NULL.
57 * @fnc_handle: a handle that is passed on to @fnc.
58 *
59 * This enumerates dv_timings using the full list of possible CEA-861 and DMT
60 * timings, filtering out any timings that are not supported based on the
61 * hardware capabilities and the callback function (if non-NULL).
62 *
63 * If a valid timing for the given index is found, it will fill in @t and
64 * return 0, otherwise it returns -EINVAL.
65 */
66int v4l2_enum_dv_timings_cap(struct v4l2_enum_dv_timings *t,
67 const struct v4l2_dv_timings_cap *cap,
68 v4l2_check_dv_timings_fnc fnc,
69 void *fnc_handle);
70
71/** v4l2_find_dv_timings_cap() - Find the closest timings struct
72 * @t: the v4l2_enum_dv_timings struct.
73 * @cap: the v4l2_dv_timings_cap capabilities.
74 * @pclock_delta: maximum delta between t->pixelclock and the timing struct
75 * under consideration.
76 * @fnc: callback to check if a given timings struct is OK. May be NULL.
77 * @fnc_handle: a handle that is passed on to @fnc.
78 *
79 * This function tries to map the given timings to an entry in the
80 * full list of possible CEA-861 and DMT timings, filtering out any timings
81 * that are not supported based on the hardware capabilities and the callback
82 * function (if non-NULL).
83 *
84 * On success it will fill in @t with the found timings and it returns true.
85 * On failure it will return false.
86 */
87bool v4l2_find_dv_timings_cap(struct v4l2_dv_timings *t,
88 const struct v4l2_dv_timings_cap *cap,
89 unsigned pclock_delta,
90 v4l2_check_dv_timings_fnc fnc,
91 void *fnc_handle);
92
93/** v4l2_match_dv_timings() - do two timings match?
94 * @measured: the measured timings data.
95 * @standard: the timings according to the standard.
96 * @pclock_delta: maximum delta in Hz between standard->pixelclock and
97 * the measured timings.
98 *
99 * Returns true if the two timings match, returns false otherwise.
100 */
101bool v4l2_match_dv_timings(const struct v4l2_dv_timings *measured,
102 const struct v4l2_dv_timings *standard,
103 unsigned pclock_delta);
104
105/** v4l2_print_dv_timings() - log the contents of a dv_timings struct
106 * @dev_prefix:device prefix for each log line.
107 * @prefix: additional prefix for each log line, may be NULL.
108 * @t: the timings data.
109 * @detailed: if true, give a detailed log.
110 */
111void v4l2_print_dv_timings(const char *dev_prefix, const char *prefix,
112 const struct v4l2_dv_timings *t, bool detailed);
113
114/** v4l2_detect_cvt - detect if the given timings follow the CVT standard
115 * @frame_height - the total height of the frame (including blanking) in lines.
116 * @hfreq - the horizontal frequency in Hz.
117 * @vsync - the height of the vertical sync in lines.
118 * @polarities - the horizontal and vertical polarities (same as struct
119 * v4l2_bt_timings polarities).
120 * @fmt - the resulting timings.
121 *
122 * This function will attempt to detect if the given values correspond to a
123 * valid CVT format. If so, then it will return true, and fmt will be filled
124 * in with the found CVT timings.
125 */
126bool v4l2_detect_cvt(unsigned frame_height, unsigned hfreq, unsigned vsync,
127 u32 polarities, struct v4l2_dv_timings *fmt);
128
129/** v4l2_detect_gtf - detect if the given timings follow the GTF standard
130 * @frame_height - the total height of the frame (including blanking) in lines.
131 * @hfreq - the horizontal frequency in Hz.
132 * @vsync - the height of the vertical sync in lines.
133 * @polarities - the horizontal and vertical polarities (same as struct
134 * v4l2_bt_timings polarities).
135 * @aspect - preferred aspect ratio. GTF has no method of determining the
136 * aspect ratio in order to derive the image width from the
137 * image height, so it has to be passed explicitly. Usually
138 * the native screen aspect ratio is used for this. If it
139 * is not filled in correctly, then 16:9 will be assumed.
140 * @fmt - the resulting timings.
141 *
142 * This function will attempt to detect if the given values correspond to a
143 * valid GTF format. If so, then it will return true, and fmt will be filled
144 * in with the found GTF timings.
145 */
146bool v4l2_detect_gtf(unsigned frame_height, unsigned hfreq, unsigned vsync,
147 u32 polarities, struct v4l2_fract aspect,
148 struct v4l2_dv_timings *fmt);
149
150/** v4l2_calc_aspect_ratio - calculate the aspect ratio based on bytes
151 * 0x15 and 0x16 from the EDID.
152 * @hor_landscape - byte 0x15 from the EDID.
153 * @vert_portrait - byte 0x16 from the EDID.
154 *
155 * Determines the aspect ratio from the EDID.
156 * See VESA Enhanced EDID standard, release A, rev 2, section 3.6.2:
157 * "Horizontal and Vertical Screen Size or Aspect Ratio"
158 */
159struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait);
160
161#endif
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 83ae07e53350..395c4a95a42a 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -40,6 +40,9 @@
40#define V4L2_MBUS_FIELD_EVEN_HIGH (1 << 10) 40#define V4L2_MBUS_FIELD_EVEN_HIGH (1 << 10)
41/* FIELD = 1/0 - Field1 (odd)/Field2 (even) */ 41/* FIELD = 1/0 - Field1 (odd)/Field2 (even) */
42#define V4L2_MBUS_FIELD_EVEN_LOW (1 << 11) 42#define V4L2_MBUS_FIELD_EVEN_LOW (1 << 11)
43/* Active state of Sync-on-green (SoG) signal, 0/1 for LOW/HIGH respectively. */
44#define V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH (1 << 12)
45#define V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW (1 << 13)
43 46
44/* Serial flags */ 47/* Serial flags */
45/* How many lanes the client can use */ 48/* How many lanes the client can use */
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h
index 0f4555b2a31b..44542a20ab81 100644
--- a/include/media/v4l2-mem2mem.h
+++ b/include/media/v4l2-mem2mem.h
@@ -60,6 +60,7 @@ struct v4l2_m2m_queue_ctx {
60 struct list_head rdy_queue; 60 struct list_head rdy_queue;
61 spinlock_t rdy_spinlock; 61 spinlock_t rdy_spinlock;
62 u8 num_rdy; 62 u8 num_rdy;
63 bool buffered;
63}; 64};
64 65
65struct v4l2_m2m_ctx { 66struct v4l2_m2m_ctx {
@@ -134,6 +135,18 @@ struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(struct v4l2_m2m_dev *m2m_dev,
134 void *drv_priv, 135 void *drv_priv,
135 int (*queue_init)(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq)); 136 int (*queue_init)(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq));
136 137
138static inline void v4l2_m2m_set_src_buffered(struct v4l2_m2m_ctx *m2m_ctx,
139 bool buffered)
140{
141 m2m_ctx->out_q_ctx.buffered = buffered;
142}
143
144static inline void v4l2_m2m_set_dst_buffered(struct v4l2_m2m_ctx *m2m_ctx,
145 bool buffered)
146{
147 m2m_ctx->cap_q_ctx.buffered = buffered;
148}
149
137void v4l2_m2m_ctx_release(struct v4l2_m2m_ctx *m2m_ctx); 150void v4l2_m2m_ctx_release(struct v4l2_m2m_ctx *m2m_ctx);
138 151
139void v4l2_m2m_buf_queue(struct v4l2_m2m_ctx *m2m_ctx, struct vb2_buffer *vb); 152void v4l2_m2m_buf_queue(struct v4l2_m2m_ctx *m2m_ctx, struct vb2_buffer *vb);
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 3250cc5e7925..bfda0fe9aeb0 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -586,15 +586,14 @@ struct v4l2_subdev {
586 struct video_device *devnode; 586 struct video_device *devnode;
587 /* pointer to the physical device, if any */ 587 /* pointer to the physical device, if any */
588 struct device *dev; 588 struct device *dev;
589 struct v4l2_async_subdev_list asdl; 589 /* Links this subdev to a global subdev_list or @notifier->done list. */
590 struct list_head async_list;
591 /* Pointer to respective struct v4l2_async_subdev. */
592 struct v4l2_async_subdev *asd;
593 /* Pointer to the managing notifier. */
594 struct v4l2_async_notifier *notifier;
590}; 595};
591 596
592static inline struct v4l2_subdev *v4l2_async_to_subdev(
593 struct v4l2_async_subdev_list *asdl)
594{
595 return container_of(asdl, struct v4l2_subdev, asdl);
596}
597
598#define media_entity_to_v4l2_subdev(ent) \ 597#define media_entity_to_v4l2_subdev(ent) \
599 container_of(ent, struct v4l2_subdev, entity) 598 container_of(ent, struct v4l2_subdev, entity)
600#define vdev_to_v4l2_subdev(vdev) \ 599#define vdev_to_v4l2_subdev(vdev) \
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index d88a098d1aff..6781258d0b67 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -219,8 +219,9 @@ struct vb2_buffer {
219 * configured format and *num_buffers is the total number 219 * configured format and *num_buffers is the total number
220 * of buffers, that are being allocated. When called from 220 * of buffers, that are being allocated. When called from
221 * VIDIOC_CREATE_BUFS, fmt != NULL and it describes the 221 * VIDIOC_CREATE_BUFS, fmt != NULL and it describes the
222 * target frame format. In this case *num_buffers are being 222 * target frame format (if the format isn't valid the
223 * allocated additionally to q->num_buffers. 223 * callback must return -EINVAL). In this case *num_buffers
224 * are being allocated additionally to q->num_buffers.
224 * @wait_prepare: release any locks taken while calling vb2 functions; 225 * @wait_prepare: release any locks taken while calling vb2 functions;
225 * it is called before an ioctl needs to wait for a new 226 * it is called before an ioctl needs to wait for a new
226 * buffer to arrive; required to avoid a deadlock in 227 * buffer to arrive; required to avoid a deadlock in
@@ -236,8 +237,10 @@ struct vb2_buffer {
236 * @buf_prepare: called every time the buffer is queued from userspace 237 * @buf_prepare: called every time the buffer is queued from userspace
237 * and from the VIDIOC_PREPARE_BUF ioctl; drivers may 238 * and from the VIDIOC_PREPARE_BUF ioctl; drivers may
238 * perform any initialization required before each hardware 239 * perform any initialization required before each hardware
239 * operation in this callback; if an error is returned, the 240 * operation in this callback; drivers that support
240 * buffer will not be queued in driver; optional 241 * VIDIOC_CREATE_BUFS must also validate the buffer size;
242 * if an error is returned, the buffer will not be queued
243 * in driver; optional
241 * @buf_finish: called before every dequeue of the buffer back to 244 * @buf_finish: called before every dequeue of the buffer back to
242 * userspace; drivers may perform any operations required 245 * userspace; drivers may perform any operations required
243 * before userspace accesses the buffer; optional 246 * before userspace accesses the buffer; optional
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 4c7c01a73911..c38a005bd0cf 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -26,6 +26,8 @@
26#ifndef NET_9P_CLIENT_H 26#ifndef NET_9P_CLIENT_H
27#define NET_9P_CLIENT_H 27#define NET_9P_CLIENT_H
28 28
29#include <linux/utsname.h>
30
29/* Number of requests per row */ 31/* Number of requests per row */
30#define P9_ROW_MAXTAG 255 32#define P9_ROW_MAXTAG 255
31 33
@@ -134,6 +136,7 @@ struct p9_req_t {
134 * @tagpool - transaction id accounting for session 136 * @tagpool - transaction id accounting for session
135 * @reqs - 2D array of requests 137 * @reqs - 2D array of requests
136 * @max_tag - current maximum tag id allocated 138 * @max_tag - current maximum tag id allocated
139 * @name - node name used as client id
137 * 140 *
138 * The client structure is used to keep track of various per-client 141 * The client structure is used to keep track of various per-client
139 * state that has been instantiated. 142 * state that has been instantiated.
@@ -164,6 +167,8 @@ struct p9_client {
164 struct p9_idpool *tagpool; 167 struct p9_idpool *tagpool;
165 struct p9_req_t *reqs[P9_ROW_MAXTAG]; 168 struct p9_req_t *reqs[P9_ROW_MAXTAG];
166 int max_tag; 169 int max_tag;
170
171 char name[__NEW_UTS_LEN + 1];
167}; 172};
168 173
169/** 174/**
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index d9fa68f26c41..9a36d9297114 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -40,8 +40,6 @@
40 * @close: member function to discard a connection on this transport 40 * @close: member function to discard a connection on this transport
41 * @request: member function to issue a request to the transport 41 * @request: member function to issue a request to the transport
42 * @cancel: member function to cancel a request (if it hasn't been sent) 42 * @cancel: member function to cancel a request (if it hasn't been sent)
43 * @cancelled: member function to notify that a cancelled request will not
44 * not receive a reply
45 * 43 *
46 * This is the basic API for a transport module which is registered by the 44 * This is the basic API for a transport module which is registered by the
47 * transport module with the 9P core network module and used by the client 45 * transport module with the 9P core network module and used by the client
@@ -60,7 +58,6 @@ struct p9_trans_module {
60 void (*close) (struct p9_client *); 58 void (*close) (struct p9_client *);
61 int (*request) (struct p9_client *, struct p9_req_t *req); 59 int (*request) (struct p9_client *, struct p9_req_t *req);
62 int (*cancel) (struct p9_client *, struct p9_req_t *req); 60 int (*cancel) (struct p9_client *, struct p9_req_t *req);
63 int (*cancelled)(struct p9_client *, struct p9_req_t *req);
64 int (*zc_request)(struct p9_client *, struct p9_req_t *, 61 int (*zc_request)(struct p9_client *, struct p9_req_t *,
65 char *, char *, int , int, int, int); 62 char *, char *, int , int, int, int);
66}; 63};
diff --git a/include/net/act_api.h b/include/net/act_api.h
index b8ffac7b6bab..9e90fdff470d 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -82,36 +82,36 @@ struct tc_action_ops {
82 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *); 82 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *);
83}; 83};
84 84
85extern struct tcf_common *tcf_hash_lookup(u32 index, 85struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo);
86 struct tcf_hashinfo *hinfo); 86void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo);
87extern void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo); 87int tcf_hash_release(struct tcf_common *p, int bind,
88extern int tcf_hash_release(struct tcf_common *p, int bind, 88 struct tcf_hashinfo *hinfo);
89 struct tcf_hashinfo *hinfo); 89int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb,
90extern int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb, 90 int type, struct tc_action *a);
91 int type, struct tc_action *a); 91u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo);
92extern u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo); 92int tcf_hash_search(struct tc_action *a, u32 index);
93extern int tcf_hash_search(struct tc_action *a, u32 index); 93struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a,
94extern struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, 94 int bind, struct tcf_hashinfo *hinfo);
95 int bind, struct tcf_hashinfo *hinfo); 95struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est,
96extern struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est, 96 struct tc_action *a, int size,
97 struct tc_action *a, int size, 97 int bind, u32 *idx_gen,
98 int bind, u32 *idx_gen, 98 struct tcf_hashinfo *hinfo);
99 struct tcf_hashinfo *hinfo); 99void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
100extern void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
101 100
102extern int tcf_register_action(struct tc_action_ops *a); 101int tcf_register_action(struct tc_action_ops *a);
103extern int tcf_unregister_action(struct tc_action_ops *a); 102int tcf_unregister_action(struct tc_action_ops *a);
104extern void tcf_action_destroy(struct tc_action *a, int bind); 103void tcf_action_destroy(struct tc_action *a, int bind);
105extern int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res); 104int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a,
106extern struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla, 105 struct tcf_result *res);
107 struct nlattr *est, char *n, int ovr, 106struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla,
108 int bind); 107 struct nlattr *est, char *n, int ovr,
109extern struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla, 108 int bind);
110 struct nlattr *est, char *n, int ovr, 109struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
111 int bind); 110 struct nlattr *est, char *n, int ovr,
112extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); 111 int bind);
113extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); 112int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int);
114extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); 113int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
115extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *, int); 114int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
115int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int);
116#endif /* CONFIG_NET_CLS_ACT */ 116#endif /* CONFIG_NET_CLS_ACT */
117#endif 117#endif
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index c7b181cb47a6..86505bfa5d2c 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -53,51 +53,40 @@ struct prefix_info {
53#define IN6_ADDR_HSIZE_SHIFT 4 53#define IN6_ADDR_HSIZE_SHIFT 4
54#define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT) 54#define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT)
55 55
56extern int addrconf_init(void); 56int addrconf_init(void);
57extern void addrconf_cleanup(void); 57void addrconf_cleanup(void);
58 58
59extern int addrconf_add_ifaddr(struct net *net, 59int addrconf_add_ifaddr(struct net *net, void __user *arg);
60 void __user *arg); 60int addrconf_del_ifaddr(struct net *net, void __user *arg);
61extern int addrconf_del_ifaddr(struct net *net, 61int addrconf_set_dstaddr(struct net *net, void __user *arg);
62 void __user *arg);
63extern int addrconf_set_dstaddr(struct net *net,
64 void __user *arg);
65 62
66extern int ipv6_chk_addr(struct net *net, 63int ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
67 const struct in6_addr *addr, 64 const struct net_device *dev, int strict);
68 const struct net_device *dev,
69 int strict);
70 65
71#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) 66#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
72extern int ipv6_chk_home_addr(struct net *net, 67int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr);
73 const struct in6_addr *addr);
74#endif 68#endif
75 69
76extern int ipv6_chk_prefix(const struct in6_addr *addr, 70bool ipv6_chk_custom_prefix(const struct in6_addr *addr,
77 struct net_device *dev); 71 const unsigned int prefix_len,
78 72 struct net_device *dev);
79extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, 73
80 const struct in6_addr *addr, 74int ipv6_chk_prefix(const struct in6_addr *addr, struct net_device *dev);
81 struct net_device *dev, 75
82 int strict); 76struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
83 77 const struct in6_addr *addr,
84extern int ipv6_dev_get_saddr(struct net *net, 78 struct net_device *dev, int strict);
85 const struct net_device *dev, 79
86 const struct in6_addr *daddr, 80int ipv6_dev_get_saddr(struct net *net, const struct net_device *dev,
87 unsigned int srcprefs, 81 const struct in6_addr *daddr, unsigned int srcprefs,
88 struct in6_addr *saddr); 82 struct in6_addr *saddr);
89extern int __ipv6_get_lladdr(struct inet6_dev *idev, 83int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr,
90 struct in6_addr *addr, 84 unsigned char banned_flags);
91 unsigned char banned_flags); 85int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
92extern int ipv6_get_lladdr(struct net_device *dev, 86 unsigned char banned_flags);
93 struct in6_addr *addr, 87int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2);
94 unsigned char banned_flags); 88void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr);
95extern int ipv6_rcv_saddr_equal(const struct sock *sk, 89void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr);
96 const struct sock *sk2);
97extern void addrconf_join_solict(struct net_device *dev,
98 const struct in6_addr *addr);
99extern void addrconf_leave_solict(struct inet6_dev *idev,
100 const struct in6_addr *addr);
101 90
102static inline unsigned long addrconf_timeout_fixup(u32 timeout, 91static inline unsigned long addrconf_timeout_fixup(u32 timeout,
103 unsigned int unit) 92 unsigned int unit)
@@ -124,41 +113,58 @@ static inline int addrconf_finite_timeout(unsigned long timeout)
124/* 113/*
125 * IPv6 Address Label subsystem (addrlabel.c) 114 * IPv6 Address Label subsystem (addrlabel.c)
126 */ 115 */
127extern int ipv6_addr_label_init(void); 116int ipv6_addr_label_init(void);
128extern void ipv6_addr_label_cleanup(void); 117void ipv6_addr_label_cleanup(void);
129extern void ipv6_addr_label_rtnl_register(void); 118void ipv6_addr_label_rtnl_register(void);
130extern u32 ipv6_addr_label(struct net *net, 119u32 ipv6_addr_label(struct net *net, const struct in6_addr *addr,
131 const struct in6_addr *addr, 120 int type, int ifindex);
132 int type, int ifindex);
133 121
134/* 122/*
135 * multicast prototypes (mcast.c) 123 * multicast prototypes (mcast.c)
136 */ 124 */
137extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, 125int ipv6_sock_mc_join(struct sock *sk, int ifindex,
138 const struct in6_addr *addr); 126 const struct in6_addr *addr);
139extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, 127int ipv6_sock_mc_drop(struct sock *sk, int ifindex,
140 const struct in6_addr *addr); 128 const struct in6_addr *addr);
141extern void ipv6_sock_mc_close(struct sock *sk); 129void ipv6_sock_mc_close(struct sock *sk);
142extern bool inet6_mc_check(struct sock *sk, 130bool inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr,
143 const struct in6_addr *mc_addr, 131 const struct in6_addr *src_addr);
144 const struct in6_addr *src_addr); 132
145 133int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr);
146extern int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr); 134int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr);
147extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr); 135int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr);
148extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr); 136void ipv6_mc_up(struct inet6_dev *idev);
149extern void ipv6_mc_up(struct inet6_dev *idev); 137void ipv6_mc_down(struct inet6_dev *idev);
150extern void ipv6_mc_down(struct inet6_dev *idev); 138void ipv6_mc_unmap(struct inet6_dev *idev);
151extern void ipv6_mc_unmap(struct inet6_dev *idev); 139void ipv6_mc_remap(struct inet6_dev *idev);
152extern void ipv6_mc_remap(struct inet6_dev *idev); 140void ipv6_mc_init_dev(struct inet6_dev *idev);
153extern void ipv6_mc_init_dev(struct inet6_dev *idev); 141void ipv6_mc_destroy_dev(struct inet6_dev *idev);
154extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); 142void addrconf_dad_failure(struct inet6_ifaddr *ifp);
155extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); 143
156 144bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
157extern bool ipv6_chk_mcast_addr(struct net_device *dev, 145 const struct in6_addr *src_addr);
158 const struct in6_addr *group, 146
159 const struct in6_addr *src_addr); 147void ipv6_mc_dad_complete(struct inet6_dev *idev);
160 148
161extern void ipv6_mc_dad_complete(struct inet6_dev *idev); 149/* A stub used by vxlan module. This is ugly, ideally these
150 * symbols should be built into the core kernel.
151 */
152struct ipv6_stub {
153 int (*ipv6_sock_mc_join)(struct sock *sk, int ifindex,
154 const struct in6_addr *addr);
155 int (*ipv6_sock_mc_drop)(struct sock *sk, int ifindex,
156 const struct in6_addr *addr);
157 int (*ipv6_dst_lookup)(struct sock *sk, struct dst_entry **dst,
158 struct flowi6 *fl6);
159 void (*udpv6_encap_enable)(void);
160 void (*ndisc_send_na)(struct net_device *dev, struct neighbour *neigh,
161 const struct in6_addr *daddr,
162 const struct in6_addr *solicited_addr,
163 bool router, bool solicited, bool override, bool inc_opt);
164 struct neigh_table *nd_tbl;
165};
166extern const struct ipv6_stub *ipv6_stub __read_mostly;
167
162/* 168/*
163 * identify MLD packets for MLD filter exceptions 169 * identify MLD packets for MLD filter exceptions
164 */ 170 */
@@ -184,29 +190,31 @@ static inline bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset)
184 return false; 190 return false;
185} 191}
186 192
187extern void addrconf_prefix_rcv(struct net_device *dev, 193void addrconf_prefix_rcv(struct net_device *dev,
188 u8 *opt, int len, bool sllao); 194 u8 *opt, int len, bool sllao);
189 195
190/* 196/*
191 * anycast prototypes (anycast.c) 197 * anycast prototypes (anycast.c)
192 */ 198 */
193extern int ipv6_sock_ac_join(struct sock *sk,int ifindex, const struct in6_addr *addr); 199int ipv6_sock_ac_join(struct sock *sk, int ifindex,
194extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex, const struct in6_addr *addr); 200 const struct in6_addr *addr);
195extern void ipv6_sock_ac_close(struct sock *sk); 201int ipv6_sock_ac_drop(struct sock *sk, int ifindex,
196 202 const struct in6_addr *addr);
197extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); 203void ipv6_sock_ac_close(struct sock *sk);
198extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); 204
199extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, 205int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr);
206int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
207bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
200 const struct in6_addr *addr); 208 const struct in6_addr *addr);
201 209
202 210
203/* Device notifier */ 211/* Device notifier */
204extern int register_inet6addr_notifier(struct notifier_block *nb); 212int register_inet6addr_notifier(struct notifier_block *nb);
205extern int unregister_inet6addr_notifier(struct notifier_block *nb); 213int unregister_inet6addr_notifier(struct notifier_block *nb);
206extern int inet6addr_notifier_call_chain(unsigned long val, void *v); 214int inet6addr_notifier_call_chain(unsigned long val, void *v);
207 215
208extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex, 216void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex,
209 struct ipv6_devconf *devconf); 217 struct ipv6_devconf *devconf);
210 218
211/** 219/**
212 * __in6_dev_get - get inet6_dev pointer from netdevice 220 * __in6_dev_get - get inet6_dev pointer from netdevice
@@ -240,7 +248,7 @@ static inline struct inet6_dev *in6_dev_get(const struct net_device *dev)
240 return idev; 248 return idev;
241} 249}
242 250
243extern void in6_dev_finish_destroy(struct inet6_dev *idev); 251void in6_dev_finish_destroy(struct inet6_dev *idev);
244 252
245static inline void in6_dev_put(struct inet6_dev *idev) 253static inline void in6_dev_put(struct inet6_dev *idev)
246{ 254{
@@ -258,7 +266,7 @@ static inline void in6_dev_hold(struct inet6_dev *idev)
258 atomic_inc(&idev->refcnt); 266 atomic_inc(&idev->refcnt);
259} 267}
260 268
261extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); 269void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp);
262 270
263static inline void in6_ifa_put(struct inet6_ifaddr *ifp) 271static inline void in6_ifa_put(struct inet6_ifaddr *ifp)
264{ 272{
@@ -340,8 +348,8 @@ static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr)
340} 348}
341 349
342#ifdef CONFIG_PROC_FS 350#ifdef CONFIG_PROC_FS
343extern int if6_proc_init(void); 351int if6_proc_init(void);
344extern void if6_proc_exit(void); 352void if6_proc_exit(void);
345#endif 353#endif
346 354
347#endif 355#endif
diff --git a/include/net/af_rxrpc.h b/include/net/af_rxrpc.h
index 03e6e9453623..e797d45a5ae6 100644
--- a/include/net/af_rxrpc.h
+++ b/include/net/af_rxrpc.h
@@ -31,24 +31,21 @@ enum {
31 31
32typedef void (*rxrpc_interceptor_t)(struct sock *, unsigned long, 32typedef void (*rxrpc_interceptor_t)(struct sock *, unsigned long,
33 struct sk_buff *); 33 struct sk_buff *);
34extern void rxrpc_kernel_intercept_rx_messages(struct socket *, 34void rxrpc_kernel_intercept_rx_messages(struct socket *, rxrpc_interceptor_t);
35 rxrpc_interceptor_t); 35struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *,
36extern struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *, 36 struct sockaddr_rxrpc *,
37 struct sockaddr_rxrpc *, 37 struct key *,
38 struct key *, 38 unsigned long,
39 unsigned long, 39 gfp_t);
40 gfp_t); 40int rxrpc_kernel_send_data(struct rxrpc_call *, struct msghdr *, size_t);
41extern int rxrpc_kernel_send_data(struct rxrpc_call *, struct msghdr *, 41void rxrpc_kernel_abort_call(struct rxrpc_call *, u32);
42 size_t); 42void rxrpc_kernel_end_call(struct rxrpc_call *);
43extern void rxrpc_kernel_abort_call(struct rxrpc_call *, u32); 43bool rxrpc_kernel_is_data_last(struct sk_buff *);
44extern void rxrpc_kernel_end_call(struct rxrpc_call *); 44u32 rxrpc_kernel_get_abort_code(struct sk_buff *);
45extern bool rxrpc_kernel_is_data_last(struct sk_buff *); 45int rxrpc_kernel_get_error_number(struct sk_buff *);
46extern u32 rxrpc_kernel_get_abort_code(struct sk_buff *); 46void rxrpc_kernel_data_delivered(struct sk_buff *);
47extern int rxrpc_kernel_get_error_number(struct sk_buff *); 47void rxrpc_kernel_free_skb(struct sk_buff *);
48extern void rxrpc_kernel_data_delivered(struct sk_buff *); 48struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *, unsigned long);
49extern void rxrpc_kernel_free_skb(struct sk_buff *); 49int rxrpc_kernel_reject_call(struct socket *);
50extern struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *,
51 unsigned long);
52extern int rxrpc_kernel_reject_call(struct socket *);
53 50
54#endif /* _NET_RXRPC_H */ 51#endif /* _NET_RXRPC_H */
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index dbdfd2b0f3b3..a175ba4a7adb 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -6,12 +6,12 @@
6#include <linux/mutex.h> 6#include <linux/mutex.h>
7#include <net/sock.h> 7#include <net/sock.h>
8 8
9extern void unix_inflight(struct file *fp); 9void unix_inflight(struct file *fp);
10extern void unix_notinflight(struct file *fp); 10void unix_notinflight(struct file *fp);
11extern void unix_gc(void); 11void unix_gc(void);
12extern void wait_for_unix_gc(void); 12void wait_for_unix_gc(void);
13extern struct sock *unix_get_socket(struct file *filp); 13struct sock *unix_get_socket(struct file *filp);
14extern struct sock *unix_peer_get(struct sock *); 14struct sock *unix_peer_get(struct sock *);
15 15
16#define UNIX_HASH_SIZE 256 16#define UNIX_HASH_SIZE 256
17#define UNIX_HASH_BITS 8 17#define UNIX_HASH_BITS 8
@@ -35,6 +35,7 @@ struct unix_skb_parms {
35#ifdef CONFIG_SECURITY_NETWORK 35#ifdef CONFIG_SECURITY_NETWORK
36 u32 secid; /* Security ID */ 36 u32 secid; /* Security ID */
37#endif 37#endif
38 u32 consumed;
38}; 39};
39 40
40#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb)) 41#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb))
@@ -71,8 +72,8 @@ long unix_inq_len(struct sock *sk);
71long unix_outq_len(struct sock *sk); 72long unix_outq_len(struct sock *sk);
72 73
73#ifdef CONFIG_SYSCTL 74#ifdef CONFIG_SYSCTL
74extern int unix_sysctl_register(struct net *net); 75int unix_sysctl_register(struct net *net);
75extern void unix_sysctl_unregister(struct net *net); 76void unix_sysctl_unregister(struct net *net);
76#else 77#else
77static inline int unix_sysctl_register(struct net *net) { return 0; } 78static inline int unix_sysctl_register(struct net *net) { return 0; }
78static inline void unix_sysctl_unregister(struct net *net) {} 79static inline void unix_sysctl_unregister(struct net *net) {}
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
new file mode 100644
index 000000000000..7d64d3609ec9
--- /dev/null
+++ b/include/net/af_vsock.h
@@ -0,0 +1,175 @@
1/*
2 * VMware vSockets Driver
3 *
4 * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation version 2 and no later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef __AF_VSOCK_H__
17#define __AF_VSOCK_H__
18
19#include <linux/kernel.h>
20#include <linux/workqueue.h>
21#include <linux/vm_sockets.h>
22
23#include "vsock_addr.h"
24
25#define LAST_RESERVED_PORT 1023
26
27#define vsock_sk(__sk) ((struct vsock_sock *)__sk)
28#define sk_vsock(__vsk) (&(__vsk)->sk)
29
30struct vsock_sock {
31 /* sk must be the first member. */
32 struct sock sk;
33 struct sockaddr_vm local_addr;
34 struct sockaddr_vm remote_addr;
35 /* Links for the global tables of bound and connected sockets. */
36 struct list_head bound_table;
37 struct list_head connected_table;
38 /* Accessed without the socket lock held. This means it can never be
39 * modified outsided of socket create or destruct.
40 */
41 bool trusted;
42 bool cached_peer_allow_dgram; /* Dgram communication allowed to
43 * cached peer?
44 */
45 u32 cached_peer; /* Context ID of last dgram destination check. */
46 const struct cred *owner;
47 /* Rest are SOCK_STREAM only. */
48 long connect_timeout;
49 /* Listening socket that this came from. */
50 struct sock *listener;
51 /* Used for pending list and accept queue during connection handshake.
52 * The listening socket is the head for both lists. Sockets created
53 * for connection requests are placed in the pending list until they
54 * are connected, at which point they are put in the accept queue list
55 * so they can be accepted in accept(). If accept() cannot accept the
56 * connection, it is marked as rejected so the cleanup function knows
57 * to clean up the socket.
58 */
59 struct list_head pending_links;
60 struct list_head accept_queue;
61 bool rejected;
62 struct delayed_work dwork;
63 u32 peer_shutdown;
64 bool sent_request;
65 bool ignore_connecting_rst;
66
67 /* Private to transport. */
68 void *trans;
69};
70
71s64 vsock_stream_has_data(struct vsock_sock *vsk);
72s64 vsock_stream_has_space(struct vsock_sock *vsk);
73void vsock_pending_work(struct work_struct *work);
74struct sock *__vsock_create(struct net *net,
75 struct socket *sock,
76 struct sock *parent,
77 gfp_t priority, unsigned short type);
78
79/**** TRANSPORT ****/
80
81struct vsock_transport_recv_notify_data {
82 u64 data1; /* Transport-defined. */
83 u64 data2; /* Transport-defined. */
84 bool notify_on_block;
85};
86
87struct vsock_transport_send_notify_data {
88 u64 data1; /* Transport-defined. */
89 u64 data2; /* Transport-defined. */
90};
91
92struct vsock_transport {
93 /* Initialize/tear-down socket. */
94 int (*init)(struct vsock_sock *, struct vsock_sock *);
95 void (*destruct)(struct vsock_sock *);
96 void (*release)(struct vsock_sock *);
97
98 /* Connections. */
99 int (*connect)(struct vsock_sock *);
100
101 /* DGRAM. */
102 int (*dgram_bind)(struct vsock_sock *, struct sockaddr_vm *);
103 int (*dgram_dequeue)(struct kiocb *kiocb, struct vsock_sock *vsk,
104 struct msghdr *msg, size_t len, int flags);
105 int (*dgram_enqueue)(struct vsock_sock *, struct sockaddr_vm *,
106 struct iovec *, size_t len);
107 bool (*dgram_allow)(u32 cid, u32 port);
108
109 /* STREAM. */
110 /* TODO: stream_bind() */
111 ssize_t (*stream_dequeue)(struct vsock_sock *, struct iovec *,
112 size_t len, int flags);
113 ssize_t (*stream_enqueue)(struct vsock_sock *, struct iovec *,
114 size_t len);
115 s64 (*stream_has_data)(struct vsock_sock *);
116 s64 (*stream_has_space)(struct vsock_sock *);
117 u64 (*stream_rcvhiwat)(struct vsock_sock *);
118 bool (*stream_is_active)(struct vsock_sock *);
119 bool (*stream_allow)(u32 cid, u32 port);
120
121 /* Notification. */
122 int (*notify_poll_in)(struct vsock_sock *, size_t, bool *);
123 int (*notify_poll_out)(struct vsock_sock *, size_t, bool *);
124 int (*notify_recv_init)(struct vsock_sock *, size_t,
125 struct vsock_transport_recv_notify_data *);
126 int (*notify_recv_pre_block)(struct vsock_sock *, size_t,
127 struct vsock_transport_recv_notify_data *);
128 int (*notify_recv_pre_dequeue)(struct vsock_sock *, size_t,
129 struct vsock_transport_recv_notify_data *);
130 int (*notify_recv_post_dequeue)(struct vsock_sock *, size_t,
131 ssize_t, bool, struct vsock_transport_recv_notify_data *);
132 int (*notify_send_init)(struct vsock_sock *,
133 struct vsock_transport_send_notify_data *);
134 int (*notify_send_pre_block)(struct vsock_sock *,
135 struct vsock_transport_send_notify_data *);
136 int (*notify_send_pre_enqueue)(struct vsock_sock *,
137 struct vsock_transport_send_notify_data *);
138 int (*notify_send_post_enqueue)(struct vsock_sock *, ssize_t,
139 struct vsock_transport_send_notify_data *);
140
141 /* Shutdown. */
142 int (*shutdown)(struct vsock_sock *, int);
143
144 /* Buffer sizes. */
145 void (*set_buffer_size)(struct vsock_sock *, u64);
146 void (*set_min_buffer_size)(struct vsock_sock *, u64);
147 void (*set_max_buffer_size)(struct vsock_sock *, u64);
148 u64 (*get_buffer_size)(struct vsock_sock *);
149 u64 (*get_min_buffer_size)(struct vsock_sock *);
150 u64 (*get_max_buffer_size)(struct vsock_sock *);
151
152 /* Addressing. */
153 u32 (*get_local_cid)(void);
154};
155
156/**** CORE ****/
157
158int vsock_core_init(const struct vsock_transport *t);
159void vsock_core_exit(void);
160
161/**** UTILS ****/
162
163void vsock_release_pending(struct sock *pending);
164void vsock_add_pending(struct sock *listener, struct sock *pending);
165void vsock_remove_pending(struct sock *listener, struct sock *pending);
166void vsock_enqueue_accept(struct sock *listener, struct sock *connected);
167void vsock_insert_connected(struct vsock_sock *vsk);
168void vsock_remove_bound(struct vsock_sock *vsk);
169void vsock_remove_connected(struct vsock_sock *vsk);
170struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr);
171struct sock *vsock_find_connected_socket(struct sockaddr_vm *src,
172 struct sockaddr_vm *dst);
173void vsock_for_each_connected_socket(void (*fn)(struct sock *sk));
174
175#endif /* __AF_VSOCK_H__ */
diff --git a/include/net/arp.h b/include/net/arp.h
index b630dae03411..7509d9da4e36 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -46,22 +46,22 @@ static inline struct neighbour *__ipv4_neigh_lookup(struct net_device *dev, u32
46 return n; 46 return n;
47} 47}
48 48
49extern void arp_init(void); 49void arp_init(void);
50extern int arp_find(unsigned char *haddr, struct sk_buff *skb); 50int arp_find(unsigned char *haddr, struct sk_buff *skb);
51extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg); 51int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg);
52extern void arp_send(int type, int ptype, __be32 dest_ip, 52void arp_send(int type, int ptype, __be32 dest_ip,
53 struct net_device *dev, __be32 src_ip, 53 struct net_device *dev, __be32 src_ip,
54 const unsigned char *dest_hw, 54 const unsigned char *dest_hw,
55 const unsigned char *src_hw, const unsigned char *th); 55 const unsigned char *src_hw, const unsigned char *th);
56extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir); 56int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir);
57extern void arp_ifdown(struct net_device *dev); 57void arp_ifdown(struct net_device *dev);
58 58
59extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, 59struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
60 struct net_device *dev, __be32 src_ip, 60 struct net_device *dev, __be32 src_ip,
61 const unsigned char *dest_hw, 61 const unsigned char *dest_hw,
62 const unsigned char *src_hw, 62 const unsigned char *src_hw,
63 const unsigned char *target_hw); 63 const unsigned char *target_hw);
64extern void arp_xmit(struct sk_buff *skb); 64void arp_xmit(struct sk_buff *skb);
65int arp_invalidate(struct net_device *dev, __be32 ip); 65int arp_invalidate(struct net_device *dev, __be32 ip);
66 66
67#endif /* _ARP_H */ 67#endif /* _ARP_H */
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 89ed9ac5701f..bf0396e9a5d3 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -195,7 +195,7 @@ static inline void ax25_hold_route(ax25_route *ax25_rt)
195 atomic_inc(&ax25_rt->refcount); 195 atomic_inc(&ax25_rt->refcount);
196} 196}
197 197
198extern void __ax25_put_route(ax25_route *ax25_rt); 198void __ax25_put_route(ax25_route *ax25_rt);
199 199
200static inline void ax25_put_route(ax25_route *ax25_rt) 200static inline void ax25_put_route(ax25_route *ax25_rt)
201{ 201{
@@ -272,30 +272,31 @@ static inline __be16 ax25_type_trans(struct sk_buff *skb, struct net_device *dev
272/* af_ax25.c */ 272/* af_ax25.c */
273extern struct hlist_head ax25_list; 273extern struct hlist_head ax25_list;
274extern spinlock_t ax25_list_lock; 274extern spinlock_t ax25_list_lock;
275extern void ax25_cb_add(ax25_cb *); 275void ax25_cb_add(ax25_cb *);
276struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int); 276struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int);
277struct sock *ax25_get_socket(ax25_address *, ax25_address *, int); 277struct sock *ax25_get_socket(ax25_address *, ax25_address *, int);
278extern ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *, struct net_device *); 278ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *,
279extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int); 279 struct net_device *);
280extern void ax25_destroy_socket(ax25_cb *); 280void ax25_send_to_raw(ax25_address *, struct sk_buff *, int);
281extern ax25_cb * __must_check ax25_create_cb(void); 281void ax25_destroy_socket(ax25_cb *);
282extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); 282ax25_cb * __must_check ax25_create_cb(void);
283extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *); 283void ax25_fillin_cb(ax25_cb *, ax25_dev *);
284struct sock *ax25_make_new(struct sock *, struct ax25_dev *);
284 285
285/* ax25_addr.c */ 286/* ax25_addr.c */
286extern const ax25_address ax25_bcast; 287extern const ax25_address ax25_bcast;
287extern const ax25_address ax25_defaddr; 288extern const ax25_address ax25_defaddr;
288extern const ax25_address null_ax25_address; 289extern const ax25_address null_ax25_address;
289extern char *ax2asc(char *buf, const ax25_address *); 290char *ax2asc(char *buf, const ax25_address *);
290extern void asc2ax(ax25_address *addr, const char *callsign); 291void asc2ax(ax25_address *addr, const char *callsign);
291extern int ax25cmp(const ax25_address *, const ax25_address *); 292int ax25cmp(const ax25_address *, const ax25_address *);
292extern int ax25digicmp(const ax25_digi *, const ax25_digi *); 293int ax25digicmp(const ax25_digi *, const ax25_digi *);
293extern const unsigned char *ax25_addr_parse(const unsigned char *, int, 294const unsigned char *ax25_addr_parse(const unsigned char *, int,
294 ax25_address *, ax25_address *, ax25_digi *, int *, int *); 295 ax25_address *, ax25_address *, ax25_digi *, int *, int *);
295extern int ax25_addr_build(unsigned char *, const ax25_address *, 296int ax25_addr_build(unsigned char *, const ax25_address *,
296 const ax25_address *, const ax25_digi *, int, int); 297 const ax25_address *, const ax25_digi *, int, int);
297extern int ax25_addr_size(const ax25_digi *); 298int ax25_addr_size(const ax25_digi *);
298extern void ax25_digi_invert(const ax25_digi *, ax25_digi *); 299void ax25_digi_invert(const ax25_digi *, ax25_digi *);
299 300
300/* ax25_dev.c */ 301/* ax25_dev.c */
301extern ax25_dev *ax25_dev_list; 302extern ax25_dev *ax25_dev_list;
@@ -306,33 +307,33 @@ static inline ax25_dev *ax25_dev_ax25dev(struct net_device *dev)
306 return dev->ax25_ptr; 307 return dev->ax25_ptr;
307} 308}
308 309
309extern ax25_dev *ax25_addr_ax25dev(ax25_address *); 310ax25_dev *ax25_addr_ax25dev(ax25_address *);
310extern void ax25_dev_device_up(struct net_device *); 311void ax25_dev_device_up(struct net_device *);
311extern void ax25_dev_device_down(struct net_device *); 312void ax25_dev_device_down(struct net_device *);
312extern int ax25_fwd_ioctl(unsigned int, struct ax25_fwd_struct *); 313int ax25_fwd_ioctl(unsigned int, struct ax25_fwd_struct *);
313extern struct net_device *ax25_fwd_dev(struct net_device *); 314struct net_device *ax25_fwd_dev(struct net_device *);
314extern void ax25_dev_free(void); 315void ax25_dev_free(void);
315 316
316/* ax25_ds_in.c */ 317/* ax25_ds_in.c */
317extern int ax25_ds_frame_in(ax25_cb *, struct sk_buff *, int); 318int ax25_ds_frame_in(ax25_cb *, struct sk_buff *, int);
318 319
319/* ax25_ds_subr.c */ 320/* ax25_ds_subr.c */
320extern void ax25_ds_nr_error_recovery(ax25_cb *); 321void ax25_ds_nr_error_recovery(ax25_cb *);
321extern void ax25_ds_enquiry_response(ax25_cb *); 322void ax25_ds_enquiry_response(ax25_cb *);
322extern void ax25_ds_establish_data_link(ax25_cb *); 323void ax25_ds_establish_data_link(ax25_cb *);
323extern void ax25_dev_dama_off(ax25_dev *); 324void ax25_dev_dama_off(ax25_dev *);
324extern void ax25_dama_on(ax25_cb *); 325void ax25_dama_on(ax25_cb *);
325extern void ax25_dama_off(ax25_cb *); 326void ax25_dama_off(ax25_cb *);
326 327
327/* ax25_ds_timer.c */ 328/* ax25_ds_timer.c */
328extern void ax25_ds_setup_timer(ax25_dev *); 329void ax25_ds_setup_timer(ax25_dev *);
329extern void ax25_ds_set_timer(ax25_dev *); 330void ax25_ds_set_timer(ax25_dev *);
330extern void ax25_ds_del_timer(ax25_dev *); 331void ax25_ds_del_timer(ax25_dev *);
331extern void ax25_ds_timer(ax25_cb *); 332void ax25_ds_timer(ax25_cb *);
332extern void ax25_ds_t1_timeout(ax25_cb *); 333void ax25_ds_t1_timeout(ax25_cb *);
333extern void ax25_ds_heartbeat_expiry(ax25_cb *); 334void ax25_ds_heartbeat_expiry(ax25_cb *);
334extern void ax25_ds_t3timer_expiry(ax25_cb *); 335void ax25_ds_t3timer_expiry(ax25_cb *);
335extern void ax25_ds_idletimer_expiry(ax25_cb *); 336void ax25_ds_idletimer_expiry(ax25_cb *);
336 337
337/* ax25_iface.c */ 338/* ax25_iface.c */
338 339
@@ -342,107 +343,109 @@ struct ax25_protocol {
342 int (*func)(struct sk_buff *, ax25_cb *); 343 int (*func)(struct sk_buff *, ax25_cb *);
343}; 344};
344 345
345extern void ax25_register_pid(struct ax25_protocol *ap); 346void ax25_register_pid(struct ax25_protocol *ap);
346extern void ax25_protocol_release(unsigned int); 347void ax25_protocol_release(unsigned int);
347 348
348struct ax25_linkfail { 349struct ax25_linkfail {
349 struct hlist_node lf_node; 350 struct hlist_node lf_node;
350 void (*func)(ax25_cb *, int); 351 void (*func)(ax25_cb *, int);
351}; 352};
352 353
353extern void ax25_linkfail_register(struct ax25_linkfail *lf); 354void ax25_linkfail_register(struct ax25_linkfail *lf);
354extern void ax25_linkfail_release(struct ax25_linkfail *lf); 355void ax25_linkfail_release(struct ax25_linkfail *lf);
355extern int __must_check ax25_listen_register(ax25_address *, 356int __must_check ax25_listen_register(ax25_address *, struct net_device *);
356 struct net_device *); 357void ax25_listen_release(ax25_address *, struct net_device *);
357extern void ax25_listen_release(ax25_address *, struct net_device *); 358int(*ax25_protocol_function(unsigned int))(struct sk_buff *, ax25_cb *);
358extern int (*ax25_protocol_function(unsigned int))(struct sk_buff *, ax25_cb *); 359int ax25_listen_mine(ax25_address *, struct net_device *);
359extern int ax25_listen_mine(ax25_address *, struct net_device *); 360void ax25_link_failed(ax25_cb *, int);
360extern void ax25_link_failed(ax25_cb *, int); 361int ax25_protocol_is_registered(unsigned int);
361extern int ax25_protocol_is_registered(unsigned int);
362 362
363/* ax25_in.c */ 363/* ax25_in.c */
364extern int ax25_rx_iframe(ax25_cb *, struct sk_buff *); 364int ax25_rx_iframe(ax25_cb *, struct sk_buff *);
365extern int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); 365int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *,
366 struct net_device *);
366 367
367/* ax25_ip.c */ 368/* ax25_ip.c */
368extern int ax25_hard_header(struct sk_buff *, struct net_device *, 369int ax25_hard_header(struct sk_buff *, struct net_device *, unsigned short,
369 unsigned short, const void *, 370 const void *, const void *, unsigned int);
370 const void *, unsigned int); 371int ax25_rebuild_header(struct sk_buff *);
371extern int ax25_rebuild_header(struct sk_buff *);
372extern const struct header_ops ax25_header_ops; 372extern const struct header_ops ax25_header_ops;
373 373
374/* ax25_out.c */ 374/* ax25_out.c */
375extern ax25_cb *ax25_send_frame(struct sk_buff *, int, ax25_address *, ax25_address *, ax25_digi *, struct net_device *); 375ax25_cb *ax25_send_frame(struct sk_buff *, int, ax25_address *, ax25_address *,
376extern void ax25_output(ax25_cb *, int, struct sk_buff *); 376 ax25_digi *, struct net_device *);
377extern void ax25_kick(ax25_cb *); 377void ax25_output(ax25_cb *, int, struct sk_buff *);
378extern void ax25_transmit_buffer(ax25_cb *, struct sk_buff *, int); 378void ax25_kick(ax25_cb *);
379extern void ax25_queue_xmit(struct sk_buff *skb, struct net_device *dev); 379void ax25_transmit_buffer(ax25_cb *, struct sk_buff *, int);
380extern int ax25_check_iframes_acked(ax25_cb *, unsigned short); 380void ax25_queue_xmit(struct sk_buff *skb, struct net_device *dev);
381int ax25_check_iframes_acked(ax25_cb *, unsigned short);
381 382
382/* ax25_route.c */ 383/* ax25_route.c */
383extern void ax25_rt_device_down(struct net_device *); 384void ax25_rt_device_down(struct net_device *);
384extern int ax25_rt_ioctl(unsigned int, void __user *); 385int ax25_rt_ioctl(unsigned int, void __user *);
385extern const struct file_operations ax25_route_fops; 386extern const struct file_operations ax25_route_fops;
386extern ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev); 387ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev);
387extern int ax25_rt_autobind(ax25_cb *, ax25_address *); 388int ax25_rt_autobind(ax25_cb *, ax25_address *);
388extern struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, ax25_address *, ax25_digi *); 389struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *,
389extern void ax25_rt_free(void); 390 ax25_address *, ax25_digi *);
391void ax25_rt_free(void);
390 392
391/* ax25_std_in.c */ 393/* ax25_std_in.c */
392extern int ax25_std_frame_in(ax25_cb *, struct sk_buff *, int); 394int ax25_std_frame_in(ax25_cb *, struct sk_buff *, int);
393 395
394/* ax25_std_subr.c */ 396/* ax25_std_subr.c */
395extern void ax25_std_nr_error_recovery(ax25_cb *); 397void ax25_std_nr_error_recovery(ax25_cb *);
396extern void ax25_std_establish_data_link(ax25_cb *); 398void ax25_std_establish_data_link(ax25_cb *);
397extern void ax25_std_transmit_enquiry(ax25_cb *); 399void ax25_std_transmit_enquiry(ax25_cb *);
398extern void ax25_std_enquiry_response(ax25_cb *); 400void ax25_std_enquiry_response(ax25_cb *);
399extern void ax25_std_timeout_response(ax25_cb *); 401void ax25_std_timeout_response(ax25_cb *);
400 402
401/* ax25_std_timer.c */ 403/* ax25_std_timer.c */
402extern void ax25_std_heartbeat_expiry(ax25_cb *); 404void ax25_std_heartbeat_expiry(ax25_cb *);
403extern void ax25_std_t1timer_expiry(ax25_cb *); 405void ax25_std_t1timer_expiry(ax25_cb *);
404extern void ax25_std_t2timer_expiry(ax25_cb *); 406void ax25_std_t2timer_expiry(ax25_cb *);
405extern void ax25_std_t3timer_expiry(ax25_cb *); 407void ax25_std_t3timer_expiry(ax25_cb *);
406extern void ax25_std_idletimer_expiry(ax25_cb *); 408void ax25_std_idletimer_expiry(ax25_cb *);
407 409
408/* ax25_subr.c */ 410/* ax25_subr.c */
409extern void ax25_clear_queues(ax25_cb *); 411void ax25_clear_queues(ax25_cb *);
410extern void ax25_frames_acked(ax25_cb *, unsigned short); 412void ax25_frames_acked(ax25_cb *, unsigned short);
411extern void ax25_requeue_frames(ax25_cb *); 413void ax25_requeue_frames(ax25_cb *);
412extern int ax25_validate_nr(ax25_cb *, unsigned short); 414int ax25_validate_nr(ax25_cb *, unsigned short);
413extern int ax25_decode(ax25_cb *, struct sk_buff *, int *, int *, int *); 415int ax25_decode(ax25_cb *, struct sk_buff *, int *, int *, int *);
414extern void ax25_send_control(ax25_cb *, int, int, int); 416void ax25_send_control(ax25_cb *, int, int, int);
415extern void ax25_return_dm(struct net_device *, ax25_address *, ax25_address *, ax25_digi *); 417void ax25_return_dm(struct net_device *, ax25_address *, ax25_address *,
416extern void ax25_calculate_t1(ax25_cb *); 418 ax25_digi *);
417extern void ax25_calculate_rtt(ax25_cb *); 419void ax25_calculate_t1(ax25_cb *);
418extern void ax25_disconnect(ax25_cb *, int); 420void ax25_calculate_rtt(ax25_cb *);
421void ax25_disconnect(ax25_cb *, int);
419 422
420/* ax25_timer.c */ 423/* ax25_timer.c */
421extern void ax25_setup_timers(ax25_cb *); 424void ax25_setup_timers(ax25_cb *);
422extern void ax25_start_heartbeat(ax25_cb *); 425void ax25_start_heartbeat(ax25_cb *);
423extern void ax25_start_t1timer(ax25_cb *); 426void ax25_start_t1timer(ax25_cb *);
424extern void ax25_start_t2timer(ax25_cb *); 427void ax25_start_t2timer(ax25_cb *);
425extern void ax25_start_t3timer(ax25_cb *); 428void ax25_start_t3timer(ax25_cb *);
426extern void ax25_start_idletimer(ax25_cb *); 429void ax25_start_idletimer(ax25_cb *);
427extern void ax25_stop_heartbeat(ax25_cb *); 430void ax25_stop_heartbeat(ax25_cb *);
428extern void ax25_stop_t1timer(ax25_cb *); 431void ax25_stop_t1timer(ax25_cb *);
429extern void ax25_stop_t2timer(ax25_cb *); 432void ax25_stop_t2timer(ax25_cb *);
430extern void ax25_stop_t3timer(ax25_cb *); 433void ax25_stop_t3timer(ax25_cb *);
431extern void ax25_stop_idletimer(ax25_cb *); 434void ax25_stop_idletimer(ax25_cb *);
432extern int ax25_t1timer_running(ax25_cb *); 435int ax25_t1timer_running(ax25_cb *);
433extern unsigned long ax25_display_timer(struct timer_list *); 436unsigned long ax25_display_timer(struct timer_list *);
434 437
435/* ax25_uid.c */ 438/* ax25_uid.c */
436extern int ax25_uid_policy; 439extern int ax25_uid_policy;
437extern ax25_uid_assoc *ax25_findbyuid(kuid_t); 440ax25_uid_assoc *ax25_findbyuid(kuid_t);
438extern int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *); 441int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *);
439extern const struct file_operations ax25_uid_fops; 442extern const struct file_operations ax25_uid_fops;
440extern void ax25_uid_free(void); 443void ax25_uid_free(void);
441 444
442/* sysctl_net_ax25.c */ 445/* sysctl_net_ax25.c */
443#ifdef CONFIG_SYSCTL 446#ifdef CONFIG_SYSCTL
444extern int ax25_register_dev_sysctl(ax25_dev *ax25_dev); 447int ax25_register_dev_sysctl(ax25_dev *ax25_dev);
445extern void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev); 448void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev);
446#else 449#else
447static inline int ax25_register_dev_sysctl(ax25_dev *ax25_dev) { return 0; } 450static inline int ax25_register_dev_sysctl(ax25_dev *ax25_dev) { return 0; }
448static inline void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev) {} 451static inline void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev) {}
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 10eb9b389014..10d43d8c7037 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -107,6 +107,14 @@ struct bt_power {
107 */ 107 */
108#define BT_CHANNEL_POLICY_AMP_PREFERRED 2 108#define BT_CHANNEL_POLICY_AMP_PREFERRED 2
109 109
110#define BT_VOICE 11
111struct bt_voice {
112 __u16 setting;
113};
114
115#define BT_VOICE_TRANSPARENT 0x0003
116#define BT_VOICE_CVSD_16BIT 0x0060
117
110__printf(1, 2) 118__printf(1, 2)
111int bt_info(const char *fmt, ...); 119int bt_info(const char *fmt, ...);
112__printf(1, 2) 120__printf(1, 2)
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 3c592cf473da..15f10841e2b5 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -104,6 +104,7 @@ enum {
104enum { 104enum {
105 HCI_SETUP, 105 HCI_SETUP,
106 HCI_AUTO_OFF, 106 HCI_AUTO_OFF,
107 HCI_RFKILLED,
107 HCI_MGMT, 108 HCI_MGMT,
108 HCI_PAIRABLE, 109 HCI_PAIRABLE,
109 HCI_SERVICE_CACHE, 110 HCI_SERVICE_CACHE,
@@ -238,6 +239,7 @@ enum {
238#define LMP_CVSD 0x01 239#define LMP_CVSD 0x01
239#define LMP_PSCHEME 0x02 240#define LMP_PSCHEME 0x02
240#define LMP_PCONTROL 0x04 241#define LMP_PCONTROL 0x04
242#define LMP_TRANSPARENT 0x08
241 243
242#define LMP_RSSI_INQ 0x40 244#define LMP_RSSI_INQ 0x40
243#define LMP_ESCO 0x80 245#define LMP_ESCO 0x80
@@ -296,6 +298,12 @@ enum {
296#define HCI_AT_GENERAL_BONDING 0x04 298#define HCI_AT_GENERAL_BONDING 0x04
297#define HCI_AT_GENERAL_BONDING_MITM 0x05 299#define HCI_AT_GENERAL_BONDING_MITM 0x05
298 300
301/* I/O capabilities */
302#define HCI_IO_DISPLAY_ONLY 0x00
303#define HCI_IO_DISPLAY_YESNO 0x01
304#define HCI_IO_KEYBOARD_ONLY 0x02
305#define HCI_IO_NO_INPUT_OUTPUT 0x03
306
299/* Link Key types */ 307/* Link Key types */
300#define HCI_LK_COMBINATION 0x00 308#define HCI_LK_COMBINATION 0x00
301#define HCI_LK_LOCAL_UNIT 0x01 309#define HCI_LK_LOCAL_UNIT 0x01
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index f77885ea78c2..3ede820d328f 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -320,6 +320,7 @@ struct hci_conn {
320 __u32 passkey_notify; 320 __u32 passkey_notify;
321 __u8 passkey_entered; 321 __u8 passkey_entered;
322 __u16 disc_timeout; 322 __u16 disc_timeout;
323 __u16 setting;
323 unsigned long flags; 324 unsigned long flags;
324 325
325 __u8 remote_cap; 326 __u8 remote_cap;
@@ -569,7 +570,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev,
569} 570}
570 571
571void hci_disconnect(struct hci_conn *conn, __u8 reason); 572void hci_disconnect(struct hci_conn *conn, __u8 reason);
572void hci_setup_sync(struct hci_conn *conn, __u16 handle); 573bool hci_setup_sync(struct hci_conn *conn, __u16 handle);
573void hci_sco_setup(struct hci_conn *conn, __u8 status); 574void hci_sco_setup(struct hci_conn *conn, __u8 status);
574 575
575struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst); 576struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst);
@@ -584,6 +585,8 @@ struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle);
584 585
585struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, 586struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
586 __u8 dst_type, __u8 sec_level, __u8 auth_type); 587 __u8 dst_type, __u8 sec_level, __u8 auth_type);
588struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst,
589 __u16 setting);
587int hci_conn_check_link_mode(struct hci_conn *conn); 590int hci_conn_check_link_mode(struct hci_conn *conn);
588int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); 591int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level);
589int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type); 592int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type);
@@ -797,6 +800,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
797#define lmp_lsto_capable(dev) ((dev)->features[0][7] & LMP_LSTO) 800#define lmp_lsto_capable(dev) ((dev)->features[0][7] & LMP_LSTO)
798#define lmp_inq_tx_pwr_capable(dev) ((dev)->features[0][7] & LMP_INQ_TX_PWR) 801#define lmp_inq_tx_pwr_capable(dev) ((dev)->features[0][7] & LMP_INQ_TX_PWR)
799#define lmp_ext_feat_capable(dev) ((dev)->features[0][7] & LMP_EXTFEATURES) 802#define lmp_ext_feat_capable(dev) ((dev)->features[0][7] & LMP_EXTFEATURES)
803#define lmp_transp_capable(dev) ((dev)->features[0][2] & LMP_TRANSPARENT)
800 804
801/* ----- Extended LMP capabilities ----- */ 805/* ----- Extended LMP capabilities ----- */
802#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP) 806#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP)
@@ -1213,4 +1217,8 @@ void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],
1213 1217
1214u8 bdaddr_to_le(u8 bdaddr_type); 1218u8 bdaddr_to_le(u8 bdaddr_type);
1215 1219
1220#define SCO_AIRMODE_MASK 0x0003
1221#define SCO_AIRMODE_CVSD 0x0000
1222#define SCO_AIRMODE_TRANSP 0x0003
1223
1216#endif /* __HCI_CORE_H */ 1224#endif /* __HCI_CORE_H */
diff --git a/include/net/bluetooth/sco.h b/include/net/bluetooth/sco.h
index 1e35c43657c8..e252a31ee6b6 100644
--- a/include/net/bluetooth/sco.h
+++ b/include/net/bluetooth/sco.h
@@ -73,6 +73,7 @@ struct sco_conn {
73struct sco_pinfo { 73struct sco_pinfo {
74 struct bt_sock bt; 74 struct bt_sock bt;
75 __u32 flags; 75 __u32 flags;
76 __u16 setting;
76 struct sco_conn *conn; 77 struct sco_conn *conn;
77}; 78};
78 79
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 7b0730aeb892..cb710913d5c8 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -461,6 +461,33 @@ ieee80211_chandef_rate_flags(struct cfg80211_chan_def *chandef)
461} 461}
462 462
463/** 463/**
464 * ieee80211_chandef_max_power - maximum transmission power for the chandef
465 *
466 * In some regulations, the transmit power may depend on the configured channel
467 * bandwidth which may be defined as dBm/MHz. This function returns the actual
468 * max_power for non-standard (20 MHz) channels.
469 *
470 * @chandef: channel definition for the channel
471 *
472 * Returns: maximum allowed transmission power in dBm for the chandef
473 */
474static inline int
475ieee80211_chandef_max_power(struct cfg80211_chan_def *chandef)
476{
477 switch (chandef->width) {
478 case NL80211_CHAN_WIDTH_5:
479 return min(chandef->chan->max_reg_power - 6,
480 chandef->chan->max_power);
481 case NL80211_CHAN_WIDTH_10:
482 return min(chandef->chan->max_reg_power - 3,
483 chandef->chan->max_power);
484 default:
485 break;
486 }
487 return chandef->chan->max_power;
488}
489
490/**
464 * enum survey_info_flags - survey information flags 491 * enum survey_info_flags - survey information flags
465 * 492 *
466 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in 493 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in
@@ -490,7 +517,7 @@ enum survey_info_flags {
490 * @channel: the channel this survey record reports, mandatory 517 * @channel: the channel this survey record reports, mandatory
491 * @filled: bitflag of flags from &enum survey_info_flags 518 * @filled: bitflag of flags from &enum survey_info_flags
492 * @noise: channel noise in dBm. This and all following fields are 519 * @noise: channel noise in dBm. This and all following fields are
493 * optional 520 * optional
494 * @channel_time: amount of time in ms the radio spent on the channel 521 * @channel_time: amount of time in ms the radio spent on the channel
495 * @channel_time_busy: amount of time the primary channel was sensed busy 522 * @channel_time_busy: amount of time the primary channel was sensed busy
496 * @channel_time_ext_busy: amount of time the extension channel was sensed busy 523 * @channel_time_ext_busy: amount of time the extension channel was sensed busy
@@ -546,9 +573,9 @@ struct cfg80211_crypto_settings {
546/** 573/**
547 * struct cfg80211_beacon_data - beacon data 574 * struct cfg80211_beacon_data - beacon data
548 * @head: head portion of beacon (before TIM IE) 575 * @head: head portion of beacon (before TIM IE)
549 * or %NULL if not changed 576 * or %NULL if not changed
550 * @tail: tail portion of beacon (after TIM IE) 577 * @tail: tail portion of beacon (after TIM IE)
551 * or %NULL if not changed 578 * or %NULL if not changed
552 * @head_len: length of @head 579 * @head_len: length of @head
553 * @tail_len: length of @tail 580 * @tail_len: length of @tail
554 * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL 581 * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL
@@ -639,6 +666,30 @@ struct cfg80211_ap_settings {
639}; 666};
640 667
641/** 668/**
669 * struct cfg80211_csa_settings - channel switch settings
670 *
671 * Used for channel switch
672 *
673 * @chandef: defines the channel to use after the switch
674 * @beacon_csa: beacon data while performing the switch
675 * @counter_offset_beacon: offset for the counter within the beacon (tail)
676 * @counter_offset_presp: offset for the counter within the probe response
677 * @beacon_after: beacon data to be used on the new channel
678 * @radar_required: whether radar detection is required on the new channel
679 * @block_tx: whether transmissions should be blocked while changing
680 * @count: number of beacons until switch
681 */
682struct cfg80211_csa_settings {
683 struct cfg80211_chan_def chandef;
684 struct cfg80211_beacon_data beacon_csa;
685 u16 counter_offset_beacon, counter_offset_presp;
686 struct cfg80211_beacon_data beacon_after;
687 bool radar_required;
688 bool block_tx;
689 u8 count;
690};
691
692/**
642 * enum station_parameters_apply_mask - station parameter values to apply 693 * enum station_parameters_apply_mask - station parameter values to apply
643 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp) 694 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
644 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability 695 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability
@@ -764,7 +815,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
764 * @STATION_INFO_PLINK_STATE: @plink_state filled 815 * @STATION_INFO_PLINK_STATE: @plink_state filled
765 * @STATION_INFO_SIGNAL: @signal filled 816 * @STATION_INFO_SIGNAL: @signal filled
766 * @STATION_INFO_TX_BITRATE: @txrate fields are filled 817 * @STATION_INFO_TX_BITRATE: @txrate fields are filled
767 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) 818 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs)
768 * @STATION_INFO_RX_PACKETS: @rx_packets filled with 32-bit value 819 * @STATION_INFO_RX_PACKETS: @rx_packets filled with 32-bit value
769 * @STATION_INFO_TX_PACKETS: @tx_packets filled with 32-bit value 820 * @STATION_INFO_TX_PACKETS: @tx_packets filled with 32-bit value
770 * @STATION_INFO_TX_RETRIES: @tx_retries filled 821 * @STATION_INFO_TX_RETRIES: @tx_retries filled
@@ -1285,6 +1336,7 @@ struct cfg80211_ssid {
1285 * @n_ssids: number of SSIDs 1336 * @n_ssids: number of SSIDs
1286 * @channels: channels to scan on. 1337 * @channels: channels to scan on.
1287 * @n_channels: total number of channels to scan 1338 * @n_channels: total number of channels to scan
1339 * @scan_width: channel width for scanning
1288 * @ie: optional information element(s) to add into Probe Request or %NULL 1340 * @ie: optional information element(s) to add into Probe Request or %NULL
1289 * @ie_len: length of ie in octets 1341 * @ie_len: length of ie in octets
1290 * @flags: bit field of flags controlling operation 1342 * @flags: bit field of flags controlling operation
@@ -1300,6 +1352,7 @@ struct cfg80211_scan_request {
1300 struct cfg80211_ssid *ssids; 1352 struct cfg80211_ssid *ssids;
1301 int n_ssids; 1353 int n_ssids;
1302 u32 n_channels; 1354 u32 n_channels;
1355 enum nl80211_bss_scan_width scan_width;
1303 const u8 *ie; 1356 const u8 *ie;
1304 size_t ie_len; 1357 size_t ie_len;
1305 u32 flags; 1358 u32 flags;
@@ -1333,6 +1386,7 @@ struct cfg80211_match_set {
1333 * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans) 1386 * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans)
1334 * @n_ssids: number of SSIDs 1387 * @n_ssids: number of SSIDs
1335 * @n_channels: total number of channels to scan 1388 * @n_channels: total number of channels to scan
1389 * @scan_width: channel width for scanning
1336 * @interval: interval between each scheduled scan cycle 1390 * @interval: interval between each scheduled scan cycle
1337 * @ie: optional information element(s) to add into Probe Request or %NULL 1391 * @ie: optional information element(s) to add into Probe Request or %NULL
1338 * @ie_len: length of ie in octets 1392 * @ie_len: length of ie in octets
@@ -1352,6 +1406,7 @@ struct cfg80211_sched_scan_request {
1352 struct cfg80211_ssid *ssids; 1406 struct cfg80211_ssid *ssids;
1353 int n_ssids; 1407 int n_ssids;
1354 u32 n_channels; 1408 u32 n_channels;
1409 enum nl80211_bss_scan_width scan_width;
1355 u32 interval; 1410 u32 interval;
1356 const u8 *ie; 1411 const u8 *ie;
1357 size_t ie_len; 1412 size_t ie_len;
@@ -1403,6 +1458,7 @@ struct cfg80211_bss_ies {
1403 * for use in scan results and similar. 1458 * for use in scan results and similar.
1404 * 1459 *
1405 * @channel: channel this BSS is on 1460 * @channel: channel this BSS is on
1461 * @scan_width: width of the control channel
1406 * @bssid: BSSID of the BSS 1462 * @bssid: BSSID of the BSS
1407 * @beacon_interval: the beacon interval as from the frame 1463 * @beacon_interval: the beacon interval as from the frame
1408 * @capability: the capability field in host byte order 1464 * @capability: the capability field in host byte order
@@ -1424,6 +1480,7 @@ struct cfg80211_bss_ies {
1424 */ 1480 */
1425struct cfg80211_bss { 1481struct cfg80211_bss {
1426 struct ieee80211_channel *channel; 1482 struct ieee80211_channel *channel;
1483 enum nl80211_bss_scan_width scan_width;
1427 1484
1428 const struct cfg80211_bss_ies __rcu *ies; 1485 const struct cfg80211_bss_ies __rcu *ies;
1429 const struct cfg80211_bss_ies __rcu *beacon_ies; 1486 const struct cfg80211_bss_ies __rcu *beacon_ies;
@@ -1509,7 +1566,7 @@ enum cfg80211_assoc_req_flags {
1509 * @prev_bssid: previous BSSID, if not %NULL use reassociate frame 1566 * @prev_bssid: previous BSSID, if not %NULL use reassociate frame
1510 * @flags: See &enum cfg80211_assoc_req_flags 1567 * @flags: See &enum cfg80211_assoc_req_flags
1511 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask 1568 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1512 * will be used in ht_capa. Un-supported values will be ignored. 1569 * will be used in ht_capa. Un-supported values will be ignored.
1513 * @ht_capa_mask: The bits of ht_capa which are to be used. 1570 * @ht_capa_mask: The bits of ht_capa which are to be used.
1514 * @vht_capa: VHT capability override 1571 * @vht_capa: VHT capability override
1515 * @vht_capa_mask: VHT capability mask indicating which fields to use 1572 * @vht_capa_mask: VHT capability mask indicating which fields to use
@@ -1592,6 +1649,9 @@ struct cfg80211_disassoc_request {
1592 * user space. Otherwise, port is marked authorized by default. 1649 * user space. Otherwise, port is marked authorized by default.
1593 * @basic_rates: bitmap of basic rates to use when creating the IBSS 1650 * @basic_rates: bitmap of basic rates to use when creating the IBSS
1594 * @mcast_rate: per-band multicast rate index + 1 (0: disabled) 1651 * @mcast_rate: per-band multicast rate index + 1 (0: disabled)
1652 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1653 * will be used in ht_capa. Un-supported values will be ignored.
1654 * @ht_capa_mask: The bits of ht_capa which are to be used.
1595 */ 1655 */
1596struct cfg80211_ibss_params { 1656struct cfg80211_ibss_params {
1597 u8 *ssid; 1657 u8 *ssid;
@@ -1605,6 +1665,8 @@ struct cfg80211_ibss_params {
1605 bool privacy; 1665 bool privacy;
1606 bool control_port; 1666 bool control_port;
1607 int mcast_rate[IEEE80211_NUM_BANDS]; 1667 int mcast_rate[IEEE80211_NUM_BANDS];
1668 struct ieee80211_ht_cap ht_capa;
1669 struct ieee80211_ht_cap ht_capa_mask;
1608}; 1670};
1609 1671
1610/** 1672/**
@@ -1630,9 +1692,9 @@ struct cfg80211_ibss_params {
1630 * @key: WEP key for shared key authentication 1692 * @key: WEP key for shared key authentication
1631 * @flags: See &enum cfg80211_assoc_req_flags 1693 * @flags: See &enum cfg80211_assoc_req_flags
1632 * @bg_scan_period: Background scan period in seconds 1694 * @bg_scan_period: Background scan period in seconds
1633 * or -1 to indicate that default value is to be used. 1695 * or -1 to indicate that default value is to be used.
1634 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask 1696 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1635 * will be used in ht_capa. Un-supported values will be ignored. 1697 * will be used in ht_capa. Un-supported values will be ignored.
1636 * @ht_capa_mask: The bits of ht_capa which are to be used. 1698 * @ht_capa_mask: The bits of ht_capa which are to be used.
1637 * @vht_capa: VHT Capability overrides 1699 * @vht_capa: VHT Capability overrides
1638 * @vht_capa_mask: The bits of vht_capa which are to be used. 1700 * @vht_capa_mask: The bits of vht_capa which are to be used.
@@ -1698,7 +1760,7 @@ struct cfg80211_pmksa {
1698}; 1760};
1699 1761
1700/** 1762/**
1701 * struct cfg80211_wowlan_trig_pkt_pattern - packet pattern 1763 * struct cfg80211_pkt_pattern - packet pattern
1702 * @mask: bitmask where to match pattern and where to ignore bytes, 1764 * @mask: bitmask where to match pattern and where to ignore bytes,
1703 * one bit per byte, in same format as nl80211 1765 * one bit per byte, in same format as nl80211
1704 * @pattern: bytes to match where bitmask is 1 1766 * @pattern: bytes to match where bitmask is 1
@@ -1708,7 +1770,7 @@ struct cfg80211_pmksa {
1708 * Internal note: @mask and @pattern are allocated in one chunk of 1770 * Internal note: @mask and @pattern are allocated in one chunk of
1709 * memory, free @mask only! 1771 * memory, free @mask only!
1710 */ 1772 */
1711struct cfg80211_wowlan_trig_pkt_pattern { 1773struct cfg80211_pkt_pattern {
1712 u8 *mask, *pattern; 1774 u8 *mask, *pattern;
1713 int pattern_len; 1775 int pattern_len;
1714 int pkt_offset; 1776 int pkt_offset;
@@ -1770,12 +1832,41 @@ struct cfg80211_wowlan {
1770 bool any, disconnect, magic_pkt, gtk_rekey_failure, 1832 bool any, disconnect, magic_pkt, gtk_rekey_failure,
1771 eap_identity_req, four_way_handshake, 1833 eap_identity_req, four_way_handshake,
1772 rfkill_release; 1834 rfkill_release;
1773 struct cfg80211_wowlan_trig_pkt_pattern *patterns; 1835 struct cfg80211_pkt_pattern *patterns;
1774 struct cfg80211_wowlan_tcp *tcp; 1836 struct cfg80211_wowlan_tcp *tcp;
1775 int n_patterns; 1837 int n_patterns;
1776}; 1838};
1777 1839
1778/** 1840/**
1841 * struct cfg80211_coalesce_rules - Coalesce rule parameters
1842 *
1843 * This structure defines coalesce rule for the device.
1844 * @delay: maximum coalescing delay in msecs.
1845 * @condition: condition for packet coalescence.
1846 * see &enum nl80211_coalesce_condition.
1847 * @patterns: array of packet patterns
1848 * @n_patterns: number of patterns
1849 */
1850struct cfg80211_coalesce_rules {
1851 int delay;
1852 enum nl80211_coalesce_condition condition;
1853 struct cfg80211_pkt_pattern *patterns;
1854 int n_patterns;
1855};
1856
1857/**
1858 * struct cfg80211_coalesce - Packet coalescing settings
1859 *
1860 * This structure defines coalescing settings.
1861 * @rules: array of coalesce rules
1862 * @n_rules: number of rules
1863 */
1864struct cfg80211_coalesce {
1865 struct cfg80211_coalesce_rules *rules;
1866 int n_rules;
1867};
1868
1869/**
1779 * struct cfg80211_wowlan_wakeup - wakeup report 1870 * struct cfg80211_wowlan_wakeup - wakeup report
1780 * @disconnect: woke up by getting disconnected 1871 * @disconnect: woke up by getting disconnected
1781 * @magic_pkt: woke up by receiving magic packet 1872 * @magic_pkt: woke up by receiving magic packet
@@ -1990,7 +2081,7 @@ struct cfg80211_update_ft_ies_params {
1990 * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management 2081 * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management
1991 * frame on another channel 2082 * frame on another channel
1992 * 2083 *
1993 * @testmode_cmd: run a test mode command 2084 * @testmode_cmd: run a test mode command; @wdev may be %NULL
1994 * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be 2085 * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be
1995 * used by the function, but 0 and 1 must not be touched. Additionally, 2086 * used by the function, but 0 and 1 must not be touched. Additionally,
1996 * return error codes other than -ENOBUFS and -ENOENT will terminate the 2087 * return error codes other than -ENOBUFS and -ENOENT will terminate the
@@ -2071,6 +2162,9 @@ struct cfg80211_update_ft_ies_params {
2071 * driver can take the most appropriate actions. 2162 * driver can take the most appropriate actions.
2072 * @crit_proto_stop: Indicates critical protocol no longer needs increased link 2163 * @crit_proto_stop: Indicates critical protocol no longer needs increased link
2073 * reliability. This operation can not fail. 2164 * reliability. This operation can not fail.
2165 * @set_coalesce: Set coalesce parameters.
2166 *
2167 * @channel_switch: initiate channel-switch procedure (with CSA)
2074 */ 2168 */
2075struct cfg80211_ops { 2169struct cfg80211_ops {
2076 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 2170 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2196,7 +2290,8 @@ struct cfg80211_ops {
2196 void (*rfkill_poll)(struct wiphy *wiphy); 2290 void (*rfkill_poll)(struct wiphy *wiphy);
2197 2291
2198#ifdef CONFIG_NL80211_TESTMODE 2292#ifdef CONFIG_NL80211_TESTMODE
2199 int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len); 2293 int (*testmode_cmd)(struct wiphy *wiphy, struct wireless_dev *wdev,
2294 void *data, int len);
2200 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb, 2295 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb,
2201 struct netlink_callback *cb, 2296 struct netlink_callback *cb,
2202 void *data, int len); 2297 void *data, int len);
@@ -2306,6 +2401,12 @@ struct cfg80211_ops {
2306 u16 duration); 2401 u16 duration);
2307 void (*crit_proto_stop)(struct wiphy *wiphy, 2402 void (*crit_proto_stop)(struct wiphy *wiphy,
2308 struct wireless_dev *wdev); 2403 struct wireless_dev *wdev);
2404 int (*set_coalesce)(struct wiphy *wiphy,
2405 struct cfg80211_coalesce *coalesce);
2406
2407 int (*channel_switch)(struct wiphy *wiphy,
2408 struct net_device *dev,
2409 struct cfg80211_csa_settings *params);
2309}; 2410};
2310 2411
2311/* 2412/*
@@ -2371,6 +2472,8 @@ struct cfg80211_ops {
2371 * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX. 2472 * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX.
2372 * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call. 2473 * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call.
2373 * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels. 2474 * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels.
2475 * @WIPHY_FLAG_HAS_CHANNEL_SWITCH: Device supports channel switch in
2476 * beaconing mode (AP, IBSS, Mesh, ...).
2374 */ 2477 */
2375enum wiphy_flags { 2478enum wiphy_flags {
2376 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 2479 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -2395,6 +2498,7 @@ enum wiphy_flags {
2395 WIPHY_FLAG_OFFCHAN_TX = BIT(20), 2498 WIPHY_FLAG_OFFCHAN_TX = BIT(20),
2396 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21), 2499 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21),
2397 WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22), 2500 WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22),
2501 WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(23),
2398}; 2502};
2399 2503
2400/** 2504/**
@@ -2532,6 +2636,25 @@ struct wiphy_wowlan_support {
2532}; 2636};
2533 2637
2534/** 2638/**
2639 * struct wiphy_coalesce_support - coalesce support data
2640 * @n_rules: maximum number of coalesce rules
2641 * @max_delay: maximum supported coalescing delay in msecs
2642 * @n_patterns: number of supported patterns in a rule
2643 * (see nl80211.h for the pattern definition)
2644 * @pattern_max_len: maximum length of each pattern
2645 * @pattern_min_len: minimum length of each pattern
2646 * @max_pkt_offset: maximum Rx packet offset
2647 */
2648struct wiphy_coalesce_support {
2649 int n_rules;
2650 int max_delay;
2651 int n_patterns;
2652 int pattern_max_len;
2653 int pattern_min_len;
2654 int max_pkt_offset;
2655};
2656
2657/**
2535 * struct wiphy - wireless hardware description 2658 * struct wiphy - wireless hardware description
2536 * @reg_notifier: the driver's regulatory notification callback, 2659 * @reg_notifier: the driver's regulatory notification callback,
2537 * note that if your driver uses wiphy_apply_custom_regulatory() 2660 * note that if your driver uses wiphy_apply_custom_regulatory()
@@ -2641,6 +2764,7 @@ struct wiphy_wowlan_support {
2641 * 802.11-2012 8.4.2.29 for the defined fields. 2764 * 802.11-2012 8.4.2.29 for the defined fields.
2642 * @extended_capabilities_mask: mask of the valid values 2765 * @extended_capabilities_mask: mask of the valid values
2643 * @extended_capabilities_len: length of the extended capabilities 2766 * @extended_capabilities_len: length of the extended capabilities
2767 * @coalesce: packet coalescing support information
2644 */ 2768 */
2645struct wiphy { 2769struct wiphy {
2646 /* assign these fields before you register the wiphy */ 2770 /* assign these fields before you register the wiphy */
@@ -2750,6 +2874,8 @@ struct wiphy {
2750 const struct iw_handler_def *wext; 2874 const struct iw_handler_def *wext;
2751#endif 2875#endif
2752 2876
2877 const struct wiphy_coalesce_support *coalesce;
2878
2753 char priv[0] __aligned(NETDEV_ALIGN); 2879 char priv[0] __aligned(NETDEV_ALIGN);
2754}; 2880};
2755 2881
@@ -2841,7 +2967,7 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv);
2841 * 2967 *
2842 * Return: A non-negative wiphy index or a negative error code. 2968 * Return: A non-negative wiphy index or a negative error code.
2843 */ 2969 */
2844extern int wiphy_register(struct wiphy *wiphy); 2970int wiphy_register(struct wiphy *wiphy);
2845 2971
2846/** 2972/**
2847 * wiphy_unregister - deregister a wiphy from cfg80211 2973 * wiphy_unregister - deregister a wiphy from cfg80211
@@ -2852,14 +2978,14 @@ extern int wiphy_register(struct wiphy *wiphy);
2852 * pointer, but the call may sleep to wait for an outstanding 2978 * pointer, but the call may sleep to wait for an outstanding
2853 * request that is being handled. 2979 * request that is being handled.
2854 */ 2980 */
2855extern void wiphy_unregister(struct wiphy *wiphy); 2981void wiphy_unregister(struct wiphy *wiphy);
2856 2982
2857/** 2983/**
2858 * wiphy_free - free wiphy 2984 * wiphy_free - free wiphy
2859 * 2985 *
2860 * @wiphy: The wiphy to free 2986 * @wiphy: The wiphy to free
2861 */ 2987 */
2862extern void wiphy_free(struct wiphy *wiphy); 2988void wiphy_free(struct wiphy *wiphy);
2863 2989
2864/* internal structs */ 2990/* internal structs */
2865struct cfg80211_conn; 2991struct cfg80211_conn;
@@ -3014,14 +3140,14 @@ static inline void *wdev_priv(struct wireless_dev *wdev)
3014 * @band: band, necessary due to channel number overlap 3140 * @band: band, necessary due to channel number overlap
3015 * Return: The corresponding frequency (in MHz), or 0 if the conversion failed. 3141 * Return: The corresponding frequency (in MHz), or 0 if the conversion failed.
3016 */ 3142 */
3017extern int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band); 3143int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band);
3018 3144
3019/** 3145/**
3020 * ieee80211_frequency_to_channel - convert frequency to channel number 3146 * ieee80211_frequency_to_channel - convert frequency to channel number
3021 * @freq: center frequency 3147 * @freq: center frequency
3022 * Return: The corresponding channel, or 0 if the conversion failed. 3148 * Return: The corresponding channel, or 0 if the conversion failed.
3023 */ 3149 */
3024extern int ieee80211_frequency_to_channel(int freq); 3150int ieee80211_frequency_to_channel(int freq);
3025 3151
3026/* 3152/*
3027 * Name indirection necessary because the ieee80211 code also has 3153 * Name indirection necessary because the ieee80211 code also has
@@ -3030,8 +3156,8 @@ extern int ieee80211_frequency_to_channel(int freq);
3030 * to include both header files you'll (rightfully!) get a symbol 3156 * to include both header files you'll (rightfully!) get a symbol
3031 * clash. 3157 * clash.
3032 */ 3158 */
3033extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, 3159struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
3034 int freq); 3160 int freq);
3035/** 3161/**
3036 * ieee80211_get_channel - get channel struct from wiphy for specified frequency 3162 * ieee80211_get_channel - get channel struct from wiphy for specified frequency
3037 * @wiphy: the struct wiphy to get the channel for 3163 * @wiphy: the struct wiphy to get the channel for
@@ -3063,11 +3189,13 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
3063/** 3189/**
3064 * ieee80211_mandatory_rates - get mandatory rates for a given band 3190 * ieee80211_mandatory_rates - get mandatory rates for a given band
3065 * @sband: the band to look for rates in 3191 * @sband: the band to look for rates in
3192 * @scan_width: width of the control channel
3066 * 3193 *
3067 * This function returns a bitmap of the mandatory rates for the given 3194 * This function returns a bitmap of the mandatory rates for the given
3068 * band, bits are set according to the rate position in the bitrates array. 3195 * band, bits are set according to the rate position in the bitrates array.
3069 */ 3196 */
3070u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband); 3197u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband,
3198 enum nl80211_bss_scan_width scan_width);
3071 3199
3072/* 3200/*
3073 * Radiotap parsing functions -- for controlled injection support 3201 * Radiotap parsing functions -- for controlled injection support
@@ -3141,13 +3269,14 @@ struct ieee80211_radiotap_iterator {
3141 int _reset_on_ext; 3269 int _reset_on_ext;
3142}; 3270};
3143 3271
3144extern int ieee80211_radiotap_iterator_init( 3272int
3145 struct ieee80211_radiotap_iterator *iterator, 3273ieee80211_radiotap_iterator_init(struct ieee80211_radiotap_iterator *iterator,
3146 struct ieee80211_radiotap_header *radiotap_header, 3274 struct ieee80211_radiotap_header *radiotap_header,
3147 int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns); 3275 int max_length,
3276 const struct ieee80211_radiotap_vendor_namespaces *vns);
3148 3277
3149extern int ieee80211_radiotap_iterator_next( 3278int
3150 struct ieee80211_radiotap_iterator *iterator); 3279ieee80211_radiotap_iterator_next(struct ieee80211_radiotap_iterator *iterator);
3151 3280
3152 3281
3153extern const unsigned char rfc1042_header[6]; 3282extern const unsigned char rfc1042_header[6];
@@ -3307,7 +3436,7 @@ const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type,
3307 * 3436 *
3308 * Return: 0 on success. -ENOMEM. 3437 * Return: 0 on success. -ENOMEM.
3309 */ 3438 */
3310extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2); 3439int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3311 3440
3312/** 3441/**
3313 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain 3442 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
@@ -3321,9 +3450,8 @@ extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3321 * default channel settings will be disregarded. If no rule is found for a 3450 * default channel settings will be disregarded. If no rule is found for a
3322 * channel on the regulatory domain the channel will be disabled. 3451 * channel on the regulatory domain the channel will be disabled.
3323 */ 3452 */
3324extern void wiphy_apply_custom_regulatory( 3453void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
3325 struct wiphy *wiphy, 3454 const struct ieee80211_regdomain *regd);
3326 const struct ieee80211_regdomain *regd);
3327 3455
3328/** 3456/**
3329 * freq_reg_info - get regulatory information for the given frequency 3457 * freq_reg_info - get regulatory information for the given frequency
@@ -3379,10 +3507,11 @@ void cfg80211_sched_scan_results(struct wiphy *wiphy);
3379void cfg80211_sched_scan_stopped(struct wiphy *wiphy); 3507void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
3380 3508
3381/** 3509/**
3382 * cfg80211_inform_bss_frame - inform cfg80211 of a received BSS frame 3510 * cfg80211_inform_bss_width_frame - inform cfg80211 of a received BSS frame
3383 * 3511 *
3384 * @wiphy: the wiphy reporting the BSS 3512 * @wiphy: the wiphy reporting the BSS
3385 * @channel: The channel the frame was received on 3513 * @channel: The channel the frame was received on
3514 * @scan_width: width of the control channel
3386 * @mgmt: the management frame (probe response or beacon) 3515 * @mgmt: the management frame (probe response or beacon)
3387 * @len: length of the management frame 3516 * @len: length of the management frame
3388 * @signal: the signal strength, type depends on the wiphy's signal_type 3517 * @signal: the signal strength, type depends on the wiphy's signal_type
@@ -3395,16 +3524,29 @@ void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
3395 * Or %NULL on error. 3524 * Or %NULL on error.
3396 */ 3525 */
3397struct cfg80211_bss * __must_check 3526struct cfg80211_bss * __must_check
3527cfg80211_inform_bss_width_frame(struct wiphy *wiphy,
3528 struct ieee80211_channel *channel,
3529 enum nl80211_bss_scan_width scan_width,
3530 struct ieee80211_mgmt *mgmt, size_t len,
3531 s32 signal, gfp_t gfp);
3532
3533static inline struct cfg80211_bss * __must_check
3398cfg80211_inform_bss_frame(struct wiphy *wiphy, 3534cfg80211_inform_bss_frame(struct wiphy *wiphy,
3399 struct ieee80211_channel *channel, 3535 struct ieee80211_channel *channel,
3400 struct ieee80211_mgmt *mgmt, size_t len, 3536 struct ieee80211_mgmt *mgmt, size_t len,
3401 s32 signal, gfp_t gfp); 3537 s32 signal, gfp_t gfp)
3538{
3539 return cfg80211_inform_bss_width_frame(wiphy, channel,
3540 NL80211_BSS_CHAN_WIDTH_20,
3541 mgmt, len, signal, gfp);
3542}
3402 3543
3403/** 3544/**
3404 * cfg80211_inform_bss - inform cfg80211 of a new BSS 3545 * cfg80211_inform_bss - inform cfg80211 of a new BSS
3405 * 3546 *
3406 * @wiphy: the wiphy reporting the BSS 3547 * @wiphy: the wiphy reporting the BSS
3407 * @channel: The channel the frame was received on 3548 * @channel: The channel the frame was received on
3549 * @scan_width: width of the control channel
3408 * @bssid: the BSSID of the BSS 3550 * @bssid: the BSSID of the BSS
3409 * @tsf: the TSF sent by the peer in the beacon/probe response (or 0) 3551 * @tsf: the TSF sent by the peer in the beacon/probe response (or 0)
3410 * @capability: the capability field sent by the peer 3552 * @capability: the capability field sent by the peer
@@ -3421,11 +3563,26 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
3421 * Or %NULL on error. 3563 * Or %NULL on error.
3422 */ 3564 */
3423struct cfg80211_bss * __must_check 3565struct cfg80211_bss * __must_check
3566cfg80211_inform_bss_width(struct wiphy *wiphy,
3567 struct ieee80211_channel *channel,
3568 enum nl80211_bss_scan_width scan_width,
3569 const u8 *bssid, u64 tsf, u16 capability,
3570 u16 beacon_interval, const u8 *ie, size_t ielen,
3571 s32 signal, gfp_t gfp);
3572
3573static inline struct cfg80211_bss * __must_check
3424cfg80211_inform_bss(struct wiphy *wiphy, 3574cfg80211_inform_bss(struct wiphy *wiphy,
3425 struct ieee80211_channel *channel, 3575 struct ieee80211_channel *channel,
3426 const u8 *bssid, u64 tsf, u16 capability, 3576 const u8 *bssid, u64 tsf, u16 capability,
3427 u16 beacon_interval, const u8 *ie, size_t ielen, 3577 u16 beacon_interval, const u8 *ie, size_t ielen,
3428 s32 signal, gfp_t gfp); 3578 s32 signal, gfp_t gfp)
3579{
3580 return cfg80211_inform_bss_width(wiphy, channel,
3581 NL80211_BSS_CHAN_WIDTH_20,
3582 bssid, tsf, capability,
3583 beacon_interval, ie, ielen, signal,
3584 gfp);
3585}
3429 3586
3430struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, 3587struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
3431 struct ieee80211_channel *channel, 3588 struct ieee80211_channel *channel,
@@ -3471,6 +3628,19 @@ void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3471 */ 3628 */
3472void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); 3629void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3473 3630
3631static inline enum nl80211_bss_scan_width
3632cfg80211_chandef_to_scan_width(const struct cfg80211_chan_def *chandef)
3633{
3634 switch (chandef->width) {
3635 case NL80211_CHAN_WIDTH_5:
3636 return NL80211_BSS_CHAN_WIDTH_5;
3637 case NL80211_CHAN_WIDTH_10:
3638 return NL80211_BSS_CHAN_WIDTH_10;
3639 default:
3640 return NL80211_BSS_CHAN_WIDTH_20;
3641 }
3642}
3643
3474/** 3644/**
3475 * cfg80211_rx_mlme_mgmt - notification of processed MLME management frame 3645 * cfg80211_rx_mlme_mgmt - notification of processed MLME management frame
3476 * @dev: network device 3646 * @dev: network device
@@ -3886,6 +4056,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
3886 * @sig_dbm: signal strength in mBm, or 0 if unknown 4056 * @sig_dbm: signal strength in mBm, or 0 if unknown
3887 * @buf: Management frame (header + body) 4057 * @buf: Management frame (header + body)
3888 * @len: length of the frame data 4058 * @len: length of the frame data
4059 * @flags: flags, as defined in enum nl80211_rxmgmt_flags
3889 * @gfp: context flags 4060 * @gfp: context flags
3890 * 4061 *
3891 * This function is called whenever an Action frame is received for a station 4062 * This function is called whenever an Action frame is received for a station
@@ -3897,7 +4068,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
3897 * driver is responsible for rejecting the frame. 4068 * driver is responsible for rejecting the frame.
3898 */ 4069 */
3899bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, 4070bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm,
3900 const u8 *buf, size_t len, gfp_t gfp); 4071 const u8 *buf, size_t len, u32 flags, gfp_t gfp);
3901 4072
3902/** 4073/**
3903 * cfg80211_mgmt_tx_status - notification of TX status for management frame 4074 * cfg80211_mgmt_tx_status - notification of TX status for management frame
diff --git a/include/net/checksum.h b/include/net/checksum.h
index 600d1d705bb8..8f59ca50477c 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -107,11 +107,11 @@ static inline void csum_replace2(__sum16 *sum, __be16 from, __be16 to)
107} 107}
108 108
109struct sk_buff; 109struct sk_buff;
110extern void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb, 110void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb,
111 __be32 from, __be32 to, int pseudohdr); 111 __be32 from, __be32 to, int pseudohdr);
112extern void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, 112void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb,
113 const __be32 *from, const __be32 *to, 113 const __be32 *from, const __be32 *to,
114 int pseudohdr); 114 int pseudohdr);
115 115
116static inline void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb, 116static inline void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb,
117 __be16 from, __be16 to, 117 __be16 from, __be16 to,
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index a7a683e30b64..a8c2ef6d3b93 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -290,6 +290,7 @@ static inline int cipso_v4_validate(const struct sk_buff *skb,
290 unsigned char err_offset = 0; 290 unsigned char err_offset = 0;
291 u8 opt_len = opt[1]; 291 u8 opt_len = opt[1];
292 u8 opt_iter; 292 u8 opt_iter;
293 u8 tag_len;
293 294
294 if (opt_len < 8) { 295 if (opt_len < 8) {
295 err_offset = 1; 296 err_offset = 1;
@@ -302,11 +303,12 @@ static inline int cipso_v4_validate(const struct sk_buff *skb,
302 } 303 }
303 304
304 for (opt_iter = 6; opt_iter < opt_len;) { 305 for (opt_iter = 6; opt_iter < opt_len;) {
305 if (opt[opt_iter + 1] > (opt_len - opt_iter)) { 306 tag_len = opt[opt_iter + 1];
307 if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) {
306 err_offset = opt_iter + 1; 308 err_offset = opt_iter + 1;
307 goto out; 309 goto out;
308 } 310 }
309 opt_iter += opt[opt_iter + 1]; 311 opt_iter += tag_len;
310 } 312 }
311 313
312out: 314out:
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index 0fee0617fb7d..33d03b648646 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -24,7 +24,7 @@ struct cgroup_cls_state
24 u32 classid; 24 u32 classid;
25}; 25};
26 26
27extern void sock_update_classid(struct sock *sk); 27void sock_update_classid(struct sock *sk);
28 28
29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) 29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP)
30static inline u32 task_cls_classid(struct task_struct *p) 30static inline u32 task_cls_classid(struct task_struct *p)
@@ -35,7 +35,7 @@ static inline u32 task_cls_classid(struct task_struct *p)
35 return 0; 35 return 0;
36 36
37 rcu_read_lock(); 37 rcu_read_lock();
38 classid = container_of(task_subsys_state(p, net_cls_subsys_id), 38 classid = container_of(task_css(p, net_cls_subsys_id),
39 struct cgroup_cls_state, css)->classid; 39 struct cgroup_cls_state, css)->classid;
40 rcu_read_unlock(); 40 rcu_read_unlock();
41 41
@@ -51,7 +51,7 @@ static inline u32 task_cls_classid(struct task_struct *p)
51 return 0; 51 return 0;
52 52
53 rcu_read_lock(); 53 rcu_read_lock();
54 css = task_subsys_state(p, net_cls_subsys_id); 54 css = task_css(p, net_cls_subsys_id);
55 if (css) 55 if (css)
56 classid = container_of(css, 56 classid = container_of(css,
57 struct cgroup_cls_state, css)->classid; 57 struct cgroup_cls_state, css)->classid;
diff --git a/include/net/dst.h b/include/net/dst.h
index 1f8fd109e225..3c4c944096c9 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -311,11 +311,13 @@ static inline void skb_dst_force(struct sk_buff *skb)
311 * __skb_tunnel_rx - prepare skb for rx reinsert 311 * __skb_tunnel_rx - prepare skb for rx reinsert
312 * @skb: buffer 312 * @skb: buffer
313 * @dev: tunnel device 313 * @dev: tunnel device
314 * @net: netns for packet i/o
314 * 315 *
315 * After decapsulation, packet is going to re-enter (netif_rx()) our stack, 316 * After decapsulation, packet is going to re-enter (netif_rx()) our stack,
316 * so make some cleanups. (no accounting done) 317 * so make some cleanups. (no accounting done)
317 */ 318 */
318static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) 319static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
320 struct net *net)
319{ 321{
320 skb->dev = dev; 322 skb->dev = dev;
321 323
@@ -327,8 +329,7 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
327 if (!skb->l4_rxhash) 329 if (!skb->l4_rxhash)
328 skb->rxhash = 0; 330 skb->rxhash = 0;
329 skb_set_queue_mapping(skb, 0); 331 skb_set_queue_mapping(skb, 0);
330 skb_dst_drop(skb); 332 skb_scrub_packet(skb, !net_eq(net, dev_net(dev)));
331 nf_reset(skb);
332} 333}
333 334
334/** 335/**
@@ -340,12 +341,13 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
340 * so make some cleanups, and perform accounting. 341 * so make some cleanups, and perform accounting.
341 * Note: this accounting is not SMP safe. 342 * Note: this accounting is not SMP safe.
342 */ 343 */
343static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) 344static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
345 struct net *net)
344{ 346{
345 /* TODO : stats should be SMP safe */ 347 /* TODO : stats should be SMP safe */
346 dev->stats.rx_packets++; 348 dev->stats.rx_packets++;
347 dev->stats.rx_bytes += skb->len; 349 dev->stats.rx_bytes += skb->len;
348 __skb_tunnel_rx(skb, dev); 350 __skb_tunnel_rx(skb, dev, net);
349} 351}
350 352
351/* Children define the path of the packet through the 353/* Children define the path of the packet through the
@@ -477,10 +479,22 @@ static inline struct dst_entry *xfrm_lookup(struct net *net,
477{ 479{
478 return dst_orig; 480 return dst_orig;
479} 481}
482
483static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
484{
485 return NULL;
486}
487
480#else 488#else
481extern struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, 489extern struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig,
482 const struct flowi *fl, struct sock *sk, 490 const struct flowi *fl, struct sock *sk,
483 int flags); 491 int flags);
492
493/* skb attached with this dst needs transformation if dst->xfrm is valid */
494static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst)
495{
496 return dst->xfrm;
497}
484#endif 498#endif
485 499
486#endif /* _NET_DST_H */ 500#endif /* _NET_DST_H */
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index e361f4882426..4b2b557fb0e8 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -10,21 +10,25 @@
10 10
11struct fib_rule { 11struct fib_rule {
12 struct list_head list; 12 struct list_head list;
13 atomic_t refcnt;
14 int iifindex; 13 int iifindex;
15 int oifindex; 14 int oifindex;
16 u32 mark; 15 u32 mark;
17 u32 mark_mask; 16 u32 mark_mask;
18 u32 pref;
19 u32 flags; 17 u32 flags;
20 u32 table; 18 u32 table;
21 u8 action; 19 u8 action;
20 /* 3 bytes hole, try to use */
22 u32 target; 21 u32 target;
23 struct fib_rule __rcu *ctarget; 22 struct fib_rule __rcu *ctarget;
23 struct net *fr_net;
24
25 atomic_t refcnt;
26 u32 pref;
27 int suppress_ifgroup;
28 int suppress_prefixlen;
24 char iifname[IFNAMSIZ]; 29 char iifname[IFNAMSIZ];
25 char oifname[IFNAMSIZ]; 30 char oifname[IFNAMSIZ];
26 struct rcu_head rcu; 31 struct rcu_head rcu;
27 struct net * fr_net;
28}; 32};
29 33
30struct fib_lookup_arg { 34struct fib_lookup_arg {
@@ -46,6 +50,8 @@ struct fib_rules_ops {
46 int (*action)(struct fib_rule *, 50 int (*action)(struct fib_rule *,
47 struct flowi *, int, 51 struct flowi *, int,
48 struct fib_lookup_arg *); 52 struct fib_lookup_arg *);
53 bool (*suppress)(struct fib_rule *,
54 struct fib_lookup_arg *);
49 int (*match)(struct fib_rule *, 55 int (*match)(struct fib_rule *,
50 struct flowi *, int); 56 struct flowi *, int);
51 int (*configure)(struct fib_rule *, 57 int (*configure)(struct fib_rule *,
@@ -80,6 +86,8 @@ struct fib_rules_ops {
80 [FRA_FWMARK] = { .type = NLA_U32 }, \ 86 [FRA_FWMARK] = { .type = NLA_U32 }, \
81 [FRA_FWMASK] = { .type = NLA_U32 }, \ 87 [FRA_FWMASK] = { .type = NLA_U32 }, \
82 [FRA_TABLE] = { .type = NLA_U32 }, \ 88 [FRA_TABLE] = { .type = NLA_U32 }, \
89 [FRA_SUPPRESS_PREFIXLEN] = { .type = NLA_U32 }, \
90 [FRA_SUPPRESS_IFGROUP] = { .type = NLA_U32 }, \
83 [FRA_GOTO] = { .type = NLA_U32 } 91 [FRA_GOTO] = { .type = NLA_U32 }
84 92
85static inline void fib_rule_get(struct fib_rule *rule) 93static inline void fib_rule_get(struct fib_rule *rule)
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index c6d07cb074bc..8b5b71433297 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -230,6 +230,10 @@ enum ieee80211_radiotap_type {
230#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ 230#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */
231#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ 231#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
232#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ 232#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
233#define IEEE80211_CHAN_GSM 0x1000 /* GSM (900 MHz) */
234#define IEEE80211_CHAN_STURBO 0x2000 /* Static Turbo */
235#define IEEE80211_CHAN_HALF 0x4000 /* Half channel (10 MHz wide) */
236#define IEEE80211_CHAN_QUARTER 0x8000 /* Quarter channel (5 MHz wide) */
233 237
234/* For IEEE80211_RADIOTAP_FLAGS */ 238/* For IEEE80211_RADIOTAP_FLAGS */
235#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received 239#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 736b5fb95474..02ef7727bb55 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -171,12 +171,17 @@ struct inet6_dev {
171 struct ifmcaddr6 *mc_list; 171 struct ifmcaddr6 *mc_list;
172 struct ifmcaddr6 *mc_tomb; 172 struct ifmcaddr6 *mc_tomb;
173 spinlock_t mc_lock; 173 spinlock_t mc_lock;
174 unsigned char mc_qrv; 174
175 unsigned char mc_qrv; /* Query Robustness Variable */
175 unsigned char mc_gq_running; 176 unsigned char mc_gq_running;
176 unsigned char mc_ifc_count; 177 unsigned char mc_ifc_count;
177 unsigned char mc_dad_count; 178 unsigned char mc_dad_count;
178 unsigned long mc_v1_seen; 179
180 unsigned long mc_v1_seen; /* Max time we stay in MLDv1 mode */
181 unsigned long mc_qi; /* Query Interval */
182 unsigned long mc_qri; /* Query Response Interval */
179 unsigned long mc_maxdelay; 183 unsigned long mc_maxdelay;
184
180 struct timer_list mc_gq_timer; /* general query timer */ 185 struct timer_list mc_gq_timer; /* general query timer */
181 struct timer_list mc_ifc_timer; /* interface change timer */ 186 struct timer_list mc_ifc_timer; /* interface change timer */
182 struct timer_list mc_dad_timer; /* dad complete mc timer */ 187 struct timer_list mc_dad_timer; /* dad complete mc timer */
diff --git a/include/net/ip.h b/include/net/ip.h
index a68f838a132c..5e5268807a1c 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -194,7 +194,17 @@ static inline u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t syncp
194} 194}
195#endif 195#endif
196extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align); 196extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align);
197extern void snmp_mib_free(void __percpu *ptr[2]); 197
198static inline void snmp_mib_free(void __percpu *ptr[SNMP_ARRAY_SZ])
199{
200 int i;
201
202 BUG_ON(ptr == NULL);
203 for (i = 0; i < SNMP_ARRAY_SZ; i++) {
204 free_percpu(ptr[i]);
205 ptr[i] = NULL;
206 }
207}
198 208
199extern struct local_ports { 209extern struct local_ports {
200 seqlock_t lock; 210 seqlock_t lock;
@@ -254,9 +264,11 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
254 264
255extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); 265extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more);
256 266
257static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, struct sock *sk) 267static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk)
258{ 268{
259 if (iph->frag_off & htons(IP_DF)) { 269 struct iphdr *iph = ip_hdr(skb);
270
271 if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) {
260 /* This is only to work around buggy Windows95/2000 272 /* This is only to work around buggy Windows95/2000
261 * VJ compression implementations. If the ID field 273 * VJ compression implementations. If the ID field
262 * does not change, they drop every other packet in 274 * does not change, they drop every other packet in
@@ -268,9 +280,11 @@ static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, str
268 __ip_select_ident(iph, dst, 0); 280 __ip_select_ident(iph, dst, 0);
269} 281}
270 282
271static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more) 283static inline void ip_select_ident_more(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk, int more)
272{ 284{
273 if (iph->frag_off & htons(IP_DF)) { 285 struct iphdr *iph = ip_hdr(skb);
286
287 if ((iph->frag_off & htons(IP_DF)) && !skb->local_df) {
274 if (sk && inet_sk(sk)->inet_daddr) { 288 if (sk && inet_sk(sk)->inet_daddr) {
275 iph->id = htons(inet_sk(sk)->inet_id); 289 iph->id = htons(inet_sk(sk)->inet_id);
276 inet_sk(sk)->inet_id += 1 + more; 290 inet_sk(sk)->inet_id += 1 + more;
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index f667248202b6..2b786b7e3585 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -112,8 +112,6 @@ extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
112 const struct in6_addr *addr, 112 const struct in6_addr *addr,
113 bool anycast); 113 bool anycast);
114 114
115extern int ip6_dst_hoplimit(struct dst_entry *dst);
116
117/* 115/*
118 * support functions for ND 116 * support functions for ND
119 * 117 *
@@ -196,11 +194,9 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb)
196 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); 194 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb));
197} 195}
198 196
199static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt, struct in6_addr *dest) 197static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt)
200{ 198{
201 if (rt->rt6i_flags & RTF_GATEWAY) 199 return &rt->rt6i_gateway;
202 return &rt->rt6i_gateway;
203 return dest;
204} 200}
205 201
206#endif 202#endif
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 4da5de10d1d4..6d1549c4893c 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -36,6 +36,7 @@ struct __ip6_tnl_parm {
36struct ip6_tnl { 36struct ip6_tnl {
37 struct ip6_tnl __rcu *next; /* next tunnel in list */ 37 struct ip6_tnl __rcu *next; /* next tunnel in list */
38 struct net_device *dev; /* virtual device associated with tunnel */ 38 struct net_device *dev; /* virtual device associated with tunnel */
39 struct net *net; /* netns for packet i/o */
39 struct __ip6_tnl_parm parms; /* tunnel configuration parameters */ 40 struct __ip6_tnl_parm parms; /* tunnel configuration parameters */
40 struct flowi fl; /* flowi template for xmit */ 41 struct flowi fl; /* flowi template for xmit */
41 struct dst_entry *dst_cache; /* cached dst */ 42 struct dst_entry *dst_cache; /* cached dst */
@@ -74,7 +75,6 @@ static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
74 struct net_device_stats *stats = &dev->stats; 75 struct net_device_stats *stats = &dev->stats;
75 int pkt_len, err; 76 int pkt_len, err;
76 77
77 nf_reset(skb);
78 pkt_len = skb->len; 78 pkt_len = skb->len;
79 err = ip6_local_out(skb); 79 err = ip6_local_out(skb);
80 80
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index a354db5b7662..a0a4a100f5c9 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -86,12 +86,12 @@ struct tnl_ptk_info {
86#define PACKET_RCVD 0 86#define PACKET_RCVD 0
87#define PACKET_REJECT 1 87#define PACKET_REJECT 1
88 88
89#define IP_TNL_HASH_BITS 10 89#define IP_TNL_HASH_BITS 7
90#define IP_TNL_HASH_SIZE (1 << IP_TNL_HASH_BITS) 90#define IP_TNL_HASH_SIZE (1 << IP_TNL_HASH_BITS)
91 91
92struct ip_tunnel_net { 92struct ip_tunnel_net {
93 struct hlist_head *tunnels;
94 struct net_device *fb_tunnel_dev; 93 struct net_device *fb_tunnel_dev;
94 struct hlist_head tunnels[IP_TNL_HASH_SIZE];
95}; 95};
96 96
97#ifdef CONFIG_INET 97#ifdef CONFIG_INET
@@ -102,7 +102,7 @@ void ip_tunnel_dellink(struct net_device *dev, struct list_head *head);
102int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, 102int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
103 struct rtnl_link_ops *ops, char *devname); 103 struct rtnl_link_ops *ops, char *devname);
104 104
105void ip_tunnel_delete_net(struct ip_tunnel_net *itn); 105void ip_tunnel_delete_net(struct ip_tunnel_net *itn, struct rtnl_link_ops *ops);
106 106
107void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, 107void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
108 const struct iphdr *tnl_params, const u8 protocol); 108 const struct iphdr *tnl_params, const u8 protocol);
@@ -146,10 +146,9 @@ static inline u8 ip_tunnel_ecn_encap(u8 tos, const struct iphdr *iph,
146} 146}
147 147
148int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto); 148int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto);
149int iptunnel_xmit(struct net *net, struct rtable *rt, 149int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb,
150 struct sk_buff *skb,
151 __be32 src, __be32 dst, __u8 proto, 150 __be32 src, __be32 dst, __u8 proto,
152 __u8 tos, __u8 ttl, __be16 df); 151 __u8 tos, __u8 ttl, __be16 df, bool xnet);
153 152
154static inline void iptunnel_xmit_stats(int err, 153static inline void iptunnel_xmit_stats(int err,
155 struct net_device_stats *err_stats, 154 struct net_device_stats *err_stats,
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index f0d70f066f3d..9c4d37ec45a1 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -723,8 +723,6 @@ struct ip_vs_dest_dst {
723 struct rcu_head rcu_head; 723 struct rcu_head rcu_head;
724}; 724};
725 725
726/* In grace period after removing */
727#define IP_VS_DEST_STATE_REMOVING 0x01
728/* 726/*
729 * The real server destination forwarding entry 727 * The real server destination forwarding entry
730 * with ip address, port number, and so on. 728 * with ip address, port number, and so on.
@@ -742,7 +740,7 @@ struct ip_vs_dest {
742 740
743 atomic_t refcnt; /* reference counter */ 741 atomic_t refcnt; /* reference counter */
744 struct ip_vs_stats stats; /* statistics */ 742 struct ip_vs_stats stats; /* statistics */
745 unsigned long state; /* state flags */ 743 unsigned long idle_start; /* start time, jiffies */
746 744
747 /* connection counters and thresholds */ 745 /* connection counters and thresholds */
748 atomic_t activeconns; /* active connections */ 746 atomic_t activeconns; /* active connections */
@@ -756,14 +754,13 @@ struct ip_vs_dest {
756 struct ip_vs_dest_dst __rcu *dest_dst; /* cached dst info */ 754 struct ip_vs_dest_dst __rcu *dest_dst; /* cached dst info */
757 755
758 /* for virtual service */ 756 /* for virtual service */
759 struct ip_vs_service *svc; /* service it belongs to */ 757 struct ip_vs_service __rcu *svc; /* service it belongs to */
760 __u16 protocol; /* which protocol (TCP/UDP) */ 758 __u16 protocol; /* which protocol (TCP/UDP) */
761 __be16 vport; /* virtual port number */ 759 __be16 vport; /* virtual port number */
762 union nf_inet_addr vaddr; /* virtual IP address */ 760 union nf_inet_addr vaddr; /* virtual IP address */
763 __u32 vfwmark; /* firewall mark of service */ 761 __u32 vfwmark; /* firewall mark of service */
764 762
765 struct list_head t_list; /* in dest_trash */ 763 struct list_head t_list; /* in dest_trash */
766 struct rcu_head rcu_head;
767 unsigned int in_rs_table:1; /* we are in rs_table */ 764 unsigned int in_rs_table:1; /* we are in rs_table */
768}; 765};
769 766
@@ -1649,7 +1646,7 @@ static inline void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp)
1649/* CONFIG_IP_VS_NFCT */ 1646/* CONFIG_IP_VS_NFCT */
1650#endif 1647#endif
1651 1648
1652static inline unsigned int 1649static inline int
1653ip_vs_dest_conn_overhead(struct ip_vs_dest *dest) 1650ip_vs_dest_conn_overhead(struct ip_vs_dest *dest)
1654{ 1651{
1655 /* 1652 /*
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 5fe564985171..bbf1c8fb8511 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -41,6 +41,7 @@
41#define NEXTHDR_ICMP 58 /* ICMP for IPv6. */ 41#define NEXTHDR_ICMP 58 /* ICMP for IPv6. */
42#define NEXTHDR_NONE 59 /* No next header */ 42#define NEXTHDR_NONE 59 /* No next header */
43#define NEXTHDR_DEST 60 /* Destination options header. */ 43#define NEXTHDR_DEST 60 /* Destination options header. */
44#define NEXTHDR_SCTP 132 /* SCTP message. */
44#define NEXTHDR_MOBILITY 135 /* Mobility header. */ 45#define NEXTHDR_MOBILITY 135 /* Mobility header. */
45 46
46#define NEXTHDR_MAX 255 47#define NEXTHDR_MAX 255
@@ -657,6 +658,8 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
657 658
658extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); 659extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
659 660
661extern int ip6_dst_hoplimit(struct dst_entry *dst);
662
660/* 663/*
661 * Header manipulation 664 * Header manipulation
662 */ 665 */
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h
index 0af8b8dfbc22..550c2d6ec7ff 100644
--- a/include/net/irda/irlan_common.h
+++ b/include/net/irda/irlan_common.h
@@ -32,6 +32,7 @@
32#include <linux/types.h> 32#include <linux/types.h>
33#include <linux/skbuff.h> 33#include <linux/skbuff.h>
34#include <linux/netdevice.h> 34#include <linux/netdevice.h>
35#include <linux/if_ether.h>
35 36
36#include <net/irda/irttp.h> 37#include <net/irda/irttp.h>
37 38
@@ -161,7 +162,7 @@ struct irlan_provider_cb {
161 int access_type; /* Access type */ 162 int access_type; /* Access type */
162 __u16 send_arb_val; 163 __u16 send_arb_val;
163 164
164 __u8 mac_address[6]; /* Generated MAC address for peer device */ 165 __u8 mac_address[ETH_ALEN]; /* Generated MAC address for peer device */
165}; 166};
166 167
167/* 168/*
diff --git a/include/net/llc_if.h b/include/net/llc_if.h
index b595a004d31b..f0cb909b60eb 100644
--- a/include/net/llc_if.h
+++ b/include/net/llc_if.h
@@ -62,36 +62,6 @@
62#define LLC_STATUS_CONFLICT 7 /* disconnect conn */ 62#define LLC_STATUS_CONFLICT 7 /* disconnect conn */
63#define LLC_STATUS_RESET_DONE 8 /* */ 63#define LLC_STATUS_RESET_DONE 8 /* */
64 64
65/**
66 * llc_mac_null - determines if a address is a null mac address
67 * @mac: Mac address to test if null.
68 *
69 * Determines if a given address is a null mac address. Returns 0 if the
70 * address is not a null mac, 1 if the address is a null mac.
71 */
72static inline int llc_mac_null(const u8 *mac)
73{
74 return is_zero_ether_addr(mac);
75}
76
77static inline int llc_mac_multicast(const u8 *mac)
78{
79 return is_multicast_ether_addr(mac);
80}
81/**
82 * llc_mac_match - determines if two mac addresses are the same
83 * @mac1: First mac address to compare.
84 * @mac2: Second mac address to compare.
85 *
86 * Determines if two given mac address are the same. Returns 0 if there
87 * is not a complete match up to len, 1 if a complete match up to len is
88 * found.
89 */
90static inline int llc_mac_match(const u8 *mac1, const u8 *mac2)
91{
92 return !compare_ether_addr(mac1, mac2);
93}
94
95extern int llc_establish_connection(struct sock *sk, u8 *lmac, 65extern int llc_establish_connection(struct sock *sk, u8 *lmac,
96 u8 *dmac, u8 dsap); 66 u8 *dmac, u8 dsap);
97extern int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb); 67extern int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 551ba6a6a073..cc6035f1a2f1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -152,11 +152,14 @@ struct ieee80211_low_level_stats {
152 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed 152 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed
153 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed 153 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed
154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed 154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed
155 * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel,
156 * this is used only with channel switching with CSA
155 */ 157 */
156enum ieee80211_chanctx_change { 158enum ieee80211_chanctx_change {
157 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), 159 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
158 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), 160 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
159 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), 161 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2),
162 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3),
160}; 163};
161 164
162/** 165/**
@@ -372,7 +375,7 @@ struct ieee80211_bss_conf {
372}; 375};
373 376
374/** 377/**
375 * enum mac80211_tx_control_flags - flags to describe transmission information/status 378 * enum mac80211_tx_info_flags - flags to describe transmission information/status
376 * 379 *
377 * These flags are used with the @flags member of &ieee80211_tx_info. 380 * These flags are used with the @flags member of &ieee80211_tx_info.
378 * 381 *
@@ -468,7 +471,7 @@ struct ieee80211_bss_conf {
468 * Note: If you have to add new flags to the enumeration, then don't 471 * Note: If you have to add new flags to the enumeration, then don't
469 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. 472 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
470 */ 473 */
471enum mac80211_tx_control_flags { 474enum mac80211_tx_info_flags {
472 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 475 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
473 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(1), 476 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(1),
474 IEEE80211_TX_CTL_NO_ACK = BIT(2), 477 IEEE80211_TX_CTL_NO_ACK = BIT(2),
@@ -504,6 +507,18 @@ enum mac80211_tx_control_flags {
504 507
505#define IEEE80211_TX_CTL_STBC_SHIFT 23 508#define IEEE80211_TX_CTL_STBC_SHIFT 23
506 509
510/**
511 * enum mac80211_tx_control_flags - flags to describe transmit control
512 *
513 * @IEEE80211_TX_CTRL_PORT_CTRL_PROTO: this frame is a port control
514 * protocol frame (e.g. EAP)
515 *
516 * These flags are used in tx_info->control.flags.
517 */
518enum mac80211_tx_control_flags {
519 IEEE80211_TX_CTRL_PORT_CTRL_PROTO = BIT(0),
520};
521
507/* 522/*
508 * This definition is used as a mask to clear all temporary flags, which are 523 * This definition is used as a mask to clear all temporary flags, which are
509 * set by the tx handlers for each transmission attempt by the mac80211 stack. 524 * set by the tx handlers for each transmission attempt by the mac80211 stack.
@@ -677,7 +692,8 @@ struct ieee80211_tx_info {
677 /* NB: vif can be NULL for injected frames */ 692 /* NB: vif can be NULL for injected frames */
678 struct ieee80211_vif *vif; 693 struct ieee80211_vif *vif;
679 struct ieee80211_key_conf *hw_key; 694 struct ieee80211_key_conf *hw_key;
680 /* 8 bytes free */ 695 u32 flags;
696 /* 4 bytes free */
681 } control; 697 } control;
682 struct { 698 struct {
683 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; 699 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES];
@@ -811,6 +827,8 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
811 * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC 827 * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC
812 * is stored in the @ampdu_delimiter_crc field) 828 * is stored in the @ampdu_delimiter_crc field)
813 * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3 829 * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3
830 * @RX_FLAG_10MHZ: 10 MHz (half channel) was used
831 * @RX_FLAG_5MHZ: 5 MHz (quarter channel) was used
814 */ 832 */
815enum mac80211_rx_flags { 833enum mac80211_rx_flags {
816 RX_FLAG_MMIC_ERROR = BIT(0), 834 RX_FLAG_MMIC_ERROR = BIT(0),
@@ -839,6 +857,8 @@ enum mac80211_rx_flags {
839 RX_FLAG_80P80MHZ = BIT(24), 857 RX_FLAG_80P80MHZ = BIT(24),
840 RX_FLAG_160MHZ = BIT(25), 858 RX_FLAG_160MHZ = BIT(25),
841 RX_FLAG_STBC_MASK = BIT(26) | BIT(27), 859 RX_FLAG_STBC_MASK = BIT(26) | BIT(27),
860 RX_FLAG_10MHZ = BIT(28),
861 RX_FLAG_5MHZ = BIT(29),
842}; 862};
843 863
844#define RX_FLAG_STBC_SHIFT 26 864#define RX_FLAG_STBC_SHIFT 26
@@ -1004,11 +1024,11 @@ enum ieee80211_smps_mode {
1004 * @radar_enabled: whether radar detection is enabled 1024 * @radar_enabled: whether radar detection is enabled
1005 * 1025 *
1006 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame 1026 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
1007 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, 1027 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
1008 * but actually means the number of transmissions not the number of retries 1028 * but actually means the number of transmissions not the number of retries
1009 * @short_frame_max_tx_count: Maximum number of transmissions for a "short" 1029 * @short_frame_max_tx_count: Maximum number of transmissions for a "short"
1010 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the 1030 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the
1011 * number of transmissions not the number of retries 1031 * number of transmissions not the number of retries
1012 * 1032 *
1013 * @smps_mode: spatial multiplexing powersave mode; note that 1033 * @smps_mode: spatial multiplexing powersave mode; note that
1014 * %IEEE80211_SMPS_STATIC is used when the device is not 1034 * %IEEE80211_SMPS_STATIC is used when the device is not
@@ -1080,6 +1100,7 @@ enum ieee80211_vif_flags {
1080 * @addr: address of this interface 1100 * @addr: address of this interface
1081 * @p2p: indicates whether this AP or STA interface is a p2p 1101 * @p2p: indicates whether this AP or STA interface is a p2p
1082 * interface, i.e. a GO or p2p-sta respectively 1102 * interface, i.e. a GO or p2p-sta respectively
1103 * @csa_active: marks whether a channel switch is going on
1083 * @driver_flags: flags/capabilities the driver has for this interface, 1104 * @driver_flags: flags/capabilities the driver has for this interface,
1084 * these need to be set (or cleared) when the interface is added 1105 * these need to be set (or cleared) when the interface is added
1085 * or, if supported by the driver, the interface type is changed 1106 * or, if supported by the driver, the interface type is changed
@@ -1092,7 +1113,7 @@ enum ieee80211_vif_flags {
1092 * be off when it is %NULL there can still be races and packets could be 1113 * be off when it is %NULL there can still be races and packets could be
1093 * processed after it switches back to %NULL. 1114 * processed after it switches back to %NULL.
1094 * @debugfs_dir: debugfs dentry, can be used by drivers to create own per 1115 * @debugfs_dir: debugfs dentry, can be used by drivers to create own per
1095 * interface debug files. Note that it will be NULL for the virtual 1116 * interface debug files. Note that it will be NULL for the virtual
1096 * monitor interface (if that is requested.) 1117 * monitor interface (if that is requested.)
1097 * @drv_priv: data area for driver use, will always be aligned to 1118 * @drv_priv: data area for driver use, will always be aligned to
1098 * sizeof(void *). 1119 * sizeof(void *).
@@ -1102,6 +1123,7 @@ struct ieee80211_vif {
1102 struct ieee80211_bss_conf bss_conf; 1123 struct ieee80211_bss_conf bss_conf;
1103 u8 addr[ETH_ALEN]; 1124 u8 addr[ETH_ALEN];
1104 bool p2p; 1125 bool p2p;
1126 bool csa_active;
1105 1127
1106 u8 cab_queue; 1128 u8 cab_queue;
1107 u8 hw_queue[IEEE80211_NUM_ACS]; 1129 u8 hw_queue[IEEE80211_NUM_ACS];
@@ -1425,10 +1447,10 @@ struct ieee80211_tx_control {
1425 * the stack. 1447 * the stack.
1426 * 1448 *
1427 * @IEEE80211_HW_CONNECTION_MONITOR: 1449 * @IEEE80211_HW_CONNECTION_MONITOR:
1428 * The hardware performs its own connection monitoring, including 1450 * The hardware performs its own connection monitoring, including
1429 * periodic keep-alives to the AP and probing the AP on beacon loss. 1451 * periodic keep-alives to the AP and probing the AP on beacon loss.
1430 * When this flag is set, signaling beacon-loss will cause an immediate 1452 * When this flag is set, signaling beacon-loss will cause an immediate
1431 * change to disassociated state. 1453 * change to disassociated state.
1432 * 1454 *
1433 * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC: 1455 * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC:
1434 * This device needs to get data from beacon before association (i.e. 1456 * This device needs to get data from beacon before association (i.e.
@@ -1527,10 +1549,10 @@ enum ieee80211_hw_flags {
1527 * @channel_change_time: time (in microseconds) it takes to change channels. 1549 * @channel_change_time: time (in microseconds) it takes to change channels.
1528 * 1550 *
1529 * @max_signal: Maximum value for signal (rssi) in RX information, used 1551 * @max_signal: Maximum value for signal (rssi) in RX information, used
1530 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB 1552 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB
1531 * 1553 *
1532 * @max_listen_interval: max listen interval in units of beacon interval 1554 * @max_listen_interval: max listen interval in units of beacon interval
1533 * that HW supports 1555 * that HW supports
1534 * 1556 *
1535 * @queues: number of available hardware transmit queues for 1557 * @queues: number of available hardware transmit queues for
1536 * data packets. WMM/QoS requires at least four, these 1558 * data packets. WMM/QoS requires at least four, these
@@ -2444,7 +2466,7 @@ enum ieee80211_roc_type {
2444 * The callback can sleep. 2466 * The callback can sleep.
2445 * 2467 *
2446 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware. 2468 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware.
2447 * Currently, this is only used for IBSS mode debugging. Is not a 2469 * Currently, this is only used for IBSS mode debugging. Is not a
2448 * required function. 2470 * required function.
2449 * The callback can sleep. 2471 * The callback can sleep.
2450 * 2472 *
@@ -2495,8 +2517,8 @@ enum ieee80211_roc_type {
2495 * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout 2517 * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout
2496 * accordingly. This callback is not required and may sleep. 2518 * accordingly. This callback is not required and may sleep.
2497 * 2519 *
2498 * @testmode_cmd: Implement a cfg80211 test mode command. 2520 * @testmode_cmd: Implement a cfg80211 test mode command. The passed @vif may
2499 * The callback can sleep. 2521 * be %NULL. The callback can sleep.
2500 * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep. 2522 * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep.
2501 * 2523 *
2502 * @flush: Flush all pending frames from the hardware queue, making sure 2524 * @flush: Flush all pending frames from the hardware queue, making sure
@@ -2634,6 +2656,16 @@ enum ieee80211_roc_type {
2634 * @ipv6_addr_change: IPv6 address assignment on the given interface changed. 2656 * @ipv6_addr_change: IPv6 address assignment on the given interface changed.
2635 * Currently, this is only called for managed or P2P client interfaces. 2657 * Currently, this is only called for managed or P2P client interfaces.
2636 * This callback is optional; it must not sleep. 2658 * This callback is optional; it must not sleep.
2659 *
2660 * @channel_switch_beacon: Starts a channel switch to a new channel.
2661 * Beacons are modified to include CSA or ECSA IEs before calling this
2662 * function. The corresponding count fields in these IEs must be
2663 * decremented, and when they reach zero the driver must call
2664 * ieee80211_csa_finish(). Drivers which use ieee80211_beacon_get()
2665 * get the csa counter decremented by mac80211, but must check if it is
2666 * zero using ieee80211_csa_is_complete() after the beacon has been
2667 * transmitted and then call ieee80211_csa_finish().
2668 *
2637 */ 2669 */
2638struct ieee80211_ops { 2670struct ieee80211_ops {
2639 void (*tx)(struct ieee80211_hw *hw, 2671 void (*tx)(struct ieee80211_hw *hw,
@@ -2747,7 +2779,8 @@ struct ieee80211_ops {
2747 void (*rfkill_poll)(struct ieee80211_hw *hw); 2779 void (*rfkill_poll)(struct ieee80211_hw *hw);
2748 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); 2780 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class);
2749#ifdef CONFIG_NL80211_TESTMODE 2781#ifdef CONFIG_NL80211_TESTMODE
2750 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); 2782 int (*testmode_cmd)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2783 void *data, int len);
2751 int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb, 2784 int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb,
2752 struct netlink_callback *cb, 2785 struct netlink_callback *cb,
2753 void *data, int len); 2786 void *data, int len);
@@ -2821,6 +2854,9 @@ struct ieee80211_ops {
2821 struct ieee80211_vif *vif, 2854 struct ieee80211_vif *vif,
2822 struct inet6_dev *idev); 2855 struct inet6_dev *idev);
2823#endif 2856#endif
2857 void (*channel_switch_beacon)(struct ieee80211_hw *hw,
2858 struct ieee80211_vif *vif,
2859 struct cfg80211_chan_def *chandef);
2824}; 2860};
2825 2861
2826/** 2862/**
@@ -2878,14 +2914,14 @@ enum ieee80211_tpt_led_trigger_flags {
2878}; 2914};
2879 2915
2880#ifdef CONFIG_MAC80211_LEDS 2916#ifdef CONFIG_MAC80211_LEDS
2881extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); 2917char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw);
2882extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); 2918char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw);
2883extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); 2919char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw);
2884extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); 2920char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw);
2885extern char *__ieee80211_create_tpt_led_trigger( 2921char *__ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw,
2886 struct ieee80211_hw *hw, unsigned int flags, 2922 unsigned int flags,
2887 const struct ieee80211_tpt_blink *blink_table, 2923 const struct ieee80211_tpt_blink *blink_table,
2888 unsigned int blink_table_len); 2924 unsigned int blink_table_len);
2889#endif 2925#endif
2890/** 2926/**
2891 * ieee80211_get_tx_led_name - get name of TX LED 2927 * ieee80211_get_tx_led_name - get name of TX LED
@@ -3316,6 +3352,25 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
3316} 3352}
3317 3353
3318/** 3354/**
3355 * ieee80211_csa_finish - notify mac80211 about channel switch
3356 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3357 *
3358 * After a channel switch announcement was scheduled and the counter in this
3359 * announcement hit zero, this function must be called by the driver to
3360 * notify mac80211 that the channel can be changed.
3361 */
3362void ieee80211_csa_finish(struct ieee80211_vif *vif);
3363
3364/**
3365 * ieee80211_csa_is_complete - find out if counters reached zero
3366 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3367 *
3368 * This function returns whether the channel switch counters reached zero.
3369 */
3370bool ieee80211_csa_is_complete(struct ieee80211_vif *vif);
3371
3372
3373/**
3319 * ieee80211_proberesp_get - retrieve a Probe Response template 3374 * ieee80211_proberesp_get - retrieve a Probe Response template
3320 * @hw: pointer obtained from ieee80211_alloc_hw(). 3375 * @hw: pointer obtained from ieee80211_alloc_hw().
3321 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3376 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
@@ -3634,6 +3689,89 @@ void ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf,
3634 int tid, struct ieee80211_key_seq *seq); 3689 int tid, struct ieee80211_key_seq *seq);
3635 3690
3636/** 3691/**
3692 * ieee80211_set_key_tx_seq - set key TX sequence counter
3693 *
3694 * @keyconf: the parameter passed with the set key
3695 * @seq: new sequence data
3696 *
3697 * This function allows a driver to set the current TX IV/PNs for the
3698 * given key. This is useful when resuming from WoWLAN sleep and the
3699 * device may have transmitted frames using the PTK, e.g. replies to
3700 * ARP requests.
3701 *
3702 * Note that this function may only be called when no TX processing
3703 * can be done concurrently.
3704 */
3705void ieee80211_set_key_tx_seq(struct ieee80211_key_conf *keyconf,
3706 struct ieee80211_key_seq *seq);
3707
3708/**
3709 * ieee80211_set_key_rx_seq - set key RX sequence counter
3710 *
3711 * @keyconf: the parameter passed with the set key
3712 * @tid: The TID, or -1 for the management frame value (CCMP only);
3713 * the value on TID 0 is also used for non-QoS frames. For
3714 * CMAC, only TID 0 is valid.
3715 * @seq: new sequence data
3716 *
3717 * This function allows a driver to set the current RX IV/PNs for the
3718 * given key. This is useful when resuming from WoWLAN sleep and GTK
3719 * rekey may have been done while suspended. It should not be called
3720 * if IV checking is done by the device and not by mac80211.
3721 *
3722 * Note that this function may only be called when no RX processing
3723 * can be done concurrently.
3724 */
3725void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *keyconf,
3726 int tid, struct ieee80211_key_seq *seq);
3727
3728/**
3729 * ieee80211_remove_key - remove the given key
3730 * @keyconf: the parameter passed with the set key
3731 *
3732 * Remove the given key. If the key was uploaded to the hardware at the
3733 * time this function is called, it is not deleted in the hardware but
3734 * instead assumed to have been removed already.
3735 *
3736 * Note that due to locking considerations this function can (currently)
3737 * only be called during key iteration (ieee80211_iter_keys().)
3738 */
3739void ieee80211_remove_key(struct ieee80211_key_conf *keyconf);
3740
3741/**
3742 * ieee80211_gtk_rekey_add - add a GTK key from rekeying during WoWLAN
3743 * @vif: the virtual interface to add the key on
3744 * @keyconf: new key data
3745 *
3746 * When GTK rekeying was done while the system was suspended, (a) new
3747 * key(s) will be available. These will be needed by mac80211 for proper
3748 * RX processing, so this function allows setting them.
3749 *
3750 * The function returns the newly allocated key structure, which will
3751 * have similar contents to the passed key configuration but point to
3752 * mac80211-owned memory. In case of errors, the function returns an
3753 * ERR_PTR(), use IS_ERR() etc.
3754 *
3755 * Note that this function assumes the key isn't added to hardware
3756 * acceleration, so no TX will be done with the key. Since it's a GTK
3757 * on managed (station) networks, this is true anyway. If the driver
3758 * calls this function from the resume callback and subsequently uses
3759 * the return code 1 to reconfigure the device, this key will be part
3760 * of the reconfiguration.
3761 *
3762 * Note that the driver should also call ieee80211_set_key_rx_seq()
3763 * for the new key for each TID to set up sequence counters properly.
3764 *
3765 * IMPORTANT: If this replaces a key that is present in the hardware,
3766 * then it will attempt to remove it during this call. In many cases
3767 * this isn't what you want, so call ieee80211_remove_key() first for
3768 * the key that's being replaced.
3769 */
3770struct ieee80211_key_conf *
3771ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
3772 struct ieee80211_key_conf *keyconf);
3773
3774/**
3637 * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying 3775 * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying
3638 * @vif: virtual interface the rekeying was done on 3776 * @vif: virtual interface the rekeying was done on
3639 * @bssid: The BSSID of the AP, for checking association 3777 * @bssid: The BSSID of the AP, for checking association
@@ -4205,8 +4343,10 @@ struct rate_control_ops {
4205 4343
4206 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp); 4344 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp);
4207 void (*rate_init)(void *priv, struct ieee80211_supported_band *sband, 4345 void (*rate_init)(void *priv, struct ieee80211_supported_band *sband,
4346 struct cfg80211_chan_def *chandef,
4208 struct ieee80211_sta *sta, void *priv_sta); 4347 struct ieee80211_sta *sta, void *priv_sta);
4209 void (*rate_update)(void *priv, struct ieee80211_supported_band *sband, 4348 void (*rate_update)(void *priv, struct ieee80211_supported_band *sband,
4349 struct cfg80211_chan_def *chandef,
4210 struct ieee80211_sta *sta, void *priv_sta, 4350 struct ieee80211_sta *sta, void *priv_sta,
4211 u32 changed); 4351 u32 changed);
4212 void (*free_sta)(void *priv, struct ieee80211_sta *sta, 4352 void (*free_sta)(void *priv, struct ieee80211_sta *sta,
diff --git a/include/net/mac802154.h b/include/net/mac802154.h
index d0d11df9cba1..807d6b7a943f 100644
--- a/include/net/mac802154.h
+++ b/include/net/mac802154.h
@@ -133,7 +133,7 @@ struct ieee802154_ops {
133 133
134/* Basic interface to register ieee802154 device */ 134/* Basic interface to register ieee802154 device */
135struct ieee802154_dev * 135struct ieee802154_dev *
136ieee802154_alloc_device(size_t priv_data_lex, struct ieee802154_ops *ops); 136ieee802154_alloc_device(size_t priv_data_len, struct ieee802154_ops *ops);
137void ieee802154_free_device(struct ieee802154_dev *dev); 137void ieee802154_free_device(struct ieee802154_dev *dev);
138int ieee802154_register_device(struct ieee802154_dev *dev); 138int ieee802154_register_device(struct ieee802154_dev *dev);
139void ieee802154_unregister_device(struct ieee802154_dev *dev); 139void ieee802154_unregister_device(struct ieee802154_dev *dev);
diff --git a/include/net/mld.h b/include/net/mld.h
index 467143cd4e2f..faa1d161bf24 100644
--- a/include/net/mld.h
+++ b/include/net/mld.h
@@ -63,13 +63,48 @@ struct mld2_query {
63#define mld2q_mrc mld2q_hdr.icmp6_maxdelay 63#define mld2q_mrc mld2q_hdr.icmp6_maxdelay
64#define mld2q_resv1 mld2q_hdr.icmp6_dataun.un_data16[1] 64#define mld2q_resv1 mld2q_hdr.icmp6_dataun.un_data16[1]
65 65
66/* Max Response Code */ 66/* RFC3810, 5.1.3. Maximum Response Code:
67#define MLDV2_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) 67 *
68#define MLDV2_EXP(thresh, nbmant, nbexp, value) \ 68 * If Maximum Response Code >= 32768, Maximum Response Code represents a
69 ((value) < (thresh) ? (value) : \ 69 * floating-point value as follows:
70 ((MLDV2_MASK(value, nbmant) | (1<<(nbmant))) << \ 70 *
71 (MLDV2_MASK((value) >> (nbmant), nbexp) + (nbexp)))) 71 * 0 1 2 3 4 5 6 7 8 9 A B C D E F
72 72 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
73#define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value) 73 * |1| exp | mant |
74 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
75 */
76#define MLDV2_MRC_EXP(value) (((value) >> 12) & 0x0007)
77#define MLDV2_MRC_MAN(value) ((value) & 0x0fff)
78
79/* RFC3810, 5.1.9. QQIC (Querier's Query Interval Code):
80 *
81 * If QQIC >= 128, QQIC represents a floating-point value as follows:
82 *
83 * 0 1 2 3 4 5 6 7
84 * +-+-+-+-+-+-+-+-+
85 * |1| exp | mant |
86 * +-+-+-+-+-+-+-+-+
87 */
88#define MLDV2_QQIC_EXP(value) (((value) >> 4) & 0x07)
89#define MLDV2_QQIC_MAN(value) ((value) & 0x0f)
90
91static inline unsigned long mldv2_mrc(const struct mld2_query *mlh2)
92{
93 /* RFC3810, 5.1.3. Maximum Response Code */
94 unsigned long ret, mc_mrc = ntohs(mlh2->mld2q_mrc);
95
96 if (mc_mrc < 32768) {
97 ret = mc_mrc;
98 } else {
99 unsigned long mc_man, mc_exp;
100
101 mc_exp = MLDV2_MRC_EXP(mc_mrc);
102 mc_man = MLDV2_MRC_MAN(mc_mrc);
103
104 ret = (mc_man | 0x1000) << (mc_exp + 3);
105 }
106
107 return ret;
108}
74 109
75#endif 110#endif
diff --git a/include/net/mrp.h b/include/net/mrp.h
index 4fbf02aa2ec1..0f7558b638ae 100644
--- a/include/net/mrp.h
+++ b/include/net/mrp.h
@@ -112,6 +112,7 @@ struct mrp_applicant {
112 struct mrp_application *app; 112 struct mrp_application *app;
113 struct net_device *dev; 113 struct net_device *dev;
114 struct timer_list join_timer; 114 struct timer_list join_timer;
115 struct timer_list periodic_timer;
115 116
116 spinlock_t lock; 117 spinlock_t lock;
117 struct sk_buff_head queue; 118 struct sk_buff_head queue;
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 6fea32340ae8..ea0cc26ab70e 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -190,7 +190,9 @@ static inline struct neighbour *__ipv6_neigh_lookup(struct net_device *dev, cons
190} 190}
191 191
192extern int ndisc_init(void); 192extern int ndisc_init(void);
193extern int ndisc_late_init(void);
193 194
195extern void ndisc_late_cleanup(void);
194extern void ndisc_cleanup(void); 196extern void ndisc_cleanup(void);
195 197
196extern int ndisc_rcv(struct sk_buff *skb); 198extern int ndisc_rcv(struct sk_buff *skb);
@@ -204,6 +206,11 @@ extern void ndisc_send_ns(struct net_device *dev,
204extern void ndisc_send_rs(struct net_device *dev, 206extern void ndisc_send_rs(struct net_device *dev,
205 const struct in6_addr *saddr, 207 const struct in6_addr *saddr,
206 const struct in6_addr *daddr); 208 const struct in6_addr *daddr);
209extern void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
210 const struct in6_addr *daddr,
211 const struct in6_addr *solicited_addr,
212 bool router, bool solicited, bool override,
213 bool inc_opt);
207 214
208extern void ndisc_send_redirect(struct sk_buff *skb, 215extern void ndisc_send_redirect(struct sk_buff *skb,
209 const struct in6_addr *target); 216 const struct in6_addr *target);
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 7e748ad8b50c..536501a3e58d 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -195,68 +195,67 @@ static inline void *neighbour_priv(const struct neighbour *n)
195#define NEIGH_UPDATE_F_ISROUTER 0x40000000 195#define NEIGH_UPDATE_F_ISROUTER 0x40000000
196#define NEIGH_UPDATE_F_ADMIN 0x80000000 196#define NEIGH_UPDATE_F_ADMIN 0x80000000
197 197
198extern void neigh_table_init(struct neigh_table *tbl); 198void neigh_table_init(struct neigh_table *tbl);
199extern int neigh_table_clear(struct neigh_table *tbl); 199int neigh_table_clear(struct neigh_table *tbl);
200extern struct neighbour * neigh_lookup(struct neigh_table *tbl, 200struct neighbour *neigh_lookup(struct neigh_table *tbl, const void *pkey,
201 const void *pkey, 201 struct net_device *dev);
202 struct net_device *dev); 202struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, struct net *net,
203extern struct neighbour * neigh_lookup_nodev(struct neigh_table *tbl, 203 const void *pkey);
204 struct net *net, 204struct neighbour *__neigh_create(struct neigh_table *tbl, const void *pkey,
205 const void *pkey); 205 struct net_device *dev, bool want_ref);
206extern struct neighbour * __neigh_create(struct neigh_table *tbl,
207 const void *pkey,
208 struct net_device *dev,
209 bool want_ref);
210static inline struct neighbour *neigh_create(struct neigh_table *tbl, 206static inline struct neighbour *neigh_create(struct neigh_table *tbl,
211 const void *pkey, 207 const void *pkey,
212 struct net_device *dev) 208 struct net_device *dev)
213{ 209{
214 return __neigh_create(tbl, pkey, dev, true); 210 return __neigh_create(tbl, pkey, dev, true);
215} 211}
216extern void neigh_destroy(struct neighbour *neigh); 212void neigh_destroy(struct neighbour *neigh);
217extern int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb); 213int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb);
218extern int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, 214int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags);
219 u32 flags); 215void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
220extern void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); 216int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
221extern int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); 217int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb);
222extern int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb); 218int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb);
223extern int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb); 219int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb);
224extern int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb); 220int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb);
225extern int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb); 221struct neighbour *neigh_event_ns(struct neigh_table *tbl,
226extern struct neighbour *neigh_event_ns(struct neigh_table *tbl,
227 u8 *lladdr, void *saddr, 222 u8 *lladdr, void *saddr,
228 struct net_device *dev); 223 struct net_device *dev);
229 224
230extern struct neigh_parms *neigh_parms_alloc(struct net_device *dev, struct neigh_table *tbl); 225struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
231extern void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms); 226 struct neigh_table *tbl);
227void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms);
232 228
233static inline 229static inline
234struct net *neigh_parms_net(const struct neigh_parms *parms) 230struct net *neigh_parms_net(const struct neigh_parms *parms)
235{ 231{
236 return read_pnet(&parms->net); 232 return read_pnet(&parms->net);
237} 233}
238 234
239extern unsigned long neigh_rand_reach_time(unsigned long base); 235unsigned long neigh_rand_reach_time(unsigned long base);
240 236
241extern void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p, 237void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p,
242 struct sk_buff *skb); 238 struct sk_buff *skb);
243extern struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev, int creat); 239struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, struct net *net,
244extern struct pneigh_entry *__pneigh_lookup(struct neigh_table *tbl, 240 const void *key, struct net_device *dev,
245 struct net *net, 241 int creat);
246 const void *key, 242struct pneigh_entry *__pneigh_lookup(struct neigh_table *tbl, struct net *net,
247 struct net_device *dev); 243 const void *key, struct net_device *dev);
248extern int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev); 244int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key,
245 struct net_device *dev);
249 246
250static inline 247static inline struct net *pneigh_net(const struct pneigh_entry *pneigh)
251struct net *pneigh_net(const struct pneigh_entry *pneigh)
252{ 248{
253 return read_pnet(&pneigh->net); 249 return read_pnet(&pneigh->net);
254} 250}
255 251
256extern void neigh_app_ns(struct neighbour *n); 252void neigh_app_ns(struct neighbour *n);
257extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); 253void neigh_for_each(struct neigh_table *tbl,
258extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); 254 void (*cb)(struct neighbour *, void *), void *cookie);
259extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_entry *)); 255void __neigh_for_each_release(struct neigh_table *tbl,
256 int (*cb)(struct neighbour *));
257void pneigh_for_each(struct neigh_table *tbl,
258 void (*cb)(struct pneigh_entry *));
260 259
261struct neigh_seq_state { 260struct neigh_seq_state {
262 struct seq_net_private p; 261 struct seq_net_private p;
@@ -270,15 +269,14 @@ struct neigh_seq_state {
270#define NEIGH_SEQ_IS_PNEIGH 0x00000002 269#define NEIGH_SEQ_IS_PNEIGH 0x00000002
271#define NEIGH_SEQ_SKIP_NOARP 0x00000004 270#define NEIGH_SEQ_SKIP_NOARP 0x00000004
272}; 271};
273extern void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *, unsigned int); 272void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *,
274extern void *neigh_seq_next(struct seq_file *, void *, loff_t *); 273 unsigned int);
275extern void neigh_seq_stop(struct seq_file *, void *); 274void *neigh_seq_next(struct seq_file *, void *, loff_t *);
276 275void neigh_seq_stop(struct seq_file *, void *);
277extern int neigh_sysctl_register(struct net_device *dev, 276
278 struct neigh_parms *p, 277int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
279 char *p_name, 278 char *p_name, proc_handler *proc_handler);
280 proc_handler *proc_handler); 279void neigh_sysctl_unregister(struct neigh_parms *p);
281extern void neigh_sysctl_unregister(struct neigh_parms *p);
282 280
283static inline void __neigh_parms_put(struct neigh_parms *parms) 281static inline void __neigh_parms_put(struct neigh_parms *parms)
284{ 282{
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 84e37b1ca9e1..9d22f08896c6 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -74,6 +74,7 @@ struct net {
74 struct hlist_head *dev_index_head; 74 struct hlist_head *dev_index_head;
75 unsigned int dev_base_seq; /* protected by rtnl_mutex */ 75 unsigned int dev_base_seq; /* protected by rtnl_mutex */
76 int ifindex; 76 int ifindex;
77 unsigned int dev_unreg_count;
77 78
78 /* core fib_rules */ 79 /* core fib_rules */
79 struct list_head rules_ops; 80 struct list_head rules_ops;
@@ -119,7 +120,6 @@ struct net {
119 struct netns_ipvs *ipvs; 120 struct netns_ipvs *ipvs;
120#endif 121#endif
121 struct sock *diag_nlsk; 122 struct sock *diag_nlsk;
122 atomic_t rt_genid;
123 atomic_t fnhe_genid; 123 atomic_t fnhe_genid;
124}; 124};
125 125
@@ -333,14 +333,42 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header)
333} 333}
334#endif 334#endif
335 335
336static inline int rt_genid(struct net *net) 336static inline int rt_genid_ipv4(struct net *net)
337{ 337{
338 return atomic_read(&net->rt_genid); 338 return atomic_read(&net->ipv4.rt_genid);
339} 339}
340 340
341static inline void rt_genid_bump(struct net *net) 341static inline void rt_genid_bump_ipv4(struct net *net)
342{ 342{
343 atomic_inc(&net->rt_genid); 343 atomic_inc(&net->ipv4.rt_genid);
344}
345
346#if IS_ENABLED(CONFIG_IPV6)
347static inline int rt_genid_ipv6(struct net *net)
348{
349 return atomic_read(&net->ipv6.rt_genid);
350}
351
352static inline void rt_genid_bump_ipv6(struct net *net)
353{
354 atomic_inc(&net->ipv6.rt_genid);
355}
356#else
357static inline int rt_genid_ipv6(struct net *net)
358{
359 return 0;
360}
361
362static inline void rt_genid_bump_ipv6(struct net *net)
363{
364}
365#endif
366
367/* For callers who don't really care about whether it's IPv4 or IPv6 */
368static inline void rt_genid_bump_all(struct net *net)
369{
370 rt_genid_bump_ipv4(net);
371 rt_genid_bump_ipv6(net);
344} 372}
345 373
346static inline int fnhe_genid(struct net *net) 374static inline int fnhe_genid(struct net *net)
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 644d9c223d24..0c1288a50e8b 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -181,8 +181,7 @@ __nf_conntrack_find(struct net *net, u16 zone,
181 const struct nf_conntrack_tuple *tuple); 181 const struct nf_conntrack_tuple *tuple);
182 182
183extern int nf_conntrack_hash_check_insert(struct nf_conn *ct); 183extern int nf_conntrack_hash_check_insert(struct nf_conn *ct);
184extern void nf_ct_delete_from_lists(struct nf_conn *ct); 184bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report);
185extern void nf_ct_dying_timeout(struct nf_conn *ct);
186 185
187extern void nf_conntrack_flush_report(struct net *net, u32 portid, int report); 186extern void nf_conntrack_flush_report(struct net *net, u32 portid, int report);
188 187
@@ -235,7 +234,7 @@ static inline bool nf_ct_kill(struct nf_conn *ct)
235} 234}
236 235
237/* These are for NAT. Icky. */ 236/* These are for NAT. Icky. */
238extern s16 (*nf_ct_nat_offset)(const struct nf_conn *ct, 237extern s32 (*nf_ct_nat_offset)(const struct nf_conn *ct,
239 enum ip_conntrack_dir dir, 238 enum ip_conntrack_dir dir,
240 u32 seq); 239 u32 seq);
241 240
@@ -249,7 +248,9 @@ extern void nf_ct_untracked_status_or(unsigned long bits);
249 248
250/* Iterate over all conntracks: if iter returns true, it's deleted. */ 249/* Iterate over all conntracks: if iter returns true, it's deleted. */
251extern void 250extern void
252nf_ct_iterate_cleanup(struct net *net, int (*iter)(struct nf_conn *i, void *data), void *data); 251nf_ct_iterate_cleanup(struct net *net,
252 int (*iter)(struct nf_conn *i, void *data),
253 void *data, u32 portid, int report);
253extern void nf_conntrack_free(struct nf_conn *ct); 254extern void nf_conntrack_free(struct nf_conn *ct);
254extern struct nf_conn * 255extern struct nf_conn *
255nf_conntrack_alloc(struct net *net, u16 zone, 256nf_conntrack_alloc(struct net *net, u16 zone,
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
index 977bc8a46444..88a1d4060d52 100644
--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -10,6 +10,7 @@ enum nf_ct_ext_id {
10#if defined(CONFIG_NF_NAT) || defined(CONFIG_NF_NAT_MODULE) 10#if defined(CONFIG_NF_NAT) || defined(CONFIG_NF_NAT_MODULE)
11 NF_CT_EXT_NAT, 11 NF_CT_EXT_NAT,
12#endif 12#endif
13 NF_CT_EXT_SEQADJ,
13 NF_CT_EXT_ACCT, 14 NF_CT_EXT_ACCT,
14#ifdef CONFIG_NF_CONNTRACK_EVENTS 15#ifdef CONFIG_NF_CONNTRACK_EVENTS
15 NF_CT_EXT_ECACHE, 16 NF_CT_EXT_ECACHE,
@@ -26,17 +27,22 @@ enum nf_ct_ext_id {
26#ifdef CONFIG_NF_CONNTRACK_LABELS 27#ifdef CONFIG_NF_CONNTRACK_LABELS
27 NF_CT_EXT_LABELS, 28 NF_CT_EXT_LABELS,
28#endif 29#endif
30#if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY)
31 NF_CT_EXT_SYNPROXY,
32#endif
29 NF_CT_EXT_NUM, 33 NF_CT_EXT_NUM,
30}; 34};
31 35
32#define NF_CT_EXT_HELPER_TYPE struct nf_conn_help 36#define NF_CT_EXT_HELPER_TYPE struct nf_conn_help
33#define NF_CT_EXT_NAT_TYPE struct nf_conn_nat 37#define NF_CT_EXT_NAT_TYPE struct nf_conn_nat
38#define NF_CT_EXT_SEQADJ_TYPE struct nf_conn_seqadj
34#define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter 39#define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter
35#define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache 40#define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache
36#define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone 41#define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone
37#define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp 42#define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp
38#define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout 43#define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout
39#define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels 44#define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels
45#define NF_CT_EXT_SYNPROXY_TYPE struct nf_conn_synproxy
40 46
41/* Extensions: optional stuff which isn't permanently in struct. */ 47/* Extensions: optional stuff which isn't permanently in struct. */
42struct nf_ct_ext { 48struct nf_ct_ext {
@@ -80,7 +86,7 @@ static inline void nf_ct_ext_destroy(struct nf_conn *ct)
80static inline void nf_ct_ext_free(struct nf_conn *ct) 86static inline void nf_ct_ext_free(struct nf_conn *ct)
81{ 87{
82 if (ct->ext) 88 if (ct->ext)
83 kfree(ct->ext); 89 kfree_rcu(ct->ext, rcu);
84} 90}
85 91
86/* Add this type, returns pointer to data or NULL. */ 92/* Add this type, returns pointer to data or NULL. */
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index 914d8d900798..b411d7b17dec 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -148,17 +148,10 @@ extern int nf_ct_port_nlattr_tuple_size(void);
148extern const struct nla_policy nf_ct_port_nla_policy[]; 148extern const struct nla_policy nf_ct_port_nla_policy[];
149 149
150#ifdef CONFIG_SYSCTL 150#ifdef CONFIG_SYSCTL
151#ifdef DEBUG_INVALID_PACKETS
152#define LOG_INVALID(net, proto) \ 151#define LOG_INVALID(net, proto) \
153 ((net)->ct.sysctl_log_invalid == (proto) || \ 152 ((net)->ct.sysctl_log_invalid == (proto) || \
154 (net)->ct.sysctl_log_invalid == IPPROTO_RAW) 153 (net)->ct.sysctl_log_invalid == IPPROTO_RAW)
155#else 154#else
156#define LOG_INVALID(net, proto) \
157 (((net)->ct.sysctl_log_invalid == (proto) || \
158 (net)->ct.sysctl_log_invalid == IPPROTO_RAW) \
159 && net_ratelimit())
160#endif
161#else
162static inline int LOG_INVALID(struct net *net, int proto) { return 0; } 155static inline int LOG_INVALID(struct net *net, int proto) { return 0; }
163#endif /* CONFIG_SYSCTL */ 156#endif /* CONFIG_SYSCTL */
164 157
diff --git a/include/net/netfilter/nf_conntrack_seqadj.h b/include/net/netfilter/nf_conntrack_seqadj.h
new file mode 100644
index 000000000000..f6177a5fe0ca
--- /dev/null
+++ b/include/net/netfilter/nf_conntrack_seqadj.h
@@ -0,0 +1,51 @@
1#ifndef _NF_CONNTRACK_SEQADJ_H
2#define _NF_CONNTRACK_SEQADJ_H
3
4#include <net/netfilter/nf_conntrack_extend.h>
5
6/**
7 * struct nf_ct_seqadj - sequence number adjustment information
8 *
9 * @correction_pos: position of the last TCP sequence number modification
10 * @offset_before: sequence number offset before last modification
11 * @offset_after: sequence number offset after last modification
12 */
13struct nf_ct_seqadj {
14 u32 correction_pos;
15 s32 offset_before;
16 s32 offset_after;
17};
18
19struct nf_conn_seqadj {
20 struct nf_ct_seqadj seq[IP_CT_DIR_MAX];
21};
22
23static inline struct nf_conn_seqadj *nfct_seqadj(const struct nf_conn *ct)
24{
25 return nf_ct_ext_find(ct, NF_CT_EXT_SEQADJ);
26}
27
28static inline struct nf_conn_seqadj *nfct_seqadj_ext_add(struct nf_conn *ct)
29{
30 return nf_ct_ext_add(ct, NF_CT_EXT_SEQADJ, GFP_ATOMIC);
31}
32
33extern int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
34 s32 off);
35extern int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
36 __be32 seq, s32 off);
37extern void nf_ct_tcp_seqadj_set(struct sk_buff *skb,
38 struct nf_conn *ct,
39 enum ip_conntrack_info ctinfo,
40 s32 off);
41
42extern int nf_ct_seq_adjust(struct sk_buff *skb,
43 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
44 unsigned int protoff);
45extern s32 nf_ct_seq_offset(const struct nf_conn *ct, enum ip_conntrack_dir,
46 u32 seq);
47
48extern int nf_conntrack_seqadj_init(void);
49extern void nf_conntrack_seqadj_fini(void);
50
51#endif /* _NF_CONNTRACK_SEQADJ_H */
diff --git a/include/net/netfilter/nf_conntrack_synproxy.h b/include/net/netfilter/nf_conntrack_synproxy.h
new file mode 100644
index 000000000000..f572f313d6f1
--- /dev/null
+++ b/include/net/netfilter/nf_conntrack_synproxy.h
@@ -0,0 +1,77 @@
1#ifndef _NF_CONNTRACK_SYNPROXY_H
2#define _NF_CONNTRACK_SYNPROXY_H
3
4#include <net/netns/generic.h>
5
6struct nf_conn_synproxy {
7 u32 isn;
8 u32 its;
9 u32 tsoff;
10};
11
12static inline struct nf_conn_synproxy *nfct_synproxy(const struct nf_conn *ct)
13{
14#if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY)
15 return nf_ct_ext_find(ct, NF_CT_EXT_SYNPROXY);
16#else
17 return NULL;
18#endif
19}
20
21static inline struct nf_conn_synproxy *nfct_synproxy_ext_add(struct nf_conn *ct)
22{
23#if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY)
24 return nf_ct_ext_add(ct, NF_CT_EXT_SYNPROXY, GFP_ATOMIC);
25#else
26 return NULL;
27#endif
28}
29
30struct synproxy_stats {
31 unsigned int syn_received;
32 unsigned int cookie_invalid;
33 unsigned int cookie_valid;
34 unsigned int cookie_retrans;
35 unsigned int conn_reopened;
36};
37
38struct synproxy_net {
39 struct nf_conn *tmpl;
40 struct synproxy_stats __percpu *stats;
41};
42
43extern int synproxy_net_id;
44static inline struct synproxy_net *synproxy_pernet(struct net *net)
45{
46 return net_generic(net, synproxy_net_id);
47}
48
49struct synproxy_options {
50 u8 options;
51 u8 wscale;
52 u16 mss;
53 u32 tsval;
54 u32 tsecr;
55};
56
57struct tcphdr;
58struct xt_synproxy_info;
59extern bool synproxy_parse_options(const struct sk_buff *skb, unsigned int doff,
60 const struct tcphdr *th,
61 struct synproxy_options *opts);
62extern unsigned int synproxy_options_size(const struct synproxy_options *opts);
63extern void synproxy_build_options(struct tcphdr *th,
64 const struct synproxy_options *opts);
65
66extern void synproxy_init_timestamp_cookie(const struct xt_synproxy_info *info,
67 struct synproxy_options *opts);
68extern void synproxy_check_timestamp_cookie(struct synproxy_options *opts);
69
70extern unsigned int synproxy_tstamp_adjust(struct sk_buff *skb,
71 unsigned int protoff,
72 struct tcphdr *th,
73 struct nf_conn *ct,
74 enum ip_conntrack_info ctinfo,
75 const struct nf_conn_synproxy *synproxy);
76
77#endif /* _NF_CONNTRACK_SYNPROXY_H */
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index ad14a799fd2e..59a192420053 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -13,15 +13,6 @@ enum nf_nat_manip_type {
13#define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \ 13#define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \
14 (hooknum) != NF_INET_LOCAL_IN) 14 (hooknum) != NF_INET_LOCAL_IN)
15 15
16/* NAT sequence number modifications */
17struct nf_nat_seq {
18 /* position of the last TCP sequence number modification (if any) */
19 u_int32_t correction_pos;
20
21 /* sequence number offset before and after last modification */
22 int16_t offset_before, offset_after;
23};
24
25#include <linux/list.h> 16#include <linux/list.h>
26#include <linux/netfilter/nf_conntrack_pptp.h> 17#include <linux/netfilter/nf_conntrack_pptp.h>
27#include <net/netfilter/nf_conntrack_extend.h> 18#include <net/netfilter/nf_conntrack_extend.h>
@@ -39,7 +30,6 @@ struct nf_conn;
39/* The structure embedded in the conntrack structure. */ 30/* The structure embedded in the conntrack structure. */
40struct nf_conn_nat { 31struct nf_conn_nat {
41 struct hlist_node bysource; 32 struct hlist_node bysource;
42 struct nf_nat_seq seq[IP_CT_DIR_MAX];
43 struct nf_conn *ct; 33 struct nf_conn *ct;
44 union nf_conntrack_nat_help help; 34 union nf_conntrack_nat_help help;
45#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ 35#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h
index b4d6bfc2af03..404324d1d0c4 100644
--- a/include/net/netfilter/nf_nat_helper.h
+++ b/include/net/netfilter/nf_nat_helper.h
@@ -39,28 +39,9 @@ extern int nf_nat_mangle_udp_packet(struct sk_buff *skb,
39 const char *rep_buffer, 39 const char *rep_buffer,
40 unsigned int rep_len); 40 unsigned int rep_len);
41 41
42extern void nf_nat_set_seq_adjust(struct nf_conn *ct,
43 enum ip_conntrack_info ctinfo,
44 __be32 seq, s16 off);
45extern int nf_nat_seq_adjust(struct sk_buff *skb,
46 struct nf_conn *ct,
47 enum ip_conntrack_info ctinfo,
48 unsigned int protoff);
49extern int (*nf_nat_seq_adjust_hook)(struct sk_buff *skb,
50 struct nf_conn *ct,
51 enum ip_conntrack_info ctinfo,
52 unsigned int protoff);
53
54/* Setup NAT on this expected conntrack so it follows master, but goes 42/* Setup NAT on this expected conntrack so it follows master, but goes
55 * to port ct->master->saved_proto. */ 43 * to port ct->master->saved_proto. */
56extern void nf_nat_follow_master(struct nf_conn *ct, 44extern void nf_nat_follow_master(struct nf_conn *ct,
57 struct nf_conntrack_expect *this); 45 struct nf_conntrack_expect *this);
58 46
59extern s16 nf_nat_get_offset(const struct nf_conn *ct,
60 enum ip_conntrack_dir dir,
61 u32 seq);
62
63extern void nf_nat_tcp_seq_adjust(struct sk_buff *skb, struct nf_conn *ct,
64 u32 dir, int off);
65
66#endif 47#endif
diff --git a/include/net/netfilter/nf_tproxy_core.h b/include/net/netfilter/nf_tproxy_core.h
deleted file mode 100644
index 36d9379d4c4b..000000000000
--- a/include/net/netfilter/nf_tproxy_core.h
+++ /dev/null
@@ -1,210 +0,0 @@
1#ifndef _NF_TPROXY_CORE_H
2#define _NF_TPROXY_CORE_H
3
4#include <linux/types.h>
5#include <linux/in.h>
6#include <linux/skbuff.h>
7#include <net/sock.h>
8#include <net/inet_hashtables.h>
9#include <net/inet6_hashtables.h>
10#include <net/tcp.h>
11
12#define NFT_LOOKUP_ANY 0
13#define NFT_LOOKUP_LISTENER 1
14#define NFT_LOOKUP_ESTABLISHED 2
15
16/* look up and get a reference to a matching socket */
17
18
19/* This function is used by the 'TPROXY' target and the 'socket'
20 * match. The following lookups are supported:
21 *
22 * Explicit TProxy target rule
23 * ===========================
24 *
25 * This is used when the user wants to intercept a connection matching
26 * an explicit iptables rule. In this case the sockets are assumed
27 * matching in preference order:
28 *
29 * - match: if there's a fully established connection matching the
30 * _packet_ tuple, it is returned, assuming the redirection
31 * already took place and we process a packet belonging to an
32 * established connection
33 *
34 * - match: if there's a listening socket matching the redirection
35 * (e.g. on-port & on-ip of the connection), it is returned,
36 * regardless if it was bound to 0.0.0.0 or an explicit
37 * address. The reasoning is that if there's an explicit rule, it
38 * does not really matter if the listener is bound to an interface
39 * or to 0. The user already stated that he wants redirection
40 * (since he added the rule).
41 *
42 * "socket" match based redirection (no specific rule)
43 * ===================================================
44 *
45 * There are connections with dynamic endpoints (e.g. FTP data
46 * connection) that the user is unable to add explicit rules
47 * for. These are taken care of by a generic "socket" rule. It is
48 * assumed that the proxy application is trusted to open such
49 * connections without explicit iptables rule (except of course the
50 * generic 'socket' rule). In this case the following sockets are
51 * matched in preference order:
52 *
53 * - match: if there's a fully established connection matching the
54 * _packet_ tuple
55 *
56 * - match: if there's a non-zero bound listener (possibly with a
57 * non-local address) We don't accept zero-bound listeners, since
58 * then local services could intercept traffic going through the
59 * box.
60 *
61 * Please note that there's an overlap between what a TPROXY target
62 * and a socket match will match. Normally if you have both rules the
63 * "socket" match will be the first one, effectively all packets
64 * belonging to established connections going through that one.
65 */
66static inline struct sock *
67nf_tproxy_get_sock_v4(struct net *net, const u8 protocol,
68 const __be32 saddr, const __be32 daddr,
69 const __be16 sport, const __be16 dport,
70 const struct net_device *in, int lookup_type)
71{
72 struct sock *sk;
73
74 /* look up socket */
75 switch (protocol) {
76 case IPPROTO_TCP:
77 switch (lookup_type) {
78 case NFT_LOOKUP_ANY:
79 sk = __inet_lookup(net, &tcp_hashinfo,
80 saddr, sport, daddr, dport,
81 in->ifindex);
82 break;
83 case NFT_LOOKUP_LISTENER:
84 sk = inet_lookup_listener(net, &tcp_hashinfo,
85 saddr, sport,
86 daddr, dport,
87 in->ifindex);
88
89 /* NOTE: we return listeners even if bound to
90 * 0.0.0.0, those are filtered out in
91 * xt_socket, since xt_TPROXY needs 0 bound
92 * listeners too */
93
94 break;
95 case NFT_LOOKUP_ESTABLISHED:
96 sk = inet_lookup_established(net, &tcp_hashinfo,
97 saddr, sport, daddr, dport,
98 in->ifindex);
99 break;
100 default:
101 WARN_ON(1);
102 sk = NULL;
103 break;
104 }
105 break;
106 case IPPROTO_UDP:
107 sk = udp4_lib_lookup(net, saddr, sport, daddr, dport,
108 in->ifindex);
109 if (sk && lookup_type != NFT_LOOKUP_ANY) {
110 int connected = (sk->sk_state == TCP_ESTABLISHED);
111 int wildcard = (inet_sk(sk)->inet_rcv_saddr == 0);
112
113 /* NOTE: we return listeners even if bound to
114 * 0.0.0.0, those are filtered out in
115 * xt_socket, since xt_TPROXY needs 0 bound
116 * listeners too */
117 if ((lookup_type == NFT_LOOKUP_ESTABLISHED && (!connected || wildcard)) ||
118 (lookup_type == NFT_LOOKUP_LISTENER && connected)) {
119 sock_put(sk);
120 sk = NULL;
121 }
122 }
123 break;
124 default:
125 WARN_ON(1);
126 sk = NULL;
127 }
128
129 pr_debug("tproxy socket lookup: proto %u %08x:%u -> %08x:%u, lookup type: %d, sock %p\n",
130 protocol, ntohl(saddr), ntohs(sport), ntohl(daddr), ntohs(dport), lookup_type, sk);
131
132 return sk;
133}
134
135#if IS_ENABLED(CONFIG_IPV6)
136static inline struct sock *
137nf_tproxy_get_sock_v6(struct net *net, const u8 protocol,
138 const struct in6_addr *saddr, const struct in6_addr *daddr,
139 const __be16 sport, const __be16 dport,
140 const struct net_device *in, int lookup_type)
141{
142 struct sock *sk;
143
144 /* look up socket */
145 switch (protocol) {
146 case IPPROTO_TCP:
147 switch (lookup_type) {
148 case NFT_LOOKUP_ANY:
149 sk = inet6_lookup(net, &tcp_hashinfo,
150 saddr, sport, daddr, dport,
151 in->ifindex);
152 break;
153 case NFT_LOOKUP_LISTENER:
154 sk = inet6_lookup_listener(net, &tcp_hashinfo,
155 saddr, sport,
156 daddr, ntohs(dport),
157 in->ifindex);
158
159 /* NOTE: we return listeners even if bound to
160 * 0.0.0.0, those are filtered out in
161 * xt_socket, since xt_TPROXY needs 0 bound
162 * listeners too */
163
164 break;
165 case NFT_LOOKUP_ESTABLISHED:
166 sk = __inet6_lookup_established(net, &tcp_hashinfo,
167 saddr, sport, daddr, ntohs(dport),
168 in->ifindex);
169 break;
170 default:
171 WARN_ON(1);
172 sk = NULL;
173 break;
174 }
175 break;
176 case IPPROTO_UDP:
177 sk = udp6_lib_lookup(net, saddr, sport, daddr, dport,
178 in->ifindex);
179 if (sk && lookup_type != NFT_LOOKUP_ANY) {
180 int connected = (sk->sk_state == TCP_ESTABLISHED);
181 int wildcard = ipv6_addr_any(&inet6_sk(sk)->rcv_saddr);
182
183 /* NOTE: we return listeners even if bound to
184 * 0.0.0.0, those are filtered out in
185 * xt_socket, since xt_TPROXY needs 0 bound
186 * listeners too */
187 if ((lookup_type == NFT_LOOKUP_ESTABLISHED && (!connected || wildcard)) ||
188 (lookup_type == NFT_LOOKUP_LISTENER && connected)) {
189 sock_put(sk);
190 sk = NULL;
191 }
192 }
193 break;
194 default:
195 WARN_ON(1);
196 sk = NULL;
197 }
198
199 pr_debug("tproxy socket lookup: proto %u %pI6:%u -> %pI6:%u, lookup type: %d, sock %p\n",
200 protocol, saddr, ntohs(sport), daddr, ntohs(dport), lookup_type, sk);
201
202 return sk;
203}
204#endif
205
206/* assign a socket to the skb -- consumes sk */
207void
208nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk);
209
210#endif
diff --git a/include/net/netfilter/nfnetlink_queue.h b/include/net/netfilter/nfnetlink_queue.h
index 86267a529514..aff88ba91391 100644
--- a/include/net/netfilter/nfnetlink_queue.h
+++ b/include/net/netfilter/nfnetlink_queue.h
@@ -15,6 +15,8 @@ int nfqnl_ct_put(struct sk_buff *skb, struct nf_conn *ct,
15 enum ip_conntrack_info ctinfo); 15 enum ip_conntrack_info ctinfo);
16void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct, 16void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct,
17 enum ip_conntrack_info ctinfo, int diff); 17 enum ip_conntrack_info ctinfo, int diff);
18int nfqnl_attach_expect(struct nf_conn *ct, const struct nlattr *attr,
19 u32 portid, u32 report);
18#else 20#else
19inline struct nf_conn * 21inline struct nf_conn *
20nfqnl_ct_get(struct sk_buff *entskb, size_t *size, enum ip_conntrack_info *ctinfo) 22nfqnl_ct_get(struct sk_buff *entskb, size_t *size, enum ip_conntrack_info *ctinfo)
@@ -39,5 +41,11 @@ inline void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct,
39 enum ip_conntrack_info ctinfo, int diff) 41 enum ip_conntrack_info ctinfo, int diff)
40{ 42{
41} 43}
44
45inline int nfqnl_attach_expect(struct nf_conn *ct, const struct nlattr *attr,
46 u32 portid, u32 report)
47{
48 return 0;
49}
42#endif /* NF_CONNTRACK */ 50#endif /* NF_CONNTRACK */
43#endif 51#endif
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 2ba9de89e8ec..bf2ec2202c56 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -77,5 +77,6 @@ struct netns_ipv4 {
77 struct fib_rules_ops *mr_rules_ops; 77 struct fib_rules_ops *mr_rules_ops;
78#endif 78#endif
79#endif 79#endif
80 atomic_t rt_genid;
80}; 81};
81#endif 82#endif
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 005e2c2e39a9..0fb2401197c5 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -72,6 +72,7 @@ struct netns_ipv6 {
72#endif 72#endif
73#endif 73#endif
74 atomic_t dev_addr_genid; 74 atomic_t dev_addr_genid;
75 atomic_t rt_genid;
75}; 76};
76 77
77#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) 78#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index 50ab8c26ab59..099d02782e22 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -25,11 +25,7 @@ struct netprio_map {
25 u32 priomap[]; 25 u32 priomap[];
26}; 26};
27 27
28struct cgroup_netprio_state { 28void sock_update_netprioidx(struct sock *sk);
29 struct cgroup_subsys_state css;
30};
31
32extern void sock_update_netprioidx(struct sock *sk);
33 29
34#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) 30#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP)
35 31
@@ -39,7 +35,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
39 u32 idx; 35 u32 idx;
40 36
41 rcu_read_lock(); 37 rcu_read_lock();
42 css = task_subsys_state(p, net_prio_subsys_id); 38 css = task_css(p, net_prio_subsys_id);
43 idx = css->cgroup->id; 39 idx = css->cgroup->id;
44 rcu_read_unlock(); 40 rcu_read_unlock();
45 return idx; 41 return idx;
@@ -53,7 +49,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
53 u32 idx = 0; 49 u32 idx = 0;
54 50
55 rcu_read_lock(); 51 rcu_read_lock();
56 css = task_subsys_state(p, net_prio_subsys_id); 52 css = task_css(p, net_prio_subsys_id);
57 if (css) 53 if (css)
58 idx = css->cgroup->id; 54 idx = css->cgroup->id;
59 rcu_read_unlock(); 55 rcu_read_unlock();
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 5f286b726bb6..f68ee68e4e3e 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -224,6 +224,9 @@ int nfc_set_remote_general_bytes(struct nfc_dev *dev,
224 u8 *gt, u8 gt_len); 224 u8 *gt, u8 gt_len);
225u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, size_t *gb_len); 225u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, size_t *gb_len);
226 226
227int nfc_fw_download_done(struct nfc_dev *dev, const char *firmware_name,
228 u32 result);
229
227int nfc_targets_found(struct nfc_dev *dev, 230int nfc_targets_found(struct nfc_dev *dev,
228 struct nfc_target *targets, int ntargets); 231 struct nfc_target *targets, int ntargets);
229int nfc_target_lost(struct nfc_dev *dev, u32 target_idx); 232int nfc_target_lost(struct nfc_dev *dev, u32 target_idx);
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 13174509cdfd..2ebef77a2f9a 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -14,8 +14,8 @@ struct tcf_walker {
14 int (*fn)(struct tcf_proto *, unsigned long node, struct tcf_walker *); 14 int (*fn)(struct tcf_proto *, unsigned long node, struct tcf_walker *);
15}; 15};
16 16
17extern int register_tcf_proto_ops(struct tcf_proto_ops *ops); 17int register_tcf_proto_ops(struct tcf_proto_ops *ops);
18extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops); 18int unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
19 19
20static inline unsigned long 20static inline unsigned long
21__cls_set_class(unsigned long *clp, unsigned long cl) 21__cls_set_class(unsigned long *clp, unsigned long cl)
@@ -126,17 +126,17 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
126 return 0; 126 return 0;
127} 127}
128 128
129extern int tcf_exts_validate(struct net *net, struct tcf_proto *tp, 129int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
130 struct nlattr **tb, struct nlattr *rate_tlv, 130 struct nlattr **tb, struct nlattr *rate_tlv,
131 struct tcf_exts *exts, 131 struct tcf_exts *exts,
132 const struct tcf_ext_map *map); 132 const struct tcf_ext_map *map);
133extern void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); 133void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts);
134extern void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, 134void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
135 struct tcf_exts *src); 135 struct tcf_exts *src);
136extern int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts, 136int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts,
137 const struct tcf_ext_map *map); 137 const struct tcf_ext_map *map);
138extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, 138int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts,
139 const struct tcf_ext_map *map); 139 const struct tcf_ext_map *map);
140 140
141/** 141/**
142 * struct tcf_pkt_info - packet information 142 * struct tcf_pkt_info - packet information
@@ -239,14 +239,14 @@ struct tcf_ematch_ops {
239 struct list_head link; 239 struct list_head link;
240}; 240};
241 241
242extern int tcf_em_register(struct tcf_ematch_ops *); 242int tcf_em_register(struct tcf_ematch_ops *);
243extern void tcf_em_unregister(struct tcf_ematch_ops *); 243void tcf_em_unregister(struct tcf_ematch_ops *);
244extern int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *, 244int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *,
245 struct tcf_ematch_tree *); 245 struct tcf_ematch_tree *);
246extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *); 246void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *);
247extern int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int); 247int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int);
248extern int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *, 248int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *,
249 struct tcf_pkt_info *); 249 struct tcf_pkt_info *);
250 250
251/** 251/**
252 * tcf_em_tree_change - replace ematch tree of a running classifier 252 * tcf_em_tree_change - replace ematch tree of a running classifier
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 388bf8b6d060..59ec3cd15d68 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -64,8 +64,8 @@ struct qdisc_watchdog {
64 struct Qdisc *qdisc; 64 struct Qdisc *qdisc;
65}; 65};
66 66
67extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc); 67void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
68extern void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires); 68void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires);
69 69
70static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, 70static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
71 psched_time_t expires) 71 psched_time_t expires)
@@ -73,31 +73,34 @@ static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
73 qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires)); 73 qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires));
74} 74}
75 75
76extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd); 76void qdisc_watchdog_cancel(struct qdisc_watchdog *wd);
77 77
78extern struct Qdisc_ops pfifo_qdisc_ops; 78extern struct Qdisc_ops pfifo_qdisc_ops;
79extern struct Qdisc_ops bfifo_qdisc_ops; 79extern struct Qdisc_ops bfifo_qdisc_ops;
80extern struct Qdisc_ops pfifo_head_drop_qdisc_ops; 80extern struct Qdisc_ops pfifo_head_drop_qdisc_ops;
81 81
82extern int fifo_set_limit(struct Qdisc *q, unsigned int limit); 82int fifo_set_limit(struct Qdisc *q, unsigned int limit);
83extern struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops, 83struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,
84 unsigned int limit); 84 unsigned int limit);
85 85
86extern int register_qdisc(struct Qdisc_ops *qops); 86int register_qdisc(struct Qdisc_ops *qops);
87extern int unregister_qdisc(struct Qdisc_ops *qops); 87int unregister_qdisc(struct Qdisc_ops *qops);
88extern void qdisc_list_del(struct Qdisc *q); 88void qdisc_get_default(char *id, size_t len);
89extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); 89int qdisc_set_default(const char *id);
90extern struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); 90
91extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, 91void qdisc_list_del(struct Qdisc *q);
92 struct nlattr *tab); 92struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle);
93extern void qdisc_put_rtab(struct qdisc_rate_table *tab); 93struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle);
94extern void qdisc_put_stab(struct qdisc_size_table *tab); 94struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
95extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); 95 struct nlattr *tab);
96extern int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q, 96void qdisc_put_rtab(struct qdisc_rate_table *tab);
97 struct net_device *dev, struct netdev_queue *txq, 97void qdisc_put_stab(struct qdisc_size_table *tab);
98 spinlock_t *root_lock); 98void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc);
99 99int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,
100extern void __qdisc_run(struct Qdisc *q); 100 struct net_device *dev, struct netdev_queue *txq,
101 spinlock_t *root_lock);
102
103void __qdisc_run(struct Qdisc *q);
101 104
102static inline void qdisc_run(struct Qdisc *q) 105static inline void qdisc_run(struct Qdisc *q)
103{ 106{
@@ -105,10 +108,10 @@ static inline void qdisc_run(struct Qdisc *q)
105 __qdisc_run(q); 108 __qdisc_run(q);
106} 109}
107 110
108extern int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp, 111int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp,
109 struct tcf_result *res);
110extern int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
111 struct tcf_result *res); 112 struct tcf_result *res);
113int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
114 struct tcf_result *res);
112 115
113/* Calculate maximal size of packet seen by hard_start_xmit 116/* Calculate maximal size of packet seen by hard_start_xmit
114 routine of this device. 117 routine of this device.
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index e5ae0c50fa9c..f4eb365f7dcd 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -316,6 +316,7 @@ extern struct Qdisc noop_qdisc;
316extern struct Qdisc_ops noop_qdisc_ops; 316extern struct Qdisc_ops noop_qdisc_ops;
317extern struct Qdisc_ops pfifo_fast_ops; 317extern struct Qdisc_ops pfifo_fast_ops;
318extern struct Qdisc_ops mq_qdisc_ops; 318extern struct Qdisc_ops mq_qdisc_ops;
319extern const struct Qdisc_ops *default_qdisc_ops;
319 320
320struct Qdisc_class_common { 321struct Qdisc_class_common {
321 u32 classid; 322 u32 classid;
@@ -350,30 +351,32 @@ qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id)
350 return NULL; 351 return NULL;
351} 352}
352 353
353extern int qdisc_class_hash_init(struct Qdisc_class_hash *); 354int qdisc_class_hash_init(struct Qdisc_class_hash *);
354extern void qdisc_class_hash_insert(struct Qdisc_class_hash *, struct Qdisc_class_common *); 355void qdisc_class_hash_insert(struct Qdisc_class_hash *,
355extern void qdisc_class_hash_remove(struct Qdisc_class_hash *, struct Qdisc_class_common *); 356 struct Qdisc_class_common *);
356extern void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *); 357void qdisc_class_hash_remove(struct Qdisc_class_hash *,
357extern void qdisc_class_hash_destroy(struct Qdisc_class_hash *); 358 struct Qdisc_class_common *);
358 359void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *);
359extern void dev_init_scheduler(struct net_device *dev); 360void qdisc_class_hash_destroy(struct Qdisc_class_hash *);
360extern void dev_shutdown(struct net_device *dev); 361
361extern void dev_activate(struct net_device *dev); 362void dev_init_scheduler(struct net_device *dev);
362extern void dev_deactivate(struct net_device *dev); 363void dev_shutdown(struct net_device *dev);
363extern void dev_deactivate_many(struct list_head *head); 364void dev_activate(struct net_device *dev);
364extern struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, 365void dev_deactivate(struct net_device *dev);
365 struct Qdisc *qdisc); 366void dev_deactivate_many(struct list_head *head);
366extern void qdisc_reset(struct Qdisc *qdisc); 367struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
367extern void qdisc_destroy(struct Qdisc *qdisc); 368 struct Qdisc *qdisc);
368extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); 369void qdisc_reset(struct Qdisc *qdisc);
369extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, 370void qdisc_destroy(struct Qdisc *qdisc);
370 struct Qdisc_ops *ops); 371void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
371extern struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue, 372struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
372 struct Qdisc_ops *ops, u32 parentid); 373 const struct Qdisc_ops *ops);
373extern void __qdisc_calculate_pkt_len(struct sk_buff *skb, 374struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
374 const struct qdisc_size_table *stab); 375 const struct Qdisc_ops *ops, u32 parentid);
375extern void tcf_destroy(struct tcf_proto *tp); 376void __qdisc_calculate_pkt_len(struct sk_buff *skb,
376extern void tcf_destroy_chain(struct tcf_proto **fl); 377 const struct qdisc_size_table *stab);
378void tcf_destroy(struct tcf_proto *tp);
379void tcf_destroy_chain(struct tcf_proto **fl);
377 380
378/* Reset all TX qdiscs greater then index of a device. */ 381/* Reset all TX qdiscs greater then index of a device. */
379static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i) 382static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
@@ -698,7 +701,8 @@ static inline u64 psched_l2t_ns(const struct psched_ratecfg *r,
698 return ((u64)len * r->mult) >> r->shift; 701 return ((u64)len * r->mult) >> r->shift;
699} 702}
700 703
701extern void psched_ratecfg_precompute(struct psched_ratecfg *r, const struct tc_ratespec *conf); 704void psched_ratecfg_precompute(struct psched_ratecfg *r,
705 const struct tc_ratespec *conf);
702 706
703static inline void psched_ratecfg_getrate(struct tc_ratespec *res, 707static inline void psched_ratecfg_getrate(struct tc_ratespec *res,
704 const struct psched_ratecfg *r) 708 const struct psched_ratecfg *r)
diff --git a/include/net/sctp/auth.h b/include/net/sctp/auth.h
index 49bc9577c61e..aa80bef3c9d5 100644
--- a/include/net/sctp/auth.h
+++ b/include/net/sctp/auth.h
@@ -22,16 +22,10 @@
22 * 22 *
23 * Please send any bug reports or fixes you make to the 23 * Please send any bug reports or fixes you make to the
24 * email address(es): 24 * email address(es):
25 * lksctp developers <lksctp-developers@lists.sourceforge.net> 25 * lksctp developers <linux-sctp@vger.kernel.org>
26 *
27 * Or submit a bug report through the following website:
28 * http://www.sf.net/projects/lksctp
29 * 26 *
30 * Written or modified by: 27 * Written or modified by:
31 * Vlad Yasevich <vladislav.yasevich@hp.com> 28 * Vlad Yasevich <vladislav.yasevich@hp.com>
32 *
33 * Any bugs reported given to us we will try to fix... any fixes shared will
34 * be incorporated into the next SCTP release.
35 */ 29 */
36 30
37#ifndef __sctp_auth_h__ 31#ifndef __sctp_auth_h__
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index 0cb08e6fb6df..259924d63ba6 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -25,10 +25,7 @@
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email address(es): 27 * email address(es):
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <linux-sctp@vger.kernel.org>
29 *
30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp
32 * 29 *
33 * Written or modified by: 30 * Written or modified by:
34 * Dinakaran Joseph 31 * Dinakaran Joseph
@@ -37,9 +34,6 @@
37 * 34 *
38 * Rewritten to use libcrc32c by: 35 * Rewritten to use libcrc32c by:
39 * Vlad Yasevich <vladislav.yasevich@hp.com> 36 * Vlad Yasevich <vladislav.yasevich@hp.com>
40 *
41 * Any bugs reported given to us we will try to fix... any fixes shared will
42 * be incorporated into the next SCTP release.
43 */ 37 */
44 38
45#ifndef __sctp_checksum_h__ 39#ifndef __sctp_checksum_h__
@@ -85,4 +79,19 @@ static inline __le32 sctp_end_cksum(__u32 crc32)
85 return cpu_to_le32(~crc32); 79 return cpu_to_le32(~crc32);
86} 80}
87 81
82/* Calculate the CRC32C checksum of an SCTP packet. */
83static inline __le32 sctp_compute_cksum(const struct sk_buff *skb,
84 unsigned int offset)
85{
86 const struct sk_buff *iter;
87
88 __u32 crc32 = sctp_start_cksum(skb->data + offset,
89 skb_headlen(skb) - offset);
90 skb_walk_frags(skb, iter)
91 crc32 = sctp_update_cksum((__u8 *) iter->data,
92 skb_headlen(iter), crc32);
93
94 return sctp_end_cksum(crc32);
95}
96
88#endif /* __sctp_checksum_h__ */ 97#endif /* __sctp_checksum_h__ */
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 35247271e557..832f2191489c 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -23,19 +23,17 @@
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * the Free Software Foundation, 59 Temple Place - Suite 330,
24 * Boston, MA 02111-1307, USA. 24 * Boston, MA 02111-1307, USA.
25 * 25 *
26 * Please send any bug reports or fixes you make to one of the 26 * Please send any bug reports or fixes you make to the
27 * following email addresses: 27 * email address(es):
28 * lksctp developers <linux-sctp@vger.kernel.org>
28 * 29 *
29 * La Monte H.P. Yarroll <piggy@acm.org> 30 * Written or modified by:
30 * Karl Knutson <karl@athena.chicago.il.us> 31 * La Monte H.P. Yarroll <piggy@acm.org>
31 * Ardelle Fan <ardelle.fan@intel.com> 32 * Karl Knutson <karl@athena.chicago.il.us>
32 * Sridhar Samudrala <sri@us.ibm.com> 33 * Ardelle Fan <ardelle.fan@intel.com>
33 * 34 * Sridhar Samudrala <sri@us.ibm.com>
34 * Any bugs reported given to us we will try to fix... any fixes shared will
35 * be incorporated into the next SCTP release.
36 */ 35 */
37 36
38
39#ifndef __net_sctp_command_h__ 37#ifndef __net_sctp_command_h__
40#define __net_sctp_command_h__ 38#define __net_sctp_command_h__
41 39
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index ca50e0751e47..2f0a565a0fd5 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -25,10 +25,7 @@
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email address(es): 27 * email address(es):
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <linux-sctp@vger.kernel.org>
29 *
30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp
32 * 29 *
33 * Written or modified by: 30 * Written or modified by:
34 * La Monte H.P. Yarroll <piggy@acm.org> 31 * La Monte H.P. Yarroll <piggy@acm.org>
@@ -39,9 +36,6 @@
39 * Xingang Guo <xingang.guo@intel.com> 36 * Xingang Guo <xingang.guo@intel.com>
40 * Sridhar Samudrala <samudrala@us.ibm.com> 37 * Sridhar Samudrala <samudrala@us.ibm.com>
41 * Daisy Chang <daisyc@us.ibm.com> 38 * Daisy Chang <daisyc@us.ibm.com>
42 *
43 * Any bugs reported given to us we will try to fix... any fixes shared will
44 * be incorporated into the next SCTP release.
45 */ 39 */
46 40
47#ifndef __sctp_constants_h__ 41#ifndef __sctp_constants_h__
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index d8e37ecea691..3794c5ad20fe 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -27,10 +27,7 @@
27 * 27 *
28 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
29 * email address(es): 29 * email address(es):
30 * lksctp developers <lksctp-developers@lists.sourceforge.net> 30 * lksctp developers <linux-sctp@vger.kernel.org>
31 *
32 * Or submit a bug report through the following website:
33 * http://www.sf.net/projects/lksctp
34 * 31 *
35 * Written or modified by: 32 * Written or modified by:
36 * La Monte H.P. Yarroll <piggy@acm.org> 33 * La Monte H.P. Yarroll <piggy@acm.org>
@@ -41,9 +38,6 @@
41 * Ardelle Fan <ardelle.fan@intel.com> 38 * Ardelle Fan <ardelle.fan@intel.com>
42 * Ryan Layer <rmlayer@us.ibm.com> 39 * Ryan Layer <rmlayer@us.ibm.com>
43 * Kevin Gao <kevin.gao@intel.com> 40 * Kevin Gao <kevin.gao@intel.com>
44 *
45 * Any bugs reported given to us we will try to fix... any fixes shared will
46 * be incorporated into the next SCTP release.
47 */ 41 */
48 42
49#ifndef __net_sctp_h__ 43#ifndef __net_sctp_h__
@@ -613,7 +607,7 @@ static inline void sctp_v4_map_v6(union sctp_addr *addr)
613 */ 607 */
614static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) 608static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
615{ 609{
616 if (t->dst && !dst_check(t->dst, 0)) { 610 if (t->dst && !dst_check(t->dst, t->dst_cookie)) {
617 dst_release(t->dst); 611 dst_release(t->dst);
618 t->dst = NULL; 612 t->dst = NULL;
619 } 613 }
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 2a82d1384706..4ef75af340b6 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -27,10 +27,7 @@
27 * 27 *
28 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
29 * email addresses: 29 * email addresses:
30 * lksctp developers <lksctp-developers@lists.sourceforge.net> 30 * lksctp developers <linux-sctp@vger.kernel.org>
31 *
32 * Or submit a bug report through the following website:
33 * http://www.sf.net/projects/lksctp
34 * 31 *
35 * Written or modified by: 32 * Written or modified by:
36 * La Monte H.P. Yarroll <piggy@acm.org> 33 * La Monte H.P. Yarroll <piggy@acm.org>
@@ -42,9 +39,6 @@
42 * Daisy Chang <daisyc@us.ibm.com> 39 * Daisy Chang <daisyc@us.ibm.com>
43 * Ardelle Fan <ardelle.fan@intel.com> 40 * Ardelle Fan <ardelle.fan@intel.com>
44 * Kevin Gao <kevin.gao@intel.com> 41 * Kevin Gao <kevin.gao@intel.com>
45 *
46 * Any bugs reported given to us we will try to fix... any fixes shared will
47 * be incorporated into the next SCTP release.
48 */ 42 */
49 43
50#include <linux/types.h> 44#include <linux/types.h>
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index e745c92a1532..2174d8da0770 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -25,10 +25,7 @@
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email addresses: 27 * email addresses:
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <linux-sctp@vger.kernel.org>
29 *
30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp
32 * 29 *
33 * Written or modified by: 30 * Written or modified by:
34 * Randall Stewart <randall@sctp.chicago.il.us> 31 * Randall Stewart <randall@sctp.chicago.il.us>
@@ -46,9 +43,6 @@
46 * Ryan Layer <rmlayer@us.ibm.com> 43 * Ryan Layer <rmlayer@us.ibm.com>
47 * Anup Pemmaiah <pemmaiah@cc.usu.edu> 44 * Anup Pemmaiah <pemmaiah@cc.usu.edu>
48 * Kevin Gao <kevin.gao@intel.com> 45 * Kevin Gao <kevin.gao@intel.com>
49 *
50 * Any bugs reported given to us we will try to fix... any fixes shared will
51 * be incorporated into the next SCTP release.
52 */ 46 */
53 47
54#ifndef __sctp_structs_h__ 48#ifndef __sctp_structs_h__
@@ -119,29 +113,27 @@ struct sctp_hashbucket {
119 113
120/* The SCTP globals structure. */ 114/* The SCTP globals structure. */
121extern struct sctp_globals { 115extern struct sctp_globals {
122 /* The following variables are implementation specific. */
123
124 /* Default initialization values to be applied to new associations. */
125 __u16 max_instreams;
126 __u16 max_outstreams;
127
128 /* This is a list of groups of functions for each address 116 /* This is a list of groups of functions for each address
129 * family that we support. 117 * family that we support.
130 */ 118 */
131 struct list_head address_families; 119 struct list_head address_families;
132 120
133 /* This is the hash of all endpoints. */ 121 /* This is the hash of all endpoints. */
134 int ep_hashsize;
135 struct sctp_hashbucket *ep_hashtable; 122 struct sctp_hashbucket *ep_hashtable;
136
137 /* This is the hash of all associations. */ 123 /* This is the hash of all associations. */
138 int assoc_hashsize;
139 struct sctp_hashbucket *assoc_hashtable; 124 struct sctp_hashbucket *assoc_hashtable;
140
141 /* This is the sctp port control hash. */ 125 /* This is the sctp port control hash. */
142 int port_hashsize;
143 struct sctp_bind_hashbucket *port_hashtable; 126 struct sctp_bind_hashbucket *port_hashtable;
144 127
128 /* Sizes of above hashtables. */
129 int ep_hashsize;
130 int assoc_hashsize;
131 int port_hashsize;
132
133 /* Default initialization values to be applied to new associations. */
134 __u16 max_instreams;
135 __u16 max_outstreams;
136
145 /* Flag to indicate whether computing and verifying checksum 137 /* Flag to indicate whether computing and verifying checksum
146 * is disabled. */ 138 * is disabled. */
147 bool checksum_disable; 139 bool checksum_disable;
@@ -782,6 +774,7 @@ struct sctp_transport {
782 774
783 /* Has this transport moved the ctsn since we last sacked */ 775 /* Has this transport moved the ctsn since we last sacked */
784 __u32 sack_generation; 776 __u32 sack_generation;
777 u32 dst_cookie;
785 778
786 struct flowi fl; 779 struct flowi fl;
787 780
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h
index 2c5d2b4d5d1e..54bbbe547303 100644
--- a/include/net/sctp/tsnmap.h
+++ b/include/net/sctp/tsnmap.h
@@ -28,19 +28,13 @@
28 * 28 *
29 * Please send any bug reports or fixes you make to the 29 * Please send any bug reports or fixes you make to the
30 * email address(es): 30 * email address(es):
31 * lksctp developers <lksctp-developers@lists.sourceforge.net> 31 * lksctp developers <linux-sctp@vger.kernel.org>
32 *
33 * Or submit a bug report through the following website:
34 * http://www.sf.net/projects/lksctp
35 * 32 *
36 * Written or modified by: 33 * Written or modified by:
37 * Jon Grimm <jgrimm@us.ibm.com> 34 * Jon Grimm <jgrimm@us.ibm.com>
38 * La Monte H.P. Yarroll <piggy@acm.org> 35 * La Monte H.P. Yarroll <piggy@acm.org>
39 * Karl Knutson <karl@athena.chicago.il.us> 36 * Karl Knutson <karl@athena.chicago.il.us>
40 * Sridhar Samudrala <sri@us.ibm.com> 37 * Sridhar Samudrala <sri@us.ibm.com>
41 *
42 * Any bugs reported given to us we will try to fix... any fixes shared will
43 * be incorporated into the next SCTP release.
44 */ 38 */
45#include <net/sctp/constants.h> 39#include <net/sctp/constants.h>
46 40
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index ca4693b4e09e..27b9f5c90153 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -31,19 +31,13 @@
31 * 31 *
32 * Please send any bug reports or fixes you make to the 32 * Please send any bug reports or fixes you make to the
33 * email address(es): 33 * email address(es):
34 * lksctp developers <lksctp-developers@lists.sourceforge.net> 34 * lksctp developers <linux-sctp@vger.kernel.org>
35 *
36 * Or submit a bug report through the following website:
37 * http://www.sf.net/projects/lksctp
38 * 35 *
39 * Written or modified by: 36 * Written or modified by:
40 * Jon Grimm <jgrimm@us.ibm.com> 37 * Jon Grimm <jgrimm@us.ibm.com>
41 * La Monte H.P. Yarroll <piggy@acm.org> 38 * La Monte H.P. Yarroll <piggy@acm.org>
42 * Karl Knutson <karl@athena.chicago.il.us> 39 * Karl Knutson <karl@athena.chicago.il.us>
43 * Sridhar Samudrala <sri@us.ibm.com> 40 * Sridhar Samudrala <sri@us.ibm.com>
44 *
45 * Any bugs reported given to us we will try to fix... any fixes shared will
46 * be incorporated into the next SCTP release.
47 */ 41 */
48 42
49#ifndef __sctp_ulpevent_h__ 43#ifndef __sctp_ulpevent_h__
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index 00e50ba3f24b..b0cf5d54d717 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -30,18 +30,12 @@
30 * 30 *
31 * Please send any bug reports or fixes you make to the 31 * Please send any bug reports or fixes you make to the
32 * email addresses: 32 * email addresses:
33 * lksctp developers <lksctp-developers@lists.sourceforge.net> 33 * lksctp developers <linux-sctp@vger.kernel.org>
34 *
35 * Or submit a bug report through the following website:
36 * http://www.sf.net/projects/lksctp
37 * 34 *
38 * Written or modified by: 35 * Written or modified by:
39 * Jon Grimm <jgrimm@us.ibm.com> 36 * Jon Grimm <jgrimm@us.ibm.com>
40 * La Monte H.P. Yarroll <piggy@acm.org> 37 * La Monte H.P. Yarroll <piggy@acm.org>
41 * Sridhar Samudrala <sri@us.ibm.com> 38 * Sridhar Samudrala <sri@us.ibm.com>
42 *
43 * Any bugs reported given to us we will try to fix... any fixes shared will
44 * be incorporated into the next SCTP release.
45 */ 39 */
46 40
47#ifndef __sctp_ulpqueue_h__ 41#ifndef __sctp_ulpqueue_h__
diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h
index 6ca975bebd37..c2e542b27a5a 100644
--- a/include/net/secure_seq.h
+++ b/include/net/secure_seq.h
@@ -3,7 +3,6 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6extern void net_secret_init(void);
7extern __u32 secure_ip_id(__be32 daddr); 6extern __u32 secure_ip_id(__be32 daddr);
8extern __u32 secure_ipv6_id(const __be32 daddr[4]); 7extern __u32 secure_ipv6_id(const __be32 daddr[4]);
9extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); 8extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
diff --git a/include/net/sock.h b/include/net/sock.h
index 31d5cfbb51ec..808cbc2ec6c1 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -232,6 +232,7 @@ struct cg_proto;
232 * @sk_napi_id: id of the last napi context to receive data for sk 232 * @sk_napi_id: id of the last napi context to receive data for sk
233 * @sk_ll_usec: usecs to busypoll when there is no data 233 * @sk_ll_usec: usecs to busypoll when there is no data
234 * @sk_allocation: allocation mode 234 * @sk_allocation: allocation mode
235 * @sk_pacing_rate: Pacing rate (if supported by transport/packet scheduler)
235 * @sk_sndbuf: size of send buffer in bytes 236 * @sk_sndbuf: size of send buffer in bytes
236 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, 237 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE,
237 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings 238 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings
@@ -361,6 +362,7 @@ struct sock {
361 kmemcheck_bitfield_end(flags); 362 kmemcheck_bitfield_end(flags);
362 int sk_wmem_queued; 363 int sk_wmem_queued;
363 gfp_t sk_allocation; 364 gfp_t sk_allocation;
365 u32 sk_pacing_rate; /* bytes per second */
364 netdev_features_t sk_route_caps; 366 netdev_features_t sk_route_caps;
365 netdev_features_t sk_route_nocaps; 367 netdev_features_t sk_route_nocaps;
366 int sk_gso_type; 368 int sk_gso_type;
@@ -407,6 +409,11 @@ struct sock {
407 void (*sk_destruct)(struct sock *sk); 409 void (*sk_destruct)(struct sock *sk);
408}; 410};
409 411
412#define __sk_user_data(sk) ((*((void __rcu **)&(sk)->sk_user_data)))
413
414#define rcu_dereference_sk_user_data(sk) rcu_dereference(__sk_user_data((sk)))
415#define rcu_assign_sk_user_data(sk, ptr) rcu_assign_pointer(__sk_user_data((sk)), ptr)
416
410/* 417/*
411 * SK_CAN_REUSE and SK_NO_REUSE on a socket mean that the socket is OK 418 * SK_CAN_REUSE and SK_NO_REUSE on a socket mean that the socket is OK
412 * or not whether his port will be reused by someone else. SK_FORCE_REUSE 419 * or not whether his port will be reused by someone else. SK_FORCE_REUSE
@@ -746,11 +753,6 @@ static inline int sk_stream_wspace(const struct sock *sk)
746 753
747extern void sk_stream_write_space(struct sock *sk); 754extern void sk_stream_write_space(struct sock *sk);
748 755
749static inline bool sk_stream_memory_free(const struct sock *sk)
750{
751 return sk->sk_wmem_queued < sk->sk_sndbuf;
752}
753
754/* OOB backlog add */ 756/* OOB backlog add */
755static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) 757static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb)
756{ 758{
@@ -950,6 +952,7 @@ struct proto {
950 unsigned int inuse_idx; 952 unsigned int inuse_idx;
951#endif 953#endif
952 954
955 bool (*stream_memory_free)(const struct sock *sk);
953 /* Memory pressure */ 956 /* Memory pressure */
954 void (*enter_memory_pressure)(struct sock *sk); 957 void (*enter_memory_pressure)(struct sock *sk);
955 atomic_long_t *memory_allocated; /* Current allocated memory. */ 958 atomic_long_t *memory_allocated; /* Current allocated memory. */
@@ -1088,6 +1091,21 @@ static inline struct cg_proto *parent_cg_proto(struct proto *proto,
1088} 1091}
1089#endif 1092#endif
1090 1093
1094static inline bool sk_stream_memory_free(const struct sock *sk)
1095{
1096 if (sk->sk_wmem_queued >= sk->sk_sndbuf)
1097 return false;
1098
1099 return sk->sk_prot->stream_memory_free ?
1100 sk->sk_prot->stream_memory_free(sk) : true;
1101}
1102
1103static inline bool sk_stream_is_writeable(const struct sock *sk)
1104{
1105 return sk_stream_wspace(sk) >= sk_stream_min_wspace(sk) &&
1106 sk_stream_memory_free(sk);
1107}
1108
1091 1109
1092static inline bool sk_has_memory_pressure(const struct sock *sk) 1110static inline bool sk_has_memory_pressure(const struct sock *sk)
1093{ 1111{
@@ -1509,6 +1527,7 @@ extern struct sk_buff *sock_rmalloc(struct sock *sk,
1509 unsigned long size, int force, 1527 unsigned long size, int force,
1510 gfp_t priority); 1528 gfp_t priority);
1511extern void sock_wfree(struct sk_buff *skb); 1529extern void sock_wfree(struct sk_buff *skb);
1530extern void skb_orphan_partial(struct sk_buff *skb);
1512extern void sock_rfree(struct sk_buff *skb); 1531extern void sock_rfree(struct sk_buff *skb);
1513extern void sock_edemux(struct sk_buff *skb); 1532extern void sock_edemux(struct sk_buff *skb);
1514 1533
@@ -1527,7 +1546,8 @@ extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk,
1527 unsigned long header_len, 1546 unsigned long header_len,
1528 unsigned long data_len, 1547 unsigned long data_len,
1529 int noblock, 1548 int noblock,
1530 int *errcode); 1549 int *errcode,
1550 int max_page_order);
1531extern void *sock_kmalloc(struct sock *sk, int size, 1551extern void *sock_kmalloc(struct sock *sk, int size,
1532 gfp_t priority); 1552 gfp_t priority);
1533extern void sock_kfree_s(struct sock *sk, void *mem, int size); 1553extern void sock_kfree_s(struct sock *sk, void *mem, int size);
@@ -1610,16 +1630,14 @@ static inline void sk_filter_release(struct sk_filter *fp)
1610 1630
1611static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) 1631static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp)
1612{ 1632{
1613 unsigned int size = sk_filter_len(fp); 1633 atomic_sub(sk_filter_size(fp->len), &sk->sk_omem_alloc);
1614
1615 atomic_sub(size, &sk->sk_omem_alloc);
1616 sk_filter_release(fp); 1634 sk_filter_release(fp);
1617} 1635}
1618 1636
1619static inline void sk_filter_charge(struct sock *sk, struct sk_filter *fp) 1637static inline void sk_filter_charge(struct sock *sk, struct sk_filter *fp)
1620{ 1638{
1621 atomic_inc(&fp->refcnt); 1639 atomic_inc(&fp->refcnt);
1622 atomic_add(sk_filter_len(fp), &sk->sk_omem_alloc); 1640 atomic_add(sk_filter_size(fp->len), &sk->sk_omem_alloc);
1623} 1641}
1624 1642
1625/* 1643/*
@@ -2249,6 +2267,8 @@ static inline struct sock *skb_steal_sock(struct sk_buff *skb)
2249extern void sock_enable_timestamp(struct sock *sk, int flag); 2267extern void sock_enable_timestamp(struct sock *sk, int flag);
2250extern int sock_get_timestamp(struct sock *, struct timeval __user *); 2268extern int sock_get_timestamp(struct sock *, struct timeval __user *);
2251extern int sock_get_timestampns(struct sock *, struct timespec __user *); 2269extern int sock_get_timestampns(struct sock *, struct timespec __user *);
2270extern int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,
2271 int level, int type);
2252 2272
2253/* 2273/*
2254 * Enable debug/info messages 2274 * Enable debug/info messages
diff --git a/include/net/tcp.h b/include/net/tcp.h
index d1980054ec75..b1aa324c5e65 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -192,10 +192,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
192#define TCPOLEN_TIMESTAMP 10 192#define TCPOLEN_TIMESTAMP 10
193#define TCPOLEN_MD5SIG 18 193#define TCPOLEN_MD5SIG 18
194#define TCPOLEN_EXP_FASTOPEN_BASE 4 194#define TCPOLEN_EXP_FASTOPEN_BASE 4
195#define TCPOLEN_COOKIE_BASE 2 /* Cookie-less header extension */
196#define TCPOLEN_COOKIE_PAIR 3 /* Cookie pair header extension */
197#define TCPOLEN_COOKIE_MIN (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MIN)
198#define TCPOLEN_COOKIE_MAX (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MAX)
199 195
200/* But this is what stacks really send out. */ 196/* But this is what stacks really send out. */
201#define TCPOLEN_TSTAMP_ALIGNED 12 197#define TCPOLEN_TSTAMP_ALIGNED 12
@@ -284,6 +280,8 @@ extern int sysctl_tcp_thin_dupack;
284extern int sysctl_tcp_early_retrans; 280extern int sysctl_tcp_early_retrans;
285extern int sysctl_tcp_limit_output_bytes; 281extern int sysctl_tcp_limit_output_bytes;
286extern int sysctl_tcp_challenge_ack_limit; 282extern int sysctl_tcp_challenge_ack_limit;
283extern unsigned int sysctl_tcp_notsent_lowat;
284extern int sysctl_tcp_min_tso_segs;
287 285
288extern atomic_long_t tcp_memory_allocated; 286extern atomic_long_t tcp_memory_allocated;
289extern struct percpu_counter tcp_sockets_allocated; 287extern struct percpu_counter tcp_sockets_allocated;
@@ -373,8 +371,8 @@ extern void tcp_delack_timer_handler(struct sock *sk);
373extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); 371extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
374extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, 372extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
375 const struct tcphdr *th, unsigned int len); 373 const struct tcphdr *th, unsigned int len);
376extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, 374extern void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
377 const struct tcphdr *th, unsigned int len); 375 const struct tcphdr *th, unsigned int len);
378extern void tcp_rcv_space_adjust(struct sock *sk); 376extern void tcp_rcv_space_adjust(struct sock *sk);
379extern void tcp_cleanup_rbuf(struct sock *sk, int copied); 377extern void tcp_cleanup_rbuf(struct sock *sk, int copied);
380extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); 378extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp);
@@ -479,9 +477,13 @@ void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb);
479 477
480/* From syncookies.c */ 478/* From syncookies.c */
481extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS]; 479extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
480extern int __cookie_v4_check(const struct iphdr *iph, const struct tcphdr *th,
481 u32 cookie);
482extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, 482extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
483 struct ip_options *opt); 483 struct ip_options *opt);
484#ifdef CONFIG_SYN_COOKIES 484#ifdef CONFIG_SYN_COOKIES
485extern u32 __cookie_v4_init_sequence(const struct iphdr *iph,
486 const struct tcphdr *th, u16 *mssp);
485extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, 487extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb,
486 __u16 *mss); 488 __u16 *mss);
487#else 489#else
@@ -498,8 +500,12 @@ extern bool cookie_check_timestamp(struct tcp_options_received *opt,
498 struct net *net, bool *ecn_ok); 500 struct net *net, bool *ecn_ok);
499 501
500/* From net/ipv6/syncookies.c */ 502/* From net/ipv6/syncookies.c */
503extern int __cookie_v6_check(const struct ipv6hdr *iph, const struct tcphdr *th,
504 u32 cookie);
501extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); 505extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
502#ifdef CONFIG_SYN_COOKIES 506#ifdef CONFIG_SYN_COOKIES
507extern u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph,
508 const struct tcphdr *th, u16 *mssp);
503extern __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb, 509extern __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb,
504 __u16 *mss); 510 __u16 *mss);
505#else 511#else
@@ -591,7 +597,6 @@ extern void tcp_initialize_rcv_mss(struct sock *sk);
591extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); 597extern int tcp_mtu_to_mss(struct sock *sk, int pmtu);
592extern int tcp_mss_to_mtu(struct sock *sk, int mss); 598extern int tcp_mss_to_mtu(struct sock *sk, int mss);
593extern void tcp_mtup_init(struct sock *sk); 599extern void tcp_mtup_init(struct sock *sk);
594extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt);
595extern void tcp_init_buffer_space(struct sock *sk); 600extern void tcp_init_buffer_space(struct sock *sk);
596 601
597static inline void tcp_bound_rto(const struct sock *sk) 602static inline void tcp_bound_rto(const struct sock *sk)
@@ -1094,15 +1099,6 @@ static inline void tcp_openreq_init(struct request_sock *req,
1094 ireq->loc_port = tcp_hdr(skb)->dest; 1099 ireq->loc_port = tcp_hdr(skb)->dest;
1095} 1100}
1096 1101
1097/* Compute time elapsed between SYNACK and the ACK completing 3WHS */
1098static inline void tcp_synack_rtt_meas(struct sock *sk,
1099 struct request_sock *req)
1100{
1101 if (tcp_rsk(req)->snt_synack)
1102 tcp_valid_rtt_meas(sk,
1103 tcp_time_stamp - tcp_rsk(req)->snt_synack);
1104}
1105
1106extern void tcp_enter_memory_pressure(struct sock *sk); 1102extern void tcp_enter_memory_pressure(struct sock *sk);
1107 1103
1108static inline int keepalive_intvl_when(const struct tcp_sock *tp) 1104static inline int keepalive_intvl_when(const struct tcp_sock *tp)
@@ -1313,7 +1309,8 @@ void tcp_free_fastopen_req(struct tcp_sock *tp);
1313 1309
1314extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; 1310extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
1315int tcp_fastopen_reset_cipher(void *key, unsigned int len); 1311int tcp_fastopen_reset_cipher(void *key, unsigned int len);
1316void tcp_fastopen_cookie_gen(__be32 addr, struct tcp_fastopen_cookie *foc); 1312extern void tcp_fastopen_cookie_gen(__be32 src, __be32 dst,
1313 struct tcp_fastopen_cookie *foc);
1317 1314
1318#define TCP_FASTOPEN_KEY_LENGTH 16 1315#define TCP_FASTOPEN_KEY_LENGTH 16
1319 1316
@@ -1549,6 +1546,19 @@ extern int tcp_gro_complete(struct sk_buff *skb);
1549extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, 1546extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr,
1550 __be32 daddr); 1547 __be32 daddr);
1551 1548
1549static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp)
1550{
1551 return tp->notsent_lowat ?: sysctl_tcp_notsent_lowat;
1552}
1553
1554static inline bool tcp_stream_memory_free(const struct sock *sk)
1555{
1556 const struct tcp_sock *tp = tcp_sk(sk);
1557 u32 notsent_bytes = tp->write_seq - tp->snd_nxt;
1558
1559 return notsent_bytes < tcp_notsent_lowat(tp);
1560}
1561
1552#ifdef CONFIG_PROC_FS 1562#ifdef CONFIG_PROC_FS
1553extern int tcp4_proc_init(void); 1563extern int tcp4_proc_init(void);
1554extern void tcp4_proc_exit(void); 1564extern void tcp4_proc_exit(void);
diff --git a/include/net/udp.h b/include/net/udp.h
index 74c10ec5e74f..ef2e0b7843a0 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -183,6 +183,7 @@ extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
183 struct msghdr *msg, size_t len); 183 struct msghdr *msg, size_t len);
184extern int udp_push_pending_frames(struct sock *sk); 184extern int udp_push_pending_frames(struct sock *sk);
185extern void udp_flush_pending_frames(struct sock *sk); 185extern void udp_flush_pending_frames(struct sock *sk);
186extern void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst);
186extern int udp_rcv(struct sk_buff *skb); 187extern int udp_rcv(struct sk_buff *skb);
187extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); 188extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
188extern int udp_disconnect(struct sock *sk, int flags); 189extern int udp_disconnect(struct sock *sk, int flags);
diff --git a/include/net/vsock_addr.h b/include/net/vsock_addr.h
new file mode 100644
index 000000000000..9ccd5316eac0
--- /dev/null
+++ b/include/net/vsock_addr.h
@@ -0,0 +1,30 @@
1/*
2 * VMware vSockets Driver
3 *
4 * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation version 2 and no later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef _VSOCK_ADDR_H_
17#define _VSOCK_ADDR_H_
18
19#include <linux/vm_sockets.h>
20
21void vsock_addr_init(struct sockaddr_vm *addr, u32 cid, u32 port);
22int vsock_addr_validate(const struct sockaddr_vm *addr);
23bool vsock_addr_bound(const struct sockaddr_vm *addr);
24void vsock_addr_unbind(struct sockaddr_vm *addr);
25bool vsock_addr_equals_addr(const struct sockaddr_vm *addr,
26 const struct sockaddr_vm *other);
27int vsock_addr_cast(const struct sockaddr *addr, size_t len,
28 struct sockaddr_vm **out_addr);
29
30#endif
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
new file mode 100644
index 000000000000..2d64d3cd4999
--- /dev/null
+++ b/include/net/vxlan.h
@@ -0,0 +1,40 @@
1#ifndef __NET_VXLAN_H
2#define __NET_VXLAN_H 1
3
4#include <linux/skbuff.h>
5#include <linux/netdevice.h>
6#include <linux/udp.h>
7
8#define VNI_HASH_BITS 10
9#define VNI_HASH_SIZE (1<<VNI_HASH_BITS)
10
11struct vxlan_sock;
12typedef void (vxlan_rcv_t)(struct vxlan_sock *vh, struct sk_buff *skb, __be32 key);
13
14/* per UDP socket information */
15struct vxlan_sock {
16 struct hlist_node hlist;
17 vxlan_rcv_t *rcv;
18 void *data;
19 struct work_struct del_work;
20 struct socket *sock;
21 struct rcu_head rcu;
22 struct hlist_head vni_list[VNI_HASH_SIZE];
23 atomic_t refcnt;
24};
25
26struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
27 vxlan_rcv_t *rcv, void *data,
28 bool no_share, bool ipv6);
29
30void vxlan_sock_release(struct vxlan_sock *vs);
31
32int vxlan_xmit_skb(struct vxlan_sock *vs,
33 struct rtable *rt, struct sk_buff *skb,
34 __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df,
35 __be16 src_port, __be16 dst_port, __be32 vni);
36
37__be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb);
38
39void vxlan_get_rx_port(struct net_device *netdev);
40#endif
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index e823786e7c66..e253bf0cc7ef 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1554,7 +1554,7 @@ struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, u32
1554int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); 1554int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info);
1555u32 xfrm_get_acqseq(void); 1555u32 xfrm_get_acqseq(void);
1556extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 1556extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
1557struct xfrm_state *xfrm_find_acq(struct net *net, struct xfrm_mark *mark, 1557struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark,
1558 u8 mode, u32 reqid, u8 proto, 1558 u8 mode, u32 reqid, u8 proto,
1559 const xfrm_address_t *daddr, 1559 const xfrm_address_t *daddr,
1560 const xfrm_address_t *saddr, int create, 1560 const xfrm_address_t *saddr, int create,
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 645c3cedce9c..e393171e2fac 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -116,7 +116,8 @@ enum ib_device_cap_flags {
116 IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21), 116 IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21),
117 IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22), 117 IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22),
118 IB_DEVICE_MEM_WINDOW_TYPE_2A = (1<<23), 118 IB_DEVICE_MEM_WINDOW_TYPE_2A = (1<<23),
119 IB_DEVICE_MEM_WINDOW_TYPE_2B = (1<<24) 119 IB_DEVICE_MEM_WINDOW_TYPE_2B = (1<<24),
120 IB_DEVICE_MANAGED_FLOW_STEERING = (1<<29)
120}; 121};
121 122
122enum ib_atomic_cap { 123enum ib_atomic_cap {
@@ -635,6 +636,12 @@ enum ib_qp_create_flags {
635 IB_QP_CREATE_RESERVED_END = 1 << 31, 636 IB_QP_CREATE_RESERVED_END = 1 << 31,
636}; 637};
637 638
639
640/*
641 * Note: users may not call ib_close_qp or ib_destroy_qp from the event_handler
642 * callback to destroy the passed in QP.
643 */
644
638struct ib_qp_init_attr { 645struct ib_qp_init_attr {
639 void (*event_handler)(struct ib_event *, void *); 646 void (*event_handler)(struct ib_event *, void *);
640 void *qp_context; 647 void *qp_context;
@@ -953,6 +960,7 @@ struct ib_ucontext {
953 struct list_head srq_list; 960 struct list_head srq_list;
954 struct list_head ah_list; 961 struct list_head ah_list;
955 struct list_head xrcd_list; 962 struct list_head xrcd_list;
963 struct list_head rule_list;
956 int closing; 964 int closing;
957}; 965};
958 966
@@ -1033,7 +1041,8 @@ struct ib_qp {
1033 struct ib_srq *srq; 1041 struct ib_srq *srq;
1034 struct ib_xrcd *xrcd; /* XRC TGT QPs only */ 1042 struct ib_xrcd *xrcd; /* XRC TGT QPs only */
1035 struct list_head xrcd_list; 1043 struct list_head xrcd_list;
1036 atomic_t usecnt; /* count times opened, mcast attaches */ 1044 /* count times opened, mcast attaches, flow attaches */
1045 atomic_t usecnt;
1037 struct list_head open_list; 1046 struct list_head open_list;
1038 struct ib_qp *real_qp; 1047 struct ib_qp *real_qp;
1039 struct ib_uobject *uobject; 1048 struct ib_uobject *uobject;
@@ -1068,6 +1077,112 @@ struct ib_fmr {
1068 u32 rkey; 1077 u32 rkey;
1069}; 1078};
1070 1079
1080/* Supported steering options */
1081enum ib_flow_attr_type {
1082 /* steering according to rule specifications */
1083 IB_FLOW_ATTR_NORMAL = 0x0,
1084 /* default unicast and multicast rule -
1085 * receive all Eth traffic which isn't steered to any QP
1086 */
1087 IB_FLOW_ATTR_ALL_DEFAULT = 0x1,
1088 /* default multicast rule -
1089 * receive all Eth multicast traffic which isn't steered to any QP
1090 */
1091 IB_FLOW_ATTR_MC_DEFAULT = 0x2,
1092 /* sniffer rule - receive all port traffic */
1093 IB_FLOW_ATTR_SNIFFER = 0x3
1094};
1095
1096/* Supported steering header types */
1097enum ib_flow_spec_type {
1098 /* L2 headers*/
1099 IB_FLOW_SPEC_ETH = 0x20,
1100 /* L3 header*/
1101 IB_FLOW_SPEC_IPV4 = 0x30,
1102 /* L4 headers*/
1103 IB_FLOW_SPEC_TCP = 0x40,
1104 IB_FLOW_SPEC_UDP = 0x41
1105};
1106
1107#define IB_FLOW_SPEC_SUPPORT_LAYERS 4
1108
1109/* Flow steering rule priority is set according to it's domain.
1110 * Lower domain value means higher priority.
1111 */
1112enum ib_flow_domain {
1113 IB_FLOW_DOMAIN_USER,
1114 IB_FLOW_DOMAIN_ETHTOOL,
1115 IB_FLOW_DOMAIN_RFS,
1116 IB_FLOW_DOMAIN_NIC,
1117 IB_FLOW_DOMAIN_NUM /* Must be last */
1118};
1119
1120struct ib_flow_eth_filter {
1121 u8 dst_mac[6];
1122 u8 src_mac[6];
1123 __be16 ether_type;
1124 __be16 vlan_tag;
1125};
1126
1127struct ib_flow_spec_eth {
1128 enum ib_flow_spec_type type;
1129 u16 size;
1130 struct ib_flow_eth_filter val;
1131 struct ib_flow_eth_filter mask;
1132};
1133
1134struct ib_flow_ipv4_filter {
1135 __be32 src_ip;
1136 __be32 dst_ip;
1137};
1138
1139struct ib_flow_spec_ipv4 {
1140 enum ib_flow_spec_type type;
1141 u16 size;
1142 struct ib_flow_ipv4_filter val;
1143 struct ib_flow_ipv4_filter mask;
1144};
1145
1146struct ib_flow_tcp_udp_filter {
1147 __be16 dst_port;
1148 __be16 src_port;
1149};
1150
1151struct ib_flow_spec_tcp_udp {
1152 enum ib_flow_spec_type type;
1153 u16 size;
1154 struct ib_flow_tcp_udp_filter val;
1155 struct ib_flow_tcp_udp_filter mask;
1156};
1157
1158union ib_flow_spec {
1159 struct {
1160 enum ib_flow_spec_type type;
1161 u16 size;
1162 };
1163 struct ib_flow_spec_eth eth;
1164 struct ib_flow_spec_ipv4 ipv4;
1165 struct ib_flow_spec_tcp_udp tcp_udp;
1166};
1167
1168struct ib_flow_attr {
1169 enum ib_flow_attr_type type;
1170 u16 size;
1171 u16 priority;
1172 u32 flags;
1173 u8 num_of_specs;
1174 u8 port;
1175 /* Following are the optional layers according to user request
1176 * struct ib_flow_spec_xxx
1177 * struct ib_flow_spec_yyy
1178 */
1179};
1180
1181struct ib_flow {
1182 struct ib_qp *qp;
1183 struct ib_uobject *uobject;
1184};
1185
1071struct ib_mad; 1186struct ib_mad;
1072struct ib_grh; 1187struct ib_grh;
1073 1188
@@ -1300,6 +1415,11 @@ struct ib_device {
1300 struct ib_ucontext *ucontext, 1415 struct ib_ucontext *ucontext,
1301 struct ib_udata *udata); 1416 struct ib_udata *udata);
1302 int (*dealloc_xrcd)(struct ib_xrcd *xrcd); 1417 int (*dealloc_xrcd)(struct ib_xrcd *xrcd);
1418 struct ib_flow * (*create_flow)(struct ib_qp *qp,
1419 struct ib_flow_attr
1420 *flow_attr,
1421 int domain);
1422 int (*destroy_flow)(struct ib_flow *flow_id);
1303 1423
1304 struct ib_dma_mapping_ops *dma_ops; 1424 struct ib_dma_mapping_ops *dma_ops;
1305 1425
@@ -2260,4 +2380,8 @@ struct ib_xrcd *ib_alloc_xrcd(struct ib_device *device);
2260 */ 2380 */
2261int ib_dealloc_xrcd(struct ib_xrcd *xrcd); 2381int ib_dealloc_xrcd(struct ib_xrcd *xrcd);
2262 2382
2383struct ib_flow *ib_create_flow(struct ib_qp *qp,
2384 struct ib_flow_attr *flow_attr, int domain);
2385int ib_destroy_flow(struct ib_flow *flow_id);
2386
2263#endif /* IB_VERBS_H */ 2387#endif /* IB_VERBS_H */
diff --git a/include/rdma/iw_cm.h b/include/rdma/iw_cm.h
index 1a046b1595cc..1017e0bdf8ba 100644
--- a/include/rdma/iw_cm.h
+++ b/include/rdma/iw_cm.h
@@ -49,8 +49,8 @@ enum iw_cm_event_type {
49struct iw_cm_event { 49struct iw_cm_event {
50 enum iw_cm_event_type event; 50 enum iw_cm_event_type event;
51 int status; 51 int status;
52 struct sockaddr_in local_addr; 52 struct sockaddr_storage local_addr;
53 struct sockaddr_in remote_addr; 53 struct sockaddr_storage remote_addr;
54 void *private_data; 54 void *private_data;
55 void *provider_data; 55 void *provider_data;
56 u8 private_data_len; 56 u8 private_data_len;
@@ -83,8 +83,8 @@ struct iw_cm_id {
83 iw_cm_handler cm_handler; /* client callback function */ 83 iw_cm_handler cm_handler; /* client callback function */
84 void *context; /* client cb context */ 84 void *context; /* client cb context */
85 struct ib_device *device; 85 struct ib_device *device;
86 struct sockaddr_in local_addr; 86 struct sockaddr_storage local_addr;
87 struct sockaddr_in remote_addr; 87 struct sockaddr_storage remote_addr;
88 void *provider_data; /* provider private data */ 88 void *provider_data; /* provider private data */
89 iw_event_handler event_handler; /* cb for provider 89 iw_event_handler event_handler; /* cb for provider
90 events */ 90 events */
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 9d28ded2a3f4..13d81c5c4ebf 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -494,6 +494,38 @@ enum iscsi_param {
494 ISCSI_PARAM_BOOT_NIC, 494 ISCSI_PARAM_BOOT_NIC,
495 ISCSI_PARAM_BOOT_TARGET, 495 ISCSI_PARAM_BOOT_TARGET,
496 496
497 ISCSI_PARAM_AUTO_SND_TGT_DISABLE,
498 ISCSI_PARAM_DISCOVERY_SESS,
499 ISCSI_PARAM_PORTAL_TYPE,
500 ISCSI_PARAM_CHAP_AUTH_EN,
501 ISCSI_PARAM_DISCOVERY_LOGOUT_EN,
502 ISCSI_PARAM_BIDI_CHAP_EN,
503 ISCSI_PARAM_DISCOVERY_AUTH_OPTIONAL,
504
505 ISCSI_PARAM_DEF_TIME2WAIT,
506 ISCSI_PARAM_DEF_TIME2RETAIN,
507 ISCSI_PARAM_MAX_SEGMENT_SIZE,
508 ISCSI_PARAM_STATSN,
509 ISCSI_PARAM_KEEPALIVE_TMO,
510 ISCSI_PARAM_LOCAL_PORT,
511 ISCSI_PARAM_TSID,
512 ISCSI_PARAM_DEF_TASKMGMT_TMO,
513
514 ISCSI_PARAM_TCP_TIMESTAMP_STAT,
515 ISCSI_PARAM_TCP_WSF_DISABLE,
516 ISCSI_PARAM_TCP_NAGLE_DISABLE,
517 ISCSI_PARAM_TCP_TIMER_SCALE,
518 ISCSI_PARAM_TCP_TIMESTAMP_EN,
519 ISCSI_PARAM_TCP_XMIT_WSF,
520 ISCSI_PARAM_TCP_RECV_WSF,
521 ISCSI_PARAM_IP_FRAGMENT_DISABLE,
522 ISCSI_PARAM_IPV4_TOS,
523 ISCSI_PARAM_IPV6_TC,
524 ISCSI_PARAM_IPV6_FLOW_LABEL,
525 ISCSI_PARAM_IS_FW_ASSIGNED_IPV6,
526
527 ISCSI_PARAM_DISCOVERY_PARENT_IDX,
528 ISCSI_PARAM_DISCOVERY_PARENT_TYPE,
497 /* must always be last */ 529 /* must always be last */
498 ISCSI_PARAM_MAX, 530 ISCSI_PARAM_MAX,
499}; 531};
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 4265a4bb83cd..6ac9e17acdc4 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -62,6 +62,8 @@ enum {
62 TMF_NOT_FOUND, 62 TMF_NOT_FOUND,
63}; 63};
64 64
65#define ISID_SIZE 6
66
65/* Connection suspend "bit" */ 67/* Connection suspend "bit" */
66#define ISCSI_SUSPEND_BIT 1 68#define ISCSI_SUSPEND_BIT 1
67 69
@@ -173,6 +175,7 @@ struct iscsi_conn {
173 175
174 /* iSCSI connection-wide sequencing */ 176 /* iSCSI connection-wide sequencing */
175 uint32_t exp_statsn; 177 uint32_t exp_statsn;
178 uint32_t statsn;
176 179
177 /* control data */ 180 /* control data */
178 int id; /* CID */ 181 int id; /* CID */
@@ -213,6 +216,22 @@ struct iscsi_conn {
213 int persistent_port; 216 int persistent_port;
214 char *persistent_address; 217 char *persistent_address;
215 218
219 unsigned max_segment_size;
220 unsigned tcp_xmit_wsf;
221 unsigned tcp_recv_wsf;
222 uint16_t keepalive_tmo;
223 uint16_t local_port;
224 uint8_t tcp_timestamp_stat;
225 uint8_t tcp_nagle_disable;
226 uint8_t tcp_wsf_disable;
227 uint8_t tcp_timer_scale;
228 uint8_t tcp_timestamp_en;
229 uint8_t fragment_disable;
230 uint8_t ipv4_tos;
231 uint8_t ipv6_traffic_class;
232 uint8_t ipv6_flow_label;
233 uint8_t is_fw_assigned_ipv6;
234
216 /* MIB-statistics */ 235 /* MIB-statistics */
217 uint64_t txdata_octets; 236 uint64_t txdata_octets;
218 uint64_t rxdata_octets; 237 uint64_t rxdata_octets;
@@ -290,6 +309,18 @@ struct iscsi_session {
290 char *boot_root; 309 char *boot_root;
291 char *boot_nic; 310 char *boot_nic;
292 char *boot_target; 311 char *boot_target;
312 char *portal_type;
313 char *discovery_parent_type;
314 uint16_t discovery_parent_idx;
315 uint16_t def_taskmgmt_tmo;
316 uint16_t tsid;
317 uint8_t auto_snd_tgt_disable;
318 uint8_t discovery_sess;
319 uint8_t chap_auth_en;
320 uint8_t discovery_logout_en;
321 uint8_t bidi_chap_en;
322 uint8_t discovery_auth_optional;
323 uint8_t isid[ISID_SIZE];
293 324
294 /* control data */ 325 /* control data */
295 struct iscsi_transport *tt; 326 struct iscsi_transport *tt;
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 4b87d99e7fa1..66d42edfb3fc 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -144,6 +144,7 @@ enum scsi_timeouts {
144#define ACCESS_CONTROL_IN 0x86 144#define ACCESS_CONTROL_IN 0x86
145#define ACCESS_CONTROL_OUT 0x87 145#define ACCESS_CONTROL_OUT 0x87
146#define READ_16 0x88 146#define READ_16 0x88
147#define COMPARE_AND_WRITE 0x89
147#define WRITE_16 0x8a 148#define WRITE_16 0x8a
148#define READ_ATTRIBUTE 0x8c 149#define READ_ATTRIBUTE 0x8c
149#define WRITE_ATTRIBUTE 0x8d 150#define WRITE_ATTRIBUTE 0x8d
@@ -457,6 +458,8 @@ static inline int scsi_is_wlun(unsigned int lun)
457 * other paths */ 458 * other paths */
458#define DID_NEXUS_FAILURE 0x11 /* Permanent nexus failure, retry on other 459#define DID_NEXUS_FAILURE 0x11 /* Permanent nexus failure, retry on other
459 * paths might yield different results */ 460 * paths might yield different results */
461#define DID_ALLOC_FAILURE 0x12 /* Space allocation on the device failed */
462#define DID_MEDIUM_ERROR 0x13 /* Medium error */
460#define DRIVER_OK 0x00 /* Driver status */ 463#define DRIVER_OK 0x00 /* Driver status */
461 464
462/* 465/*
@@ -486,7 +489,6 @@ static inline int scsi_is_wlun(unsigned int lun)
486#define TIMEOUT_ERROR 0x2007 489#define TIMEOUT_ERROR 0x2007
487#define SCSI_RETURN_NOT_HANDLED 0x2008 490#define SCSI_RETURN_NOT_HANDLED 0x2008
488#define FAST_IO_FAIL 0x2009 491#define FAST_IO_FAIL 0x2009
489#define TARGET_ERROR 0x200A
490 492
491/* 493/*
492 * Midlevel queue return values. 494 * Midlevel queue return values.
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index a44954c7cdc2..d65fbec2533d 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -52,8 +52,15 @@ enum scsi_device_state {
52 52
53enum scsi_device_event { 53enum scsi_device_event {
54 SDEV_EVT_MEDIA_CHANGE = 1, /* media has changed */ 54 SDEV_EVT_MEDIA_CHANGE = 1, /* media has changed */
55 SDEV_EVT_INQUIRY_CHANGE_REPORTED, /* 3F 03 UA reported */
56 SDEV_EVT_CAPACITY_CHANGE_REPORTED, /* 2A 09 UA reported */
57 SDEV_EVT_SOFT_THRESHOLD_REACHED_REPORTED, /* 38 07 UA reported */
58 SDEV_EVT_MODE_PARAMETER_CHANGE_REPORTED, /* 2A 01 UA reported */
59 SDEV_EVT_LUN_CHANGE_REPORTED, /* 3F 0E UA reported */
60
61 SDEV_EVT_FIRST = SDEV_EVT_MEDIA_CHANGE,
62 SDEV_EVT_LAST = SDEV_EVT_LUN_CHANGE_REPORTED,
55 63
56 SDEV_EVT_LAST = SDEV_EVT_MEDIA_CHANGE,
57 SDEV_EVT_MAXBITS = SDEV_EVT_LAST + 1 64 SDEV_EVT_MAXBITS = SDEV_EVT_LAST + 1
58}; 65};
59 66
@@ -164,6 +171,7 @@ struct scsi_device {
164 atomic_t disk_events_disable_depth; /* disable depth for disk events */ 171 atomic_t disk_events_disable_depth; /* disable depth for disk events */
165 172
166 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ 173 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
174 DECLARE_BITMAP(pending_events, SDEV_EVT_MAXBITS); /* pending events */
167 struct list_head event_list; /* asserted events */ 175 struct list_head event_list; /* asserted events */
168 struct work_struct event_work; 176 struct work_struct event_work;
169 177
@@ -261,6 +269,9 @@ struct scsi_target {
261 * means no lun present. */ 269 * means no lun present. */
262 unsigned int no_report_luns:1; /* Don't use 270 unsigned int no_report_luns:1; /* Don't use
263 * REPORT LUNS for scanning. */ 271 * REPORT LUNS for scanning. */
272 unsigned int expecting_lun_change:1; /* A device has reported
273 * a 3F/0E UA, other devices on
274 * the same target will also. */
264 /* commands actually active on LLD. protected by host lock. */ 275 /* commands actually active on LLD. protected by host lock. */
265 unsigned int target_busy; 276 unsigned int target_busy;
266 /* 277 /*
diff --git a/include/sound/core.h b/include/sound/core.h
index c586617cfa0d..2a14f1f02d4f 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -27,6 +27,7 @@
27#include <linux/rwsem.h> /* struct rw_semaphore */ 27#include <linux/rwsem.h> /* struct rw_semaphore */
28#include <linux/pm.h> /* pm_message_t */ 28#include <linux/pm.h> /* pm_message_t */
29#include <linux/stringify.h> 29#include <linux/stringify.h>
30#include <linux/printk.h>
30 31
31/* number of supported soundcards */ 32/* number of supported soundcards */
32#ifdef CONFIG_SND_DYNAMIC_MINORS 33#ifdef CONFIG_SND_DYNAMIC_MINORS
@@ -376,6 +377,11 @@ void __snd_printk(unsigned int level, const char *file, int line,
376#define snd_BUG() WARN(1, "BUG?\n") 377#define snd_BUG() WARN(1, "BUG?\n")
377 378
378/** 379/**
380 * Suppress high rates of output when CONFIG_SND_DEBUG is enabled.
381 */
382#define snd_printd_ratelimit() printk_ratelimit()
383
384/**
379 * snd_BUG_ON - debugging check macro 385 * snd_BUG_ON - debugging check macro
380 * @cond: condition to evaluate 386 * @cond: condition to evaluate
381 * 387 *
@@ -398,6 +404,8 @@ static inline void _snd_printd(int level, const char *format, ...) {}
398 unlikely(__ret_warn_on); \ 404 unlikely(__ret_warn_on); \
399}) 405})
400 406
407static inline bool snd_printd_ratelimit(void) { return false; }
408
401#endif /* CONFIG_SND_DEBUG */ 409#endif /* CONFIG_SND_DEBUG */
402 410
403#ifdef CONFIG_SND_DEBUG_VERBOSE 411#ifdef CONFIG_SND_DEBUG_VERBOSE
diff --git a/include/sound/pxa2xx-lib.h b/include/sound/pxa2xx-lib.h
index 2fd3d251d9a5..56e818e4a1cb 100644
--- a/include/sound/pxa2xx-lib.h
+++ b/include/sound/pxa2xx-lib.h
@@ -6,13 +6,6 @@
6 6
7/* PCM */ 7/* PCM */
8 8
9struct pxa2xx_pcm_dma_params {
10 char *name; /* stream identifier */
11 u32 dcmd; /* DMA descriptor dcmd field */
12 volatile u32 *drcmr; /* the DMA request channel to use */
13 u32 dev_addr; /* device physical address for DMA */
14};
15
16extern int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream, 9extern int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
17 struct snd_pcm_hw_params *params); 10 struct snd_pcm_hw_params *params);
18extern int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream); 11extern int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream);
diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
new file mode 100644
index 000000000000..fb0a312bcb81
--- /dev/null
+++ b/include/sound/rcar_snd.h
@@ -0,0 +1,85 @@
1/*
2 * Renesas R-Car SRU/SCU/SSIU/SSI support
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.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 RCAR_SND_H
13#define RCAR_SND_H
14
15#include <linux/sh_clk.h>
16
17#define RSND_GEN1_SRU 0
18#define RSND_GEN1_ADG 1
19#define RSND_GEN1_SSI 2
20
21#define RSND_GEN2_SRU 0
22#define RSND_GEN2_ADG 1
23#define RSND_GEN2_SSIU 2
24#define RSND_GEN2_SSI 3
25
26#define RSND_BASE_MAX 4
27
28/*
29 * flags
30 *
31 * 0xAB000000
32 *
33 * A : clock sharing settings
34 * B : SSI direction
35 */
36#define RSND_SSI_CLK_PIN_SHARE (1 << 31)
37#define RSND_SSI_CLK_FROM_ADG (1 << 30) /* clock parent is master */
38#define RSND_SSI_SYNC (1 << 29) /* SSI34_sync etc */
39#define RSND_SSI_DEPENDENT (1 << 28) /* SSI needs SRU/SCU */
40
41#define RSND_SSI_PLAY (1 << 24)
42
43#define RSND_SSI_SET(_dai_id, _dma_id, _pio_irq, _flags) \
44{ .dai_id = _dai_id, .dma_id = _dma_id, .pio_irq = _pio_irq, .flags = _flags }
45#define RSND_SSI_UNUSED \
46{ .dai_id = -1, .dma_id = -1, .pio_irq = -1, .flags = 0 }
47
48struct rsnd_ssi_platform_info {
49 int dai_id;
50 int dma_id;
51 int pio_irq;
52 u32 flags;
53};
54
55/*
56 * flags
57 */
58#define RSND_SCU_USE_HPBIF (1 << 31) /* it needs RSND_SSI_DEPENDENT */
59
60struct rsnd_scu_platform_info {
61 u32 flags;
62};
63
64/*
65 * flags
66 *
67 * 0x0000000A
68 *
69 * A : generation
70 */
71#define RSND_GEN_MASK (0xF << 0)
72#define RSND_GEN1 (1 << 0) /* fixme */
73#define RSND_GEN2 (2 << 0) /* fixme */
74
75struct rcar_snd_info {
76 u32 flags;
77 struct rsnd_ssi_platform_info *ssi_info;
78 int ssi_info_nr;
79 struct rsnd_scu_platform_info *scu_info;
80 int scu_info_nr;
81 int (*start)(int id);
82 int (*stop)(int id);
83};
84
85#endif
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 3e479f4e15f5..27a72d5d4b00 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -70,121 +70,144 @@ struct device;
70 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 70 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
71 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 71 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
72 72
73#define SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) \
74 .reg = wreg, .mask = 1, .shift = wshift, \
75 .on_val = winvert ? 0 : 1, .off_val = winvert ? 1 : 0
76
73/* path domain */ 77/* path domain */
74#define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ 78#define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\
75 wcontrols, wncontrols) \ 79 wcontrols, wncontrols) \
76{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 80{ .id = snd_soc_dapm_pga, .name = wname, \
77 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 81 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
82 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
78#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ 83#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\
79 wcontrols, wncontrols) \ 84 wcontrols, wncontrols) \
80{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ 85{ .id = snd_soc_dapm_out_drv, .name = wname, \
81 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 86 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
87 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
82#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ 88#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \
83 wcontrols, wncontrols)\ 89 wcontrols, wncontrols)\
84{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 90{ .id = snd_soc_dapm_mixer, .name = wname, \
85 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 91 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
92 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
86#define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ 93#define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \
87 wcontrols, wncontrols)\ 94 wcontrols, wncontrols)\
88{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ 95{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \
89 .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ 96 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
90 .num_kcontrols = wncontrols} 97 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
91#define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ 98#define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \
92{ .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ 99{ .id = snd_soc_dapm_micbias, .name = wname, \
93 .invert = winvert, .kcontrol_news = NULL, .num_kcontrols = 0} 100 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
101 .kcontrol_news = NULL, .num_kcontrols = 0}
94#define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ 102#define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \
95{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ 103{ .id = snd_soc_dapm_switch, .name = wname, \
96 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} 104 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
105 .kcontrol_news = wcontrols, .num_kcontrols = 1}
97#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ 106#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \
98{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ 107{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, \
99 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} 108 .kcontrol_news = wcontrols, .num_kcontrols = 1}
100#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ 109#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \
101{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ 110{ .id = snd_soc_dapm_virt_mux, .name = wname, \
102 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} 111 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
112 .kcontrol_news = wcontrols, .num_kcontrols = 1}
103#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ 113#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \
104{ .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ 114{ .id = snd_soc_dapm_value_mux, .name = wname, \
105 .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ 115 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
106 .num_kcontrols = 1} 116 .kcontrol_news = wcontrols, .num_kcontrols = 1}
107 117
108/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 118/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
109#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ 119#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\
110 wcontrols) \ 120 wcontrols) \
111{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 121{ .id = snd_soc_dapm_pga, .name = wname, \
112 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 122 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
123 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
113#define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ 124#define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \
114 wcontrols)\ 125 wcontrols)\
115{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 126{ .id = snd_soc_dapm_mixer, .name = wname, \
116 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 127 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
128 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
117#define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ 129#define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \
118 wcontrols)\ 130 wcontrols)\
119{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ 131{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \
120 .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ 132 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
121 .num_kcontrols = ARRAY_SIZE(wcontrols)} 133 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
122 134
123/* path domain with event - event handler must return 0 for success */ 135/* path domain with event - event handler must return 0 for success */
124#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ 136#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \
125 wncontrols, wevent, wflags) \ 137 wncontrols, wevent, wflags) \
126{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 138{ .id = snd_soc_dapm_pga, .name = wname, \
127 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ 139 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
140 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
128 .event = wevent, .event_flags = wflags} 141 .event = wevent, .event_flags = wflags}
129#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ 142#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \
130 wncontrols, wevent, wflags) \ 143 wncontrols, wevent, wflags) \
131{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ 144{ .id = snd_soc_dapm_out_drv, .name = wname, \
132 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ 145 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
146 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
133 .event = wevent, .event_flags = wflags} 147 .event = wevent, .event_flags = wflags}
134#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ 148#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \
135 wncontrols, wevent, wflags) \ 149 wncontrols, wevent, wflags) \
136{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 150{ .id = snd_soc_dapm_mixer, .name = wname, \
137 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ 151 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
152 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
138 .event = wevent, .event_flags = wflags} 153 .event = wevent, .event_flags = wflags}
139#define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ 154#define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \
140 wcontrols, wncontrols, wevent, wflags) \ 155 wcontrols, wncontrols, wevent, wflags) \
141{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 156{ .id = snd_soc_dapm_mixer, .name = wname, \
142 .invert = winvert, .kcontrol_news = wcontrols, \ 157 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
158 .kcontrol_news = wcontrols, \
143 .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} 159 .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags}
144#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ 160#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \
145 wevent, wflags) \ 161 wevent, wflags) \
146{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ 162{ .id = snd_soc_dapm_switch, .name = wname, \
147 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ 163 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
164 .kcontrol_news = wcontrols, .num_kcontrols = 1, \
148 .event = wevent, .event_flags = wflags} 165 .event = wevent, .event_flags = wflags}
149#define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ 166#define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
150 wevent, wflags) \ 167 wevent, wflags) \
151{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ 168{ .id = snd_soc_dapm_mux, .name = wname, \
152 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ 169 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
170 .kcontrol_news = wcontrols, .num_kcontrols = 1, \
153 .event = wevent, .event_flags = wflags} 171 .event = wevent, .event_flags = wflags}
154#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ 172#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
155 wevent, wflags) \ 173 wevent, wflags) \
156{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ 174{ .id = snd_soc_dapm_virt_mux, .name = wname, \
157 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ 175 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
176 .kcontrol_news = wcontrols, .num_kcontrols = 1, \
158 .event = wevent, .event_flags = wflags} 177 .event = wevent, .event_flags = wflags}
159 178
160/* additional sequencing control within an event type */ 179/* additional sequencing control within an event type */
161#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \ 180#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \
162 wevent, wflags) \ 181 wevent, wflags) \
163{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 182{ .id = snd_soc_dapm_pga, .name = wname, \
164 .invert = winvert, .event = wevent, .event_flags = wflags, \ 183 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
184 .event = wevent, .event_flags = wflags, \
165 .subseq = wsubseq} 185 .subseq = wsubseq}
166#define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \ 186#define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \
167 wflags) \ 187 wflags) \
168{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ 188{ .id = snd_soc_dapm_supply, .name = wname, \
169 .shift = wshift, .invert = winvert, .event = wevent, \ 189 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
170 .event_flags = wflags, .subseq = wsubseq} 190 .event = wevent, .event_flags = wflags, .subseq = wsubseq}
171 191
172/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 192/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
173#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 193#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
174 wevent, wflags) \ 194 wevent, wflags) \
175{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 195{ .id = snd_soc_dapm_pga, .name = wname, \
176 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 196 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
197 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
177 .event = wevent, .event_flags = wflags} 198 .event = wevent, .event_flags = wflags}
178#define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 199#define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
179 wevent, wflags) \ 200 wevent, wflags) \
180{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 201{ .id = snd_soc_dapm_mixer, .name = wname, \
181 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 202 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
203 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
182 .event = wevent, .event_flags = wflags} 204 .event = wevent, .event_flags = wflags}
183#define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ 205#define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \
184 wcontrols, wevent, wflags) \ 206 wcontrols, wevent, wflags) \
185{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 207{ .id = snd_soc_dapm_mixer, .name = wname, \
186 .invert = winvert, .kcontrol_news = wcontrols, \ 208 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
187 .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags} 209 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
210 .event = wevent, .event_flags = wflags}
188 211
189/* events that are pre and post DAPM */ 212/* events that are pre and post DAPM */
190#define SND_SOC_DAPM_PRE(wname, wevent) \ 213#define SND_SOC_DAPM_PRE(wname, wevent) \
@@ -199,35 +222,36 @@ struct device;
199/* stream domain */ 222/* stream domain */
200#define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ 223#define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \
201{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 224{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
202 .reg = wreg, .shift = wshift, .invert = winvert } 225 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
203#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \ 226#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \
204 wevent, wflags) \ 227 wevent, wflags) \
205{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 228{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
206 .reg = wreg, .shift = wshift, .invert = winvert, \ 229 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
207 .event = wevent, .event_flags = wflags } 230 .event = wevent, .event_flags = wflags }
208#define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ 231#define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \
209{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 232{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
210 .reg = wreg, .shift = wshift, .invert = winvert } 233 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
211#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \ 234#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \
212 wevent, wflags) \ 235 wevent, wflags) \
213{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 236{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
214 .reg = wreg, .shift = wshift, .invert = winvert, \ 237 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
215 .event = wevent, .event_flags = wflags } 238 .event = wevent, .event_flags = wflags }
216#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 239#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \
217{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ 240{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \
218 .shift = wshift, .invert = winvert} 241 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) }
219#define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ 242#define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \
220 wevent, wflags) \ 243 wevent, wflags) \
221{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ 244{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \
222 .shift = wshift, .invert = winvert, \ 245 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
223 .event = wevent, .event_flags = wflags} 246 .event = wevent, .event_flags = wflags}
247
224#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ 248#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \
225{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ 249{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \
226 .shift = wshift, .invert = winvert} 250 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
227#define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ 251#define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \
228 wevent, wflags) \ 252 wevent, wflags) \
229{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ 253{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \
230 .shift = wshift, .invert = winvert, \ 254 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
231 .event = wevent, .event_flags = wflags} 255 .event = wevent, .event_flags = wflags}
232#define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \ 256#define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \
233{ .id = snd_soc_dapm_clock_supply, .name = wname, \ 257{ .id = snd_soc_dapm_clock_supply, .name = wname, \
@@ -241,14 +265,14 @@ struct device;
241 .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ 265 .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \
242 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} 266 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
243#define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ 267#define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \
244{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ 268{ .id = snd_soc_dapm_supply, .name = wname, \
245 .shift = wshift, .invert = winvert, .event = wevent, \ 269 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
246 .event_flags = wflags} 270 .event = wevent, .event_flags = wflags}
247#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \ 271#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \
248{ .id = snd_soc_dapm_regulator_supply, .name = wname, \ 272{ .id = snd_soc_dapm_regulator_supply, .name = wname, \
249 .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ 273 .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \
250 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \ 274 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \
251 .invert = wflags} 275 .on_val = wflags}
252 276
253 277
254/* dapm kcontrol types */ 278/* dapm kcontrol types */
@@ -256,14 +280,26 @@ struct device;
256{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 280{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
257 .info = snd_soc_info_volsw, \ 281 .info = snd_soc_info_volsw, \
258 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 282 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
259 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 283 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
284#define SOC_DAPM_SINGLE_AUTODISABLE(xname, reg, shift, max, invert) \
285{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
286 .info = snd_soc_info_volsw, \
287 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
288 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 1) }
260#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ 289#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
261{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 290{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
262 .info = snd_soc_info_volsw, \ 291 .info = snd_soc_info_volsw, \
263 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ 292 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
264 .tlv.p = (tlv_array), \ 293 .tlv.p = (tlv_array), \
265 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 294 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
266 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 295 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
296#define SOC_DAPM_SINGLE_TLV_AUTODISABLE(xname, reg, shift, max, invert, tlv_array) \
297{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
298 .info = snd_soc_info_volsw, \
299 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
300 .tlv.p = (tlv_array), \
301 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
302 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
267#define SOC_DAPM_ENUM(xname, xenum) \ 303#define SOC_DAPM_ENUM(xname, xenum) \
268{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 304{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
269 .info = snd_soc_info_enum_double, \ 305 .info = snd_soc_info_enum_double, \
@@ -333,6 +369,7 @@ struct snd_soc_dapm_route;
333struct snd_soc_dapm_context; 369struct snd_soc_dapm_context;
334struct regulator; 370struct regulator;
335struct snd_soc_dapm_widget_list; 371struct snd_soc_dapm_widget_list;
372struct snd_soc_dapm_update;
336 373
337int dapm_reg_event(struct snd_soc_dapm_widget *w, 374int dapm_reg_event(struct snd_soc_dapm_widget *w,
338 struct snd_kcontrol *kcontrol, int event); 375 struct snd_kcontrol *kcontrol, int event);
@@ -376,7 +413,7 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
376 struct snd_soc_dapm_widget *sink); 413 struct snd_soc_dapm_widget *sink);
377 414
378/* dapm path setup */ 415/* dapm path setup */
379int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm); 416int snd_soc_dapm_new_widgets(struct snd_soc_card *card);
380void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); 417void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
381int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, 418int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
382 const struct snd_soc_dapm_route *route, int num); 419 const struct snd_soc_dapm_route *route, int num);
@@ -391,10 +428,12 @@ void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
391void snd_soc_dapm_shutdown(struct snd_soc_card *card); 428void snd_soc_dapm_shutdown(struct snd_soc_card *card);
392 429
393/* external DAPM widget events */ 430/* external DAPM widget events */
394int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, 431int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm,
395 struct snd_kcontrol *kcontrol, int connect); 432 struct snd_kcontrol *kcontrol, int connect,
396int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget, 433 struct snd_soc_dapm_update *update);
397 struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e); 434int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm,
435 struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e,
436 struct snd_soc_dapm_update *update);
398 437
399/* dapm sys fs - used by the core */ 438/* dapm sys fs - used by the core */
400int snd_soc_dapm_sys_add(struct device *dev); 439int snd_soc_dapm_sys_add(struct device *dev);
@@ -424,6 +463,8 @@ void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm);
424int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, 463int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
425 struct snd_soc_dapm_widget_list **list); 464 struct snd_soc_dapm_widget_list **list);
426 465
466struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(struct snd_kcontrol *kcontrol);
467
427/* dapm widget types */ 468/* dapm widget types */
428enum snd_soc_dapm_type { 469enum snd_soc_dapm_type {
429 snd_soc_dapm_input = 0, /* input pin */ 470 snd_soc_dapm_input = 0, /* input pin */
@@ -455,6 +496,7 @@ enum snd_soc_dapm_type {
455 snd_soc_dapm_dai_in, /* link to DAI structure */ 496 snd_soc_dapm_dai_in, /* link to DAI structure */
456 snd_soc_dapm_dai_out, 497 snd_soc_dapm_dai_out,
457 snd_soc_dapm_dai_link, /* link between two DAI structures */ 498 snd_soc_dapm_dai_link, /* link between two DAI structures */
499 snd_soc_dapm_kcontrol, /* Auto-disabled kcontrol */
458}; 500};
459 501
460enum snd_soc_dapm_subclass { 502enum snd_soc_dapm_subclass {
@@ -485,7 +527,6 @@ struct snd_soc_dapm_path {
485 /* source (input) and sink (output) widgets */ 527 /* source (input) and sink (output) widgets */
486 struct snd_soc_dapm_widget *source; 528 struct snd_soc_dapm_widget *source;
487 struct snd_soc_dapm_widget *sink; 529 struct snd_soc_dapm_widget *sink;
488 struct snd_kcontrol *kcontrol;
489 530
490 /* status */ 531 /* status */
491 u32 connect:1; /* source and sink widgets are connected */ 532 u32 connect:1; /* source and sink widgets are connected */
@@ -498,6 +539,7 @@ struct snd_soc_dapm_path {
498 539
499 struct list_head list_source; 540 struct list_head list_source;
500 struct list_head list_sink; 541 struct list_head list_sink;
542 struct list_head list_kcontrol;
501 struct list_head list; 543 struct list_head list;
502}; 544};
503 545
@@ -518,12 +560,10 @@ struct snd_soc_dapm_widget {
518 /* dapm control */ 560 /* dapm control */
519 int reg; /* negative reg = no direct dapm */ 561 int reg; /* negative reg = no direct dapm */
520 unsigned char shift; /* bits to shift */ 562 unsigned char shift; /* bits to shift */
521 unsigned int value; /* widget current value */
522 unsigned int mask; /* non-shifted mask */ 563 unsigned int mask; /* non-shifted mask */
523 unsigned int on_val; /* on state value */ 564 unsigned int on_val; /* on state value */
524 unsigned int off_val; /* off state value */ 565 unsigned int off_val; /* off state value */
525 unsigned char power:1; /* block power status */ 566 unsigned char power:1; /* block power status */
526 unsigned char invert:1; /* invert the power bit */
527 unsigned char active:1; /* active stream on DAC, ADC's */ 567 unsigned char active:1; /* active stream on DAC, ADC's */
528 unsigned char connected:1; /* connected codec pin */ 568 unsigned char connected:1; /* connected codec pin */
529 unsigned char new:1; /* cnew complete */ 569 unsigned char new:1; /* cnew complete */
@@ -559,7 +599,6 @@ struct snd_soc_dapm_widget {
559}; 599};
560 600
561struct snd_soc_dapm_update { 601struct snd_soc_dapm_update {
562 struct snd_soc_dapm_widget *widget;
563 struct snd_kcontrol *kcontrol; 602 struct snd_kcontrol *kcontrol;
564 int reg; 603 int reg;
565 int mask; 604 int mask;
@@ -573,8 +612,6 @@ struct snd_soc_dapm_context {
573 struct delayed_work delayed_work; 612 struct delayed_work delayed_work;
574 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ 613 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
575 614
576 struct snd_soc_dapm_update *update;
577
578 void (*seq_notifier)(struct snd_soc_dapm_context *, 615 void (*seq_notifier)(struct snd_soc_dapm_context *,
579 enum snd_soc_dapm_type, int); 616 enum snd_soc_dapm_type, int);
580 617
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h
index 04598f1efd77..047d657c331c 100644
--- a/include/sound/soc-dpcm.h
+++ b/include/sound/soc-dpcm.h
@@ -133,6 +133,6 @@ void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, int stream,
133/* internal use only */ 133/* internal use only */
134int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute); 134int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute);
135int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); 135int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd);
136int soc_dpcm_runtime_update(struct snd_soc_dapm_widget *); 136int soc_dpcm_runtime_update(struct snd_soc_card *);
137 137
138#endif 138#endif
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 6eabee7ec15a..d22cb0a06feb 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -30,13 +30,13 @@
30/* 30/*
31 * Convenience kcontrol builders 31 * Convenience kcontrol builders
32 */ 32 */
33#define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert) \ 33#define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert, xautodisable) \
34 ((unsigned long)&(struct soc_mixer_control) \ 34 ((unsigned long)&(struct soc_mixer_control) \
35 {.reg = xreg, .rreg = xreg, .shift = shift_left, \ 35 {.reg = xreg, .rreg = xreg, .shift = shift_left, \
36 .rshift = shift_right, .max = xmax, .platform_max = xmax, \ 36 .rshift = shift_right, .max = xmax, .platform_max = xmax, \
37 .invert = xinvert}) 37 .invert = xinvert, .autodisable = xautodisable})
38#define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ 38#define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, xautodisable) \
39 SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert) 39 SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert, xautodisable)
40#define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ 40#define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \
41 ((unsigned long)&(struct soc_mixer_control) \ 41 ((unsigned long)&(struct soc_mixer_control) \
42 {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) 42 {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert})
@@ -52,7 +52,7 @@
52{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 52{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
53 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ 53 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
54 .put = snd_soc_put_volsw, \ 54 .put = snd_soc_put_volsw, \
55 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 55 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
56#define SOC_SINGLE_RANGE(xname, xreg, xshift, xmin, xmax, xinvert) \ 56#define SOC_SINGLE_RANGE(xname, xreg, xshift, xmin, xmax, xinvert) \
57{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 57{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
58 .info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \ 58 .info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \
@@ -68,7 +68,7 @@
68 .tlv.p = (tlv_array), \ 68 .tlv.p = (tlv_array), \
69 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ 69 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
70 .put = snd_soc_put_volsw, \ 70 .put = snd_soc_put_volsw, \
71 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 71 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
72#define SOC_SINGLE_SX_TLV(xname, xreg, xshift, xmin, xmax, tlv_array) \ 72#define SOC_SINGLE_SX_TLV(xname, xreg, xshift, xmin, xmax, tlv_array) \
73{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 73{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
74 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 74 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
@@ -97,7 +97,7 @@
97 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ 97 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
98 .put = snd_soc_put_volsw, \ 98 .put = snd_soc_put_volsw, \
99 .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ 99 .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
100 max, invert) } 100 max, invert, 0) }
101#define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ 101#define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \
102{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 102{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
103 .info = snd_soc_info_volsw, \ 103 .info = snd_soc_info_volsw, \
@@ -119,7 +119,7 @@
119 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ 119 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
120 .put = snd_soc_put_volsw, \ 120 .put = snd_soc_put_volsw, \
121 .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ 121 .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
122 max, invert) } 122 max, invert, 0) }
123#define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ 123#define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \
124{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 124{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
125 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ 125 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
@@ -190,14 +190,14 @@
190{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 190{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
191 .info = snd_soc_info_volsw, \ 191 .info = snd_soc_info_volsw, \
192 .get = xhandler_get, .put = xhandler_put, \ 192 .get = xhandler_get, .put = xhandler_put, \
193 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } 193 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, 0) }
194#define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\ 194#define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\
195 xhandler_get, xhandler_put) \ 195 xhandler_get, xhandler_put) \
196{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 196{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
197 .info = snd_soc_info_volsw, \ 197 .info = snd_soc_info_volsw, \
198 .get = xhandler_get, .put = xhandler_put, \ 198 .get = xhandler_get, .put = xhandler_put, \
199 .private_value = \ 199 .private_value = \
200 SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert) } 200 SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert, 0) }
201#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ 201#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\
202 xhandler_get, xhandler_put, tlv_array) \ 202 xhandler_get, xhandler_put, tlv_array) \
203{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 203{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
@@ -206,7 +206,7 @@
206 .tlv.p = (tlv_array), \ 206 .tlv.p = (tlv_array), \
207 .info = snd_soc_info_volsw, \ 207 .info = snd_soc_info_volsw, \
208 .get = xhandler_get, .put = xhandler_put, \ 208 .get = xhandler_get, .put = xhandler_put, \
209 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } 209 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, 0) }
210#define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ 210#define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\
211 xhandler_get, xhandler_put, tlv_array) \ 211 xhandler_get, xhandler_put, tlv_array) \
212{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 212{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
@@ -216,7 +216,7 @@
216 .info = snd_soc_info_volsw, \ 216 .info = snd_soc_info_volsw, \
217 .get = xhandler_get, .put = xhandler_put, \ 217 .get = xhandler_get, .put = xhandler_put, \
218 .private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \ 218 .private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \
219 xmax, xinvert) } 219 xmax, xinvert, 0) }
220#define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ 220#define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\
221 xhandler_get, xhandler_put, tlv_array) \ 221 xhandler_get, xhandler_put, tlv_array) \
222{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 222{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
@@ -234,7 +234,7 @@
234 .private_value = xdata } 234 .private_value = xdata }
235#define SOC_ENUM_EXT(xname, xenum, xhandler_get, xhandler_put) \ 235#define SOC_ENUM_EXT(xname, xenum, xhandler_get, xhandler_put) \
236{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 236{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
237 .info = snd_soc_info_enum_ext, \ 237 .info = snd_soc_info_enum_double, \
238 .get = xhandler_get, .put = xhandler_put, \ 238 .get = xhandler_get, .put = xhandler_put, \
239 .private_value = (unsigned long)&xenum } 239 .private_value = (unsigned long)&xenum }
240 240
@@ -468,6 +468,8 @@ int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
468void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); 468void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
469 469
470int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops); 470int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops);
471int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops,
472 struct platform_device *pdev);
471 473
472/* 474/*
473 *Controls 475 *Controls
@@ -475,6 +477,8 @@ int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops);
475struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, 477struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
476 void *data, const char *long_name, 478 void *data, const char *long_name,
477 const char *prefix); 479 const char *prefix);
480struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
481 const char *name);
478int snd_soc_add_codec_controls(struct snd_soc_codec *codec, 482int snd_soc_add_codec_controls(struct snd_soc_codec *codec,
479 const struct snd_kcontrol_new *controls, int num_controls); 483 const struct snd_kcontrol_new *controls, int num_controls);
480int snd_soc_add_platform_controls(struct snd_soc_platform *platform, 484int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
@@ -485,8 +489,6 @@ int snd_soc_add_dai_controls(struct snd_soc_dai *dai,
485 const struct snd_kcontrol_new *controls, int num_controls); 489 const struct snd_kcontrol_new *controls, int num_controls);
486int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, 490int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
487 struct snd_ctl_elem_info *uinfo); 491 struct snd_ctl_elem_info *uinfo);
488int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
489 struct snd_ctl_elem_info *uinfo);
490int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol, 492int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol,
491 struct snd_ctl_elem_value *ucontrol); 493 struct snd_ctl_elem_value *ucontrol);
492int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol, 494int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
@@ -497,8 +499,6 @@ int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol,
497 struct snd_ctl_elem_value *ucontrol); 499 struct snd_ctl_elem_value *ucontrol);
498int snd_soc_info_volsw(struct snd_kcontrol *kcontrol, 500int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
499 struct snd_ctl_elem_info *uinfo); 501 struct snd_ctl_elem_info *uinfo);
500int snd_soc_info_volsw_ext(struct snd_kcontrol *kcontrol,
501 struct snd_ctl_elem_info *uinfo);
502#define snd_soc_info_bool_ext snd_ctl_boolean_mono_info 502#define snd_soc_info_bool_ext snd_ctl_boolean_mono_info
503int snd_soc_get_volsw(struct snd_kcontrol *kcontrol, 503int snd_soc_get_volsw(struct snd_kcontrol *kcontrol,
504 struct snd_ctl_elem_value *ucontrol); 504 struct snd_ctl_elem_value *ucontrol);
@@ -697,7 +697,6 @@ struct snd_soc_codec {
697 unsigned int probed:1; /* Codec has been probed */ 697 unsigned int probed:1; /* Codec has been probed */
698 unsigned int ac97_registered:1; /* Codec has been AC97 registered */ 698 unsigned int ac97_registered:1; /* Codec has been AC97 registered */
699 unsigned int ac97_created:1; /* Codec has been created by SoC */ 699 unsigned int ac97_created:1; /* Codec has been created by SoC */
700 unsigned int sysfs_registered:1; /* codec has been sysfs registered */
701 unsigned int cache_init:1; /* codec cache has been initialized */ 700 unsigned int cache_init:1; /* codec cache has been initialized */
702 unsigned int using_regmap:1; /* using regmap access */ 701 unsigned int using_regmap:1; /* using regmap access */
703 u32 cache_only; /* Suppress writes to hardware */ 702 u32 cache_only; /* Suppress writes to hardware */
@@ -705,7 +704,6 @@ struct snd_soc_codec {
705 704
706 /* codec IO */ 705 /* codec IO */
707 void *control_data; /* codec control (i2c/3wire) data */ 706 void *control_data; /* codec control (i2c/3wire) data */
708 enum snd_soc_control_type control_type;
709 hw_write_t hw_write; 707 hw_write_t hw_write;
710 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); 708 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int);
711 unsigned int (*read)(struct snd_soc_codec *, unsigned int); 709 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
@@ -724,7 +722,6 @@ struct snd_soc_codec {
724#ifdef CONFIG_DEBUG_FS 722#ifdef CONFIG_DEBUG_FS
725 struct dentry *debugfs_codec_root; 723 struct dentry *debugfs_codec_root;
726 struct dentry *debugfs_reg; 724 struct dentry *debugfs_reg;
727 struct dentry *debugfs_dapm;
728#endif 725#endif
729}; 726};
730 727
@@ -849,7 +846,6 @@ struct snd_soc_platform {
849 846
850#ifdef CONFIG_DEBUG_FS 847#ifdef CONFIG_DEBUG_FS
851 struct dentry *debugfs_platform_root; 848 struct dentry *debugfs_platform_root;
852 struct dentry *debugfs_dapm;
853#endif 849#endif
854}; 850};
855 851
@@ -934,6 +930,10 @@ struct snd_soc_dai_link {
934 /* machine stream operations */ 930 /* machine stream operations */
935 const struct snd_soc_ops *ops; 931 const struct snd_soc_ops *ops;
936 const struct snd_soc_compr_ops *compr_ops; 932 const struct snd_soc_compr_ops *compr_ops;
933
934 /* For unidirectional dai links */
935 bool playback_only;
936 bool capture_only;
937}; 937};
938 938
939struct snd_soc_codec_conf { 939struct snd_soc_codec_conf {
@@ -1042,6 +1042,7 @@ struct snd_soc_card {
1042 /* Generic DAPM context for the card */ 1042 /* Generic DAPM context for the card */
1043 struct snd_soc_dapm_context dapm; 1043 struct snd_soc_dapm_context dapm;
1044 struct snd_soc_dapm_stats dapm_stats; 1044 struct snd_soc_dapm_stats dapm_stats;
1045 struct snd_soc_dapm_update *update;
1045 1046
1046#ifdef CONFIG_DEBUG_FS 1047#ifdef CONFIG_DEBUG_FS
1047 struct dentry *debugfs_card_root; 1048 struct dentry *debugfs_card_root;
@@ -1087,7 +1088,9 @@ struct snd_soc_pcm_runtime {
1087/* mixer control */ 1088/* mixer control */
1088struct soc_mixer_control { 1089struct soc_mixer_control {
1089 int min, max, platform_max; 1090 int min, max, platform_max;
1090 unsigned int reg, rreg, shift, rshift, invert; 1091 unsigned int reg, rreg, shift, rshift;
1092 unsigned int invert:1;
1093 unsigned int autodisable:1;
1091}; 1094};
1092 1095
1093struct soc_bytes { 1096struct soc_bytes {
diff --git a/include/target/iscsi/iscsi_transport.h b/include/target/iscsi/iscsi_transport.h
index e5d09d242ba3..a12589c4ee92 100644
--- a/include/target/iscsi/iscsi_transport.h
+++ b/include/target/iscsi/iscsi_transport.h
@@ -6,13 +6,13 @@ struct iscsit_transport {
6#define ISCSIT_TRANSPORT_NAME 16 6#define ISCSIT_TRANSPORT_NAME 16
7 char name[ISCSIT_TRANSPORT_NAME]; 7 char name[ISCSIT_TRANSPORT_NAME];
8 int transport_type; 8 int transport_type;
9 int priv_size;
9 struct module *owner; 10 struct module *owner;
10 struct list_head t_node; 11 struct list_head t_node;
11 int (*iscsit_setup_np)(struct iscsi_np *, struct __kernel_sockaddr_storage *); 12 int (*iscsit_setup_np)(struct iscsi_np *, struct __kernel_sockaddr_storage *);
12 int (*iscsit_accept_np)(struct iscsi_np *, struct iscsi_conn *); 13 int (*iscsit_accept_np)(struct iscsi_np *, struct iscsi_conn *);
13 void (*iscsit_free_np)(struct iscsi_np *); 14 void (*iscsit_free_np)(struct iscsi_np *);
14 void (*iscsit_free_conn)(struct iscsi_conn *); 15 void (*iscsit_free_conn)(struct iscsi_conn *);
15 struct iscsi_cmd *(*iscsit_alloc_cmd)(struct iscsi_conn *, gfp_t);
16 int (*iscsit_get_login_rx)(struct iscsi_conn *, struct iscsi_login *); 16 int (*iscsit_get_login_rx)(struct iscsi_conn *, struct iscsi_login *);
17 int (*iscsit_put_login_tx)(struct iscsi_conn *, struct iscsi_login *, u32); 17 int (*iscsit_put_login_tx)(struct iscsi_conn *, struct iscsi_login *, u32);
18 int (*iscsit_immediate_queue)(struct iscsi_conn *, struct iscsi_cmd *, int); 18 int (*iscsit_immediate_queue)(struct iscsi_conn *, struct iscsi_cmd *, int);
@@ -22,6 +22,11 @@ struct iscsit_transport {
22 int (*iscsit_queue_status)(struct iscsi_conn *, struct iscsi_cmd *); 22 int (*iscsit_queue_status)(struct iscsi_conn *, struct iscsi_cmd *);
23}; 23};
24 24
25static inline void *iscsit_priv_cmd(struct iscsi_cmd *cmd)
26{
27 return (void *)(cmd + 1);
28}
29
25/* 30/*
26 * From iscsi_target_transport.c 31 * From iscsi_target_transport.c
27 */ 32 */
@@ -92,3 +97,4 @@ extern int iscsit_tmr_post_handler(struct iscsi_cmd *, struct iscsi_conn *);
92extern struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *, gfp_t); 97extern struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *, gfp_t);
93extern int iscsit_sequence_cmd(struct iscsi_conn *, struct iscsi_cmd *, 98extern int iscsit_sequence_cmd(struct iscsi_conn *, struct iscsi_cmd *,
94 unsigned char *, __be32); 99 unsigned char *, __be32);
100extern void iscsit_release_cmd(struct iscsi_cmd *);
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index ffa2696d64dc..5ebe21cd5d1c 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -39,7 +39,8 @@ struct se_subsystem_api {
39}; 39};
40 40
41struct sbc_ops { 41struct sbc_ops {
42 sense_reason_t (*execute_rw)(struct se_cmd *cmd); 42 sense_reason_t (*execute_rw)(struct se_cmd *cmd, struct scatterlist *,
43 u32, enum dma_data_direction);
43 sense_reason_t (*execute_sync_cache)(struct se_cmd *cmd); 44 sense_reason_t (*execute_sync_cache)(struct se_cmd *cmd);
44 sense_reason_t (*execute_write_same)(struct se_cmd *cmd); 45 sense_reason_t (*execute_write_same)(struct se_cmd *cmd);
45 sense_reason_t (*execute_write_same_unmap)(struct se_cmd *cmd); 46 sense_reason_t (*execute_write_same_unmap)(struct se_cmd *cmd);
@@ -73,6 +74,10 @@ int transport_set_vpd_ident(struct t10_vpd *, unsigned char *);
73/* core helpers also used by command snooping in pscsi */ 74/* core helpers also used by command snooping in pscsi */
74void *transport_kmap_data_sg(struct se_cmd *); 75void *transport_kmap_data_sg(struct se_cmd *);
75void transport_kunmap_data_sg(struct se_cmd *); 76void transport_kunmap_data_sg(struct se_cmd *);
77/* core helpers also used by xcopy during internal command setup */
78int target_alloc_sgl(struct scatterlist **, unsigned int *, u32, bool);
79sense_reason_t transport_generic_map_mem_to_cmd(struct se_cmd *,
80 struct scatterlist *, u32, struct scatterlist *, u32);
76 81
77void array_free(void *array, int n); 82void array_free(void *array, int n);
78 83
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index e34fc904f2e1..5bdb8b7d2a69 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -5,11 +5,12 @@
5#include <linux/configfs.h> 5#include <linux/configfs.h>
6#include <linux/dma-mapping.h> 6#include <linux/dma-mapping.h>
7#include <linux/blkdev.h> 7#include <linux/blkdev.h>
8#include <linux/percpu_ida.h>
8#include <scsi/scsi_cmnd.h> 9#include <scsi/scsi_cmnd.h>
9#include <net/sock.h> 10#include <net/sock.h>
10#include <net/tcp.h> 11#include <net/tcp.h>
11 12
12#define TARGET_CORE_MOD_VERSION "v4.1.0-rc2-ml" 13#define TARGET_CORE_MOD_VERSION "v4.1.0"
13#define TARGET_CORE_VERSION TARGET_CORE_MOD_VERSION 14#define TARGET_CORE_VERSION TARGET_CORE_MOD_VERSION
14 15
15/* Maximum Number of LUNs per Target Portal Group */ 16/* Maximum Number of LUNs per Target Portal Group */
@@ -96,6 +97,10 @@
96 * block/blk-lib.c:blkdev_issue_discard() 97 * block/blk-lib.c:blkdev_issue_discard()
97 */ 98 */
98#define DA_EMULATE_TPWS 0 99#define DA_EMULATE_TPWS 0
100/* Emulation for CompareAndWrite (AtomicTestandSet) by default */
101#define DA_EMULATE_CAW 1
102/* Emulation for 3rd Party Copy (ExtendedCopy) by default */
103#define DA_EMULATE_3PC 1
99/* No Emulation for PSCSI by default */ 104/* No Emulation for PSCSI by default */
100#define DA_EMULATE_ALUA 0 105#define DA_EMULATE_ALUA 0
101/* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */ 106/* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */
@@ -158,6 +163,9 @@ enum se_cmd_flags_table {
158 SCF_ALUA_NON_OPTIMIZED = 0x00008000, 163 SCF_ALUA_NON_OPTIMIZED = 0x00008000,
159 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00020000, 164 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00020000,
160 SCF_ACK_KREF = 0x00040000, 165 SCF_ACK_KREF = 0x00040000,
166 SCF_COMPARE_AND_WRITE = 0x00080000,
167 SCF_COMPARE_AND_WRITE_POST = 0x00100000,
168 SCF_CMD_XCOPY_PASSTHROUGH = 0x00200000,
161}; 169};
162 170
163/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ 171/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */
@@ -196,6 +204,7 @@ enum tcm_sense_reason_table {
196 TCM_ADDRESS_OUT_OF_RANGE = R(0x11), 204 TCM_ADDRESS_OUT_OF_RANGE = R(0x11),
197 TCM_OUT_OF_RESOURCES = R(0x12), 205 TCM_OUT_OF_RESOURCES = R(0x12),
198 TCM_PARAMETER_LIST_LENGTH_ERROR = R(0x13), 206 TCM_PARAMETER_LIST_LENGTH_ERROR = R(0x13),
207 TCM_MISCOMPARE_VERIFY = R(0x14),
199#undef R 208#undef R
200}; 209};
201 210
@@ -415,6 +424,8 @@ struct se_cmd {
415 enum dma_data_direction data_direction; 424 enum dma_data_direction data_direction;
416 /* For SAM Task Attribute */ 425 /* For SAM Task Attribute */
417 int sam_task_attr; 426 int sam_task_attr;
427 /* Used for se_sess->sess_tag_pool */
428 unsigned int map_tag;
418 /* Transport protocol dependent state, see transport_state_table */ 429 /* Transport protocol dependent state, see transport_state_table */
419 enum transport_state_table t_state; 430 enum transport_state_table t_state;
420 unsigned cmd_wait_set:1; 431 unsigned cmd_wait_set:1;
@@ -444,11 +455,14 @@ struct se_cmd {
444 struct kref cmd_kref; 455 struct kref cmd_kref;
445 struct target_core_fabric_ops *se_tfo; 456 struct target_core_fabric_ops *se_tfo;
446 sense_reason_t (*execute_cmd)(struct se_cmd *); 457 sense_reason_t (*execute_cmd)(struct se_cmd *);
447 void (*transport_complete_callback)(struct se_cmd *); 458 sense_reason_t (*execute_rw)(struct se_cmd *, struct scatterlist *,
459 u32, enum dma_data_direction);
460 sense_reason_t (*transport_complete_callback)(struct se_cmd *);
448 461
449 unsigned char *t_task_cdb; 462 unsigned char *t_task_cdb;
450 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; 463 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE];
451 unsigned long long t_task_lba; 464 unsigned long long t_task_lba;
465 unsigned int t_task_nolb;
452 unsigned int transport_state; 466 unsigned int transport_state;
453#define CMD_T_ABORTED (1 << 0) 467#define CMD_T_ABORTED (1 << 0)
454#define CMD_T_ACTIVE (1 << 1) 468#define CMD_T_ACTIVE (1 << 1)
@@ -469,7 +483,9 @@ struct se_cmd {
469 struct work_struct work; 483 struct work_struct work;
470 484
471 struct scatterlist *t_data_sg; 485 struct scatterlist *t_data_sg;
486 struct scatterlist *t_data_sg_orig;
472 unsigned int t_data_nents; 487 unsigned int t_data_nents;
488 unsigned int t_data_nents_orig;
473 void *t_data_vmap; 489 void *t_data_vmap;
474 struct scatterlist *t_bidi_data_sg; 490 struct scatterlist *t_bidi_data_sg;
475 unsigned int t_bidi_data_nents; 491 unsigned int t_bidi_data_nents;
@@ -536,6 +552,8 @@ struct se_session {
536 struct list_head sess_wait_list; 552 struct list_head sess_wait_list;
537 spinlock_t sess_cmd_lock; 553 spinlock_t sess_cmd_lock;
538 struct kref sess_kref; 554 struct kref sess_kref;
555 void *sess_cmd_map;
556 struct percpu_ida sess_tag_pool;
539}; 557};
540 558
541struct se_device; 559struct se_device;
@@ -589,6 +607,8 @@ struct se_dev_attrib {
589 int emulate_tas; 607 int emulate_tas;
590 int emulate_tpu; 608 int emulate_tpu;
591 int emulate_tpws; 609 int emulate_tpws;
610 int emulate_caw;
611 int emulate_3pc;
592 int enforce_pr_isids; 612 int enforce_pr_isids;
593 int is_nonrot; 613 int is_nonrot;
594 int emulate_rest_reord; 614 int emulate_rest_reord;
@@ -656,6 +676,7 @@ struct se_device {
656 spinlock_t se_port_lock; 676 spinlock_t se_port_lock;
657 spinlock_t se_tmr_lock; 677 spinlock_t se_tmr_lock;
658 spinlock_t qf_cmd_lock; 678 spinlock_t qf_cmd_lock;
679 struct semaphore caw_sem;
659 /* Used for legacy SPC-2 reservationsa */ 680 /* Used for legacy SPC-2 reservationsa */
660 struct se_node_acl *dev_reserved_node_acl; 681 struct se_node_acl *dev_reserved_node_acl;
661 /* Used for ALUA Logical Unit Group membership */ 682 /* Used for ALUA Logical Unit Group membership */
@@ -669,6 +690,7 @@ struct se_device {
669 struct list_head delayed_cmd_list; 690 struct list_head delayed_cmd_list;
670 struct list_head state_list; 691 struct list_head state_list;
671 struct list_head qf_cmd_list; 692 struct list_head qf_cmd_list;
693 struct list_head g_dev_node;
672 /* Pointer to associated SE HBA */ 694 /* Pointer to associated SE HBA */
673 struct se_hba *se_hba; 695 struct se_hba *se_hba;
674 /* T10 Inquiry and VPD WWN Information */ 696 /* T10 Inquiry and VPD WWN Information */
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index 7a16178424f9..882b650e32be 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -84,6 +84,9 @@ struct target_core_fabric_ops {
84}; 84};
85 85
86struct se_session *transport_init_session(void); 86struct se_session *transport_init_session(void);
87int transport_alloc_session_tags(struct se_session *, unsigned int,
88 unsigned int);
89struct se_session *transport_init_session_tags(unsigned int, unsigned int);
87void __transport_register_session(struct se_portal_group *, 90void __transport_register_session(struct se_portal_group *,
88 struct se_node_acl *, struct se_session *, void *); 91 struct se_node_acl *, struct se_session *, void *);
89void transport_register_session(struct se_portal_group *, 92void transport_register_session(struct se_portal_group *,
@@ -131,6 +134,7 @@ int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
131void core_tmr_release_req(struct se_tmr_req *); 134void core_tmr_release_req(struct se_tmr_req *);
132int transport_generic_handle_tmr(struct se_cmd *); 135int transport_generic_handle_tmr(struct se_cmd *);
133void transport_generic_request_failure(struct se_cmd *, sense_reason_t); 136void transport_generic_request_failure(struct se_cmd *, sense_reason_t);
137void __target_execute_cmd(struct se_cmd *);
134int transport_lookup_tmr_lun(struct se_cmd *, u32); 138int transport_lookup_tmr_lun(struct se_cmd *, u32);
135 139
136struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *, 140struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *,
@@ -175,4 +179,30 @@ u32 iscsi_get_pr_transport_id_len(struct se_portal_group *, struct se_node_acl *
175char *iscsi_parse_pr_out_transport_id(struct se_portal_group *, const char *, 179char *iscsi_parse_pr_out_transport_id(struct se_portal_group *, const char *,
176 u32 *, char **); 180 u32 *, char **);
177 181
182/*
183 * The LIO target core uses DMA_TO_DEVICE to mean that data is going
184 * to the target (eg handling a WRITE) and DMA_FROM_DEVICE to mean
185 * that data is coming from the target (eg handling a READ). However,
186 * this is just the opposite of what we have to tell the DMA mapping
187 * layer -- eg when handling a READ, the HBA will have to DMA the data
188 * out of memory so it can send it to the initiator, which means we
189 * need to use DMA_TO_DEVICE when we map the data.
190 */
191static inline enum dma_data_direction
192target_reverse_dma_direction(struct se_cmd *se_cmd)
193{
194 if (se_cmd->se_cmd_flags & SCF_BIDI)
195 return DMA_BIDIRECTIONAL;
196
197 switch (se_cmd->data_direction) {
198 case DMA_TO_DEVICE:
199 return DMA_FROM_DEVICE;
200 case DMA_FROM_DEVICE:
201 return DMA_TO_DEVICE;
202 case DMA_NONE:
203 default:
204 return DMA_NONE;
205 }
206}
207
178#endif /* TARGET_CORE_FABRICH */ 208#endif /* TARGET_CORE_FABRICH */
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 60ae7c3db912..4c2301d2ef1a 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -618,6 +618,7 @@ TRACE_EVENT(block_rq_remap,
618 __field( unsigned int, nr_sector ) 618 __field( unsigned int, nr_sector )
619 __field( dev_t, old_dev ) 619 __field( dev_t, old_dev )
620 __field( sector_t, old_sector ) 620 __field( sector_t, old_sector )
621 __field( unsigned int, nr_bios )
621 __array( char, rwbs, RWBS_LEN) 622 __array( char, rwbs, RWBS_LEN)
622 ), 623 ),
623 624
@@ -627,15 +628,16 @@ TRACE_EVENT(block_rq_remap,
627 __entry->nr_sector = blk_rq_sectors(rq); 628 __entry->nr_sector = blk_rq_sectors(rq);
628 __entry->old_dev = dev; 629 __entry->old_dev = dev;
629 __entry->old_sector = from; 630 __entry->old_sector = from;
631 __entry->nr_bios = blk_rq_count_bios(rq);
630 blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq)); 632 blk_fill_rwbs(__entry->rwbs, rq->cmd_flags, blk_rq_bytes(rq));
631 ), 633 ),
632 634
633 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu", 635 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu %u",
634 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, 636 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
635 (unsigned long long)__entry->sector, 637 (unsigned long long)__entry->sector,
636 __entry->nr_sector, 638 __entry->nr_sector,
637 MAJOR(__entry->old_dev), MINOR(__entry->old_dev), 639 MAJOR(__entry->old_dev), MINOR(__entry->old_dev),
638 (unsigned long long)__entry->old_sector) 640 (unsigned long long)__entry->old_sector, __entry->nr_bios)
639); 641);
640 642
641#endif /* _TRACE_BLOCK_H */ 643#endif /* _TRACE_BLOCK_H */
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 2902657ba766..f18b3b76e01e 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -42,6 +42,7 @@ struct extent_buffer;
42 { BTRFS_TREE_LOG_OBJECTID, "TREE_LOG" }, \ 42 { BTRFS_TREE_LOG_OBJECTID, "TREE_LOG" }, \
43 { BTRFS_QUOTA_TREE_OBJECTID, "QUOTA_TREE" }, \ 43 { BTRFS_QUOTA_TREE_OBJECTID, "QUOTA_TREE" }, \
44 { BTRFS_TREE_RELOC_OBJECTID, "TREE_RELOC" }, \ 44 { BTRFS_TREE_RELOC_OBJECTID, "TREE_RELOC" }, \
45 { BTRFS_UUID_TREE_OBJECTID, "UUID_RELOC" }, \
45 { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" }) 46 { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" })
46 47
47#define show_root_type(obj) \ 48#define show_root_type(obj) \
@@ -439,7 +440,7 @@ TRACE_EVENT(btrfs_sync_fs,
439 { BTRFS_UPDATE_DELAYED_HEAD, "UPDATE_DELAYED_HEAD" }) 440 { BTRFS_UPDATE_DELAYED_HEAD, "UPDATE_DELAYED_HEAD" })
440 441
441 442
442TRACE_EVENT(btrfs_delayed_tree_ref, 443DECLARE_EVENT_CLASS(btrfs_delayed_tree_ref,
443 444
444 TP_PROTO(struct btrfs_delayed_ref_node *ref, 445 TP_PROTO(struct btrfs_delayed_ref_node *ref,
445 struct btrfs_delayed_tree_ref *full_ref, 446 struct btrfs_delayed_tree_ref *full_ref,
@@ -481,7 +482,25 @@ TRACE_EVENT(btrfs_delayed_tree_ref,
481 (unsigned long long)__entry->seq) 482 (unsigned long long)__entry->seq)
482); 483);
483 484
484TRACE_EVENT(btrfs_delayed_data_ref, 485DEFINE_EVENT(btrfs_delayed_tree_ref, add_delayed_tree_ref,
486
487 TP_PROTO(struct btrfs_delayed_ref_node *ref,
488 struct btrfs_delayed_tree_ref *full_ref,
489 int action),
490
491 TP_ARGS(ref, full_ref, action)
492);
493
494DEFINE_EVENT(btrfs_delayed_tree_ref, run_delayed_tree_ref,
495
496 TP_PROTO(struct btrfs_delayed_ref_node *ref,
497 struct btrfs_delayed_tree_ref *full_ref,
498 int action),
499
500 TP_ARGS(ref, full_ref, action)
501);
502
503DECLARE_EVENT_CLASS(btrfs_delayed_data_ref,
485 504
486 TP_PROTO(struct btrfs_delayed_ref_node *ref, 505 TP_PROTO(struct btrfs_delayed_ref_node *ref,
487 struct btrfs_delayed_data_ref *full_ref, 506 struct btrfs_delayed_data_ref *full_ref,
@@ -527,7 +546,25 @@ TRACE_EVENT(btrfs_delayed_data_ref,
527 (unsigned long long)__entry->seq) 546 (unsigned long long)__entry->seq)
528); 547);
529 548
530TRACE_EVENT(btrfs_delayed_ref_head, 549DEFINE_EVENT(btrfs_delayed_data_ref, add_delayed_data_ref,
550
551 TP_PROTO(struct btrfs_delayed_ref_node *ref,
552 struct btrfs_delayed_data_ref *full_ref,
553 int action),
554
555 TP_ARGS(ref, full_ref, action)
556);
557
558DEFINE_EVENT(btrfs_delayed_data_ref, run_delayed_data_ref,
559
560 TP_PROTO(struct btrfs_delayed_ref_node *ref,
561 struct btrfs_delayed_data_ref *full_ref,
562 int action),
563
564 TP_ARGS(ref, full_ref, action)
565);
566
567DECLARE_EVENT_CLASS(btrfs_delayed_ref_head,
531 568
532 TP_PROTO(struct btrfs_delayed_ref_node *ref, 569 TP_PROTO(struct btrfs_delayed_ref_node *ref,
533 struct btrfs_delayed_ref_head *head_ref, 570 struct btrfs_delayed_ref_head *head_ref,
@@ -556,6 +593,24 @@ TRACE_EVENT(btrfs_delayed_ref_head,
556 __entry->is_data) 593 __entry->is_data)
557); 594);
558 595
596DEFINE_EVENT(btrfs_delayed_ref_head, add_delayed_ref_head,
597
598 TP_PROTO(struct btrfs_delayed_ref_node *ref,
599 struct btrfs_delayed_ref_head *head_ref,
600 int action),
601
602 TP_ARGS(ref, head_ref, action)
603);
604
605DEFINE_EVENT(btrfs_delayed_ref_head, run_delayed_ref_head,
606
607 TP_PROTO(struct btrfs_delayed_ref_node *ref,
608 struct btrfs_delayed_ref_head *head_ref,
609 int action),
610
611 TP_ARGS(ref, head_ref, action)
612);
613
559#define show_chunk_type(type) \ 614#define show_chunk_type(type) \
560 __print_flags(type, "|", \ 615 __print_flags(type, "|", \
561 { BTRFS_BLOCK_GROUP_DATA, "DATA" }, \ 616 { BTRFS_BLOCK_GROUP_DATA, "DATA" }, \
diff --git a/include/trace/events/context_tracking.h b/include/trace/events/context_tracking.h
new file mode 100644
index 000000000000..ce8007cf29cf
--- /dev/null
+++ b/include/trace/events/context_tracking.h
@@ -0,0 +1,58 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM context_tracking
3
4#if !defined(_TRACE_CONTEXT_TRACKING_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_CONTEXT_TRACKING_H
6
7#include <linux/tracepoint.h>
8
9DECLARE_EVENT_CLASS(context_tracking_user,
10
11 TP_PROTO(int dummy),
12
13 TP_ARGS(dummy),
14
15 TP_STRUCT__entry(
16 __field( int, dummy )
17 ),
18
19 TP_fast_assign(
20 __entry->dummy = dummy;
21 ),
22
23 TP_printk("%s", "")
24);
25
26/**
27 * user_enter - called when the kernel resumes to userspace
28 * @dummy: dummy arg to make trace event macro happy
29 *
30 * This event occurs when the kernel resumes to userspace after
31 * an exception or a syscall.
32 */
33DEFINE_EVENT(context_tracking_user, user_enter,
34
35 TP_PROTO(int dummy),
36
37 TP_ARGS(dummy)
38);
39
40/**
41 * user_exit - called when userspace enters the kernel
42 * @dummy: dummy arg to make trace event macro happy
43 *
44 * This event occurs when userspace enters the kernel through
45 * an exception or a syscall.
46 */
47DEFINE_EVENT(context_tracking_user, user_exit,
48
49 TP_PROTO(int dummy),
50
51 TP_ARGS(dummy)
52);
53
54
55#endif /* _TRACE_CONTEXT_TRACKING_H */
56
57/* This part must be outside protection */
58#include <trace/define_trace.h>
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 2068db241f22..197d3125df2a 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -14,7 +14,6 @@ struct ext4_prealloc_space;
14struct ext4_inode_info; 14struct ext4_inode_info;
15struct mpage_da_data; 15struct mpage_da_data;
16struct ext4_map_blocks; 16struct ext4_map_blocks;
17struct ext4_extent;
18struct extent_status; 17struct extent_status;
19 18
20#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))
@@ -64,10 +63,10 @@ struct extent_status;
64 { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" }) 63 { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" })
65 64
66#define show_extent_status(status) __print_flags(status, "", \ 65#define show_extent_status(status) __print_flags(status, "", \
67 { (1 << 3), "W" }, \ 66 { EXTENT_STATUS_WRITTEN, "W" }, \
68 { (1 << 2), "U" }, \ 67 { EXTENT_STATUS_UNWRITTEN, "U" }, \
69 { (1 << 1), "D" }, \ 68 { EXTENT_STATUS_DELAYED, "D" }, \
70 { (1 << 0), "H" }) 69 { EXTENT_STATUS_HOLE, "H" })
71 70
72 71
73TRACE_EVENT(ext4_free_inode, 72TRACE_EVENT(ext4_free_inode,
@@ -2192,7 +2191,7 @@ TRACE_EVENT(ext4_ext_remove_space_done,
2192 (unsigned short) __entry->eh_entries) 2191 (unsigned short) __entry->eh_entries)
2193); 2192);
2194 2193
2195TRACE_EVENT(ext4_es_insert_extent, 2194DECLARE_EVENT_CLASS(ext4__es_extent,
2196 TP_PROTO(struct inode *inode, struct extent_status *es), 2195 TP_PROTO(struct inode *inode, struct extent_status *es),
2197 2196
2198 TP_ARGS(inode, es), 2197 TP_ARGS(inode, es),
@@ -2212,7 +2211,7 @@ TRACE_EVENT(ext4_es_insert_extent,
2212 __entry->lblk = es->es_lblk; 2211 __entry->lblk = es->es_lblk;
2213 __entry->len = es->es_len; 2212 __entry->len = es->es_len;
2214 __entry->pblk = ext4_es_pblock(es); 2213 __entry->pblk = ext4_es_pblock(es);
2215 __entry->status = ext4_es_status(es) >> 60; 2214 __entry->status = ext4_es_status(es);
2216 ), 2215 ),
2217 2216
2218 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s", 2217 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
@@ -2222,6 +2221,18 @@ TRACE_EVENT(ext4_es_insert_extent,
2222 __entry->pblk, show_extent_status(__entry->status)) 2221 __entry->pblk, show_extent_status(__entry->status))
2223); 2222);
2224 2223
2224DEFINE_EVENT(ext4__es_extent, ext4_es_insert_extent,
2225 TP_PROTO(struct inode *inode, struct extent_status *es),
2226
2227 TP_ARGS(inode, es)
2228);
2229
2230DEFINE_EVENT(ext4__es_extent, ext4_es_cache_extent,
2231 TP_PROTO(struct inode *inode, struct extent_status *es),
2232
2233 TP_ARGS(inode, es)
2234);
2235
2225TRACE_EVENT(ext4_es_remove_extent, 2236TRACE_EVENT(ext4_es_remove_extent,
2226 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len), 2237 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len),
2227 2238
@@ -2289,7 +2300,7 @@ TRACE_EVENT(ext4_es_find_delayed_extent_range_exit,
2289 __entry->lblk = es->es_lblk; 2300 __entry->lblk = es->es_lblk;
2290 __entry->len = es->es_len; 2301 __entry->len = es->es_len;
2291 __entry->pblk = ext4_es_pblock(es); 2302 __entry->pblk = ext4_es_pblock(es);
2292 __entry->status = ext4_es_status(es) >> 60; 2303 __entry->status = ext4_es_status(es);
2293 ), 2304 ),
2294 2305
2295 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s", 2306 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
@@ -2343,7 +2354,7 @@ TRACE_EVENT(ext4_es_lookup_extent_exit,
2343 __entry->lblk = es->es_lblk; 2354 __entry->lblk = es->es_lblk;
2344 __entry->len = es->es_len; 2355 __entry->len = es->es_len;
2345 __entry->pblk = ext4_es_pblock(es); 2356 __entry->pblk = ext4_es_pblock(es);
2346 __entry->status = ext4_es_status(es) >> 60; 2357 __entry->status = ext4_es_status(es);
2347 __entry->found = found; 2358 __entry->found = found;
2348 ), 2359 ),
2349 2360
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h
index 6bc943ecb841..d0c613476620 100644
--- a/include/trace/events/kmem.h
+++ b/include/trace/events/kmem.h
@@ -268,11 +268,13 @@ TRACE_EVENT(mm_page_alloc_extfrag,
268 268
269 TP_PROTO(struct page *page, 269 TP_PROTO(struct page *page,
270 int alloc_order, int fallback_order, 270 int alloc_order, int fallback_order,
271 int alloc_migratetype, int fallback_migratetype), 271 int alloc_migratetype, int fallback_migratetype,
272 int change_ownership),
272 273
273 TP_ARGS(page, 274 TP_ARGS(page,
274 alloc_order, fallback_order, 275 alloc_order, fallback_order,
275 alloc_migratetype, fallback_migratetype), 276 alloc_migratetype, fallback_migratetype,
277 change_ownership),
276 278
277 TP_STRUCT__entry( 279 TP_STRUCT__entry(
278 __field( struct page *, page ) 280 __field( struct page *, page )
@@ -280,6 +282,7 @@ TRACE_EVENT(mm_page_alloc_extfrag,
280 __field( int, fallback_order ) 282 __field( int, fallback_order )
281 __field( int, alloc_migratetype ) 283 __field( int, alloc_migratetype )
282 __field( int, fallback_migratetype ) 284 __field( int, fallback_migratetype )
285 __field( int, change_ownership )
283 ), 286 ),
284 287
285 TP_fast_assign( 288 TP_fast_assign(
@@ -288,6 +291,7 @@ TRACE_EVENT(mm_page_alloc_extfrag,
288 __entry->fallback_order = fallback_order; 291 __entry->fallback_order = fallback_order;
289 __entry->alloc_migratetype = alloc_migratetype; 292 __entry->alloc_migratetype = alloc_migratetype;
290 __entry->fallback_migratetype = fallback_migratetype; 293 __entry->fallback_migratetype = fallback_migratetype;
294 __entry->change_ownership = change_ownership;
291 ), 295 ),
292 296
293 TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d", 297 TP_printk("page=%p pfn=%lu alloc_order=%d fallback_order=%d pageblock_order=%d alloc_migratetype=%d fallback_migratetype=%d fragmenting=%d change_ownership=%d",
@@ -299,7 +303,7 @@ TRACE_EVENT(mm_page_alloc_extfrag,
299 __entry->alloc_migratetype, 303 __entry->alloc_migratetype,
300 __entry->fallback_migratetype, 304 __entry->fallback_migratetype,
301 __entry->fallback_order < pageblock_order, 305 __entry->fallback_order < pageblock_order,
302 __entry->alloc_migratetype == __entry->fallback_migratetype) 306 __entry->change_ownership)
303); 307);
304 308
305#endif /* _TRACE_KMEM_H */ 309#endif /* _TRACE_KMEM_H */
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 8e42410bd159..cda100d6762d 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -66,6 +66,43 @@ TRACE_EVENT(machine_suspend,
66 TP_printk("state=%lu", (unsigned long)__entry->state) 66 TP_printk("state=%lu", (unsigned long)__entry->state)
67); 67);
68 68
69TRACE_EVENT(device_pm_report_time,
70
71 TP_PROTO(struct device *dev, const char *pm_ops, s64 ops_time,
72 char *pm_event_str, int error),
73
74 TP_ARGS(dev, pm_ops, ops_time, pm_event_str, error),
75
76 TP_STRUCT__entry(
77 __string(device, dev_name(dev))
78 __string(driver, dev_driver_string(dev))
79 __string(parent, dev->parent ? dev_name(dev->parent) : "none")
80 __string(pm_ops, pm_ops ? pm_ops : "none ")
81 __string(pm_event_str, pm_event_str)
82 __field(s64, ops_time)
83 __field(int, error)
84 ),
85
86 TP_fast_assign(
87 const char *tmp = dev->parent ? dev_name(dev->parent) : "none";
88 const char *tmp_i = pm_ops ? pm_ops : "none ";
89
90 __assign_str(device, dev_name(dev));
91 __assign_str(driver, dev_driver_string(dev));
92 __assign_str(parent, tmp);
93 __assign_str(pm_ops, tmp_i);
94 __assign_str(pm_event_str, pm_event_str);
95 __entry->ops_time = ops_time;
96 __entry->error = error;
97 ),
98
99 /* ops_str has an extra space at the end */
100 TP_printk("%s %s parent=%s state=%s ops=%snsecs=%lld err=%d",
101 __get_str(driver), __get_str(device), __get_str(parent),
102 __get_str(pm_event_str), __get_str(pm_ops),
103 __entry->ops_time, __entry->error)
104);
105
69DECLARE_EVENT_CLASS(wakeup_source, 106DECLARE_EVENT_CLASS(wakeup_source,
70 107
71 TP_PROTO(const char *name, unsigned int state), 108 TP_PROTO(const char *name, unsigned int state),
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 59ebcc89f148..ee2376cfaab3 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -19,12 +19,12 @@
19 */ 19 */
20TRACE_EVENT(rcu_utilization, 20TRACE_EVENT(rcu_utilization,
21 21
22 TP_PROTO(char *s), 22 TP_PROTO(const char *s),
23 23
24 TP_ARGS(s), 24 TP_ARGS(s),
25 25
26 TP_STRUCT__entry( 26 TP_STRUCT__entry(
27 __field(char *, s) 27 __field(const char *, s)
28 ), 28 ),
29 29
30 TP_fast_assign( 30 TP_fast_assign(
@@ -51,14 +51,14 @@ TRACE_EVENT(rcu_utilization,
51 */ 51 */
52TRACE_EVENT(rcu_grace_period, 52TRACE_EVENT(rcu_grace_period,
53 53
54 TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent), 54 TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent),
55 55
56 TP_ARGS(rcuname, gpnum, gpevent), 56 TP_ARGS(rcuname, gpnum, gpevent),
57 57
58 TP_STRUCT__entry( 58 TP_STRUCT__entry(
59 __field(char *, rcuname) 59 __field(const char *, rcuname)
60 __field(unsigned long, gpnum) 60 __field(unsigned long, gpnum)
61 __field(char *, gpevent) 61 __field(const char *, gpevent)
62 ), 62 ),
63 63
64 TP_fast_assign( 64 TP_fast_assign(
@@ -89,21 +89,21 @@ TRACE_EVENT(rcu_grace_period,
89 */ 89 */
90TRACE_EVENT(rcu_future_grace_period, 90TRACE_EVENT(rcu_future_grace_period,
91 91
92 TP_PROTO(char *rcuname, unsigned long gpnum, unsigned long completed, 92 TP_PROTO(const char *rcuname, unsigned long gpnum, unsigned long completed,
93 unsigned long c, u8 level, int grplo, int grphi, 93 unsigned long c, u8 level, int grplo, int grphi,
94 char *gpevent), 94 const char *gpevent),
95 95
96 TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent), 96 TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent),
97 97
98 TP_STRUCT__entry( 98 TP_STRUCT__entry(
99 __field(char *, rcuname) 99 __field(const char *, rcuname)
100 __field(unsigned long, gpnum) 100 __field(unsigned long, gpnum)
101 __field(unsigned long, completed) 101 __field(unsigned long, completed)
102 __field(unsigned long, c) 102 __field(unsigned long, c)
103 __field(u8, level) 103 __field(u8, level)
104 __field(int, grplo) 104 __field(int, grplo)
105 __field(int, grphi) 105 __field(int, grphi)
106 __field(char *, gpevent) 106 __field(const char *, gpevent)
107 ), 107 ),
108 108
109 TP_fast_assign( 109 TP_fast_assign(
@@ -132,13 +132,13 @@ TRACE_EVENT(rcu_future_grace_period,
132 */ 132 */
133TRACE_EVENT(rcu_grace_period_init, 133TRACE_EVENT(rcu_grace_period_init,
134 134
135 TP_PROTO(char *rcuname, unsigned long gpnum, u8 level, 135 TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level,
136 int grplo, int grphi, unsigned long qsmask), 136 int grplo, int grphi, unsigned long qsmask),
137 137
138 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask), 138 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
139 139
140 TP_STRUCT__entry( 140 TP_STRUCT__entry(
141 __field(char *, rcuname) 141 __field(const char *, rcuname)
142 __field(unsigned long, gpnum) 142 __field(unsigned long, gpnum)
143 __field(u8, level) 143 __field(u8, level)
144 __field(int, grplo) 144 __field(int, grplo)
@@ -168,12 +168,12 @@ TRACE_EVENT(rcu_grace_period_init,
168 */ 168 */
169TRACE_EVENT(rcu_preempt_task, 169TRACE_EVENT(rcu_preempt_task,
170 170
171 TP_PROTO(char *rcuname, int pid, unsigned long gpnum), 171 TP_PROTO(const char *rcuname, int pid, unsigned long gpnum),
172 172
173 TP_ARGS(rcuname, pid, gpnum), 173 TP_ARGS(rcuname, pid, gpnum),
174 174
175 TP_STRUCT__entry( 175 TP_STRUCT__entry(
176 __field(char *, rcuname) 176 __field(const char *, rcuname)
177 __field(unsigned long, gpnum) 177 __field(unsigned long, gpnum)
178 __field(int, pid) 178 __field(int, pid)
179 ), 179 ),
@@ -195,12 +195,12 @@ TRACE_EVENT(rcu_preempt_task,
195 */ 195 */
196TRACE_EVENT(rcu_unlock_preempted_task, 196TRACE_EVENT(rcu_unlock_preempted_task,
197 197
198 TP_PROTO(char *rcuname, unsigned long gpnum, int pid), 198 TP_PROTO(const char *rcuname, unsigned long gpnum, int pid),
199 199
200 TP_ARGS(rcuname, gpnum, pid), 200 TP_ARGS(rcuname, gpnum, pid),
201 201
202 TP_STRUCT__entry( 202 TP_STRUCT__entry(
203 __field(char *, rcuname) 203 __field(const char *, rcuname)
204 __field(unsigned long, gpnum) 204 __field(unsigned long, gpnum)
205 __field(int, pid) 205 __field(int, pid)
206 ), 206 ),
@@ -224,14 +224,14 @@ TRACE_EVENT(rcu_unlock_preempted_task,
224 */ 224 */
225TRACE_EVENT(rcu_quiescent_state_report, 225TRACE_EVENT(rcu_quiescent_state_report,
226 226
227 TP_PROTO(char *rcuname, unsigned long gpnum, 227 TP_PROTO(const char *rcuname, unsigned long gpnum,
228 unsigned long mask, unsigned long qsmask, 228 unsigned long mask, unsigned long qsmask,
229 u8 level, int grplo, int grphi, int gp_tasks), 229 u8 level, int grplo, int grphi, int gp_tasks),
230 230
231 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks), 231 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
232 232
233 TP_STRUCT__entry( 233 TP_STRUCT__entry(
234 __field(char *, rcuname) 234 __field(const char *, rcuname)
235 __field(unsigned long, gpnum) 235 __field(unsigned long, gpnum)
236 __field(unsigned long, mask) 236 __field(unsigned long, mask)
237 __field(unsigned long, qsmask) 237 __field(unsigned long, qsmask)
@@ -268,15 +268,15 @@ TRACE_EVENT(rcu_quiescent_state_report,
268 */ 268 */
269TRACE_EVENT(rcu_fqs, 269TRACE_EVENT(rcu_fqs,
270 270
271 TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent), 271 TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent),
272 272
273 TP_ARGS(rcuname, gpnum, cpu, qsevent), 273 TP_ARGS(rcuname, gpnum, cpu, qsevent),
274 274
275 TP_STRUCT__entry( 275 TP_STRUCT__entry(
276 __field(char *, rcuname) 276 __field(const char *, rcuname)
277 __field(unsigned long, gpnum) 277 __field(unsigned long, gpnum)
278 __field(int, cpu) 278 __field(int, cpu)
279 __field(char *, qsevent) 279 __field(const char *, qsevent)
280 ), 280 ),
281 281
282 TP_fast_assign( 282 TP_fast_assign(
@@ -308,12 +308,12 @@ TRACE_EVENT(rcu_fqs,
308 */ 308 */
309TRACE_EVENT(rcu_dyntick, 309TRACE_EVENT(rcu_dyntick,
310 310
311 TP_PROTO(char *polarity, long long oldnesting, long long newnesting), 311 TP_PROTO(const char *polarity, long long oldnesting, long long newnesting),
312 312
313 TP_ARGS(polarity, oldnesting, newnesting), 313 TP_ARGS(polarity, oldnesting, newnesting),
314 314
315 TP_STRUCT__entry( 315 TP_STRUCT__entry(
316 __field(char *, polarity) 316 __field(const char *, polarity)
317 __field(long long, oldnesting) 317 __field(long long, oldnesting)
318 __field(long long, newnesting) 318 __field(long long, newnesting)
319 ), 319 ),
@@ -352,12 +352,12 @@ TRACE_EVENT(rcu_dyntick,
352 */ 352 */
353TRACE_EVENT(rcu_prep_idle, 353TRACE_EVENT(rcu_prep_idle,
354 354
355 TP_PROTO(char *reason), 355 TP_PROTO(const char *reason),
356 356
357 TP_ARGS(reason), 357 TP_ARGS(reason),
358 358
359 TP_STRUCT__entry( 359 TP_STRUCT__entry(
360 __field(char *, reason) 360 __field(const char *, reason)
361 ), 361 ),
362 362
363 TP_fast_assign( 363 TP_fast_assign(
@@ -376,13 +376,13 @@ TRACE_EVENT(rcu_prep_idle,
376 */ 376 */
377TRACE_EVENT(rcu_callback, 377TRACE_EVENT(rcu_callback,
378 378
379 TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy, 379 TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy,
380 long qlen), 380 long qlen),
381 381
382 TP_ARGS(rcuname, rhp, qlen_lazy, qlen), 382 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
383 383
384 TP_STRUCT__entry( 384 TP_STRUCT__entry(
385 __field(char *, rcuname) 385 __field(const char *, rcuname)
386 __field(void *, rhp) 386 __field(void *, rhp)
387 __field(void *, func) 387 __field(void *, func)
388 __field(long, qlen_lazy) 388 __field(long, qlen_lazy)
@@ -412,13 +412,13 @@ TRACE_EVENT(rcu_callback,
412 */ 412 */
413TRACE_EVENT(rcu_kfree_callback, 413TRACE_EVENT(rcu_kfree_callback,
414 414
415 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, 415 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset,
416 long qlen_lazy, long qlen), 416 long qlen_lazy, long qlen),
417 417
418 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), 418 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
419 419
420 TP_STRUCT__entry( 420 TP_STRUCT__entry(
421 __field(char *, rcuname) 421 __field(const char *, rcuname)
422 __field(void *, rhp) 422 __field(void *, rhp)
423 __field(unsigned long, offset) 423 __field(unsigned long, offset)
424 __field(long, qlen_lazy) 424 __field(long, qlen_lazy)
@@ -447,12 +447,12 @@ TRACE_EVENT(rcu_kfree_callback,
447 */ 447 */
448TRACE_EVENT(rcu_batch_start, 448TRACE_EVENT(rcu_batch_start,
449 449
450 TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit), 450 TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit),
451 451
452 TP_ARGS(rcuname, qlen_lazy, qlen, blimit), 452 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
453 453
454 TP_STRUCT__entry( 454 TP_STRUCT__entry(
455 __field(char *, rcuname) 455 __field(const char *, rcuname)
456 __field(long, qlen_lazy) 456 __field(long, qlen_lazy)
457 __field(long, qlen) 457 __field(long, qlen)
458 __field(long, blimit) 458 __field(long, blimit)
@@ -477,12 +477,12 @@ TRACE_EVENT(rcu_batch_start,
477 */ 477 */
478TRACE_EVENT(rcu_invoke_callback, 478TRACE_EVENT(rcu_invoke_callback,
479 479
480 TP_PROTO(char *rcuname, struct rcu_head *rhp), 480 TP_PROTO(const char *rcuname, struct rcu_head *rhp),
481 481
482 TP_ARGS(rcuname, rhp), 482 TP_ARGS(rcuname, rhp),
483 483
484 TP_STRUCT__entry( 484 TP_STRUCT__entry(
485 __field(char *, rcuname) 485 __field(const char *, rcuname)
486 __field(void *, rhp) 486 __field(void *, rhp)
487 __field(void *, func) 487 __field(void *, func)
488 ), 488 ),
@@ -506,12 +506,12 @@ TRACE_EVENT(rcu_invoke_callback,
506 */ 506 */
507TRACE_EVENT(rcu_invoke_kfree_callback, 507TRACE_EVENT(rcu_invoke_kfree_callback,
508 508
509 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset), 509 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset),
510 510
511 TP_ARGS(rcuname, rhp, offset), 511 TP_ARGS(rcuname, rhp, offset),
512 512
513 TP_STRUCT__entry( 513 TP_STRUCT__entry(
514 __field(char *, rcuname) 514 __field(const char *, rcuname)
515 __field(void *, rhp) 515 __field(void *, rhp)
516 __field(unsigned long, offset) 516 __field(unsigned long, offset)
517 ), 517 ),
@@ -539,13 +539,13 @@ TRACE_EVENT(rcu_invoke_kfree_callback,
539 */ 539 */
540TRACE_EVENT(rcu_batch_end, 540TRACE_EVENT(rcu_batch_end,
541 541
542 TP_PROTO(char *rcuname, int callbacks_invoked, 542 TP_PROTO(const char *rcuname, int callbacks_invoked,
543 bool cb, bool nr, bool iit, bool risk), 543 bool cb, bool nr, bool iit, bool risk),
544 544
545 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), 545 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
546 546
547 TP_STRUCT__entry( 547 TP_STRUCT__entry(
548 __field(char *, rcuname) 548 __field(const char *, rcuname)
549 __field(int, callbacks_invoked) 549 __field(int, callbacks_invoked)
550 __field(bool, cb) 550 __field(bool, cb)
551 __field(bool, nr) 551 __field(bool, nr)
@@ -577,13 +577,13 @@ TRACE_EVENT(rcu_batch_end,
577 */ 577 */
578TRACE_EVENT(rcu_torture_read, 578TRACE_EVENT(rcu_torture_read,
579 579
580 TP_PROTO(char *rcutorturename, struct rcu_head *rhp, 580 TP_PROTO(const char *rcutorturename, struct rcu_head *rhp,
581 unsigned long secs, unsigned long c_old, unsigned long c), 581 unsigned long secs, unsigned long c_old, unsigned long c),
582 582
583 TP_ARGS(rcutorturename, rhp, secs, c_old, c), 583 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
584 584
585 TP_STRUCT__entry( 585 TP_STRUCT__entry(
586 __field(char *, rcutorturename) 586 __field(const char *, rcutorturename)
587 __field(struct rcu_head *, rhp) 587 __field(struct rcu_head *, rhp)
588 __field(unsigned long, secs) 588 __field(unsigned long, secs)
589 __field(unsigned long, c_old) 589 __field(unsigned long, c_old)
@@ -623,13 +623,13 @@ TRACE_EVENT(rcu_torture_read,
623 */ 623 */
624TRACE_EVENT(rcu_barrier, 624TRACE_EVENT(rcu_barrier,
625 625
626 TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done), 626 TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done),
627 627
628 TP_ARGS(rcuname, s, cpu, cnt, done), 628 TP_ARGS(rcuname, s, cpu, cnt, done),
629 629
630 TP_STRUCT__entry( 630 TP_STRUCT__entry(
631 __field(char *, rcuname) 631 __field(const char *, rcuname)
632 __field(char *, s) 632 __field(const char *, s)
633 __field(int, cpu) 633 __field(int, cpu)
634 __field(int, cnt) 634 __field(int, cnt)
635 __field(unsigned long, done) 635 __field(unsigned long, done)
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index e5586caff67a..2e7d9947a10d 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -57,7 +57,7 @@ DECLARE_EVENT_CLASS(sched_wakeup_template,
57 57
58 TP_PROTO(struct task_struct *p, int success), 58 TP_PROTO(struct task_struct *p, int success),
59 59
60 TP_ARGS(p, success), 60 TP_ARGS(__perf_task(p), success),
61 61
62 TP_STRUCT__entry( 62 TP_STRUCT__entry(
63 __array( char, comm, TASK_COMM_LEN ) 63 __array( char, comm, TASK_COMM_LEN )
@@ -73,9 +73,6 @@ DECLARE_EVENT_CLASS(sched_wakeup_template,
73 __entry->prio = p->prio; 73 __entry->prio = p->prio;
74 __entry->success = success; 74 __entry->success = success;
75 __entry->target_cpu = task_cpu(p); 75 __entry->target_cpu = task_cpu(p);
76 )
77 TP_perf_assign(
78 __perf_task(p);
79 ), 76 ),
80 77
81 TP_printk("comm=%s pid=%d prio=%d success=%d target_cpu=%03d", 78 TP_printk("comm=%s pid=%d prio=%d success=%d target_cpu=%03d",
@@ -313,7 +310,7 @@ DECLARE_EVENT_CLASS(sched_stat_template,
313 310
314 TP_PROTO(struct task_struct *tsk, u64 delay), 311 TP_PROTO(struct task_struct *tsk, u64 delay),
315 312
316 TP_ARGS(tsk, delay), 313 TP_ARGS(__perf_task(tsk), __perf_count(delay)),
317 314
318 TP_STRUCT__entry( 315 TP_STRUCT__entry(
319 __array( char, comm, TASK_COMM_LEN ) 316 __array( char, comm, TASK_COMM_LEN )
@@ -325,10 +322,6 @@ DECLARE_EVENT_CLASS(sched_stat_template,
325 memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); 322 memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
326 __entry->pid = tsk->pid; 323 __entry->pid = tsk->pid;
327 __entry->delay = delay; 324 __entry->delay = delay;
328 )
329 TP_perf_assign(
330 __perf_count(delay);
331 __perf_task(tsk);
332 ), 325 ),
333 326
334 TP_printk("comm=%s pid=%d delay=%Lu [ns]", 327 TP_printk("comm=%s pid=%d delay=%Lu [ns]",
@@ -372,11 +365,11 @@ DEFINE_EVENT(sched_stat_template, sched_stat_blocked,
372 * Tracepoint for accounting runtime (time the task is executing 365 * Tracepoint for accounting runtime (time the task is executing
373 * on a CPU). 366 * on a CPU).
374 */ 367 */
375TRACE_EVENT(sched_stat_runtime, 368DECLARE_EVENT_CLASS(sched_stat_runtime,
376 369
377 TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime), 370 TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime),
378 371
379 TP_ARGS(tsk, runtime, vruntime), 372 TP_ARGS(tsk, __perf_count(runtime), vruntime),
380 373
381 TP_STRUCT__entry( 374 TP_STRUCT__entry(
382 __array( char, comm, TASK_COMM_LEN ) 375 __array( char, comm, TASK_COMM_LEN )
@@ -390,9 +383,6 @@ TRACE_EVENT(sched_stat_runtime,
390 __entry->pid = tsk->pid; 383 __entry->pid = tsk->pid;
391 __entry->runtime = runtime; 384 __entry->runtime = runtime;
392 __entry->vruntime = vruntime; 385 __entry->vruntime = vruntime;
393 )
394 TP_perf_assign(
395 __perf_count(runtime);
396 ), 386 ),
397 387
398 TP_printk("comm=%s pid=%d runtime=%Lu [ns] vruntime=%Lu [ns]", 388 TP_printk("comm=%s pid=%d runtime=%Lu [ns] vruntime=%Lu [ns]",
@@ -401,6 +391,10 @@ TRACE_EVENT(sched_stat_runtime,
401 (unsigned long long)__entry->vruntime) 391 (unsigned long long)__entry->vruntime)
402); 392);
403 393
394DEFINE_EVENT(sched_stat_runtime, sched_stat_runtime,
395 TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime),
396 TP_ARGS(tsk, runtime, vruntime));
397
404/* 398/*
405 * Tracepoint for showing priority inheritance modifying a tasks 399 * Tracepoint for showing priority inheritance modifying a tasks
406 * priority. 400 * priority.
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 43be87d5dd58..d51d16c7afd8 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -6,6 +6,8 @@
6 6
7#include <linux/sunrpc/sched.h> 7#include <linux/sunrpc/sched.h>
8#include <linux/sunrpc/clnt.h> 8#include <linux/sunrpc/clnt.h>
9#include <net/tcp_states.h>
10#include <linux/net.h>
9#include <linux/tracepoint.h> 11#include <linux/tracepoint.h>
10 12
11DECLARE_EVENT_CLASS(rpc_task_status, 13DECLARE_EVENT_CLASS(rpc_task_status,
@@ -15,18 +17,20 @@ DECLARE_EVENT_CLASS(rpc_task_status,
15 TP_ARGS(task), 17 TP_ARGS(task),
16 18
17 TP_STRUCT__entry( 19 TP_STRUCT__entry(
18 __field(const struct rpc_task *, task) 20 __field(unsigned int, task_id)
19 __field(const struct rpc_clnt *, clnt) 21 __field(unsigned int, client_id)
20 __field(int, status) 22 __field(int, status)
21 ), 23 ),
22 24
23 TP_fast_assign( 25 TP_fast_assign(
24 __entry->task = task; 26 __entry->task_id = task->tk_pid;
25 __entry->clnt = task->tk_client; 27 __entry->client_id = task->tk_client->cl_clid;
26 __entry->status = task->tk_status; 28 __entry->status = task->tk_status;
27 ), 29 ),
28 30
29 TP_printk("task:%p@%p, status %d",__entry->task, __entry->clnt, __entry->status) 31 TP_printk("task:%u@%u, status %d",
32 __entry->task_id, __entry->client_id,
33 __entry->status)
30); 34);
31 35
32DEFINE_EVENT(rpc_task_status, rpc_call_status, 36DEFINE_EVENT(rpc_task_status, rpc_call_status,
@@ -47,18 +51,20 @@ TRACE_EVENT(rpc_connect_status,
47 TP_ARGS(task, status), 51 TP_ARGS(task, status),
48 52
49 TP_STRUCT__entry( 53 TP_STRUCT__entry(
50 __field(const struct rpc_task *, task) 54 __field(unsigned int, task_id)
51 __field(const struct rpc_clnt *, clnt) 55 __field(unsigned int, client_id)
52 __field(int, status) 56 __field(int, status)
53 ), 57 ),
54 58
55 TP_fast_assign( 59 TP_fast_assign(
56 __entry->task = task; 60 __entry->task_id = task->tk_pid;
57 __entry->clnt = task->tk_client; 61 __entry->client_id = task->tk_client->cl_clid;
58 __entry->status = status; 62 __entry->status = status;
59 ), 63 ),
60 64
61 TP_printk("task:%p@%p, status %d",__entry->task, __entry->clnt, __entry->status) 65 TP_printk("task:%u@%u, status %d",
66 __entry->task_id, __entry->client_id,
67 __entry->status)
62); 68);
63 69
64DECLARE_EVENT_CLASS(rpc_task_running, 70DECLARE_EVENT_CLASS(rpc_task_running,
@@ -68,8 +74,8 @@ DECLARE_EVENT_CLASS(rpc_task_running,
68 TP_ARGS(clnt, task, action), 74 TP_ARGS(clnt, task, action),
69 75
70 TP_STRUCT__entry( 76 TP_STRUCT__entry(
71 __field(const struct rpc_clnt *, clnt) 77 __field(unsigned int, task_id)
72 __field(const struct rpc_task *, task) 78 __field(unsigned int, client_id)
73 __field(const void *, action) 79 __field(const void *, action)
74 __field(unsigned long, runstate) 80 __field(unsigned long, runstate)
75 __field(int, status) 81 __field(int, status)
@@ -77,17 +83,16 @@ DECLARE_EVENT_CLASS(rpc_task_running,
77 ), 83 ),
78 84
79 TP_fast_assign( 85 TP_fast_assign(
80 __entry->clnt = clnt; 86 __entry->client_id = clnt->cl_clid;
81 __entry->task = task; 87 __entry->task_id = task->tk_pid;
82 __entry->action = action; 88 __entry->action = action;
83 __entry->runstate = task->tk_runstate; 89 __entry->runstate = task->tk_runstate;
84 __entry->status = task->tk_status; 90 __entry->status = task->tk_status;
85 __entry->flags = task->tk_flags; 91 __entry->flags = task->tk_flags;
86 ), 92 ),
87 93
88 TP_printk("task:%p@%p flags=%4.4x state=%4.4lx status=%d action=%pf", 94 TP_printk("task:%u@%u flags=%4.4x state=%4.4lx status=%d action=%pf",
89 __entry->task, 95 __entry->task_id, __entry->client_id,
90 __entry->clnt,
91 __entry->flags, 96 __entry->flags,
92 __entry->runstate, 97 __entry->runstate,
93 __entry->status, 98 __entry->status,
@@ -126,8 +131,8 @@ DECLARE_EVENT_CLASS(rpc_task_queued,
126 TP_ARGS(clnt, task, q), 131 TP_ARGS(clnt, task, q),
127 132
128 TP_STRUCT__entry( 133 TP_STRUCT__entry(
129 __field(const struct rpc_clnt *, clnt) 134 __field(unsigned int, task_id)
130 __field(const struct rpc_task *, task) 135 __field(unsigned int, client_id)
131 __field(unsigned long, timeout) 136 __field(unsigned long, timeout)
132 __field(unsigned long, runstate) 137 __field(unsigned long, runstate)
133 __field(int, status) 138 __field(int, status)
@@ -136,8 +141,8 @@ DECLARE_EVENT_CLASS(rpc_task_queued,
136 ), 141 ),
137 142
138 TP_fast_assign( 143 TP_fast_assign(
139 __entry->clnt = clnt; 144 __entry->client_id = clnt->cl_clid;
140 __entry->task = task; 145 __entry->task_id = task->tk_pid;
141 __entry->timeout = task->tk_timeout; 146 __entry->timeout = task->tk_timeout;
142 __entry->runstate = task->tk_runstate; 147 __entry->runstate = task->tk_runstate;
143 __entry->status = task->tk_status; 148 __entry->status = task->tk_status;
@@ -145,9 +150,8 @@ DECLARE_EVENT_CLASS(rpc_task_queued,
145 __assign_str(q_name, rpc_qname(q)); 150 __assign_str(q_name, rpc_qname(q));
146 ), 151 ),
147 152
148 TP_printk("task:%p@%p flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s", 153 TP_printk("task:%u@%u flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s",
149 __entry->task, 154 __entry->task_id, __entry->client_id,
150 __entry->clnt,
151 __entry->flags, 155 __entry->flags,
152 __entry->runstate, 156 __entry->runstate,
153 __entry->status, 157 __entry->status,
@@ -172,6 +176,135 @@ DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup,
172 176
173); 177);
174 178
179#define rpc_show_socket_state(state) \
180 __print_symbolic(state, \
181 { SS_FREE, "FREE" }, \
182 { SS_UNCONNECTED, "UNCONNECTED" }, \
183 { SS_CONNECTING, "CONNECTING," }, \
184 { SS_CONNECTED, "CONNECTED," }, \
185 { SS_DISCONNECTING, "DISCONNECTING" })
186
187#define rpc_show_sock_state(state) \
188 __print_symbolic(state, \
189 { TCP_ESTABLISHED, "ESTABLISHED" }, \
190 { TCP_SYN_SENT, "SYN_SENT" }, \
191 { TCP_SYN_RECV, "SYN_RECV" }, \
192 { TCP_FIN_WAIT1, "FIN_WAIT1" }, \
193 { TCP_FIN_WAIT2, "FIN_WAIT2" }, \
194 { TCP_TIME_WAIT, "TIME_WAIT" }, \
195 { TCP_CLOSE, "CLOSE" }, \
196 { TCP_CLOSE_WAIT, "CLOSE_WAIT" }, \
197 { TCP_LAST_ACK, "LAST_ACK" }, \
198 { TCP_LISTEN, "LISTEN" }, \
199 { TCP_CLOSING, "CLOSING" })
200
201DECLARE_EVENT_CLASS(xs_socket_event,
202
203 TP_PROTO(
204 struct rpc_xprt *xprt,
205 struct socket *socket
206 ),
207
208 TP_ARGS(xprt, socket),
209
210 TP_STRUCT__entry(
211 __field(unsigned int, socket_state)
212 __field(unsigned int, sock_state)
213 __field(unsigned long long, ino)
214 __string(dstaddr,
215 xprt->address_strings[RPC_DISPLAY_ADDR])
216 __string(dstport,
217 xprt->address_strings[RPC_DISPLAY_PORT])
218 ),
219
220 TP_fast_assign(
221 struct inode *inode = SOCK_INODE(socket);
222 __entry->socket_state = socket->state;
223 __entry->sock_state = socket->sk->sk_state;
224 __entry->ino = (unsigned long long)inode->i_ino;
225 __assign_str(dstaddr,
226 xprt->address_strings[RPC_DISPLAY_ADDR]);
227 __assign_str(dstport,
228 xprt->address_strings[RPC_DISPLAY_PORT]);
229 ),
230
231 TP_printk(
232 "socket:[%llu] dstaddr=%s/%s "
233 "state=%u (%s) sk_state=%u (%s)",
234 __entry->ino, __get_str(dstaddr), __get_str(dstport),
235 __entry->socket_state,
236 rpc_show_socket_state(__entry->socket_state),
237 __entry->sock_state,
238 rpc_show_sock_state(__entry->sock_state)
239 )
240);
241#define DEFINE_RPC_SOCKET_EVENT(name) \
242 DEFINE_EVENT(xs_socket_event, name, \
243 TP_PROTO( \
244 struct rpc_xprt *xprt, \
245 struct socket *socket \
246 ), \
247 TP_ARGS(xprt, socket))
248
249DECLARE_EVENT_CLASS(xs_socket_event_done,
250
251 TP_PROTO(
252 struct rpc_xprt *xprt,
253 struct socket *socket,
254 int error
255 ),
256
257 TP_ARGS(xprt, socket, error),
258
259 TP_STRUCT__entry(
260 __field(int, error)
261 __field(unsigned int, socket_state)
262 __field(unsigned int, sock_state)
263 __field(unsigned long long, ino)
264 __string(dstaddr,
265 xprt->address_strings[RPC_DISPLAY_ADDR])
266 __string(dstport,
267 xprt->address_strings[RPC_DISPLAY_PORT])
268 ),
269
270 TP_fast_assign(
271 struct inode *inode = SOCK_INODE(socket);
272 __entry->socket_state = socket->state;
273 __entry->sock_state = socket->sk->sk_state;
274 __entry->ino = (unsigned long long)inode->i_ino;
275 __entry->error = error;
276 __assign_str(dstaddr,
277 xprt->address_strings[RPC_DISPLAY_ADDR]);
278 __assign_str(dstport,
279 xprt->address_strings[RPC_DISPLAY_PORT]);
280 ),
281
282 TP_printk(
283 "error=%d socket:[%llu] dstaddr=%s/%s "
284 "state=%u (%s) sk_state=%u (%s)",
285 __entry->error,
286 __entry->ino, __get_str(dstaddr), __get_str(dstport),
287 __entry->socket_state,
288 rpc_show_socket_state(__entry->socket_state),
289 __entry->sock_state,
290 rpc_show_sock_state(__entry->sock_state)
291 )
292);
293#define DEFINE_RPC_SOCKET_EVENT_DONE(name) \
294 DEFINE_EVENT(xs_socket_event_done, name, \
295 TP_PROTO( \
296 struct rpc_xprt *xprt, \
297 struct socket *socket, \
298 int error \
299 ), \
300 TP_ARGS(xprt, socket, error))
301
302DEFINE_RPC_SOCKET_EVENT(rpc_socket_state_change);
303DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_connect);
304DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_reset_connection);
305DEFINE_RPC_SOCKET_EVENT(rpc_socket_close);
306DEFINE_RPC_SOCKET_EVENT(rpc_socket_shutdown);
307
175#endif /* _TRACE_SUNRPC_H */ 308#endif /* _TRACE_SUNRPC_H */
176 309
177#include <trace/define_trace.h> 310#include <trace/define_trace.h>
diff --git a/include/trace/events/target.h b/include/trace/events/target.h
index aef8fc354025..da9cc0f05c93 100644
--- a/include/trace/events/target.h
+++ b/include/trace/events/target.h
@@ -144,7 +144,7 @@ TRACE_EVENT(target_sequencer_start,
144 ), 144 ),
145 145
146 TP_fast_assign( 146 TP_fast_assign(
147 __entry->unpacked_lun = cmd->se_lun->unpacked_lun; 147 __entry->unpacked_lun = cmd->orig_fe_lun;
148 __entry->opcode = cmd->t_task_cdb[0]; 148 __entry->opcode = cmd->t_task_cdb[0];
149 __entry->data_length = cmd->data_length; 149 __entry->data_length = cmd->data_length;
150 __entry->task_attribute = cmd->sam_task_attr; 150 __entry->task_attribute = cmd->sam_task_attr;
@@ -182,7 +182,7 @@ TRACE_EVENT(target_cmd_complete,
182 ), 182 ),
183 183
184 TP_fast_assign( 184 TP_fast_assign(
185 __entry->unpacked_lun = cmd->se_lun->unpacked_lun; 185 __entry->unpacked_lun = cmd->orig_fe_lun;
186 __entry->opcode = cmd->t_task_cdb[0]; 186 __entry->opcode = cmd->t_task_cdb[0];
187 __entry->data_length = cmd->data_length; 187 __entry->data_length = cmd->data_length;
188 __entry->task_attribute = cmd->sam_task_attr; 188 __entry->task_attribute = cmd->sam_task_attr;
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index 63cfcccaebb3..132a985aba8b 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -202,7 +202,7 @@ TRACE_EVENT(mm_shrink_slab_start,
202 202
203 TP_fast_assign( 203 TP_fast_assign(
204 __entry->shr = shr; 204 __entry->shr = shr;
205 __entry->shrink = shr->shrink; 205 __entry->shrink = shr->scan_objects;
206 __entry->nr_objects_to_shrink = nr_objects_to_shrink; 206 __entry->nr_objects_to_shrink = nr_objects_to_shrink;
207 __entry->gfp_flags = sc->gfp_mask; 207 __entry->gfp_flags = sc->gfp_mask;
208 __entry->pgs_scanned = pgs_scanned; 208 __entry->pgs_scanned = pgs_scanned;
@@ -241,7 +241,7 @@ TRACE_EVENT(mm_shrink_slab_end,
241 241
242 TP_fast_assign( 242 TP_fast_assign(
243 __entry->shr = shr; 243 __entry->shr = shr;
244 __entry->shrink = shr->shrink; 244 __entry->shrink = shr->scan_objects;
245 __entry->unused_scan = unused_scan_cnt; 245 __entry->unused_scan = unused_scan_cnt;
246 __entry->new_scan = new_scan_cnt; 246 __entry->new_scan = new_scan_cnt;
247 __entry->retval = shrinker_retval; 247 __entry->retval = shrinker_retval;
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 41a6643e2136..5c7ab17cbb02 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -507,8 +507,14 @@ static inline notrace int ftrace_get_offsets_##call( \
507#undef TP_fast_assign 507#undef TP_fast_assign
508#define TP_fast_assign(args...) args 508#define TP_fast_assign(args...) args
509 509
510#undef TP_perf_assign 510#undef __perf_addr
511#define TP_perf_assign(args...) 511#define __perf_addr(a) (a)
512
513#undef __perf_count
514#define __perf_count(c) (c)
515
516#undef __perf_task
517#define __perf_task(t) (t)
512 518
513#undef DECLARE_EVENT_CLASS 519#undef DECLARE_EVENT_CLASS
514#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 520#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
@@ -636,16 +642,13 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
636#define __get_str(field) (char *)__get_dynamic_array(field) 642#define __get_str(field) (char *)__get_dynamic_array(field)
637 643
638#undef __perf_addr 644#undef __perf_addr
639#define __perf_addr(a) __addr = (a) 645#define __perf_addr(a) (__addr = (a))
640 646
641#undef __perf_count 647#undef __perf_count
642#define __perf_count(c) __count = (c) 648#define __perf_count(c) (__count = (c))
643 649
644#undef __perf_task 650#undef __perf_task
645#define __perf_task(t) __task = (t) 651#define __perf_task(t) (__task = (t))
646
647#undef TP_perf_assign
648#define TP_perf_assign(args...) args
649 652
650#undef DECLARE_EVENT_CLASS 653#undef DECLARE_EVENT_CLASS
651#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 654#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
@@ -663,15 +666,20 @@ perf_trace_##call(void *__data, proto) \
663 int __data_size; \ 666 int __data_size; \
664 int rctx; \ 667 int rctx; \
665 \ 668 \
666 perf_fetch_caller_regs(&__regs); \
667 \
668 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ 669 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
670 \
671 head = this_cpu_ptr(event_call->perf_events); \
672 if (__builtin_constant_p(!__task) && !__task && \
673 hlist_empty(head)) \
674 return; \
675 \
669 __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ 676 __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\
670 sizeof(u64)); \ 677 sizeof(u64)); \
671 __entry_size -= sizeof(u32); \ 678 __entry_size -= sizeof(u32); \
672 \ 679 \
673 entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \ 680 perf_fetch_caller_regs(&__regs); \
674 __entry_size, event_call->event.type, &__regs, &rctx); \ 681 entry = perf_trace_buf_prepare(__entry_size, \
682 event_call->event.type, &__regs, &rctx); \
675 if (!entry) \ 683 if (!entry) \
676 return; \ 684 return; \
677 \ 685 \
@@ -679,7 +687,6 @@ perf_trace_##call(void *__data, proto) \
679 \ 687 \
680 { assign; } \ 688 { assign; } \
681 \ 689 \
682 head = this_cpu_ptr(event_call->perf_events); \
683 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ 690 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \
684 __count, &__regs, head, __task); \ 691 __count, &__regs, head, __task); \
685} 692}
diff --git a/include/uapi/drm/Kbuild b/include/uapi/drm/Kbuild
index 119487e05e65..2d9a25daab05 100644
--- a/include/uapi/drm/Kbuild
+++ b/include/uapi/drm/Kbuild
@@ -16,3 +16,4 @@ header-y += sis_drm.h
16header-y += tegra_drm.h 16header-y += tegra_drm.h
17header-y += via_drm.h 17header-y += via_drm.h
18header-y += vmwgfx_drm.h 18header-y += vmwgfx_drm.h
19header-y += msm_drm.h
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 238a166b9fe6..ece867889cc7 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -181,7 +181,7 @@ enum drm_map_type {
181 _DRM_AGP = 3, /**< AGP/GART */ 181 _DRM_AGP = 3, /**< AGP/GART */
182 _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ 182 _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */
183 _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */ 183 _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */
184 _DRM_GEM = 6, /**< GEM object */ 184 _DRM_GEM = 6, /**< GEM object (obsolete) */
185}; 185};
186 186
187/** 187/**
@@ -780,6 +780,7 @@ struct drm_event_vblank {
780#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 780#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
781#define DRM_CAP_PRIME 0x5 781#define DRM_CAP_PRIME 0x5
782#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 782#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
783#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
783 784
784#define DRM_PRIME_CAP_IMPORT 0x1 785#define DRM_PRIME_CAP_IMPORT 0x1
785#define DRM_PRIME_CAP_EXPORT 0x2 786#define DRM_PRIME_CAP_EXPORT 0x2
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 53db7cea373b..28acbaf4a81e 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -223,6 +223,8 @@ struct drm_mode_get_connector {
223 __u32 connection; 223 __u32 connection;
224 __u32 mm_width, mm_height; /**< HxW in millimeters */ 224 __u32 mm_width, mm_height; /**< HxW in millimeters */
225 __u32 subpixel; 225 __u32 subpixel;
226
227 __u32 pad;
226}; 228};
227 229
228#define DRM_MODE_PROP_PENDING (1<<0) 230#define DRM_MODE_PROP_PENDING (1<<0)
@@ -412,7 +414,8 @@ struct drm_mode_crtc_lut {
412}; 414};
413 415
414#define DRM_MODE_PAGE_FLIP_EVENT 0x01 416#define DRM_MODE_PAGE_FLIP_EVENT 0x01
415#define DRM_MODE_PAGE_FLIP_FLAGS DRM_MODE_PAGE_FLIP_EVENT 417#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
418#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_PAGE_FLIP_ASYNC)
416 419
417/* 420/*
418 * Request a page flip on the specified crtc. 421 * Request a page flip on the specified crtc.
@@ -426,11 +429,14 @@ struct drm_mode_crtc_lut {
426 * flip is already pending as the ioctl is called, EBUSY will be 429 * flip is already pending as the ioctl is called, EBUSY will be
427 * returned. 430 * returned.
428 * 431 *
429 * The ioctl supports one flag, DRM_MODE_PAGE_FLIP_EVENT, which will 432 * Flag DRM_MODE_PAGE_FLIP_EVENT requests that drm sends back a vblank
430 * request that drm sends back a vblank event (see drm.h: struct 433 * event (see drm.h: struct drm_event_vblank) when the page flip is
431 * drm_event_vblank) when the page flip is done. The user_data field 434 * done. The user_data field passed in with this ioctl will be
432 * passed in with this ioctl will be returned as the user_data field 435 * returned as the user_data field in the vblank event struct.
433 * in the vblank event struct. 436 *
437 * Flag DRM_MODE_PAGE_FLIP_ASYNC requests that the flip happen
438 * 'as soon as possible', meaning that it not delay waiting for vblank.
439 * This may cause tearing on the screen.
434 * 440 *
435 * The reserved field must be zero until we figure out something 441 * The reserved field must be zero until we figure out something
436 * clever to use it for. 442 * clever to use it for.
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 923ed7fe5775..55bb5729bd78 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -33,6 +33,30 @@
33 * subject to backwards-compatibility constraints. 33 * subject to backwards-compatibility constraints.
34 */ 34 */
35 35
36/**
37 * DOC: uevents generated by i915 on it's device node
38 *
39 * I915_L3_PARITY_UEVENT - Generated when the driver receives a parity mismatch
40 * event from the gpu l3 cache. Additional information supplied is ROW,
41 * BANK, SUBBANK of the affected cacheline. Userspace should keep track of
42 * these events and if a specific cache-line seems to have a persistent
43 * error remap it with the l3 remapping tool supplied in intel-gpu-tools.
44 * The value supplied with the event is always 1.
45 *
46 * I915_ERROR_UEVENT - Generated upon error detection, currently only via
47 * hangcheck. The error detection event is a good indicator of when things
48 * began to go badly. The value supplied with the event is a 1 upon error
49 * detection, and a 0 upon reset completion, signifying no more error
50 * exists. NOTE: Disabling hangcheck or reset via module parameter will
51 * cause the related events to not be seen.
52 *
53 * I915_RESET_UEVENT - Event is generated just before an attempt to reset the
54 * the GPU. The value supplied with the event is always 1. NOTE: Disable
55 * reset via module parameter will cause this event to not be seen.
56 */
57#define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR"
58#define I915_ERROR_UEVENT "ERROR"
59#define I915_RESET_UEVENT "RESET"
36 60
37/* Each region is a minimum of 16k, and there are at most 255 of them. 61/* Each region is a minimum of 16k, and there are at most 255 of them.
38 */ 62 */
@@ -310,6 +334,7 @@ typedef struct drm_i915_irq_wait {
310#define I915_PARAM_HAS_PINNED_BATCHES 24 334#define I915_PARAM_HAS_PINNED_BATCHES 24
311#define I915_PARAM_HAS_EXEC_NO_RELOC 25 335#define I915_PARAM_HAS_EXEC_NO_RELOC 25
312#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 336#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26
337#define I915_PARAM_HAS_WT 27
313 338
314typedef struct drm_i915_getparam { 339typedef struct drm_i915_getparam {
315 int param; 340 int param;
@@ -744,8 +769,32 @@ struct drm_i915_gem_busy {
744 __u32 busy; 769 __u32 busy;
745}; 770};
746 771
772/**
773 * I915_CACHING_NONE
774 *
775 * GPU access is not coherent with cpu caches. Default for machines without an
776 * LLC.
777 */
747#define I915_CACHING_NONE 0 778#define I915_CACHING_NONE 0
779/**
780 * I915_CACHING_CACHED
781 *
782 * GPU access is coherent with cpu caches and furthermore the data is cached in
783 * last-level caches shared between cpu cores and the gpu GT. Default on
784 * machines with HAS_LLC.
785 */
748#define I915_CACHING_CACHED 1 786#define I915_CACHING_CACHED 1
787/**
788 * I915_CACHING_DISPLAY
789 *
790 * Special GPU caching mode which is coherent with the scanout engines.
791 * Transparently falls back to I915_CACHING_NONE on platforms where no special
792 * cache mode (like write-through or gfdt flushing) is available. The kernel
793 * automatically sets this mode when using a buffer as a scanout target.
794 * Userspace can manually set this mode to avoid a costly stall and clflush in
795 * the hotpath of drawing the first frame.
796 */
797#define I915_CACHING_DISPLAY 2
749 798
750struct drm_i915_gem_caching { 799struct drm_i915_gem_caching {
751 /** 800 /**
diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h
new file mode 100644
index 000000000000..d3c62074016d
--- /dev/null
+++ b/include/uapi/drm/msm_drm.h
@@ -0,0 +1,207 @@
1/*
2 * Copyright (C) 2013 Red Hat
3 * Author: Rob Clark <robdclark@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that 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, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __MSM_DRM_H__
19#define __MSM_DRM_H__
20
21#include <stddef.h>
22#include <drm/drm.h>
23
24/* Please note that modifications to all structs defined here are
25 * subject to backwards-compatibility constraints:
26 * 1) Do not use pointers, use uint64_t instead for 32 bit / 64 bit
27 * user/kernel compatibility
28 * 2) Keep fields aligned to their size
29 * 3) Because of how drm_ioctl() works, we can add new fields at
30 * the end of an ioctl if some care is taken: drm_ioctl() will
31 * zero out the new fields at the tail of the ioctl, so a zero
32 * value should have a backwards compatible meaning. And for
33 * output params, userspace won't see the newly added output
34 * fields.. so that has to be somehow ok.
35 */
36
37#define MSM_PIPE_NONE 0x00
38#define MSM_PIPE_2D0 0x01
39#define MSM_PIPE_2D1 0x02
40#define MSM_PIPE_3D0 0x10
41
42/* timeouts are specified in clock-monotonic absolute times (to simplify
43 * restarting interrupted ioctls). The following struct is logically the
44 * same as 'struct timespec' but 32/64b ABI safe.
45 */
46struct drm_msm_timespec {
47 int64_t tv_sec; /* seconds */
48 int64_t tv_nsec; /* nanoseconds */
49};
50
51#define MSM_PARAM_GPU_ID 0x01
52#define MSM_PARAM_GMEM_SIZE 0x02
53
54struct drm_msm_param {
55 uint32_t pipe; /* in, MSM_PIPE_x */
56 uint32_t param; /* in, MSM_PARAM_x */
57 uint64_t value; /* out (get_param) or in (set_param) */
58};
59
60/*
61 * GEM buffers:
62 */
63
64#define MSM_BO_SCANOUT 0x00000001 /* scanout capable */
65#define MSM_BO_GPU_READONLY 0x00000002
66#define MSM_BO_CACHE_MASK 0x000f0000
67/* cache modes */
68#define MSM_BO_CACHED 0x00010000
69#define MSM_BO_WC 0x00020000
70#define MSM_BO_UNCACHED 0x00040000
71
72struct drm_msm_gem_new {
73 uint64_t size; /* in */
74 uint32_t flags; /* in, mask of MSM_BO_x */
75 uint32_t handle; /* out */
76};
77
78struct drm_msm_gem_info {
79 uint32_t handle; /* in */
80 uint32_t pad;
81 uint64_t offset; /* out, offset to pass to mmap() */
82};
83
84#define MSM_PREP_READ 0x01
85#define MSM_PREP_WRITE 0x02
86#define MSM_PREP_NOSYNC 0x04
87
88struct drm_msm_gem_cpu_prep {
89 uint32_t handle; /* in */
90 uint32_t op; /* in, mask of MSM_PREP_x */
91 struct drm_msm_timespec timeout; /* in */
92};
93
94struct drm_msm_gem_cpu_fini {
95 uint32_t handle; /* in */
96};
97
98/*
99 * Cmdstream Submission:
100 */
101
102/* The value written into the cmdstream is logically:
103 *
104 * ((relocbuf->gpuaddr + reloc_offset) << shift) | or
105 *
106 * When we have GPU's w/ >32bit ptrs, it should be possible to deal
107 * with this by emit'ing two reloc entries with appropriate shift
108 * values. Or a new MSM_SUBMIT_CMD_x type would also be an option.
109 *
110 * NOTE that reloc's must be sorted by order of increasing submit_offset,
111 * otherwise EINVAL.
112 */
113struct drm_msm_gem_submit_reloc {
114 uint32_t submit_offset; /* in, offset from submit_bo */
115 uint32_t or; /* in, value OR'd with result */
116 int32_t shift; /* in, amount of left shift (can be negative) */
117 uint32_t reloc_idx; /* in, index of reloc_bo buffer */
118 uint64_t reloc_offset; /* in, offset from start of reloc_bo */
119};
120
121/* submit-types:
122 * BUF - this cmd buffer is executed normally.
123 * IB_TARGET_BUF - this cmd buffer is an IB target. Reloc's are
124 * processed normally, but the kernel does not setup an IB to
125 * this buffer in the first-level ringbuffer
126 * CTX_RESTORE_BUF - only executed if there has been a GPU context
127 * switch since the last SUBMIT ioctl
128 */
129#define MSM_SUBMIT_CMD_BUF 0x0001
130#define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002
131#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
132struct drm_msm_gem_submit_cmd {
133 uint32_t type; /* in, one of MSM_SUBMIT_CMD_x */
134 uint32_t submit_idx; /* in, index of submit_bo cmdstream buffer */
135 uint32_t submit_offset; /* in, offset into submit_bo */
136 uint32_t size; /* in, cmdstream size */
137 uint32_t pad;
138 uint32_t nr_relocs; /* in, number of submit_reloc's */
139 uint64_t __user relocs; /* in, ptr to array of submit_reloc's */
140};
141
142/* Each buffer referenced elsewhere in the cmdstream submit (ie. the
143 * cmdstream buffer(s) themselves or reloc entries) has one (and only
144 * one) entry in the submit->bos[] table.
145 *
146 * As a optimization, the current buffer (gpu virtual address) can be
147 * passed back through the 'presumed' field. If on a subsequent reloc,
148 * userspace passes back a 'presumed' address that is still valid,
149 * then patching the cmdstream for this entry is skipped. This can
150 * avoid kernel needing to map/access the cmdstream bo in the common
151 * case.
152 */
153#define MSM_SUBMIT_BO_READ 0x0001
154#define MSM_SUBMIT_BO_WRITE 0x0002
155struct drm_msm_gem_submit_bo {
156 uint32_t flags; /* in, mask of MSM_SUBMIT_BO_x */
157 uint32_t handle; /* in, GEM handle */
158 uint64_t presumed; /* in/out, presumed buffer address */
159};
160
161/* Each cmdstream submit consists of a table of buffers involved, and
162 * one or more cmdstream buffers. This allows for conditional execution
163 * (context-restore), and IB buffers needed for per tile/bin draw cmds.
164 */
165struct drm_msm_gem_submit {
166 uint32_t pipe; /* in, MSM_PIPE_x */
167 uint32_t fence; /* out */
168 uint32_t nr_bos; /* in, number of submit_bo's */
169 uint32_t nr_cmds; /* in, number of submit_cmd's */
170 uint64_t __user bos; /* in, ptr to array of submit_bo's */
171 uint64_t __user cmds; /* in, ptr to array of submit_cmd's */
172};
173
174/* The normal way to synchronize with the GPU is just to CPU_PREP on
175 * a buffer if you need to access it from the CPU (other cmdstream
176 * submission from same or other contexts, PAGE_FLIP ioctl, etc, all
177 * handle the required synchronization under the hood). This ioctl
178 * mainly just exists as a way to implement the gallium pipe_fence
179 * APIs without requiring a dummy bo to synchronize on.
180 */
181struct drm_msm_wait_fence {
182 uint32_t fence; /* in */
183 uint32_t pad;
184 struct drm_msm_timespec timeout; /* in */
185};
186
187#define DRM_MSM_GET_PARAM 0x00
188/* placeholder:
189#define DRM_MSM_SET_PARAM 0x01
190 */
191#define DRM_MSM_GEM_NEW 0x02
192#define DRM_MSM_GEM_INFO 0x03
193#define DRM_MSM_GEM_CPU_PREP 0x04
194#define DRM_MSM_GEM_CPU_FINI 0x05
195#define DRM_MSM_GEM_SUBMIT 0x06
196#define DRM_MSM_WAIT_FENCE 0x07
197#define DRM_MSM_NUM_IOCTLS 0x08
198
199#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
200#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
201#define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)
202#define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep)
203#define DRM_IOCTL_MSM_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini)
204#define DRM_IOCTL_MSM_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit)
205#define DRM_IOCTL_MSM_WAIT_FENCE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence)
206
207#endif /* __MSM_DRM_H__ */
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
index 321d4ac5c512..46d41e8b0dcc 100644
--- a/include/uapi/drm/radeon_drm.h
+++ b/include/uapi/drm/radeon_drm.h
@@ -979,6 +979,8 @@ struct drm_radeon_cs {
979#define RADEON_INFO_RING_WORKING 0x15 979#define RADEON_INFO_RING_WORKING 0x15
980/* SI tile mode array */ 980/* SI tile mode array */
981#define RADEON_INFO_SI_TILE_MODE_ARRAY 0x16 981#define RADEON_INFO_SI_TILE_MODE_ARRAY 0x16
982/* query if CP DMA is supported on the compute ring */
983#define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17
982 984
983 985
984struct drm_radeon_info { 986struct drm_radeon_info {
@@ -1005,4 +1007,6 @@ struct drm_radeon_info {
1005#define SI_TILE_MODE_DEPTH_STENCIL_2D_4AA 3 1007#define SI_TILE_MODE_DEPTH_STENCIL_2D_4AA 3
1006#define SI_TILE_MODE_DEPTH_STENCIL_2D_8AA 2 1008#define SI_TILE_MODE_DEPTH_STENCIL_2D_8AA 2
1007 1009
1010#define CIK_TILE_MODE_DEPTH_STENCIL_1D 5
1011
1008#endif 1012#endif
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 997f9f2f0963..115add2515aa 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -227,6 +227,7 @@ header-y += kvm_para.h
227endif 227endif
228 228
229header-y += l2tp.h 229header-y += l2tp.h
230header-y += libc-compat.h
230header-y += limits.h 231header-y += limits.h
231header-y += llc.h 232header-y += llc.h
232header-y += loop.h 233header-y += loop.h
@@ -283,6 +284,7 @@ header-y += nfs_mount.h
283header-y += nfsacl.h 284header-y += nfsacl.h
284header-y += nl80211.h 285header-y += nl80211.h
285header-y += nubus.h 286header-y += nubus.h
287header-y += nvme.h
286header-y += nvram.h 288header-y += nvram.h
287header-y += omap3isp.h 289header-y += omap3isp.h
288header-y += omapfb.h 290header-y += omapfb.h
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index 05aed70627e2..45e618921c61 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -305,6 +305,31 @@ struct btrfs_ioctl_clone_range_args {
305#define BTRFS_DEFRAG_RANGE_COMPRESS 1 305#define BTRFS_DEFRAG_RANGE_COMPRESS 1
306#define BTRFS_DEFRAG_RANGE_START_IO 2 306#define BTRFS_DEFRAG_RANGE_START_IO 2
307 307
308#define BTRFS_SAME_DATA_DIFFERS 1
309/* For extent-same ioctl */
310struct btrfs_ioctl_same_extent_info {
311 __s64 fd; /* in - destination file */
312 __u64 logical_offset; /* in - start of extent in destination */
313 __u64 bytes_deduped; /* out - total # of bytes we were able
314 * to dedupe from this file */
315 /* status of this dedupe operation:
316 * 0 if dedup succeeds
317 * < 0 for error
318 * == BTRFS_SAME_DATA_DIFFERS if data differs
319 */
320 __s32 status; /* out - see above description */
321 __u32 reserved;
322};
323
324struct btrfs_ioctl_same_args {
325 __u64 logical_offset; /* in - start of extent in source */
326 __u64 length; /* in - length of extent */
327 __u16 dest_count; /* in - total elements in info array */
328 __u16 reserved1;
329 __u32 reserved2;
330 struct btrfs_ioctl_same_extent_info info[0];
331};
332
308struct btrfs_ioctl_space_info { 333struct btrfs_ioctl_space_info {
309 __u64 flags; 334 __u64 flags;
310 __u64 total_bytes; 335 __u64 total_bytes;
@@ -524,7 +549,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
524 struct btrfs_ioctl_search_args) 549 struct btrfs_ioctl_search_args)
525#define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \ 550#define BTRFS_IOC_INO_LOOKUP _IOWR(BTRFS_IOCTL_MAGIC, 18, \
526 struct btrfs_ioctl_ino_lookup_args) 551 struct btrfs_ioctl_ino_lookup_args)
527#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, u64) 552#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)
528#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \ 553#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \
529 struct btrfs_ioctl_space_args) 554 struct btrfs_ioctl_space_args)
530#define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64) 555#define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)
@@ -579,4 +604,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
579 struct btrfs_ioctl_get_dev_stats) 604 struct btrfs_ioctl_get_dev_stats)
580#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \ 605#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \
581 struct btrfs_ioctl_dev_replace_args) 606 struct btrfs_ioctl_dev_replace_args)
607#define BTRFS_IOC_FILE_EXTENT_SAME _IOWR(BTRFS_IOCTL_MAGIC, 54, \
608 struct btrfs_ioctl_same_args)
609
582#endif /* _UAPI_LINUX_BTRFS_H */ 610#endif /* _UAPI_LINUX_BTRFS_H */
diff --git a/include/uapi/linux/can/gw.h b/include/uapi/linux/can/gw.h
index ae07bec74f4b..4e27c82b564a 100644
--- a/include/uapi/linux/can/gw.h
+++ b/include/uapi/linux/can/gw.h
@@ -45,6 +45,7 @@ enum {
45 CGW_DST_IF, /* ifindex of destination network interface */ 45 CGW_DST_IF, /* ifindex of destination network interface */
46 CGW_FILTER, /* specify struct can_filter on source CAN device */ 46 CGW_FILTER, /* specify struct can_filter on source CAN device */
47 CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */ 47 CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */
48 CGW_LIM_HOPS, /* limit the number of hops of this specific rule */
48 __CGW_MAX 49 __CGW_MAX
49}; 50};
50 51
@@ -116,13 +117,19 @@ enum {
116 * Sets a CAN receive filter for the gateway job specified by the 117 * Sets a CAN receive filter for the gateway job specified by the
117 * struct can_filter described in include/linux/can.h 118 * struct can_filter described in include/linux/can.h
118 * 119 *
119 * CGW_MOD_XXX (length 17 bytes): 120 * CGW_MOD_(AND|OR|XOR|SET) (length 17 bytes):
120 * Specifies a modification that's done to a received CAN frame before it is 121 * Specifies a modification that's done to a received CAN frame before it is
121 * send out to the destination interface. 122 * send out to the destination interface.
122 * 123 *
123 * <struct can_frame> data used as operator 124 * <struct can_frame> data used as operator
124 * <u8> affected CAN frame elements 125 * <u8> affected CAN frame elements
125 * 126 *
127 * CGW_LIM_HOPS (length 1 byte):
128 * Limit the number of hops of this specific rule. Usually the received CAN
129 * frame can be processed as much as 'max_hops' times (which is given at module
130 * load time of the can-gw module). This value is used to reduce the number of
131 * possible hops for this gateway rule to a value smaller then max_hops.
132 *
126 * CGW_CS_XOR (length 4 bytes): 133 * CGW_CS_XOR (length 4 bytes):
127 * Set a simple XOR checksum starting with an initial value into 134 * Set a simple XOR checksum starting with an initial value into
128 * data[result-idx] using data[start-idx] .. data[end-idx] 135 * data[result-idx] using data[start-idx] .. data[end-idx]
diff --git a/include/uapi/linux/cifs/cifs_mount.h b/include/uapi/linux/cifs/cifs_mount.h
new file mode 100644
index 000000000000..d7e4c6ce6171
--- /dev/null
+++ b/include/uapi/linux/cifs/cifs_mount.h
@@ -0,0 +1,27 @@
1/*
2 * include/uapi/linux/cifs/cifs_mount.h
3 *
4 * Author(s): Scott Lovenberg (scott.lovenberg@gmail.com)
5 *
6 * This library is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
10 *
11 * This library 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
14 * the GNU Lesser General Public License for more details.
15 */
16#ifndef _CIFS_MOUNT_H
17#define _CIFS_MOUNT_H
18
19/* Max string lengths for cifs mounting options. */
20#define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */
21#define CIFS_MAX_USERNAME_LEN 256 /* reasonable max for current servers */
22#define CIFS_MAX_PASSWORD_LEN 512 /* Windows max seems to be 256 wide chars */
23#define CIFS_MAX_SHARE_LEN 256 /* reasonable max share name length */
24#define CIFS_NI_MAXHOST 1024 /* max host name length (256 * 4 bytes) */
25
26
27#endif /* _CIFS_MOUNT_H */
diff --git a/include/uapi/linux/dm-ioctl.h b/include/uapi/linux/dm-ioctl.h
index afd0cbd52edb..f1e12bd40b3b 100644
--- a/include/uapi/linux/dm-ioctl.h
+++ b/include/uapi/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 25 270#define DM_VERSION_MINOR 26
271#define DM_VERSION_PATCHLEVEL 0 271#define DM_VERSION_PATCHLEVEL 0
272#define DM_VERSION_EXTRA "-ioctl (2013-06-26)" 272#define DM_VERSION_EXTRA "-ioctl (2013-08-15)"
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/uapi/linux/dn.h b/include/uapi/linux/dn.h
index 9c50445462d9..5fbdd3d49eba 100644
--- a/include/uapi/linux/dn.h
+++ b/include/uapi/linux/dn.h
@@ -2,6 +2,7 @@
2#define _LINUX_DN_H 2#define _LINUX_DN_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/if_ether.h>
5 6
6/* 7/*
7 8
@@ -120,7 +121,7 @@ struct linkinfo_dn {
120 * Ethernet address format (for DECnet) 121 * Ethernet address format (for DECnet)
121 */ 122 */
122union etheraddress { 123union etheraddress {
123 __u8 dne_addr[6]; /* Full ethernet address */ 124 __u8 dne_addr[ETH_ALEN]; /* Full ethernet address */
124 struct { 125 struct {
125 __u8 dne_hiord[4]; /* DECnet HIORD prefix */ 126 __u8 dne_hiord[4]; /* DECnet HIORD prefix */
126 __u8 dne_nodeaddr[2]; /* DECnet node address */ 127 __u8 dne_nodeaddr[2]; /* DECnet node address */
diff --git a/include/uapi/linux/dqblk_xfs.h b/include/uapi/linux/dqblk_xfs.h
index 86552807aed9..dcd75cc26196 100644
--- a/include/uapi/linux/dqblk_xfs.h
+++ b/include/uapi/linux/dqblk_xfs.h
@@ -38,6 +38,7 @@
38#define Q_XGETQSTAT XQM_CMD(5) /* get quota subsystem status */ 38#define Q_XGETQSTAT XQM_CMD(5) /* get quota subsystem status */
39#define Q_XQUOTARM XQM_CMD(6) /* free disk space used by dquots */ 39#define Q_XQUOTARM XQM_CMD(6) /* free disk space used by dquots */
40#define Q_XQUOTASYNC XQM_CMD(7) /* delalloc flush, updates dquots */ 40#define Q_XQUOTASYNC XQM_CMD(7) /* delalloc flush, updates dquots */
41#define Q_XGETQSTATV XQM_CMD(8) /* newer version of get quota */
41 42
42/* 43/*
43 * fs_disk_quota structure: 44 * fs_disk_quota structure:
@@ -163,4 +164,50 @@ typedef struct fs_quota_stat {
163 __u16 qs_iwarnlimit; /* limit for num warnings */ 164 __u16 qs_iwarnlimit; /* limit for num warnings */
164} fs_quota_stat_t; 165} fs_quota_stat_t;
165 166
167/*
168 * fs_quota_statv is used by Q_XGETQSTATV for a given file system. It provides
169 * a centralized way to get meta information about the quota subsystem. eg.
170 * space taken up for user, group, and project quotas, number of dquots
171 * currently incore.
172 *
173 * This version has proper versioning support with appropriate padding for
174 * future expansions, and ability to expand for future without creating any
175 * backward compatibility issues.
176 *
177 * Q_XGETQSTATV uses the passed in value of the requested version via
178 * fs_quota_statv.qs_version to determine the return data layout of
179 * fs_quota_statv. The kernel will fill the data fields relevant to that
180 * version.
181 *
182 * If kernel does not support user space caller specified version, EINVAL will
183 * be returned. User space caller can then reduce the version number and retry
184 * the same command.
185 */
186#define FS_QSTATV_VERSION1 1 /* fs_quota_statv.qs_version */
187/*
188 * Some basic information about 'quota files' for Q_XGETQSTATV command
189 */
190struct fs_qfilestatv {
191 __u64 qfs_ino; /* inode number */
192 __u64 qfs_nblks; /* number of BBs 512-byte-blks */
193 __u32 qfs_nextents; /* number of extents */
194 __u32 qfs_pad; /* pad for 8-byte alignment */
195};
196
197struct fs_quota_statv {
198 __s8 qs_version; /* version for future changes */
199 __u8 qs_pad1; /* pad for 16bit alignment */
200 __u16 qs_flags; /* FS_QUOTA_.* flags */
201 __u32 qs_incoredqs; /* number of dquots incore */
202 struct fs_qfilestatv qs_uquota; /* user quota information */
203 struct fs_qfilestatv qs_gquota; /* group quota information */
204 struct fs_qfilestatv qs_pquota; /* project quota information */
205 __s32 qs_btimelimit; /* limit for blks timer */
206 __s32 qs_itimelimit; /* limit for inodes timer */
207 __s32 qs_rtbtimelimit;/* limit for rt blks timer */
208 __u16 qs_bwarnlimit; /* limit for num warnings */
209 __u16 qs_iwarnlimit; /* limit for num warnings */
210 __u64 qs_pad2[8]; /* for future proofing */
211};
212
166#endif /* _LINUX_DQBLK_XFS_H */ 213#endif /* _LINUX_DQBLK_XFS_H */
diff --git a/include/uapi/linux/elf-em.h b/include/uapi/linux/elf-em.h
index 8e2b7bac4378..59c17a2d38ad 100644
--- a/include/uapi/linux/elf-em.h
+++ b/include/uapi/linux/elf-em.h
@@ -22,6 +22,7 @@
22#define EM_PPC 20 /* PowerPC */ 22#define EM_PPC 20 /* PowerPC */
23#define EM_PPC64 21 /* PowerPC64 */ 23#define EM_PPC64 21 /* PowerPC64 */
24#define EM_SPU 23 /* Cell BE SPU */ 24#define EM_SPU 23 /* Cell BE SPU */
25#define EM_ARM 40 /* ARM 32 bit */
25#define EM_SH 42 /* SuperH */ 26#define EM_SH 42 /* SuperH */
26#define EM_SPARCV9 43 /* SPARC v9 64-bit */ 27#define EM_SPARCV9 43 /* SPARC v9 64-bit */
27#define EM_IA_64 50 /* HP/Intel IA-64 */ 28#define EM_IA_64 50 /* HP/Intel IA-64 */
@@ -34,6 +35,7 @@
34#define EM_MN10300 89 /* Panasonic/MEI MN10300, AM33 */ 35#define EM_MN10300 89 /* Panasonic/MEI MN10300, AM33 */
35#define EM_BLACKFIN 106 /* ADI Blackfin Processor */ 36#define EM_BLACKFIN 106 /* ADI Blackfin Processor */
36#define EM_TI_C6000 140 /* TI C6X DSPs */ 37#define EM_TI_C6000 140 /* TI C6X DSPs */
38#define EM_AARCH64 183 /* ARM 64 bit */
37#define EM_FRV 0x5441 /* Fujitsu FR-V */ 39#define EM_FRV 0x5441 /* Fujitsu FR-V */
38#define EM_AVR32 0x18ad /* Atmel AVR32 */ 40#define EM_AVR32 0x18ad /* Atmel AVR32 */
39 41
diff --git a/include/uapi/linux/fib_rules.h b/include/uapi/linux/fib_rules.h
index 51da65b68b85..2b82d7e30974 100644
--- a/include/uapi/linux/fib_rules.h
+++ b/include/uapi/linux/fib_rules.h
@@ -44,8 +44,8 @@ enum {
44 FRA_FWMARK, /* mark */ 44 FRA_FWMARK, /* mark */
45 FRA_FLOW, /* flow/class id */ 45 FRA_FLOW, /* flow/class id */
46 FRA_UNUSED6, 46 FRA_UNUSED6,
47 FRA_UNUSED7, 47 FRA_SUPPRESS_IFGROUP,
48 FRA_UNUSED8, 48 FRA_SUPPRESS_PREFIXLEN,
49 FRA_TABLE, /* Extended table id */ 49 FRA_TABLE, /* Extended table id */
50 FRA_FWMASK, /* mask for netfilter mark */ 50 FRA_FWMASK, /* mask for netfilter mark */
51 FRA_OIFNAME, 51 FRA_OIFNAME,
diff --git a/include/uapi/linux/fiemap.h b/include/uapi/linux/fiemap.h
index d830747f5c0b..0c51d617dae9 100644
--- a/include/uapi/linux/fiemap.h
+++ b/include/uapi/linux/fiemap.h
@@ -40,6 +40,7 @@ struct fiemap {
40 40
41#define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */ 41#define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */
42#define FIEMAP_FLAG_XATTR 0x00000002 /* map extended attribute tree */ 42#define FIEMAP_FLAG_XATTR 0x00000002 /* map extended attribute tree */
43#define FIEMAP_FLAG_CACHE 0x00000004 /* request caching of the extents */
43 44
44#define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR) 45#define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR)
45 46
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
index a4ed56cf0eac..6c28b61bb690 100644
--- a/include/uapi/linux/fs.h
+++ b/include/uapi/linux/fs.h
@@ -49,9 +49,9 @@ struct files_stat_struct {
49}; 49};
50 50
51struct inodes_stat_t { 51struct inodes_stat_t {
52 int nr_inodes; 52 long nr_inodes;
53 int nr_unused; 53 long nr_unused;
54 int dummy[5]; /* padding for sysctl ABI compatibility */ 54 long dummy[5]; /* padding for sysctl ABI compatibility */
55}; 55};
56 56
57 57
diff --git a/include/uapi/linux/icmpv6.h b/include/uapi/linux/icmpv6.h
index e0133c73c304..590beda78ea0 100644
--- a/include/uapi/linux/icmpv6.h
+++ b/include/uapi/linux/icmpv6.h
@@ -115,6 +115,8 @@ struct icmp6hdr {
115#define ICMPV6_NOT_NEIGHBOUR 2 115#define ICMPV6_NOT_NEIGHBOUR 2
116#define ICMPV6_ADDR_UNREACH 3 116#define ICMPV6_ADDR_UNREACH 3
117#define ICMPV6_PORT_UNREACH 4 117#define ICMPV6_PORT_UNREACH 4
118#define ICMPV6_POLICY_FAIL 5
119#define ICMPV6_REJECT_ROUTE 6
118 120
119/* 121/*
120 * Codes for Time Exceeded 122 * Codes for Time Exceeded
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index 2d70d79ce2fd..39f621a9fe82 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -14,6 +14,7 @@
14#define _UAPI_LINUX_IF_BRIDGE_H 14#define _UAPI_LINUX_IF_BRIDGE_H
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/if_ether.h>
17 18
18#define SYSFS_BRIDGE_ATTR "bridge" 19#define SYSFS_BRIDGE_ATTR "bridge"
19#define SYSFS_BRIDGE_FDB "brforward" 20#define SYSFS_BRIDGE_FDB "brforward"
@@ -88,7 +89,7 @@ struct __port_info {
88}; 89};
89 90
90struct __fdb_entry { 91struct __fdb_entry {
91 __u8 mac_addr[6]; 92 __u8 mac_addr[ETH_ALEN];
92 __u8 port_no; 93 __u8 port_no;
93 __u8 is_local; 94 __u8 is_local;
94 __u32 ageing_timer_value; 95 __u32 ageing_timer_value;
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 03f6170ab337..80394e8dc3a3 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -143,6 +143,7 @@ enum {
143 IFLA_NUM_TX_QUEUES, 143 IFLA_NUM_TX_QUEUES,
144 IFLA_NUM_RX_QUEUES, 144 IFLA_NUM_RX_QUEUES,
145 IFLA_CARRIER, 145 IFLA_CARRIER,
146 IFLA_PHYS_PORT_ID,
146 __IFLA_MAX 147 __IFLA_MAX
147}; 148};
148 149
@@ -313,6 +314,8 @@ enum {
313 IFLA_VXLAN_L2MISS, 314 IFLA_VXLAN_L2MISS,
314 IFLA_VXLAN_L3MISS, 315 IFLA_VXLAN_L3MISS,
315 IFLA_VXLAN_PORT, /* destination port */ 316 IFLA_VXLAN_PORT, /* destination port */
317 IFLA_VXLAN_GROUP6,
318 IFLA_VXLAN_LOCAL6,
316 __IFLA_VXLAN_MAX 319 __IFLA_VXLAN_MAX
317}; 320};
318#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) 321#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
index b950c02030c0..dbf06667394b 100644
--- a/include/uapi/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
@@ -56,6 +56,7 @@ struct sockaddr_ll {
56#define PACKET_FANOUT_LB 1 56#define PACKET_FANOUT_LB 1
57#define PACKET_FANOUT_CPU 2 57#define PACKET_FANOUT_CPU 2
58#define PACKET_FANOUT_ROLLOVER 3 58#define PACKET_FANOUT_ROLLOVER 3
59#define PACKET_FANOUT_RND 4
59#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000 60#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000
60#define PACKET_FANOUT_FLAG_DEFRAG 0x8000 61#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
61 62
diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
index e36a4aecd311..e128769331b5 100644
--- a/include/uapi/linux/if_pppox.h
+++ b/include/uapi/linux/if_pppox.h
@@ -46,7 +46,7 @@ struct pppoe_addr {
46 * PPTP addressing definition 46 * PPTP addressing definition
47 */ 47 */
48struct pptp_addr { 48struct pptp_addr {
49 __be16 call_id; 49 __u16 call_id;
50 struct in_addr sin_addr; 50 struct in_addr sin_addr;
51}; 51};
52 52
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
index 82334f88967e..e9502dd1ee2c 100644
--- a/include/uapi/linux/if_tun.h
+++ b/include/uapi/linux/if_tun.h
@@ -56,6 +56,8 @@
56#define TUNGETVNETHDRSZ _IOR('T', 215, int) 56#define TUNGETVNETHDRSZ _IOR('T', 215, int)
57#define TUNSETVNETHDRSZ _IOW('T', 216, int) 57#define TUNSETVNETHDRSZ _IOW('T', 216, int)
58#define TUNSETQUEUE _IOW('T', 217, int) 58#define TUNSETQUEUE _IOW('T', 217, int)
59#define TUNSETIFINDEX _IOW('T', 218, unsigned int)
60#define TUNGETFILTER _IOR('T', 219, struct sock_fprog)
59 61
60/* TUNSETIFF ifr flags */ 62/* TUNSETIFF ifr flags */
61#define IFF_TUN 0x0001 63#define IFF_TUN 0x0001
@@ -70,6 +72,10 @@
70#define IFF_DETACH_QUEUE 0x0400 72#define IFF_DETACH_QUEUE 0x0400
71/* read-only flag */ 73/* read-only flag */
72#define IFF_PERSIST 0x0800 74#define IFF_PERSIST 0x0800
75#define IFF_NOFILTER 0x1000
76
77/* Socket options */
78#define TUN_TX_TIMESTAMP 1
73 79
74/* Features for GSO (TUNSETOFFLOAD). */ 80/* Features for GSO (TUNSETOFFLOAD). */
75#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ 81#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h
index 9edb441df827..f9e8e496ae5d 100644
--- a/include/uapi/linux/in.h
+++ b/include/uapi/linux/in.h
@@ -24,30 +24,53 @@
24/* Standard well-defined IP protocols. */ 24/* Standard well-defined IP protocols. */
25enum { 25enum {
26 IPPROTO_IP = 0, /* Dummy protocol for TCP */ 26 IPPROTO_IP = 0, /* Dummy protocol for TCP */
27#define IPPROTO_IP IPPROTO_IP
27 IPPROTO_ICMP = 1, /* Internet Control Message Protocol */ 28 IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
29#define IPPROTO_ICMP IPPROTO_ICMP
28 IPPROTO_IGMP = 2, /* Internet Group Management Protocol */ 30 IPPROTO_IGMP = 2, /* Internet Group Management Protocol */
31#define IPPROTO_IGMP IPPROTO_IGMP
29 IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */ 32 IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
33#define IPPROTO_IPIP IPPROTO_IPIP
30 IPPROTO_TCP = 6, /* Transmission Control Protocol */ 34 IPPROTO_TCP = 6, /* Transmission Control Protocol */
35#define IPPROTO_TCP IPPROTO_TCP
31 IPPROTO_EGP = 8, /* Exterior Gateway Protocol */ 36 IPPROTO_EGP = 8, /* Exterior Gateway Protocol */
37#define IPPROTO_EGP IPPROTO_EGP
32 IPPROTO_PUP = 12, /* PUP protocol */ 38 IPPROTO_PUP = 12, /* PUP protocol */
39#define IPPROTO_PUP IPPROTO_PUP
33 IPPROTO_UDP = 17, /* User Datagram Protocol */ 40 IPPROTO_UDP = 17, /* User Datagram Protocol */
41#define IPPROTO_UDP IPPROTO_UDP
34 IPPROTO_IDP = 22, /* XNS IDP protocol */ 42 IPPROTO_IDP = 22, /* XNS IDP protocol */
43#define IPPROTO_IDP IPPROTO_IDP
44 IPPROTO_TP = 29, /* SO Transport Protocol Class 4 */
45#define IPPROTO_TP IPPROTO_TP
35 IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */ 46 IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */
36 IPPROTO_RSVP = 46, /* RSVP protocol */ 47#define IPPROTO_DCCP IPPROTO_DCCP
48 IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
49#define IPPROTO_IPV6 IPPROTO_IPV6
50 IPPROTO_RSVP = 46, /* RSVP Protocol */
51#define IPPROTO_RSVP IPPROTO_RSVP
37 IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */ 52 IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */
38 53#define IPPROTO_GRE IPPROTO_GRE
39 IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */ 54 IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
40 55#define IPPROTO_ESP IPPROTO_ESP
41 IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */ 56 IPPROTO_AH = 51, /* Authentication Header protocol */
42 IPPROTO_AH = 51, /* Authentication Header protocol */ 57#define IPPROTO_AH IPPROTO_AH
43 IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */ 58 IPPROTO_MTP = 92, /* Multicast Transport Protocol */
44 IPPROTO_PIM = 103, /* Protocol Independent Multicast */ 59#define IPPROTO_MTP IPPROTO_MTP
45 60 IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */
46 IPPROTO_COMP = 108, /* Compression Header protocol */ 61#define IPPROTO_BEETPH IPPROTO_BEETPH
47 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */ 62 IPPROTO_ENCAP = 98, /* Encapsulation Header */
63#define IPPROTO_ENCAP IPPROTO_ENCAP
64 IPPROTO_PIM = 103, /* Protocol Independent Multicast */
65#define IPPROTO_PIM IPPROTO_PIM
66 IPPROTO_COMP = 108, /* Compression Header Protocol */
67#define IPPROTO_COMP IPPROTO_COMP
68 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
69#define IPPROTO_SCTP IPPROTO_SCTP
48 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */ 70 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
49 71#define IPPROTO_UDPLITE IPPROTO_UDPLITE
50 IPPROTO_RAW = 255, /* Raw IP packets */ 72 IPPROTO_RAW = 255, /* Raw IP packets */
73#define IPPROTO_RAW IPPROTO_RAW
51 IPPROTO_MAX 74 IPPROTO_MAX
52}; 75};
53 76
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
index 53b1d56a6e7f..440d5c479145 100644
--- a/include/uapi/linux/in6.h
+++ b/include/uapi/linux/in6.h
@@ -22,22 +22,30 @@
22#define _UAPI_LINUX_IN6_H 22#define _UAPI_LINUX_IN6_H
23 23
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/libc-compat.h>
25 26
26/* 27/*
27 * IPv6 address structure 28 * IPv6 address structure
28 */ 29 */
29 30
31#if __UAPI_DEF_IN6_ADDR
30struct in6_addr { 32struct in6_addr {
31 union { 33 union {
32 __u8 u6_addr8[16]; 34 __u8 u6_addr8[16];
35#if __UAPI_DEF_IN6_ADDR_ALT
33 __be16 u6_addr16[8]; 36 __be16 u6_addr16[8];
34 __be32 u6_addr32[4]; 37 __be32 u6_addr32[4];
38#endif
35 } in6_u; 39 } in6_u;
36#define s6_addr in6_u.u6_addr8 40#define s6_addr in6_u.u6_addr8
41#if __UAPI_DEF_IN6_ADDR_ALT
37#define s6_addr16 in6_u.u6_addr16 42#define s6_addr16 in6_u.u6_addr16
38#define s6_addr32 in6_u.u6_addr32 43#define s6_addr32 in6_u.u6_addr32
44#endif
39}; 45};
46#endif /* __UAPI_DEF_IN6_ADDR */
40 47
48#if __UAPI_DEF_SOCKADDR_IN6
41struct sockaddr_in6 { 49struct sockaddr_in6 {
42 unsigned short int sin6_family; /* AF_INET6 */ 50 unsigned short int sin6_family; /* AF_INET6 */
43 __be16 sin6_port; /* Transport layer port # */ 51 __be16 sin6_port; /* Transport layer port # */
@@ -45,7 +53,9 @@ struct sockaddr_in6 {
45 struct in6_addr sin6_addr; /* IPv6 address */ 53 struct in6_addr sin6_addr; /* IPv6 address */
46 __u32 sin6_scope_id; /* scope id (new in RFC2553) */ 54 __u32 sin6_scope_id; /* scope id (new in RFC2553) */
47}; 55};
56#endif /* __UAPI_DEF_SOCKADDR_IN6 */
48 57
58#if __UAPI_DEF_IPV6_MREQ
49struct ipv6_mreq { 59struct ipv6_mreq {
50 /* IPv6 multicast address of group */ 60 /* IPv6 multicast address of group */
51 struct in6_addr ipv6mr_multiaddr; 61 struct in6_addr ipv6mr_multiaddr;
@@ -53,6 +63,7 @@ struct ipv6_mreq {
53 /* local IPv6 address of interface */ 63 /* local IPv6 address of interface */
54 int ipv6mr_ifindex; 64 int ipv6mr_ifindex;
55}; 65};
66#endif /* __UAPI_DEF_IVP6_MREQ */
56 67
57#define ipv6mr_acaddr ipv6mr_multiaddr 68#define ipv6mr_acaddr ipv6mr_multiaddr
58 69
@@ -114,13 +125,24 @@ struct in6_flowlabel_req {
114/* 125/*
115 * IPV6 extension headers 126 * IPV6 extension headers
116 */ 127 */
117#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */ 128#if __UAPI_DEF_IPPROTO_V6
118#define IPPROTO_ROUTING 43 /* IPv6 routing header */ 129enum {
119#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */ 130 IPPROTO_HOPOPTS = 0, /* IPv6 hop-by-hop options */
120#define IPPROTO_ICMPV6 58 /* ICMPv6 */ 131#define IPPROTO_HOPOPTS IPPROTO_HOPOPTS
121#define IPPROTO_NONE 59 /* IPv6 no next header */ 132 IPPROTO_ROUTING = 43, /* IPv6 routing header */
122#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */ 133#define IPPROTO_ROUTING IPPROTO_ROUTING
123#define IPPROTO_MH 135 /* IPv6 mobility header */ 134 IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header */
135#define IPPROTO_FRAGMENT IPPROTO_FRAGMENT
136 IPPROTO_ICMPV6 = 58, /* ICMPv6 */
137#define IPPROTO_ICMPV6 IPPROTO_ICMPV6
138 IPPROTO_NONE = 59, /* IPv6 no next header */
139#define IPPROTO_NONE IPPROTO_NONE
140 IPPROTO_DSTOPTS = 60, /* IPv6 destination options */
141#define IPPROTO_DSTOPTS IPPROTO_DSTOPTS
142 IPPROTO_MH = 135, /* IPv6 mobility header */
143#define IPPROTO_MH IPPROTO_MH
144};
145#endif /* __UAPI_DEF_IPPROTO_V6 */
124 146
125/* 147/*
126 * IPv6 TLV options. 148 * IPv6 TLV options.
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
index d584047b072b..a3726275876d 100644
--- a/include/uapi/linux/input.h
+++ b/include/uapi/linux/input.h
@@ -152,6 +152,7 @@ struct input_keymap_entry {
152#define EVIOCGEFFECTS _IOR('E', 0x84, int) /* Report number of effects playable at the same time */ 152#define EVIOCGEFFECTS _IOR('E', 0x84, int) /* Report number of effects playable at the same time */
153 153
154#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */ 154#define EVIOCGRAB _IOW('E', 0x90, int) /* Grab/Release device */
155#define EVIOCREVOKE _IOW('E', 0x91, int) /* Revoke device access */
155 156
156#define EVIOCSCLOCKID _IOW('E', 0xa0, int) /* Set clockid to be used for timestamps */ 157#define EVIOCSCLOCKID _IOW('E', 0xa0, int) /* Set clockid to be used for timestamps */
157 158
@@ -194,6 +195,8 @@ struct input_keymap_entry {
194#define SYN_CONFIG 1 195#define SYN_CONFIG 1
195#define SYN_MT_REPORT 2 196#define SYN_MT_REPORT 2
196#define SYN_DROPPED 3 197#define SYN_DROPPED 3
198#define SYN_MAX 0xf
199#define SYN_CNT (SYN_MAX+1)
197 200
198/* 201/*
199 * Keys and buttons 202 * Keys and buttons
diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h
index 2fee45bdec0a..411959405ab6 100644
--- a/include/uapi/linux/ip.h
+++ b/include/uapi/linux/ip.h
@@ -162,6 +162,8 @@ enum
162 IPV4_DEVCONF_SRC_VMARK, 162 IPV4_DEVCONF_SRC_VMARK,
163 IPV4_DEVCONF_PROXY_ARP_PVLAN, 163 IPV4_DEVCONF_PROXY_ARP_PVLAN,
164 IPV4_DEVCONF_ROUTE_LOCALNET, 164 IPV4_DEVCONF_ROUTE_LOCALNET,
165 IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL,
166 IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL,
165 __IPV4_DEVCONF_MAX 167 __IPV4_DEVCONF_MAX
166}; 168};
167 169
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index 4bda4cf5b0f5..593b0e32d956 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -160,6 +160,9 @@ enum {
160 DEVCONF_ACCEPT_DAD, 160 DEVCONF_ACCEPT_DAD,
161 DEVCONF_FORCE_TLLAO, 161 DEVCONF_FORCE_TLLAO,
162 DEVCONF_NDISC_NOTIFY, 162 DEVCONF_NDISC_NOTIFY,
163 DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL,
164 DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL,
165 DEVCONF_SUPPRESS_FRAG_NDISC,
163 DEVCONF_MAX 166 DEVCONF_MAX
164}; 167};
165 168
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index acccd08be6c7..99c25338ede8 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -667,6 +667,7 @@ struct kvm_ppc_smmu_info {
667#define KVM_CAP_PPC_RTAS 91 667#define KVM_CAP_PPC_RTAS 91
668#define KVM_CAP_IRQ_XICS 92 668#define KVM_CAP_IRQ_XICS 92
669#define KVM_CAP_ARM_EL1_32BIT 93 669#define KVM_CAP_ARM_EL1_32BIT 93
670#define KVM_CAP_SPAPR_MULTITCE 94
670 671
671#ifdef KVM_CAP_IRQ_ROUTING 672#ifdef KVM_CAP_IRQ_ROUTING
672 673
diff --git a/include/uapi/linux/kvm_para.h b/include/uapi/linux/kvm_para.h
index cea2c5c72d26..2841f86eae0b 100644
--- a/include/uapi/linux/kvm_para.h
+++ b/include/uapi/linux/kvm_para.h
@@ -19,6 +19,7 @@
19#define KVM_HC_MMU_OP 2 19#define KVM_HC_MMU_OP 2
20#define KVM_HC_FEATURES 3 20#define KVM_HC_FEATURES 3
21#define KVM_HC_PPC_MAP_MAGIC_PAGE 4 21#define KVM_HC_PPC_MAP_MAGIC_PAGE 4
22#define KVM_HC_KICK_CPU 5
22 23
23/* 24/*
24 * hypercalls use architecture specific 25 * hypercalls use architecture specific
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
new file mode 100644
index 000000000000..335e8a7cad39
--- /dev/null
+++ b/include/uapi/linux/libc-compat.h
@@ -0,0 +1,103 @@
1/*
2 * Compatibility interface for userspace libc header coordination:
3 *
4 * Define compatibility macros that are used to control the inclusion or
5 * exclusion of UAPI structures and definitions in coordination with another
6 * userspace C library.
7 *
8 * This header is intended to solve the problem of UAPI definitions that
9 * conflict with userspace definitions. If a UAPI header has such conflicting
10 * definitions then the solution is as follows:
11 *
12 * * Synchronize the UAPI header and the libc headers so either one can be
13 * used and such that the ABI is preserved. If this is not possible then
14 * no simple compatibility interface exists (you need to write translating
15 * wrappers and rename things) and you can't use this interface.
16 *
17 * Then follow this process:
18 *
19 * (a) Include libc-compat.h in the UAPI header.
20 * e.g. #include <linux/libc-compat.h>
21 * This include must be as early as possible.
22 *
23 * (b) In libc-compat.h add enough code to detect that the comflicting
24 * userspace libc header has been included first.
25 *
26 * (c) If the userspace libc header has been included first define a set of
27 * guard macros of the form __UAPI_DEF_FOO and set their values to 1, else
28 * set their values to 0.
29 *
30 * (d) Back in the UAPI header with the conflicting definitions, guard the
31 * definitions with:
32 * #if __UAPI_DEF_FOO
33 * ...
34 * #endif
35 *
36 * This fixes the situation where the linux headers are included *after* the
37 * libc headers. To fix the problem with the inclusion in the other order the
38 * userspace libc headers must be fixed like this:
39 *
40 * * For all definitions that conflict with kernel definitions wrap those
41 * defines in the following:
42 * #if !__UAPI_DEF_FOO
43 * ...
44 * #endif
45 *
46 * This prevents the redefinition of a construct already defined by the kernel.
47 */
48#ifndef _UAPI_LIBC_COMPAT_H
49#define _UAPI_LIBC_COMPAT_H
50
51/* We have included glibc headers... */
52#if defined(__GLIBC__)
53
54/* Coordinate with glibc netinet/in.h header. */
55#if defined(_NETINET_IN_H)
56
57/* GLIBC headers included first so don't define anything
58 * that would already be defined. */
59#define __UAPI_DEF_IN6_ADDR 0
60/* The exception is the in6_addr macros which must be defined
61 * if the glibc code didn't define them. This guard matches
62 * the guard in glibc/inet/netinet/in.h which defines the
63 * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
64#if defined(__USE_MISC) || defined (__USE_GNU)
65#define __UAPI_DEF_IN6_ADDR_ALT 0
66#else
67#define __UAPI_DEF_IN6_ADDR_ALT 1
68#endif
69#define __UAPI_DEF_SOCKADDR_IN6 0
70#define __UAPI_DEF_IPV6_MREQ 0
71#define __UAPI_DEF_IPPROTO_V6 0
72
73#else
74
75/* Linux headers included first, and we must define everything
76 * we need. The expectation is that glibc will check the
77 * __UAPI_DEF_* defines and adjust appropriately. */
78#define __UAPI_DEF_IN6_ADDR 1
79/* We unconditionally define the in6_addr macros and glibc must
80 * coordinate. */
81#define __UAPI_DEF_IN6_ADDR_ALT 1
82#define __UAPI_DEF_SOCKADDR_IN6 1
83#define __UAPI_DEF_IPV6_MREQ 1
84#define __UAPI_DEF_IPPROTO_V6 1
85
86#endif /* _NETINET_IN_H */
87
88
89/* If we did not see any headers from any supported C libraries,
90 * or we are being included in the kernel, then define everything
91 * that we need. */
92#else /* !defined(__GLIBC__) */
93
94/* Definitions for in6.h */
95#define __UAPI_DEF_IN6_ADDR 1
96#define __UAPI_DEF_IN6_ADDR_ALT 1
97#define __UAPI_DEF_SOCKADDR_IN6 1
98#define __UAPI_DEF_IPV6_MREQ 1
99#define __UAPI_DEF_IPPROTO_V6 1
100
101#endif /* __GLIBC__ */
102
103#endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild
index 41115776d76f..174915420d3f 100644
--- a/include/uapi/linux/netfilter/Kbuild
+++ b/include/uapi/linux/netfilter/Kbuild
@@ -22,6 +22,7 @@ header-y += xt_CONNMARK.h
22header-y += xt_CONNSECMARK.h 22header-y += xt_CONNSECMARK.h
23header-y += xt_CT.h 23header-y += xt_CT.h
24header-y += xt_DSCP.h 24header-y += xt_DSCP.h
25header-y += xt_HMARK.h
25header-y += xt_IDLETIMER.h 26header-y += xt_IDLETIMER.h
26header-y += xt_LED.h 27header-y += xt_LED.h
27header-y += xt_LOG.h 28header-y += xt_LOG.h
@@ -68,6 +69,7 @@ header-y += xt_quota.h
68header-y += xt_rateest.h 69header-y += xt_rateest.h
69header-y += xt_realm.h 70header-y += xt_realm.h
70header-y += xt_recent.h 71header-y += xt_recent.h
72header-y += xt_rpfilter.h
71header-y += xt_sctp.h 73header-y += xt_sctp.h
72header-y += xt_set.h 74header-y += xt_set.h
73header-y += xt_socket.h 75header-y += xt_socket.h
diff --git a/include/uapi/linux/netfilter/nf_conntrack_common.h b/include/uapi/linux/netfilter/nf_conntrack_common.h
index d69483fb3825..8dd803818ebe 100644
--- a/include/uapi/linux/netfilter/nf_conntrack_common.h
+++ b/include/uapi/linux/netfilter/nf_conntrack_common.h
@@ -99,7 +99,8 @@ enum ip_conntrack_events {
99 IPCT_PROTOINFO, /* protocol information has changed */ 99 IPCT_PROTOINFO, /* protocol information has changed */
100 IPCT_HELPER, /* new helper has been set */ 100 IPCT_HELPER, /* new helper has been set */
101 IPCT_MARK, /* new mark has been set */ 101 IPCT_MARK, /* new mark has been set */
102 IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */ 102 IPCT_SEQADJ, /* sequence adjustment has changed */
103 IPCT_NATSEQADJ = IPCT_SEQADJ,
103 IPCT_SECMARK, /* new security mark has been set */ 104 IPCT_SECMARK, /* new security mark has been set */
104 IPCT_LABEL, /* new connlabel has been set */ 105 IPCT_LABEL, /* new connlabel has been set */
105}; 106};
diff --git a/include/uapi/linux/netfilter/nfnetlink_conntrack.h b/include/uapi/linux/netfilter/nfnetlink_conntrack.h
index 08fabc6c93f3..acad6c52a652 100644
--- a/include/uapi/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/uapi/linux/netfilter/nfnetlink_conntrack.h
@@ -42,8 +42,10 @@ enum ctattr_type {
42 CTA_ID, 42 CTA_ID,
43 CTA_NAT_DST, 43 CTA_NAT_DST,
44 CTA_TUPLE_MASTER, 44 CTA_TUPLE_MASTER,
45 CTA_NAT_SEQ_ADJ_ORIG, 45 CTA_SEQ_ADJ_ORIG,
46 CTA_NAT_SEQ_ADJ_REPLY, 46 CTA_NAT_SEQ_ADJ_ORIG = CTA_SEQ_ADJ_ORIG,
47 CTA_SEQ_ADJ_REPLY,
48 CTA_NAT_SEQ_ADJ_REPLY = CTA_SEQ_ADJ_REPLY,
47 CTA_SECMARK, /* obsolete */ 49 CTA_SECMARK, /* obsolete */
48 CTA_ZONE, 50 CTA_ZONE,
49 CTA_SECCTX, 51 CTA_SECCTX,
@@ -165,6 +167,15 @@ enum ctattr_protonat {
165}; 167};
166#define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1) 168#define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1)
167 169
170enum ctattr_seqadj {
171 CTA_SEQADJ_UNSPEC,
172 CTA_SEQADJ_CORRECTION_POS,
173 CTA_SEQADJ_OFFSET_BEFORE,
174 CTA_SEQADJ_OFFSET_AFTER,
175 __CTA_SEQADJ_MAX
176};
177#define CTA_SEQADJ_MAX (__CTA_SEQADJ_MAX - 1)
178
168enum ctattr_natseq { 179enum ctattr_natseq {
169 CTA_NAT_SEQ_UNSPEC, 180 CTA_NAT_SEQ_UNSPEC,
170 CTA_NAT_SEQ_CORRECTION_POS, 181 CTA_NAT_SEQ_CORRECTION_POS,
diff --git a/include/uapi/linux/netfilter/nfnetlink_queue.h b/include/uapi/linux/netfilter/nfnetlink_queue.h
index 3a9b92147339..0132bad79de7 100644
--- a/include/uapi/linux/netfilter/nfnetlink_queue.h
+++ b/include/uapi/linux/netfilter/nfnetlink_queue.h
@@ -46,6 +46,7 @@ enum nfqnl_attr_type {
46 NFQA_CT_INFO, /* enum ip_conntrack_info */ 46 NFQA_CT_INFO, /* enum ip_conntrack_info */
47 NFQA_CAP_LEN, /* __u32 length of captured packet */ 47 NFQA_CAP_LEN, /* __u32 length of captured packet */
48 NFQA_SKB_INFO, /* __u32 skb meta information */ 48 NFQA_SKB_INFO, /* __u32 skb meta information */
49 NFQA_EXP, /* nf_conntrack_netlink.h */
49 50
50 __NFQA_MAX 51 __NFQA_MAX
51}; 52};
diff --git a/include/linux/netfilter/xt_HMARK.h b/include/uapi/linux/netfilter/xt_HMARK.h
index 826fc5807577..826fc5807577 100644
--- a/include/linux/netfilter/xt_HMARK.h
+++ b/include/uapi/linux/netfilter/xt_HMARK.h
diff --git a/include/uapi/linux/netfilter/xt_SYNPROXY.h b/include/uapi/linux/netfilter/xt_SYNPROXY.h
new file mode 100644
index 000000000000..2d59fbaa93c6
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_SYNPROXY.h
@@ -0,0 +1,16 @@
1#ifndef _XT_SYNPROXY_H
2#define _XT_SYNPROXY_H
3
4#define XT_SYNPROXY_OPT_MSS 0x01
5#define XT_SYNPROXY_OPT_WSCALE 0x02
6#define XT_SYNPROXY_OPT_SACK_PERM 0x04
7#define XT_SYNPROXY_OPT_TIMESTAMP 0x08
8#define XT_SYNPROXY_OPT_ECN 0x10
9
10struct xt_synproxy_info {
11 __u8 options;
12 __u8 wscale;
13 __u16 mss;
14};
15
16#endif /* _XT_SYNPROXY_H */
diff --git a/include/linux/netfilter/xt_rpfilter.h b/include/uapi/linux/netfilter/xt_rpfilter.h
index 8358d4f71952..8358d4f71952 100644
--- a/include/linux/netfilter/xt_rpfilter.h
+++ b/include/uapi/linux/netfilter/xt_rpfilter.h
diff --git a/include/uapi/linux/netfilter_bridge/ebt_802_3.h b/include/uapi/linux/netfilter_bridge/ebt_802_3.h
index 5bf84912a082..f37522aade24 100644
--- a/include/uapi/linux/netfilter_bridge/ebt_802_3.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_802_3.h
@@ -2,6 +2,7 @@
2#define _UAPI__LINUX_BRIDGE_EBT_802_3_H 2#define _UAPI__LINUX_BRIDGE_EBT_802_3_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/if_ether.h>
5 6
6#define EBT_802_3_SAP 0x01 7#define EBT_802_3_SAP 0x01
7#define EBT_802_3_TYPE 0x02 8#define EBT_802_3_TYPE 0x02
@@ -42,8 +43,8 @@ struct hdr_ni {
42}; 43};
43 44
44struct ebt_802_3_hdr { 45struct ebt_802_3_hdr {
45 __u8 daddr[6]; 46 __u8 daddr[ETH_ALEN];
46 __u8 saddr[6]; 47 __u8 saddr[ETH_ALEN];
47 __be16 len; 48 __be16 len;
48 union { 49 union {
49 struct hdr_ui ui; 50 struct hdr_ui ui;
diff --git a/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h b/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h
index c6a204c97047..eac0f6548f47 100644
--- a/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h
+++ b/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h
@@ -2,6 +2,7 @@
2#define _IPT_CLUSTERIP_H_target 2#define _IPT_CLUSTERIP_H_target
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/if_ether.h>
5 6
6enum clusterip_hashmode { 7enum clusterip_hashmode {
7 CLUSTERIP_HASHMODE_SIP = 0, 8 CLUSTERIP_HASHMODE_SIP = 0,
@@ -22,7 +23,7 @@ struct ipt_clusterip_tgt_info {
22 __u32 flags; 23 __u32 flags;
23 24
24 /* only relevant for new ones */ 25 /* only relevant for new ones */
25 __u8 clustermac[6]; 26 __u8 clustermac[ETH_ALEN];
26 __u16 num_total_nodes; 27 __u16 num_total_nodes;
27 __u16 num_local_nodes; 28 __u16 num_local_nodes;
28 __u16 local_nodes[CLUSTERIP_MAX_NODES]; 29 __u16 local_nodes[CLUSTERIP_MAX_NODES];
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index 8137dd8d2adf..29bed72a4ac4 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -71,6 +71,20 @@
71 * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element. 71 * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element.
72 * @NFC_CMD_FW_DOWNLOAD: Request to Load/flash firmware, or event to inform 72 * @NFC_CMD_FW_DOWNLOAD: Request to Load/flash firmware, or event to inform
73 * that some firmware was loaded 73 * that some firmware was loaded
74 * @NFC_EVENT_SE_ADDED: Event emitted when a new secure element is discovered.
75 * This typically will be sent whenever a new NFC controller with either
76 * an embedded SE or an UICC one connected to it through SWP.
77 * @NFC_EVENT_SE_REMOVED: Event emitted when a secure element is removed from
78 * the system, as a consequence of e.g. an NFC controller being unplugged.
79 * @NFC_EVENT_SE_CONNECTIVITY: This event is emitted whenever a secure element
80 * is requesting connectivity access. For example a UICC SE may need to
81 * talk with a sleeping modem and will notify this need by sending this
82 * event. It is then up to userspace to decide if it will wake the modem
83 * up or not.
84 * @NFC_EVENT_SE_TRANSACTION: This event is sent when an application running on
85 * a specific SE notifies us about the end of a transaction. The parameter
86 * for this event is the application ID (AID).
87 * @NFC_CMD_GET_SE: Dump all discovered secure elements from an NFC controller.
74 */ 88 */
75enum nfc_commands { 89enum nfc_commands {
76 NFC_CMD_UNSPEC, 90 NFC_CMD_UNSPEC,
@@ -97,6 +111,9 @@ enum nfc_commands {
97 NFC_CMD_FW_DOWNLOAD, 111 NFC_CMD_FW_DOWNLOAD,
98 NFC_EVENT_SE_ADDED, 112 NFC_EVENT_SE_ADDED,
99 NFC_EVENT_SE_REMOVED, 113 NFC_EVENT_SE_REMOVED,
114 NFC_EVENT_SE_CONNECTIVITY,
115 NFC_EVENT_SE_TRANSACTION,
116 NFC_CMD_GET_SE,
100/* private: internal use only */ 117/* private: internal use only */
101 __NFC_CMD_AFTER_LAST 118 __NFC_CMD_AFTER_LAST
102}; 119};
@@ -129,6 +146,7 @@ enum nfc_commands {
129 * @NFC_ATTR_FIRMWARE_NAME: Free format firmware version 146 * @NFC_ATTR_FIRMWARE_NAME: Free format firmware version
130 * @NFC_ATTR_SE_INDEX: Secure element index 147 * @NFC_ATTR_SE_INDEX: Secure element index
131 * @NFC_ATTR_SE_TYPE: Secure element type (UICC or EMBEDDED) 148 * @NFC_ATTR_SE_TYPE: Secure element type (UICC or EMBEDDED)
149 * @NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS: Firmware download operation status
132 */ 150 */
133enum nfc_attrs { 151enum nfc_attrs {
134 NFC_ATTR_UNSPEC, 152 NFC_ATTR_UNSPEC,
@@ -154,6 +172,8 @@ enum nfc_attrs {
154 NFC_ATTR_FIRMWARE_NAME, 172 NFC_ATTR_FIRMWARE_NAME,
155 NFC_ATTR_SE_INDEX, 173 NFC_ATTR_SE_INDEX,
156 NFC_ATTR_SE_TYPE, 174 NFC_ATTR_SE_TYPE,
175 NFC_ATTR_SE_AID,
176 NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS,
157/* private: internal use only */ 177/* private: internal use only */
158 __NFC_ATTR_AFTER_LAST 178 __NFC_ATTR_AFTER_LAST
159}; 179};
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 861e5eba3953..fde2c021b26d 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -126,6 +126,31 @@
126 */ 126 */
127 127
128/** 128/**
129 * DOC: packet coalesce support
130 *
131 * In most cases, host that receives IPv4 and IPv6 multicast/broadcast
132 * packets does not do anything with these packets. Therefore the
133 * reception of these unwanted packets causes unnecessary processing
134 * and power consumption.
135 *
136 * Packet coalesce feature helps to reduce number of received interrupts
137 * to host by buffering these packets in firmware/hardware for some
138 * predefined time. Received interrupt will be generated when one of the
139 * following events occur.
140 * a) Expiration of hardware timer whose expiration time is set to maximum
141 * coalescing delay of matching coalesce rule.
142 * b) Coalescing buffer in hardware reaches it's limit.
143 * c) Packet doesn't match any of the configured coalesce rules.
144 *
145 * User needs to configure following parameters for creating a coalesce
146 * rule.
147 * a) Maximum coalescing delay
148 * b) List of packet patterns which needs to be matched
149 * c) Condition for coalescence. pattern 'match' or 'no match'
150 * Multiple such rules can be created.
151 */
152
153/**
129 * enum nl80211_commands - supported nl80211 commands 154 * enum nl80211_commands - supported nl80211 commands
130 * 155 *
131 * @NL80211_CMD_UNSPEC: unspecified command to catch errors 156 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
@@ -648,6 +673,19 @@
648 * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can 673 * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can
649 * return back to normal. 674 * return back to normal.
650 * 675 *
676 * @NL80211_CMD_GET_COALESCE: Get currently supported coalesce rules.
677 * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules.
678 *
679 * @NL80211_CMD_CHANNEL_SWITCH: Perform a channel switch by announcing the
680 * the new channel information (Channel Switch Announcement - CSA)
681 * in the beacon for some time (as defined in the
682 * %NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the
683 * new channel. Userspace provides the new channel information (using
684 * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel
685 * width). %NL80211_ATTR_CH_SWITCH_BLOCK_TX may be supplied to inform
686 * other station that transmission must be blocked until the channel
687 * switch is complete.
688 *
651 * @NL80211_CMD_MAX: highest used command number 689 * @NL80211_CMD_MAX: highest used command number
652 * @__NL80211_CMD_AFTER_LAST: internal use 690 * @__NL80211_CMD_AFTER_LAST: internal use
653 */ 691 */
@@ -810,6 +848,11 @@ enum nl80211_commands {
810 NL80211_CMD_CRIT_PROTOCOL_START, 848 NL80211_CMD_CRIT_PROTOCOL_START,
811 NL80211_CMD_CRIT_PROTOCOL_STOP, 849 NL80211_CMD_CRIT_PROTOCOL_STOP,
812 850
851 NL80211_CMD_GET_COALESCE,
852 NL80211_CMD_SET_COALESCE,
853
854 NL80211_CMD_CHANNEL_SWITCH,
855
813 /* add new commands above here */ 856 /* add new commands above here */
814 857
815 /* used to define NL80211_CMD_MAX below */ 858 /* used to define NL80211_CMD_MAX below */
@@ -1436,6 +1479,23 @@ enum nl80211_commands {
1436 * allowed to be used with the first @NL80211_CMD_SET_STATION command to 1479 * allowed to be used with the first @NL80211_CMD_SET_STATION command to
1437 * update a TDLS peer STA entry. 1480 * update a TDLS peer STA entry.
1438 * 1481 *
1482 * @NL80211_ATTR_COALESCE_RULE: Coalesce rule information.
1483 *
1484 * @NL80211_ATTR_CH_SWITCH_COUNT: u32 attribute specifying the number of TBTT's
1485 * until the channel switch event.
1486 * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission
1487 * must be blocked on the current channel (before the channel switch
1488 * operation).
1489 * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information
1490 * for the time while performing a channel switch.
1491 * @NL80211_ATTR_CSA_C_OFF_BEACON: Offset of the channel switch counter
1492 * field in the beacons tail (%NL80211_ATTR_BEACON_TAIL).
1493 * @NL80211_ATTR_CSA_C_OFF_PRESP: Offset of the channel switch counter
1494 * field in the probe response (%NL80211_ATTR_PROBE_RESP).
1495 *
1496 * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
1497 * As specified in the &enum nl80211_rxmgmt_flags.
1498 *
1439 * @NL80211_ATTR_MAX: highest attribute number currently defined 1499 * @NL80211_ATTR_MAX: highest attribute number currently defined
1440 * @__NL80211_ATTR_AFTER_LAST: internal use 1500 * @__NL80211_ATTR_AFTER_LAST: internal use
1441 */ 1501 */
@@ -1736,6 +1796,16 @@ enum nl80211_attrs {
1736 1796
1737 NL80211_ATTR_PEER_AID, 1797 NL80211_ATTR_PEER_AID,
1738 1798
1799 NL80211_ATTR_COALESCE_RULE,
1800
1801 NL80211_ATTR_CH_SWITCH_COUNT,
1802 NL80211_ATTR_CH_SWITCH_BLOCK_TX,
1803 NL80211_ATTR_CSA_IES,
1804 NL80211_ATTR_CSA_C_OFF_BEACON,
1805 NL80211_ATTR_CSA_C_OFF_PRESP,
1806
1807 NL80211_ATTR_RXMGMT_FLAGS,
1808
1739 /* add attributes here, update the policy in nl80211.c */ 1809 /* add attributes here, update the policy in nl80211.c */
1740 1810
1741 __NL80211_ATTR_AFTER_LAST, 1811 __NL80211_ATTR_AFTER_LAST,
@@ -2773,6 +2843,21 @@ enum nl80211_chan_width {
2773}; 2843};
2774 2844
2775/** 2845/**
2846 * enum nl80211_bss_scan_width - control channel width for a BSS
2847 *
2848 * These values are used with the %NL80211_BSS_CHAN_WIDTH attribute.
2849 *
2850 * @NL80211_BSS_CHAN_WIDTH_20: control channel is 20 MHz wide or compatible
2851 * @NL80211_BSS_CHAN_WIDTH_10: control channel is 10 MHz wide
2852 * @NL80211_BSS_CHAN_WIDTH_5: control channel is 5 MHz wide
2853 */
2854enum nl80211_bss_scan_width {
2855 NL80211_BSS_CHAN_WIDTH_20,
2856 NL80211_BSS_CHAN_WIDTH_10,
2857 NL80211_BSS_CHAN_WIDTH_5,
2858};
2859
2860/**
2776 * enum nl80211_bss - netlink attributes for a BSS 2861 * enum nl80211_bss - netlink attributes for a BSS
2777 * 2862 *
2778 * @__NL80211_BSS_INVALID: invalid 2863 * @__NL80211_BSS_INVALID: invalid
@@ -2796,6 +2881,8 @@ enum nl80211_chan_width {
2796 * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information 2881 * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information
2797 * elements from a Beacon frame (bin); not present if no Beacon frame has 2882 * elements from a Beacon frame (bin); not present if no Beacon frame has
2798 * yet been received 2883 * yet been received
2884 * @NL80211_BSS_CHAN_WIDTH: channel width of the control channel
2885 * (u32, enum nl80211_bss_scan_width)
2799 * @__NL80211_BSS_AFTER_LAST: internal 2886 * @__NL80211_BSS_AFTER_LAST: internal
2800 * @NL80211_BSS_MAX: highest BSS attribute 2887 * @NL80211_BSS_MAX: highest BSS attribute
2801 */ 2888 */
@@ -2812,6 +2899,7 @@ enum nl80211_bss {
2812 NL80211_BSS_STATUS, 2899 NL80211_BSS_STATUS,
2813 NL80211_BSS_SEEN_MS_AGO, 2900 NL80211_BSS_SEEN_MS_AGO,
2814 NL80211_BSS_BEACON_IES, 2901 NL80211_BSS_BEACON_IES,
2902 NL80211_BSS_CHAN_WIDTH,
2815 2903
2816 /* keep last */ 2904 /* keep last */
2817 __NL80211_BSS_AFTER_LAST, 2905 __NL80211_BSS_AFTER_LAST,
@@ -3060,11 +3148,11 @@ enum nl80211_tx_power_setting {
3060}; 3148};
3061 3149
3062/** 3150/**
3063 * enum nl80211_wowlan_packet_pattern_attr - WoWLAN packet pattern attribute 3151 * enum nl80211_packet_pattern_attr - packet pattern attribute
3064 * @__NL80211_WOWLAN_PKTPAT_INVALID: invalid number for nested attribute 3152 * @__NL80211_PKTPAT_INVALID: invalid number for nested attribute
3065 * @NL80211_WOWLAN_PKTPAT_PATTERN: the pattern, values where the mask has 3153 * @NL80211_PKTPAT_PATTERN: the pattern, values where the mask has
3066 * a zero bit are ignored 3154 * a zero bit are ignored
3067 * @NL80211_WOWLAN_PKTPAT_MASK: pattern mask, must be long enough to have 3155 * @NL80211_PKTPAT_MASK: pattern mask, must be long enough to have
3068 * a bit for each byte in the pattern. The lowest-order bit corresponds 3156 * a bit for each byte in the pattern. The lowest-order bit corresponds
3069 * to the first byte of the pattern, but the bytes of the pattern are 3157 * to the first byte of the pattern, but the bytes of the pattern are
3070 * in a little-endian-like format, i.e. the 9th byte of the pattern 3158 * in a little-endian-like format, i.e. the 9th byte of the pattern
@@ -3075,39 +3163,50 @@ enum nl80211_tx_power_setting {
3075 * Note that the pattern matching is done as though frames were not 3163 * Note that the pattern matching is done as though frames were not
3076 * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked 3164 * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
3077 * first (including SNAP header unpacking) and then matched. 3165 * first (including SNAP header unpacking) and then matched.
3078 * @NL80211_WOWLAN_PKTPAT_OFFSET: packet offset, pattern is matched after 3166 * @NL80211_PKTPAT_OFFSET: packet offset, pattern is matched after
3079 * these fixed number of bytes of received packet 3167 * these fixed number of bytes of received packet
3080 * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes 3168 * @NUM_NL80211_PKTPAT: number of attributes
3081 * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number 3169 * @MAX_NL80211_PKTPAT: max attribute number
3082 */ 3170 */
3083enum nl80211_wowlan_packet_pattern_attr { 3171enum nl80211_packet_pattern_attr {
3084 __NL80211_WOWLAN_PKTPAT_INVALID, 3172 __NL80211_PKTPAT_INVALID,
3085 NL80211_WOWLAN_PKTPAT_MASK, 3173 NL80211_PKTPAT_MASK,
3086 NL80211_WOWLAN_PKTPAT_PATTERN, 3174 NL80211_PKTPAT_PATTERN,
3087 NL80211_WOWLAN_PKTPAT_OFFSET, 3175 NL80211_PKTPAT_OFFSET,
3088 3176
3089 NUM_NL80211_WOWLAN_PKTPAT, 3177 NUM_NL80211_PKTPAT,
3090 MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1, 3178 MAX_NL80211_PKTPAT = NUM_NL80211_PKTPAT - 1,
3091}; 3179};
3092 3180
3093/** 3181/**
3094 * struct nl80211_wowlan_pattern_support - pattern support information 3182 * struct nl80211_pattern_support - packet pattern support information
3095 * @max_patterns: maximum number of patterns supported 3183 * @max_patterns: maximum number of patterns supported
3096 * @min_pattern_len: minimum length of each pattern 3184 * @min_pattern_len: minimum length of each pattern
3097 * @max_pattern_len: maximum length of each pattern 3185 * @max_pattern_len: maximum length of each pattern
3098 * @max_pkt_offset: maximum Rx packet offset 3186 * @max_pkt_offset: maximum Rx packet offset
3099 * 3187 *
3100 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when 3188 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
3101 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the 3189 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED or in
3102 * capability information given by the kernel to userspace. 3190 * %NL80211_ATTR_COALESCE_RULE_PKT_PATTERN when that is part of
3191 * %NL80211_ATTR_COALESCE_RULE in the capability information given
3192 * by the kernel to userspace.
3103 */ 3193 */
3104struct nl80211_wowlan_pattern_support { 3194struct nl80211_pattern_support {
3105 __u32 max_patterns; 3195 __u32 max_patterns;
3106 __u32 min_pattern_len; 3196 __u32 min_pattern_len;
3107 __u32 max_pattern_len; 3197 __u32 max_pattern_len;
3108 __u32 max_pkt_offset; 3198 __u32 max_pkt_offset;
3109} __attribute__((packed)); 3199} __attribute__((packed));
3110 3200
3201/* only for backward compatibility */
3202#define __NL80211_WOWLAN_PKTPAT_INVALID __NL80211_PKTPAT_INVALID
3203#define NL80211_WOWLAN_PKTPAT_MASK NL80211_PKTPAT_MASK
3204#define NL80211_WOWLAN_PKTPAT_PATTERN NL80211_PKTPAT_PATTERN
3205#define NL80211_WOWLAN_PKTPAT_OFFSET NL80211_PKTPAT_OFFSET
3206#define NUM_NL80211_WOWLAN_PKTPAT NUM_NL80211_PKTPAT
3207#define MAX_NL80211_WOWLAN_PKTPAT MAX_NL80211_PKTPAT
3208#define nl80211_wowlan_pattern_support nl80211_pattern_support
3209
3111/** 3210/**
3112 * enum nl80211_wowlan_triggers - WoWLAN trigger definitions 3211 * enum nl80211_wowlan_triggers - WoWLAN trigger definitions
3113 * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes 3212 * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes
@@ -3127,7 +3226,7 @@ struct nl80211_wowlan_pattern_support {
3127 * pattern matching is done after the packet is converted to the MSDU. 3226 * pattern matching is done after the packet is converted to the MSDU.
3128 * 3227 *
3129 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute 3228 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
3130 * carrying a &struct nl80211_wowlan_pattern_support. 3229 * carrying a &struct nl80211_pattern_support.
3131 * 3230 *
3132 * When reporting wakeup. it is a u32 attribute containing the 0-based 3231 * When reporting wakeup. it is a u32 attribute containing the 0-based
3133 * index of the pattern that caused the wakeup, in the patterns passed 3232 * index of the pattern that caused the wakeup, in the patterns passed
@@ -3284,7 +3383,7 @@ struct nl80211_wowlan_tcp_data_token_feature {
3284 * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a 3383 * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a
3285 * u32 attribute holding the maximum length 3384 * u32 attribute holding the maximum length
3286 * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for 3385 * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for
3287 * feature advertising. The mask works like @NL80211_WOWLAN_PKTPAT_MASK 3386 * feature advertising. The mask works like @NL80211_PKTPAT_MASK
3288 * but on the TCP payload only. 3387 * but on the TCP payload only.
3289 * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes 3388 * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes
3290 * @MAX_NL80211_WOWLAN_TCP: highest attribute number 3389 * @MAX_NL80211_WOWLAN_TCP: highest attribute number
@@ -3309,6 +3408,55 @@ enum nl80211_wowlan_tcp_attrs {
3309}; 3408};
3310 3409
3311/** 3410/**
3411 * struct nl80211_coalesce_rule_support - coalesce rule support information
3412 * @max_rules: maximum number of rules supported
3413 * @pat: packet pattern support information
3414 * @max_delay: maximum supported coalescing delay in msecs
3415 *
3416 * This struct is carried in %NL80211_ATTR_COALESCE_RULE in the
3417 * capability information given by the kernel to userspace.
3418 */
3419struct nl80211_coalesce_rule_support {
3420 __u32 max_rules;
3421 struct nl80211_pattern_support pat;
3422 __u32 max_delay;
3423} __attribute__((packed));
3424
3425/**
3426 * enum nl80211_attr_coalesce_rule - coalesce rule attribute
3427 * @__NL80211_COALESCE_RULE_INVALID: invalid number for nested attribute
3428 * @NL80211_ATTR_COALESCE_RULE_DELAY: delay in msecs used for packet coalescing
3429 * @NL80211_ATTR_COALESCE_RULE_CONDITION: condition for packet coalescence,
3430 * see &enum nl80211_coalesce_condition.
3431 * @NL80211_ATTR_COALESCE_RULE_PKT_PATTERN: packet offset, pattern is matched
3432 * after these fixed number of bytes of received packet
3433 * @NUM_NL80211_ATTR_COALESCE_RULE: number of attributes
3434 * @NL80211_ATTR_COALESCE_RULE_MAX: max attribute number
3435 */
3436enum nl80211_attr_coalesce_rule {
3437 __NL80211_COALESCE_RULE_INVALID,
3438 NL80211_ATTR_COALESCE_RULE_DELAY,
3439 NL80211_ATTR_COALESCE_RULE_CONDITION,
3440 NL80211_ATTR_COALESCE_RULE_PKT_PATTERN,
3441
3442 /* keep last */
3443 NUM_NL80211_ATTR_COALESCE_RULE,
3444 NL80211_ATTR_COALESCE_RULE_MAX = NUM_NL80211_ATTR_COALESCE_RULE - 1
3445};
3446
3447/**
3448 * enum nl80211_coalesce_condition - coalesce rule conditions
3449 * @NL80211_COALESCE_CONDITION_MATCH: coalaesce Rx packets when patterns
3450 * in a rule are matched.
3451 * @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns
3452 * in a rule are not matched.
3453 */
3454enum nl80211_coalesce_condition {
3455 NL80211_COALESCE_CONDITION_MATCH,
3456 NL80211_COALESCE_CONDITION_NO_MATCH
3457};
3458
3459/**
3312 * enum nl80211_iface_limit_attrs - limit attributes 3460 * enum nl80211_iface_limit_attrs - limit attributes
3313 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) 3461 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved)
3314 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that 3462 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that
@@ -3758,4 +3906,15 @@ enum nl80211_crit_proto_id {
3758/* maximum duration for critical protocol measures */ 3906/* maximum duration for critical protocol measures */
3759#define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */ 3907#define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */
3760 3908
3909/**
3910 * enum nl80211_rxmgmt_flags - flags for received management frame.
3911 *
3912 * Used by cfg80211_rx_mgmt()
3913 *
3914 * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver.
3915 */
3916enum nl80211_rxmgmt_flags {
3917 NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
3918};
3919
3761#endif /* __LINUX_NL80211_H */ 3920#endif /* __LINUX_NL80211_H */
diff --git a/include/uapi/linux/nvme.h b/include/uapi/linux/nvme.h
new file mode 100644
index 000000000000..989c04e0c563
--- /dev/null
+++ b/include/uapi/linux/nvme.h
@@ -0,0 +1,477 @@
1/*
2 * Definitions for the NVM Express interface
3 * Copyright (c) 2011-2013, Intel 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.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19#ifndef _UAPI_LINUX_NVME_H
20#define _UAPI_LINUX_NVME_H
21
22#include <linux/types.h>
23
24struct nvme_id_power_state {
25 __le16 max_power; /* centiwatts */
26 __u8 rsvd2;
27 __u8 flags;
28 __le32 entry_lat; /* microseconds */
29 __le32 exit_lat; /* microseconds */
30 __u8 read_tput;
31 __u8 read_lat;
32 __u8 write_tput;
33 __u8 write_lat;
34 __u8 rsvd16[16];
35};
36
37enum {
38 NVME_PS_FLAGS_MAX_POWER_SCALE = 1 << 0,
39 NVME_PS_FLAGS_NON_OP_STATE = 1 << 1,
40};
41
42struct nvme_id_ctrl {
43 __le16 vid;
44 __le16 ssvid;
45 char sn[20];
46 char mn[40];
47 char fr[8];
48 __u8 rab;
49 __u8 ieee[3];
50 __u8 mic;
51 __u8 mdts;
52 __u8 rsvd78[178];
53 __le16 oacs;
54 __u8 acl;
55 __u8 aerl;
56 __u8 frmw;
57 __u8 lpa;
58 __u8 elpe;
59 __u8 npss;
60 __u8 rsvd264[248];
61 __u8 sqes;
62 __u8 cqes;
63 __u8 rsvd514[2];
64 __le32 nn;
65 __le16 oncs;
66 __le16 fuses;
67 __u8 fna;
68 __u8 vwc;
69 __le16 awun;
70 __le16 awupf;
71 __u8 rsvd530[1518];
72 struct nvme_id_power_state psd[32];
73 __u8 vs[1024];
74};
75
76enum {
77 NVME_CTRL_ONCS_COMPARE = 1 << 0,
78 NVME_CTRL_ONCS_WRITE_UNCORRECTABLE = 1 << 1,
79 NVME_CTRL_ONCS_DSM = 1 << 2,
80};
81
82struct nvme_lbaf {
83 __le16 ms;
84 __u8 ds;
85 __u8 rp;
86};
87
88struct nvme_id_ns {
89 __le64 nsze;
90 __le64 ncap;
91 __le64 nuse;
92 __u8 nsfeat;
93 __u8 nlbaf;
94 __u8 flbas;
95 __u8 mc;
96 __u8 dpc;
97 __u8 dps;
98 __u8 rsvd30[98];
99 struct nvme_lbaf lbaf[16];
100 __u8 rsvd192[192];
101 __u8 vs[3712];
102};
103
104enum {
105 NVME_NS_FEAT_THIN = 1 << 0,
106 NVME_LBAF_RP_BEST = 0,
107 NVME_LBAF_RP_BETTER = 1,
108 NVME_LBAF_RP_GOOD = 2,
109 NVME_LBAF_RP_DEGRADED = 3,
110};
111
112struct nvme_smart_log {
113 __u8 critical_warning;
114 __u8 temperature[2];
115 __u8 avail_spare;
116 __u8 spare_thresh;
117 __u8 percent_used;
118 __u8 rsvd6[26];
119 __u8 data_units_read[16];
120 __u8 data_units_written[16];
121 __u8 host_reads[16];
122 __u8 host_writes[16];
123 __u8 ctrl_busy_time[16];
124 __u8 power_cycles[16];
125 __u8 power_on_hours[16];
126 __u8 unsafe_shutdowns[16];
127 __u8 media_errors[16];
128 __u8 num_err_log_entries[16];
129 __u8 rsvd192[320];
130};
131
132enum {
133 NVME_SMART_CRIT_SPARE = 1 << 0,
134 NVME_SMART_CRIT_TEMPERATURE = 1 << 1,
135 NVME_SMART_CRIT_RELIABILITY = 1 << 2,
136 NVME_SMART_CRIT_MEDIA = 1 << 3,
137 NVME_SMART_CRIT_VOLATILE_MEMORY = 1 << 4,
138};
139
140struct nvme_lba_range_type {
141 __u8 type;
142 __u8 attributes;
143 __u8 rsvd2[14];
144 __u64 slba;
145 __u64 nlb;
146 __u8 guid[16];
147 __u8 rsvd48[16];
148};
149
150enum {
151 NVME_LBART_TYPE_FS = 0x01,
152 NVME_LBART_TYPE_RAID = 0x02,
153 NVME_LBART_TYPE_CACHE = 0x03,
154 NVME_LBART_TYPE_SWAP = 0x04,
155
156 NVME_LBART_ATTRIB_TEMP = 1 << 0,
157 NVME_LBART_ATTRIB_HIDE = 1 << 1,
158};
159
160/* I/O commands */
161
162enum nvme_opcode {
163 nvme_cmd_flush = 0x00,
164 nvme_cmd_write = 0x01,
165 nvme_cmd_read = 0x02,
166 nvme_cmd_write_uncor = 0x04,
167 nvme_cmd_compare = 0x05,
168 nvme_cmd_dsm = 0x09,
169};
170
171struct nvme_common_command {
172 __u8 opcode;
173 __u8 flags;
174 __u16 command_id;
175 __le32 nsid;
176 __le32 cdw2[2];
177 __le64 metadata;
178 __le64 prp1;
179 __le64 prp2;
180 __le32 cdw10[6];
181};
182
183struct nvme_rw_command {
184 __u8 opcode;
185 __u8 flags;
186 __u16 command_id;
187 __le32 nsid;
188 __u64 rsvd2;
189 __le64 metadata;
190 __le64 prp1;
191 __le64 prp2;
192 __le64 slba;
193 __le16 length;
194 __le16 control;
195 __le32 dsmgmt;
196 __le32 reftag;
197 __le16 apptag;
198 __le16 appmask;
199};
200
201enum {
202 NVME_RW_LR = 1 << 15,
203 NVME_RW_FUA = 1 << 14,
204 NVME_RW_DSM_FREQ_UNSPEC = 0,
205 NVME_RW_DSM_FREQ_TYPICAL = 1,
206 NVME_RW_DSM_FREQ_RARE = 2,
207 NVME_RW_DSM_FREQ_READS = 3,
208 NVME_RW_DSM_FREQ_WRITES = 4,
209 NVME_RW_DSM_FREQ_RW = 5,
210 NVME_RW_DSM_FREQ_ONCE = 6,
211 NVME_RW_DSM_FREQ_PREFETCH = 7,
212 NVME_RW_DSM_FREQ_TEMP = 8,
213 NVME_RW_DSM_LATENCY_NONE = 0 << 4,
214 NVME_RW_DSM_LATENCY_IDLE = 1 << 4,
215 NVME_RW_DSM_LATENCY_NORM = 2 << 4,
216 NVME_RW_DSM_LATENCY_LOW = 3 << 4,
217 NVME_RW_DSM_SEQ_REQ = 1 << 6,
218 NVME_RW_DSM_COMPRESSED = 1 << 7,
219};
220
221struct nvme_dsm_cmd {
222 __u8 opcode;
223 __u8 flags;
224 __u16 command_id;
225 __le32 nsid;
226 __u64 rsvd2[2];
227 __le64 prp1;
228 __le64 prp2;
229 __le32 nr;
230 __le32 attributes;
231 __u32 rsvd12[4];
232};
233
234enum {
235 NVME_DSMGMT_IDR = 1 << 0,
236 NVME_DSMGMT_IDW = 1 << 1,
237 NVME_DSMGMT_AD = 1 << 2,
238};
239
240struct nvme_dsm_range {
241 __le32 cattr;
242 __le32 nlb;
243 __le64 slba;
244};
245
246/* Admin commands */
247
248enum nvme_admin_opcode {
249 nvme_admin_delete_sq = 0x00,
250 nvme_admin_create_sq = 0x01,
251 nvme_admin_get_log_page = 0x02,
252 nvme_admin_delete_cq = 0x04,
253 nvme_admin_create_cq = 0x05,
254 nvme_admin_identify = 0x06,
255 nvme_admin_abort_cmd = 0x08,
256 nvme_admin_set_features = 0x09,
257 nvme_admin_get_features = 0x0a,
258 nvme_admin_async_event = 0x0c,
259 nvme_admin_activate_fw = 0x10,
260 nvme_admin_download_fw = 0x11,
261 nvme_admin_format_nvm = 0x80,
262 nvme_admin_security_send = 0x81,
263 nvme_admin_security_recv = 0x82,
264};
265
266enum {
267 NVME_QUEUE_PHYS_CONTIG = (1 << 0),
268 NVME_CQ_IRQ_ENABLED = (1 << 1),
269 NVME_SQ_PRIO_URGENT = (0 << 1),
270 NVME_SQ_PRIO_HIGH = (1 << 1),
271 NVME_SQ_PRIO_MEDIUM = (2 << 1),
272 NVME_SQ_PRIO_LOW = (3 << 1),
273 NVME_FEAT_ARBITRATION = 0x01,
274 NVME_FEAT_POWER_MGMT = 0x02,
275 NVME_FEAT_LBA_RANGE = 0x03,
276 NVME_FEAT_TEMP_THRESH = 0x04,
277 NVME_FEAT_ERR_RECOVERY = 0x05,
278 NVME_FEAT_VOLATILE_WC = 0x06,
279 NVME_FEAT_NUM_QUEUES = 0x07,
280 NVME_FEAT_IRQ_COALESCE = 0x08,
281 NVME_FEAT_IRQ_CONFIG = 0x09,
282 NVME_FEAT_WRITE_ATOMIC = 0x0a,
283 NVME_FEAT_ASYNC_EVENT = 0x0b,
284 NVME_FEAT_SW_PROGRESS = 0x0c,
285 NVME_FWACT_REPL = (0 << 3),
286 NVME_FWACT_REPL_ACTV = (1 << 3),
287 NVME_FWACT_ACTV = (2 << 3),
288};
289
290struct nvme_identify {
291 __u8 opcode;
292 __u8 flags;
293 __u16 command_id;
294 __le32 nsid;
295 __u64 rsvd2[2];
296 __le64 prp1;
297 __le64 prp2;
298 __le32 cns;
299 __u32 rsvd11[5];
300};
301
302struct nvme_features {
303 __u8 opcode;
304 __u8 flags;
305 __u16 command_id;
306 __le32 nsid;
307 __u64 rsvd2[2];
308 __le64 prp1;
309 __le64 prp2;
310 __le32 fid;
311 __le32 dword11;
312 __u32 rsvd12[4];
313};
314
315struct nvme_create_cq {
316 __u8 opcode;
317 __u8 flags;
318 __u16 command_id;
319 __u32 rsvd1[5];
320 __le64 prp1;
321 __u64 rsvd8;
322 __le16 cqid;
323 __le16 qsize;
324 __le16 cq_flags;
325 __le16 irq_vector;
326 __u32 rsvd12[4];
327};
328
329struct nvme_create_sq {
330 __u8 opcode;
331 __u8 flags;
332 __u16 command_id;
333 __u32 rsvd1[5];
334 __le64 prp1;
335 __u64 rsvd8;
336 __le16 sqid;
337 __le16 qsize;
338 __le16 sq_flags;
339 __le16 cqid;
340 __u32 rsvd12[4];
341};
342
343struct nvme_delete_queue {
344 __u8 opcode;
345 __u8 flags;
346 __u16 command_id;
347 __u32 rsvd1[9];
348 __le16 qid;
349 __u16 rsvd10;
350 __u32 rsvd11[5];
351};
352
353struct nvme_download_firmware {
354 __u8 opcode;
355 __u8 flags;
356 __u16 command_id;
357 __u32 rsvd1[5];
358 __le64 prp1;
359 __le64 prp2;
360 __le32 numd;
361 __le32 offset;
362 __u32 rsvd12[4];
363};
364
365struct nvme_format_cmd {
366 __u8 opcode;
367 __u8 flags;
368 __u16 command_id;
369 __le32 nsid;
370 __u64 rsvd2[4];
371 __le32 cdw10;
372 __u32 rsvd11[5];
373};
374
375struct nvme_command {
376 union {
377 struct nvme_common_command common;
378 struct nvme_rw_command rw;
379 struct nvme_identify identify;
380 struct nvme_features features;
381 struct nvme_create_cq create_cq;
382 struct nvme_create_sq create_sq;
383 struct nvme_delete_queue delete_queue;
384 struct nvme_download_firmware dlfw;
385 struct nvme_format_cmd format;
386 struct nvme_dsm_cmd dsm;
387 };
388};
389
390enum {
391 NVME_SC_SUCCESS = 0x0,
392 NVME_SC_INVALID_OPCODE = 0x1,
393 NVME_SC_INVALID_FIELD = 0x2,
394 NVME_SC_CMDID_CONFLICT = 0x3,
395 NVME_SC_DATA_XFER_ERROR = 0x4,
396 NVME_SC_POWER_LOSS = 0x5,
397 NVME_SC_INTERNAL = 0x6,
398 NVME_SC_ABORT_REQ = 0x7,
399 NVME_SC_ABORT_QUEUE = 0x8,
400 NVME_SC_FUSED_FAIL = 0x9,
401 NVME_SC_FUSED_MISSING = 0xa,
402 NVME_SC_INVALID_NS = 0xb,
403 NVME_SC_CMD_SEQ_ERROR = 0xc,
404 NVME_SC_LBA_RANGE = 0x80,
405 NVME_SC_CAP_EXCEEDED = 0x81,
406 NVME_SC_NS_NOT_READY = 0x82,
407 NVME_SC_CQ_INVALID = 0x100,
408 NVME_SC_QID_INVALID = 0x101,
409 NVME_SC_QUEUE_SIZE = 0x102,
410 NVME_SC_ABORT_LIMIT = 0x103,
411 NVME_SC_ABORT_MISSING = 0x104,
412 NVME_SC_ASYNC_LIMIT = 0x105,
413 NVME_SC_FIRMWARE_SLOT = 0x106,
414 NVME_SC_FIRMWARE_IMAGE = 0x107,
415 NVME_SC_INVALID_VECTOR = 0x108,
416 NVME_SC_INVALID_LOG_PAGE = 0x109,
417 NVME_SC_INVALID_FORMAT = 0x10a,
418 NVME_SC_BAD_ATTRIBUTES = 0x180,
419 NVME_SC_WRITE_FAULT = 0x280,
420 NVME_SC_READ_ERROR = 0x281,
421 NVME_SC_GUARD_CHECK = 0x282,
422 NVME_SC_APPTAG_CHECK = 0x283,
423 NVME_SC_REFTAG_CHECK = 0x284,
424 NVME_SC_COMPARE_FAILED = 0x285,
425 NVME_SC_ACCESS_DENIED = 0x286,
426};
427
428struct nvme_completion {
429 __le32 result; /* Used by admin commands to return data */
430 __u32 rsvd;
431 __le16 sq_head; /* how much of this queue may be reclaimed */
432 __le16 sq_id; /* submission queue that generated this entry */
433 __u16 command_id; /* of the command which completed */
434 __le16 status; /* did the command fail, and if so, why? */
435};
436
437struct nvme_user_io {
438 __u8 opcode;
439 __u8 flags;
440 __u16 control;
441 __u16 nblocks;
442 __u16 rsvd;
443 __u64 metadata;
444 __u64 addr;
445 __u64 slba;
446 __u32 dsmgmt;
447 __u32 reftag;
448 __u16 apptag;
449 __u16 appmask;
450};
451
452struct nvme_admin_cmd {
453 __u8 opcode;
454 __u8 flags;
455 __u16 rsvd1;
456 __u32 nsid;
457 __u32 cdw2;
458 __u32 cdw3;
459 __u64 metadata;
460 __u64 addr;
461 __u32 metadata_len;
462 __u32 data_len;
463 __u32 cdw10;
464 __u32 cdw11;
465 __u32 cdw12;
466 __u32 cdw13;
467 __u32 cdw14;
468 __u32 cdw15;
469 __u32 timeout_ms;
470 __u32 result;
471};
472
473#define NVME_IOCTL_ID _IO('N', 0x40)
474#define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
475#define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
476
477#endif /* _UAPI_LINUX_NVME_H */
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index c55efaaa9bb4..a74d375b439b 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -1,6 +1,6 @@
1 1
2/* 2/*
3 * Copyright (c) 2007-2011 Nicira Networks. 3 * Copyright (c) 2007-2013 Nicira, Inc.
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public 6 * modify it under the terms of version 2 of the GNU General Public
@@ -165,6 +165,7 @@ enum ovs_vport_type {
165 OVS_VPORT_TYPE_NETDEV, /* network device */ 165 OVS_VPORT_TYPE_NETDEV, /* network device */
166 OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */ 166 OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */
167 OVS_VPORT_TYPE_GRE, /* GRE tunnel. */ 167 OVS_VPORT_TYPE_GRE, /* GRE tunnel. */
168 OVS_VPORT_TYPE_VXLAN, /* VXLAN tunnel. */
168 __OVS_VPORT_TYPE_MAX 169 __OVS_VPORT_TYPE_MAX
169}; 170};
170 171
@@ -211,6 +212,16 @@ enum ovs_vport_attr {
211 212
212#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1) 213#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
213 214
215/* OVS_VPORT_ATTR_OPTIONS attributes for tunnels.
216 */
217enum {
218 OVS_TUNNEL_ATTR_UNSPEC,
219 OVS_TUNNEL_ATTR_DST_PORT, /* 16-bit UDP port, used by L4 tunnels. */
220 __OVS_TUNNEL_ATTR_MAX
221};
222
223#define OVS_TUNNEL_ATTR_MAX (__OVS_TUNNEL_ATTR_MAX - 1)
224
214/* Flows. */ 225/* Flows. */
215 226
216#define OVS_FLOW_FAMILY "ovs_flow" 227#define OVS_FLOW_FAMILY "ovs_flow"
@@ -248,6 +259,7 @@ enum ovs_key_attr {
248 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */ 259 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */
249 OVS_KEY_ATTR_SKB_MARK, /* u32 skb mark */ 260 OVS_KEY_ATTR_SKB_MARK, /* u32 skb mark */
250 OVS_KEY_ATTR_TUNNEL, /* Nested set of ovs_tunnel attributes */ 261 OVS_KEY_ATTR_TUNNEL, /* Nested set of ovs_tunnel attributes */
262 OVS_KEY_ATTR_SCTP, /* struct ovs_key_sctp */
251 263
252#ifdef __KERNEL__ 264#ifdef __KERNEL__
253 OVS_KEY_ATTR_IPV4_TUNNEL, /* struct ovs_key_ipv4_tunnel */ 265 OVS_KEY_ATTR_IPV4_TUNNEL, /* struct ovs_key_ipv4_tunnel */
@@ -322,6 +334,11 @@ struct ovs_key_udp {
322 __be16 udp_dst; 334 __be16 udp_dst;
323}; 335};
324 336
337struct ovs_key_sctp {
338 __be16 sctp_src;
339 __be16 sctp_dst;
340};
341
325struct ovs_key_icmp { 342struct ovs_key_icmp {
326 __u8 icmp_type; 343 __u8 icmp_type;
327 __u8 icmp_code; 344 __u8 icmp_code;
@@ -368,6 +385,12 @@ struct ovs_key_nd {
368 * @OVS_FLOW_ATTR_CLEAR: If present in a %OVS_FLOW_CMD_SET request, clears the 385 * @OVS_FLOW_ATTR_CLEAR: If present in a %OVS_FLOW_CMD_SET request, clears the
369 * last-used time, accumulated TCP flags, and statistics for this flow. 386 * last-used time, accumulated TCP flags, and statistics for this flow.
370 * Otherwise ignored in requests. Never present in notifications. 387 * Otherwise ignored in requests. Never present in notifications.
388 * @OVS_FLOW_ATTR_MASK: Nested %OVS_KEY_ATTR_* attributes specifying the
389 * mask bits for wildcarded flow match. Mask bit value '1' specifies exact
390 * match with corresponding flow key bit, while mask bit value '0' specifies
391 * a wildcarded match. Omitting attribute is treated as wildcarding all
392 * corresponding fields. Optional for all requests. If not present,
393 * all flow key bits are exact match bits.
371 * 394 *
372 * These attributes follow the &struct ovs_header within the Generic Netlink 395 * These attributes follow the &struct ovs_header within the Generic Netlink
373 * payload for %OVS_FLOW_* commands. 396 * payload for %OVS_FLOW_* commands.
@@ -380,6 +403,7 @@ enum ovs_flow_attr {
380 OVS_FLOW_ATTR_TCP_FLAGS, /* 8-bit OR'd TCP flags. */ 403 OVS_FLOW_ATTR_TCP_FLAGS, /* 8-bit OR'd TCP flags. */
381 OVS_FLOW_ATTR_USED, /* u64 msecs last used in monotonic time. */ 404 OVS_FLOW_ATTR_USED, /* u64 msecs last used in monotonic time. */
382 OVS_FLOW_ATTR_CLEAR, /* Flag to clear stats, tcp_flags, used. */ 405 OVS_FLOW_ATTR_CLEAR, /* Flag to clear stats, tcp_flags, used. */
406 OVS_FLOW_ATTR_MASK, /* Sequence of OVS_KEY_ATTR_* attributes. */
383 __OVS_FLOW_ATTR_MAX 407 __OVS_FLOW_ATTR_MAX
384}; 408};
385 409
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index c3cc01d474b0..baa7852468ef 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -421,24 +421,24 @@
421#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */ 421#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */
422#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */ 422#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */
423#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ 423#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */
424#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ 424#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCIe to PCI/PCI-X Bridge */
425#define PCI_EXP_TYPE_PCIE_BRIDGE 0x8 /* PCI/PCI-X to PCIE Bridge */ 425#define PCI_EXP_TYPE_PCIE_BRIDGE 0x8 /* PCI/PCI-X to PCIe Bridge */
426#define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */ 426#define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */
427#define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */ 427#define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */
428#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ 428#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
429#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ 429#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */
430#define PCI_EXP_DEVCAP 4 /* Device capabilities */ 430#define PCI_EXP_DEVCAP 4 /* Device capabilities */
431#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */ 431#define PCI_EXP_DEVCAP_PAYLOAD 0x00000007 /* Max_Payload_Size */
432#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */ 432#define PCI_EXP_DEVCAP_PHANTOM 0x00000018 /* Phantom functions */
433#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */ 433#define PCI_EXP_DEVCAP_EXT_TAG 0x00000020 /* Extended tags */
434#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */ 434#define PCI_EXP_DEVCAP_L0S 0x000001c0 /* L0s Acceptable Latency */
435#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */ 435#define PCI_EXP_DEVCAP_L1 0x00000e00 /* L1 Acceptable Latency */
436#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */ 436#define PCI_EXP_DEVCAP_ATN_BUT 0x00001000 /* Attention Button Present */
437#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */ 437#define PCI_EXP_DEVCAP_ATN_IND 0x00002000 /* Attention Indicator Present */
438#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */ 438#define PCI_EXP_DEVCAP_PWR_IND 0x00004000 /* Power Indicator Present */
439#define PCI_EXP_DEVCAP_RBER 0x8000 /* Role-Based Error Reporting */ 439#define PCI_EXP_DEVCAP_RBER 0x00008000 /* Role-Based Error Reporting */
440#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */ 440#define PCI_EXP_DEVCAP_PWR_VAL 0x03fc0000 /* Slot Power Limit Value */
441#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */ 441#define PCI_EXP_DEVCAP_PWR_SCL 0x0c000000 /* Slot Power Limit Scale */
442#define PCI_EXP_DEVCAP_FLR 0x10000000 /* Function Level Reset */ 442#define PCI_EXP_DEVCAP_FLR 0x10000000 /* Function Level Reset */
443#define PCI_EXP_DEVCTL 8 /* Device Control */ 443#define PCI_EXP_DEVCTL 8 /* Device Control */
444#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */ 444#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
@@ -454,16 +454,16 @@
454#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */ 454#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */
455#define PCI_EXP_DEVCTL_BCR_FLR 0x8000 /* Bridge Configuration Retry / FLR */ 455#define PCI_EXP_DEVCTL_BCR_FLR 0x8000 /* Bridge Configuration Retry / FLR */
456#define PCI_EXP_DEVSTA 10 /* Device Status */ 456#define PCI_EXP_DEVSTA 10 /* Device Status */
457#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */ 457#define PCI_EXP_DEVSTA_CED 0x0001 /* Correctable Error Detected */
458#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */ 458#define PCI_EXP_DEVSTA_NFED 0x0002 /* Non-Fatal Error Detected */
459#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */ 459#define PCI_EXP_DEVSTA_FED 0x0004 /* Fatal Error Detected */
460#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */ 460#define PCI_EXP_DEVSTA_URD 0x0008 /* Unsupported Request Detected */
461#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ 461#define PCI_EXP_DEVSTA_AUXPD 0x0010 /* AUX Power Detected */
462#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ 462#define PCI_EXP_DEVSTA_TRPND 0x0020 /* Transactions Pending */
463#define PCI_EXP_LNKCAP 12 /* Link Capabilities */ 463#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
464#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */ 464#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */
465#define PCI_EXP_LNKCAP_SLS_2_5GB 0x1 /* LNKCAP2 SLS Vector bit 0 (2.5GT/s) */ 465#define PCI_EXP_LNKCAP_SLS_2_5GB 0x00000001 /* LNKCAP2 SLS Vector bit 0 */
466#define PCI_EXP_LNKCAP_SLS_5_0GB 0x2 /* LNKCAP2 SLS Vector bit 1 (5.0GT/s) */ 466#define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */
467#define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */ 467#define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */
468#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */ 468#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */
469#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */ 469#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */
@@ -475,21 +475,21 @@
475#define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */ 475#define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */
476#define PCI_EXP_LNKCTL 16 /* Link Control */ 476#define PCI_EXP_LNKCTL 16 /* Link Control */
477#define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */ 477#define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */
478#define PCI_EXP_LNKCTL_ASPM_L0S 0x01 /* L0s Enable */ 478#define PCI_EXP_LNKCTL_ASPM_L0S 0x0001 /* L0s Enable */
479#define PCI_EXP_LNKCTL_ASPM_L1 0x02 /* L1 Enable */ 479#define PCI_EXP_LNKCTL_ASPM_L1 0x0002 /* L1 Enable */
480#define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */ 480#define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */
481#define PCI_EXP_LNKCTL_LD 0x0010 /* Link Disable */ 481#define PCI_EXP_LNKCTL_LD 0x0010 /* Link Disable */
482#define PCI_EXP_LNKCTL_RL 0x0020 /* Retrain Link */ 482#define PCI_EXP_LNKCTL_RL 0x0020 /* Retrain Link */
483#define PCI_EXP_LNKCTL_CCC 0x0040 /* Common Clock Configuration */ 483#define PCI_EXP_LNKCTL_CCC 0x0040 /* Common Clock Configuration */
484#define PCI_EXP_LNKCTL_ES 0x0080 /* Extended Synch */ 484#define PCI_EXP_LNKCTL_ES 0x0080 /* Extended Synch */
485#define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */ 485#define PCI_EXP_LNKCTL_CLKREQ_EN 0x0100 /* Enable clkreq */
486#define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */ 486#define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */
487#define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */ 487#define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */
488#define PCI_EXP_LNKCTL_LABIE 0x0800 /* Lnk Autonomous Bandwidth Interrupt Enable */ 488#define PCI_EXP_LNKCTL_LABIE 0x0800 /* Lnk Autonomous Bandwidth Interrupt Enable */
489#define PCI_EXP_LNKSTA 18 /* Link Status */ 489#define PCI_EXP_LNKSTA 18 /* Link Status */
490#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */ 490#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */
491#define PCI_EXP_LNKSTA_CLS_2_5GB 0x01 /* Current Link Speed 2.5GT/s */ 491#define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */
492#define PCI_EXP_LNKSTA_CLS_5_0GB 0x02 /* Current Link Speed 5.0GT/s */ 492#define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */
493#define PCI_EXP_LNKSTA_NLW 0x03f0 /* Nogotiated Link Width */ 493#define PCI_EXP_LNKSTA_NLW 0x03f0 /* Nogotiated Link Width */
494#define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */ 494#define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */
495#define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */ 495#define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */
@@ -534,44 +534,49 @@
534#define PCI_EXP_SLTSTA_EIS 0x0080 /* Electromechanical Interlock Status */ 534#define PCI_EXP_SLTSTA_EIS 0x0080 /* Electromechanical Interlock Status */
535#define PCI_EXP_SLTSTA_DLLSC 0x0100 /* Data Link Layer State Changed */ 535#define PCI_EXP_SLTSTA_DLLSC 0x0100 /* Data Link Layer State Changed */
536#define PCI_EXP_RTCTL 28 /* Root Control */ 536#define PCI_EXP_RTCTL 28 /* Root Control */
537#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */ 537#define PCI_EXP_RTCTL_SECEE 0x0001 /* System Error on Correctable Error */
538#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */ 538#define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */
539#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */ 539#define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */
540#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */ 540#define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */
541#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */ 541#define PCI_EXP_RTCTL_CRSSVE 0x0010 /* CRS Software Visibility Enable */
542#define PCI_EXP_RTCAP 30 /* Root Capabilities */ 542#define PCI_EXP_RTCAP 30 /* Root Capabilities */
543#define PCI_EXP_RTSTA 32 /* Root Status */ 543#define PCI_EXP_RTSTA 32 /* Root Status */
544#define PCI_EXP_RTSTA_PME 0x10000 /* PME status */ 544#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */
545#define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ 545#define PCI_EXP_RTSTA_PENDING 0x00020000 /* PME pending */
546/* 546/*
547 * Note that the following PCI Express 'Capability Structure' registers 547 * The Device Capabilities 2, Device Status 2, Device Control 2,
548 * were introduced with 'Capability Version' 0x2 (v2). These registers 548 * Link Capabilities 2, Link Status 2, Link Control 2,
549 * do not exist on devices with Capability Version 1. Use pci_pcie_cap2() 549 * Slot Capabilities 2, Slot Status 2, and Slot Control 2 registers
550 * to use these fields safely. 550 * are only present on devices with PCIe Capability version 2.
551 * Use pcie_capability_read_word() and similar interfaces to use them
552 * safely.
551 */ 553 */
552#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ 554#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */
553#define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ 555#define PCI_EXP_DEVCAP2_ARI 0x00000020 /* Alternative Routing-ID */
554#define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */ 556#define PCI_EXP_DEVCAP2_LTR 0x00000800 /* Latency tolerance reporting */
555#define PCI_EXP_OBFF_MASK 0xc0000 /* OBFF support mechanism */ 557#define PCI_EXP_DEVCAP2_OBFF_MASK 0x000c0000 /* OBFF support mechanism */
556#define PCI_EXP_OBFF_MSG 0x40000 /* New message signaling */ 558#define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */
557#define PCI_EXP_OBFF_WAKE 0x80000 /* Re-use WAKE# for OBFF */ 559#define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */
558#define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ 560#define PCI_EXP_DEVCTL2 40 /* Device Control 2 */
559#define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */ 561#define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */
560#define PCI_EXP_IDO_REQ_EN 0x100 /* ID-based ordering request enable */ 562#define PCI_EXP_DEVCTL2_IDO_REQ_EN 0x0100 /* Allow IDO for requests */
561#define PCI_EXP_IDO_CMP_EN 0x200 /* ID-based ordering completion enable */ 563#define PCI_EXP_DEVCTL2_IDO_CMP_EN 0x0200 /* Allow IDO for completions */
562#define PCI_EXP_LTR_EN 0x400 /* Latency tolerance reporting */ 564#define PCI_EXP_DEVCTL2_LTR_EN 0x0400 /* Enable LTR mechanism */
563#define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */ 565#define PCI_EXP_DEVCTL2_OBFF_MSGA_EN 0x2000 /* Enable OBFF Message type A */
564#define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */ 566#define PCI_EXP_DEVCTL2_OBFF_MSGB_EN 0x4000 /* Enable OBFF Message type B */
565#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ 567#define PCI_EXP_DEVCTL2_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */
568#define PCI_EXP_DEVSTA2 42 /* Device Status 2 */
566#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */ 569#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */
567#define PCI_EXP_LNKCAP2 44 /* Link Capability 2 */ 570#define PCI_EXP_LNKCAP2 44 /* Link Capabilities 2 */
568#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x02 /* Supported Link Speed 2.5GT/s */ 571#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x00000002 /* Supported Speed 2.5GT/s */
569#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x04 /* Supported Link Speed 5.0GT/s */ 572#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5.0GT/s */
570#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x08 /* Supported Link Speed 8.0GT/s */ 573#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8.0GT/s */
571#define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */ 574#define PCI_EXP_LNKCAP2_CROSSLINK 0x00000100 /* Crosslink supported */
572#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ 575#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
573#define PCI_EXP_LNKSTA2 50 /* Link Status 2 */ 576#define PCI_EXP_LNKSTA2 50 /* Link Status 2 */
577#define PCI_EXP_SLTCAP2 52 /* Slot Capabilities 2 */
574#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ 578#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */
579#define PCI_EXP_SLTSTA2 58 /* Slot Status 2 */
575 580
576/* Extended Capabilities (PCI-X 2.0 and Express) */ 581/* Extended Capabilities (PCI-X 2.0 and Express) */
577#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff) 582#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index 0b1df41691e8..2fc1602e23bb 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -109,6 +109,7 @@ enum perf_sw_ids {
109 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, 109 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
110 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7, 110 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
111 PERF_COUNT_SW_EMULATION_FAULTS = 8, 111 PERF_COUNT_SW_EMULATION_FAULTS = 8,
112 PERF_COUNT_SW_DUMMY = 9,
112 113
113 PERF_COUNT_SW_MAX, /* non-ABI */ 114 PERF_COUNT_SW_MAX, /* non-ABI */
114}; 115};
@@ -134,8 +135,9 @@ enum perf_event_sample_format {
134 PERF_SAMPLE_STACK_USER = 1U << 13, 135 PERF_SAMPLE_STACK_USER = 1U << 13,
135 PERF_SAMPLE_WEIGHT = 1U << 14, 136 PERF_SAMPLE_WEIGHT = 1U << 14,
136 PERF_SAMPLE_DATA_SRC = 1U << 15, 137 PERF_SAMPLE_DATA_SRC = 1U << 15,
138 PERF_SAMPLE_IDENTIFIER = 1U << 16,
137 139
138 PERF_SAMPLE_MAX = 1U << 16, /* non-ABI */ 140 PERF_SAMPLE_MAX = 1U << 17, /* non-ABI */
139}; 141};
140 142
141/* 143/*
@@ -275,8 +277,9 @@ struct perf_event_attr {
275 277
276 exclude_callchain_kernel : 1, /* exclude kernel callchains */ 278 exclude_callchain_kernel : 1, /* exclude kernel callchains */
277 exclude_callchain_user : 1, /* exclude user callchains */ 279 exclude_callchain_user : 1, /* exclude user callchains */
280 mmap2 : 1, /* include mmap with inode data */
278 281
279 __reserved_1 : 41; 282 __reserved_1 : 40;
280 283
281 union { 284 union {
282 __u32 wakeup_events; /* wakeup every n events */ 285 __u32 wakeup_events; /* wakeup every n events */
@@ -321,6 +324,7 @@ struct perf_event_attr {
321#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64) 324#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)
322#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) 325#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)
323#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) 326#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
327#define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *)
324 328
325enum perf_event_ioc_flags { 329enum perf_event_ioc_flags {
326 PERF_IOC_FLAG_GROUP = 1U << 0, 330 PERF_IOC_FLAG_GROUP = 1U << 0,
@@ -375,9 +379,15 @@ struct perf_event_mmap_page {
375 __u64 time_running; /* time event on cpu */ 379 __u64 time_running; /* time event on cpu */
376 union { 380 union {
377 __u64 capabilities; 381 __u64 capabilities;
378 __u64 cap_usr_time : 1, 382 struct {
379 cap_usr_rdpmc : 1, 383 __u64 cap_bit0 : 1, /* Always 0, deprecated, see commit 860f085b74e9 */
380 cap_____res : 62; 384 cap_bit0_is_deprecated : 1, /* Always 1, signals that bit 0 is zero */
385
386 cap_user_rdpmc : 1, /* The RDPMC instruction can be used to read counts */
387 cap_user_time : 1, /* The time_* fields are used */
388 cap_user_time_zero : 1, /* The time_zero field is used */
389 cap_____res : 59;
390 };
381 }; 391 };
382 392
383 /* 393 /*
@@ -418,23 +428,43 @@ struct perf_event_mmap_page {
418 __u16 time_shift; 428 __u16 time_shift;
419 __u32 time_mult; 429 __u32 time_mult;
420 __u64 time_offset; 430 __u64 time_offset;
431 /*
432 * If cap_usr_time_zero, the hardware clock (e.g. TSC) can be calculated
433 * from sample timestamps.
434 *
435 * time = timestamp - time_zero;
436 * quot = time / time_mult;
437 * rem = time % time_mult;
438 * cyc = (quot << time_shift) + (rem << time_shift) / time_mult;
439 *
440 * And vice versa:
441 *
442 * quot = cyc >> time_shift;
443 * rem = cyc & ((1 << time_shift) - 1);
444 * timestamp = time_zero + quot * time_mult +
445 * ((rem * time_mult) >> time_shift);
446 */
447 __u64 time_zero;
448 __u32 size; /* Header size up to __reserved[] fields. */
421 449
422 /* 450 /*
423 * Hole for extension of the self monitor capabilities 451 * Hole for extension of the self monitor capabilities
424 */ 452 */
425 453
426 __u64 __reserved[120]; /* align to 1k */ 454 __u8 __reserved[118*8+4]; /* align to 1k. */
427 455
428 /* 456 /*
429 * Control data for the mmap() data buffer. 457 * Control data for the mmap() data buffer.
430 * 458 *
431 * User-space reading the @data_head value should issue an rmb(), on 459 * User-space reading the @data_head value should issue an smp_rmb(),
432 * SMP capable platforms, after reading this value -- see 460 * after reading this value.
433 * perf_event_wakeup().
434 * 461 *
435 * When the mapping is PROT_WRITE the @data_tail value should be 462 * When the mapping is PROT_WRITE the @data_tail value should be
436 * written by userspace to reflect the last read data. In this case 463 * written by userspace to reflect the last read data, after issueing
437 * the kernel will not over-write unread data. 464 * an smp_mb() to separate the data read from the ->data_tail store.
465 * In this case the kernel will not over-write unread data.
466 *
467 * See perf_output_put_handle() for the data ordering.
438 */ 468 */
439 __u64 data_head; /* head in the data section */ 469 __u64 data_head; /* head in the data section */
440 __u64 data_tail; /* user-space written tail */ 470 __u64 data_tail; /* user-space written tail */
@@ -471,13 +501,28 @@ enum perf_event_type {
471 /* 501 /*
472 * If perf_event_attr.sample_id_all is set then all event types will 502 * If perf_event_attr.sample_id_all is set then all event types will
473 * have the sample_type selected fields related to where/when 503 * have the sample_type selected fields related to where/when
474 * (identity) an event took place (TID, TIME, ID, CPU, STREAM_ID) 504 * (identity) an event took place (TID, TIME, ID, STREAM_ID, CPU,
475 * described in PERF_RECORD_SAMPLE below, it will be stashed just after 505 * IDENTIFIER) described in PERF_RECORD_SAMPLE below, it will be stashed
476 * the perf_event_header and the fields already present for the existing 506 * just after the perf_event_header and the fields already present for
477 * fields, i.e. at the end of the payload. That way a newer perf.data 507 * the existing fields, i.e. at the end of the payload. That way a newer
478 * file will be supported by older perf tools, with these new optional 508 * perf.data file will be supported by older perf tools, with these new
479 * fields being ignored. 509 * optional fields being ignored.
510 *
511 * struct sample_id {
512 * { u32 pid, tid; } && PERF_SAMPLE_TID
513 * { u64 time; } && PERF_SAMPLE_TIME
514 * { u64 id; } && PERF_SAMPLE_ID
515 * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID
516 * { u32 cpu, res; } && PERF_SAMPLE_CPU
517 * { u64 id; } && PERF_SAMPLE_IDENTIFIER
518 * } && perf_event_attr::sample_id_all
480 * 519 *
520 * Note that PERF_SAMPLE_IDENTIFIER duplicates PERF_SAMPLE_ID. The
521 * advantage of PERF_SAMPLE_IDENTIFIER is that its position is fixed
522 * relative to header.size.
523 */
524
525 /*
481 * The MMAP events record the PROT_EXEC mappings so that we can 526 * The MMAP events record the PROT_EXEC mappings so that we can
482 * correlate userspace IPs to code. They have the following structure: 527 * correlate userspace IPs to code. They have the following structure:
483 * 528 *
@@ -489,6 +534,7 @@ enum perf_event_type {
489 * u64 len; 534 * u64 len;
490 * u64 pgoff; 535 * u64 pgoff;
491 * char filename[]; 536 * char filename[];
537 * struct sample_id sample_id;
492 * }; 538 * };
493 */ 539 */
494 PERF_RECORD_MMAP = 1, 540 PERF_RECORD_MMAP = 1,
@@ -498,6 +544,7 @@ enum perf_event_type {
498 * struct perf_event_header header; 544 * struct perf_event_header header;
499 * u64 id; 545 * u64 id;
500 * u64 lost; 546 * u64 lost;
547 * struct sample_id sample_id;
501 * }; 548 * };
502 */ 549 */
503 PERF_RECORD_LOST = 2, 550 PERF_RECORD_LOST = 2,
@@ -508,6 +555,7 @@ enum perf_event_type {
508 * 555 *
509 * u32 pid, tid; 556 * u32 pid, tid;
510 * char comm[]; 557 * char comm[];
558 * struct sample_id sample_id;
511 * }; 559 * };
512 */ 560 */
513 PERF_RECORD_COMM = 3, 561 PERF_RECORD_COMM = 3,
@@ -518,6 +566,7 @@ enum perf_event_type {
518 * u32 pid, ppid; 566 * u32 pid, ppid;
519 * u32 tid, ptid; 567 * u32 tid, ptid;
520 * u64 time; 568 * u64 time;
569 * struct sample_id sample_id;
521 * }; 570 * };
522 */ 571 */
523 PERF_RECORD_EXIT = 4, 572 PERF_RECORD_EXIT = 4,
@@ -528,6 +577,7 @@ enum perf_event_type {
528 * u64 time; 577 * u64 time;
529 * u64 id; 578 * u64 id;
530 * u64 stream_id; 579 * u64 stream_id;
580 * struct sample_id sample_id;
531 * }; 581 * };
532 */ 582 */
533 PERF_RECORD_THROTTLE = 5, 583 PERF_RECORD_THROTTLE = 5,
@@ -539,6 +589,7 @@ enum perf_event_type {
539 * u32 pid, ppid; 589 * u32 pid, ppid;
540 * u32 tid, ptid; 590 * u32 tid, ptid;
541 * u64 time; 591 * u64 time;
592 * struct sample_id sample_id;
542 * }; 593 * };
543 */ 594 */
544 PERF_RECORD_FORK = 7, 595 PERF_RECORD_FORK = 7,
@@ -549,6 +600,7 @@ enum perf_event_type {
549 * u32 pid, tid; 600 * u32 pid, tid;
550 * 601 *
551 * struct read_format values; 602 * struct read_format values;
603 * struct sample_id sample_id;
552 * }; 604 * };
553 */ 605 */
554 PERF_RECORD_READ = 8, 606 PERF_RECORD_READ = 8,
@@ -557,6 +609,13 @@ enum perf_event_type {
557 * struct { 609 * struct {
558 * struct perf_event_header header; 610 * struct perf_event_header header;
559 * 611 *
612 * #
613 * # Note that PERF_SAMPLE_IDENTIFIER duplicates PERF_SAMPLE_ID.
614 * # The advantage of PERF_SAMPLE_IDENTIFIER is that its position
615 * # is fixed relative to header.
616 * #
617 *
618 * { u64 id; } && PERF_SAMPLE_IDENTIFIER
560 * { u64 ip; } && PERF_SAMPLE_IP 619 * { u64 ip; } && PERF_SAMPLE_IP
561 * { u32 pid, tid; } && PERF_SAMPLE_TID 620 * { u32 pid, tid; } && PERF_SAMPLE_TID
562 * { u64 time; } && PERF_SAMPLE_TIME 621 * { u64 time; } && PERF_SAMPLE_TIME
@@ -596,11 +655,32 @@ enum perf_event_type {
596 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER 655 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER
597 * 656 *
598 * { u64 weight; } && PERF_SAMPLE_WEIGHT 657 * { u64 weight; } && PERF_SAMPLE_WEIGHT
599 * { u64 data_src; } && PERF_SAMPLE_DATA_SRC 658 * { u64 data_src; } && PERF_SAMPLE_DATA_SRC
600 * }; 659 * };
601 */ 660 */
602 PERF_RECORD_SAMPLE = 9, 661 PERF_RECORD_SAMPLE = 9,
603 662
663 /*
664 * The MMAP2 records are an augmented version of MMAP, they add
665 * maj, min, ino numbers to be used to uniquely identify each mapping
666 *
667 * struct {
668 * struct perf_event_header header;
669 *
670 * u32 pid, tid;
671 * u64 addr;
672 * u64 len;
673 * u64 pgoff;
674 * u32 maj;
675 * u32 min;
676 * u64 ino;
677 * u64 ino_generation;
678 * char filename[];
679 * struct sample_id sample_id;
680 * };
681 */
682 PERF_RECORD_MMAP2 = 10,
683
604 PERF_RECORD_MAX, /* non-ABI */ 684 PERF_RECORD_MAX, /* non-ABI */
605}; 685};
606 686
@@ -685,4 +765,28 @@ union perf_mem_data_src {
685#define PERF_MEM_S(a, s) \ 765#define PERF_MEM_S(a, s) \
686 (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) 766 (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
687 767
768/*
769 * single taken branch record layout:
770 *
771 * from: source instruction (may not always be a branch insn)
772 * to: branch target
773 * mispred: branch target was mispredicted
774 * predicted: branch target was predicted
775 *
776 * support for mispred, predicted is optional. In case it
777 * is not supported mispred = predicted = 0.
778 *
779 * in_tx: running in a hardware transaction
780 * abort: aborting a hardware transaction
781 */
782struct perf_branch_entry {
783 __u64 from;
784 __u64 to;
785 __u64 mispred:1, /* target mispredicted */
786 predicted:1,/* target predicted */
787 in_tx:1, /* in transaction */
788 abort:1, /* transaction abort */
789 reserved:60;
790};
791
688#endif /* _UAPI_LINUX_PERF_EVENT_H */ 792#endif /* _UAPI_LINUX_PERF_EVENT_H */
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index 09d62b9228ff..9b829134d422 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -744,4 +744,45 @@ struct tc_fq_codel_xstats {
744 }; 744 };
745}; 745};
746 746
747/* FQ */
748
749enum {
750 TCA_FQ_UNSPEC,
751
752 TCA_FQ_PLIMIT, /* limit of total number of packets in queue */
753
754 TCA_FQ_FLOW_PLIMIT, /* limit of packets per flow */
755
756 TCA_FQ_QUANTUM, /* RR quantum */
757
758 TCA_FQ_INITIAL_QUANTUM, /* RR quantum for new flow */
759
760 TCA_FQ_RATE_ENABLE, /* enable/disable rate limiting */
761
762 TCA_FQ_FLOW_DEFAULT_RATE,/* for sockets with unspecified sk_rate,
763 * use the following rate
764 */
765
766 TCA_FQ_FLOW_MAX_RATE, /* per flow max rate */
767
768 TCA_FQ_BUCKETS_LOG, /* log2(number of buckets) */
769 __TCA_FQ_MAX
770};
771
772#define TCA_FQ_MAX (__TCA_FQ_MAX - 1)
773
774struct tc_fq_qd_stats {
775 __u64 gc_flows;
776 __u64 highprio_packets;
777 __u64 tcp_retrans;
778 __u64 throttled;
779 __u64 flows_plimit;
780 __u64 pkts_too_long;
781 __u64 allocation_errors;
782 __s64 time_next_delayed_flow;
783 __u32 flows;
784 __u32 inactive_flows;
785 __u32 throttled_flows;
786 __u32 pad;
787};
747#endif 788#endif
diff --git a/include/uapi/linux/reiserfs_xattr.h b/include/uapi/linux/reiserfs_xattr.h
index d8ce17c2459a..38fdd648be21 100644
--- a/include/uapi/linux/reiserfs_xattr.h
+++ b/include/uapi/linux/reiserfs_xattr.h
@@ -16,7 +16,7 @@ struct reiserfs_xattr_header {
16}; 16};
17 17
18struct reiserfs_security_handle { 18struct reiserfs_security_handle {
19 char *name; 19 const char *name;
20 void *value; 20 void *value;
21 size_t length; 21 size_t length;
22}; 22};
diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
index 66b466e4ca08..ca451e99b28b 100644
--- a/include/uapi/linux/sctp.h
+++ b/include/uapi/linux/sctp.h
@@ -28,7 +28,7 @@
28 * 28 *
29 * Please send any bug reports or fixes you make to the 29 * Please send any bug reports or fixes you make to the
30 * email address(es): 30 * email address(es):
31 * lksctp developers <lksctp-developers@lists.sourceforge.net> 31 * lksctp developers <linux-sctp@vger.kernel.org>
32 * 32 *
33 * Or submit a bug report through the following website: 33 * Or submit a bug report through the following website:
34 * http://www.sf.net/projects/lksctp 34 * http://www.sf.net/projects/lksctp
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h
index 9119cc0977bf..b47dba2c1e6f 100644
--- a/include/uapi/linux/serial_core.h
+++ b/include/uapi/linux/serial_core.h
@@ -232,4 +232,10 @@
232/* SH-SCI */ 232/* SH-SCI */
233#define PORT_HSCIF 104 233#define PORT_HSCIF 104
234 234
235/* ST ASC type numbers */
236#define PORT_ASC 105
237
238/* Tilera TILE-Gx UART */
239#define PORT_TILEGX 106
240
235#endif /* _UAPILINUX_SERIAL_CORE_H */ 241#endif /* _UAPILINUX_SERIAL_CORE_H */
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h
index a1356d3b54df..1bdb4a39d1e1 100644
--- a/include/uapi/linux/snmp.h
+++ b/include/uapi/linux/snmp.h
@@ -51,6 +51,10 @@ enum
51 IPSTATS_MIB_INBCASTOCTETS, /* InBcastOctets */ 51 IPSTATS_MIB_INBCASTOCTETS, /* InBcastOctets */
52 IPSTATS_MIB_OUTBCASTOCTETS, /* OutBcastOctets */ 52 IPSTATS_MIB_OUTBCASTOCTETS, /* OutBcastOctets */
53 IPSTATS_MIB_CSUMERRORS, /* InCsumErrors */ 53 IPSTATS_MIB_CSUMERRORS, /* InCsumErrors */
54 IPSTATS_MIB_NOECTPKTS, /* InNoECTPkts */
55 IPSTATS_MIB_ECT1PKTS, /* InECT1Pkts */
56 IPSTATS_MIB_ECT0PKTS, /* InECT0Pkts */
57 IPSTATS_MIB_CEPKTS, /* InCEPkts */
54 __IPSTATS_MIB_MAX 58 __IPSTATS_MIB_MAX
55}; 59};
56 60
diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild
index 0623ec4e728f..56f121605c99 100644
--- a/include/uapi/linux/tc_act/Kbuild
+++ b/include/uapi/linux/tc_act/Kbuild
@@ -1,5 +1,6 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += tc_csum.h 2header-y += tc_csum.h
3header-y += tc_defact.h
3header-y += tc_gact.h 4header-y += tc_gact.h
4header-y += tc_ipt.h 5header-y += tc_ipt.h
5header-y += tc_mirred.h 6header-y += tc_mirred.h
diff --git a/include/linux/tc_act/tc_defact.h b/include/uapi/linux/tc_act/tc_defact.h
index 6f65d07c7ce2..17dddb40f740 100644
--- a/include/linux/tc_act/tc_defact.h
+++ b/include/uapi/linux/tc_act/tc_defact.h
@@ -6,7 +6,7 @@
6struct tc_defact { 6struct tc_defact {
7 tc_gen; 7 tc_gen;
8}; 8};
9 9
10enum { 10enum {
11 TCA_DEF_UNSPEC, 11 TCA_DEF_UNSPEC,
12 TCA_DEF_TM, 12 TCA_DEF_TM,
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
index 8d776ebc4829..377f1e59411d 100644
--- a/include/uapi/linux/tcp.h
+++ b/include/uapi/linux/tcp.h
@@ -111,6 +111,7 @@ enum {
111#define TCP_REPAIR_OPTIONS 22 111#define TCP_REPAIR_OPTIONS 22
112#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */ 112#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */
113#define TCP_TIMESTAMP 24 113#define TCP_TIMESTAMP 24
114#define TCP_NOTSENT_LOWAT 25 /* limit number of unsent bytes in write queue */
114 115
115struct tcp_repair_opt { 116struct tcp_repair_opt {
116 __u32 opt_code; 117 __u32 opt_code;
diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h
index e9ed951e2b09..414b74be4da1 100644
--- a/include/uapi/linux/uhid.h
+++ b/include/uapi/linux/uhid.h
@@ -30,7 +30,7 @@ enum uhid_event_type {
30 UHID_OPEN, 30 UHID_OPEN,
31 UHID_CLOSE, 31 UHID_CLOSE,
32 UHID_OUTPUT, 32 UHID_OUTPUT,
33 UHID_OUTPUT_EV, 33 UHID_OUTPUT_EV, /* obsolete! */
34 UHID_INPUT, 34 UHID_INPUT,
35 UHID_FEATURE, 35 UHID_FEATURE,
36 UHID_FEATURE_ANSWER, 36 UHID_FEATURE_ANSWER,
@@ -69,6 +69,8 @@ struct uhid_output_req {
69 __u8 rtype; 69 __u8 rtype;
70} __attribute__((__packed__)); 70} __attribute__((__packed__));
71 71
72/* Obsolete! Newer kernels will no longer send these events but instead convert
73 * it into raw output reports via UHID_OUTPUT. */
72struct uhid_output_ev_req { 74struct uhid_output_ev_req {
73 __u16 type; 75 __u16 type;
74 __u16 code; 76 __u16 code;
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index e90a88a8708f..083bb5a5aae2 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -161,6 +161,8 @@ enum v4l2_colorfx {
161#define V4L2_CID_USER_SI476X_BASE (V4L2_CID_USER_BASE + 0x1040) 161#define V4L2_CID_USER_SI476X_BASE (V4L2_CID_USER_BASE + 0x1040)
162 162
163/* MPEG-class control IDs */ 163/* MPEG-class control IDs */
164/* The MPEG controls are applicable to all codec controls
165 * and the 'MPEG' part of the define is historical */
164 166
165#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 167#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
166#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) 168#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
@@ -522,6 +524,33 @@ enum v4l2_mpeg_video_mpeg4_profile {
522}; 524};
523#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407) 525#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)
524 526
527/* Control IDs for VP8 streams
528 * Although VP8 is not part of MPEG we add these controls to the MPEG class
529 * as that class is already handling other video compression standards
530 */
531#define V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS (V4L2_CID_MPEG_BASE+500)
532enum v4l2_vp8_num_partitions {
533 V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION = 0,
534 V4L2_CID_MPEG_VIDEO_VPX_2_PARTITIONS = 1,
535 V4L2_CID_MPEG_VIDEO_VPX_4_PARTITIONS = 2,
536 V4L2_CID_MPEG_VIDEO_VPX_8_PARTITIONS = 3,
537};
538#define V4L2_CID_MPEG_VIDEO_VPX_IMD_DISABLE_4X4 (V4L2_CID_MPEG_BASE+501)
539#define V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES (V4L2_CID_MPEG_BASE+502)
540enum v4l2_vp8_num_ref_frames {
541 V4L2_CID_MPEG_VIDEO_VPX_1_REF_FRAME = 0,
542 V4L2_CID_MPEG_VIDEO_VPX_2_REF_FRAME = 1,
543 V4L2_CID_MPEG_VIDEO_VPX_3_REF_FRAME = 2,
544};
545#define V4L2_CID_MPEG_VIDEO_VPX_FILTER_LEVEL (V4L2_CID_MPEG_BASE+503)
546#define V4L2_CID_MPEG_VIDEO_VPX_FILTER_SHARPNESS (V4L2_CID_MPEG_BASE+504)
547#define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD (V4L2_CID_MPEG_BASE+505)
548#define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL (V4L2_CID_MPEG_BASE+506)
549enum v4l2_vp8_golden_frame_sel {
550 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV = 0,
551 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD = 1,
552};
553
525/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ 554/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
526#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) 555#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
527#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0) 556#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
diff --git a/include/uapi/linux/v4l2-dv-timings.h b/include/uapi/linux/v4l2-dv-timings.h
index 4e0c58d25ff0..be709fe29552 100644
--- a/include/uapi/linux/v4l2-dv-timings.h
+++ b/include/uapi/linux/v4l2-dv-timings.h
@@ -823,12 +823,4 @@
823 V4L2_DV_FL_REDUCED_BLANKING) \ 823 V4L2_DV_FL_REDUCED_BLANKING) \
824} 824}
825 825
826#define V4L2_DV_BT_DMT_1366X768P60 { \
827 .type = V4L2_DV_BT_656_1120, \
828 V4L2_INIT_BT_TIMINGS(1366, 768, 0, \
829 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
830 85500000, 70, 143, 213, 3, 3, 24, 0, 0, 0, \
831 V4L2_DV_BT_STD_DMT, 0) \
832}
833
834#endif 826#endif
diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h
index 6ee63d09b32d..a9601257bb43 100644
--- a/include/uapi/linux/v4l2-mediabus.h
+++ b/include/uapi/linux/v4l2-mediabus.h
@@ -37,7 +37,7 @@
37enum v4l2_mbus_pixelcode { 37enum v4l2_mbus_pixelcode {
38 V4L2_MBUS_FMT_FIXED = 0x0001, 38 V4L2_MBUS_FMT_FIXED = 0x0001,
39 39
40 /* RGB - next is 0x100d */ 40 /* RGB - next is 0x100e */
41 V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001, 41 V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001,
42 V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002, 42 V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002,
43 V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003, 43 V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003,
@@ -50,8 +50,9 @@ enum v4l2_mbus_pixelcode {
50 V4L2_MBUS_FMT_RGB888_1X24 = 0x100a, 50 V4L2_MBUS_FMT_RGB888_1X24 = 0x100a,
51 V4L2_MBUS_FMT_RGB888_2X12_BE = 0x100b, 51 V4L2_MBUS_FMT_RGB888_2X12_BE = 0x100b,
52 V4L2_MBUS_FMT_RGB888_2X12_LE = 0x100c, 52 V4L2_MBUS_FMT_RGB888_2X12_LE = 0x100c,
53 V4L2_MBUS_FMT_ARGB8888_1X32 = 0x100d,
53 54
54 /* YUV (including grey) - next is 0x2017 */ 55 /* YUV (including grey) - next is 0x2018 */
55 V4L2_MBUS_FMT_Y8_1X8 = 0x2001, 56 V4L2_MBUS_FMT_Y8_1X8 = 0x2001,
56 V4L2_MBUS_FMT_UV8_1X8 = 0x2015, 57 V4L2_MBUS_FMT_UV8_1X8 = 0x2015,
57 V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002, 58 V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002,
@@ -74,6 +75,7 @@ enum v4l2_mbus_pixelcode {
74 V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d, 75 V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d,
75 V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e, 76 V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e,
76 V4L2_MBUS_FMT_YUV10_1X30 = 0x2016, 77 V4L2_MBUS_FMT_YUV10_1X30 = 0x2016,
78 V4L2_MBUS_FMT_AYUV8_1X32 = 0x2017,
77 79
78 /* Bayer - next is 0x3019 */ 80 /* Bayer - next is 0x3019 */
79 V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001, 81 V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001,
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index 916e444e6f74..0fd47f5bc146 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -324,6 +324,44 @@ enum {
324 VFIO_PCI_NUM_IRQS 324 VFIO_PCI_NUM_IRQS
325}; 325};
326 326
327/**
328 * VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IORW(VFIO_TYPE, VFIO_BASE + 12,
329 * struct vfio_pci_hot_reset_info)
330 *
331 * Return: 0 on success, -errno on failure:
332 * -enospc = insufficient buffer, -enodev = unsupported for device.
333 */
334struct vfio_pci_dependent_device {
335 __u32 group_id;
336 __u16 segment;
337 __u8 bus;
338 __u8 devfn; /* Use PCI_SLOT/PCI_FUNC */
339};
340
341struct vfio_pci_hot_reset_info {
342 __u32 argsz;
343 __u32 flags;
344 __u32 count;
345 struct vfio_pci_dependent_device devices[];
346};
347
348#define VFIO_DEVICE_GET_PCI_HOT_RESET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
349
350/**
351 * VFIO_DEVICE_PCI_HOT_RESET - _IOW(VFIO_TYPE, VFIO_BASE + 13,
352 * struct vfio_pci_hot_reset)
353 *
354 * Return: 0 on success, -errno on failure.
355 */
356struct vfio_pci_hot_reset {
357 __u32 argsz;
358 __u32 flags;
359 __u32 count;
360 __s32 group_fds[];
361};
362
363#define VFIO_DEVICE_PCI_HOT_RESET _IO(VFIO_TYPE, VFIO_BASE + 13)
364
327/* -------- API for Type1 VFIO IOMMU -------- */ 365/* -------- API for Type1 VFIO IOMMU -------- */
328 366
329/** 367/**
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 95ef4551edc1..437f1b0f8937 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -348,6 +348,8 @@ struct v4l2_pix_format {
348/* two non contiguous planes - one Y, one Cr + Cb interleaved */ 348/* two non contiguous planes - one Y, one Cr + Cb interleaved */
349#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ 349#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
350#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */ 350#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
351#define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6') /* 16 Y/CbCr 4:2:2 */
352#define V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1') /* 16 Y/CrCb 4:2:2 */
351#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */ 353#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
352#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */ 354#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */
353 355
@@ -1055,6 +1057,16 @@ struct v4l2_bt_timings {
1055 or used depends on the hardware. */ 1057 or used depends on the hardware. */
1056#define V4L2_DV_FL_HALF_LINE (1 << 3) 1058#define V4L2_DV_FL_HALF_LINE (1 << 3)
1057 1059
1060/* A few useful defines to calculate the total blanking and frame sizes */
1061#define V4L2_DV_BT_BLANKING_WIDTH(bt) \
1062 (bt->hfrontporch + bt->hsync + bt->hbackporch)
1063#define V4L2_DV_BT_FRAME_WIDTH(bt) \
1064 (bt->width + V4L2_DV_BT_BLANKING_WIDTH(bt))
1065#define V4L2_DV_BT_BLANKING_HEIGHT(bt) \
1066 (bt->vfrontporch + bt->vsync + bt->vbackporch + \
1067 bt->il_vfrontporch + bt->il_vsync + bt->il_vbackporch)
1068#define V4L2_DV_BT_FRAME_HEIGHT(bt) \
1069 (bt->height + V4L2_DV_BT_BLANKING_HEIGHT(bt))
1058 1070
1059/** struct v4l2_dv_timings - DV timings 1071/** struct v4l2_dv_timings - DV timings
1060 * @type: the type of the timings 1072 * @type: the type of the timings
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
index c520203fac2f..172a7f00780c 100644
--- a/include/uapi/linux/virtio_net.h
+++ b/include/uapi/linux/virtio_net.h
@@ -60,7 +60,7 @@
60 60
61struct virtio_net_config { 61struct virtio_net_config {
62 /* The config defining mac address (if VIRTIO_NET_F_MAC) */ 62 /* The config defining mac address (if VIRTIO_NET_F_MAC) */
63 __u8 mac[6]; 63 __u8 mac[ETH_ALEN];
64 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ 64 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
65 __u16 status; 65 __u16 status;
66 /* Maximum number of each of transmit and receive queues; 66 /* Maximum number of each of transmit and receive queues;
@@ -70,7 +70,9 @@ struct virtio_net_config {
70 __u16 max_virtqueue_pairs; 70 __u16 max_virtqueue_pairs;
71} __attribute__((packed)); 71} __attribute__((packed));
72 72
73/* This is the first element of the scatter-gather list. If you don't 73/* This header comes first in the scatter-gather list.
74 * If VIRTIO_F_ANY_LAYOUT is not negotiated, it must
75 * be the first element of the scatter-gather list. If you don't
74 * specify GSO or CSUM features, you can simply ignore the header. */ 76 * specify GSO or CSUM features, you can simply ignore the header. */
75struct virtio_net_hdr { 77struct virtio_net_hdr {
76#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset 78#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
diff --git a/include/uapi/linux/wimax/i2400m.h b/include/uapi/linux/wimax/i2400m.h
index 62d356153565..fd198bc24a3c 100644
--- a/include/uapi/linux/wimax/i2400m.h
+++ b/include/uapi/linux/wimax/i2400m.h
@@ -122,7 +122,7 @@
122#define __LINUX__WIMAX__I2400M_H__ 122#define __LINUX__WIMAX__I2400M_H__
123 123
124#include <linux/types.h> 124#include <linux/types.h>
125 125#include <linux/if_ether.h>
126 126
127/* 127/*
128 * Host Device Interface (HDI) common to all busses 128 * Host Device Interface (HDI) common to all busses
@@ -487,7 +487,7 @@ struct i2400m_tlv_l4_message_versions {
487struct i2400m_tlv_detailed_device_info { 487struct i2400m_tlv_detailed_device_info {
488 struct i2400m_tlv_hdr hdr; 488 struct i2400m_tlv_hdr hdr;
489 __u8 reserved1[400]; 489 __u8 reserved1[400];
490 __u8 mac_address[6]; 490 __u8 mac_address[ETH_ALEN];
491 __u8 reserved2[2]; 491 __u8 reserved2[2];
492} __attribute__((packed)); 492} __attribute__((packed));
493 493
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
index 805711ea2005..e3ddd86c90a6 100644
--- a/include/uapi/rdma/ib_user_verbs.h
+++ b/include/uapi/rdma/ib_user_verbs.h
@@ -43,6 +43,7 @@
43 * compatibility are made. 43 * compatibility are made.
44 */ 44 */
45#define IB_USER_VERBS_ABI_VERSION 6 45#define IB_USER_VERBS_ABI_VERSION 6
46#define IB_USER_VERBS_CMD_THRESHOLD 50
46 47
47enum { 48enum {
48 IB_USER_VERBS_CMD_GET_CONTEXT, 49 IB_USER_VERBS_CMD_GET_CONTEXT,
@@ -85,7 +86,11 @@ enum {
85 IB_USER_VERBS_CMD_OPEN_XRCD, 86 IB_USER_VERBS_CMD_OPEN_XRCD,
86 IB_USER_VERBS_CMD_CLOSE_XRCD, 87 IB_USER_VERBS_CMD_CLOSE_XRCD,
87 IB_USER_VERBS_CMD_CREATE_XSRQ, 88 IB_USER_VERBS_CMD_CREATE_XSRQ,
88 IB_USER_VERBS_CMD_OPEN_QP 89 IB_USER_VERBS_CMD_OPEN_QP,
90#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
91 IB_USER_VERBS_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
92 IB_USER_VERBS_CMD_DESTROY_FLOW
93#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
89}; 94};
90 95
91/* 96/*
@@ -123,6 +128,17 @@ struct ib_uverbs_cmd_hdr {
123 __u16 out_words; 128 __u16 out_words;
124}; 129};
125 130
131#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
132struct ib_uverbs_cmd_hdr_ex {
133 __u32 command;
134 __u16 in_words;
135 __u16 out_words;
136 __u16 provider_in_words;
137 __u16 provider_out_words;
138 __u32 cmd_hdr_reserved;
139};
140#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
141
126struct ib_uverbs_get_context { 142struct ib_uverbs_get_context {
127 __u64 response; 143 __u64 response;
128 __u64 driver_data[0]; 144 __u64 driver_data[0];
@@ -684,6 +700,93 @@ struct ib_uverbs_detach_mcast {
684 __u64 driver_data[0]; 700 __u64 driver_data[0];
685}; 701};
686 702
703#ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING
704struct ib_kern_eth_filter {
705 __u8 dst_mac[6];
706 __u8 src_mac[6];
707 __be16 ether_type;
708 __be16 vlan_tag;
709};
710
711struct ib_kern_spec_eth {
712 __u32 type;
713 __u16 size;
714 __u16 reserved;
715 struct ib_kern_eth_filter val;
716 struct ib_kern_eth_filter mask;
717};
718
719struct ib_kern_ipv4_filter {
720 __be32 src_ip;
721 __be32 dst_ip;
722};
723
724struct ib_kern_spec_ipv4 {
725 __u32 type;
726 __u16 size;
727 __u16 reserved;
728 struct ib_kern_ipv4_filter val;
729 struct ib_kern_ipv4_filter mask;
730};
731
732struct ib_kern_tcp_udp_filter {
733 __be16 dst_port;
734 __be16 src_port;
735};
736
737struct ib_kern_spec_tcp_udp {
738 __u32 type;
739 __u16 size;
740 __u16 reserved;
741 struct ib_kern_tcp_udp_filter val;
742 struct ib_kern_tcp_udp_filter mask;
743};
744
745struct ib_kern_spec {
746 union {
747 struct {
748 __u32 type;
749 __u16 size;
750 __u16 reserved;
751 };
752 struct ib_kern_spec_eth eth;
753 struct ib_kern_spec_ipv4 ipv4;
754 struct ib_kern_spec_tcp_udp tcp_udp;
755 };
756};
757
758struct ib_kern_flow_attr {
759 __u32 type;
760 __u16 size;
761 __u16 priority;
762 __u8 num_of_specs;
763 __u8 reserved[2];
764 __u8 port;
765 __u32 flags;
766 /* Following are the optional layers according to user request
767 * struct ib_flow_spec_xxx
768 * struct ib_flow_spec_yyy
769 */
770};
771
772struct ib_uverbs_create_flow {
773 __u32 comp_mask;
774 __u64 response;
775 __u32 qp_handle;
776 struct ib_kern_flow_attr flow_attr;
777};
778
779struct ib_uverbs_create_flow_resp {
780 __u32 comp_mask;
781 __u32 flow_handle;
782};
783
784struct ib_uverbs_destroy_flow {
785 __u32 comp_mask;
786 __u32 flow_handle;
787};
788#endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */
789
687struct ib_uverbs_create_srq { 790struct ib_uverbs_create_srq {
688 __u64 response; 791 __u64 response;
689 __u64 user_handle; 792 __u64 user_handle;
diff --git a/include/uapi/sound/hdspm.h b/include/uapi/sound/hdspm.h
index 1f59ea2a4a76..d956c3593f65 100644
--- a/include/uapi/sound/hdspm.h
+++ b/include/uapi/sound/hdspm.h
@@ -111,7 +111,7 @@ struct hdspm_ltc {
111 enum hdspm_ltc_input_format input_format; 111 enum hdspm_ltc_input_format input_format;
112}; 112};
113 113
114#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_mixer_ioctl) 114#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
115 115
116/** 116/**
117 * The status data reflects the device's current state 117 * The status data reflects the device's current state
diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h
index f88825928dd1..efed3c3383d6 100644
--- a/include/video/da8xx-fb.h
+++ b/include/video/da8xx-fb.h
@@ -23,6 +23,11 @@ enum raster_load_mode {
23 LOAD_PALETTE, 23 LOAD_PALETTE,
24}; 24};
25 25
26enum da8xx_frame_complete {
27 DA8XX_FRAME_WAIT,
28 DA8XX_FRAME_NOWAIT,
29};
30
26struct da8xx_lcdc_platform_data { 31struct da8xx_lcdc_platform_data {
27 const char manu_name[10]; 32 const char manu_name[10];
28 void *controller_data; 33 void *controller_data;
diff --git a/include/video/omap-panel-data.h b/include/video/omap-panel-data.h
index 6b2366fb6e53..f7ac8d972af0 100644
--- a/include/video/omap-panel-data.h
+++ b/include/video/omap-panel-data.h
@@ -33,124 +33,6 @@
33struct omap_dss_device; 33struct omap_dss_device;
34 34
35/** 35/**
36 * struct panel_generic_dpi_data - panel driver configuration data
37 * @name: panel name
38 * @platform_enable: platform specific panel enable function
39 * @platform_disable: platform specific panel disable function
40 * @num_gpios: number of gpios connected to panel
41 * @gpios: gpio numbers on the platform
42 * @gpio_invert: configure gpio as active high or low
43 */
44struct panel_generic_dpi_data {
45 const char *name;
46 int (*platform_enable)(struct omap_dss_device *dssdev);
47 void (*platform_disable)(struct omap_dss_device *dssdev);
48
49 int num_gpios;
50 int gpios[10];
51 bool gpio_invert[10];
52};
53
54/**
55 * struct panel_n8x0_data - N800 panel driver configuration data
56 */
57struct panel_n8x0_data {
58 int (*platform_enable)(struct omap_dss_device *dssdev);
59 void (*platform_disable)(struct omap_dss_device *dssdev);
60 int panel_reset;
61 int ctrl_pwrdown;
62};
63
64/**
65 * struct nokia_dsi_panel_data - Nokia DSI panel driver configuration data
66 * @name: panel name
67 * @use_ext_te: use external TE
68 * @ext_te_gpio: external TE GPIO
69 * @esd_interval: interval of ESD checks, 0 = disabled (ms)
70 * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms)
71 * @use_dsi_backlight: true if panel uses DSI command to control backlight
72 * @pin_config: DSI pin configuration
73 */
74
75struct nokia_dsi_panel_data {
76 const char *name;
77
78 int reset_gpio;
79
80 bool use_ext_te;
81 int ext_te_gpio;
82
83 unsigned esd_interval;
84 unsigned ulps_timeout;
85
86 bool use_dsi_backlight;
87
88 struct omap_dsi_pin_config pin_config;
89};
90
91/**
92 * struct picodlp_panel_data - picodlp panel driver configuration data
93 * @picodlp_adapter_id: i2c_adapter number for picodlp
94 */
95struct picodlp_panel_data {
96 int picodlp_adapter_id;
97 int emu_done_gpio;
98 int pwrgood_gpio;
99};
100
101/**
102 * struct tfp410_platform_data - tfp410 panel driver configuration data
103 * @i2c_bus_num: i2c bus id for the panel
104 * @power_down_gpio: gpio number for PD pin (or -1 if not available)
105 */
106struct tfp410_platform_data {
107 int i2c_bus_num;
108 int power_down_gpio;
109};
110
111/**
112 * sharp ls panel driver configuration data
113 * @resb_gpio: reset signal
114 * @ini_gpio: power on control
115 * @mo_gpio: selection for resolution(VGA/QVGA)
116 * @lr_gpio: selection for horizontal scanning direction
117 * @ud_gpio: selection for vertical scanning direction
118 */
119struct panel_sharp_ls037v7dw01_data {
120 int resb_gpio;
121 int ini_gpio;
122 int mo_gpio;
123 int lr_gpio;
124 int ud_gpio;
125};
126
127/**
128 * acx565akm panel driver configuration data
129 * @reset_gpio: reset signal
130 */
131struct panel_acx565akm_data {
132 int reset_gpio;
133};
134
135/**
136 * nec nl8048 panel driver configuration data
137 * @res_gpio: reset signal
138 * @qvga_gpio: selection for resolution(QVGA/WVGA)
139 */
140struct panel_nec_nl8048_data {
141 int res_gpio;
142 int qvga_gpio;
143};
144
145/**
146 * tpo td043 panel driver configuration data
147 * @nreset_gpio: reset signal
148 */
149struct panel_tpo_td043_data {
150 int nreset_gpio;
151};
152
153/**
154 * encoder_tfp410 platform data 36 * encoder_tfp410 platform data
155 * @name: name for this display entity 37 * @name: name for this display entity
156 * @power_down_gpio: gpio number for PD pin (or -1 if not available) 38 * @power_down_gpio: gpio number for PD pin (or -1 if not available)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index b39463553845..3d7c51a6f9ff 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -250,19 +250,6 @@ struct rfbi_timings {
250 int converted; 250 int converted;
251}; 251};
252 252
253void omap_rfbi_write_command(const void *buf, u32 len);
254void omap_rfbi_read_data(void *buf, u32 len);
255void omap_rfbi_write_data(const void *buf, u32 len);
256void omap_rfbi_write_pixels(const void __iomem *buf, int scr_width,
257 u16 x, u16 y,
258 u16 w, u16 h);
259int omap_rfbi_enable_te(bool enable, unsigned line);
260int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode,
261 unsigned hs_pulse_time, unsigned vs_pulse_time,
262 int hs_pol_inv, int vs_pol_inv, int extif_div);
263void rfbi_bus_lock(void);
264void rfbi_bus_unlock(void);
265
266/* DSI */ 253/* DSI */
267 254
268enum omap_dss_dsi_trans_mode { 255enum omap_dss_dsi_trans_mode {
@@ -321,39 +308,6 @@ struct omap_dss_dsi_config {
321 enum omap_dss_dsi_trans_mode trans_mode; 308 enum omap_dss_dsi_trans_mode trans_mode;
322}; 309};
323 310
324void dsi_bus_lock(struct omap_dss_device *dssdev);
325void dsi_bus_unlock(struct omap_dss_device *dssdev);
326int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data,
327 int len);
328int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data,
329 int len);
330int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd);
331int dsi_vc_generic_write_0(struct omap_dss_device *dssdev, int channel);
332int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
333 u8 param);
334int dsi_vc_generic_write_1(struct omap_dss_device *dssdev, int channel,
335 u8 param);
336int dsi_vc_generic_write_2(struct omap_dss_device *dssdev, int channel,
337 u8 param1, u8 param2);
338int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel,
339 u8 *data, int len);
340int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel,
341 u8 *data, int len);
342int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
343 u8 *buf, int buflen);
344int dsi_vc_generic_read_0(struct omap_dss_device *dssdev, int channel, u8 *buf,
345 int buflen);
346int dsi_vc_generic_read_1(struct omap_dss_device *dssdev, int channel, u8 param,
347 u8 *buf, int buflen);
348int dsi_vc_generic_read_2(struct omap_dss_device *dssdev, int channel,
349 u8 param1, u8 param2, u8 *buf, int buflen);
350int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
351 u16 len);
352int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel);
353int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);
354int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel);
355void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel);
356
357enum omapdss_version { 311enum omapdss_version {
358 OMAPDSS_VER_UNKNOWN = 0, 312 OMAPDSS_VER_UNKNOWN = 0,
359 OMAPDSS_VER_OMAP24xx, 313 OMAPDSS_VER_OMAP24xx,
@@ -749,10 +703,6 @@ struct omapdss_dsi_ops {
749}; 703};
750 704
751struct omap_dss_device { 705struct omap_dss_device {
752 /* old device, to be removed */
753 struct device old_dev;
754
755 /* new device, pointer to panel device */
756 struct device *dev; 706 struct device *dev;
757 707
758 struct module *owner; 708 struct module *owner;
@@ -765,9 +715,6 @@ struct omap_dss_device {
765 enum omap_display_type type; 715 enum omap_display_type type;
766 enum omap_display_type output_type; 716 enum omap_display_type output_type;
767 717
768 /* obsolete, to be removed */
769 enum omap_channel channel;
770
771 union { 718 union {
772 struct { 719 struct {
773 u8 data_lines; 720 u8 data_lines;
@@ -827,7 +774,7 @@ struct omap_dss_device {
827 774
828 enum omap_display_caps caps; 775 enum omap_display_caps caps;
829 776
830 struct omap_dss_device *output; 777 struct omap_dss_device *src;
831 778
832 enum omap_dss_display_state state; 779 enum omap_dss_display_state state;
833 780
@@ -846,7 +793,7 @@ struct omap_dss_device {
846 /* dynamic fields */ 793 /* dynamic fields */
847 struct omap_overlay_manager *manager; 794 struct omap_overlay_manager *manager;
848 795
849 struct omap_dss_device *device; 796 struct omap_dss_device *dst;
850}; 797};
851 798
852struct omap_dss_hdmi_data 799struct omap_dss_hdmi_data
@@ -857,8 +804,6 @@ struct omap_dss_hdmi_data
857}; 804};
858 805
859struct omap_dss_driver { 806struct omap_dss_driver {
860 struct device_driver driver;
861
862 int (*probe)(struct omap_dss_device *); 807 int (*probe)(struct omap_dss_device *);
863 void (*remove)(struct omap_dss_device *); 808 void (*remove)(struct omap_dss_device *);
864 809
@@ -1023,51 +968,6 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
1023#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) 968#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
1024#define to_dss_device(x) container_of((x), struct omap_dss_device, old_dev) 969#define to_dss_device(x) container_of((x), struct omap_dss_device, old_dev)
1025 970
1026void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
1027 bool enable);
1028int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable);
1029int omapdss_dsi_set_config(struct omap_dss_device *dssdev,
1030 const struct omap_dss_dsi_config *config);
1031
1032int omap_dsi_update(struct omap_dss_device *dssdev, int channel,
1033 void (*callback)(int, void *), void *data);
1034int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel);
1035int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id);
1036void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel);
1037int omapdss_dsi_configure_pins(struct omap_dss_device *dssdev,
1038 const struct omap_dsi_pin_config *pin_cfg);
1039
1040int omapdss_dsi_display_enable(struct omap_dss_device *dssdev);
1041void omapdss_dsi_display_disable(struct omap_dss_device *dssdev,
1042 bool disconnect_lanes, bool enter_ulps);
1043
1044int omapdss_dpi_display_enable(struct omap_dss_device *dssdev);
1045void omapdss_dpi_display_disable(struct omap_dss_device *dssdev);
1046void omapdss_dpi_set_timings(struct omap_dss_device *dssdev,
1047 struct omap_video_timings *timings);
1048int dpi_check_timings(struct omap_dss_device *dssdev,
1049 struct omap_video_timings *timings);
1050void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines);
1051
1052int omapdss_sdi_display_enable(struct omap_dss_device *dssdev);
1053void omapdss_sdi_display_disable(struct omap_dss_device *dssdev);
1054void omapdss_sdi_set_timings(struct omap_dss_device *dssdev,
1055 struct omap_video_timings *timings);
1056void omapdss_sdi_set_datapairs(struct omap_dss_device *dssdev, int datapairs);
1057
1058int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev);
1059void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev);
1060int omap_rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *),
1061 void *data);
1062int omap_rfbi_configure(struct omap_dss_device *dssdev);
1063void omapdss_rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h);
1064void omapdss_rfbi_set_pixel_size(struct omap_dss_device *dssdev,
1065 int pixel_size);
1066void omapdss_rfbi_set_data_lines(struct omap_dss_device *dssdev,
1067 int data_lines);
1068void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev,
1069 struct rfbi_timings *timings);
1070
1071int omapdss_compat_init(void); 971int omapdss_compat_init(void);
1072void omapdss_compat_uninit(void); 972void omapdss_compat_uninit(void);
1073 973
@@ -1111,7 +1011,7 @@ void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
1111 1011
1112static inline bool omapdss_device_is_connected(struct omap_dss_device *dssdev) 1012static inline bool omapdss_device_is_connected(struct omap_dss_device *dssdev)
1113{ 1013{
1114 return dssdev->output; 1014 return dssdev->src;
1115} 1015}
1116 1016
1117static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev) 1017static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index 46aa3d1c1654..4ddd7dc4a61e 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -75,8 +75,10 @@ static inline int xen_acpi_get_pxm(acpi_handle h)
75 return -ENXIO; 75 return -ENXIO;
76} 76}
77 77
78int xen_acpi_notify_hypervisor_state(u8 sleep_state, 78int xen_acpi_notify_hypervisor_sleep(u8 sleep_state,
79 u32 pm1a_cnt, u32 pm1b_cnd); 79 u32 pm1a_cnt, u32 pm1b_cnd);
80int xen_acpi_notify_hypervisor_extended_sleep(u8 sleep_state,
81 u32 val_a, u32 val_b);
80 82
81static inline int xen_acpi_suspend_lowlevel(void) 83static inline int xen_acpi_suspend_lowlevel(void)
82{ 84{
@@ -93,7 +95,9 @@ static inline void xen_acpi_sleep_register(void)
93{ 95{
94 if (xen_initial_domain()) { 96 if (xen_initial_domain()) {
95 acpi_os_set_prepare_sleep( 97 acpi_os_set_prepare_sleep(
96 &xen_acpi_notify_hypervisor_state); 98 &xen_acpi_notify_hypervisor_sleep);
99 acpi_os_set_prepare_extended_sleep(
100 &xen_acpi_notify_hypervisor_extended_sleep);
97 101
98 acpi_suspend_lowlevel = xen_acpi_suspend_lowlevel; 102 acpi_suspend_lowlevel = xen_acpi_suspend_lowlevel;
99 } 103 }
diff --git a/include/xen/balloon.h b/include/xen/balloon.h
index cc2e1a7e44ec..a4c1c6a93691 100644
--- a/include/xen/balloon.h
+++ b/include/xen/balloon.h
@@ -29,6 +29,9 @@ int alloc_xenballooned_pages(int nr_pages, struct page **pages,
29 bool highmem); 29 bool highmem);
30void free_xenballooned_pages(int nr_pages, struct page **pages); 30void free_xenballooned_pages(int nr_pages, struct page **pages);
31 31
32struct page *get_balloon_scratch_page(void);
33void put_balloon_scratch_page(void);
34
32struct device; 35struct device;
33#ifdef CONFIG_XEN_SELFBALLOONING 36#ifdef CONFIG_XEN_SELFBALLOONING
34extern int register_xen_selfballooning(struct device *dev); 37extern int register_xen_selfballooning(struct device *dev);
diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
new file mode 100644
index 000000000000..28e7dcd75e82
--- /dev/null
+++ b/include/xen/interface/io/tpmif.h
@@ -0,0 +1,52 @@
1/******************************************************************************
2 * tpmif.h
3 *
4 * TPM I/O interface for Xen guest OSes, v2
5 *
6 * This file is in the public domain.
7 *
8 */
9
10#ifndef __XEN_PUBLIC_IO_TPMIF_H__
11#define __XEN_PUBLIC_IO_TPMIF_H__
12
13/*
14 * Xenbus state machine
15 *
16 * Device open:
17 * 1. Both ends start in XenbusStateInitialising
18 * 2. Backend transitions to InitWait (frontend does not wait on this step)
19 * 3. Frontend populates ring-ref, event-channel, feature-protocol-v2
20 * 4. Frontend transitions to Initialised
21 * 5. Backend maps grant and event channel, verifies feature-protocol-v2
22 * 6. Backend transitions to Connected
23 * 7. Frontend verifies feature-protocol-v2, transitions to Connected
24 *
25 * Device close:
26 * 1. State is changed to XenbusStateClosing
27 * 2. Frontend transitions to Closed
28 * 3. Backend unmaps grant and event, changes state to InitWait
29 */
30
31enum vtpm_shared_page_state {
32 VTPM_STATE_IDLE, /* no contents / vTPM idle / cancel complete */
33 VTPM_STATE_SUBMIT, /* request ready / vTPM working */
34 VTPM_STATE_FINISH, /* response ready / vTPM idle */
35 VTPM_STATE_CANCEL, /* cancel requested / vTPM working */
36};
37/* The backend should only change state to IDLE or FINISH, while the
38 * frontend should only change to SUBMIT or CANCEL. */
39
40
41struct vtpm_shared_page {
42 uint32_t length; /* request/response length in bytes */
43
44 uint8_t state; /* enum vtpm_shared_page_state */
45 uint8_t locality; /* for the current request */
46 uint8_t pad;
47
48 uint8_t nr_extra_pages; /* extra pages for long packets; may be zero */
49 uint32_t extra_pages[0]; /* grant IDs; length in nr_extra_pages */
50};
51
52#endif
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
index c57d5f67f702..f1331e3e7271 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -152,10 +152,11 @@ DEFINE_GUEST_HANDLE_STRUCT(xenpf_firmware_info_t);
152#define XENPF_enter_acpi_sleep 51 152#define XENPF_enter_acpi_sleep 51
153struct xenpf_enter_acpi_sleep { 153struct xenpf_enter_acpi_sleep {
154 /* IN variables */ 154 /* IN variables */
155 uint16_t pm1a_cnt_val; /* PM1a control value. */ 155 uint16_t val_a; /* PM1a control / sleep type A. */
156 uint16_t pm1b_cnt_val; /* PM1b control value. */ 156 uint16_t val_b; /* PM1b control / sleep type B. */
157 uint32_t sleep_state; /* Which state to enter (Sn). */ 157 uint32_t sleep_state; /* Which state to enter (Sn). */
158 uint32_t flags; /* Must be zero. */ 158#define XENPF_ACPI_SLEEP_EXTENDED 0x00000001
159 uint32_t flags; /* XENPF_ACPI_SLEEP_*. */
159}; 160};
160DEFINE_GUEST_HANDLE_STRUCT(xenpf_enter_acpi_sleep_t); 161DEFINE_GUEST_HANDLE_STRUCT(xenpf_enter_acpi_sleep_t);
161 162
diff --git a/include/xen/interface/vcpu.h b/include/xen/interface/vcpu.h
index 87e6f8a48661..b05288ce3991 100644
--- a/include/xen/interface/vcpu.h
+++ b/include/xen/interface/vcpu.h
@@ -170,4 +170,6 @@ struct vcpu_register_vcpu_info {
170}; 170};
171DEFINE_GUEST_HANDLE_STRUCT(vcpu_register_vcpu_info); 171DEFINE_GUEST_HANDLE_STRUCT(vcpu_register_vcpu_info);
172 172
173/* Send an NMI to the specified VCPU. @extra_arg == NULL. */
174#define VCPUOP_send_nmi 11
173#endif /* __XEN_PUBLIC_VCPU_H__ */ 175#endif /* __XEN_PUBLIC_VCPU_H__ */