aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-02-02 03:43:20 -0500
committerIngo Molnar <mingo@kernel.org>2014-02-02 03:43:20 -0500
commit65370bdf881e20907e7a53abab9b8c0bc5f60a6b (patch)
tree0d32a494e873b7b92dbfab0e67ffeef597ee8108 /include
parente207552e64ea053a33e856828ad7915484911d06 (diff)
parent5cb480f6b488128140c940abff3c36f524a334a8 (diff)
Merge branch 'linus' into core/locking
Refresh the topic. Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h64
-rw-r--r--include/acpi/acpi_drivers.h3
-rw-r--r--include/acpi/acpi_io.h (renamed from include/linux/acpi_io.h)1
-rw-r--r--include/acpi/acpixf.h39
-rw-r--r--include/acpi/actbl.h3
-rw-r--r--include/acpi/actbl1.h10
-rw-r--r--include/acpi/actbl2.h5
-rw-r--r--include/acpi/actbl3.h15
-rw-r--r--include/acpi/actypes.h12
-rw-r--r--include/acpi/platform/acenv.h20
-rw-r--r--include/acpi/platform/aclinux.h4
-rw-r--r--include/asm-generic/audit_change_attr.h4
-rw-r--r--include/asm-generic/audit_write.h6
-rw-r--r--include/asm-generic/fixmap.h97
-rw-r--r--include/asm-generic/hash.h9
-rw-r--r--include/asm-generic/int-l64.h49
-rw-r--r--include/asm-generic/pgtable.h12
-rw-r--r--include/asm-generic/uaccess.h2
-rw-r--r--include/drm/drmP.h81
-rw-r--r--include/drm/drm_agpsupport.h33
-rw-r--r--include/drm/drm_crtc.h30
-rw-r--r--include/drm/drm_crtc_helper.h4
-rw-r--r--include/drm/drm_dp_helper.h35
-rw-r--r--include/drm/drm_mipi_dsi.h158
-rw-r--r--include/drm/drm_os_linux.h37
-rw-r--r--include/drm/drm_panel.h82
-rw-r--r--include/drm/ttm/ttm_bo_driver.h9
-rw-r--r--include/drm/ttm/ttm_object.h18
-rw-r--r--include/dt-bindings/clk/at91.h22
-rw-r--r--include/dt-bindings/clk/exynos-audss-clk.h3
-rw-r--r--include/dt-bindings/clock/exynos4.h244
-rw-r--r--include/dt-bindings/clock/exynos5250.h160
-rw-r--r--include/dt-bindings/clock/exynos5420.h188
-rw-r--r--include/dt-bindings/clock/exynos5440.h42
-rw-r--r--include/dt-bindings/clock/hi3620-clock.h152
-rw-r--r--include/dt-bindings/clock/imx5-clock.h203
-rw-r--r--include/dt-bindings/clock/imx6sl-clock.h4
-rw-r--r--include/dt-bindings/clock/mpc512x-clock.h76
-rw-r--r--include/dt-bindings/clock/qcom,gcc-msm8660.h276
-rw-r--r--include/dt-bindings/clock/qcom,gcc-msm8960.h313
-rw-r--r--include/dt-bindings/clock/qcom,gcc-msm8974.h320
-rw-r--r--include/dt-bindings/clock/qcom,mmcc-msm8960.h137
-rw-r--r--include/dt-bindings/clock/qcom,mmcc-msm8974.h161
-rw-r--r--include/dt-bindings/clock/r8a7790-clock.h107
-rw-r--r--include/dt-bindings/clock/r8a7791-clock.h111
-rw-r--r--include/dt-bindings/clock/tegra114-car.h8
-rw-r--r--include/dt-bindings/clock/tegra124-car.h341
-rw-r--r--include/dt-bindings/clock/tegra20-car.h2
-rw-r--r--include/dt-bindings/clock/tegra30-car.h12
-rw-r--r--include/dt-bindings/clock/vf610-clock.h6
-rw-r--r--include/dt-bindings/gpio/tegra-gpio.h1
-rw-r--r--include/dt-bindings/pinctrl/omap.h20
-rw-r--r--include/dt-bindings/pinctrl/pinctrl-tegra.h45
-rw-r--r--include/dt-bindings/reset/qcom,gcc-msm8660.h134
-rw-r--r--include/dt-bindings/reset/qcom,gcc-msm8960.h118
-rw-r--r--include/dt-bindings/reset/qcom,gcc-msm8974.h96
-rw-r--r--include/dt-bindings/reset/qcom,mmcc-msm8960.h93
-rw-r--r--include/dt-bindings/reset/qcom,mmcc-msm8974.h62
-rw-r--r--include/dt-bindings/thermal/thermal.h17
-rw-r--r--include/kvm/arm_vgic.h2
-rw-r--r--include/linux/acpi.h24
-rw-r--r--include/linux/acpi_gpio.h51
-rw-r--r--include/linux/amba/sp810.h8
-rw-r--r--include/linux/ath9k_platform.h2
-rw-r--r--include/linux/audit.h22
-rw-r--r--include/linux/bcma/bcma.h9
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h1
-rw-r--r--include/linux/bio.h283
-rw-r--r--include/linux/blk-mq.h13
-rw-r--r--include/linux/blk_types.h24
-rw-r--r--include/linux/blkdev.h15
-rw-r--r--include/linux/bootmem.h190
-rw-r--r--include/linux/cache.h4
-rw-r--r--include/linux/ccp.h537
-rw-r--r--include/linux/ceph/buffer.h1
-rw-r--r--include/linux/ceph/ceph_features.h101
-rw-r--r--include/linux/ceph/ceph_fs.h36
-rw-r--r--include/linux/ceph/decode.h17
-rw-r--r--include/linux/ceph/libceph.h19
-rw-r--r--include/linux/ceph/messenger.h17
-rw-r--r--include/linux/ceph/osd_client.h19
-rw-r--r--include/linux/ceph/osdmap.h66
-rw-r--r--include/linux/ceph/rados.h4
-rw-r--r--include/linux/cgroup.h112
-rw-r--r--include/linux/cgroup_subsys.h4
-rw-r--r--include/linux/clk-private.h8
-rw-r--r--include/linux/clk-provider.h48
-rw-r--r--include/linux/clk.h17
-rw-r--r--include/linux/clk/at91_pmc.h192
-rw-r--r--include/linux/clk/shmobile.h19
-rw-r--r--include/linux/clk/tegra.h7
-rw-r--r--include/linux/clk/ti.h298
-rw-r--r--include/linux/clkdev.h5
-rw-r--r--include/linux/cmdline-parser.h8
-rw-r--r--include/linux/compaction.h16
-rw-r--r--include/linux/compat.h20
-rw-r--r--include/linux/compiler-gcc.h3
-rw-r--r--include/linux/compiler-intel.h7
-rw-r--r--include/linux/compiler.h4
-rw-r--r--include/linux/component.h32
-rw-r--r--include/linux/container.h25
-rw-r--r--include/linux/cpu_cooling.h25
-rw-r--r--include/linux/cpufreq.h42
-rw-r--r--include/linux/cramfs_fs.h10
-rw-r--r--include/linux/cramfs_fs_sb.h20
-rw-r--r--include/linux/crush/crush.h20
-rw-r--r--include/linux/crush/mapper.h3
-rw-r--r--include/linux/dm-io.h4
-rw-r--r--include/linux/dma-debug.h6
-rw-r--r--include/linux/dma_remapping.h4
-rw-r--r--include/linux/dmaengine.h52
-rw-r--r--include/linux/dmar.h13
-rw-r--r--include/linux/etherdevice.h118
-rw-r--r--include/linux/export.h1
-rw-r--r--include/linux/extcon/extcon-gpio.h1
-rw-r--r--include/linux/f2fs_fs.h7
-rw-r--r--include/linux/fb.h4
-rw-r--r--include/linux/fdtable.h35
-rw-r--r--include/linux/filter.h5
-rw-r--r--include/linux/firmware.h7
-rw-r--r--include/linux/flex_array.h3
-rw-r--r--include/linux/fs.h1
-rw-r--r--include/linux/fsnotify_backend.h126
-rw-r--r--include/linux/ftrace.h2
-rw-r--r--include/linux/ftrace_event.h139
-rw-r--r--include/linux/genalloc.h2
-rw-r--r--include/linux/generic_acl.h14
-rw-r--r--include/linux/gfp.h1
-rw-r--r--include/linux/gpio.h1
-rw-r--r--include/linux/gpio/driver.h56
-rw-r--r--include/linux/hash.h36
-rw-r--r--include/linux/hid-sensor-ids.h12
-rw-r--r--include/linux/host1x.h6
-rw-r--r--include/linux/huge_mm.h23
-rw-r--r--include/linux/hugetlb.h8
-rw-r--r--include/linux/hugetlb_cgroup.h5
-rw-r--r--include/linux/i2c-pnx.h1
-rw-r--r--include/linux/i2c-smbus.h2
-rw-r--r--include/linux/i2c.h16
-rw-r--r--include/linux/i2c/tsc2007.h8
-rw-r--r--include/linux/i2c/twl.h5
-rw-r--r--include/linux/ide.h8
-rw-r--r--include/linux/ieee80211.h10
-rw-r--r--include/linux/if_macvlan.h37
-rw-r--r--include/linux/if_tunnel.h9
-rw-r--r--include/linux/if_vlan.h38
-rw-r--r--include/linux/iio/buffer.h3
-rw-r--r--include/linux/iio/events.h4
-rw-r--r--include/linux/iio/iio.h115
-rw-r--r--include/linux/iio/types.h1
-rw-r--r--include/linux/inet_lro.h23
-rw-r--r--include/linux/inetdevice.h14
-rw-r--r--include/linux/init.h2
-rw-r--r--include/linux/init_task.h4
-rw-r--r--include/linux/intel-iommu.h3
-rw-r--r--include/linux/interrupt.h2
-rw-r--r--include/linux/iommu.h16
-rw-r--r--include/linux/ipc.h2
-rw-r--r--include/linux/ipc_namespace.h1
-rw-r--r--include/linux/ipv6.h8
-rw-r--r--include/linux/irqchip/arm-gic.h12
-rw-r--r--include/linux/irqchip/xtensa-mx.h17
-rw-r--r--include/linux/irqchip/xtensa-pic.h18
-rw-r--r--include/linux/irqdesc.h8
-rw-r--r--include/linux/iscsi_ibft.h2
-rw-r--r--include/linux/jiffies.h6
-rw-r--r--include/linux/jump_label.h19
-rw-r--r--include/linux/kernel.h32
-rw-r--r--include/linux/kernfs.h376
-rw-r--r--include/linux/kexec.h1
-rw-r--r--include/linux/kobj_completion.h18
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/ksm.h15
-rw-r--r--include/linux/kvm_host.h20
-rw-r--r--include/linux/libata.h2
-rw-r--r--include/linux/linkage.h19
-rw-r--r--include/linux/mdio.h3
-rw-r--r--include/linux/memblock.h55
-rw-r--r--include/linux/memcontrol.h23
-rw-r--r--include/linux/memory.h1
-rw-r--r--include/linux/mempolicy.h32
-rw-r--r--include/linux/mfd/abx500/ab8500-gpio.h33
-rw-r--r--include/linux/mfd/abx500/ab8500.h2
-rw-r--r--include/linux/mfd/arizona/registers.h198
-rw-r--r--include/linux/mfd/as3722.h5
-rw-r--r--include/linux/mfd/lp3943.h114
-rw-r--r--include/linux/mfd/max14577-private.h330
-rw-r--r--include/linux/mfd/max14577.h69
-rw-r--r--include/linux/mfd/max77686-private.h2
-rw-r--r--include/linux/mfd/max8997-private.h2
-rw-r--r--include/linux/mfd/max8998-private.h2
-rw-r--r--include/linux/mfd/mc13xxx.h39
-rw-r--r--include/linux/mfd/samsung/core.h6
-rw-r--r--include/linux/mfd/samsung/s5m8767.h18
-rw-r--r--include/linux/mfd/syscon/imx6q-iomuxc-gpr.h1
-rw-r--r--include/linux/mfd/ti_am335x_tscadc.h8
-rw-r--r--include/linux/mfd/tmio.h8
-rw-r--r--include/linux/mfd/tps6586x.h7
-rw-r--r--include/linux/mfd/tps65910.h5
-rw-r--r--include/linux/migrate.h6
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mlx4/cmd.h2
-rw-r--r--include/linux/mlx4/cq.h20
-rw-r--r--include/linux/mlx4/device.h44
-rw-r--r--include/linux/mlx4/qp.h6
-rw-r--r--include/linux/mlx5/cq.h18
-rw-r--r--include/linux/mlx5/device.h31
-rw-r--r--include/linux/mlx5/qp.h45
-rw-r--r--include/linux/mm.h95
-rw-r--r--include/linux/mman.h1
-rw-r--r--include/linux/mmc/card.h8
-rw-r--r--include/linux/mmc/sdhci.h2
-rw-r--r--include/linux/mmc/sdio_ids.h9
-rw-r--r--include/linux/mmc/tmio.h1
-rw-r--r--include/linux/mmdebug.h9
-rw-r--r--include/linux/mmzone.h11
-rw-r--r--include/linux/module.h64
-rw-r--r--include/linux/msg.h2
-rw-r--r--include/linux/msi.h4
-rw-r--r--include/linux/mtd/mtdram.h2
-rw-r--r--include/linux/mtd/nand.h41
-rw-r--r--include/linux/mtd/partitions.h8
-rw-r--r--include/linux/net.h3
-rw-r--r--include/linux/netdevice.h156
-rw-r--r--include/linux/netfilter/ipset/ip_set.h1
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/nfs_fs.h25
-rw-r--r--include/linux/nls.h3
-rw-r--r--include/linux/of.h7
-rw-r--r--include/linux/of_device.h6
-rw-r--r--include/linux/of_fdt.h1
-rw-r--r--include/linux/of_mdio.h10
-rw-r--r--include/linux/of_mtd.h2
-rw-r--r--include/linux/page-flags.h10
-rw-r--r--include/linux/pagemap.h10
-rw-r--r--include/linux/parser.h1
-rw-r--r--include/linux/pci-ats.h17
-rw-r--r--include/linux/pci.h352
-rw-r--r--include/linux/pci_hotplug.h3
-rw-r--r--include/linux/percpu.h1
-rw-r--r--include/linux/percpu_ida.h3
-rw-r--r--include/linux/phy.h116
-rw-r--r--include/linux/phy/phy.h28
-rw-r--r--include/linux/pinctrl/pinconf-generic.h10
-rw-r--r--include/linux/pinctrl/pinctrl.h2
-rw-r--r--include/linux/pipe_fs_i.h2
-rw-r--r--include/linux/platform_data/asoc-ti-mcbsp.h6
-rw-r--r--include/linux/platform_data/asoc-ux500-msp.h9
-rw-r--r--include/linux/platform_data/clocksource-nomadik-mtu.h9
-rw-r--r--include/linux/platform_data/davinci_asp.h1
-rw-r--r--include/linux/platform_data/dma-imx-sdma.h5
-rw-r--r--include/linux/platform_data/dma-imx.h1
-rw-r--r--include/linux/platform_data/dma-mmp_tdma.h8
-rw-r--r--include/linux/platform_data/dma-mv_xor.h6
-rw-r--r--include/linux/platform_data/eth-netx.h6
-rw-r--r--include/linux/platform_data/gpio-davinci.h3
-rw-r--r--include/linux/platform_data/gpio-lpc32xx.h50
-rw-r--r--include/linux/platform_data/i2c-nomadik.h39
-rw-r--r--include/linux/platform_data/keypad-ep93xx.h10
-rw-r--r--include/linux/platform_data/keypad-omap.h6
-rw-r--r--include/linux/platform_data/leds-kirkwood-netxbig.h8
-rw-r--r--include/linux/platform_data/leds-kirkwood-ns2.h8
-rw-r--r--include/linux/platform_data/mfd-mcp-sa11x0.h6
-rw-r--r--include/linux/platform_data/mtd-nand-omap2.h2
-rw-r--r--include/linux/platform_data/mtd-nand-pxa3xx.h3
-rw-r--r--include/linux/platform_data/mtd-onenand-omap2.h2
-rw-r--r--include/linux/platform_data/mtd-orion_nand.h6
-rw-r--r--include/linux/platform_data/pinctrl-nomadik.h242
-rw-r--r--include/linux/platform_data/pn544.h3
-rw-r--r--include/linux/platform_data/si5351.h16
-rw-r--r--include/linux/platform_data/spi-nuc900.h8
-rw-r--r--include/linux/platform_data/usb-ehci-orion.h6
-rw-r--r--include/linux/platform_data/usb-omap1.h53
-rw-r--r--include/linux/platform_data/video-ep93xx.h10
-rw-r--r--include/linux/platform_data/video-msm_fb.h3
-rw-r--r--include/linux/platform_data/video-pxafb.h2
-rw-r--r--include/linux/platform_data/vsp1.h2
-rw-r--r--include/linux/pm.h21
-rw-r--r--include/linux/pm_runtime.h12
-rw-r--r--include/linux/posix_acl.h100
-rw-r--r--include/linux/posix_acl_xattr.h3
-rw-r--r--include/linux/power/bq2415x_charger.h48
-rw-r--r--include/linux/power/charger-manager.h34
-rw-r--r--include/linux/power/isp1704_charger.h1
-rw-r--r--include/linux/power_supply.h16
-rw-r--r--include/linux/preempt.h5
-rw-r--r--include/linux/printk.h26
-rw-r--r--include/linux/projid.h15
-rw-r--r--include/linux/ramfs.h7
-rw-r--r--include/linux/random.h18
-rw-r--r--include/linux/rcupdate.h2
-rw-r--r--include/linux/reciprocal_div.h39
-rw-r--r--include/linux/regmap.h15
-rw-r--r--include/linux/regulator/act8865.h53
-rw-r--r--include/linux/reset-controller.h1
-rw-r--r--include/linux/rmap.h27
-rw-r--r--include/linux/rwsem.h11
-rw-r--r--include/linux/scatterlist.h1
-rw-r--r--include/linux/sched.h42
-rw-r--r--include/linux/sched/sysctl.h4
-rw-r--r--include/linux/sctp.h7
-rw-r--r--include/linux/serial_bcm63xx.h119
-rw-r--r--include/linux/serial_sci.h52
-rw-r--r--include/linux/sfi_acpi.h5
-rw-r--r--include/linux/sh_eth.h1
-rw-r--r--include/linux/shm.h2
-rw-r--r--include/linux/skbuff.h230
-rw-r--r--include/linux/slab.h9
-rw-r--r--include/linux/slab_def.h6
-rw-r--r--include/linux/smp.h6
-rw-r--r--include/linux/socket.h16
-rw-r--r--include/linux/spi/74x164.h9
-rw-r--r--include/linux/spi/s3c24xx.h2
-rw-r--r--include/linux/spi/spi.h20
-rw-r--r--include/linux/splice.h3
-rw-r--r--include/linux/ssb/ssb.h1
-rw-r--r--include/linux/ssbi.h19
-rw-r--r--include/linux/stmmac.h26
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h5
-rw-r--r--include/linux/sunrpc/svc.h6
-rw-r--r--include/linux/sysfs.h47
-rw-r--r--include/linux/tboot.h2
-rw-r--r--include/linux/tcp.h5
-rw-r--r--include/linux/tegra-powergate.h55
-rw-r--r--include/linux/thermal.h32
-rw-r--r--include/linux/tick.h6
-rw-r--r--include/linux/tpm.h12
-rw-r--r--include/linux/tracepoint.h2
-rw-r--r--include/linux/tty.h9
-rw-r--r--include/linux/tty_flip.h11
-rw-r--r--include/linux/tty_ldisc.h6
-rw-r--r--include/linux/uidgid.h22
-rw-r--r--include/linux/usb.h1
-rw-r--r--include/linux/usb/chipidea.h1
-rw-r--r--include/linux/usb/composite.h2
-rw-r--r--include/linux/usb/functionfs.h30
-rw-r--r--include/linux/usb/gadget.h58
-rw-r--r--include/linux/usb/hcd.h3
-rw-r--r--include/linux/usb/msm_hsusb.h3
-rw-r--r--include/linux/usb/musb.h3
-rw-r--r--include/linux/usb/omap_control_usb.h6
-rw-r--r--include/linux/usb/otg-fsm.h244
-rw-r--r--include/linux/uwb/umc.h2
-rw-r--r--include/linux/vme.h3
-rw-r--r--include/linux/vmpressure.h8
-rw-r--r--include/linux/vmstat.h2
-rw-r--r--include/linux/w1-gpio.h1
-rw-r--r--include/linux/wait.h4
-rw-r--r--include/linux/zsmalloc.h51
-rw-r--r--include/math-emu/op-common.h9
-rw-r--r--include/media/adv7604.h38
-rw-r--r--include/media/adv7842.h59
-rw-r--r--include/media/atmel-isi.h2
-rw-r--r--include/media/media-entity.h1
-rw-r--r--include/media/omap4iss.h65
-rw-r--r--include/media/rc-map.h1
-rw-r--r--include/media/saa6588.h2
-rw-r--r--include/media/saa6752hs.h26
-rw-r--r--include/media/si4713.h2
-rw-r--r--include/media/v4l2-fh.h4
-rw-r--r--include/media/v4l2-int-device.h305
-rw-r--r--include/media/v4l2-mem2mem.h24
-rw-r--r--include/media/v4l2-of.h6
-rw-r--r--include/media/videobuf2-core.h18
-rw-r--r--include/net/Space.h31
-rw-r--r--include/net/act_api.h63
-rw-r--r--include/net/addrconf.h16
-rw-r--r--include/net/arp.h1
-rw-r--r--include/net/bluetooth/bluetooth.h3
-rw-r--r--include/net/bluetooth/hci.h10
-rw-r--r--include/net/bluetooth/hci_core.h7
-rw-r--r--include/net/bluetooth/l2cap.h46
-rw-r--r--include/net/cfg80211.h323
-rw-r--r--include/net/cipso_ipv4.h5
-rw-r--r--include/net/cls_cgroup.h40
-rw-r--r--include/net/codel.h4
-rw-r--r--include/net/dcbevent.h3
-rw-r--r--include/net/dcbnl.h3
-rw-r--r--include/net/dn_dev.h2
-rw-r--r--include/net/dst.h5
-rw-r--r--include/net/flow.h3
-rw-r--r--include/net/genetlink.h4
-rw-r--r--include/net/gre.h3
-rw-r--r--include/net/if_inet6.h2
-rw-r--r--include/net/inet_timewait_sock.h6
-rw-r--r--include/net/inetpeer.h1
-rw-r--r--include/net/ip.h42
-rw-r--r--include/net/ip6_fib.h2
-rw-r--r--include/net/ip6_route.h34
-rw-r--r--include/net/ip6_tunnel.h2
-rw-r--r--include/net/ip_tunnels.h10
-rw-r--r--include/net/ipv6.h26
-rw-r--r--include/net/irda/discovery.h4
-rw-r--r--include/net/irda/ircomm_core.h4
-rw-r--r--include/net/irda/ircomm_event.h4
-rw-r--r--include/net/irda/ircomm_lmp.h4
-rw-r--r--include/net/irda/ircomm_param.h4
-rw-r--r--include/net/irda/ircomm_ttp.h4
-rw-r--r--include/net/irda/ircomm_tty.h4
-rw-r--r--include/net/irda/ircomm_tty_attach.h4
-rw-r--r--include/net/irda/irda_device.h4
-rw-r--r--include/net/irda/irlap_event.h4
-rw-r--r--include/net/irda/irlap_frame.h4
-rw-r--r--include/net/irda/parameters.h4
-rw-r--r--include/net/irda/qos.h4
-rw-r--r--include/net/llc.h1
-rw-r--r--include/net/mac80211.h138
-rw-r--r--include/net/mip6.h3
-rw-r--r--include/net/neighbour.h83
-rw-r--r--include/net/netfilter/ipv4/nf_conntrack_ipv4.h2
-rw-r--r--include/net/netfilter/ipv4/nf_reject.h128
-rw-r--r--include/net/netfilter/ipv6/nf_reject.h171
-rw-r--r--include/net/netfilter/nf_conntrack_l3proto.h1
-rw-r--r--include/net/netfilter/nf_queue.h62
-rw-r--r--include/net/netfilter/nf_tables.h47
-rw-r--r--include/net/netfilter/nf_tables_ipv4.h5
-rw-r--r--include/net/netfilter/nf_tables_ipv6.h3
-rw-r--r--include/net/netlabel.h5
-rw-r--r--include/net/netns/conntrack.h33
-rw-r--r--include/net/netns/ipv4.h2
-rw-r--r--include/net/netns/ipv6.h2
-rw-r--r--include/net/netns/nftables.h1
-rw-r--r--include/net/netns/xfrm.h6
-rw-r--r--include/net/netprio_cgroup.h18
-rw-r--r--include/net/nfc/digital.h10
-rw-r--r--include/net/nfc/hci.h4
-rw-r--r--include/net/nfc/llc.h4
-rw-r--r--include/net/nfc/nci.h3
-rw-r--r--include/net/nfc/nci_core.h5
-rw-r--r--include/net/nfc/nfc.h4
-rw-r--r--include/net/ping.h16
-rw-r--r--include/net/pkt_cls.h67
-rw-r--r--include/net/pkt_sched.h1
-rw-r--r--include/net/protocol.h10
-rw-r--r--include/net/red.h5
-rw-r--r--include/net/regulatory.h84
-rw-r--r--include/net/route.h27
-rw-r--r--include/net/rtnetlink.h17
-rw-r--r--include/net/sch_generic.h4
-rw-r--r--include/net/sctp/auth.h5
-rw-r--r--include/net/sctp/checksum.h5
-rw-r--r--include/net/sctp/command.h5
-rw-r--r--include/net/sctp/constants.h5
-rw-r--r--include/net/sctp/sctp.h32
-rw-r--r--include/net/sctp/sm.h5
-rw-r--r--include/net/sctp/structs.h65
-rw-r--r--include/net/sctp/tsnmap.h5
-rw-r--r--include/net/sctp/ulpevent.h5
-rw-r--r--include/net/sctp/ulpqueue.h5
-rw-r--r--include/net/sock.h26
-rw-r--r--include/net/tc_act/tc_skbedit.h3
-rw-r--r--include/net/tcp.h11
-rw-r--r--include/net/transp_v6.h9
-rw-r--r--include/net/vxlan.h1
-rw-r--r--include/net/xfrm.h36
-rw-r--r--include/rdma/ib_addr.h69
-rw-r--r--include/rdma/ib_cm.h1
-rw-r--r--include/rdma/ib_pack.h1
-rw-r--r--include/rdma/ib_sa.h3
-rw-r--r--include/rdma/ib_verbs.h42
-rw-r--r--include/scsi/iscsi_if.h230
-rw-r--r--include/scsi/libiscsi.h1
-rw-r--r--include/scsi/osd_ore.h1
-rw-r--r--include/scsi/scsi.h1
-rw-r--r--include/scsi/scsi_cmnd.h1
-rw-r--r--include/scsi/scsi_driver.h2
-rw-r--r--include/scsi/scsi_host.h10
-rw-r--r--include/scsi/scsi_transport_iscsi.h4
-rw-r--r--include/scsi/scsi_transport_srp.h36
-rw-r--r--include/sound/cs42l52.h14
-rw-r--r--include/sound/dmaengine_pcm.h10
-rw-r--r--include/sound/hda_verbs.h554
-rw-r--r--include/sound/memalloc.h7
-rw-r--r--include/sound/pcm.h3
-rw-r--r--include/sound/pcm_params.h12
-rw-r--r--include/sound/rcar_snd.h4
-rw-r--r--include/sound/soc-dai.h8
-rw-r--r--include/sound/soc-dapm.h1
-rw-r--r--include/sound/soc-dpcm.h22
-rw-r--r--include/sound/soc.h22
-rw-r--r--include/sound/spear_dma.h1
-rw-r--r--include/target/iscsi/iscsi_transport.h2
-rw-r--r--include/target/target_core_backend.h7
-rw-r--r--include/target/target_core_base.h82
-rw-r--r--include/target/target_core_fabric.h3
-rw-r--r--include/trace/events/bcache.h36
-rw-r--r--include/trace/events/block.h26
-rw-r--r--include/trace/events/btrfs.h23
-rw-r--r--include/trace/events/compaction.h42
-rw-r--r--include/trace/events/f2fs.h111
-rw-r--r--include/trace/events/migrate.h26
-rw-r--r--include/trace/events/net.h158
-rw-r--r--include/trace/events/power.h53
-rw-r--r--include/trace/events/sched.h87
-rw-r--r--include/trace/events/sunrpc.h1
-rw-r--r--include/trace/events/v4l2.h157
-rw-r--r--include/trace/ftrace.h29
-rw-r--r--include/uapi/asm-generic/ipcbuf.h4
-rw-r--r--include/uapi/asm-generic/msgbuf.h10
-rw-r--r--include/uapi/asm-generic/shmbuf.h24
-rw-r--r--include/uapi/asm-generic/socket.h2
-rw-r--r--include/uapi/asm-generic/types.h3
-rw-r--r--include/uapi/drm/drm.h1
-rw-r--r--include/uapi/drm/i915_drm.h21
-rw-r--r--include/uapi/drm/radeon_drm.h2
-rw-r--r--include/uapi/drm/vmwgfx_drm.h260
-rw-r--r--include/uapi/linux/apm_bios.h2
-rw-r--r--include/uapi/linux/audit.h8
-rw-r--r--include/uapi/linux/bcache.h3
-rw-r--r--include/uapi/linux/btrfs.h13
-rw-r--r--include/uapi/linux/dm-log-userspace.h20
-rw-r--r--include/uapi/linux/dn.h1
-rw-r--r--include/uapi/linux/fd.h3
-rw-r--r--include/uapi/linux/genwqe/genwqe_card.h500
-rw-r--r--include/uapi/linux/gfs2_ondisk.h11
-rw-r--r--include/uapi/linux/if_addr.h6
-rw-r--r--include/uapi/linux/if_arp.h1
-rw-r--r--include/uapi/linux/if_link.h48
-rw-r--r--include/uapi/linux/if_packet.h29
-rw-r--r--include/uapi/linux/in6.h6
-rw-r--r--include/uapi/linux/kvm.h2
-rw-r--r--include/uapi/linux/media.h1
-rw-r--r--include/uapi/linux/mqueue.h10
-rw-r--r--include/uapi/linux/msg.h4
-rw-r--r--include/uapi/linux/neighbour.h2
-rw-r--r--include/uapi/linux/net_tstamp.h16
-rw-r--r--include/uapi/linux/netconf.h1
-rw-r--r--include/uapi/linux/netfilter.h1
-rw-r--r--include/uapi/linux/netfilter/Kbuild3
-rw-r--r--include/uapi/linux/netfilter/nf_nat.h12
-rw-r--r--include/uapi/linux/netfilter/nf_tables.h30
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_queue.h5
-rw-r--r--include/uapi/linux/netfilter/xt_cgroup.h11
-rw-r--r--include/uapi/linux/netfilter/xt_ipcomp.h16
-rw-r--r--include/uapi/linux/netfilter/xt_l2tp.h27
-rw-r--r--include/uapi/linux/netfilter/xt_osf.h3
-rw-r--r--include/uapi/linux/nfs4.h2
-rw-r--r--include/uapi/linux/nl80211.h129
-rw-r--r--include/uapi/linux/openvswitch.h14
-rw-r--r--include/uapi/linux/pci_regs.h42
-rw-r--r--include/uapi/linux/perf_event.h2
-rw-r--r--include/uapi/linux/pkt_sched.h53
-rw-r--r--include/uapi/linux/ppp-ioctl.h1
-rw-r--r--include/uapi/linux/raid/md_p.h6
-rw-r--r--include/uapi/linux/resource.h32
-rw-r--r--include/uapi/linux/sctp.h5
-rw-r--r--include/uapi/linux/shm.h10
-rw-r--r--include/uapi/linux/snmp.h1
-rw-r--r--include/uapi/linux/sockios.h3
-rw-r--r--include/uapi/linux/tc_act/tc_ipt.h1
-rw-r--r--include/uapi/linux/tcp_metrics.h2
-rw-r--r--include/uapi/linux/timex.h34
-rw-r--r--include/uapi/linux/v4l2-controls.h9
-rw-r--r--include/uapi/linux/v4l2-mediabus.h3
-rw-r--r--include/uapi/linux/videodev2.h4
-rw-r--r--include/uapi/linux/vsp1.h34
-rw-r--r--include/uapi/linux/xattr.h3
-rw-r--r--include/uapi/sound/compress_params.h10
-rw-r--r--include/video/pxa168fb.h2
-rw-r--r--include/xen/events.h9
-rw-r--r--include/xen/grant_table.h17
-rw-r--r--include/xen/interface/elfnote.h13
-rw-r--r--include/xen/interface/event_channel.h68
-rw-r--r--include/xen/interface/xen.h6
-rw-r--r--include/xen/platform_pci.h25
-rw-r--r--include/xen/xen.h14
566 files changed, 14947 insertions, 3834 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index ddabed1f51c2..8256eb4ad057 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -28,8 +28,6 @@
28 28
29#include <linux/device.h> 29#include <linux/device.h>
30 30
31#include <acpi/acpi.h>
32
33/* TBD: Make dynamic */ 31/* TBD: Make dynamic */
34#define ACPI_MAX_HANDLES 10 32#define ACPI_MAX_HANDLES 10
35struct acpi_handle_list { 33struct acpi_handle_list {
@@ -66,6 +64,32 @@ bool acpi_ata_match(acpi_handle handle);
66bool acpi_bay_match(acpi_handle handle); 64bool acpi_bay_match(acpi_handle handle);
67bool acpi_dock_match(acpi_handle handle); 65bool acpi_dock_match(acpi_handle handle);
68 66
67bool acpi_check_dsm(acpi_handle handle, const u8 *uuid, int rev, u64 funcs);
68union acpi_object *acpi_evaluate_dsm(acpi_handle handle, const u8 *uuid,
69 int rev, int func, union acpi_object *argv4);
70
71static inline union acpi_object *
72acpi_evaluate_dsm_typed(acpi_handle handle, const u8 *uuid, int rev, int func,
73 union acpi_object *argv4, acpi_object_type type)
74{
75 union acpi_object *obj;
76
77 obj = acpi_evaluate_dsm(handle, uuid, rev, func, argv4);
78 if (obj && obj->type != type) {
79 ACPI_FREE(obj);
80 obj = NULL;
81 }
82
83 return obj;
84}
85
86#define ACPI_INIT_DSM_ARGV4(cnt, eles) \
87 { \
88 .package.type = ACPI_TYPE_PACKAGE, \
89 .package.count = (cnt), \
90 .package.elements = (eles) \
91 }
92
69#ifdef CONFIG_ACPI 93#ifdef CONFIG_ACPI
70 94
71#include <linux/proc_fs.h> 95#include <linux/proc_fs.h>
@@ -91,17 +115,11 @@ struct acpi_device;
91 * ----------------- 115 * -----------------
92 */ 116 */
93 117
94enum acpi_hotplug_mode {
95 AHM_GENERIC = 0,
96 AHM_CONTAINER,
97 AHM_COUNT
98};
99
100struct acpi_hotplug_profile { 118struct acpi_hotplug_profile {
101 struct kobject kobj; 119 struct kobject kobj;
120 int (*scan_dependent)(struct acpi_device *adev);
102 bool enabled:1; 121 bool enabled:1;
103 bool ignore:1; 122 bool demand_offline:1;
104 enum acpi_hotplug_mode mode;
105}; 123};
106 124
107static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile( 125static inline struct acpi_hotplug_profile *to_acpi_hotplug_profile(
@@ -169,8 +187,10 @@ struct acpi_device_flags {
169 u32 ejectable:1; 187 u32 ejectable:1;
170 u32 power_manageable:1; 188 u32 power_manageable:1;
171 u32 match_driver:1; 189 u32 match_driver:1;
190 u32 initialized:1;
191 u32 visited:1;
172 u32 no_hotplug:1; 192 u32 no_hotplug:1;
173 u32 reserved:26; 193 u32 reserved:24;
174}; 194};
175 195
176/* File System */ 196/* File System */
@@ -300,6 +320,7 @@ struct acpi_device {
300 struct list_head children; 320 struct list_head children;
301 struct list_head node; 321 struct list_head node;
302 struct list_head wakeup_list; 322 struct list_head wakeup_list;
323 struct list_head del_list;
303 struct acpi_device_status status; 324 struct acpi_device_status status;
304 struct acpi_device_flags flags; 325 struct acpi_device_flags flags;
305 struct acpi_device_pnp pnp; 326 struct acpi_device_pnp pnp;
@@ -325,6 +346,11 @@ static inline void *acpi_driver_data(struct acpi_device *d)
325#define to_acpi_device(d) container_of(d, struct acpi_device, dev) 346#define to_acpi_device(d) container_of(d, struct acpi_device, dev)
326#define to_acpi_driver(d) container_of(d, struct acpi_driver, drv) 347#define to_acpi_driver(d) container_of(d, struct acpi_driver, drv)
327 348
349static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta)
350{
351 *((u32 *)&adev->status) = sta;
352}
353
328/* acpi_device.dev.bus == &acpi_bus_type */ 354/* acpi_device.dev.bus == &acpi_bus_type */
329extern struct bus_type acpi_bus_type; 355extern struct bus_type acpi_bus_type;
330 356
@@ -387,6 +413,11 @@ int acpi_match_device_ids(struct acpi_device *device,
387int acpi_create_dir(struct acpi_device *); 413int acpi_create_dir(struct acpi_device *);
388void acpi_remove_dir(struct acpi_device *); 414void acpi_remove_dir(struct acpi_device *);
389 415
416static inline bool acpi_device_enumerated(struct acpi_device *adev)
417{
418 return adev && adev->flags.initialized && adev->flags.visited;
419}
420
390typedef void (*acpi_hp_callback)(void *data, u32 src); 421typedef void (*acpi_hp_callback)(void *data, u32 src);
391 422
392acpi_status acpi_hotplug_execute(acpi_hp_callback func, void *data, u32 src); 423acpi_status acpi_hotplug_execute(acpi_hp_callback func, void *data, u32 src);
@@ -410,7 +441,7 @@ struct acpi_bus_type {
410 struct list_head list; 441 struct list_head list;
411 const char *name; 442 const char *name;
412 bool (*match)(struct device *dev); 443 bool (*match)(struct device *dev);
413 int (*find_device) (struct device *, acpi_handle *); 444 struct acpi_device * (*find_companion)(struct device *);
414 void (*setup)(struct device *); 445 void (*setup)(struct device *);
415 void (*cleanup)(struct device *); 446 void (*cleanup)(struct device *);
416}; 447};
@@ -429,12 +460,9 @@ struct acpi_pci_root {
429}; 460};
430 461
431/* helper */ 462/* helper */
432acpi_handle acpi_find_child(acpi_handle, u64, bool); 463
433static inline acpi_handle acpi_get_child(acpi_handle handle, u64 addr) 464struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
434{ 465 u64 address, bool check_children);
435 return acpi_find_child(handle, addr, false);
436}
437void acpi_preset_companion(struct device *dev, acpi_handle parent, u64 addr);
438int acpi_is_root_bridge(acpi_handle); 466int acpi_is_root_bridge(acpi_handle);
439struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); 467struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
440 468
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 1cedfcb1bd88..b124fdb26046 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -26,9 +26,6 @@
26#ifndef __ACPI_DRIVERS_H__ 26#ifndef __ACPI_DRIVERS_H__
27#define __ACPI_DRIVERS_H__ 27#define __ACPI_DRIVERS_H__
28 28
29#include <linux/acpi.h>
30#include <acpi/acpi_bus.h>
31
32#define ACPI_MAX_STRING 80 29#define ACPI_MAX_STRING 80
33 30
34/* 31/*
diff --git a/include/linux/acpi_io.h b/include/acpi/acpi_io.h
index b0ffa219993e..2be858018c7f 100644
--- a/include/linux/acpi_io.h
+++ b/include/acpi/acpi_io.h
@@ -2,7 +2,6 @@
2#define _ACPI_IO_H_ 2#define _ACPI_IO_H_
3 3
4#include <linux/io.h> 4#include <linux/io.h>
5#include <acpi/acpi.h>
6 5
7static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys, 6static inline void __iomem *acpi_os_ioremap(acpi_physical_address phys,
8 acpi_size size) 7 acpi_size size)
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 4278aba96503..fea6773f87fc 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 0x20131115 49#define ACPI_CA_VERSION 0x20131218
50 50
51#include <acpi/acconfig.h> 51#include <acpi/acconfig.h>
52#include <acpi/actypes.h> 52#include <acpi/actypes.h>
@@ -54,7 +54,6 @@
54#include <acpi/acbuffer.h> 54#include <acpi/acbuffer.h>
55 55
56extern u8 acpi_gbl_permanent_mmap; 56extern u8 acpi_gbl_permanent_mmap;
57extern u32 acpi_rsdt_forced;
58 57
59/* 58/*
60 * Globals that are publically available 59 * Globals that are publically available
@@ -72,17 +71,19 @@ extern u32 acpi_dbg_layer;
72 71
73/* ACPICA runtime options */ 72/* ACPICA runtime options */
74 73
75extern u8 acpi_gbl_enable_interpreter_slack;
76extern u8 acpi_gbl_all_methods_serialized; 74extern u8 acpi_gbl_all_methods_serialized;
77extern u8 acpi_gbl_create_osi_method;
78extern u8 acpi_gbl_use_default_register_widths;
79extern acpi_name acpi_gbl_trace_method_name;
80extern u32 acpi_gbl_trace_flags;
81extern bool acpi_gbl_enable_aml_debug_object;
82extern u8 acpi_gbl_copy_dsdt_locally; 75extern u8 acpi_gbl_copy_dsdt_locally;
83extern u8 acpi_gbl_truncate_io_addresses; 76extern u8 acpi_gbl_create_osi_method;
84extern u8 acpi_gbl_disable_auto_repair; 77extern u8 acpi_gbl_disable_auto_repair;
85extern u8 acpi_gbl_disable_ssdt_table_load; 78extern u8 acpi_gbl_disable_ssdt_table_load;
79extern u8 acpi_gbl_do_not_use_xsdt;
80extern u8 acpi_gbl_enable_aml_debug_object;
81extern u8 acpi_gbl_enable_interpreter_slack;
82extern u32 acpi_gbl_trace_flags;
83extern acpi_name acpi_gbl_trace_method_name;
84extern u8 acpi_gbl_truncate_io_addresses;
85extern u8 acpi_gbl_use32_bit_fadt_addresses;
86extern u8 acpi_gbl_use_default_register_widths;
86 87
87/* 88/*
88 * Hardware-reduced prototypes. All interfaces that use these macros will 89 * Hardware-reduced prototypes. All interfaces that use these macros will
@@ -130,10 +131,9 @@ acpi_status __init acpi_terminate(void);
130 * Miscellaneous global interfaces 131 * Miscellaneous global interfaces
131 */ 132 */
132ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) 133ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
133
134ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) 134ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
135#ifdef ACPI_FUTURE_USAGE 135#ifdef ACPI_FUTURE_USAGE
136 acpi_status acpi_subsystem_status(void); 136acpi_status acpi_subsystem_status(void);
137#endif 137#endif
138 138
139#ifdef ACPI_FUTURE_USAGE 139#ifdef ACPI_FUTURE_USAGE
@@ -278,16 +278,13 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
278 acpi_install_sci_handler(acpi_sci_handler 278 acpi_install_sci_handler(acpi_sci_handler
279 address, 279 address,
280 void *context)) 280 void *context))
281
282ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 281ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
283 acpi_remove_sci_handler(acpi_sci_handler 282 acpi_remove_sci_handler(acpi_sci_handler
284 address)) 283 address))
285
286ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 284ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
287 acpi_install_global_event_handler 285 acpi_install_global_event_handler
288 (acpi_gbl_event_handler handler, 286 (acpi_gbl_event_handler handler,
289 void *context)) 287 void *context))
290
291ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 288ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
292 acpi_install_fixed_event_handler(u32 289 acpi_install_fixed_event_handler(u32
293 acpi_event, 290 acpi_event,
@@ -295,12 +292,10 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
295 handler, 292 handler,
296 void 293 void
297 *context)) 294 *context))
298
299ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 295ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
300 acpi_remove_fixed_event_handler(u32 acpi_event, 296 acpi_remove_fixed_event_handler(u32 acpi_event,
301 acpi_event_handler 297 acpi_event_handler
302 handler)) 298 handler))
303
304ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 299ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
305 acpi_install_gpe_handler(acpi_handle 300 acpi_install_gpe_handler(acpi_handle
306 gpe_device, 301 gpe_device,
@@ -309,15 +304,14 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
309 acpi_gpe_handler 304 acpi_gpe_handler
310 address, 305 address,
311 void *context)) 306 void *context))
312
313ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 307ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
314 acpi_remove_gpe_handler(acpi_handle gpe_device, 308 acpi_remove_gpe_handler(acpi_handle gpe_device,
315 u32 gpe_number, 309 u32 gpe_number,
316 acpi_gpe_handler 310 acpi_gpe_handler
317 address)) 311 address))
318acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type, 312acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type,
319 acpi_notify_handler handler, 313 acpi_notify_handler handler,
320 void *context); 314 void *context);
321 315
322acpi_status 316acpi_status
323acpi_remove_notify_handler(acpi_handle device, 317acpi_remove_notify_handler(acpi_handle device,
@@ -366,7 +360,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
366 360
367ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 361ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
368 acpi_disable_event(u32 event, u32 flags)) 362 acpi_disable_event(u32 event, u32 flags))
369
370ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event)) 363ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
371 364
372ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 365ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
@@ -404,20 +397,16 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
404 parent_device, 397 parent_device,
405 acpi_handle gpe_device, 398 acpi_handle gpe_device,
406 u32 gpe_number)) 399 u32 gpe_number))
407
408ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 400ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
409 acpi_set_gpe_wake_mask(acpi_handle gpe_device, 401 acpi_set_gpe_wake_mask(acpi_handle gpe_device,
410 u32 gpe_number, 402 u32 gpe_number,
411 u8 action)) 403 u8 action))
412
413ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 404ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
414 acpi_get_gpe_status(acpi_handle gpe_device, 405 acpi_get_gpe_status(acpi_handle gpe_device,
415 u32 gpe_number, 406 u32 gpe_number,
416 acpi_event_status 407 acpi_event_status
417 *event_status)) 408 *event_status))
418
419ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void)) 409ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
420
421ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void)) 410ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
422 411
423ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 412ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
@@ -431,7 +420,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
431 *gpe_block_address, 420 *gpe_block_address,
432 u32 register_count, 421 u32 register_count,
433 u32 interrupt_number)) 422 u32 interrupt_number))
434
435ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 423ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
436 acpi_remove_gpe_block(acpi_handle gpe_device)) 424 acpi_remove_gpe_block(acpi_handle gpe_device))
437 425
@@ -532,7 +520,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
532#ifdef ACPI_FUTURE_USAGE 520#ifdef ACPI_FUTURE_USAGE
533ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 521ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
534 acpi_get_timer_resolution(u32 *resolution)) 522 acpi_get_timer_resolution(u32 *resolution))
535
536ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks)) 523ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
537 524
538ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 525ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 94970880126f..325aeae1fa99 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -182,6 +182,9 @@ struct acpi_table_xsdt {
182 u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ 182 u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
183}; 183};
184 184
185#define ACPI_RSDT_ENTRY_SIZE (sizeof (u32))
186#define ACPI_XSDT_ENTRY_SIZE (sizeof (u64))
187
185/******************************************************************************* 188/*******************************************************************************
186 * 189 *
187 * FACS - Firmware ACPI Control Structure (FACS) 190 * FACS - Firmware ACPI Control Structure (FACS)
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 556c83ee6b42..4ec8c194bfe5 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -457,7 +457,7 @@ struct acpi_hest_aer_common {
457 u8 enabled; 457 u8 enabled;
458 u32 records_to_preallocate; 458 u32 records_to_preallocate;
459 u32 max_sections_per_record; 459 u32 max_sections_per_record;
460 u32 bus; 460 u32 bus; /* Bus and Segment numbers */
461 u16 device; 461 u16 device;
462 u16 function; 462 u16 function;
463 u16 device_control; 463 u16 device_control;
@@ -473,6 +473,14 @@ struct acpi_hest_aer_common {
473#define ACPI_HEST_FIRMWARE_FIRST (1) 473#define ACPI_HEST_FIRMWARE_FIRST (1)
474#define ACPI_HEST_GLOBAL (1<<1) 474#define ACPI_HEST_GLOBAL (1<<1)
475 475
476/*
477 * Macros to access the bus/segment numbers in Bus field above:
478 * Bus number is encoded in bits 7:0
479 * Segment number is encoded in bits 23:8
480 */
481#define ACPI_HEST_BUS(bus) ((bus) & 0xFF)
482#define ACPI_HEST_SEGMENT(bus) (((bus) >> 8) & 0xFFFF)
483
476/* Hardware Error Notification */ 484/* Hardware Error Notification */
477 485
478struct acpi_hest_notify { 486struct acpi_hest_notify {
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 40f7ed115452..094a906a0e98 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -327,6 +327,11 @@ struct acpi_table_dbg2 {
327 u32 info_count; 327 u32 info_count;
328}; 328};
329 329
330struct acpi_dbg2_header {
331 u32 info_offset;
332 u32 info_count;
333};
334
330/* Debug Device Information Subtable */ 335/* Debug Device Information Subtable */
331 336
332struct acpi_dbg2_device { 337struct acpi_dbg2_device {
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
index e2c0931a3d67..01c2a9013e40 100644
--- a/include/acpi/actbl3.h
+++ b/include/acpi/actbl3.h
@@ -374,16 +374,22 @@ struct acpi_mpst_shared {
374struct acpi_table_pcct { 374struct acpi_table_pcct {
375 struct acpi_table_header header; /* Common ACPI table header */ 375 struct acpi_table_header header; /* Common ACPI table header */
376 u32 flags; 376 u32 flags;
377 u32 latency; 377 u64 reserved;
378 u32 reserved;
379}; 378};
380 379
381/* Values for Flags field above */ 380/* Values for Flags field above */
382 381
383#define ACPI_PCCT_DOORBELL 1 382#define ACPI_PCCT_DOORBELL 1
384 383
384/* Values for subtable type in struct acpi_subtable_header */
385
386enum acpi_pcct_type {
387 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
388 ACPI_PCCT_TYPE_RESERVED = 1 /* 1 and greater are reserved */
389};
390
385/* 391/*
386 * PCCT subtables 392 * PCCT Subtables, correspond to Type in struct acpi_subtable_header
387 */ 393 */
388 394
389/* 0: Generic Communications Subspace */ 395/* 0: Generic Communications Subspace */
@@ -396,6 +402,9 @@ struct acpi_pcct_subspace {
396 struct acpi_generic_address doorbell_register; 402 struct acpi_generic_address doorbell_register;
397 u64 preserve_mask; 403 u64 preserve_mask;
398 u64 write_mask; 404 u64 write_mask;
405 u32 latency;
406 u32 max_access_rate;
407 u16 min_turnaround_time;
399}; 408};
400 409
401/* 410/*
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 809b1a0fee7f..68a3ada689c9 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -928,8 +928,8 @@ struct acpi_object_list {
928 * Miscellaneous common Data Structures used by the interfaces 928 * Miscellaneous common Data Structures used by the interfaces
929 */ 929 */
930#define ACPI_NO_BUFFER 0 930#define ACPI_NO_BUFFER 0
931#define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) 931#define ACPI_ALLOCATE_BUFFER (acpi_size) (-1) /* Let ACPICA allocate buffer */
932#define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) 932#define ACPI_ALLOCATE_LOCAL_BUFFER (acpi_size) (-2) /* For internal use only (enables tracking) */
933 933
934struct acpi_buffer { 934struct acpi_buffer {
935 acpi_size length; /* Length in bytes of the buffer */ 935 acpi_size length; /* Length in bytes of the buffer */
@@ -937,14 +937,6 @@ struct acpi_buffer {
937}; 937};
938 938
939/* 939/*
940 * Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_BUFFER.
941 * Note: We use acpi_os_free here because acpi_os_allocate was used to allocate
942 * the buffer. This purposefully bypasses the internal allocation tracking
943 * mechanism (if it is enabled).
944 */
945#define ACPI_FREE_BUFFER(b) acpi_os_free((b).pointer)
946
947/*
948 * name_type for acpi_get_name 940 * name_type for acpi_get_name
949 */ 941 */
950#define ACPI_FULL_PATHNAME 0 942#define ACPI_FULL_PATHNAME 0
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 974d3ef7c141..b402eb67af83 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -96,13 +96,14 @@
96#endif 96#endif
97 97
98/* 98/*
99 * acpi_bin/acpi_dump/acpi_src/acpi_xtract configuration. All single 99 * acpi_bin/acpi_dump/acpi_src/acpi_xtract/Example configuration. All single
100 * threaded, with no debug output. 100 * threaded, with no debug output.
101 */ 101 */
102#if (defined ACPI_BIN_APP) || \ 102#if (defined ACPI_BIN_APP) || \
103 (defined ACPI_DUMP_APP) || \ 103 (defined ACPI_DUMP_APP) || \
104 (defined ACPI_SRC_APP) || \ 104 (defined ACPI_SRC_APP) || \
105 (defined ACPI_XTRACT_APP) 105 (defined ACPI_XTRACT_APP) || \
106 (defined ACPI_EXAMPLE_APP)
106#define ACPI_APPLICATION 107#define ACPI_APPLICATION
107#define ACPI_SINGLE_THREADED 108#define ACPI_SINGLE_THREADED
108#endif 109#endif
@@ -394,4 +395,13 @@ typedef char *va_list;
394 395
395#endif /* ACPI_USE_SYSTEM_CLIBRARY */ 396#endif /* ACPI_USE_SYSTEM_CLIBRARY */
396 397
398#ifndef ACPI_FILE
399#ifdef ACPI_APPLICATION
400#include <stdio.h>
401#define ACPI_FILE FILE *
402#else
403#define ACPI_FILE void *
404#endif /* ACPI_APPLICATION */
405#endif /* ACPI_FILE */
406
397#endif /* __ACENV_H__ */ 407#endif /* __ACENV_H__ */
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 28f4f4dba0b6..008aa287c7a9 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -239,10 +239,6 @@ void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);
239 */ 239 */
240void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size); 240void early_acpi_os_unmap_memory(void __iomem * virt, acpi_size size);
241 241
242void acpi_os_gpe_count(u32 gpe_number);
243
244void acpi_os_fixed_event_count(u32 fixed_event_number);
245
246#endif /* __KERNEL__ */ 242#endif /* __KERNEL__ */
247 243
248#endif /* __ACLINUX_H__ */ 244#endif /* __ACLINUX_H__ */
diff --git a/include/asm-generic/audit_change_attr.h b/include/asm-generic/audit_change_attr.h
index 89b73e5d0fd0..a1865537339b 100644
--- a/include/asm-generic/audit_change_attr.h
+++ b/include/asm-generic/audit_change_attr.h
@@ -4,9 +4,11 @@ __NR_chmod,
4__NR_fchmod, 4__NR_fchmod,
5#ifdef __NR_chown 5#ifdef __NR_chown
6__NR_chown, 6__NR_chown,
7__NR_fchown,
8__NR_lchown, 7__NR_lchown,
9#endif 8#endif
9#ifdef __NR_fchown
10__NR_fchown,
11#endif
10__NR_setxattr, 12__NR_setxattr,
11__NR_lsetxattr, 13__NR_lsetxattr,
12__NR_fsetxattr, 14__NR_fsetxattr,
diff --git a/include/asm-generic/audit_write.h b/include/asm-generic/audit_write.h
index e7020c57b13b..274575d7129f 100644
--- a/include/asm-generic/audit_write.h
+++ b/include/asm-generic/audit_write.h
@@ -10,6 +10,12 @@ __NR_truncate,
10#ifdef __NR_truncate64 10#ifdef __NR_truncate64
11__NR_truncate64, 11__NR_truncate64,
12#endif 12#endif
13#ifdef __NR_ftruncate
14__NR_ftruncate,
15#endif
16#ifdef __NR_ftruncate64
17__NR_ftruncate64,
18#endif
13#ifdef __NR_bind 19#ifdef __NR_bind
14__NR_bind, /* bind can affect fs object only in one way... */ 20__NR_bind, /* bind can affect fs object only in one way... */
15#endif 21#endif
diff --git a/include/asm-generic/fixmap.h b/include/asm-generic/fixmap.h
new file mode 100644
index 000000000000..5a64ca4621f3
--- /dev/null
+++ b/include/asm-generic/fixmap.h
@@ -0,0 +1,97 @@
1/*
2 * fixmap.h: compile-time virtual memory allocation
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive
6 * for more details.
7 *
8 * Copyright (C) 1998 Ingo Molnar
9 *
10 * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999
11 * x86_32 and x86_64 integration by Gustavo F. Padovan, February 2009
12 * Break out common bits to asm-generic by Mark Salter, November 2013
13 */
14
15#ifndef __ASM_GENERIC_FIXMAP_H
16#define __ASM_GENERIC_FIXMAP_H
17
18#include <linux/bug.h>
19
20#define __fix_to_virt(x) (FIXADDR_TOP - ((x) << PAGE_SHIFT))
21#define __virt_to_fix(x) ((FIXADDR_TOP - ((x)&PAGE_MASK)) >> PAGE_SHIFT)
22
23#ifndef __ASSEMBLY__
24/*
25 * 'index to address' translation. If anyone tries to use the idx
26 * directly without translation, we catch the bug with a NULL-deference
27 * kernel oops. Illegal ranges of incoming indices are caught too.
28 */
29static __always_inline unsigned long fix_to_virt(const unsigned int idx)
30{
31 BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
32 return __fix_to_virt(idx);
33}
34
35static inline unsigned long virt_to_fix(const unsigned long vaddr)
36{
37 BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START);
38 return __virt_to_fix(vaddr);
39}
40
41/*
42 * Provide some reasonable defaults for page flags.
43 * Not all architectures use all of these different types and some
44 * architectures use different names.
45 */
46#ifndef FIXMAP_PAGE_NORMAL
47#define FIXMAP_PAGE_NORMAL PAGE_KERNEL
48#endif
49#ifndef FIXMAP_PAGE_NOCACHE
50#define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NOCACHE
51#endif
52#ifndef FIXMAP_PAGE_IO
53#define FIXMAP_PAGE_IO PAGE_KERNEL_IO
54#endif
55#ifndef FIXMAP_PAGE_CLEAR
56#define FIXMAP_PAGE_CLEAR __pgprot(0)
57#endif
58
59#ifndef set_fixmap
60#define set_fixmap(idx, phys) \
61 __set_fixmap(idx, phys, FIXMAP_PAGE_NORMAL)
62#endif
63
64#ifndef clear_fixmap
65#define clear_fixmap(idx) \
66 __set_fixmap(idx, 0, FIXMAP_PAGE_CLEAR)
67#endif
68
69/* Return a pointer with offset calculated */
70#define __set_fixmap_offset(idx, phys, flags) \
71({ \
72 unsigned long addr; \
73 __set_fixmap(idx, phys, flags); \
74 addr = fix_to_virt(idx) + ((phys) & (PAGE_SIZE - 1)); \
75 addr; \
76})
77
78#define set_fixmap_offset(idx, phys) \
79 __set_fixmap_offset(idx, phys, FIXMAP_PAGE_NORMAL)
80
81/*
82 * Some hardware wants to get fixmapped without caching.
83 */
84#define set_fixmap_nocache(idx, phys) \
85 __set_fixmap(idx, phys, FIXMAP_PAGE_NOCACHE)
86
87#define set_fixmap_offset_nocache(idx, phys) \
88 __set_fixmap_offset(idx, phys, FIXMAP_PAGE_NOCACHE)
89
90/*
91 * Some fixmaps are for IO
92 */
93#define set_fixmap_io(idx, phys) \
94 __set_fixmap(idx, phys, FIXMAP_PAGE_IO)
95
96#endif /* __ASSEMBLY__ */
97#endif /* __ASM_GENERIC_FIXMAP_H */
diff --git a/include/asm-generic/hash.h b/include/asm-generic/hash.h
new file mode 100644
index 000000000000..b6312843dbd9
--- /dev/null
+++ b/include/asm-generic/hash.h
@@ -0,0 +1,9 @@
1#ifndef __ASM_GENERIC_HASH_H
2#define __ASM_GENERIC_HASH_H
3
4struct fast_hash_ops;
5static inline void setup_arch_fast_hash(struct fast_hash_ops *ops)
6{
7}
8
9#endif /* __ASM_GENERIC_HASH_H */
diff --git a/include/asm-generic/int-l64.h b/include/asm-generic/int-l64.h
deleted file mode 100644
index 27d4ec0dfce0..000000000000
--- a/include/asm-generic/int-l64.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * asm-generic/int-l64.h
3 *
4 * Integer declarations for architectures which use "long"
5 * for 64-bit types.
6 */
7#ifndef _ASM_GENERIC_INT_L64_H
8#define _ASM_GENERIC_INT_L64_H
9
10#include <uapi/asm-generic/int-l64.h>
11
12
13#ifndef __ASSEMBLY__
14
15typedef signed char s8;
16typedef unsigned char u8;
17
18typedef signed short s16;
19typedef unsigned short u16;
20
21typedef signed int s32;
22typedef unsigned int u32;
23
24typedef signed long s64;
25typedef unsigned long u64;
26
27#define S8_C(x) x
28#define U8_C(x) x ## U
29#define S16_C(x) x
30#define U16_C(x) x ## U
31#define S32_C(x) x
32#define U32_C(x) x ## U
33#define S64_C(x) x ## L
34#define U64_C(x) x ## UL
35
36#else /* __ASSEMBLY__ */
37
38#define S8_C(x) x
39#define U8_C(x) x
40#define S16_C(x) x
41#define U16_C(x) x
42#define S32_C(x) x
43#define U32_C(x) x
44#define S64_C(x) x
45#define U64_C(x) x
46
47#endif /* __ASSEMBLY__ */
48
49#endif /* _ASM_GENERIC_INT_L64_H */
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index db0923458940..8e4f41d9af4d 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -558,6 +558,18 @@ static inline pmd_t pmd_read_atomic(pmd_t *pmdp)
558} 558}
559#endif 559#endif
560 560
561#ifndef pmd_move_must_withdraw
562static inline int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
563 spinlock_t *old_pmd_ptl)
564{
565 /*
566 * With split pmd lock we also need to move preallocated
567 * PTE page table if new_pmd is on different PMD page table.
568 */
569 return new_pmd_ptl != old_pmd_ptl;
570}
571#endif
572
561/* 573/*
562 * This function is meant to be used by sites walking pagetables with 574 * This function is meant to be used by sites walking pagetables with
563 * the mmap_sem hold in read mode to protect against MADV_DONTNEED and 575 * the mmap_sem hold in read mode to protect against MADV_DONTNEED and
diff --git a/include/asm-generic/uaccess.h b/include/asm-generic/uaccess.h
index dc1269c74a52..72d8803832ff 100644
--- a/include/asm-generic/uaccess.h
+++ b/include/asm-generic/uaccess.h
@@ -3,7 +3,7 @@
3 3
4/* 4/*
5 * User space memory access functions, these should work 5 * User space memory access functions, these should work
6 * on a ny machine that has kernel and user data in the same 6 * on any machine that has kernel and user data in the same
7 * address space, e.g. all NOMMU machines. 7 * address space, e.g. all NOMMU machines.
8 */ 8 */
9#include <linux/sched.h> 9#include <linux/sched.h>
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 1d4a920ef7ff..04086c5be930 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -56,6 +56,7 @@
56#include <linux/mutex.h> 56#include <linux/mutex.h>
57#include <linux/io.h> 57#include <linux/io.h>
58#include <linux/slab.h> 58#include <linux/slab.h>
59#include <linux/ratelimit.h>
59#if defined(__alpha__) || defined(__powerpc__) 60#if defined(__alpha__) || defined(__powerpc__)
60#include <asm/pgtable.h> /* For pte_wrprotect */ 61#include <asm/pgtable.h> /* For pte_wrprotect */
61#endif 62#endif
@@ -136,7 +137,6 @@ int drm_err(const char *func, const char *format, ...);
136 137
137/* driver capabilities and requirements mask */ 138/* driver capabilities and requirements mask */
138#define DRIVER_USE_AGP 0x1 139#define DRIVER_USE_AGP 0x1
139#define DRIVER_REQUIRE_AGP 0x2
140#define DRIVER_PCI_DMA 0x8 140#define DRIVER_PCI_DMA 0x8
141#define DRIVER_SG 0x10 141#define DRIVER_SG 0x10
142#define DRIVER_HAVE_DMA 0x20 142#define DRIVER_HAVE_DMA 0x20
@@ -180,6 +180,22 @@ int drm_err(const char *func, const char *format, ...);
180#define DRM_ERROR(fmt, ...) \ 180#define DRM_ERROR(fmt, ...) \
181 drm_err(__func__, fmt, ##__VA_ARGS__) 181 drm_err(__func__, fmt, ##__VA_ARGS__)
182 182
183/**
184 * Rate limited error output. Like DRM_ERROR() but won't flood the log.
185 *
186 * \param fmt printf() like format string.
187 * \param arg arguments
188 */
189#define DRM_ERROR_RATELIMITED(fmt, ...) \
190({ \
191 static DEFINE_RATELIMIT_STATE(_rs, \
192 DEFAULT_RATELIMIT_INTERVAL, \
193 DEFAULT_RATELIMIT_BURST); \
194 \
195 if (__ratelimit(&_rs)) \
196 drm_err(__func__, fmt, ##__VA_ARGS__); \
197})
198
183#define DRM_INFO(fmt, ...) \ 199#define DRM_INFO(fmt, ...) \
184 printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__) 200 printk(KERN_INFO "[" DRM_NAME "] " fmt, ##__VA_ARGS__)
185 201
@@ -422,7 +438,6 @@ struct drm_file {
422 struct pid *pid; 438 struct pid *pid;
423 kuid_t uid; 439 kuid_t uid;
424 drm_magic_t magic; 440 drm_magic_t magic;
425 unsigned long ioctl_count;
426 struct list_head lhead; 441 struct list_head lhead;
427 struct drm_minor *minor; 442 struct drm_minor *minor;
428 unsigned long lock_count; 443 unsigned long lock_count;
@@ -511,7 +526,7 @@ struct drm_device_dma {
511 */ 526 */
512struct drm_agp_mem { 527struct drm_agp_mem {
513 unsigned long handle; /**< handle */ 528 unsigned long handle; /**< handle */
514 DRM_AGP_MEM *memory; 529 struct agp_memory *memory;
515 unsigned long bound; /**< address */ 530 unsigned long bound; /**< address */
516 int pages; 531 int pages;
517 struct list_head head; 532 struct list_head head;
@@ -523,7 +538,7 @@ struct drm_agp_mem {
523 * \sa drm_agp_init() and drm_device::agp. 538 * \sa drm_agp_init() and drm_device::agp.
524 */ 539 */
525struct drm_agp_head { 540struct drm_agp_head {
526 DRM_AGP_KERN agp_info; /**< AGP device information */ 541 struct agp_kern_info agp_info; /**< AGP device information */
527 struct list_head memory; 542 struct list_head memory;
528 unsigned long mode; /**< AGP mode */ 543 unsigned long mode; /**< AGP mode */
529 struct agp_bridge_data *bridge; 544 struct agp_bridge_data *bridge;
@@ -607,13 +622,6 @@ struct drm_ati_pcigart_info {
607}; 622};
608 623
609/** 624/**
610 * GEM specific mm private for tracking GEM objects
611 */
612struct drm_gem_mm {
613 struct drm_vma_offset_manager vma_manager;
614};
615
616/**
617 * This structure defines the drm_mm memory object, which will be used by the 625 * This structure defines the drm_mm memory object, which will be used by the
618 * DRM for its buffer objects. 626 * DRM for its buffer objects.
619 */ 627 */
@@ -750,10 +758,6 @@ struct drm_bus {
750 int (*set_unique)(struct drm_device *dev, struct drm_master *master, 758 int (*set_unique)(struct drm_device *dev, struct drm_master *master,
751 struct drm_unique *unique); 759 struct drm_unique *unique);
752 int (*irq_by_busid)(struct drm_device *dev, struct drm_irq_busid *p); 760 int (*irq_by_busid)(struct drm_device *dev, struct drm_irq_busid *p);
753 /* hooks that are for PCI */
754 int (*agp_init)(struct drm_device *dev);
755 void (*agp_destroy)(struct drm_device *dev);
756
757}; 761};
758 762
759/** 763/**
@@ -841,6 +845,7 @@ struct drm_driver {
841 * 845 *
842 * \param dev DRM device. 846 * \param dev DRM device.
843 * \param crtc Id of the crtc to query. 847 * \param crtc Id of the crtc to query.
848 * \param flags Flags from the caller (DRM_CALLED_FROM_VBLIRQ or 0).
844 * \param *vpos Target location for current vertical scanout position. 849 * \param *vpos Target location for current vertical scanout position.
845 * \param *hpos Target location for current horizontal scanout position. 850 * \param *hpos Target location for current horizontal scanout position.
846 * \param *stime Target location for timestamp taken immediately before 851 * \param *stime Target location for timestamp taken immediately before
@@ -863,6 +868,7 @@ struct drm_driver {
863 * 868 *
864 */ 869 */
865 int (*get_scanout_position) (struct drm_device *dev, int crtc, 870 int (*get_scanout_position) (struct drm_device *dev, int crtc,
871 unsigned int flags,
866 int *vpos, int *hpos, ktime_t *stime, 872 int *vpos, int *hpos, ktime_t *stime,
867 ktime_t *etime); 873 ktime_t *etime);
868 874
@@ -903,7 +909,7 @@ struct drm_driver {
903 909
904 /* these have to be filled in */ 910 /* these have to be filled in */
905 911
906 irqreturn_t(*irq_handler) (DRM_IRQ_ARGS); 912 irqreturn_t(*irq_handler) (int irq, void *arg);
907 void (*irq_preinstall) (struct drm_device *dev); 913 void (*irq_preinstall) (struct drm_device *dev);
908 int (*irq_postinstall) (struct drm_device *dev); 914 int (*irq_postinstall) (struct drm_device *dev);
909 void (*irq_uninstall) (struct drm_device *dev); 915 void (*irq_uninstall) (struct drm_device *dev);
@@ -995,8 +1001,8 @@ struct drm_driver {
995 } kdriver; 1001 } kdriver;
996 struct drm_bus *bus; 1002 struct drm_bus *bus;
997 1003
998 /* List of devices hanging off this driver */ 1004 /* List of devices hanging off this driver with stealth attach. */
999 struct list_head device_list; 1005 struct list_head legacy_dev_list;
1000}; 1006};
1001 1007
1002#define DRM_MINOR_UNASSIGNED 0 1008#define DRM_MINOR_UNASSIGNED 0
@@ -1085,7 +1091,7 @@ struct drm_vblank_crtc {
1085 * may contain multiple heads. 1091 * may contain multiple heads.
1086 */ 1092 */
1087struct drm_device { 1093struct drm_device {
1088 struct list_head driver_item; /**< list of devices per driver */ 1094 struct list_head legacy_dev_list;/**< list of devices per driver for stealth attach cleanup */
1089 char *devname; /**< For /proc/interrupts */ 1095 char *devname; /**< For /proc/interrupts */
1090 int if_version; /**< Highest interface version set */ 1096 int if_version; /**< Highest interface version set */
1091 1097
@@ -1098,8 +1104,6 @@ struct drm_device {
1098 /** \name Usage Counters */ 1104 /** \name Usage Counters */
1099 /*@{ */ 1105 /*@{ */
1100 int open_count; /**< Outstanding files open */ 1106 int open_count; /**< Outstanding files open */
1101 atomic_t ioctl_count; /**< Outstanding IOCTLs pending */
1102 atomic_t vma_count; /**< Outstanding vma areas open */
1103 int buf_use; /**< Buffers in use -- cannot alloc */ 1107 int buf_use; /**< Buffers in use -- cannot alloc */
1104 atomic_t buf_alloc; /**< Buffer allocation in progress */ 1108 atomic_t buf_alloc; /**< Buffer allocation in progress */
1105 /*@} */ 1109 /*@} */
@@ -1176,7 +1180,6 @@ struct drm_device {
1176 struct drm_sg_mem *sg; /**< Scatter gather memory */ 1180 struct drm_sg_mem *sg; /**< Scatter gather memory */
1177 unsigned int num_crtcs; /**< Number of CRTCs on this device */ 1181 unsigned int num_crtcs; /**< Number of CRTCs on this device */
1178 void *dev_private; /**< device private data */ 1182 void *dev_private; /**< device private data */
1179 void *mm_private;
1180 struct address_space *dev_mapping; 1183 struct address_space *dev_mapping;
1181 struct drm_sigdata sigdata; /**< For block_all_signals */ 1184 struct drm_sigdata sigdata; /**< For block_all_signals */
1182 sigset_t sigmask; 1185 sigset_t sigmask;
@@ -1194,6 +1197,7 @@ struct drm_device {
1194 /*@{ */ 1197 /*@{ */
1195 struct mutex object_name_lock; 1198 struct mutex object_name_lock;
1196 struct idr object_name_idr; 1199 struct idr object_name_idr;
1200 struct drm_vma_offset_manager *vma_offset_manager;
1197 /*@} */ 1201 /*@} */
1198 int switch_power_state; 1202 int switch_power_state;
1199 1203
@@ -1268,6 +1272,7 @@ extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
1268 /* Memory management support (drm_memory.h) */ 1272 /* Memory management support (drm_memory.h) */
1269#include <drm/drm_memory.h> 1273#include <drm/drm_memory.h>
1270 1274
1275
1271 /* Misc. IOCTL support (drm_ioctl.h) */ 1276 /* Misc. IOCTL support (drm_ioctl.h) */
1272extern int drm_irq_by_busid(struct drm_device *dev, void *data, 1277extern int drm_irq_by_busid(struct drm_device *dev, void *data,
1273 struct drm_file *file_priv); 1278 struct drm_file *file_priv);
@@ -1398,8 +1403,10 @@ extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
1398 int crtc, int *max_error, 1403 int crtc, int *max_error,
1399 struct timeval *vblank_time, 1404 struct timeval *vblank_time,
1400 unsigned flags, 1405 unsigned flags,
1401 struct drm_crtc *refcrtc); 1406 const struct drm_crtc *refcrtc,
1402extern void drm_calc_timestamping_constants(struct drm_crtc *crtc); 1407 const struct drm_display_mode *mode);
1408extern void drm_calc_timestamping_constants(struct drm_crtc *crtc,
1409 const struct drm_display_mode *mode);
1403 1410
1404extern bool 1411extern bool
1405drm_mode_parse_command_line_for_connector(const char *mode_option, 1412drm_mode_parse_command_line_for_connector(const char *mode_option,
@@ -1461,6 +1468,30 @@ extern int drm_debugfs_create_files(const struct drm_info_list *files,
1461extern int drm_debugfs_remove_files(const struct drm_info_list *files, 1468extern int drm_debugfs_remove_files(const struct drm_info_list *files,
1462 int count, struct drm_minor *minor); 1469 int count, struct drm_minor *minor);
1463extern int drm_debugfs_cleanup(struct drm_minor *minor); 1470extern int drm_debugfs_cleanup(struct drm_minor *minor);
1471#else
1472static inline int drm_debugfs_init(struct drm_minor *minor, int minor_id,
1473 struct dentry *root)
1474{
1475 return 0;
1476}
1477
1478static inline int drm_debugfs_create_files(const struct drm_info_list *files,
1479 int count, struct dentry *root,
1480 struct drm_minor *minor)
1481{
1482 return 0;
1483}
1484
1485static inline int drm_debugfs_remove_files(const struct drm_info_list *files,
1486 int count, struct drm_minor *minor)
1487{
1488 return 0;
1489}
1490
1491static inline int drm_debugfs_cleanup(struct drm_minor *minor)
1492{
1493 return 0;
1494}
1464#endif 1495#endif
1465 1496
1466 /* Info file support */ 1497 /* Info file support */
@@ -1645,6 +1676,7 @@ static __inline__ int drm_pci_device_is_agp(struct drm_device *dev)
1645 1676
1646 return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP); 1677 return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP);
1647} 1678}
1679void drm_pci_agp_destroy(struct drm_device *dev);
1648 1680
1649extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver); 1681extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
1650extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver); 1682extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
@@ -1660,7 +1692,6 @@ extern int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *speed_mask);
1660 1692
1661/* platform section */ 1693/* platform section */
1662extern int drm_platform_init(struct drm_driver *driver, struct platform_device *platform_device); 1694extern int drm_platform_init(struct drm_driver *driver, struct platform_device *platform_device);
1663extern void drm_platform_exit(struct drm_driver *driver, struct platform_device *platform_device);
1664 1695
1665/* returns true if currently okay to sleep */ 1696/* returns true if currently okay to sleep */
1666static __inline__ bool drm_can_sleep(void) 1697static __inline__ bool drm_can_sleep(void)
diff --git a/include/drm/drm_agpsupport.h b/include/drm/drm_agpsupport.h
index a184eeee9c96..86a02188074b 100644
--- a/include/drm/drm_agpsupport.h
+++ b/include/drm/drm_agpsupport.h
@@ -10,17 +10,16 @@
10 10
11#if __OS_HAS_AGP 11#if __OS_HAS_AGP
12 12
13void drm_free_agp(DRM_AGP_MEM * handle, int pages); 13void drm_free_agp(struct agp_memory * handle, int pages);
14int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start); 14int drm_bind_agp(struct agp_memory * handle, unsigned int start);
15int drm_unbind_agp(DRM_AGP_MEM * handle); 15int drm_unbind_agp(struct agp_memory * handle);
16DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev, 16struct agp_memory *drm_agp_bind_pages(struct drm_device *dev,
17 struct page **pages, 17 struct page **pages,
18 unsigned long num_pages, 18 unsigned long num_pages,
19 uint32_t gtt_offset, 19 uint32_t gtt_offset,
20 uint32_t type); 20 uint32_t type);
21 21
22struct drm_agp_head *drm_agp_init(struct drm_device *dev); 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); 23void drm_agp_clear(struct drm_device *dev);
25int drm_agp_acquire(struct drm_device *dev); 24int drm_agp_acquire(struct drm_device *dev);
26int drm_agp_acquire_ioctl(struct drm_device *dev, void *data, 25int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
@@ -46,29 +45,23 @@ int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
46int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request); 45int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
47int drm_agp_bind_ioctl(struct drm_device *dev, void *data, 46int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
48 struct drm_file *file_priv); 47 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 */ 48#else /* __OS_HAS_AGP */
56 49
57static inline void drm_free_agp(DRM_AGP_MEM * handle, int pages) 50static inline void drm_free_agp(struct agp_memory * handle, int pages)
58{ 51{
59} 52}
60 53
61static inline int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start) 54static inline int drm_bind_agp(struct agp_memory * handle, unsigned int start)
62{ 55{
63 return -ENODEV; 56 return -ENODEV;
64} 57}
65 58
66static inline int drm_unbind_agp(DRM_AGP_MEM * handle) 59static inline int drm_unbind_agp(struct agp_memory * handle)
67{ 60{
68 return -ENODEV; 61 return -ENODEV;
69} 62}
70 63
71static inline DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev, 64static inline struct agp_memory *drm_agp_bind_pages(struct drm_device *dev,
72 struct page **pages, 65 struct page **pages,
73 unsigned long num_pages, 66 unsigned long num_pages,
74 uint32_t gtt_offset, 67 uint32_t gtt_offset,
@@ -82,10 +75,6 @@ static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev)
82 return NULL; 75 return NULL;
83} 76}
84 77
85static inline void drm_agp_destroy(struct drm_agp_head *agp)
86{
87}
88
89static inline void drm_agp_clear(struct drm_device *dev) 78static inline void drm_agp_clear(struct drm_device *dev)
90{ 79{
91} 80}
@@ -183,12 +172,6 @@ static inline int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
183{ 172{
184 return -ENODEV; 173 return -ENODEV;
185} 174}
186
187static inline int drm_core_has_AGP(struct drm_device *dev)
188{
189 return 0;
190}
191
192#endif /* __OS_HAS_AGP */ 175#endif /* __OS_HAS_AGP */
193 176
194#endif /* _DRM_AGPSUPPORT_H_ */ 177#endif /* _DRM_AGPSUPPORT_H_ */
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index f32c5cd51f41..71727b6210ae 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -30,6 +30,7 @@
30#include <linux/types.h> 30#include <linux/types.h>
31#include <linux/idr.h> 31#include <linux/idr.h>
32#include <linux/fb.h> 32#include <linux/fb.h>
33#include <linux/hdmi.h>
33#include <drm/drm_mode.h> 34#include <drm/drm_mode.h>
34 35
35#include <drm/drm_fourcc.h> 36#include <drm/drm_fourcc.h>
@@ -181,6 +182,7 @@ struct drm_display_mode {
181 182
182 int vrefresh; /* in Hz */ 183 int vrefresh; /* in Hz */
183 int hsync; /* in kHz */ 184 int hsync; /* in kHz */
185 enum hdmi_picture_aspect picture_aspect_ratio;
184}; 186};
185 187
186static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode) 188static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode)
@@ -447,7 +449,7 @@ struct drm_crtc {
447 uint16_t *gamma_store; 449 uint16_t *gamma_store;
448 450
449 /* Constants needed for precise vblank and swap timestamping. */ 451 /* Constants needed for precise vblank and swap timestamping. */
450 s64 framedur_ns, linedur_ns, pixeldur_ns; 452 int framedur_ns, linedur_ns, pixeldur_ns;
451 453
452 /* if you are using the helper */ 454 /* if you are using the helper */
453 void *helper_private; 455 void *helper_private;
@@ -929,6 +931,19 @@ extern int drm_crtc_init(struct drm_device *dev,
929 struct drm_crtc *crtc, 931 struct drm_crtc *crtc,
930 const struct drm_crtc_funcs *funcs); 932 const struct drm_crtc_funcs *funcs);
931extern void drm_crtc_cleanup(struct drm_crtc *crtc); 933extern void drm_crtc_cleanup(struct drm_crtc *crtc);
934extern unsigned int drm_crtc_index(struct drm_crtc *crtc);
935
936/**
937 * drm_crtc_mask - find the mask of a registered CRTC
938 * @crtc: CRTC to find mask for
939 *
940 * Given a registered CRTC, return the mask bit of that CRTC for an
941 * encoder's possible_crtcs field.
942 */
943static inline uint32_t drm_crtc_mask(struct drm_crtc *crtc)
944{
945 return 1 << drm_crtc_index(crtc);
946}
932 947
933extern void drm_connector_ida_init(void); 948extern void drm_connector_ida_init(void);
934extern void drm_connector_ida_destroy(void); 949extern void drm_connector_ida_destroy(void);
@@ -950,6 +965,19 @@ extern int drm_encoder_init(struct drm_device *dev,
950 const struct drm_encoder_funcs *funcs, 965 const struct drm_encoder_funcs *funcs,
951 int encoder_type); 966 int encoder_type);
952 967
968/**
969 * drm_encoder_crtc_ok - can a given crtc drive a given encoder?
970 * @encoder: encoder to test
971 * @crtc: crtc to test
972 *
973 * Return false if @encoder can't be driven by @crtc, true otherwise.
974 */
975static inline bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
976 struct drm_crtc *crtc)
977{
978 return !!(encoder->possible_crtcs & drm_crtc_mask(crtc));
979}
980
953extern int drm_plane_init(struct drm_device *dev, 981extern int drm_plane_init(struct drm_device *dev,
954 struct drm_plane *plane, 982 struct drm_plane *plane,
955 unsigned long possible_crtcs, 983 unsigned long possible_crtcs,
diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index ef6ad3a8e58e..b1388b5fe7ac 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -120,8 +120,8 @@ struct drm_encoder_helper_funcs {
120 */ 120 */
121struct drm_connector_helper_funcs { 121struct drm_connector_helper_funcs {
122 int (*get_modes)(struct drm_connector *connector); 122 int (*get_modes)(struct drm_connector *connector);
123 int (*mode_valid)(struct drm_connector *connector, 123 enum drm_mode_status (*mode_valid)(struct drm_connector *connector,
124 struct drm_display_mode *mode); 124 struct drm_display_mode *mode);
125 struct drm_encoder *(*best_encoder)(struct drm_connector *connector); 125 struct drm_encoder *(*best_encoder)(struct drm_connector *connector);
126}; 126};
127 127
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index a92c3754e3bb..1d09050a8c00 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -41,22 +41,22 @@
41 * 1.2 formally includes both eDP and DPI definitions. 41 * 1.2 formally includes both eDP and DPI definitions.
42 */ 42 */
43 43
44#define AUX_NATIVE_WRITE 0x8 44#define DP_AUX_I2C_WRITE 0x0
45#define AUX_NATIVE_READ 0x9 45#define DP_AUX_I2C_READ 0x1
46#define AUX_I2C_WRITE 0x0 46#define DP_AUX_I2C_STATUS 0x2
47#define AUX_I2C_READ 0x1 47#define DP_AUX_I2C_MOT 0x4
48#define AUX_I2C_STATUS 0x2 48#define DP_AUX_NATIVE_WRITE 0x8
49#define AUX_I2C_MOT 0x4 49#define DP_AUX_NATIVE_READ 0x9
50 50
51#define AUX_NATIVE_REPLY_ACK (0x0 << 4) 51#define DP_AUX_NATIVE_REPLY_ACK (0x0 << 0)
52#define AUX_NATIVE_REPLY_NACK (0x1 << 4) 52#define DP_AUX_NATIVE_REPLY_NACK (0x1 << 0)
53#define AUX_NATIVE_REPLY_DEFER (0x2 << 4) 53#define DP_AUX_NATIVE_REPLY_DEFER (0x2 << 0)
54#define AUX_NATIVE_REPLY_MASK (0x3 << 4) 54#define DP_AUX_NATIVE_REPLY_MASK (0x3 << 0)
55 55
56#define AUX_I2C_REPLY_ACK (0x0 << 6) 56#define DP_AUX_I2C_REPLY_ACK (0x0 << 2)
57#define AUX_I2C_REPLY_NACK (0x1 << 6) 57#define DP_AUX_I2C_REPLY_NACK (0x1 << 2)
58#define AUX_I2C_REPLY_DEFER (0x2 << 6) 58#define DP_AUX_I2C_REPLY_DEFER (0x2 << 2)
59#define AUX_I2C_REPLY_MASK (0x3 << 6) 59#define DP_AUX_I2C_REPLY_MASK (0x3 << 2)
60 60
61/* AUX CH addresses */ 61/* AUX CH addresses */
62/* DPCD */ 62/* DPCD */
@@ -266,9 +266,10 @@
266 266
267#define DP_TEST_REQUEST 0x218 267#define DP_TEST_REQUEST 0x218
268# define DP_TEST_LINK_TRAINING (1 << 0) 268# define DP_TEST_LINK_TRAINING (1 << 0)
269# define DP_TEST_LINK_PATTERN (1 << 1) 269# define DP_TEST_LINK_VIDEO_PATTERN (1 << 1)
270# define DP_TEST_LINK_EDID_READ (1 << 2) 270# define DP_TEST_LINK_EDID_READ (1 << 2)
271# define DP_TEST_LINK_PHY_TEST_PATTERN (1 << 3) /* DPCD >= 1.1 */ 271# define DP_TEST_LINK_PHY_TEST_PATTERN (1 << 3) /* DPCD >= 1.1 */
272# define DP_TEST_LINK_FAUX_PATTERN (1 << 4) /* DPCD >= 1.2 */
272 273
273#define DP_TEST_LINK_RATE 0x219 274#define DP_TEST_LINK_RATE 0x219
274# define DP_LINK_RATE_162 (0x6) 275# define DP_LINK_RATE_162 (0x6)
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
new file mode 100644
index 000000000000..d32628acdd90
--- /dev/null
+++ b/include/drm/drm_mipi_dsi.h
@@ -0,0 +1,158 @@
1/*
2 * MIPI DSI Bus
3 *
4 * Copyright (C) 2012-2013, Samsung Electronics, Co., Ltd.
5 * Andrzej Hajda <a.hajda@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __DRM_MIPI_DSI_H__
13#define __DRM_MIPI_DSI_H__
14
15#include <linux/device.h>
16
17struct mipi_dsi_host;
18struct mipi_dsi_device;
19
20/**
21 * struct mipi_dsi_msg - read/write DSI buffer
22 * @channel: virtual channel id
23 * @type: payload data type
24 * @tx_len: length of @tx_buf
25 * @tx_buf: data to be written
26 * @rx_len: length of @rx_buf
27 * @rx_buf: data to be read, or NULL
28 */
29struct mipi_dsi_msg {
30 u8 channel;
31 u8 type;
32
33 size_t tx_len;
34 const void *tx_buf;
35
36 size_t rx_len;
37 void *rx_buf;
38};
39
40/**
41 * struct mipi_dsi_host_ops - DSI bus operations
42 * @attach: attach DSI device to DSI host
43 * @detach: detach DSI device from DSI host
44 * @transfer: send and/or receive DSI packet, return number of received bytes,
45 * or error
46 */
47struct mipi_dsi_host_ops {
48 int (*attach)(struct mipi_dsi_host *host,
49 struct mipi_dsi_device *dsi);
50 int (*detach)(struct mipi_dsi_host *host,
51 struct mipi_dsi_device *dsi);
52 ssize_t (*transfer)(struct mipi_dsi_host *host,
53 struct mipi_dsi_msg *msg);
54};
55
56/**
57 * struct mipi_dsi_host - DSI host device
58 * @dev: driver model device node for this DSI host
59 * @ops: DSI host operations
60 */
61struct mipi_dsi_host {
62 struct device *dev;
63 const struct mipi_dsi_host_ops *ops;
64};
65
66int mipi_dsi_host_register(struct mipi_dsi_host *host);
67void mipi_dsi_host_unregister(struct mipi_dsi_host *host);
68
69/* DSI mode flags */
70
71/* video mode */
72#define MIPI_DSI_MODE_VIDEO BIT(0)
73/* video burst mode */
74#define MIPI_DSI_MODE_VIDEO_BURST BIT(1)
75/* video pulse mode */
76#define MIPI_DSI_MODE_VIDEO_SYNC_PULSE BIT(2)
77/* enable auto vertical count mode */
78#define MIPI_DSI_MODE_VIDEO_AUTO_VERT BIT(3)
79/* enable hsync-end packets in vsync-pulse and v-porch area */
80#define MIPI_DSI_MODE_VIDEO_HSE BIT(4)
81/* disable hfront-porch area */
82#define MIPI_DSI_MODE_VIDEO_HFP BIT(5)
83/* disable hback-porch area */
84#define MIPI_DSI_MODE_VIDEO_HBP BIT(6)
85/* disable hsync-active area */
86#define MIPI_DSI_MODE_VIDEO_HSA BIT(7)
87/* flush display FIFO on vsync pulse */
88#define MIPI_DSI_MODE_VSYNC_FLUSH BIT(8)
89/* disable EoT packets in HS mode */
90#define MIPI_DSI_MODE_EOT_PACKET BIT(9)
91
92enum mipi_dsi_pixel_format {
93 MIPI_DSI_FMT_RGB888,
94 MIPI_DSI_FMT_RGB666,
95 MIPI_DSI_FMT_RGB666_PACKED,
96 MIPI_DSI_FMT_RGB565,
97};
98
99/**
100 * struct mipi_dsi_device - DSI peripheral device
101 * @host: DSI host for this peripheral
102 * @dev: driver model device node for this peripheral
103 * @channel: virtual channel assigned to the peripheral
104 * @format: pixel format for video mode
105 * @lanes: number of active data lanes
106 * @mode_flags: DSI operation mode related flags
107 */
108struct mipi_dsi_device {
109 struct mipi_dsi_host *host;
110 struct device dev;
111
112 unsigned int channel;
113 unsigned int lanes;
114 enum mipi_dsi_pixel_format format;
115 unsigned long mode_flags;
116};
117
118#define to_mipi_dsi_device(d) container_of(d, struct mipi_dsi_device, dev)
119
120int mipi_dsi_attach(struct mipi_dsi_device *dsi);
121int mipi_dsi_detach(struct mipi_dsi_device *dsi);
122int mipi_dsi_dcs_write(struct mipi_dsi_device *dsi, unsigned int channel,
123 const void *data, size_t len);
124ssize_t mipi_dsi_dcs_read(struct mipi_dsi_device *dsi, unsigned int channel,
125 u8 cmd, void *data, size_t len);
126
127/**
128 * struct mipi_dsi_driver - DSI driver
129 * @driver: device driver model driver
130 * @probe: callback for device binding
131 * @remove: callback for device unbinding
132 */
133struct mipi_dsi_driver {
134 struct device_driver driver;
135 int(*probe)(struct mipi_dsi_device *dsi);
136 int(*remove)(struct mipi_dsi_device *dsi);
137};
138
139#define to_mipi_dsi_driver(d) container_of(d, struct mipi_dsi_driver, driver)
140
141static inline void *mipi_dsi_get_drvdata(const struct mipi_dsi_device *dsi)
142{
143 return dev_get_drvdata(&dsi->dev);
144}
145
146static inline void mipi_dsi_set_drvdata(struct mipi_dsi_device *dsi, void *data)
147{
148 dev_set_drvdata(&dsi->dev, data);
149}
150
151int mipi_dsi_driver_register(struct mipi_dsi_driver *driver);
152void mipi_dsi_driver_unregister(struct mipi_dsi_driver *driver);
153
154#define module_mipi_dsi_driver(__mipi_dsi_driver) \
155 module_driver(__mipi_dsi_driver, mipi_dsi_driver_register, \
156 mipi_dsi_driver_unregister)
157
158#endif /* __DRM_MIPI_DSI__ */
diff --git a/include/drm/drm_os_linux.h b/include/drm/drm_os_linux.h
index 815fafc6b4ad..86ab99bc0ac5 100644
--- a/include/drm/drm_os_linux.h
+++ b/include/drm/drm_os_linux.h
@@ -21,7 +21,6 @@ static inline void writeq(u64 val, void __iomem *reg)
21 21
22/** Current process ID */ 22/** Current process ID */
23#define DRM_CURRENTPID task_pid_nr(current) 23#define DRM_CURRENTPID task_pid_nr(current)
24#define DRM_SUSER(p) capable(CAP_SYS_ADMIN)
25#define DRM_UDELAY(d) udelay(d) 24#define DRM_UDELAY(d) udelay(d)
26/** Read a byte from a MMIO region */ 25/** Read a byte from a MMIO region */
27#define DRM_READ8(map, offset) readb(((void __iomem *)(map)->handle) + (offset)) 26#define DRM_READ8(map, offset) readb(((void __iomem *)(map)->handle) + (offset))
@@ -35,45 +34,12 @@ static inline void writeq(u64 val, void __iomem *reg)
35#define DRM_WRITE16(map, offset, val) writew(val, ((void __iomem *)(map)->handle) + (offset)) 34#define DRM_WRITE16(map, offset, val) writew(val, ((void __iomem *)(map)->handle) + (offset))
36/** Write a dword into a MMIO region */ 35/** Write a dword into a MMIO region */
37#define DRM_WRITE32(map, offset, val) writel(val, ((void __iomem *)(map)->handle) + (offset)) 36#define DRM_WRITE32(map, offset, val) writel(val, ((void __iomem *)(map)->handle) + (offset))
38/** Read memory barrier */
39 37
40/** Read a qword from a MMIO region - be careful using these unless you really understand them */ 38/** Read a qword from a MMIO region - be careful using these unless you really understand them */
41#define DRM_READ64(map, offset) readq(((void __iomem *)(map)->handle) + (offset)) 39#define DRM_READ64(map, offset) readq(((void __iomem *)(map)->handle) + (offset))
42/** Write a qword into a MMIO region */ 40/** Write a qword into a MMIO region */
43#define DRM_WRITE64(map, offset, val) writeq(val, ((void __iomem *)(map)->handle) + (offset)) 41#define DRM_WRITE64(map, offset, val) writeq(val, ((void __iomem *)(map)->handle) + (offset))
44 42
45#define DRM_READMEMORYBARRIER() rmb()
46/** Write memory barrier */
47#define DRM_WRITEMEMORYBARRIER() wmb()
48/** Read/write memory barrier */
49#define DRM_MEMORYBARRIER() mb()
50
51/** IRQ handler arguments and return type and values */
52#define DRM_IRQ_ARGS int irq, void *arg
53
54/** AGP types */
55#if __OS_HAS_AGP
56#define DRM_AGP_MEM struct agp_memory
57#define DRM_AGP_KERN struct agp_kern_info
58#else
59/* define some dummy types for non AGP supporting kernels */
60struct no_agp_kern {
61 unsigned long aper_base;
62 unsigned long aper_size;
63};
64#define DRM_AGP_MEM int
65#define DRM_AGP_KERN struct no_agp_kern
66#endif
67
68/** Other copying of data to kernel space */
69#define DRM_COPY_FROM_USER(arg1, arg2, arg3) \
70 copy_from_user(arg1, arg2, arg3)
71/** Other copying of data from kernel space */
72#define DRM_COPY_TO_USER(arg1, arg2, arg3) \
73 copy_to_user(arg1, arg2, arg3)
74
75#define DRM_HZ HZ
76
77#define DRM_WAIT_ON( ret, queue, timeout, condition ) \ 43#define DRM_WAIT_ON( ret, queue, timeout, condition ) \
78do { \ 44do { \
79 DECLARE_WAITQUEUE(entry, current); \ 45 DECLARE_WAITQUEUE(entry, current); \
@@ -97,6 +63,3 @@ do { \
97 __set_current_state(TASK_RUNNING); \ 63 __set_current_state(TASK_RUNNING); \
98 remove_wait_queue(&(queue), &entry); \ 64 remove_wait_queue(&(queue), &entry); \
99} while (0) 65} while (0)
100
101#define DRM_WAKEUP( queue ) wake_up( queue )
102#define DRM_INIT_WAITQUEUE( queue ) init_waitqueue_head( queue )
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
new file mode 100644
index 000000000000..c2ab77add67c
--- /dev/null
+++ b/include/drm/drm_panel.h
@@ -0,0 +1,82 @@
1/*
2 * Copyright (C) 2013, NVIDIA Corporation. All rights reserved.
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, sub license,
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
12 * next paragraph) shall be included in all copies or substantial portions
13 * of the 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 NON-INFRINGEMENT. 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
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
24#ifndef __DRM_PANEL_H__
25#define __DRM_PANEL_H__
26
27#include <linux/list.h>
28
29struct drm_connector;
30struct drm_device;
31struct drm_panel;
32
33struct drm_panel_funcs {
34 int (*disable)(struct drm_panel *panel);
35 int (*enable)(struct drm_panel *panel);
36 int (*get_modes)(struct drm_panel *panel);
37};
38
39struct drm_panel {
40 struct drm_device *drm;
41 struct drm_connector *connector;
42 struct device *dev;
43
44 const struct drm_panel_funcs *funcs;
45
46 struct list_head list;
47};
48
49static inline int drm_panel_disable(struct drm_panel *panel)
50{
51 if (panel && panel->funcs && panel->funcs->disable)
52 return panel->funcs->disable(panel);
53
54 return panel ? -ENOSYS : -EINVAL;
55}
56
57static inline int drm_panel_enable(struct drm_panel *panel)
58{
59 if (panel && panel->funcs && panel->funcs->enable)
60 return panel->funcs->enable(panel);
61
62 return panel ? -ENOSYS : -EINVAL;
63}
64
65void drm_panel_init(struct drm_panel *panel);
66
67int drm_panel_add(struct drm_panel *panel);
68void drm_panel_remove(struct drm_panel *panel);
69
70int drm_panel_attach(struct drm_panel *panel, struct drm_connector *connector);
71int drm_panel_detach(struct drm_panel *panel);
72
73#ifdef CONFIG_OF
74struct drm_panel *of_drm_find_panel(struct device_node *np);
75#else
76static inline struct drm_panel *of_drm_find_panel(struct device_node *np)
77{
78 return NULL;
79}
80#endif
81
82#endif
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 8639c85d61c4..32d34ebf0706 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -681,6 +681,15 @@ extern int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement);
681extern int ttm_tt_swapout(struct ttm_tt *ttm, 681extern int ttm_tt_swapout(struct ttm_tt *ttm,
682 struct file *persistent_swap_storage); 682 struct file *persistent_swap_storage);
683 683
684/**
685 * ttm_tt_unpopulate - free pages from a ttm
686 *
687 * @ttm: Pointer to the ttm_tt structure
688 *
689 * Calls the driver method to free all pages from a ttm
690 */
691extern void ttm_tt_unpopulate(struct ttm_tt *ttm);
692
684/* 693/*
685 * ttm_bo.c 694 * ttm_bo.c
686 */ 695 */
diff --git a/include/drm/ttm/ttm_object.h b/include/drm/ttm/ttm_object.h
index 58b029894eb3..0097cc03034e 100644
--- a/include/drm/ttm/ttm_object.h
+++ b/include/drm/ttm/ttm_object.h
@@ -190,14 +190,26 @@ extern int ttm_base_object_init(struct ttm_object_file *tfile,
190 * @key: Hash key 190 * @key: Hash key
191 * 191 *
192 * Looks up a struct ttm_base_object with the key @key. 192 * Looks up a struct ttm_base_object with the key @key.
193 * Also verifies that the object is visible to the application, by
194 * comparing the @tfile argument and checking the object shareable flag.
195 */ 193 */
196 194
197extern struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file 195extern struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file
198 *tfile, uint32_t key); 196 *tfile, uint32_t key);
199 197
200/** 198/**
199 * ttm_base_object_lookup_for_ref
200 *
201 * @tdev: Pointer to a struct ttm_object_device.
202 * @key: Hash key
203 *
204 * Looks up a struct ttm_base_object with the key @key.
205 * This function should only be used when the struct tfile associated with the
206 * caller doesn't yet have a reference to the base object.
207 */
208
209extern struct ttm_base_object *
210ttm_base_object_lookup_for_ref(struct ttm_object_device *tdev, uint32_t key);
211
212/**
201 * ttm_base_object_unref 213 * ttm_base_object_unref
202 * 214 *
203 * @p_base: Pointer to a pointer referencing a struct ttm_base_object. 215 * @p_base: Pointer to a pointer referencing a struct ttm_base_object.
@@ -218,6 +230,8 @@ extern void ttm_base_object_unref(struct ttm_base_object **p_base);
218 * @existed: Upon completion, indicates that an identical reference object 230 * @existed: Upon completion, indicates that an identical reference object
219 * already existed, and the refcount was upped on that object instead. 231 * already existed, and the refcount was upped on that object instead.
220 * 232 *
233 * Checks that the base object is shareable and adds a ref object to it.
234 *
221 * Adding a ref object to a base object is basically like referencing the 235 * Adding a ref object to a base object is basically like referencing the
222 * base object, but a user-space application holds the reference. When the 236 * base object, but a user-space application holds the reference. When the
223 * file corresponding to @tfile is closed, all its reference objects are 237 * file corresponding to @tfile is closed, all its reference objects are
diff --git a/include/dt-bindings/clk/at91.h b/include/dt-bindings/clk/at91.h
new file mode 100644
index 000000000000..0b4cb999a3f7
--- /dev/null
+++ b/include/dt-bindings/clk/at91.h
@@ -0,0 +1,22 @@
1/*
2 * This header provides constants for AT91 pmc status.
3 *
4 * The constants defined in this header are being used in dts.
5 *
6 * Licensed under GPLv2 or later.
7 */
8
9#ifndef _DT_BINDINGS_CLK_AT91_H
10#define _DT_BINDINGS_CLK_AT91_H
11
12#define AT91_PMC_MOSCS 0 /* MOSCS Flag */
13#define AT91_PMC_LOCKA 1 /* PLLA Lock */
14#define AT91_PMC_LOCKB 2 /* PLLB Lock */
15#define AT91_PMC_MCKRDY 3 /* Master Clock */
16#define AT91_PMC_LOCKU 6 /* UPLL Lock */
17#define AT91_PMC_PCKRDY(id) (8 + (id)) /* Programmable Clock */
18#define AT91_PMC_MOSCSELS 16 /* Main Oscillator Selection */
19#define AT91_PMC_MOSCRCS 17 /* Main On-Chip RC */
20#define AT91_PMC_CFDEV 18 /* Clock Failure Detector Event */
21
22#endif
diff --git a/include/dt-bindings/clk/exynos-audss-clk.h b/include/dt-bindings/clk/exynos-audss-clk.h
index 8279f427c60f..0ae6f5a75d2a 100644
--- a/include/dt-bindings/clk/exynos-audss-clk.h
+++ b/include/dt-bindings/clk/exynos-audss-clk.h
@@ -19,7 +19,8 @@
19#define EXYNOS_SCLK_I2S 7 19#define EXYNOS_SCLK_I2S 7
20#define EXYNOS_PCM_BUS 8 20#define EXYNOS_PCM_BUS 8
21#define EXYNOS_SCLK_PCM 9 21#define EXYNOS_SCLK_PCM 9
22#define EXYNOS_ADMA 10
22 23
23#define EXYNOS_AUDSS_MAX_CLKS 10 24#define EXYNOS_AUDSS_MAX_CLKS 11
24 25
25#endif 26#endif
diff --git a/include/dt-bindings/clock/exynos4.h b/include/dt-bindings/clock/exynos4.h
new file mode 100644
index 000000000000..75aff336dfb0
--- /dev/null
+++ b/include/dt-bindings/clock/exynos4.h
@@ -0,0 +1,244 @@
1/*
2 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 * Author: Andrzej Haja <a.hajda@samsung.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Device Tree binding constants for Exynos4 clock controller.
10*/
11
12#ifndef _DT_BINDINGS_CLOCK_EXYNOS_4_H
13#define _DT_BINDINGS_CLOCK_EXYNOS_4_H
14
15/* core clocks */
16#define CLK_XXTI 1
17#define CLK_XUSBXTI 2
18#define CLK_FIN_PLL 3
19#define CLK_FOUT_APLL 4
20#define CLK_FOUT_MPLL 5
21#define CLK_FOUT_EPLL 6
22#define CLK_FOUT_VPLL 7
23#define CLK_SCLK_APLL 8
24#define CLK_SCLK_MPLL 9
25#define CLK_SCLK_EPLL 10
26#define CLK_SCLK_VPLL 11
27#define CLK_ARM_CLK 12
28#define CLK_ACLK200 13
29#define CLK_ACLK100 14
30#define CLK_ACLK160 15
31#define CLK_ACLK133 16
32#define CLK_MOUT_MPLL_USER_T 17 /* Exynos4x12 only */
33#define CLK_MOUT_MPLL_USER_C 18 /* Exynos4x12 only */
34#define CLK_MOUT_CORE 19
35#define CLK_MOUT_APLL 20
36
37/* gate for special clocks (sclk) */
38#define CLK_SCLK_FIMC0 128
39#define CLK_SCLK_FIMC1 129
40#define CLK_SCLK_FIMC2 130
41#define CLK_SCLK_FIMC3 131
42#define CLK_SCLK_CAM0 132
43#define CLK_SCLK_CAM1 133
44#define CLK_SCLK_CSIS0 134
45#define CLK_SCLK_CSIS1 135
46#define CLK_SCLK_HDMI 136
47#define CLK_SCLK_MIXER 137
48#define CLK_SCLK_DAC 138
49#define CLK_SCLK_PIXEL 139
50#define CLK_SCLK_FIMD0 140
51#define CLK_SCLK_MDNIE0 141 /* Exynos4412 only */
52#define CLK_SCLK_MDNIE_PWM0 142
53#define CLK_SCLK_MIPI0 143
54#define CLK_SCLK_AUDIO0 144
55#define CLK_SCLK_MMC0 145
56#define CLK_SCLK_MMC1 146
57#define CLK_SCLK_MMC2 147
58#define CLK_SCLK_MMC3 148
59#define CLK_SCLK_MMC4 149
60#define CLK_SCLK_SATA 150 /* Exynos4210 only */
61#define CLK_SCLK_UART0 151
62#define CLK_SCLK_UART1 152
63#define CLK_SCLK_UART2 153
64#define CLK_SCLK_UART3 154
65#define CLK_SCLK_UART4 155
66#define CLK_SCLK_AUDIO1 156
67#define CLK_SCLK_AUDIO2 157
68#define CLK_SCLK_SPDIF 158
69#define CLK_SCLK_SPI0 159
70#define CLK_SCLK_SPI1 160
71#define CLK_SCLK_SPI2 161
72#define CLK_SCLK_SLIMBUS 162
73#define CLK_SCLK_FIMD1 163 /* Exynos4210 only */
74#define CLK_SCLK_MIPI1 164 /* Exynos4210 only */
75#define CLK_SCLK_PCM1 165
76#define CLK_SCLK_PCM2 166
77#define CLK_SCLK_I2S1 167
78#define CLK_SCLK_I2S2 168
79#define CLK_SCLK_MIPIHSI 169 /* Exynos4412 only */
80#define CLK_SCLK_MFC 170
81#define CLK_SCLK_PCM0 171
82#define CLK_SCLK_G3D 172
83#define CLK_SCLK_PWM_ISP 173 /* Exynos4x12 only */
84#define CLK_SCLK_SPI0_ISP 174 /* Exynos4x12 only */
85#define CLK_SCLK_SPI1_ISP 175 /* Exynos4x12 only */
86#define CLK_SCLK_UART_ISP 176 /* Exynos4x12 only */
87#define CLK_SCLK_FIMG2D 177
88
89/* gate clocks */
90#define CLK_FIMC0 256
91#define CLK_FIMC1 257
92#define CLK_FIMC2 258
93#define CLK_FIMC3 259
94#define CLK_CSIS0 260
95#define CLK_CSIS1 261
96#define CLK_JPEG 262
97#define CLK_SMMU_FIMC0 263
98#define CLK_SMMU_FIMC1 264
99#define CLK_SMMU_FIMC2 265
100#define CLK_SMMU_FIMC3 266
101#define CLK_SMMU_JPEG 267
102#define CLK_VP 268
103#define CLK_MIXER 269
104#define CLK_TVENC 270 /* Exynos4210 only */
105#define CLK_HDMI 271
106#define CLK_SMMU_TV 272
107#define CLK_MFC 273
108#define CLK_SMMU_MFCL 274
109#define CLK_SMMU_MFCR 275
110#define CLK_G3D 276
111#define CLK_G2D 277
112#define CLK_ROTATOR 278 /* Exynos4210 only */
113#define CLK_MDMA 279 /* Exynos4210 only */
114#define CLK_SMMU_G2D 280 /* Exynos4210 only */
115#define CLK_SMMU_ROTATOR 281 /* Exynos4210 only */
116#define CLK_SMMU_MDMA 282 /* Exynos4210 only */
117#define CLK_FIMD0 283
118#define CLK_MIE0 284
119#define CLK_MDNIE0 285 /* Exynos4412 only */
120#define CLK_DSIM0 286
121#define CLK_SMMU_FIMD0 287
122#define CLK_FIMD1 288 /* Exynos4210 only */
123#define CLK_MIE1 289 /* Exynos4210 only */
124#define CLK_DSIM1 290 /* Exynos4210 only */
125#define CLK_SMMU_FIMD1 291 /* Exynos4210 only */
126#define CLK_PDMA0 292
127#define CLK_PDMA1 293
128#define CLK_PCIE_PHY 294
129#define CLK_SATA_PHY 295 /* Exynos4210 only */
130#define CLK_TSI 296
131#define CLK_SDMMC0 297
132#define CLK_SDMMC1 298
133#define CLK_SDMMC2 299
134#define CLK_SDMMC3 300
135#define CLK_SDMMC4 301
136#define CLK_SATA 302 /* Exynos4210 only */
137#define CLK_SROMC 303
138#define CLK_USB_HOST 304
139#define CLK_USB_DEVICE 305
140#define CLK_PCIE 306
141#define CLK_ONENAND 307
142#define CLK_NFCON 308
143#define CLK_SMMU_PCIE 309
144#define CLK_GPS 310
145#define CLK_SMMU_GPS 311
146#define CLK_UART0 312
147#define CLK_UART1 313
148#define CLK_UART2 314
149#define CLK_UART3 315
150#define CLK_UART4 316
151#define CLK_I2C0 317
152#define CLK_I2C1 318
153#define CLK_I2C2 319
154#define CLK_I2C3 320
155#define CLK_I2C4 321
156#define CLK_I2C5 322
157#define CLK_I2C6 323
158#define CLK_I2C7 324
159#define CLK_I2C_HDMI 325
160#define CLK_TSADC 326
161#define CLK_SPI0 327
162#define CLK_SPI1 328
163#define CLK_SPI2 329
164#define CLK_I2S1 330
165#define CLK_I2S2 331
166#define CLK_PCM0 332
167#define CLK_I2S0 333
168#define CLK_PCM1 334
169#define CLK_PCM2 335
170#define CLK_PWM 336
171#define CLK_SLIMBUS 337
172#define CLK_SPDIF 338
173#define CLK_AC97 339
174#define CLK_MODEMIF 340
175#define CLK_CHIPID 341
176#define CLK_SYSREG 342
177#define CLK_HDMI_CEC 343
178#define CLK_MCT 344
179#define CLK_WDT 345
180#define CLK_RTC 346
181#define CLK_KEYIF 347
182#define CLK_AUDSS 348
183#define CLK_MIPI_HSI 349 /* Exynos4210 only */
184#define CLK_MDMA2 350 /* Exynos4210 only */
185#define CLK_PIXELASYNCM0 351
186#define CLK_PIXELASYNCM1 352
187#define CLK_FIMC_LITE0 353 /* Exynos4x12 only */
188#define CLK_FIMC_LITE1 354 /* Exynos4x12 only */
189#define CLK_PPMUISPX 355 /* Exynos4x12 only */
190#define CLK_PPMUISPMX 356 /* Exynos4x12 only */
191#define CLK_FIMC_ISP 357 /* Exynos4x12 only */
192#define CLK_FIMC_DRC 358 /* Exynos4x12 only */
193#define CLK_FIMC_FD 359 /* Exynos4x12 only */
194#define CLK_MCUISP 360 /* Exynos4x12 only */
195#define CLK_GICISP 361 /* Exynos4x12 only */
196#define CLK_SMMU_ISP 362 /* Exynos4x12 only */
197#define CLK_SMMU_DRC 363 /* Exynos4x12 only */
198#define CLK_SMMU_FD 364 /* Exynos4x12 only */
199#define CLK_SMMU_LITE0 365 /* Exynos4x12 only */
200#define CLK_SMMU_LITE1 366 /* Exynos4x12 only */
201#define CLK_MCUCTL_ISP 367 /* Exynos4x12 only */
202#define CLK_MPWM_ISP 368 /* Exynos4x12 only */
203#define CLK_I2C0_ISP 369 /* Exynos4x12 only */
204#define CLK_I2C1_ISP 370 /* Exynos4x12 only */
205#define CLK_MTCADC_ISP 371 /* Exynos4x12 only */
206#define CLK_PWM_ISP 372 /* Exynos4x12 only */
207#define CLK_WDT_ISP 373 /* Exynos4x12 only */
208#define CLK_UART_ISP 374 /* Exynos4x12 only */
209#define CLK_ASYNCAXIM 375 /* Exynos4x12 only */
210#define CLK_SMMU_ISPCX 376 /* Exynos4x12 only */
211#define CLK_SPI0_ISP 377 /* Exynos4x12 only */
212#define CLK_SPI1_ISP 378 /* Exynos4x12 only */
213#define CLK_PWM_ISP_SCLK 379 /* Exynos4x12 only */
214#define CLK_SPI0_ISP_SCLK 380 /* Exynos4x12 only */
215#define CLK_SPI1_ISP_SCLK 381 /* Exynos4x12 only */
216#define CLK_UART_ISP_SCLK 382 /* Exynos4x12 only */
217#define CLK_TMU_APBIF 383
218
219/* mux clocks */
220#define CLK_MOUT_FIMC0 384
221#define CLK_MOUT_FIMC1 385
222#define CLK_MOUT_FIMC2 386
223#define CLK_MOUT_FIMC3 387
224#define CLK_MOUT_CAM0 388
225#define CLK_MOUT_CAM1 389
226#define CLK_MOUT_CSIS0 390
227#define CLK_MOUT_CSIS1 391
228#define CLK_MOUT_G3D0 392
229#define CLK_MOUT_G3D1 393
230#define CLK_MOUT_G3D 394
231#define CLK_ACLK400_MCUISP 395 /* Exynos4x12 only */
232
233/* div clocks */
234#define CLK_DIV_ISP0 450 /* Exynos4x12 only */
235#define CLK_DIV_ISP1 451 /* Exynos4x12 only */
236#define CLK_DIV_MCUISP0 452 /* Exynos4x12 only */
237#define CLK_DIV_MCUISP1 453 /* Exynos4x12 only */
238#define CLK_DIV_ACLK200 454 /* Exynos4x12 only */
239#define CLK_DIV_ACLK400_MCUISP 455 /* Exynos4x12 only */
240
241/* must be greater than maximal clock id */
242#define CLK_NR_CLKS 456
243
244#endif /* _DT_BINDINGS_CLOCK_EXYNOS_4_H */
diff --git a/include/dt-bindings/clock/exynos5250.h b/include/dt-bindings/clock/exynos5250.h
new file mode 100644
index 000000000000..922f2dca9bf0
--- /dev/null
+++ b/include/dt-bindings/clock/exynos5250.h
@@ -0,0 +1,160 @@
1/*
2 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 * Author: Andrzej Haja <a.hajda@samsung.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Device Tree binding constants for Exynos5250 clock controller.
10*/
11
12#ifndef _DT_BINDINGS_CLOCK_EXYNOS_5250_H
13#define _DT_BINDINGS_CLOCK_EXYNOS_5250_H
14
15/* core clocks */
16#define CLK_FIN_PLL 1
17#define CLK_FOUT_APLL 2
18#define CLK_FOUT_MPLL 3
19#define CLK_FOUT_BPLL 4
20#define CLK_FOUT_GPLL 5
21#define CLK_FOUT_CPLL 6
22#define CLK_FOUT_EPLL 7
23#define CLK_FOUT_VPLL 8
24
25/* gate for special clocks (sclk) */
26#define CLK_SCLK_CAM_BAYER 128
27#define CLK_SCLK_CAM0 129
28#define CLK_SCLK_CAM1 130
29#define CLK_SCLK_GSCL_WA 131
30#define CLK_SCLK_GSCL_WB 132
31#define CLK_SCLK_FIMD1 133
32#define CLK_SCLK_MIPI1 134
33#define CLK_SCLK_DP 135
34#define CLK_SCLK_HDMI 136
35#define CLK_SCLK_PIXEL 137
36#define CLK_SCLK_AUDIO0 138
37#define CLK_SCLK_MMC0 139
38#define CLK_SCLK_MMC1 140
39#define CLK_SCLK_MMC2 141
40#define CLK_SCLK_MMC3 142
41#define CLK_SCLK_SATA 143
42#define CLK_SCLK_USB3 144
43#define CLK_SCLK_JPEG 145
44#define CLK_SCLK_UART0 146
45#define CLK_SCLK_UART1 147
46#define CLK_SCLK_UART2 148
47#define CLK_SCLK_UART3 149
48#define CLK_SCLK_PWM 150
49#define CLK_SCLK_AUDIO1 151
50#define CLK_SCLK_AUDIO2 152
51#define CLK_SCLK_SPDIF 153
52#define CLK_SCLK_SPI0 154
53#define CLK_SCLK_SPI1 155
54#define CLK_SCLK_SPI2 156
55#define CLK_DIV_I2S1 157
56#define CLK_DIV_I2S2 158
57#define CLK_SCLK_HDMIPHY 159
58#define CLK_DIV_PCM0 160
59
60/* gate clocks */
61#define CLK_GSCL0 256
62#define CLK_GSCL1 257
63#define CLK_GSCL2 258
64#define CLK_GSCL3 259
65#define CLK_GSCL_WA 260
66#define CLK_GSCL_WB 261
67#define CLK_SMMU_GSCL0 262
68#define CLK_SMMU_GSCL1 263
69#define CLK_SMMU_GSCL2 264
70#define CLK_SMMU_GSCL3 265
71#define CLK_MFC 266
72#define CLK_SMMU_MFCL 267
73#define CLK_SMMU_MFCR 268
74#define CLK_ROTATOR 269
75#define CLK_JPEG 270
76#define CLK_MDMA1 271
77#define CLK_SMMU_ROTATOR 272
78#define CLK_SMMU_JPEG 273
79#define CLK_SMMU_MDMA1 274
80#define CLK_PDMA0 275
81#define CLK_PDMA1 276
82#define CLK_SATA 277
83#define CLK_USBOTG 278
84#define CLK_MIPI_HSI 279
85#define CLK_SDMMC0 280
86#define CLK_SDMMC1 281
87#define CLK_SDMMC2 282
88#define CLK_SDMMC3 283
89#define CLK_SROMC 284
90#define CLK_USB2 285
91#define CLK_USB3 286
92#define CLK_SATA_PHYCTRL 287
93#define CLK_SATA_PHYI2C 288
94#define CLK_UART0 289
95#define CLK_UART1 290
96#define CLK_UART2 291
97#define CLK_UART3 292
98#define CLK_UART4 293
99#define CLK_I2C0 294
100#define CLK_I2C1 295
101#define CLK_I2C2 296
102#define CLK_I2C3 297
103#define CLK_I2C4 298
104#define CLK_I2C5 299
105#define CLK_I2C6 300
106#define CLK_I2C7 301
107#define CLK_I2C_HDMI 302
108#define CLK_ADC 303
109#define CLK_SPI0 304
110#define CLK_SPI1 305
111#define CLK_SPI2 306
112#define CLK_I2S1 307
113#define CLK_I2S2 308
114#define CLK_PCM1 309
115#define CLK_PCM2 310
116#define CLK_PWM 311
117#define CLK_SPDIF 312
118#define CLK_AC97 313
119#define CLK_HSI2C0 314
120#define CLK_HSI2C1 315
121#define CLK_HSI2C2 316
122#define CLK_HSI2C3 317
123#define CLK_CHIPID 318
124#define CLK_SYSREG 319
125#define CLK_PMU 320
126#define CLK_CMU_TOP 321
127#define CLK_CMU_CORE 322
128#define CLK_CMU_MEM 323
129#define CLK_TZPC0 324
130#define CLK_TZPC1 325
131#define CLK_TZPC2 326
132#define CLK_TZPC3 327
133#define CLK_TZPC4 328
134#define CLK_TZPC5 329
135#define CLK_TZPC6 330
136#define CLK_TZPC7 331
137#define CLK_TZPC8 332
138#define CLK_TZPC9 333
139#define CLK_HDMI_CEC 334
140#define CLK_MCT 335
141#define CLK_WDT 336
142#define CLK_RTC 337
143#define CLK_TMU 338
144#define CLK_FIMD1 339
145#define CLK_MIE1 340
146#define CLK_DSIM0 341
147#define CLK_DP 342
148#define CLK_MIXER 343
149#define CLK_HDMI 344
150#define CLK_G2D 345
151#define CLK_MDMA0 346
152#define CLK_SMMU_MDMA0 347
153
154/* mux clocks */
155#define CLK_MOUT_HDMI 1024
156
157/* must be greater than maximal clock id */
158#define CLK_NR_CLKS 1025
159
160#endif /* _DT_BINDINGS_CLOCK_EXYNOS_5250_H */
diff --git a/include/dt-bindings/clock/exynos5420.h b/include/dt-bindings/clock/exynos5420.h
new file mode 100644
index 000000000000..5eefd8813f02
--- /dev/null
+++ b/include/dt-bindings/clock/exynos5420.h
@@ -0,0 +1,188 @@
1/*
2 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 * Author: Andrzej Haja <a.hajda@samsung.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Device Tree binding constants for Exynos5420 clock controller.
10*/
11
12#ifndef _DT_BINDINGS_CLOCK_EXYNOS_5420_H
13#define _DT_BINDINGS_CLOCK_EXYNOS_5420_H
14
15/* core clocks */
16#define CLK_FIN_PLL 1
17#define CLK_FOUT_APLL 2
18#define CLK_FOUT_CPLL 3
19#define CLK_FOUT_DPLL 4
20#define CLK_FOUT_EPLL 5
21#define CLK_FOUT_RPLL 6
22#define CLK_FOUT_IPLL 7
23#define CLK_FOUT_SPLL 8
24#define CLK_FOUT_VPLL 9
25#define CLK_FOUT_MPLL 10
26#define CLK_FOUT_BPLL 11
27#define CLK_FOUT_KPLL 12
28
29/* gate for special clocks (sclk) */
30#define CLK_SCLK_UART0 128
31#define CLK_SCLK_UART1 129
32#define CLK_SCLK_UART2 130
33#define CLK_SCLK_UART3 131
34#define CLK_SCLK_MMC0 132
35#define CLK_SCLK_MMC1 133
36#define CLK_SCLK_MMC2 134
37#define CLK_SCLK_SPI0 135
38#define CLK_SCLK_SPI1 136
39#define CLK_SCLK_SPI2 137
40#define CLK_SCLK_I2S1 138
41#define CLK_SCLK_I2S2 139
42#define CLK_SCLK_PCM1 140
43#define CLK_SCLK_PCM2 141
44#define CLK_SCLK_SPDIF 142
45#define CLK_SCLK_HDMI 143
46#define CLK_SCLK_PIXEL 144
47#define CLK_SCLK_DP1 145
48#define CLK_SCLK_MIPI1 146
49#define CLK_SCLK_FIMD1 147
50#define CLK_SCLK_MAUDIO0 148
51#define CLK_SCLK_MAUPCM0 149
52#define CLK_SCLK_USBD300 150
53#define CLK_SCLK_USBD301 151
54#define CLK_SCLK_USBPHY300 152
55#define CLK_SCLK_USBPHY301 153
56#define CLK_SCLK_UNIPRO 154
57#define CLK_SCLK_PWM 155
58#define CLK_SCLK_GSCL_WA 156
59#define CLK_SCLK_GSCL_WB 157
60#define CLK_SCLK_HDMIPHY 158
61
62/* gate clocks */
63#define CLK_ACLK66_PERIC 256
64#define CLK_UART0 257
65#define CLK_UART1 258
66#define CLK_UART2 259
67#define CLK_UART3 260
68#define CLK_I2C0 261
69#define CLK_I2C1 262
70#define CLK_I2C2 263
71#define CLK_I2C3 264
72#define CLK_I2C4 265
73#define CLK_I2C5 266
74#define CLK_I2C6 267
75#define CLK_I2C7 268
76#define CLK_I2C_HDMI 269
77#define CLK_TSADC 270
78#define CLK_SPI0 271
79#define CLK_SPI1 272
80#define CLK_SPI2 273
81#define CLK_KEYIF 274
82#define CLK_I2S1 275
83#define CLK_I2S2 276
84#define CLK_PCM1 277
85#define CLK_PCM2 278
86#define CLK_PWM 279
87#define CLK_SPDIF 280
88#define CLK_I2C8 281
89#define CLK_I2C9 282
90#define CLK_I2C10 283
91#define CLK_ACLK66_PSGEN 300
92#define CLK_CHIPID 301
93#define CLK_SYSREG 302
94#define CLK_TZPC0 303
95#define CLK_TZPC1 304
96#define CLK_TZPC2 305
97#define CLK_TZPC3 306
98#define CLK_TZPC4 307
99#define CLK_TZPC5 308
100#define CLK_TZPC6 309
101#define CLK_TZPC7 310
102#define CLK_TZPC8 311
103#define CLK_TZPC9 312
104#define CLK_HDMI_CEC 313
105#define CLK_SECKEY 314
106#define CLK_MCT 315
107#define CLK_WDT 316
108#define CLK_RTC 317
109#define CLK_TMU 318
110#define CLK_TMU_GPU 319
111#define CLK_PCLK66_GPIO 330
112#define CLK_ACLK200_FSYS2 350
113#define CLK_MMC0 351
114#define CLK_MMC1 352
115#define CLK_MMC2 353
116#define CLK_SROMC 354
117#define CLK_UFS 355
118#define CLK_ACLK200_FSYS 360
119#define CLK_TSI 361
120#define CLK_PDMA0 362
121#define CLK_PDMA1 363
122#define CLK_RTIC 364
123#define CLK_USBH20 365
124#define CLK_USBD300 366
125#define CLK_USBD301 367
126#define CLK_ACLK400_MSCL 380
127#define CLK_MSCL0 381
128#define CLK_MSCL1 382
129#define CLK_MSCL2 383
130#define CLK_SMMU_MSCL0 384
131#define CLK_SMMU_MSCL1 385
132#define CLK_SMMU_MSCL2 386
133#define CLK_ACLK333 400
134#define CLK_MFC 401
135#define CLK_SMMU_MFCL 402
136#define CLK_SMMU_MFCR 403
137#define CLK_ACLK200_DISP1 410
138#define CLK_DSIM1 411
139#define CLK_DP1 412
140#define CLK_HDMI 413
141#define CLK_ACLK300_DISP1 420
142#define CLK_FIMD1 421
143#define CLK_SMMU_FIMD1 422
144#define CLK_ACLK166 430
145#define CLK_MIXER 431
146#define CLK_ACLK266 440
147#define CLK_ROTATOR 441
148#define CLK_MDMA1 442
149#define CLK_SMMU_ROTATOR 443
150#define CLK_SMMU_MDMA1 444
151#define CLK_ACLK300_JPEG 450
152#define CLK_JPEG 451
153#define CLK_JPEG2 452
154#define CLK_SMMU_JPEG 453
155#define CLK_ACLK300_GSCL 460
156#define CLK_SMMU_GSCL0 461
157#define CLK_SMMU_GSCL1 462
158#define CLK_GSCL_WA 463
159#define CLK_GSCL_WB 464
160#define CLK_GSCL0 465
161#define CLK_GSCL1 466
162#define CLK_CLK_3AA 467
163#define CLK_ACLK266_G2D 470
164#define CLK_SSS 471
165#define CLK_SLIM_SSS 472
166#define CLK_MDMA0 473
167#define CLK_ACLK333_G2D 480
168#define CLK_G2D 481
169#define CLK_ACLK333_432_GSCL 490
170#define CLK_SMMU_3AA 491
171#define CLK_SMMU_FIMCL0 492
172#define CLK_SMMU_FIMCL1 493
173#define CLK_SMMU_FIMCL3 494
174#define CLK_FIMC_LITE3 495
175#define CLK_ACLK_G3D 500
176#define CLK_G3D 501
177#define CLK_SMMU_MIXER 502
178
179/* mux clocks */
180#define CLK_MOUT_HDMI 640
181
182/* divider clocks */
183#define CLK_DOUT_PIXEL 768
184
185/* must be greater than maximal clock id */
186#define CLK_NR_CLKS 769
187
188#endif /* _DT_BINDINGS_CLOCK_EXYNOS_5420_H */
diff --git a/include/dt-bindings/clock/exynos5440.h b/include/dt-bindings/clock/exynos5440.h
new file mode 100644
index 000000000000..70cd85077fa9
--- /dev/null
+++ b/include/dt-bindings/clock/exynos5440.h
@@ -0,0 +1,42 @@
1/*
2 * Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 * Author: Andrzej Haja <a.hajda-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * Device Tree binding constants for Exynos5440 clock controller.
10*/
11
12#ifndef _DT_BINDINGS_CLOCK_EXYNOS_5440_H
13#define _DT_BINDINGS_CLOCK_EXYNOS_5440_H
14
15#define CLK_XTAL 1
16#define CLK_ARM_CLK 2
17#define CLK_SPI_BAUD 16
18#define CLK_PB0_250 17
19#define CLK_PR0_250 18
20#define CLK_PR1_250 19
21#define CLK_B_250 20
22#define CLK_B_125 21
23#define CLK_B_200 22
24#define CLK_SATA 23
25#define CLK_USB 24
26#define CLK_GMAC0 25
27#define CLK_CS250 26
28#define CLK_PB0_250_O 27
29#define CLK_PR0_250_O 28
30#define CLK_PR1_250_O 29
31#define CLK_B_250_O 30
32#define CLK_B_125_O 31
33#define CLK_B_200_O 32
34#define CLK_SATA_O 33
35#define CLK_USB_O 34
36#define CLK_GMAC0_O 35
37#define CLK_CS250_O 36
38
39/* must be greater than maximal clock id */
40#define CLK_NR_CLKS 37
41
42#endif /* _DT_BINDINGS_CLOCK_EXYNOS_5440_H */
diff --git a/include/dt-bindings/clock/hi3620-clock.h b/include/dt-bindings/clock/hi3620-clock.h
new file mode 100644
index 000000000000..6eaa6a45e110
--- /dev/null
+++ b/include/dt-bindings/clock/hi3620-clock.h
@@ -0,0 +1,152 @@
1/*
2 * Copyright (c) 2012-2013 Hisilicon Limited.
3 * Copyright (c) 2012-2013 Linaro Limited.
4 *
5 * Author: Haojian Zhuang <haojian.zhuang@linaro.org>
6 * Xin Li <li.xin@linaro.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 *
22 */
23
24#ifndef __DTS_HI3620_CLOCK_H
25#define __DTS_HI3620_CLOCK_H
26
27#define HI3620_NONE_CLOCK 0
28
29/* fixed rate & fixed factor clocks */
30#define HI3620_OSC32K 1
31#define HI3620_OSC26M 2
32#define HI3620_PCLK 3
33#define HI3620_PLL_ARM0 4
34#define HI3620_PLL_ARM1 5
35#define HI3620_PLL_PERI 6
36#define HI3620_PLL_USB 7
37#define HI3620_PLL_HDMI 8
38#define HI3620_PLL_GPU 9
39#define HI3620_RCLK_TCXO 10
40#define HI3620_RCLK_CFGAXI 11
41#define HI3620_RCLK_PICO 12
42
43/* mux clocks */
44#define HI3620_TIMER0_MUX 32
45#define HI3620_TIMER1_MUX 33
46#define HI3620_TIMER2_MUX 34
47#define HI3620_TIMER3_MUX 35
48#define HI3620_TIMER4_MUX 36
49#define HI3620_TIMER5_MUX 37
50#define HI3620_TIMER6_MUX 38
51#define HI3620_TIMER7_MUX 39
52#define HI3620_TIMER8_MUX 40
53#define HI3620_TIMER9_MUX 41
54#define HI3620_UART0_MUX 42
55#define HI3620_UART1_MUX 43
56#define HI3620_UART2_MUX 44
57#define HI3620_UART3_MUX 45
58#define HI3620_UART4_MUX 46
59#define HI3620_SPI0_MUX 47
60#define HI3620_SPI1_MUX 48
61#define HI3620_SPI2_MUX 49
62#define HI3620_SAXI_MUX 50
63#define HI3620_PWM0_MUX 51
64#define HI3620_PWM1_MUX 52
65#define HI3620_SD_MUX 53
66#define HI3620_MMC1_MUX 54
67#define HI3620_MMC1_MUX2 55
68#define HI3620_G2D_MUX 56
69#define HI3620_VENC_MUX 57
70#define HI3620_VDEC_MUX 58
71#define HI3620_VPP_MUX 59
72#define HI3620_EDC0_MUX 60
73#define HI3620_LDI0_MUX 61
74#define HI3620_EDC1_MUX 62
75#define HI3620_LDI1_MUX 63
76#define HI3620_RCLK_HSIC 64
77#define HI3620_MMC2_MUX 65
78#define HI3620_MMC3_MUX 66
79
80/* divider clocks */
81#define HI3620_SHAREAXI_DIV 128
82#define HI3620_CFGAXI_DIV 129
83#define HI3620_SD_DIV 130
84#define HI3620_MMC1_DIV 131
85#define HI3620_HSIC_DIV 132
86#define HI3620_MMC2_DIV 133
87#define HI3620_MMC3_DIV 134
88
89/* gate clocks */
90#define HI3620_TIMERCLK01 160
91#define HI3620_TIMER_RCLK01 161
92#define HI3620_TIMERCLK23 162
93#define HI3620_TIMER_RCLK23 163
94#define HI3620_TIMERCLK45 164
95#define HI3620_TIMERCLK67 165
96#define HI3620_TIMERCLK89 166
97#define HI3620_RTCCLK 167
98#define HI3620_KPC_CLK 168
99#define HI3620_GPIOCLK0 169
100#define HI3620_GPIOCLK1 170
101#define HI3620_GPIOCLK2 171
102#define HI3620_GPIOCLK3 172
103#define HI3620_GPIOCLK4 173
104#define HI3620_GPIOCLK5 174
105#define HI3620_GPIOCLK6 175
106#define HI3620_GPIOCLK7 176
107#define HI3620_GPIOCLK8 177
108#define HI3620_GPIOCLK9 178
109#define HI3620_GPIOCLK10 179
110#define HI3620_GPIOCLK11 180
111#define HI3620_GPIOCLK12 181
112#define HI3620_GPIOCLK13 182
113#define HI3620_GPIOCLK14 183
114#define HI3620_GPIOCLK15 184
115#define HI3620_GPIOCLK16 185
116#define HI3620_GPIOCLK17 186
117#define HI3620_GPIOCLK18 187
118#define HI3620_GPIOCLK19 188
119#define HI3620_GPIOCLK20 189
120#define HI3620_GPIOCLK21 190
121#define HI3620_DPHY0_CLK 191
122#define HI3620_DPHY1_CLK 192
123#define HI3620_DPHY2_CLK 193
124#define HI3620_USBPHY_CLK 194
125#define HI3620_ACP_CLK 195
126#define HI3620_PWMCLK0 196
127#define HI3620_PWMCLK1 197
128#define HI3620_UARTCLK0 198
129#define HI3620_UARTCLK1 199
130#define HI3620_UARTCLK2 200
131#define HI3620_UARTCLK3 201
132#define HI3620_UARTCLK4 202
133#define HI3620_SPICLK0 203
134#define HI3620_SPICLK1 204
135#define HI3620_SPICLK2 205
136#define HI3620_I2CCLK0 206
137#define HI3620_I2CCLK1 207
138#define HI3620_I2CCLK2 208
139#define HI3620_I2CCLK3 209
140#define HI3620_SCI_CLK 210
141#define HI3620_DDRC_PER_CLK 211
142#define HI3620_DMAC_CLK 212
143#define HI3620_USB2DVC_CLK 213
144#define HI3620_SD_CLK 214
145#define HI3620_MMC_CLK1 215
146#define HI3620_MMC_CLK2 216
147#define HI3620_MMC_CLK3 217
148#define HI3620_MCU_CLK 218
149
150#define HI3620_NR_CLKS 219
151
152#endif /* __DTS_HI3620_CLOCK_H */
diff --git a/include/dt-bindings/clock/imx5-clock.h b/include/dt-bindings/clock/imx5-clock.h
new file mode 100644
index 000000000000..5f2667ecd98e
--- /dev/null
+++ b/include/dt-bindings/clock/imx5-clock.h
@@ -0,0 +1,203 @@
1/*
2 * Copyright 2013 Lucas Stach, Pengutronix <l.stach@pengutronix.de>
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
10#ifndef __DT_BINDINGS_CLOCK_IMX5_H
11#define __DT_BINDINGS_CLOCK_IMX5_H
12
13#define IMX5_CLK_DUMMY 0
14#define IMX5_CLK_CKIL 1
15#define IMX5_CLK_OSC 2
16#define IMX5_CLK_CKIH1 3
17#define IMX5_CLK_CKIH2 4
18#define IMX5_CLK_AHB 5
19#define IMX5_CLK_IPG 6
20#define IMX5_CLK_AXI_A 7
21#define IMX5_CLK_AXI_B 8
22#define IMX5_CLK_UART_PRED 9
23#define IMX5_CLK_UART_ROOT 10
24#define IMX5_CLK_ESDHC_A_PRED 11
25#define IMX5_CLK_ESDHC_B_PRED 12
26#define IMX5_CLK_ESDHC_C_SEL 13
27#define IMX5_CLK_ESDHC_D_SEL 14
28#define IMX5_CLK_EMI_SEL 15
29#define IMX5_CLK_EMI_SLOW_PODF 16
30#define IMX5_CLK_NFC_PODF 17
31#define IMX5_CLK_ECSPI_PRED 18
32#define IMX5_CLK_ECSPI_PODF 19
33#define IMX5_CLK_USBOH3_PRED 20
34#define IMX5_CLK_USBOH3_PODF 21
35#define IMX5_CLK_USB_PHY_PRED 22
36#define IMX5_CLK_USB_PHY_PODF 23
37#define IMX5_CLK_CPU_PODF 24
38#define IMX5_CLK_DI_PRED 25
39#define IMX5_CLK_TVE_SEL 27
40#define IMX5_CLK_UART1_IPG_GATE 28
41#define IMX5_CLK_UART1_PER_GATE 29
42#define IMX5_CLK_UART2_IPG_GATE 30
43#define IMX5_CLK_UART2_PER_GATE 31
44#define IMX5_CLK_UART3_IPG_GATE 32
45#define IMX5_CLK_UART3_PER_GATE 33
46#define IMX5_CLK_I2C1_GATE 34
47#define IMX5_CLK_I2C2_GATE 35
48#define IMX5_CLK_GPT_IPG_GATE 36
49#define IMX5_CLK_PWM1_IPG_GATE 37
50#define IMX5_CLK_PWM1_HF_GATE 38
51#define IMX5_CLK_PWM2_IPG_GATE 39
52#define IMX5_CLK_PWM2_HF_GATE 40
53#define IMX5_CLK_GPT_HF_GATE 41
54#define IMX5_CLK_FEC_GATE 42
55#define IMX5_CLK_USBOH3_PER_GATE 43
56#define IMX5_CLK_ESDHC1_IPG_GATE 44
57#define IMX5_CLK_ESDHC2_IPG_GATE 45
58#define IMX5_CLK_ESDHC3_IPG_GATE 46
59#define IMX5_CLK_ESDHC4_IPG_GATE 47
60#define IMX5_CLK_SSI1_IPG_GATE 48
61#define IMX5_CLK_SSI2_IPG_GATE 49
62#define IMX5_CLK_SSI3_IPG_GATE 50
63#define IMX5_CLK_ECSPI1_IPG_GATE 51
64#define IMX5_CLK_ECSPI1_PER_GATE 52
65#define IMX5_CLK_ECSPI2_IPG_GATE 53
66#define IMX5_CLK_ECSPI2_PER_GATE 54
67#define IMX5_CLK_CSPI_IPG_GATE 55
68#define IMX5_CLK_SDMA_GATE 56
69#define IMX5_CLK_EMI_SLOW_GATE 57
70#define IMX5_CLK_IPU_SEL 58
71#define IMX5_CLK_IPU_GATE 59
72#define IMX5_CLK_NFC_GATE 60
73#define IMX5_CLK_IPU_DI1_GATE 61
74#define IMX5_CLK_VPU_SEL 62
75#define IMX5_CLK_VPU_GATE 63
76#define IMX5_CLK_VPU_REFERENCE_GATE 64
77#define IMX5_CLK_UART4_IPG_GATE 65
78#define IMX5_CLK_UART4_PER_GATE 66
79#define IMX5_CLK_UART5_IPG_GATE 67
80#define IMX5_CLK_UART5_PER_GATE 68
81#define IMX5_CLK_TVE_GATE 69
82#define IMX5_CLK_TVE_PRED 70
83#define IMX5_CLK_ESDHC1_PER_GATE 71
84#define IMX5_CLK_ESDHC2_PER_GATE 72
85#define IMX5_CLK_ESDHC3_PER_GATE 73
86#define IMX5_CLK_ESDHC4_PER_GATE 74
87#define IMX5_CLK_USB_PHY_GATE 75
88#define IMX5_CLK_HSI2C_GATE 76
89#define IMX5_CLK_MIPI_HSC1_GATE 77
90#define IMX5_CLK_MIPI_HSC2_GATE 78
91#define IMX5_CLK_MIPI_ESC_GATE 79
92#define IMX5_CLK_MIPI_HSP_GATE 80
93#define IMX5_CLK_LDB_DI1_DIV_3_5 81
94#define IMX5_CLK_LDB_DI1_DIV 82
95#define IMX5_CLK_LDB_DI0_DIV_3_5 83
96#define IMX5_CLK_LDB_DI0_DIV 84
97#define IMX5_CLK_LDB_DI1_GATE 85
98#define IMX5_CLK_CAN2_SERIAL_GATE 86
99#define IMX5_CLK_CAN2_IPG_GATE 87
100#define IMX5_CLK_I2C3_GATE 88
101#define IMX5_CLK_LP_APM 89
102#define IMX5_CLK_PERIPH_APM 90
103#define IMX5_CLK_MAIN_BUS 91
104#define IMX5_CLK_AHB_MAX 92
105#define IMX5_CLK_AIPS_TZ1 93
106#define IMX5_CLK_AIPS_TZ2 94
107#define IMX5_CLK_TMAX1 95
108#define IMX5_CLK_TMAX2 96
109#define IMX5_CLK_TMAX3 97
110#define IMX5_CLK_SPBA 98
111#define IMX5_CLK_UART_SEL 99
112#define IMX5_CLK_ESDHC_A_SEL 100
113#define IMX5_CLK_ESDHC_B_SEL 101
114#define IMX5_CLK_ESDHC_A_PODF 102
115#define IMX5_CLK_ESDHC_B_PODF 103
116#define IMX5_CLK_ECSPI_SEL 104
117#define IMX5_CLK_USBOH3_SEL 105
118#define IMX5_CLK_USB_PHY_SEL 106
119#define IMX5_CLK_IIM_GATE 107
120#define IMX5_CLK_USBOH3_GATE 108
121#define IMX5_CLK_EMI_FAST_GATE 109
122#define IMX5_CLK_IPU_DI0_GATE 110
123#define IMX5_CLK_GPC_DVFS 111
124#define IMX5_CLK_PLL1_SW 112
125#define IMX5_CLK_PLL2_SW 113
126#define IMX5_CLK_PLL3_SW 114
127#define IMX5_CLK_IPU_DI0_SEL 115
128#define IMX5_CLK_IPU_DI1_SEL 116
129#define IMX5_CLK_TVE_EXT_SEL 117
130#define IMX5_CLK_MX51_MIPI 118
131#define IMX5_CLK_PLL4_SW 119
132#define IMX5_CLK_LDB_DI1_SEL 120
133#define IMX5_CLK_DI_PLL4_PODF 121
134#define IMX5_CLK_LDB_DI0_SEL 122
135#define IMX5_CLK_LDB_DI0_GATE 123
136#define IMX5_CLK_USB_PHY1_GATE 124
137#define IMX5_CLK_USB_PHY2_GATE 125
138#define IMX5_CLK_PER_LP_APM 126
139#define IMX5_CLK_PER_PRED1 127
140#define IMX5_CLK_PER_PRED2 128
141#define IMX5_CLK_PER_PODF 129
142#define IMX5_CLK_PER_ROOT 130
143#define IMX5_CLK_SSI_APM 131
144#define IMX5_CLK_SSI1_ROOT_SEL 132
145#define IMX5_CLK_SSI2_ROOT_SEL 133
146#define IMX5_CLK_SSI3_ROOT_SEL 134
147#define IMX5_CLK_SSI_EXT1_SEL 135
148#define IMX5_CLK_SSI_EXT2_SEL 136
149#define IMX5_CLK_SSI_EXT1_COM_SEL 137
150#define IMX5_CLK_SSI_EXT2_COM_SEL 138
151#define IMX5_CLK_SSI1_ROOT_PRED 139
152#define IMX5_CLK_SSI1_ROOT_PODF 140
153#define IMX5_CLK_SSI2_ROOT_PRED 141
154#define IMX5_CLK_SSI2_ROOT_PODF 142
155#define IMX5_CLK_SSI_EXT1_PRED 143
156#define IMX5_CLK_SSI_EXT1_PODF 144
157#define IMX5_CLK_SSI_EXT2_PRED 145
158#define IMX5_CLK_SSI_EXT2_PODF 146
159#define IMX5_CLK_SSI1_ROOT_GATE 147
160#define IMX5_CLK_SSI2_ROOT_GATE 148
161#define IMX5_CLK_SSI3_ROOT_GATE 149
162#define IMX5_CLK_SSI_EXT1_GATE 150
163#define IMX5_CLK_SSI_EXT2_GATE 151
164#define IMX5_CLK_EPIT1_IPG_GATE 152
165#define IMX5_CLK_EPIT1_HF_GATE 153
166#define IMX5_CLK_EPIT2_IPG_GATE 154
167#define IMX5_CLK_EPIT2_HF_GATE 155
168#define IMX5_CLK_CAN_SEL 156
169#define IMX5_CLK_CAN1_SERIAL_GATE 157
170#define IMX5_CLK_CAN1_IPG_GATE 158
171#define IMX5_CLK_OWIRE_GATE 159
172#define IMX5_CLK_GPU3D_SEL 160
173#define IMX5_CLK_GPU2D_SEL 161
174#define IMX5_CLK_GPU3D_GATE 162
175#define IMX5_CLK_GPU2D_GATE 163
176#define IMX5_CLK_GARB_GATE 164
177#define IMX5_CLK_CKO1_SEL 165
178#define IMX5_CLK_CKO1_PODF 166
179#define IMX5_CLK_CKO1 167
180#define IMX5_CLK_CKO2_SEL 168
181#define IMX5_CLK_CKO2_PODF 169
182#define IMX5_CLK_CKO2 170
183#define IMX5_CLK_SRTC_GATE 171
184#define IMX5_CLK_PATA_GATE 172
185#define IMX5_CLK_SATA_GATE 173
186#define IMX5_CLK_SPDIF_XTAL_SEL 174
187#define IMX5_CLK_SPDIF0_SEL 175
188#define IMX5_CLK_SPDIF1_SEL 176
189#define IMX5_CLK_SPDIF0_PRED 177
190#define IMX5_CLK_SPDIF0_PODF 178
191#define IMX5_CLK_SPDIF1_PRED 179
192#define IMX5_CLK_SPDIF1_PODF 180
193#define IMX5_CLK_SPDIF0_COM_SEL 181
194#define IMX5_CLK_SPDIF1_COM_SEL 182
195#define IMX5_CLK_SPDIF0_GATE 183
196#define IMX5_CLK_SPDIF1_GATE 184
197#define IMX5_CLK_SPDIF_IPG_GATE 185
198#define IMX5_CLK_OCRAM 186
199#define IMX5_CLK_SAHARA_IPG_GATE 187
200#define IMX5_CLK_SATA_REF 188
201#define IMX5_CLK_END 189
202
203#endif /* __DT_BINDINGS_CLOCK_IMX5_H */
diff --git a/include/dt-bindings/clock/imx6sl-clock.h b/include/dt-bindings/clock/imx6sl-clock.h
index 7fcdf90879f2..7cf5c9969336 100644
--- a/include/dt-bindings/clock/imx6sl-clock.h
+++ b/include/dt-bindings/clock/imx6sl-clock.h
@@ -143,6 +143,8 @@
143#define IMX6SL_CLK_USDHC2 130 143#define IMX6SL_CLK_USDHC2 130
144#define IMX6SL_CLK_USDHC3 131 144#define IMX6SL_CLK_USDHC3 131
145#define IMX6SL_CLK_USDHC4 132 145#define IMX6SL_CLK_USDHC4 132
146#define IMX6SL_CLK_CLK_END 133 146#define IMX6SL_CLK_PLL4_AUDIO_DIV 133
147#define IMX6SL_CLK_SPBA 134
148#define IMX6SL_CLK_END 135
147 149
148#endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */ 150#endif /* __DT_BINDINGS_CLOCK_IMX6SL_H */
diff --git a/include/dt-bindings/clock/mpc512x-clock.h b/include/dt-bindings/clock/mpc512x-clock.h
new file mode 100644
index 000000000000..4f94919327ce
--- /dev/null
+++ b/include/dt-bindings/clock/mpc512x-clock.h
@@ -0,0 +1,76 @@
1/*
2 * This header provides constants for MPC512x clock specs in DT bindings.
3 */
4
5#ifndef _DT_BINDINGS_CLOCK_MPC512x_CLOCK_H
6#define _DT_BINDINGS_CLOCK_MPC512x_CLOCK_H
7
8#define MPC512x_CLK_DUMMY 0
9#define MPC512x_CLK_REF 1
10#define MPC512x_CLK_SYS 2
11#define MPC512x_CLK_DIU 3
12#define MPC512x_CLK_VIU 4
13#define MPC512x_CLK_CSB 5
14#define MPC512x_CLK_E300 6
15#define MPC512x_CLK_IPS 7
16#define MPC512x_CLK_FEC 8
17#define MPC512x_CLK_SATA 9
18#define MPC512x_CLK_PATA 10
19#define MPC512x_CLK_NFC 11
20#define MPC512x_CLK_LPC 12
21#define MPC512x_CLK_MBX_BUS 13
22#define MPC512x_CLK_MBX 14
23#define MPC512x_CLK_MBX_3D 15
24#define MPC512x_CLK_AXE 16
25#define MPC512x_CLK_USB1 17
26#define MPC512x_CLK_USB2 18
27#define MPC512x_CLK_I2C 19
28#define MPC512x_CLK_MSCAN0_MCLK 20
29#define MPC512x_CLK_MSCAN1_MCLK 21
30#define MPC512x_CLK_MSCAN2_MCLK 22
31#define MPC512x_CLK_MSCAN3_MCLK 23
32#define MPC512x_CLK_BDLC 24
33#define MPC512x_CLK_SDHC 25
34#define MPC512x_CLK_PCI 26
35#define MPC512x_CLK_PSC_MCLK_IN 27
36#define MPC512x_CLK_SPDIF_TX 28
37#define MPC512x_CLK_SPDIF_RX 29
38#define MPC512x_CLK_SPDIF_MCLK 30
39#define MPC512x_CLK_SPDIF 31
40#define MPC512x_CLK_AC97 32
41#define MPC512x_CLK_PSC0_MCLK 33
42#define MPC512x_CLK_PSC1_MCLK 34
43#define MPC512x_CLK_PSC2_MCLK 35
44#define MPC512x_CLK_PSC3_MCLK 36
45#define MPC512x_CLK_PSC4_MCLK 37
46#define MPC512x_CLK_PSC5_MCLK 38
47#define MPC512x_CLK_PSC6_MCLK 39
48#define MPC512x_CLK_PSC7_MCLK 40
49#define MPC512x_CLK_PSC8_MCLK 41
50#define MPC512x_CLK_PSC9_MCLK 42
51#define MPC512x_CLK_PSC10_MCLK 43
52#define MPC512x_CLK_PSC11_MCLK 44
53#define MPC512x_CLK_PSC_FIFO 45
54#define MPC512x_CLK_PSC0 46
55#define MPC512x_CLK_PSC1 47
56#define MPC512x_CLK_PSC2 48
57#define MPC512x_CLK_PSC3 49
58#define MPC512x_CLK_PSC4 50
59#define MPC512x_CLK_PSC5 51
60#define MPC512x_CLK_PSC6 52
61#define MPC512x_CLK_PSC7 53
62#define MPC512x_CLK_PSC8 54
63#define MPC512x_CLK_PSC9 55
64#define MPC512x_CLK_PSC10 56
65#define MPC512x_CLK_PSC11 57
66#define MPC512x_CLK_SDHC2 58
67#define MPC512x_CLK_FEC2 59
68#define MPC512x_CLK_OUT0_CLK 60
69#define MPC512x_CLK_OUT1_CLK 61
70#define MPC512x_CLK_OUT2_CLK 62
71#define MPC512x_CLK_OUT3_CLK 63
72#define MPC512x_CLK_CAN_CLK_IN 64
73
74#define MPC512x_CLK_LAST_PUBLIC 64
75
76#endif
diff --git a/include/dt-bindings/clock/qcom,gcc-msm8660.h b/include/dt-bindings/clock/qcom,gcc-msm8660.h
new file mode 100644
index 000000000000..67665f6813dd
--- /dev/null
+++ b/include/dt-bindings/clock/qcom,gcc-msm8660.h
@@ -0,0 +1,276 @@
1/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
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#ifndef _DT_BINDINGS_CLK_MSM_GCC_8660_H
15#define _DT_BINDINGS_CLK_MSM_GCC_8660_H
16
17#define AFAB_CLK_SRC 0
18#define AFAB_CORE_CLK 1
19#define SCSS_A_CLK 2
20#define SCSS_H_CLK 3
21#define SCSS_XO_SRC_CLK 4
22#define AFAB_EBI1_CH0_A_CLK 5
23#define AFAB_EBI1_CH1_A_CLK 6
24#define AFAB_AXI_S0_FCLK 7
25#define AFAB_AXI_S1_FCLK 8
26#define AFAB_AXI_S2_FCLK 9
27#define AFAB_AXI_S3_FCLK 10
28#define AFAB_AXI_S4_FCLK 11
29#define SFAB_CORE_CLK 12
30#define SFAB_AXI_S0_FCLK 13
31#define SFAB_AXI_S1_FCLK 14
32#define SFAB_AXI_S2_FCLK 15
33#define SFAB_AXI_S3_FCLK 16
34#define SFAB_AXI_S4_FCLK 17
35#define SFAB_AHB_S0_FCLK 18
36#define SFAB_AHB_S1_FCLK 19
37#define SFAB_AHB_S2_FCLK 20
38#define SFAB_AHB_S3_FCLK 21
39#define SFAB_AHB_S4_FCLK 22
40#define SFAB_AHB_S5_FCLK 23
41#define SFAB_AHB_S6_FCLK 24
42#define SFAB_ADM0_M0_A_CLK 25
43#define SFAB_ADM0_M1_A_CLK 26
44#define SFAB_ADM0_M2_A_CLK 27
45#define ADM0_CLK 28
46#define ADM0_PBUS_CLK 29
47#define SFAB_ADM1_M0_A_CLK 30
48#define SFAB_ADM1_M1_A_CLK 31
49#define SFAB_ADM1_M2_A_CLK 32
50#define MMFAB_ADM1_M3_A_CLK 33
51#define ADM1_CLK 34
52#define ADM1_PBUS_CLK 35
53#define IMEM0_A_CLK 36
54#define MAHB0_CLK 37
55#define SFAB_LPASS_Q6_A_CLK 38
56#define SFAB_AFAB_M_A_CLK 39
57#define AFAB_SFAB_M0_A_CLK 40
58#define AFAB_SFAB_M1_A_CLK 41
59#define DFAB_CLK_SRC 42
60#define DFAB_CLK 43
61#define DFAB_CORE_CLK 44
62#define SFAB_DFAB_M_A_CLK 45
63#define DFAB_SFAB_M_A_CLK 46
64#define DFAB_SWAY0_H_CLK 47
65#define DFAB_SWAY1_H_CLK 48
66#define DFAB_ARB0_H_CLK 49
67#define DFAB_ARB1_H_CLK 50
68#define PPSS_H_CLK 51
69#define PPSS_PROC_CLK 52
70#define PPSS_TIMER0_CLK 53
71#define PPSS_TIMER1_CLK 54
72#define PMEM_A_CLK 55
73#define DMA_BAM_H_CLK 56
74#define SIC_H_CLK 57
75#define SPS_TIC_H_CLK 58
76#define SLIMBUS_H_CLK 59
77#define SLIMBUS_XO_SRC_CLK 60
78#define CFPB_2X_CLK_SRC 61
79#define CFPB_CLK 62
80#define CFPB0_H_CLK 63
81#define CFPB1_H_CLK 64
82#define CFPB2_H_CLK 65
83#define EBI2_2X_CLK 66
84#define EBI2_CLK 67
85#define SFAB_CFPB_M_H_CLK 68
86#define CFPB_MASTER_H_CLK 69
87#define SFAB_CFPB_S_HCLK 70
88#define CFPB_SPLITTER_H_CLK 71
89#define TSIF_H_CLK 72
90#define TSIF_INACTIVITY_TIMERS_CLK 73
91#define TSIF_REF_SRC 74
92#define TSIF_REF_CLK 75
93#define CE1_H_CLK 76
94#define CE2_H_CLK 77
95#define SFPB_H_CLK_SRC 78
96#define SFPB_H_CLK 79
97#define SFAB_SFPB_M_H_CLK 80
98#define SFAB_SFPB_S_H_CLK 81
99#define RPM_PROC_CLK 82
100#define RPM_BUS_H_CLK 83
101#define RPM_SLEEP_CLK 84
102#define RPM_TIMER_CLK 85
103#define MODEM_AHB1_H_CLK 86
104#define MODEM_AHB2_H_CLK 87
105#define RPM_MSG_RAM_H_CLK 88
106#define SC_H_CLK 89
107#define SC_A_CLK 90
108#define PMIC_ARB0_H_CLK 91
109#define PMIC_ARB1_H_CLK 92
110#define PMIC_SSBI2_SRC 93
111#define PMIC_SSBI2_CLK 94
112#define SDC1_H_CLK 95
113#define SDC2_H_CLK 96
114#define SDC3_H_CLK 97
115#define SDC4_H_CLK 98
116#define SDC5_H_CLK 99
117#define SDC1_SRC 100
118#define SDC2_SRC 101
119#define SDC3_SRC 102
120#define SDC4_SRC 103
121#define SDC5_SRC 104
122#define SDC1_CLK 105
123#define SDC2_CLK 106
124#define SDC3_CLK 107
125#define SDC4_CLK 108
126#define SDC5_CLK 109
127#define USB_HS1_H_CLK 110
128#define USB_HS1_XCVR_SRC 111
129#define USB_HS1_XCVR_CLK 112
130#define USB_HS2_H_CLK 113
131#define USB_HS2_XCVR_SRC 114
132#define USB_HS2_XCVR_CLK 115
133#define USB_FS1_H_CLK 116
134#define USB_FS1_XCVR_FS_SRC 117
135#define USB_FS1_XCVR_FS_CLK 118
136#define USB_FS1_SYSTEM_CLK 119
137#define USB_FS2_H_CLK 120
138#define USB_FS2_XCVR_FS_SRC 121
139#define USB_FS2_XCVR_FS_CLK 122
140#define USB_FS2_SYSTEM_CLK 123
141#define GSBI_COMMON_SIM_SRC 124
142#define GSBI1_H_CLK 125
143#define GSBI2_H_CLK 126
144#define GSBI3_H_CLK 127
145#define GSBI4_H_CLK 128
146#define GSBI5_H_CLK 129
147#define GSBI6_H_CLK 130
148#define GSBI7_H_CLK 131
149#define GSBI8_H_CLK 132
150#define GSBI9_H_CLK 133
151#define GSBI10_H_CLK 134
152#define GSBI11_H_CLK 135
153#define GSBI12_H_CLK 136
154#define GSBI1_UART_SRC 137
155#define GSBI1_UART_CLK 138
156#define GSBI2_UART_SRC 139
157#define GSBI2_UART_CLK 140
158#define GSBI3_UART_SRC 141
159#define GSBI3_UART_CLK 142
160#define GSBI4_UART_SRC 143
161#define GSBI4_UART_CLK 144
162#define GSBI5_UART_SRC 145
163#define GSBI5_UART_CLK 146
164#define GSBI6_UART_SRC 147
165#define GSBI6_UART_CLK 148
166#define GSBI7_UART_SRC 149
167#define GSBI7_UART_CLK 150
168#define GSBI8_UART_SRC 151
169#define GSBI8_UART_CLK 152
170#define GSBI9_UART_SRC 153
171#define GSBI9_UART_CLK 154
172#define GSBI10_UART_SRC 155
173#define GSBI10_UART_CLK 156
174#define GSBI11_UART_SRC 157
175#define GSBI11_UART_CLK 158
176#define GSBI12_UART_SRC 159
177#define GSBI12_UART_CLK 160
178#define GSBI1_QUP_SRC 161
179#define GSBI1_QUP_CLK 162
180#define GSBI2_QUP_SRC 163
181#define GSBI2_QUP_CLK 164
182#define GSBI3_QUP_SRC 165
183#define GSBI3_QUP_CLK 166
184#define GSBI4_QUP_SRC 167
185#define GSBI4_QUP_CLK 168
186#define GSBI5_QUP_SRC 169
187#define GSBI5_QUP_CLK 170
188#define GSBI6_QUP_SRC 171
189#define GSBI6_QUP_CLK 172
190#define GSBI7_QUP_SRC 173
191#define GSBI7_QUP_CLK 174
192#define GSBI8_QUP_SRC 175
193#define GSBI8_QUP_CLK 176
194#define GSBI9_QUP_SRC 177
195#define GSBI9_QUP_CLK 178
196#define GSBI10_QUP_SRC 179
197#define GSBI10_QUP_CLK 180
198#define GSBI11_QUP_SRC 181
199#define GSBI11_QUP_CLK 182
200#define GSBI12_QUP_SRC 183
201#define GSBI12_QUP_CLK 184
202#define GSBI1_SIM_CLK 185
203#define GSBI2_SIM_CLK 186
204#define GSBI3_SIM_CLK 187
205#define GSBI4_SIM_CLK 188
206#define GSBI5_SIM_CLK 189
207#define GSBI6_SIM_CLK 190
208#define GSBI7_SIM_CLK 191
209#define GSBI8_SIM_CLK 192
210#define GSBI9_SIM_CLK 193
211#define GSBI10_SIM_CLK 194
212#define GSBI11_SIM_CLK 195
213#define GSBI12_SIM_CLK 196
214#define SPDM_CFG_H_CLK 197
215#define SPDM_MSTR_H_CLK 198
216#define SPDM_FF_CLK_SRC 199
217#define SPDM_FF_CLK 200
218#define SEC_CTRL_CLK 201
219#define SEC_CTRL_ACC_CLK_SRC 202
220#define SEC_CTRL_ACC_CLK 203
221#define TLMM_H_CLK 204
222#define TLMM_CLK 205
223#define MARM_CLK_SRC 206
224#define MARM_CLK 207
225#define MAHB1_SRC 208
226#define MAHB1_CLK 209
227#define SFAB_MSS_S_H_CLK 210
228#define MAHB2_SRC 211
229#define MAHB2_CLK 212
230#define MSS_MODEM_CLK_SRC 213
231#define MSS_MODEM_CXO_CLK 214
232#define MSS_SLP_CLK 215
233#define MSS_SYS_REF_CLK 216
234#define TSSC_CLK_SRC 217
235#define TSSC_CLK 218
236#define PDM_SRC 219
237#define PDM_CLK 220
238#define GP0_SRC 221
239#define GP0_CLK 222
240#define GP1_SRC 223
241#define GP1_CLK 224
242#define GP2_SRC 225
243#define GP2_CLK 226
244#define PMEM_CLK 227
245#define MPM_CLK 228
246#define EBI1_ASFAB_SRC 229
247#define EBI1_CLK_SRC 230
248#define EBI1_CH0_CLK 231
249#define EBI1_CH1_CLK 232
250#define SFAB_SMPSS_S_H_CLK 233
251#define PRNG_SRC 234
252#define PRNG_CLK 235
253#define PXO_SRC 236
254#define LPASS_CXO_CLK 237
255#define LPASS_PXO_CLK 238
256#define SPDM_CY_PORT0_CLK 239
257#define SPDM_CY_PORT1_CLK 240
258#define SPDM_CY_PORT2_CLK 241
259#define SPDM_CY_PORT3_CLK 242
260#define SPDM_CY_PORT4_CLK 243
261#define SPDM_CY_PORT5_CLK 244
262#define SPDM_CY_PORT6_CLK 245
263#define SPDM_CY_PORT7_CLK 246
264#define PLL0 247
265#define PLL0_VOTE 248
266#define PLL5 249
267#define PLL6 250
268#define PLL6_VOTE 251
269#define PLL8 252
270#define PLL8_VOTE 253
271#define PLL9 254
272#define PLL10 255
273#define PLL11 256
274#define PLL12 257
275
276#endif
diff --git a/include/dt-bindings/clock/qcom,gcc-msm8960.h b/include/dt-bindings/clock/qcom,gcc-msm8960.h
new file mode 100644
index 000000000000..03bbf49d43b7
--- /dev/null
+++ b/include/dt-bindings/clock/qcom,gcc-msm8960.h
@@ -0,0 +1,313 @@
1/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
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#ifndef _DT_BINDINGS_CLK_MSM_GCC_8960_H
15#define _DT_BINDINGS_CLK_MSM_GCC_8960_H
16
17#define AFAB_CLK_SRC 0
18#define AFAB_CORE_CLK 1
19#define SFAB_MSS_Q6_SW_A_CLK 2
20#define SFAB_MSS_Q6_FW_A_CLK 3
21#define QDSS_STM_CLK 4
22#define SCSS_A_CLK 5
23#define SCSS_H_CLK 6
24#define SCSS_XO_SRC_CLK 7
25#define AFAB_EBI1_CH0_A_CLK 8
26#define AFAB_EBI1_CH1_A_CLK 9
27#define AFAB_AXI_S0_FCLK 10
28#define AFAB_AXI_S1_FCLK 11
29#define AFAB_AXI_S2_FCLK 12
30#define AFAB_AXI_S3_FCLK 13
31#define AFAB_AXI_S4_FCLK 14
32#define SFAB_CORE_CLK 15
33#define SFAB_AXI_S0_FCLK 16
34#define SFAB_AXI_S1_FCLK 17
35#define SFAB_AXI_S2_FCLK 18
36#define SFAB_AXI_S3_FCLK 19
37#define SFAB_AXI_S4_FCLK 20
38#define SFAB_AHB_S0_FCLK 21
39#define SFAB_AHB_S1_FCLK 22
40#define SFAB_AHB_S2_FCLK 23
41#define SFAB_AHB_S3_FCLK 24
42#define SFAB_AHB_S4_FCLK 25
43#define SFAB_AHB_S5_FCLK 26
44#define SFAB_AHB_S6_FCLK 27
45#define SFAB_AHB_S7_FCLK 28
46#define QDSS_AT_CLK_SRC 29
47#define QDSS_AT_CLK 30
48#define QDSS_TRACECLKIN_CLK_SRC 31
49#define QDSS_TRACECLKIN_CLK 32
50#define QDSS_TSCTR_CLK_SRC 33
51#define QDSS_TSCTR_CLK 34
52#define SFAB_ADM0_M0_A_CLK 35
53#define SFAB_ADM0_M1_A_CLK 36
54#define SFAB_ADM0_M2_A_CLK 37
55#define ADM0_CLK 38
56#define ADM0_PBUS_CLK 39
57#define MSS_XPU_CLK 40
58#define IMEM0_A_CLK 41
59#define QDSS_H_CLK 42
60#define PCIE_A_CLK 43
61#define PCIE_AUX_CLK 44
62#define PCIE_PHY_REF_CLK 45
63#define PCIE_H_CLK 46
64#define SFAB_CLK_SRC 47
65#define MAHB0_CLK 48
66#define Q6SW_CLK_SRC 49
67#define Q6SW_CLK 50
68#define Q6FW_CLK_SRC 51
69#define Q6FW_CLK 52
70#define SFAB_MSS_M_A_CLK 53
71#define SFAB_USB3_M_A_CLK 54
72#define SFAB_LPASS_Q6_A_CLK 55
73#define SFAB_AFAB_M_A_CLK 56
74#define AFAB_SFAB_M0_A_CLK 57
75#define AFAB_SFAB_M1_A_CLK 58
76#define SFAB_SATA_S_H_CLK 59
77#define DFAB_CLK_SRC 60
78#define DFAB_CLK 61
79#define SFAB_DFAB_M_A_CLK 62
80#define DFAB_SFAB_M_A_CLK 63
81#define DFAB_SWAY0_H_CLK 64
82#define DFAB_SWAY1_H_CLK 65
83#define DFAB_ARB0_H_CLK 66
84#define DFAB_ARB1_H_CLK 67
85#define PPSS_H_CLK 68
86#define PPSS_PROC_CLK 69
87#define PPSS_TIMER0_CLK 70
88#define PPSS_TIMER1_CLK 71
89#define PMEM_A_CLK 72
90#define DMA_BAM_H_CLK 73
91#define SIC_H_CLK 74
92#define SPS_TIC_H_CLK 75
93#define SLIMBUS_H_CLK 76
94#define SLIMBUS_XO_SRC_CLK 77
95#define CFPB_2X_CLK_SRC 78
96#define CFPB_CLK 79
97#define CFPB0_H_CLK 80
98#define CFPB1_H_CLK 81
99#define CFPB2_H_CLK 82
100#define SFAB_CFPB_M_H_CLK 83
101#define CFPB_MASTER_H_CLK 84
102#define SFAB_CFPB_S_HCLK 85
103#define CFPB_SPLITTER_H_CLK 86
104#define TSIF_H_CLK 87
105#define TSIF_INACTIVITY_TIMERS_CLK 88
106#define TSIF_REF_SRC 89
107#define TSIF_REF_CLK 90
108#define CE1_H_CLK 91
109#define CE1_CORE_CLK 92
110#define CE1_SLEEP_CLK 93
111#define CE2_H_CLK 94
112#define CE2_CORE_CLK 95
113#define CE2_SLEEP_CLK 96
114#define SFPB_H_CLK_SRC 97
115#define SFPB_H_CLK 98
116#define SFAB_SFPB_M_H_CLK 99
117#define SFAB_SFPB_S_H_CLK 100
118#define RPM_PROC_CLK 101
119#define RPM_BUS_H_CLK 102
120#define RPM_SLEEP_CLK 103
121#define RPM_TIMER_CLK 104
122#define RPM_MSG_RAM_H_CLK 105
123#define PMIC_ARB0_H_CLK 106
124#define PMIC_ARB1_H_CLK 107
125#define PMIC_SSBI2_SRC 108
126#define PMIC_SSBI2_CLK 109
127#define SDC1_H_CLK 110
128#define SDC2_H_CLK 111
129#define SDC3_H_CLK 112
130#define SDC4_H_CLK 113
131#define SDC5_H_CLK 114
132#define SDC1_SRC 115
133#define SDC2_SRC 116
134#define SDC3_SRC 117
135#define SDC4_SRC 118
136#define SDC5_SRC 119
137#define SDC1_CLK 120
138#define SDC2_CLK 121
139#define SDC3_CLK 122
140#define SDC4_CLK 123
141#define SDC5_CLK 124
142#define DFAB_A2_H_CLK 125
143#define USB_HS1_H_CLK 126
144#define USB_HS1_XCVR_SRC 127
145#define USB_HS1_XCVR_CLK 128
146#define USB_HSIC_H_CLK 129
147#define USB_HSIC_XCVR_FS_SRC 130
148#define USB_HSIC_XCVR_FS_CLK 131
149#define USB_HSIC_SYSTEM_CLK_SRC 132
150#define USB_HSIC_SYSTEM_CLK 133
151#define CFPB0_C0_H_CLK 134
152#define CFPB0_C1_H_CLK 135
153#define CFPB0_D0_H_CLK 136
154#define CFPB0_D1_H_CLK 137
155#define USB_FS1_H_CLK 138
156#define USB_FS1_XCVR_FS_SRC 139
157#define USB_FS1_XCVR_FS_CLK 140
158#define USB_FS1_SYSTEM_CLK 141
159#define USB_FS2_H_CLK 142
160#define USB_FS2_XCVR_FS_SRC 143
161#define USB_FS2_XCVR_FS_CLK 144
162#define USB_FS2_SYSTEM_CLK 145
163#define GSBI_COMMON_SIM_SRC 146
164#define GSBI1_H_CLK 147
165#define GSBI2_H_CLK 148
166#define GSBI3_H_CLK 149
167#define GSBI4_H_CLK 150
168#define GSBI5_H_CLK 151
169#define GSBI6_H_CLK 152
170#define GSBI7_H_CLK 153
171#define GSBI8_H_CLK 154
172#define GSBI9_H_CLK 155
173#define GSBI10_H_CLK 156
174#define GSBI11_H_CLK 157
175#define GSBI12_H_CLK 158
176#define GSBI1_UART_SRC 159
177#define GSBI1_UART_CLK 160
178#define GSBI2_UART_SRC 161
179#define GSBI2_UART_CLK 162
180#define GSBI3_UART_SRC 163
181#define GSBI3_UART_CLK 164
182#define GSBI4_UART_SRC 165
183#define GSBI4_UART_CLK 166
184#define GSBI5_UART_SRC 167
185#define GSBI5_UART_CLK 168
186#define GSBI6_UART_SRC 169
187#define GSBI6_UART_CLK 170
188#define GSBI7_UART_SRC 171
189#define GSBI7_UART_CLK 172
190#define GSBI8_UART_SRC 173
191#define GSBI8_UART_CLK 174
192#define GSBI9_UART_SRC 175
193#define GSBI9_UART_CLK 176
194#define GSBI10_UART_SRC 177
195#define GSBI10_UART_CLK 178
196#define GSBI11_UART_SRC 179
197#define GSBI11_UART_CLK 180
198#define GSBI12_UART_SRC 181
199#define GSBI12_UART_CLK 182
200#define GSBI1_QUP_SRC 183
201#define GSBI1_QUP_CLK 184
202#define GSBI2_QUP_SRC 185
203#define GSBI2_QUP_CLK 186
204#define GSBI3_QUP_SRC 187
205#define GSBI3_QUP_CLK 188
206#define GSBI4_QUP_SRC 189
207#define GSBI4_QUP_CLK 190
208#define GSBI5_QUP_SRC 191
209#define GSBI5_QUP_CLK 192
210#define GSBI6_QUP_SRC 193
211#define GSBI6_QUP_CLK 194
212#define GSBI7_QUP_SRC 195
213#define GSBI7_QUP_CLK 196
214#define GSBI8_QUP_SRC 197
215#define GSBI8_QUP_CLK 198
216#define GSBI9_QUP_SRC 199
217#define GSBI9_QUP_CLK 200
218#define GSBI10_QUP_SRC 201
219#define GSBI10_QUP_CLK 202
220#define GSBI11_QUP_SRC 203
221#define GSBI11_QUP_CLK 204
222#define GSBI12_QUP_SRC 205
223#define GSBI12_QUP_CLK 206
224#define GSBI1_SIM_CLK 207
225#define GSBI2_SIM_CLK 208
226#define GSBI3_SIM_CLK 209
227#define GSBI4_SIM_CLK 210
228#define GSBI5_SIM_CLK 211
229#define GSBI6_SIM_CLK 212
230#define GSBI7_SIM_CLK 213
231#define GSBI8_SIM_CLK 214
232#define GSBI9_SIM_CLK 215
233#define GSBI10_SIM_CLK 216
234#define GSBI11_SIM_CLK 217
235#define GSBI12_SIM_CLK 218
236#define USB_HSIC_HSIC_CLK_SRC 219
237#define USB_HSIC_HSIC_CLK 220
238#define USB_HSIC_HSIO_CAL_CLK 221
239#define SPDM_CFG_H_CLK 222
240#define SPDM_MSTR_H_CLK 223
241#define SPDM_FF_CLK_SRC 224
242#define SPDM_FF_CLK 225
243#define SEC_CTRL_CLK 226
244#define SEC_CTRL_ACC_CLK_SRC 227
245#define SEC_CTRL_ACC_CLK 228
246#define TLMM_H_CLK 229
247#define TLMM_CLK 230
248#define SFAB_MSS_S_H_CLK 231
249#define MSS_SLP_CLK 232
250#define MSS_Q6SW_JTAG_CLK 233
251#define MSS_Q6FW_JTAG_CLK 234
252#define MSS_S_H_CLK 235
253#define MSS_CXO_SRC_CLK 236
254#define SATA_H_CLK 237
255#define SATA_SRC_CLK 238
256#define SATA_RXOOB_CLK 239
257#define SATA_PMALIVE_CLK 240
258#define SATA_PHY_REF_CLK 241
259#define TSSC_CLK_SRC 242
260#define TSSC_CLK 243
261#define PDM_SRC 244
262#define PDM_CLK 245
263#define GP0_SRC 246
264#define GP0_CLK 247
265#define GP1_SRC 248
266#define GP1_CLK 249
267#define GP2_SRC 250
268#define GP2_CLK 251
269#define MPM_CLK 252
270#define EBI1_CLK_SRC 253
271#define EBI1_CH0_CLK 254
272#define EBI1_CH1_CLK 255
273#define EBI1_2X_CLK 256
274#define EBI1_CH0_DQ_CLK 257
275#define EBI1_CH1_DQ_CLK 258
276#define EBI1_CH0_CA_CLK 259
277#define EBI1_CH1_CA_CLK 260
278#define EBI1_XO_CLK 261
279#define SFAB_SMPSS_S_H_CLK 262
280#define PRNG_SRC 263
281#define PRNG_CLK 264
282#define PXO_SRC 265
283#define LPASS_CXO_CLK 266
284#define LPASS_PXO_CLK 267
285#define SPDM_CY_PORT0_CLK 268
286#define SPDM_CY_PORT1_CLK 269
287#define SPDM_CY_PORT2_CLK 270
288#define SPDM_CY_PORT3_CLK 271
289#define SPDM_CY_PORT4_CLK 272
290#define SPDM_CY_PORT5_CLK 273
291#define SPDM_CY_PORT6_CLK 274
292#define SPDM_CY_PORT7_CLK 275
293#define PLL0 276
294#define PLL0_VOTE 277
295#define PLL3 278
296#define PLL3_VOTE 279
297#define PLL4_VOTE 280
298#define PLL5 281
299#define PLL5_VOTE 282
300#define PLL6 283
301#define PLL6_VOTE 284
302#define PLL7_VOTE 285
303#define PLL8 286
304#define PLL8_VOTE 287
305#define PLL9 288
306#define PLL10 289
307#define PLL11 290
308#define PLL12 291
309#define PLL13 292
310#define PLL14 293
311#define PLL14_VOTE 294
312
313#endif
diff --git a/include/dt-bindings/clock/qcom,gcc-msm8974.h b/include/dt-bindings/clock/qcom,gcc-msm8974.h
new file mode 100644
index 000000000000..223ca174d9d3
--- /dev/null
+++ b/include/dt-bindings/clock/qcom,gcc-msm8974.h
@@ -0,0 +1,320 @@
1/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
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#ifndef _DT_BINDINGS_CLK_MSM_GCC_8974_H
15#define _DT_BINDINGS_CLK_MSM_GCC_8974_H
16
17#define GPLL0 0
18#define GPLL0_VOTE 1
19#define CONFIG_NOC_CLK_SRC 2
20#define GPLL2 3
21#define GPLL2_VOTE 4
22#define GPLL3 5
23#define GPLL3_VOTE 6
24#define PERIPH_NOC_CLK_SRC 7
25#define BLSP_UART_SIM_CLK_SRC 8
26#define QDSS_TSCTR_CLK_SRC 9
27#define BIMC_DDR_CLK_SRC 10
28#define SYSTEM_NOC_CLK_SRC 11
29#define GPLL1 12
30#define GPLL1_VOTE 13
31#define RPM_CLK_SRC 14
32#define GCC_BIMC_CLK 15
33#define BIMC_DDR_CPLL0_ROOT_CLK_SRC 16
34#define KPSS_AHB_CLK_SRC 17
35#define QDSS_AT_CLK_SRC 18
36#define USB30_MASTER_CLK_SRC 19
37#define BIMC_DDR_CPLL1_ROOT_CLK_SRC 20
38#define QDSS_STM_CLK_SRC 21
39#define ACC_CLK_SRC 22
40#define SEC_CTRL_CLK_SRC 23
41#define BLSP1_QUP1_I2C_APPS_CLK_SRC 24
42#define BLSP1_QUP1_SPI_APPS_CLK_SRC 25
43#define BLSP1_QUP2_I2C_APPS_CLK_SRC 26
44#define BLSP1_QUP2_SPI_APPS_CLK_SRC 27
45#define BLSP1_QUP3_I2C_APPS_CLK_SRC 28
46#define BLSP1_QUP3_SPI_APPS_CLK_SRC 29
47#define BLSP1_QUP4_I2C_APPS_CLK_SRC 30
48#define BLSP1_QUP4_SPI_APPS_CLK_SRC 31
49#define BLSP1_QUP5_I2C_APPS_CLK_SRC 32
50#define BLSP1_QUP5_SPI_APPS_CLK_SRC 33
51#define BLSP1_QUP6_I2C_APPS_CLK_SRC 34
52#define BLSP1_QUP6_SPI_APPS_CLK_SRC 35
53#define BLSP1_UART1_APPS_CLK_SRC 36
54#define BLSP1_UART2_APPS_CLK_SRC 37
55#define BLSP1_UART3_APPS_CLK_SRC 38
56#define BLSP1_UART4_APPS_CLK_SRC 39
57#define BLSP1_UART5_APPS_CLK_SRC 40
58#define BLSP1_UART6_APPS_CLK_SRC 41
59#define BLSP2_QUP1_I2C_APPS_CLK_SRC 42
60#define BLSP2_QUP1_SPI_APPS_CLK_SRC 43
61#define BLSP2_QUP2_I2C_APPS_CLK_SRC 44
62#define BLSP2_QUP2_SPI_APPS_CLK_SRC 45
63#define BLSP2_QUP3_I2C_APPS_CLK_SRC 46
64#define BLSP2_QUP3_SPI_APPS_CLK_SRC 47
65#define BLSP2_QUP4_I2C_APPS_CLK_SRC 48
66#define BLSP2_QUP4_SPI_APPS_CLK_SRC 49
67#define BLSP2_QUP5_I2C_APPS_CLK_SRC 50
68#define BLSP2_QUP5_SPI_APPS_CLK_SRC 51
69#define BLSP2_QUP6_I2C_APPS_CLK_SRC 52
70#define BLSP2_QUP6_SPI_APPS_CLK_SRC 53
71#define BLSP2_UART1_APPS_CLK_SRC 54
72#define BLSP2_UART2_APPS_CLK_SRC 55
73#define BLSP2_UART3_APPS_CLK_SRC 56
74#define BLSP2_UART4_APPS_CLK_SRC 57
75#define BLSP2_UART5_APPS_CLK_SRC 58
76#define BLSP2_UART6_APPS_CLK_SRC 59
77#define CE1_CLK_SRC 60
78#define CE2_CLK_SRC 61
79#define GP1_CLK_SRC 62
80#define GP2_CLK_SRC 63
81#define GP3_CLK_SRC 64
82#define PDM2_CLK_SRC 65
83#define QDSS_TRACECLKIN_CLK_SRC 66
84#define RBCPR_CLK_SRC 67
85#define SDCC1_APPS_CLK_SRC 68
86#define SDCC2_APPS_CLK_SRC 69
87#define SDCC3_APPS_CLK_SRC 70
88#define SDCC4_APPS_CLK_SRC 71
89#define SPMI_AHB_CLK_SRC 72
90#define SPMI_SER_CLK_SRC 73
91#define TSIF_REF_CLK_SRC 74
92#define USB30_MOCK_UTMI_CLK_SRC 75
93#define USB_HS_SYSTEM_CLK_SRC 76
94#define USB_HSIC_CLK_SRC 77
95#define USB_HSIC_IO_CAL_CLK_SRC 78
96#define USB_HSIC_SYSTEM_CLK_SRC 79
97#define GCC_BAM_DMA_AHB_CLK 80
98#define GCC_BAM_DMA_INACTIVITY_TIMERS_CLK 81
99#define GCC_BIMC_CFG_AHB_CLK 82
100#define GCC_BIMC_KPSS_AXI_CLK 83
101#define GCC_BIMC_SLEEP_CLK 84
102#define GCC_BIMC_SYSNOC_AXI_CLK 85
103#define GCC_BIMC_XO_CLK 86
104#define GCC_BLSP1_AHB_CLK 87
105#define GCC_BLSP1_SLEEP_CLK 88
106#define GCC_BLSP1_QUP1_I2C_APPS_CLK 89
107#define GCC_BLSP1_QUP1_SPI_APPS_CLK 90
108#define GCC_BLSP1_QUP2_I2C_APPS_CLK 91
109#define GCC_BLSP1_QUP2_SPI_APPS_CLK 92
110#define GCC_BLSP1_QUP3_I2C_APPS_CLK 93
111#define GCC_BLSP1_QUP3_SPI_APPS_CLK 94
112#define GCC_BLSP1_QUP4_I2C_APPS_CLK 95
113#define GCC_BLSP1_QUP4_SPI_APPS_CLK 96
114#define GCC_BLSP1_QUP5_I2C_APPS_CLK 97
115#define GCC_BLSP1_QUP5_SPI_APPS_CLK 98
116#define GCC_BLSP1_QUP6_I2C_APPS_CLK 99
117#define GCC_BLSP1_QUP6_SPI_APPS_CLK 100
118#define GCC_BLSP1_UART1_APPS_CLK 101
119#define GCC_BLSP1_UART1_SIM_CLK 102
120#define GCC_BLSP1_UART2_APPS_CLK 103
121#define GCC_BLSP1_UART2_SIM_CLK 104
122#define GCC_BLSP1_UART3_APPS_CLK 105
123#define GCC_BLSP1_UART3_SIM_CLK 106
124#define GCC_BLSP1_UART4_APPS_CLK 107
125#define GCC_BLSP1_UART4_SIM_CLK 108
126#define GCC_BLSP1_UART5_APPS_CLK 109
127#define GCC_BLSP1_UART5_SIM_CLK 110
128#define GCC_BLSP1_UART6_APPS_CLK 111
129#define GCC_BLSP1_UART6_SIM_CLK 112
130#define GCC_BLSP2_AHB_CLK 113
131#define GCC_BLSP2_SLEEP_CLK 114
132#define GCC_BLSP2_QUP1_I2C_APPS_CLK 115
133#define GCC_BLSP2_QUP1_SPI_APPS_CLK 116
134#define GCC_BLSP2_QUP2_I2C_APPS_CLK 117
135#define GCC_BLSP2_QUP2_SPI_APPS_CLK 118
136#define GCC_BLSP2_QUP3_I2C_APPS_CLK 119
137#define GCC_BLSP2_QUP3_SPI_APPS_CLK 120
138#define GCC_BLSP2_QUP4_I2C_APPS_CLK 121
139#define GCC_BLSP2_QUP4_SPI_APPS_CLK 122
140#define GCC_BLSP2_QUP5_I2C_APPS_CLK 123
141#define GCC_BLSP2_QUP5_SPI_APPS_CLK 124
142#define GCC_BLSP2_QUP6_I2C_APPS_CLK 125
143#define GCC_BLSP2_QUP6_SPI_APPS_CLK 126
144#define GCC_BLSP2_UART1_APPS_CLK 127
145#define GCC_BLSP2_UART1_SIM_CLK 128
146#define GCC_BLSP2_UART2_APPS_CLK 129
147#define GCC_BLSP2_UART2_SIM_CLK 130
148#define GCC_BLSP2_UART3_APPS_CLK 131
149#define GCC_BLSP2_UART3_SIM_CLK 132
150#define GCC_BLSP2_UART4_APPS_CLK 133
151#define GCC_BLSP2_UART4_SIM_CLK 134
152#define GCC_BLSP2_UART5_APPS_CLK 135
153#define GCC_BLSP2_UART5_SIM_CLK 136
154#define GCC_BLSP2_UART6_APPS_CLK 137
155#define GCC_BLSP2_UART6_SIM_CLK 138
156#define GCC_BOOT_ROM_AHB_CLK 139
157#define GCC_CE1_AHB_CLK 140
158#define GCC_CE1_AXI_CLK 141
159#define GCC_CE1_CLK 142
160#define GCC_CE2_AHB_CLK 143
161#define GCC_CE2_AXI_CLK 144
162#define GCC_CE2_CLK 145
163#define GCC_CNOC_BUS_TIMEOUT0_AHB_CLK 146
164#define GCC_CNOC_BUS_TIMEOUT1_AHB_CLK 147
165#define GCC_CNOC_BUS_TIMEOUT2_AHB_CLK 148
166#define GCC_CNOC_BUS_TIMEOUT3_AHB_CLK 149
167#define GCC_CNOC_BUS_TIMEOUT4_AHB_CLK 150
168#define GCC_CNOC_BUS_TIMEOUT5_AHB_CLK 151
169#define GCC_CNOC_BUS_TIMEOUT6_AHB_CLK 152
170#define GCC_CFG_NOC_AHB_CLK 153
171#define GCC_CFG_NOC_DDR_CFG_CLK 154
172#define GCC_CFG_NOC_RPM_AHB_CLK 155
173#define GCC_BIMC_DDR_CPLL0_CLK 156
174#define GCC_BIMC_DDR_CPLL1_CLK 157
175#define GCC_DDR_DIM_CFG_CLK 158
176#define GCC_DDR_DIM_SLEEP_CLK 159
177#define GCC_DEHR_CLK 160
178#define GCC_AHB_CLK 161
179#define GCC_IM_SLEEP_CLK 162
180#define GCC_XO_CLK 163
181#define GCC_XO_DIV4_CLK 164
182#define GCC_GP1_CLK 165
183#define GCC_GP2_CLK 166
184#define GCC_GP3_CLK 167
185#define GCC_IMEM_AXI_CLK 168
186#define GCC_IMEM_CFG_AHB_CLK 169
187#define GCC_KPSS_AHB_CLK 170
188#define GCC_KPSS_AXI_CLK 171
189#define GCC_LPASS_Q6_AXI_CLK 172
190#define GCC_MMSS_NOC_AT_CLK 173
191#define GCC_MMSS_NOC_CFG_AHB_CLK 174
192#define GCC_OCMEM_NOC_CFG_AHB_CLK 175
193#define GCC_OCMEM_SYS_NOC_AXI_CLK 176
194#define GCC_MPM_AHB_CLK 177
195#define GCC_MSG_RAM_AHB_CLK 178
196#define GCC_MSS_CFG_AHB_CLK 179
197#define GCC_MSS_Q6_BIMC_AXI_CLK 180
198#define GCC_NOC_CONF_XPU_AHB_CLK 181
199#define GCC_PDM2_CLK 182
200#define GCC_PDM_AHB_CLK 183
201#define GCC_PDM_XO4_CLK 184
202#define GCC_PERIPH_NOC_AHB_CLK 185
203#define GCC_PERIPH_NOC_AT_CLK 186
204#define GCC_PERIPH_NOC_CFG_AHB_CLK 187
205#define GCC_PERIPH_NOC_MPU_CFG_AHB_CLK 188
206#define GCC_PERIPH_XPU_AHB_CLK 189
207#define GCC_PNOC_BUS_TIMEOUT0_AHB_CLK 190
208#define GCC_PNOC_BUS_TIMEOUT1_AHB_CLK 191
209#define GCC_PNOC_BUS_TIMEOUT2_AHB_CLK 192
210#define GCC_PNOC_BUS_TIMEOUT3_AHB_CLK 193
211#define GCC_PNOC_BUS_TIMEOUT4_AHB_CLK 194
212#define GCC_PRNG_AHB_CLK 195
213#define GCC_QDSS_AT_CLK 196
214#define GCC_QDSS_CFG_AHB_CLK 197
215#define GCC_QDSS_DAP_AHB_CLK 198
216#define GCC_QDSS_DAP_CLK 199
217#define GCC_QDSS_ETR_USB_CLK 200
218#define GCC_QDSS_STM_CLK 201
219#define GCC_QDSS_TRACECLKIN_CLK 202
220#define GCC_QDSS_TSCTR_DIV16_CLK 203
221#define GCC_QDSS_TSCTR_DIV2_CLK 204
222#define GCC_QDSS_TSCTR_DIV3_CLK 205
223#define GCC_QDSS_TSCTR_DIV4_CLK 206
224#define GCC_QDSS_TSCTR_DIV8_CLK 207
225#define GCC_QDSS_RBCPR_XPU_AHB_CLK 208
226#define GCC_RBCPR_AHB_CLK 209
227#define GCC_RBCPR_CLK 210
228#define GCC_RPM_BUS_AHB_CLK 211
229#define GCC_RPM_PROC_HCLK 212
230#define GCC_RPM_SLEEP_CLK 213
231#define GCC_RPM_TIMER_CLK 214
232#define GCC_SDCC1_AHB_CLK 215
233#define GCC_SDCC1_APPS_CLK 216
234#define GCC_SDCC1_INACTIVITY_TIMERS_CLK 217
235#define GCC_SDCC2_AHB_CLK 218
236#define GCC_SDCC2_APPS_CLK 219
237#define GCC_SDCC2_INACTIVITY_TIMERS_CLK 220
238#define GCC_SDCC3_AHB_CLK 221
239#define GCC_SDCC3_APPS_CLK 222
240#define GCC_SDCC3_INACTIVITY_TIMERS_CLK 223
241#define GCC_SDCC4_AHB_CLK 224
242#define GCC_SDCC4_APPS_CLK 225
243#define GCC_SDCC4_INACTIVITY_TIMERS_CLK 226
244#define GCC_SEC_CTRL_ACC_CLK 227
245#define GCC_SEC_CTRL_AHB_CLK 228
246#define GCC_SEC_CTRL_BOOT_ROM_PATCH_CLK 229
247#define GCC_SEC_CTRL_CLK 230
248#define GCC_SEC_CTRL_SENSE_CLK 231
249#define GCC_SNOC_BUS_TIMEOUT0_AHB_CLK 232
250#define GCC_SNOC_BUS_TIMEOUT2_AHB_CLK 233
251#define GCC_SPDM_BIMC_CY_CLK 234
252#define GCC_SPDM_CFG_AHB_CLK 235
253#define GCC_SPDM_DEBUG_CY_CLK 236
254#define GCC_SPDM_FF_CLK 237
255#define GCC_SPDM_MSTR_AHB_CLK 238
256#define GCC_SPDM_PNOC_CY_CLK 239
257#define GCC_SPDM_RPM_CY_CLK 240
258#define GCC_SPDM_SNOC_CY_CLK 241
259#define GCC_SPMI_AHB_CLK 242
260#define GCC_SPMI_CNOC_AHB_CLK 243
261#define GCC_SPMI_SER_CLK 244
262#define GCC_SNOC_CNOC_AHB_CLK 245
263#define GCC_SNOC_PNOC_AHB_CLK 246
264#define GCC_SYS_NOC_AT_CLK 247
265#define GCC_SYS_NOC_AXI_CLK 248
266#define GCC_SYS_NOC_KPSS_AHB_CLK 249
267#define GCC_SYS_NOC_QDSS_STM_AXI_CLK 250
268#define GCC_SYS_NOC_USB3_AXI_CLK 251
269#define GCC_TCSR_AHB_CLK 252
270#define GCC_TLMM_AHB_CLK 253
271#define GCC_TLMM_CLK 254
272#define GCC_TSIF_AHB_CLK 255
273#define GCC_TSIF_INACTIVITY_TIMERS_CLK 256
274#define GCC_TSIF_REF_CLK 257
275#define GCC_USB2A_PHY_SLEEP_CLK 258
276#define GCC_USB2B_PHY_SLEEP_CLK 259
277#define GCC_USB30_MASTER_CLK 260
278#define GCC_USB30_MOCK_UTMI_CLK 261
279#define GCC_USB30_SLEEP_CLK 262
280#define GCC_USB_HS_AHB_CLK 263
281#define GCC_USB_HS_INACTIVITY_TIMERS_CLK 264
282#define GCC_USB_HS_SYSTEM_CLK 265
283#define GCC_USB_HSIC_AHB_CLK 266
284#define GCC_USB_HSIC_CLK 267
285#define GCC_USB_HSIC_IO_CAL_CLK 268
286#define GCC_USB_HSIC_IO_CAL_SLEEP_CLK 269
287#define GCC_USB_HSIC_SYSTEM_CLK 270
288#define GCC_WCSS_GPLL1_CLK_SRC 271
289#define GCC_MMSS_GPLL0_CLK_SRC 272
290#define GCC_LPASS_GPLL0_CLK_SRC 273
291#define GCC_WCSS_GPLL1_CLK_SRC_SLEEP_ENA 274
292#define GCC_MMSS_GPLL0_CLK_SRC_SLEEP_ENA 275
293#define GCC_LPASS_GPLL0_CLK_SRC_SLEEP_ENA 276
294#define GCC_IMEM_AXI_CLK_SLEEP_ENA 277
295#define GCC_SYS_NOC_KPSS_AHB_CLK_SLEEP_ENA 278
296#define GCC_BIMC_KPSS_AXI_CLK_SLEEP_ENA 279
297#define GCC_KPSS_AHB_CLK_SLEEP_ENA 280
298#define GCC_KPSS_AXI_CLK_SLEEP_ENA 281
299#define GCC_MPM_AHB_CLK_SLEEP_ENA 282
300#define GCC_OCMEM_SYS_NOC_AXI_CLK_SLEEP_ENA 283
301#define GCC_BLSP1_AHB_CLK_SLEEP_ENA 284
302#define GCC_BLSP1_SLEEP_CLK_SLEEP_ENA 285
303#define GCC_BLSP2_AHB_CLK_SLEEP_ENA 286
304#define GCC_BLSP2_SLEEP_CLK_SLEEP_ENA 287
305#define GCC_PRNG_AHB_CLK_SLEEP_ENA 288
306#define GCC_BAM_DMA_AHB_CLK_SLEEP_ENA 289
307#define GCC_BAM_DMA_INACTIVITY_TIMERS_CLK_SLEEP_ENA 290
308#define GCC_BOOT_ROM_AHB_CLK_SLEEP_ENA 291
309#define GCC_MSG_RAM_AHB_CLK_SLEEP_ENA 292
310#define GCC_TLMM_AHB_CLK_SLEEP_ENA 293
311#define GCC_TLMM_CLK_SLEEP_ENA 294
312#define GCC_SPMI_CNOC_AHB_CLK_SLEEP_ENA 295
313#define GCC_CE1_CLK_SLEEP_ENA 296
314#define GCC_CE1_AXI_CLK_SLEEP_ENA 297
315#define GCC_CE1_AHB_CLK_SLEEP_ENA 298
316#define GCC_CE2_CLK_SLEEP_ENA 299
317#define GCC_CE2_AXI_CLK_SLEEP_ENA 300
318#define GCC_CE2_AHB_CLK_SLEEP_ENA 301
319
320#endif
diff --git a/include/dt-bindings/clock/qcom,mmcc-msm8960.h b/include/dt-bindings/clock/qcom,mmcc-msm8960.h
new file mode 100644
index 000000000000..5868ef14a777
--- /dev/null
+++ b/include/dt-bindings/clock/qcom,mmcc-msm8960.h
@@ -0,0 +1,137 @@
1/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
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#ifndef _DT_BINDINGS_CLK_MSM_MMCC_8960_H
15#define _DT_BINDINGS_CLK_MSM_MMCC_8960_H
16
17#define MMSS_AHB_SRC 0
18#define FAB_AHB_CLK 1
19#define APU_AHB_CLK 2
20#define TV_ENC_AHB_CLK 3
21#define AMP_AHB_CLK 4
22#define DSI2_S_AHB_CLK 5
23#define JPEGD_AHB_CLK 6
24#define GFX2D0_AHB_CLK 7
25#define DSI_S_AHB_CLK 8
26#define DSI2_M_AHB_CLK 9
27#define VPE_AHB_CLK 10
28#define SMMU_AHB_CLK 11
29#define HDMI_M_AHB_CLK 12
30#define VFE_AHB_CLK 13
31#define ROT_AHB_CLK 14
32#define VCODEC_AHB_CLK 15
33#define MDP_AHB_CLK 16
34#define DSI_M_AHB_CLK 17
35#define CSI_AHB_CLK 18
36#define MMSS_IMEM_AHB_CLK 19
37#define IJPEG_AHB_CLK 20
38#define HDMI_S_AHB_CLK 21
39#define GFX3D_AHB_CLK 22
40#define GFX2D1_AHB_CLK 23
41#define MMSS_FPB_CLK 24
42#define MMSS_AXI_SRC 25
43#define MMSS_FAB_CORE 26
44#define FAB_MSP_AXI_CLK 27
45#define JPEGD_AXI_CLK 28
46#define GMEM_AXI_CLK 29
47#define MDP_AXI_CLK 30
48#define MMSS_IMEM_AXI_CLK 31
49#define IJPEG_AXI_CLK 32
50#define GFX3D_AXI_CLK 33
51#define VCODEC_AXI_CLK 34
52#define VFE_AXI_CLK 35
53#define VPE_AXI_CLK 36
54#define ROT_AXI_CLK 37
55#define VCODEC_AXI_A_CLK 38
56#define VCODEC_AXI_B_CLK 39
57#define MM_AXI_S3_FCLK 40
58#define MM_AXI_S2_FCLK 41
59#define MM_AXI_S1_FCLK 42
60#define MM_AXI_S0_FCLK 43
61#define MM_AXI_S2_CLK 44
62#define MM_AXI_S1_CLK 45
63#define MM_AXI_S0_CLK 46
64#define CSI0_SRC 47
65#define CSI0_CLK 48
66#define CSI0_PHY_CLK 49
67#define CSI1_SRC 50
68#define CSI1_CLK 51
69#define CSI1_PHY_CLK 52
70#define CSI2_SRC 53
71#define CSI2_CLK 54
72#define CSI2_PHY_CLK 55
73#define DSI_SRC 56
74#define DSI_CLK 57
75#define CSI_PIX_CLK 58
76#define CSI_RDI_CLK 59
77#define MDP_VSYNC_CLK 60
78#define HDMI_DIV_CLK 61
79#define HDMI_APP_CLK 62
80#define CSI_PIX1_CLK 63
81#define CSI_RDI2_CLK 64
82#define CSI_RDI1_CLK 65
83#define GFX2D0_SRC 66
84#define GFX2D0_CLK 67
85#define GFX2D1_SRC 68
86#define GFX2D1_CLK 69
87#define GFX3D_SRC 70
88#define GFX3D_CLK 71
89#define IJPEG_SRC 72
90#define IJPEG_CLK 73
91#define JPEGD_SRC 74
92#define JPEGD_CLK 75
93#define MDP_SRC 76
94#define MDP_CLK 77
95#define MDP_LUT_CLK 78
96#define DSI2_PIXEL_SRC 79
97#define DSI2_PIXEL_CLK 80
98#define DSI2_SRC 81
99#define DSI2_CLK 82
100#define DSI1_BYTE_SRC 83
101#define DSI1_BYTE_CLK 84
102#define DSI2_BYTE_SRC 85
103#define DSI2_BYTE_CLK 86
104#define DSI1_ESC_SRC 87
105#define DSI1_ESC_CLK 88
106#define DSI2_ESC_SRC 89
107#define DSI2_ESC_CLK 90
108#define ROT_SRC 91
109#define ROT_CLK 92
110#define TV_ENC_CLK 93
111#define TV_DAC_CLK 94
112#define HDMI_TV_CLK 95
113#define MDP_TV_CLK 96
114#define TV_SRC 97
115#define VCODEC_SRC 98
116#define VCODEC_CLK 99
117#define VFE_SRC 100
118#define VFE_CLK 101
119#define VFE_CSI_CLK 102
120#define VPE_SRC 103
121#define VPE_CLK 104
122#define DSI_PIXEL_SRC 105
123#define DSI_PIXEL_CLK 106
124#define CAMCLK0_SRC 107
125#define CAMCLK0_CLK 108
126#define CAMCLK1_SRC 109
127#define CAMCLK1_CLK 110
128#define CAMCLK2_SRC 111
129#define CAMCLK2_CLK 112
130#define CSIPHYTIMER_SRC 113
131#define CSIPHY2_TIMER_CLK 114
132#define CSIPHY1_TIMER_CLK 115
133#define CSIPHY0_TIMER_CLK 116
134#define PLL1 117
135#define PLL2 118
136
137#endif
diff --git a/include/dt-bindings/clock/qcom,mmcc-msm8974.h b/include/dt-bindings/clock/qcom,mmcc-msm8974.h
new file mode 100644
index 000000000000..032ed87ef0f3
--- /dev/null
+++ b/include/dt-bindings/clock/qcom,mmcc-msm8974.h
@@ -0,0 +1,161 @@
1/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
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#ifndef _DT_BINDINGS_CLK_MSM_MMCC_8974_H
15#define _DT_BINDINGS_CLK_MSM_MMCC_8974_H
16
17#define MMSS_AHB_CLK_SRC 0
18#define MMSS_AXI_CLK_SRC 1
19#define MMPLL0 2
20#define MMPLL0_VOTE 3
21#define MMPLL1 4
22#define MMPLL1_VOTE 5
23#define MMPLL2 6
24#define MMPLL3 7
25#define CSI0_CLK_SRC 8
26#define CSI1_CLK_SRC 9
27#define CSI2_CLK_SRC 10
28#define CSI3_CLK_SRC 11
29#define VFE0_CLK_SRC 12
30#define VFE1_CLK_SRC 13
31#define MDP_CLK_SRC 14
32#define GFX3D_CLK_SRC 15
33#define JPEG0_CLK_SRC 16
34#define JPEG1_CLK_SRC 17
35#define JPEG2_CLK_SRC 18
36#define PCLK0_CLK_SRC 19
37#define PCLK1_CLK_SRC 20
38#define VCODEC0_CLK_SRC 21
39#define CCI_CLK_SRC 22
40#define CAMSS_GP0_CLK_SRC 23
41#define CAMSS_GP1_CLK_SRC 24
42#define MCLK0_CLK_SRC 25
43#define MCLK1_CLK_SRC 26
44#define MCLK2_CLK_SRC 27
45#define MCLK3_CLK_SRC 28
46#define CSI0PHYTIMER_CLK_SRC 29
47#define CSI1PHYTIMER_CLK_SRC 30
48#define CSI2PHYTIMER_CLK_SRC 31
49#define CPP_CLK_SRC 32
50#define BYTE0_CLK_SRC 33
51#define BYTE1_CLK_SRC 34
52#define EDPAUX_CLK_SRC 35
53#define EDPLINK_CLK_SRC 36
54#define EDPPIXEL_CLK_SRC 37
55#define ESC0_CLK_SRC 38
56#define ESC1_CLK_SRC 39
57#define EXTPCLK_CLK_SRC 40
58#define HDMI_CLK_SRC 41
59#define VSYNC_CLK_SRC 42
60#define MMSS_RBCPR_CLK_SRC 43
61#define CAMSS_CCI_CCI_AHB_CLK 44
62#define CAMSS_CCI_CCI_CLK 45
63#define CAMSS_CSI0_AHB_CLK 46
64#define CAMSS_CSI0_CLK 47
65#define CAMSS_CSI0PHY_CLK 48
66#define CAMSS_CSI0PIX_CLK 49
67#define CAMSS_CSI0RDI_CLK 50
68#define CAMSS_CSI1_AHB_CLK 51
69#define CAMSS_CSI1_CLK 52
70#define CAMSS_CSI1PHY_CLK 53
71#define CAMSS_CSI1PIX_CLK 54
72#define CAMSS_CSI1RDI_CLK 55
73#define CAMSS_CSI2_AHB_CLK 56
74#define CAMSS_CSI2_CLK 57
75#define CAMSS_CSI2PHY_CLK 58
76#define CAMSS_CSI2PIX_CLK 59
77#define CAMSS_CSI2RDI_CLK 60
78#define CAMSS_CSI3_AHB_CLK 61
79#define CAMSS_CSI3_CLK 62
80#define CAMSS_CSI3PHY_CLK 63
81#define CAMSS_CSI3PIX_CLK 64
82#define CAMSS_CSI3RDI_CLK 65
83#define CAMSS_CSI_VFE0_CLK 66
84#define CAMSS_CSI_VFE1_CLK 67
85#define CAMSS_GP0_CLK 68
86#define CAMSS_GP1_CLK 69
87#define CAMSS_ISPIF_AHB_CLK 70
88#define CAMSS_JPEG_JPEG0_CLK 71
89#define CAMSS_JPEG_JPEG1_CLK 72
90#define CAMSS_JPEG_JPEG2_CLK 73
91#define CAMSS_JPEG_JPEG_AHB_CLK 74
92#define CAMSS_JPEG_JPEG_AXI_CLK 75
93#define CAMSS_JPEG_JPEG_OCMEMNOC_CLK 76
94#define CAMSS_MCLK0_CLK 77
95#define CAMSS_MCLK1_CLK 78
96#define CAMSS_MCLK2_CLK 79
97#define CAMSS_MCLK3_CLK 80
98#define CAMSS_MICRO_AHB_CLK 81
99#define CAMSS_PHY0_CSI0PHYTIMER_CLK 82
100#define CAMSS_PHY1_CSI1PHYTIMER_CLK 83
101#define CAMSS_PHY2_CSI2PHYTIMER_CLK 84
102#define CAMSS_TOP_AHB_CLK 85
103#define CAMSS_VFE_CPP_AHB_CLK 86
104#define CAMSS_VFE_CPP_CLK 87
105#define CAMSS_VFE_VFE0_CLK 88
106#define CAMSS_VFE_VFE1_CLK 89
107#define CAMSS_VFE_VFE_AHB_CLK 90
108#define CAMSS_VFE_VFE_AXI_CLK 91
109#define CAMSS_VFE_VFE_OCMEMNOC_CLK 92
110#define MDSS_AHB_CLK 93
111#define MDSS_AXI_CLK 94
112#define MDSS_BYTE0_CLK 95
113#define MDSS_BYTE1_CLK 96
114#define MDSS_EDPAUX_CLK 97
115#define MDSS_EDPLINK_CLK 98
116#define MDSS_EDPPIXEL_CLK 99
117#define MDSS_ESC0_CLK 100
118#define MDSS_ESC1_CLK 101
119#define MDSS_EXTPCLK_CLK 102
120#define MDSS_HDMI_AHB_CLK 103
121#define MDSS_HDMI_CLK 104
122#define MDSS_MDP_CLK 105
123#define MDSS_MDP_LUT_CLK 106
124#define MDSS_PCLK0_CLK 107
125#define MDSS_PCLK1_CLK 108
126#define MDSS_VSYNC_CLK 109
127#define MMSS_MISC_AHB_CLK 110
128#define MMSS_MMSSNOC_AHB_CLK 111
129#define MMSS_MMSSNOC_BTO_AHB_CLK 112
130#define MMSS_MMSSNOC_AXI_CLK 113
131#define MMSS_S0_AXI_CLK 114
132#define OCMEMCX_AHB_CLK 115
133#define OCMEMCX_OCMEMNOC_CLK 116
134#define OXILI_OCMEMGX_CLK 117
135#define OCMEMNOC_CLK 118
136#define OXILI_GFX3D_CLK 119
137#define OXILICX_AHB_CLK 120
138#define OXILICX_AXI_CLK 121
139#define VENUS0_AHB_CLK 122
140#define VENUS0_AXI_CLK 123
141#define VENUS0_OCMEMNOC_CLK 124
142#define VENUS0_VCODEC0_CLK 125
143#define OCMEMNOC_CLK_SRC 126
144#define SPDM_JPEG0 127
145#define SPDM_JPEG1 128
146#define SPDM_MDP 129
147#define SPDM_AXI 130
148#define SPDM_VCODEC0 131
149#define SPDM_VFE0 132
150#define SPDM_VFE1 133
151#define SPDM_JPEG2 134
152#define SPDM_PCLK1 135
153#define SPDM_GFX3D 136
154#define SPDM_AHB 137
155#define SPDM_PCLK0 138
156#define SPDM_OCMEMNOC 139
157#define SPDM_CSI0 140
158#define SPDM_RM_AXI 141
159#define SPDM_RM_OCMEMNOC 142
160
161#endif
diff --git a/include/dt-bindings/clock/r8a7790-clock.h b/include/dt-bindings/clock/r8a7790-clock.h
new file mode 100644
index 000000000000..859e9be511d9
--- /dev/null
+++ b/include/dt-bindings/clock/r8a7790-clock.h
@@ -0,0 +1,107 @@
1/*
2 * Copyright 2013 Ideas On Board SPRL
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
10#ifndef __DT_BINDINGS_CLOCK_R8A7790_H__
11#define __DT_BINDINGS_CLOCK_R8A7790_H__
12
13/* CPG */
14#define R8A7790_CLK_MAIN 0
15#define R8A7790_CLK_PLL0 1
16#define R8A7790_CLK_PLL1 2
17#define R8A7790_CLK_PLL3 3
18#define R8A7790_CLK_LB 4
19#define R8A7790_CLK_QSPI 5
20#define R8A7790_CLK_SDH 6
21#define R8A7790_CLK_SD0 7
22#define R8A7790_CLK_SD1 8
23#define R8A7790_CLK_Z 9
24
25/* MSTP0 */
26#define R8A7790_CLK_MSIOF0 0
27
28/* MSTP1 */
29#define R8A7790_CLK_TMU1 11
30#define R8A7790_CLK_TMU3 21
31#define R8A7790_CLK_TMU2 22
32#define R8A7790_CLK_CMT0 24
33#define R8A7790_CLK_TMU0 25
34#define R8A7790_CLK_VSP1_DU1 27
35#define R8A7790_CLK_VSP1_DU0 28
36#define R8A7790_CLK_VSP1_RT 30
37#define R8A7790_CLK_VSP1_SY 31
38
39/* MSTP2 */
40#define R8A7790_CLK_SCIFA2 2
41#define R8A7790_CLK_SCIFA1 3
42#define R8A7790_CLK_SCIFA0 4
43#define R8A7790_CLK_MSIOF2 5
44#define R8A7790_CLK_SCIFB0 6
45#define R8A7790_CLK_SCIFB1 7
46#define R8A7790_CLK_MSIOF1 8
47#define R8A7790_CLK_MSIOF3 15
48#define R8A7790_CLK_SCIFB2 16
49#define R8A7790_CLK_SYS_DMAC0 18
50#define R8A7790_CLK_SYS_DMAC1 19
51
52/* MSTP3 */
53#define R8A7790_CLK_TPU0 4
54#define R8A7790_CLK_MMCIF1 5
55#define R8A7790_CLK_SDHI3 11
56#define R8A7790_CLK_SDHI2 12
57#define R8A7790_CLK_SDHI1 13
58#define R8A7790_CLK_SDHI0 14
59#define R8A7790_CLK_MMCIF0 15
60#define R8A7790_CLK_SSUSB 28
61#define R8A7790_CLK_CMT1 29
62#define R8A7790_CLK_USBDMAC0 30
63#define R8A7790_CLK_USBDMAC1 31
64
65/* MSTP5 */
66#define R8A7790_CLK_THERMAL 22
67#define R8A7790_CLK_PWM 23
68
69/* MSTP7 */
70#define R8A7790_CLK_EHCI 3
71#define R8A7790_CLK_HSUSB 4
72#define R8A7790_CLK_HSCIF1 16
73#define R8A7790_CLK_HSCIF0 17
74#define R8A7790_CLK_SCIF1 20
75#define R8A7790_CLK_SCIF0 21
76#define R8A7790_CLK_DU2 22
77#define R8A7790_CLK_DU1 23
78#define R8A7790_CLK_DU0 24
79#define R8A7790_CLK_LVDS1 25
80#define R8A7790_CLK_LVDS0 26
81
82/* MSTP8 */
83#define R8A7790_CLK_VIN3 8
84#define R8A7790_CLK_VIN2 9
85#define R8A7790_CLK_VIN1 10
86#define R8A7790_CLK_VIN0 11
87#define R8A7790_CLK_ETHER 13
88#define R8A7790_CLK_SATA1 14
89#define R8A7790_CLK_SATA0 15
90
91/* MSTP9 */
92#define R8A7790_CLK_GPIO5 7
93#define R8A7790_CLK_GPIO4 8
94#define R8A7790_CLK_GPIO3 9
95#define R8A7790_CLK_GPIO2 10
96#define R8A7790_CLK_GPIO1 11
97#define R8A7790_CLK_GPIO0 12
98#define R8A7790_CLK_RCAN1 15
99#define R8A7790_CLK_RCAN0 16
100#define R8A7790_CLK_QSPI_MOD 17
101#define R8A7790_CLK_IICDVFS 26
102#define R8A7790_CLK_I2C3 28
103#define R8A7790_CLK_I2C2 29
104#define R8A7790_CLK_I2C1 30
105#define R8A7790_CLK_I2C0 31
106
107#endif /* __DT_BINDINGS_CLOCK_R8A7790_H__ */
diff --git a/include/dt-bindings/clock/r8a7791-clock.h b/include/dt-bindings/clock/r8a7791-clock.h
new file mode 100644
index 000000000000..30f82f286e29
--- /dev/null
+++ b/include/dt-bindings/clock/r8a7791-clock.h
@@ -0,0 +1,111 @@
1/*
2 * Copyright 2013 Ideas On Board SPRL
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
10#ifndef __DT_BINDINGS_CLOCK_R8A7791_H__
11#define __DT_BINDINGS_CLOCK_R8A7791_H__
12
13/* CPG */
14#define R8A7791_CLK_MAIN 0
15#define R8A7791_CLK_PLL0 1
16#define R8A7791_CLK_PLL1 2
17#define R8A7791_CLK_PLL3 3
18#define R8A7791_CLK_LB 4
19#define R8A7791_CLK_QSPI 5
20#define R8A7791_CLK_SDH 6
21#define R8A7791_CLK_SD0 7
22#define R8A7791_CLK_Z 8
23
24/* MSTP0 */
25#define R8A7791_CLK_MSIOF0 0
26
27/* MSTP1 */
28#define R8A7791_CLK_TMU1 11
29#define R8A7791_CLK_TMU3 21
30#define R8A7791_CLK_TMU2 22
31#define R8A7791_CLK_CMT0 24
32#define R8A7791_CLK_TMU0 25
33#define R8A7791_CLK_VSP1_DU1 27
34#define R8A7791_CLK_VSP1_DU0 28
35#define R8A7791_CLK_VSP1_SY 31
36
37/* MSTP2 */
38#define R8A7791_CLK_SCIFA2 2
39#define R8A7791_CLK_SCIFA1 3
40#define R8A7791_CLK_SCIFA0 4
41#define R8A7791_CLK_MSIOF2 5
42#define R8A7791_CLK_SCIFB0 6
43#define R8A7791_CLK_SCIFB1 7
44#define R8A7791_CLK_MSIOF1 8
45#define R8A7791_CLK_SCIFB2 16
46#define R8A7791_CLK_DMAC 18
47
48/* MSTP3 */
49#define R8A7791_CLK_TPU0 4
50#define R8A7791_CLK_SDHI2 11
51#define R8A7791_CLK_SDHI1 12
52#define R8A7791_CLK_SDHI0 14
53#define R8A7791_CLK_MMCIF0 15
54#define R8A7791_CLK_SSUSB 28
55#define R8A7791_CLK_CMT1 29
56#define R8A7791_CLK_USBDMAC0 30
57#define R8A7791_CLK_USBDMAC1 31
58
59/* MSTP5 */
60#define R8A7791_CLK_THERMAL 22
61#define R8A7791_CLK_PWM 23
62
63/* MSTP7 */
64#define R8A7791_CLK_HSUSB 4
65#define R8A7791_CLK_HSCIF2 13
66#define R8A7791_CLK_SCIF5 14
67#define R8A7791_CLK_SCIF4 15
68#define R8A7791_CLK_HSCIF1 16
69#define R8A7791_CLK_HSCIF0 17
70#define R8A7791_CLK_SCIF3 18
71#define R8A7791_CLK_SCIF2 19
72#define R8A7791_CLK_SCIF1 20
73#define R8A7791_CLK_SCIF0 21
74#define R8A7791_CLK_DU1 23
75#define R8A7791_CLK_DU0 24
76#define R8A7791_CLK_LVDS0 26
77
78/* MSTP8 */
79#define R8A7791_CLK_VIN2 9
80#define R8A7791_CLK_VIN1 10
81#define R8A7791_CLK_VIN0 11
82#define R8A7791_CLK_ETHER 13
83#define R8A7791_CLK_SATA1 14
84#define R8A7791_CLK_SATA0 15
85
86/* MSTP9 */
87#define R8A7791_CLK_GPIO7 4
88#define R8A7791_CLK_GPIO6 5
89#define R8A7791_CLK_GPIO5 7
90#define R8A7791_CLK_GPIO4 8
91#define R8A7791_CLK_GPIO3 9
92#define R8A7791_CLK_GPIO2 10
93#define R8A7791_CLK_GPIO1 11
94#define R8A7791_CLK_GPIO0 12
95#define R8A7791_CLK_RCAN1 15
96#define R8A7791_CLK_RCAN0 16
97#define R8A7791_CLK_QSPI_MOD 17
98#define R8A7791_CLK_I2C5 25
99#define R8A7791_CLK_IICDVFS 26
100#define R8A7791_CLK_I2C4 27
101#define R8A7791_CLK_I2C3 28
102#define R8A7791_CLK_I2C2 29
103#define R8A7791_CLK_I2C1 30
104#define R8A7791_CLK_I2C0 31
105
106/* MSTP11 */
107#define R8A7791_CLK_SCIFA3 6
108#define R8A7791_CLK_SCIFA4 7
109#define R8A7791_CLK_SCIFA5 8
110
111#endif /* __DT_BINDINGS_CLOCK_R8A7791_H__ */
diff --git a/include/dt-bindings/clock/tegra114-car.h b/include/dt-bindings/clock/tegra114-car.h
index 614aec417902..6d0d8d8ef31e 100644
--- a/include/dt-bindings/clock/tegra114-car.h
+++ b/include/dt-bindings/clock/tegra114-car.h
@@ -37,10 +37,10 @@
37#define TEGRA114_CLK_I2S2 18 37#define TEGRA114_CLK_I2S2 18
38#define TEGRA114_CLK_EPP 19 38#define TEGRA114_CLK_EPP 19
39/* 20 (register bit affects vi and vi_sensor) */ 39/* 20 (register bit affects vi and vi_sensor) */
40#define TEGRA114_CLK_GR_2D 21 40#define TEGRA114_CLK_GR2D 21
41#define TEGRA114_CLK_USBD 22 41#define TEGRA114_CLK_USBD 22
42#define TEGRA114_CLK_ISP 23 42#define TEGRA114_CLK_ISP 23
43#define TEGRA114_CLK_GR_3D 24 43#define TEGRA114_CLK_GR3D 24
44/* 25 */ 44/* 25 */
45#define TEGRA114_CLK_DISP2 26 45#define TEGRA114_CLK_DISP2 26
46#define TEGRA114_CLK_DISP1 27 46#define TEGRA114_CLK_DISP1 27
@@ -289,8 +289,8 @@
289#define TEGRA114_CLK_PCLK 261 289#define TEGRA114_CLK_PCLK 261
290#define TEGRA114_CLK_CCLK_G 262 290#define TEGRA114_CLK_CCLK_G 262
291#define TEGRA114_CLK_CCLK_LP 263 291#define TEGRA114_CLK_CCLK_LP 263
292/* 264 */ 292#define TEGRA114_CLK_DFLL_REF 264
293/* 265 */ 293#define TEGRA114_CLK_DFLL_SOC 265
294/* 266 */ 294/* 266 */
295/* 267 */ 295/* 267 */
296/* 268 */ 296/* 268 */
diff --git a/include/dt-bindings/clock/tegra124-car.h b/include/dt-bindings/clock/tegra124-car.h
new file mode 100644
index 000000000000..a1116a3b54ef
--- /dev/null
+++ b/include/dt-bindings/clock/tegra124-car.h
@@ -0,0 +1,341 @@
1/*
2 * This header provides constants for binding nvidia,tegra124-car.
3 *
4 * The first 192 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB
5 * registers. These IDs often match those in the CAR's RST_DEVICES registers,
6 * but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In
7 * this case, those clocks are assigned IDs above 185 in order to highlight
8 * this issue. Implementations that interpret these clock IDs as bit values
9 * within the CLK_OUT_ENB or RST_DEVICES registers should be careful to
10 * explicitly handle these special cases.
11 *
12 * The balance of the clocks controlled by the CAR are assigned IDs of 185 and
13 * above.
14 */
15
16#ifndef _DT_BINDINGS_CLOCK_TEGRA124_CAR_H
17#define _DT_BINDINGS_CLOCK_TEGRA124_CAR_H
18
19/* 0 */
20/* 1 */
21/* 2 */
22#define TEGRA124_CLK_ISPB 3
23#define TEGRA124_CLK_RTC 4
24#define TEGRA124_CLK_TIMER 5
25#define TEGRA124_CLK_UARTA 6
26/* 7 (register bit affects uartb and vfir) */
27/* 8 */
28#define TEGRA124_CLK_SDMMC2 9
29/* 10 (register bit affects spdif_in and spdif_out) */
30#define TEGRA124_CLK_I2S1 11
31#define TEGRA124_CLK_I2C1 12
32#define TEGRA124_CLK_NDFLASH 13
33#define TEGRA124_CLK_SDMMC1 14
34#define TEGRA124_CLK_SDMMC4 15
35/* 16 */
36#define TEGRA124_CLK_PWM 17
37#define TEGRA124_CLK_I2S2 18
38/* 20 (register bit affects vi and vi_sensor) */
39#define TEGRA124_CLK_GR_2D 21
40#define TEGRA124_CLK_USBD 22
41#define TEGRA124_CLK_ISP 23
42#define TEGRA124_CLK_GR_3D 24
43/* 25 */
44#define TEGRA124_CLK_DISP2 26
45#define TEGRA124_CLK_DISP1 27
46#define TEGRA124_CLK_HOST1X 28
47#define TEGRA124_CLK_VCP 29
48#define TEGRA124_CLK_I2S0 30
49/* 31 */
50
51/* 32 */
52/* 33 */
53#define TEGRA124_CLK_APBDMA 34
54/* 35 */
55#define TEGRA124_CLK_KBC 36
56/* 37 */
57/* 38 */
58/* 39 (register bit affects fuse and fuse_burn) */
59#define TEGRA124_CLK_KFUSE 40
60#define TEGRA124_CLK_SBC1 41
61#define TEGRA124_CLK_NOR 42
62/* 43 */
63#define TEGRA124_CLK_SBC2 44
64/* 45 */
65#define TEGRA124_CLK_SBC3 46
66#define TEGRA124_CLK_I2C5 47
67#define TEGRA124_CLK_DSIA 48
68/* 49 */
69#define TEGRA124_CLK_MIPI 50
70#define TEGRA124_CLK_HDMI 51
71#define TEGRA124_CLK_CSI 52
72/* 53 */
73#define TEGRA124_CLK_I2C2 54
74#define TEGRA124_CLK_UARTC 55
75#define TEGRA124_CLK_MIPI_CAL 56
76#define TEGRA124_CLK_EMC 57
77#define TEGRA124_CLK_USB2 58
78#define TEGRA124_CLK_USB3 59
79/* 60 */
80#define TEGRA124_CLK_VDE 61
81#define TEGRA124_CLK_BSEA 62
82#define TEGRA124_CLK_BSEV 63
83
84/* 64 */
85#define TEGRA124_CLK_UARTD 65
86#define TEGRA124_CLK_UARTE 66
87#define TEGRA124_CLK_I2C3 67
88#define TEGRA124_CLK_SBC4 68
89#define TEGRA124_CLK_SDMMC3 69
90#define TEGRA124_CLK_PCIE 70
91#define TEGRA124_CLK_OWR 71
92#define TEGRA124_CLK_AFI 72
93#define TEGRA124_CLK_CSITE 73
94/* 74 */
95/* 75 */
96#define TEGRA124_CLK_LA 76
97#define TEGRA124_CLK_TRACE 77
98#define TEGRA124_CLK_SOC_THERM 78
99#define TEGRA124_CLK_DTV 79
100#define TEGRA124_CLK_NDSPEED 80
101#define TEGRA124_CLK_I2CSLOW 81
102#define TEGRA124_CLK_DSIB 82
103#define TEGRA124_CLK_TSEC 83
104/* 84 */
105/* 85 */
106/* 86 */
107/* 87 */
108/* 88 */
109#define TEGRA124_CLK_XUSB_HOST 89
110/* 90 */
111#define TEGRA124_CLK_MSENC 91
112#define TEGRA124_CLK_CSUS 92
113/* 93 */
114/* 94 */
115/* 95 (bit affects xusb_dev and xusb_dev_src) */
116
117/* 96 */
118/* 97 */
119/* 98 */
120#define TEGRA124_CLK_MSELECT 99
121#define TEGRA124_CLK_TSENSOR 100
122#define TEGRA124_CLK_I2S3 101
123#define TEGRA124_CLK_I2S4 102
124#define TEGRA124_CLK_I2C4 103
125#define TEGRA124_CLK_SBC5 104
126#define TEGRA124_CLK_SBC6 105
127#define TEGRA124_CLK_D_AUDIO 106
128#define TEGRA124_CLK_APBIF 107
129#define TEGRA124_CLK_DAM0 108
130#define TEGRA124_CLK_DAM1 109
131#define TEGRA124_CLK_DAM2 110
132#define TEGRA124_CLK_HDA2CODEC_2X 111
133/* 112 */
134#define TEGRA124_CLK_AUDIO0_2X 113
135#define TEGRA124_CLK_AUDIO1_2X 114
136#define TEGRA124_CLK_AUDIO2_2X 115
137#define TEGRA124_CLK_AUDIO3_2X 116
138#define TEGRA124_CLK_AUDIO4_2X 117
139#define TEGRA124_CLK_SPDIF_2X 118
140#define TEGRA124_CLK_ACTMON 119
141#define TEGRA124_CLK_EXTERN1 120
142#define TEGRA124_CLK_EXTERN2 121
143#define TEGRA124_CLK_EXTERN3 122
144#define TEGRA124_CLK_SATA_OOB 123
145#define TEGRA124_CLK_SATA 124
146#define TEGRA124_CLK_HDA 125
147/* 126 */
148#define TEGRA124_CLK_SE 127
149
150#define TEGRA124_CLK_HDA2HDMI 128
151#define TEGRA124_CLK_SATA_COLD 129
152/* 130 */
153/* 131 */
154/* 132 */
155/* 133 */
156/* 134 */
157/* 135 */
158/* 136 */
159/* 137 */
160/* 138 */
161/* 139 */
162/* 140 */
163/* 141 */
164/* 142 */
165/* 143 (bit affects xusb_falcon_src, xusb_fs_src, */
166/* xusb_host_src and xusb_ss_src) */
167#define TEGRA124_CLK_CILAB 144
168#define TEGRA124_CLK_CILCD 145
169#define TEGRA124_CLK_CILE 146
170#define TEGRA124_CLK_DSIALP 147
171#define TEGRA124_CLK_DSIBLP 148
172#define TEGRA124_CLK_ENTROPY 149
173#define TEGRA124_CLK_DDS 150
174/* 151 */
175#define TEGRA124_CLK_DP2 152
176#define TEGRA124_CLK_AMX 153
177#define TEGRA124_CLK_ADX 154
178/* 155 (bit affects dfll_ref and dfll_soc) */
179#define TEGRA124_CLK_XUSB_SS 156
180/* 157 */
181/* 158 */
182/* 159 */
183
184/* 160 */
185/* 161 */
186/* 162 */
187/* 163 */
188/* 164 */
189/* 165 */
190#define TEGRA124_CLK_I2C6 166
191/* 167 */
192/* 168 */
193/* 169 */
194/* 170 */
195#define TEGRA124_CLK_VIM2_CLK 171
196/* 172 */
197/* 173 */
198/* 174 */
199/* 175 */
200#define TEGRA124_CLK_HDMI_AUDIO 176
201#define TEGRA124_CLK_CLK72MHZ 177
202#define TEGRA124_CLK_VIC03 178
203/* 179 */
204#define TEGRA124_CLK_ADX1 180
205#define TEGRA124_CLK_DPAUX 181
206#define TEGRA124_CLK_SOR0 182
207/* 183 */
208#define TEGRA124_CLK_GPU 184
209#define TEGRA124_CLK_AMX1 185
210/* 186 */
211/* 187 */
212/* 188 */
213/* 189 */
214/* 190 */
215/* 191 */
216#define TEGRA124_CLK_UARTB 192
217#define TEGRA124_CLK_VFIR 193
218#define TEGRA124_CLK_SPDIF_IN 194
219#define TEGRA124_CLK_SPDIF_OUT 195
220#define TEGRA124_CLK_VI 196
221#define TEGRA124_CLK_VI_SENSOR 197
222#define TEGRA124_CLK_FUSE 198
223#define TEGRA124_CLK_FUSE_BURN 199
224#define TEGRA124_CLK_CLK_32K 200
225#define TEGRA124_CLK_CLK_M 201
226#define TEGRA124_CLK_CLK_M_DIV2 202
227#define TEGRA124_CLK_CLK_M_DIV4 203
228#define TEGRA124_CLK_PLL_REF 204
229#define TEGRA124_CLK_PLL_C 205
230#define TEGRA124_CLK_PLL_C_OUT1 206
231#define TEGRA124_CLK_PLL_C2 207
232#define TEGRA124_CLK_PLL_C3 208
233#define TEGRA124_CLK_PLL_M 209
234#define TEGRA124_CLK_PLL_M_OUT1 210
235#define TEGRA124_CLK_PLL_P 211
236#define TEGRA124_CLK_PLL_P_OUT1 212
237#define TEGRA124_CLK_PLL_P_OUT2 213
238#define TEGRA124_CLK_PLL_P_OUT3 214
239#define TEGRA124_CLK_PLL_P_OUT4 215
240#define TEGRA124_CLK_PLL_A 216
241#define TEGRA124_CLK_PLL_A_OUT0 217
242#define TEGRA124_CLK_PLL_D 218
243#define TEGRA124_CLK_PLL_D_OUT0 219
244#define TEGRA124_CLK_PLL_D2 220
245#define TEGRA124_CLK_PLL_D2_OUT0 221
246#define TEGRA124_CLK_PLL_U 222
247#define TEGRA124_CLK_PLL_U_480M 223
248
249#define TEGRA124_CLK_PLL_U_60M 224
250#define TEGRA124_CLK_PLL_U_48M 225
251#define TEGRA124_CLK_PLL_U_12M 226
252#define TEGRA124_CLK_PLL_X 227
253#define TEGRA124_CLK_PLL_X_OUT0 228
254#define TEGRA124_CLK_PLL_RE_VCO 229
255#define TEGRA124_CLK_PLL_RE_OUT 230
256#define TEGRA124_CLK_PLL_E 231
257#define TEGRA124_CLK_SPDIF_IN_SYNC 232
258#define TEGRA124_CLK_I2S0_SYNC 233
259#define TEGRA124_CLK_I2S1_SYNC 234
260#define TEGRA124_CLK_I2S2_SYNC 235
261#define TEGRA124_CLK_I2S3_SYNC 236
262#define TEGRA124_CLK_I2S4_SYNC 237
263#define TEGRA124_CLK_VIMCLK_SYNC 238
264#define TEGRA124_CLK_AUDIO0 239
265#define TEGRA124_CLK_AUDIO1 240
266#define TEGRA124_CLK_AUDIO2 241
267#define TEGRA124_CLK_AUDIO3 242
268#define TEGRA124_CLK_AUDIO4 243
269#define TEGRA124_CLK_SPDIF 244
270#define TEGRA124_CLK_CLK_OUT_1 245
271#define TEGRA124_CLK_CLK_OUT_2 246
272#define TEGRA124_CLK_CLK_OUT_3 247
273#define TEGRA124_CLK_BLINK 248
274/* 249 */
275/* 250 */
276/* 251 */
277#define TEGRA124_CLK_XUSB_HOST_SRC 252
278#define TEGRA124_CLK_XUSB_FALCON_SRC 253
279#define TEGRA124_CLK_XUSB_FS_SRC 254
280#define TEGRA124_CLK_XUSB_SS_SRC 255
281
282#define TEGRA124_CLK_XUSB_DEV_SRC 256
283#define TEGRA124_CLK_XUSB_DEV 257
284#define TEGRA124_CLK_XUSB_HS_SRC 258
285#define TEGRA124_CLK_SCLK 259
286#define TEGRA124_CLK_HCLK 260
287#define TEGRA124_CLK_PCLK 261
288#define TEGRA124_CLK_CCLK_G 262
289#define TEGRA124_CLK_CCLK_LP 263
290#define TEGRA124_CLK_DFLL_REF 264
291#define TEGRA124_CLK_DFLL_SOC 265
292#define TEGRA124_CLK_VI_SENSOR2 266
293#define TEGRA124_CLK_PLL_P_OUT5 267
294#define TEGRA124_CLK_CML0 268
295#define TEGRA124_CLK_CML1 269
296#define TEGRA124_CLK_PLL_C4 270
297#define TEGRA124_CLK_PLL_DP 271
298#define TEGRA124_CLK_PLL_E_MUX 272
299/* 273 */
300/* 274 */
301/* 275 */
302/* 276 */
303/* 277 */
304/* 278 */
305/* 279 */
306/* 280 */
307/* 281 */
308/* 282 */
309/* 283 */
310/* 284 */
311/* 285 */
312/* 286 */
313/* 287 */
314
315/* 288 */
316/* 289 */
317/* 290 */
318/* 291 */
319/* 292 */
320/* 293 */
321/* 294 */
322/* 295 */
323/* 296 */
324/* 297 */
325/* 298 */
326/* 299 */
327#define TEGRA124_CLK_AUDIO0_MUX 300
328#define TEGRA124_CLK_AUDIO1_MUX 301
329#define TEGRA124_CLK_AUDIO2_MUX 302
330#define TEGRA124_CLK_AUDIO3_MUX 303
331#define TEGRA124_CLK_AUDIO4_MUX 304
332#define TEGRA124_CLK_SPDIF_MUX 305
333#define TEGRA124_CLK_CLK_OUT_1_MUX 306
334#define TEGRA124_CLK_CLK_OUT_2_MUX 307
335#define TEGRA124_CLK_CLK_OUT_3_MUX 308
336#define TEGRA124_CLK_DSIA_MUX 309
337#define TEGRA124_CLK_DSIB_MUX 310
338#define TEGRA124_CLK_SOR0_LVDS 311
339#define TEGRA124_CLK_CLK_MAX 312
340
341#endif /* _DT_BINDINGS_CLOCK_TEGRA124_CAR_H */
diff --git a/include/dt-bindings/clock/tegra20-car.h b/include/dt-bindings/clock/tegra20-car.h
index a1ae9a8fdd6c..9406207cfac8 100644
--- a/include/dt-bindings/clock/tegra20-car.h
+++ b/include/dt-bindings/clock/tegra20-car.h
@@ -92,7 +92,7 @@
92#define TEGRA20_CLK_OWR 71 92#define TEGRA20_CLK_OWR 71
93#define TEGRA20_CLK_AFI 72 93#define TEGRA20_CLK_AFI 72
94#define TEGRA20_CLK_CSITE 73 94#define TEGRA20_CLK_CSITE 73
95#define TEGRA20_CLK_PCIE_XCLK 74 95/* 74 */
96#define TEGRA20_CLK_AVPUCQ 75 96#define TEGRA20_CLK_AVPUCQ 75
97#define TEGRA20_CLK_LA 76 97#define TEGRA20_CLK_LA 76
98/* 77 */ 98/* 77 */
diff --git a/include/dt-bindings/clock/tegra30-car.h b/include/dt-bindings/clock/tegra30-car.h
index e40fae8f9a8d..889e49ba0aa3 100644
--- a/include/dt-bindings/clock/tegra30-car.h
+++ b/include/dt-bindings/clock/tegra30-car.h
@@ -92,7 +92,7 @@
92#define TEGRA30_CLK_OWR 71 92#define TEGRA30_CLK_OWR 71
93#define TEGRA30_CLK_AFI 72 93#define TEGRA30_CLK_AFI 72
94#define TEGRA30_CLK_CSITE 73 94#define TEGRA30_CLK_CSITE 73
95#define TEGRA30_CLK_PCIEX 74 95/* 74 */
96#define TEGRA30_CLK_AVPUCQ 75 96#define TEGRA30_CLK_AVPUCQ 75
97#define TEGRA30_CLK_LA 76 97#define TEGRA30_CLK_LA 76
98/* 77 */ 98/* 77 */
@@ -260,6 +260,14 @@
260/* 298 */ 260/* 298 */
261/* 299 */ 261/* 299 */
262#define TEGRA30_CLK_CLK_OUT_1_MUX 300 262#define TEGRA30_CLK_CLK_OUT_1_MUX 300
263#define TEGRA30_CLK_CLK_MAX 301 263#define TEGRA30_CLK_CLK_OUT_2_MUX 301
264#define TEGRA30_CLK_CLK_OUT_3_MUX 302
265#define TEGRA30_CLK_AUDIO0_MUX 303
266#define TEGRA30_CLK_AUDIO1_MUX 304
267#define TEGRA30_CLK_AUDIO2_MUX 305
268#define TEGRA30_CLK_AUDIO3_MUX 306
269#define TEGRA30_CLK_AUDIO4_MUX 307
270#define TEGRA30_CLK_SPDIF_MUX 308
271#define TEGRA30_CLK_CLK_MAX 309
264 272
265#endif /* _DT_BINDINGS_CLOCK_TEGRA30_CAR_H */ 273#endif /* _DT_BINDINGS_CLOCK_TEGRA30_CAR_H */
diff --git a/include/dt-bindings/clock/vf610-clock.h b/include/dt-bindings/clock/vf610-clock.h
index 4aa2b48cd151..a91602951d3d 100644
--- a/include/dt-bindings/clock/vf610-clock.h
+++ b/include/dt-bindings/clock/vf610-clock.h
@@ -160,6 +160,10 @@
160#define VF610_CLK_GPU2D 147 160#define VF610_CLK_GPU2D 147
161#define VF610_CLK_ENET0 148 161#define VF610_CLK_ENET0 148
162#define VF610_CLK_ENET1 149 162#define VF610_CLK_ENET1 149
163#define VF610_CLK_END 150 163#define VF610_CLK_DMAMUX0 150
164#define VF610_CLK_DMAMUX1 151
165#define VF610_CLK_DMAMUX2 152
166#define VF610_CLK_DMAMUX3 153
167#define VF610_CLK_END 154
164 168
165#endif /* __DT_BINDINGS_CLOCK_VF610_H */ 169#endif /* __DT_BINDINGS_CLOCK_VF610_H */
diff --git a/include/dt-bindings/gpio/tegra-gpio.h b/include/dt-bindings/gpio/tegra-gpio.h
index 4d179c00f081..197dc28b676e 100644
--- a/include/dt-bindings/gpio/tegra-gpio.h
+++ b/include/dt-bindings/gpio/tegra-gpio.h
@@ -43,6 +43,7 @@
43#define TEGRA_GPIO_BANK_ID_CC 28 43#define TEGRA_GPIO_BANK_ID_CC 28
44#define TEGRA_GPIO_BANK_ID_DD 29 44#define TEGRA_GPIO_BANK_ID_DD 29
45#define TEGRA_GPIO_BANK_ID_EE 30 45#define TEGRA_GPIO_BANK_ID_EE 30
46#define TEGRA_GPIO_BANK_ID_FF 31
46 47
47#define TEGRA_GPIO(bank, offset) \ 48#define TEGRA_GPIO(bank, offset) \
48 ((TEGRA_GPIO_BANK_ID_##bank * 8) + offset) 49 ((TEGRA_GPIO_BANK_ID_##bank * 8) + offset)
diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h
index bed35e36fd27..b04528cd033c 100644
--- a/include/dt-bindings/pinctrl/omap.h
+++ b/include/dt-bindings/pinctrl/omap.h
@@ -49,5 +49,25 @@
49#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN) 49#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN)
50#define PIN_OFF_WAKEUPENABLE WAKEUP_EN 50#define PIN_OFF_WAKEUPENABLE WAKEUP_EN
51 51
52/*
53 * Macros to allow using the absolute physical address instead of the
54 * padconf registers instead of the offset from padconf base.
55 */
56#define OMAP_IOPAD_OFFSET(pa, offset) (((pa) & 0xffff) - (offset))
57
58#define OMAP2420_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0030) (val)
59#define OMAP2430_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2030) (val)
60#define OMAP3_CORE1_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2030) (val)
61#define OMAP3430_CORE2_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x25d8) (val)
62#define OMAP3630_CORE2_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x25a0) (val)
63#define OMAP3_WKUP_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2a00) (val)
64#define AM33XX_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val)
65#define OMAP4_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0040) (val)
66#define OMAP4_WKUP_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0xe040) (val)
67#define AM4372_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x0800) (val)
68#define OMAP5_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x2840) (val)
69#define OMAP5_WKUP_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0xc840) (val)
70#define DRA7XX_CORE_IOPAD(pa, val) OMAP_IOPAD_OFFSET((pa), 0x3400) (val)
71
52#endif 72#endif
53 73
diff --git a/include/dt-bindings/pinctrl/pinctrl-tegra.h b/include/dt-bindings/pinctrl/pinctrl-tegra.h
new file mode 100644
index 000000000000..ebafa498be0f
--- /dev/null
+++ b/include/dt-bindings/pinctrl/pinctrl-tegra.h
@@ -0,0 +1,45 @@
1/*
2 * This header provides constants for Tegra pinctrl bindings.
3 *
4 * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
5 *
6 * Author: Laxman Dewangan <ldewangan@nvidia.com>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License,
10 * version 2, as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 */
17
18#ifndef _DT_BINDINGS_PINCTRL_TEGRA_H
19#define _DT_BINDINGS_PINCTRL_TEGRA_H
20
21/*
22 * Enable/disable for diffeent dt properties. This is applicable for
23 * properties nvidia,enable-input, nvidia,tristate, nvidia,open-drain,
24 * nvidia,lock, nvidia,rcv-sel, nvidia,high-speed-mode, nvidia,schmitt.
25 */
26#define TEGRA_PIN_DISABLE 0
27#define TEGRA_PIN_ENABLE 1
28
29#define TEGRA_PIN_PULL_NONE 0
30#define TEGRA_PIN_PULL_DOWN 1
31#define TEGRA_PIN_PULL_UP 2
32
33/* Low power mode driver */
34#define TEGRA_PIN_LP_DRIVE_DIV_8 0
35#define TEGRA_PIN_LP_DRIVE_DIV_4 1
36#define TEGRA_PIN_LP_DRIVE_DIV_2 2
37#define TEGRA_PIN_LP_DRIVE_DIV_1 3
38
39/* Rising/Falling slew rate */
40#define TEGRA_PIN_SLEW_RATE_FASTEST 0
41#define TEGRA_PIN_SLEW_RATE_FAST 1
42#define TEGRA_PIN_SLEW_RATE_SLOW 2
43#define TEGRA_PIN_SLEW_RATE_SLOWEST 3
44
45#endif
diff --git a/include/dt-bindings/reset/qcom,gcc-msm8660.h b/include/dt-bindings/reset/qcom,gcc-msm8660.h
new file mode 100644
index 000000000000..a83282fe5465
--- /dev/null
+++ b/include/dt-bindings/reset/qcom,gcc-msm8660.h
@@ -0,0 +1,134 @@
1/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
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#ifndef _DT_BINDINGS_RESET_MSM_GCC_8660_H
15#define _DT_BINDINGS_RESET_MSM_GCC_8660_H
16
17#define AFAB_CORE_RESET 0
18#define SCSS_SYS_RESET 1
19#define SCSS_SYS_POR_RESET 2
20#define AFAB_SMPSS_S_RESET 3
21#define AFAB_SMPSS_M1_RESET 4
22#define AFAB_SMPSS_M0_RESET 5
23#define AFAB_EBI1_S_RESET 6
24#define SFAB_CORE_RESET 7
25#define SFAB_ADM0_M0_RESET 8
26#define SFAB_ADM0_M1_RESET 9
27#define SFAB_ADM0_M2_RESET 10
28#define ADM0_C2_RESET 11
29#define ADM0_C1_RESET 12
30#define ADM0_C0_RESET 13
31#define ADM0_PBUS_RESET 14
32#define ADM0_RESET 15
33#define SFAB_ADM1_M0_RESET 16
34#define SFAB_ADM1_M1_RESET 17
35#define SFAB_ADM1_M2_RESET 18
36#define MMFAB_ADM1_M3_RESET 19
37#define ADM1_C3_RESET 20
38#define ADM1_C2_RESET 21
39#define ADM1_C1_RESET 22
40#define ADM1_C0_RESET 23
41#define ADM1_PBUS_RESET 24
42#define ADM1_RESET 25
43#define IMEM0_RESET 26
44#define SFAB_LPASS_Q6_RESET 27
45#define SFAB_AFAB_M_RESET 28
46#define AFAB_SFAB_M0_RESET 29
47#define AFAB_SFAB_M1_RESET 30
48#define DFAB_CORE_RESET 31
49#define SFAB_DFAB_M_RESET 32
50#define DFAB_SFAB_M_RESET 33
51#define DFAB_SWAY0_RESET 34
52#define DFAB_SWAY1_RESET 35
53#define DFAB_ARB0_RESET 36
54#define DFAB_ARB1_RESET 37
55#define PPSS_PROC_RESET 38
56#define PPSS_RESET 39
57#define PMEM_RESET 40
58#define DMA_BAM_RESET 41
59#define SIC_RESET 42
60#define SPS_TIC_RESET 43
61#define CFBP0_RESET 44
62#define CFBP1_RESET 45
63#define CFBP2_RESET 46
64#define EBI2_RESET 47
65#define SFAB_CFPB_M_RESET 48
66#define CFPB_MASTER_RESET 49
67#define SFAB_CFPB_S_RESET 50
68#define CFPB_SPLITTER_RESET 51
69#define TSIF_RESET 52
70#define CE1_RESET 53
71#define CE2_RESET 54
72#define SFAB_SFPB_M_RESET 55
73#define SFAB_SFPB_S_RESET 56
74#define RPM_PROC_RESET 57
75#define RPM_BUS_RESET 58
76#define RPM_MSG_RAM_RESET 59
77#define PMIC_ARB0_RESET 60
78#define PMIC_ARB1_RESET 61
79#define PMIC_SSBI2_RESET 62
80#define SDC1_RESET 63
81#define SDC2_RESET 64
82#define SDC3_RESET 65
83#define SDC4_RESET 66
84#define SDC5_RESET 67
85#define USB_HS1_RESET 68
86#define USB_HS2_XCVR_RESET 69
87#define USB_HS2_RESET 70
88#define USB_FS1_XCVR_RESET 71
89#define USB_FS1_RESET 72
90#define USB_FS2_XCVR_RESET 73
91#define USB_FS2_RESET 74
92#define GSBI1_RESET 75
93#define GSBI2_RESET 76
94#define GSBI3_RESET 77
95#define GSBI4_RESET 78
96#define GSBI5_RESET 79
97#define GSBI6_RESET 80
98#define GSBI7_RESET 81
99#define GSBI8_RESET 82
100#define GSBI9_RESET 83
101#define GSBI10_RESET 84
102#define GSBI11_RESET 85
103#define GSBI12_RESET 86
104#define SPDM_RESET 87
105#define SEC_CTRL_RESET 88
106#define TLMM_H_RESET 89
107#define TLMM_RESET 90
108#define MARRM_PWRON_RESET 91
109#define MARM_RESET 92
110#define MAHB1_RESET 93
111#define SFAB_MSS_S_RESET 94
112#define MAHB2_RESET 95
113#define MODEM_SW_AHB_RESET 96
114#define MODEM_RESET 97
115#define SFAB_MSS_MDM1_RESET 98
116#define SFAB_MSS_MDM0_RESET 99
117#define MSS_SLP_RESET 100
118#define MSS_MARM_SAW_RESET 101
119#define MSS_WDOG_RESET 102
120#define TSSC_RESET 103
121#define PDM_RESET 104
122#define SCSS_CORE0_RESET 105
123#define SCSS_CORE0_POR_RESET 106
124#define SCSS_CORE1_RESET 107
125#define SCSS_CORE1_POR_RESET 108
126#define MPM_RESET 109
127#define EBI1_1X_DIV_RESET 110
128#define EBI1_RESET 111
129#define SFAB_SMPSS_S_RESET 112
130#define USB_PHY0_RESET 113
131#define USB_PHY1_RESET 114
132#define PRNG_RESET 115
133
134#endif
diff --git a/include/dt-bindings/reset/qcom,gcc-msm8960.h b/include/dt-bindings/reset/qcom,gcc-msm8960.h
new file mode 100644
index 000000000000..a840e680323c
--- /dev/null
+++ b/include/dt-bindings/reset/qcom,gcc-msm8960.h
@@ -0,0 +1,118 @@
1/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
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#ifndef _DT_BINDINGS_RESET_MSM_GCC_8960_H
15#define _DT_BINDINGS_RESET_MSM_GCC_8960_H
16
17#define SFAB_MSS_Q6_SW_RESET 0
18#define SFAB_MSS_Q6_FW_RESET 1
19#define QDSS_STM_RESET 2
20#define AFAB_SMPSS_S_RESET 3
21#define AFAB_SMPSS_M1_RESET 4
22#define AFAB_SMPSS_M0_RESET 5
23#define AFAB_EBI1_CH0_RESET 6
24#define AFAB_EBI1_CH1_RESET 7
25#define SFAB_ADM0_M0_RESET 8
26#define SFAB_ADM0_M1_RESET 9
27#define SFAB_ADM0_M2_RESET 10
28#define ADM0_C2_RESET 11
29#define ADM0_C1_RESET 12
30#define ADM0_C0_RESET 13
31#define ADM0_PBUS_RESET 14
32#define ADM0_RESET 15
33#define QDSS_CLKS_SW_RESET 16
34#define QDSS_POR_RESET 17
35#define QDSS_TSCTR_RESET 18
36#define QDSS_HRESET_RESET 19
37#define QDSS_AXI_RESET 20
38#define QDSS_DBG_RESET 21
39#define PCIE_A_RESET 22
40#define PCIE_AUX_RESET 23
41#define PCIE_H_RESET 24
42#define SFAB_PCIE_M_RESET 25
43#define SFAB_PCIE_S_RESET 26
44#define SFAB_MSS_M_RESET 27
45#define SFAB_USB3_M_RESET 28
46#define SFAB_RIVA_M_RESET 29
47#define SFAB_LPASS_RESET 30
48#define SFAB_AFAB_M_RESET 31
49#define AFAB_SFAB_M0_RESET 32
50#define AFAB_SFAB_M1_RESET 33
51#define SFAB_SATA_S_RESET 34
52#define SFAB_DFAB_M_RESET 35
53#define DFAB_SFAB_M_RESET 36
54#define DFAB_SWAY0_RESET 37
55#define DFAB_SWAY1_RESET 38
56#define DFAB_ARB0_RESET 39
57#define DFAB_ARB1_RESET 40
58#define PPSS_PROC_RESET 41
59#define PPSS_RESET 42
60#define DMA_BAM_RESET 43
61#define SIC_TIC_RESET 44
62#define SLIMBUS_H_RESET 45
63#define SFAB_CFPB_M_RESET 46
64#define SFAB_CFPB_S_RESET 47
65#define TSIF_H_RESET 48
66#define CE1_H_RESET 49
67#define CE1_CORE_RESET 50
68#define CE1_SLEEP_RESET 51
69#define CE2_H_RESET 52
70#define CE2_CORE_RESET 53
71#define SFAB_SFPB_M_RESET 54
72#define SFAB_SFPB_S_RESET 55
73#define RPM_PROC_RESET 56
74#define PMIC_SSBI2_RESET 57
75#define SDC1_RESET 58
76#define SDC2_RESET 59
77#define SDC3_RESET 60
78#define SDC4_RESET 61
79#define SDC5_RESET 62
80#define DFAB_A2_RESET 63
81#define USB_HS1_RESET 64
82#define USB_HSIC_RESET 65
83#define USB_FS1_XCVR_RESET 66
84#define USB_FS1_RESET 67
85#define USB_FS2_XCVR_RESET 68
86#define USB_FS2_RESET 69
87#define GSBI1_RESET 70
88#define GSBI2_RESET 71
89#define GSBI3_RESET 72
90#define GSBI4_RESET 73
91#define GSBI5_RESET 74
92#define GSBI6_RESET 75
93#define GSBI7_RESET 76
94#define GSBI8_RESET 77
95#define GSBI9_RESET 78
96#define GSBI10_RESET 79
97#define GSBI11_RESET 80
98#define GSBI12_RESET 81
99#define SPDM_RESET 82
100#define TLMM_H_RESET 83
101#define SFAB_MSS_S_RESET 84
102#define MSS_SLP_RESET 85
103#define MSS_Q6SW_JTAG_RESET 86
104#define MSS_Q6FW_JTAG_RESET 87
105#define MSS_RESET 88
106#define SATA_H_RESET 89
107#define SATA_RXOOB_RESE 90
108#define SATA_PMALIVE_RESET 91
109#define SATA_SFAB_M_RESET 92
110#define TSSC_RESET 93
111#define PDM_RESET 94
112#define MPM_H_RESET 95
113#define MPM_RESET 96
114#define SFAB_SMPSS_S_RESET 97
115#define PRNG_RESET 98
116#define RIVA_RESET 99
117
118#endif
diff --git a/include/dt-bindings/reset/qcom,gcc-msm8974.h b/include/dt-bindings/reset/qcom,gcc-msm8974.h
new file mode 100644
index 000000000000..9bdf54322938
--- /dev/null
+++ b/include/dt-bindings/reset/qcom,gcc-msm8974.h
@@ -0,0 +1,96 @@
1/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
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#ifndef _DT_BINDINGS_RESET_MSM_GCC_8974_H
15#define _DT_BINDINGS_RESET_MSM_GCC_8974_H
16
17#define GCC_SYSTEM_NOC_BCR 0
18#define GCC_CONFIG_NOC_BCR 1
19#define GCC_PERIPH_NOC_BCR 2
20#define GCC_IMEM_BCR 3
21#define GCC_MMSS_BCR 4
22#define GCC_QDSS_BCR 5
23#define GCC_USB_30_BCR 6
24#define GCC_USB3_PHY_BCR 7
25#define GCC_USB_HS_HSIC_BCR 8
26#define GCC_USB_HS_BCR 9
27#define GCC_USB2A_PHY_BCR 10
28#define GCC_USB2B_PHY_BCR 11
29#define GCC_SDCC1_BCR 12
30#define GCC_SDCC2_BCR 13
31#define GCC_SDCC3_BCR 14
32#define GCC_SDCC4_BCR 15
33#define GCC_BLSP1_BCR 16
34#define GCC_BLSP1_QUP1_BCR 17
35#define GCC_BLSP1_UART1_BCR 18
36#define GCC_BLSP1_QUP2_BCR 19
37#define GCC_BLSP1_UART2_BCR 20
38#define GCC_BLSP1_QUP3_BCR 21
39#define GCC_BLSP1_UART3_BCR 22
40#define GCC_BLSP1_QUP4_BCR 23
41#define GCC_BLSP1_UART4_BCR 24
42#define GCC_BLSP1_QUP5_BCR 25
43#define GCC_BLSP1_UART5_BCR 26
44#define GCC_BLSP1_QUP6_BCR 27
45#define GCC_BLSP1_UART6_BCR 28
46#define GCC_BLSP2_BCR 29
47#define GCC_BLSP2_QUP1_BCR 30
48#define GCC_BLSP2_UART1_BCR 31
49#define GCC_BLSP2_QUP2_BCR 32
50#define GCC_BLSP2_UART2_BCR 33
51#define GCC_BLSP2_QUP3_BCR 34
52#define GCC_BLSP2_UART3_BCR 35
53#define GCC_BLSP2_QUP4_BCR 36
54#define GCC_BLSP2_UART4_BCR 37
55#define GCC_BLSP2_QUP5_BCR 38
56#define GCC_BLSP2_UART5_BCR 39
57#define GCC_BLSP2_QUP6_BCR 40
58#define GCC_BLSP2_UART6_BCR 41
59#define GCC_PDM_BCR 42
60#define GCC_BAM_DMA_BCR 43
61#define GCC_TSIF_BCR 44
62#define GCC_TCSR_BCR 45
63#define GCC_BOOT_ROM_BCR 46
64#define GCC_MSG_RAM_BCR 47
65#define GCC_TLMM_BCR 48
66#define GCC_MPM_BCR 49
67#define GCC_SEC_CTRL_BCR 50
68#define GCC_SPMI_BCR 51
69#define GCC_SPDM_BCR 52
70#define GCC_CE1_BCR 53
71#define GCC_CE2_BCR 54
72#define GCC_BIMC_BCR 55
73#define GCC_MPM_NON_AHB_RESET 56
74#define GCC_MPM_AHB_RESET 57
75#define GCC_SNOC_BUS_TIMEOUT0_BCR 58
76#define GCC_SNOC_BUS_TIMEOUT2_BCR 59
77#define GCC_PNOC_BUS_TIMEOUT0_BCR 60
78#define GCC_PNOC_BUS_TIMEOUT1_BCR 61
79#define GCC_PNOC_BUS_TIMEOUT2_BCR 62
80#define GCC_PNOC_BUS_TIMEOUT3_BCR 63
81#define GCC_PNOC_BUS_TIMEOUT4_BCR 64
82#define GCC_CNOC_BUS_TIMEOUT0_BCR 65
83#define GCC_CNOC_BUS_TIMEOUT1_BCR 66
84#define GCC_CNOC_BUS_TIMEOUT2_BCR 67
85#define GCC_CNOC_BUS_TIMEOUT3_BCR 68
86#define GCC_CNOC_BUS_TIMEOUT4_BCR 69
87#define GCC_CNOC_BUS_TIMEOUT5_BCR 70
88#define GCC_CNOC_BUS_TIMEOUT6_BCR 71
89#define GCC_DEHR_BCR 72
90#define GCC_RBCPR_BCR 73
91#define GCC_MSS_RESTART 74
92#define GCC_LPASS_RESTART 75
93#define GCC_WCSS_RESTART 76
94#define GCC_VENUS_RESTART 77
95
96#endif
diff --git a/include/dt-bindings/reset/qcom,mmcc-msm8960.h b/include/dt-bindings/reset/qcom,mmcc-msm8960.h
new file mode 100644
index 000000000000..ba36ec680118
--- /dev/null
+++ b/include/dt-bindings/reset/qcom,mmcc-msm8960.h
@@ -0,0 +1,93 @@
1/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
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#ifndef _DT_BINDINGS_RESET_MSM_MMCC_8960_H
15#define _DT_BINDINGS_RESET_MSM_MMCC_8960_H
16
17#define VPE_AXI_RESET 0
18#define IJPEG_AXI_RESET 1
19#define MPD_AXI_RESET 2
20#define VFE_AXI_RESET 3
21#define SP_AXI_RESET 4
22#define VCODEC_AXI_RESET 5
23#define ROT_AXI_RESET 6
24#define VCODEC_AXI_A_RESET 7
25#define VCODEC_AXI_B_RESET 8
26#define FAB_S3_AXI_RESET 9
27#define FAB_S2_AXI_RESET 10
28#define FAB_S1_AXI_RESET 11
29#define FAB_S0_AXI_RESET 12
30#define SMMU_GFX3D_ABH_RESET 13
31#define SMMU_VPE_AHB_RESET 14
32#define SMMU_VFE_AHB_RESET 15
33#define SMMU_ROT_AHB_RESET 16
34#define SMMU_VCODEC_B_AHB_RESET 17
35#define SMMU_VCODEC_A_AHB_RESET 18
36#define SMMU_MDP1_AHB_RESET 19
37#define SMMU_MDP0_AHB_RESET 20
38#define SMMU_JPEGD_AHB_RESET 21
39#define SMMU_IJPEG_AHB_RESET 22
40#define SMMU_GFX2D0_AHB_RESET 23
41#define SMMU_GFX2D1_AHB_RESET 24
42#define APU_AHB_RESET 25
43#define CSI_AHB_RESET 26
44#define TV_ENC_AHB_RESET 27
45#define VPE_AHB_RESET 28
46#define FABRIC_AHB_RESET 29
47#define GFX2D0_AHB_RESET 30
48#define GFX2D1_AHB_RESET 31
49#define GFX3D_AHB_RESET 32
50#define HDMI_AHB_RESET 33
51#define MSSS_IMEM_AHB_RESET 34
52#define IJPEG_AHB_RESET 35
53#define DSI_M_AHB_RESET 36
54#define DSI_S_AHB_RESET 37
55#define JPEGD_AHB_RESET 38
56#define MDP_AHB_RESET 39
57#define ROT_AHB_RESET 40
58#define VCODEC_AHB_RESET 41
59#define VFE_AHB_RESET 42
60#define DSI2_M_AHB_RESET 43
61#define DSI2_S_AHB_RESET 44
62#define CSIPHY2_RESET 45
63#define CSI_PIX1_RESET 46
64#define CSIPHY0_RESET 47
65#define CSIPHY1_RESET 48
66#define DSI2_RESET 49
67#define VFE_CSI_RESET 50
68#define MDP_RESET 51
69#define AMP_RESET 52
70#define JPEGD_RESET 53
71#define CSI1_RESET 54
72#define VPE_RESET 55
73#define MMSS_FABRIC_RESET 56
74#define VFE_RESET 57
75#define GFX2D0_RESET 58
76#define GFX2D1_RESET 59
77#define GFX3D_RESET 60
78#define HDMI_RESET 61
79#define MMSS_IMEM_RESET 62
80#define IJPEG_RESET 63
81#define CSI0_RESET 64
82#define DSI_RESET 65
83#define VCODEC_RESET 66
84#define MDP_TV_RESET 67
85#define MDP_VSYNC_RESET 68
86#define ROT_RESET 69
87#define TV_HDMI_RESET 70
88#define TV_ENC_RESET 71
89#define CSI2_RESET 72
90#define CSI_RDI1_RESET 73
91#define CSI_RDI2_RESET 74
92
93#endif
diff --git a/include/dt-bindings/reset/qcom,mmcc-msm8974.h b/include/dt-bindings/reset/qcom,mmcc-msm8974.h
new file mode 100644
index 000000000000..da3ec37f1b1e
--- /dev/null
+++ b/include/dt-bindings/reset/qcom,mmcc-msm8974.h
@@ -0,0 +1,62 @@
1/*
2 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
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#ifndef _DT_BINDINGS_RESET_MSM_MMCC_8974_H
15#define _DT_BINDINGS_RESET_MSM_MMCC_8974_H
16
17#define SPDM_RESET 0
18#define SPDM_RM_RESET 1
19#define VENUS0_RESET 2
20#define MDSS_RESET 3
21#define CAMSS_PHY0_RESET 4
22#define CAMSS_PHY1_RESET 5
23#define CAMSS_PHY2_RESET 6
24#define CAMSS_CSI0_RESET 7
25#define CAMSS_CSI0PHY_RESET 8
26#define CAMSS_CSI0RDI_RESET 9
27#define CAMSS_CSI0PIX_RESET 10
28#define CAMSS_CSI1_RESET 11
29#define CAMSS_CSI1PHY_RESET 12
30#define CAMSS_CSI1RDI_RESET 13
31#define CAMSS_CSI1PIX_RESET 14
32#define CAMSS_CSI2_RESET 15
33#define CAMSS_CSI2PHY_RESET 16
34#define CAMSS_CSI2RDI_RESET 17
35#define CAMSS_CSI2PIX_RESET 18
36#define CAMSS_CSI3_RESET 19
37#define CAMSS_CSI3PHY_RESET 20
38#define CAMSS_CSI3RDI_RESET 21
39#define CAMSS_CSI3PIX_RESET 22
40#define CAMSS_ISPIF_RESET 23
41#define CAMSS_CCI_RESET 24
42#define CAMSS_MCLK0_RESET 25
43#define CAMSS_MCLK1_RESET 26
44#define CAMSS_MCLK2_RESET 27
45#define CAMSS_MCLK3_RESET 28
46#define CAMSS_GP0_RESET 29
47#define CAMSS_GP1_RESET 30
48#define CAMSS_TOP_RESET 31
49#define CAMSS_MICRO_RESET 32
50#define CAMSS_JPEG_RESET 33
51#define CAMSS_VFE_RESET 34
52#define CAMSS_CSI_VFE0_RESET 35
53#define CAMSS_CSI_VFE1_RESET 36
54#define OXILI_RESET 37
55#define OXILICX_RESET 38
56#define OCMEMCX_RESET 39
57#define MMSS_RBCRP_RESET 40
58#define MMSSNOCAHB_RESET 41
59#define MMSSNOCAXI_RESET 42
60#define OCMEMNOC_RESET 43
61
62#endif
diff --git a/include/dt-bindings/thermal/thermal.h b/include/dt-bindings/thermal/thermal.h
new file mode 100644
index 000000000000..59822a995858
--- /dev/null
+++ b/include/dt-bindings/thermal/thermal.h
@@ -0,0 +1,17 @@
1/*
2 * This header provides constants for most thermal bindings.
3 *
4 * Copyright (C) 2013 Texas Instruments
5 * Eduardo Valentin <eduardo.valentin@ti.com>
6 *
7 * GPLv2 only
8 */
9
10#ifndef _DT_BINDINGS_THERMAL_THERMAL_H
11#define _DT_BINDINGS_THERMAL_THERMAL_H
12
13/* On cooling devices upper and lower limits */
14#define THERMAL_NO_LIMIT (-1UL)
15
16#endif
17
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index 7e2d15837b02..be85127bfed3 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -144,7 +144,7 @@ struct kvm_run;
144struct kvm_exit_mmio; 144struct kvm_exit_mmio;
145 145
146#ifdef CONFIG_KVM_ARM_VGIC 146#ifdef CONFIG_KVM_ARM_VGIC
147int kvm_vgic_set_addr(struct kvm *kvm, unsigned long type, u64 addr); 147int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write);
148int kvm_vgic_hyp_init(void); 148int kvm_vgic_hyp_init(void);
149int kvm_vgic_init(struct kvm *kvm); 149int kvm_vgic_init(struct kvm *kvm);
150int kvm_vgic_create(struct kvm *kvm); 150int kvm_vgic_create(struct kvm *kvm);
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index d9099b15b472..1151a1dcfe41 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -42,6 +42,7 @@
42#include <acpi/acpi_bus.h> 42#include <acpi/acpi_bus.h>
43#include <acpi/acpi_drivers.h> 43#include <acpi/acpi_drivers.h>
44#include <acpi/acpi_numa.h> 44#include <acpi/acpi_numa.h>
45#include <acpi/acpi_io.h>
45#include <asm/acpi.h> 46#include <asm/acpi.h>
46 47
47static inline acpi_handle acpi_device_handle(struct acpi_device *adev) 48static inline acpi_handle acpi_device_handle(struct acpi_device *adev)
@@ -53,6 +54,12 @@ static inline acpi_handle acpi_device_handle(struct acpi_device *adev)
53#define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev) 54#define ACPI_COMPANION_SET(dev, adev) ACPI_COMPANION(dev) = (adev)
54#define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev)) 55#define ACPI_HANDLE(dev) acpi_device_handle(ACPI_COMPANION(dev))
55 56
57static inline void acpi_preset_companion(struct device *dev,
58 struct acpi_device *parent, u64 addr)
59{
60 ACPI_COMPANION_SET(dev, acpi_find_child_device(parent, addr, NULL));
61}
62
56static inline const char *acpi_dev_name(struct acpi_device *adev) 63static inline const char *acpi_dev_name(struct acpi_device *adev)
57{ 64{
58 return dev_name(&adev->dev); 65 return dev_name(&adev->dev);
@@ -409,6 +416,9 @@ static inline bool acpi_driver_match_device(struct device *dev,
409 return !!acpi_match_device(drv->acpi_match_table, dev); 416 return !!acpi_match_device(drv->acpi_match_table, dev);
410} 417}
411 418
419int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *);
420int acpi_device_modalias(struct device *, char *, int);
421
412#define ACPI_PTR(_ptr) (_ptr) 422#define ACPI_PTR(_ptr) (_ptr)
413 423
414#else /* !CONFIG_ACPI */ 424#else /* !CONFIG_ACPI */
@@ -460,7 +470,7 @@ struct acpi_table_header;
460static inline int acpi_table_parse(char *id, 470static inline int acpi_table_parse(char *id,
461 int (*handler)(struct acpi_table_header *)) 471 int (*handler)(struct acpi_table_header *))
462{ 472{
463 return -1; 473 return -ENODEV;
464} 474}
465 475
466static inline int acpi_nvs_register(__u64 start, __u64 size) 476static inline int acpi_nvs_register(__u64 start, __u64 size)
@@ -488,6 +498,18 @@ static inline bool acpi_driver_match_device(struct device *dev,
488 return false; 498 return false;
489} 499}
490 500
501static inline int acpi_device_uevent_modalias(struct device *dev,
502 struct kobj_uevent_env *env)
503{
504 return -ENODEV;
505}
506
507static inline int acpi_device_modalias(struct device *dev,
508 char *buf, int size)
509{
510 return -ENODEV;
511}
512
491#define ACPI_PTR(_ptr) (NULL) 513#define ACPI_PTR(_ptr) (NULL)
492 514
493#endif /* !CONFIG_ACPI */ 515#endif /* !CONFIG_ACPI */
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h
deleted file mode 100644
index d875bc3dba3c..000000000000
--- a/include/linux/acpi_gpio.h
+++ /dev/null
@@ -1,51 +0,0 @@
1#ifndef _LINUX_ACPI_GPIO_H_
2#define _LINUX_ACPI_GPIO_H_
3
4#include <linux/device.h>
5#include <linux/err.h>
6#include <linux/errno.h>
7#include <linux/gpio.h>
8#include <linux/gpio/consumer.h>
9
10/**
11 * struct acpi_gpio_info - ACPI GPIO specific information
12 * @gpioint: if %true this GPIO is of type GpioInt otherwise type is GpioIo
13 * @active_low: in case of @gpioint, the pin is active low
14 */
15struct acpi_gpio_info {
16 bool gpioint;
17 bool active_low;
18};
19
20#ifdef CONFIG_GPIO_ACPI
21
22struct gpio_desc *acpi_get_gpiod_by_index(struct device *dev, int index,
23 struct acpi_gpio_info *info);
24void acpi_gpiochip_request_interrupts(struct gpio_chip *chip);
25void acpi_gpiochip_free_interrupts(struct gpio_chip *chip);
26
27#else /* CONFIG_GPIO_ACPI */
28
29static inline struct gpio_desc *
30acpi_get_gpiod_by_index(struct device *dev, int index,
31 struct acpi_gpio_info *info)
32{
33 return ERR_PTR(-ENOSYS);
34}
35
36static inline void acpi_gpiochip_request_interrupts(struct gpio_chip *chip) { }
37static inline void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) { }
38
39#endif /* CONFIG_GPIO_ACPI */
40
41static inline int acpi_get_gpio_by_index(struct device *dev, int index,
42 struct acpi_gpio_info *info)
43{
44 struct gpio_desc *desc = acpi_get_gpiod_by_index(dev, index, info);
45
46 if (IS_ERR(desc))
47 return PTR_ERR(desc);
48 return desc_to_gpio(desc);
49}
50
51#endif /* _LINUX_ACPI_GPIO_H_ */
diff --git a/include/linux/amba/sp810.h b/include/linux/amba/sp810.h
index 6636430dd0e6..c7df89f99115 100644
--- a/include/linux/amba/sp810.h
+++ b/include/linux/amba/sp810.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/include/asm/hardware/sp810.h
3 *
4 * ARM PrimeXsys System Controller SP810 header file 2 * ARM PrimeXsys System Controller SP810 header file
5 * 3 *
6 * Copyright (C) 2009 ST Microelectronics 4 * Copyright (C) 2009 ST Microelectronics
@@ -11,8 +9,8 @@
11 * warranty of any kind, whether express or implied. 9 * warranty of any kind, whether express or implied.
12 */ 10 */
13 11
14#ifndef __ASM_ARM_SP810_H 12#ifndef __AMBA_SP810_H
15#define __ASM_ARM_SP810_H 13#define __AMBA_SP810_H
16 14
17#include <linux/io.h> 15#include <linux/io.h>
18 16
@@ -61,4 +59,4 @@ static inline void sysctl_soft_reset(void __iomem *base)
61 writel(0, base + SCSYSSTAT); 59 writel(0, base + SCSYSSTAT);
62} 60}
63 61
64#endif /* __ASM_ARM_SP810_H */ 62#endif /* __AMBA_SP810_H */
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
index fcdd81bd5314..8598f8eacb20 100644
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -32,6 +32,8 @@ struct ath9k_platform_data {
32 u32 gpio_val; 32 u32 gpio_val;
33 33
34 bool is_clk_25mhz; 34 bool is_clk_25mhz;
35 bool tx_gain_buffalo;
36
35 int (*get_mac_revision)(void); 37 int (*get_mac_revision)(void);
36 int (*external_reset)(void); 38 int (*external_reset)(void);
37}; 39};
diff --git a/include/linux/audit.h b/include/linux/audit.h
index a40641954c29..aa865a9a4c4f 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -137,7 +137,7 @@ static inline void audit_syscall_exit(void *pt_regs)
137{ 137{
138 if (unlikely(current->audit_context)) { 138 if (unlikely(current->audit_context)) {
139 int success = is_syscall_success(pt_regs); 139 int success = is_syscall_success(pt_regs);
140 int return_code = regs_return_value(pt_regs); 140 long return_code = regs_return_value(pt_regs);
141 141
142 __audit_syscall_exit(success, return_code); 142 __audit_syscall_exit(success, return_code);
143 } 143 }
@@ -202,7 +202,7 @@ static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
202 return tsk->loginuid; 202 return tsk->loginuid;
203} 203}
204 204
205static inline int audit_get_sessionid(struct task_struct *tsk) 205static inline unsigned int audit_get_sessionid(struct task_struct *tsk)
206{ 206{
207 return tsk->sessionid; 207 return tsk->sessionid;
208} 208}
@@ -220,7 +220,7 @@ extern void __audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat);
220extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm, 220extern int __audit_log_bprm_fcaps(struct linux_binprm *bprm,
221 const struct cred *new, 221 const struct cred *new,
222 const struct cred *old); 222 const struct cred *old);
223extern void __audit_log_capset(pid_t pid, const struct cred *new, const struct cred *old); 223extern void __audit_log_capset(const struct cred *new, const struct cred *old);
224extern void __audit_mmap_fd(int fd, int flags); 224extern void __audit_mmap_fd(int fd, int flags);
225 225
226static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) 226static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp)
@@ -285,11 +285,11 @@ static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm,
285 return 0; 285 return 0;
286} 286}
287 287
288static inline void audit_log_capset(pid_t pid, const struct cred *new, 288static inline void audit_log_capset(const struct cred *new,
289 const struct cred *old) 289 const struct cred *old)
290{ 290{
291 if (unlikely(!audit_dummy_context())) 291 if (unlikely(!audit_dummy_context()))
292 __audit_log_capset(pid, new, old); 292 __audit_log_capset(new, old);
293} 293}
294 294
295static inline void audit_mmap_fd(int fd, int flags) 295static inline void audit_mmap_fd(int fd, int flags)
@@ -359,7 +359,7 @@ static inline kuid_t audit_get_loginuid(struct task_struct *tsk)
359{ 359{
360 return INVALID_UID; 360 return INVALID_UID;
361} 361}
362static inline int audit_get_sessionid(struct task_struct *tsk) 362static inline unsigned int audit_get_sessionid(struct task_struct *tsk)
363{ 363{
364 return -1; 364 return -1;
365} 365}
@@ -397,8 +397,8 @@ static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm,
397{ 397{
398 return 0; 398 return 0;
399} 399}
400static inline void audit_log_capset(pid_t pid, const struct cred *new, 400static inline void audit_log_capset(const struct cred *new,
401 const struct cred *old) 401 const struct cred *old)
402{ } 402{ }
403static inline void audit_mmap_fd(int fd, int flags) 403static inline void audit_mmap_fd(int fd, int flags)
404{ } 404{ }
@@ -461,9 +461,11 @@ extern int audit_update_lsm_rules(void);
461 /* Private API (for audit.c only) */ 461 /* Private API (for audit.c only) */
462extern int audit_filter_user(int type); 462extern int audit_filter_user(int type);
463extern int audit_filter_type(int type); 463extern int audit_filter_type(int type);
464extern int audit_receive_filter(int type, int pid, int seq, 464extern int audit_rule_change(int type, __u32 portid, int seq,
465 void *data, size_t datasz); 465 void *data, size_t datasz);
466extern int audit_enabled; 466extern int audit_list_rules_send(__u32 portid, int seq);
467
468extern u32 audit_enabled;
467#else /* CONFIG_AUDIT */ 469#else /* CONFIG_AUDIT */
468static inline __printf(4, 5) 470static inline __printf(4, 5)
469void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type, 471void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type,
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 4d043c30216f..0b3bb16c705a 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -418,7 +418,14 @@ static inline void bcma_maskset16(struct bcma_device *cc,
418 bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set); 418 bcma_write16(cc, offset, (bcma_read16(cc, offset) & mask) | set);
419} 419}
420 420
421extern struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid); 421extern struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
422 u8 unit);
423static inline struct bcma_device *bcma_find_core(struct bcma_bus *bus,
424 u16 coreid)
425{
426 return bcma_find_core_unit(bus, coreid, 0);
427}
428
422extern bool bcma_core_is_enabled(struct bcma_device *core); 429extern bool bcma_core_is_enabled(struct bcma_device *core);
423extern void bcma_core_disable(struct bcma_device *core, u32 flags); 430extern void bcma_core_disable(struct bcma_device *core, u32 flags);
424extern int bcma_core_enable(struct bcma_device *core, u32 flags); 431extern int bcma_core_enable(struct bcma_device *core, u32 flags);
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index c49e1a159e6e..63d105cd14a3 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -640,6 +640,7 @@ struct bcma_drv_cc {
640 spinlock_t gpio_lock; 640 spinlock_t gpio_lock;
641#ifdef CONFIG_BCMA_DRIVER_GPIO 641#ifdef CONFIG_BCMA_DRIVER_GPIO
642 struct gpio_chip gpio; 642 struct gpio_chip gpio;
643 struct irq_domain *irq_domain;
643#endif 644#endif
644}; 645};
645 646
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 060ff695085c..70654521dab6 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -61,25 +61,87 @@
61 * various member access, note that bio_data should of course not be used 61 * various member access, note that bio_data should of course not be used
62 * on highmem page vectors 62 * on highmem page vectors
63 */ 63 */
64#define bio_iovec_idx(bio, idx) (&((bio)->bi_io_vec[(idx)])) 64#define __bvec_iter_bvec(bvec, iter) (&(bvec)[(iter).bi_idx])
65#define bio_iovec(bio) bio_iovec_idx((bio), (bio)->bi_idx) 65
66#define bio_page(bio) bio_iovec((bio))->bv_page 66#define bvec_iter_page(bvec, iter) \
67#define bio_offset(bio) bio_iovec((bio))->bv_offset 67 (__bvec_iter_bvec((bvec), (iter))->bv_page)
68#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) 68
69#define bio_sectors(bio) ((bio)->bi_size >> 9) 69#define bvec_iter_len(bvec, iter) \
70#define bio_end_sector(bio) ((bio)->bi_sector + bio_sectors((bio))) 70 min((iter).bi_size, \
71 __bvec_iter_bvec((bvec), (iter))->bv_len - (iter).bi_bvec_done)
72
73#define bvec_iter_offset(bvec, iter) \
74 (__bvec_iter_bvec((bvec), (iter))->bv_offset + (iter).bi_bvec_done)
75
76#define bvec_iter_bvec(bvec, iter) \
77((struct bio_vec) { \
78 .bv_page = bvec_iter_page((bvec), (iter)), \
79 .bv_len = bvec_iter_len((bvec), (iter)), \
80 .bv_offset = bvec_iter_offset((bvec), (iter)), \
81})
82
83#define bio_iter_iovec(bio, iter) \
84 bvec_iter_bvec((bio)->bi_io_vec, (iter))
85
86#define bio_iter_page(bio, iter) \
87 bvec_iter_page((bio)->bi_io_vec, (iter))
88#define bio_iter_len(bio, iter) \
89 bvec_iter_len((bio)->bi_io_vec, (iter))
90#define bio_iter_offset(bio, iter) \
91 bvec_iter_offset((bio)->bi_io_vec, (iter))
92
93#define bio_page(bio) bio_iter_page((bio), (bio)->bi_iter)
94#define bio_offset(bio) bio_iter_offset((bio), (bio)->bi_iter)
95#define bio_iovec(bio) bio_iter_iovec((bio), (bio)->bi_iter)
96
97#define bio_multiple_segments(bio) \
98 ((bio)->bi_iter.bi_size != bio_iovec(bio).bv_len)
99#define bio_sectors(bio) ((bio)->bi_iter.bi_size >> 9)
100#define bio_end_sector(bio) ((bio)->bi_iter.bi_sector + bio_sectors((bio)))
101
102/*
103 * Check whether this bio carries any data or not. A NULL bio is allowed.
104 */
105static inline bool bio_has_data(struct bio *bio)
106{
107 if (bio &&
108 bio->bi_iter.bi_size &&
109 !(bio->bi_rw & REQ_DISCARD))
110 return true;
111
112 return false;
113}
114
115static inline bool bio_is_rw(struct bio *bio)
116{
117 if (!bio_has_data(bio))
118 return false;
119
120 if (bio->bi_rw & BIO_NO_ADVANCE_ITER_MASK)
121 return false;
122
123 return true;
124}
125
126static inline bool bio_mergeable(struct bio *bio)
127{
128 if (bio->bi_rw & REQ_NOMERGE_FLAGS)
129 return false;
130
131 return true;
132}
71 133
72static inline unsigned int bio_cur_bytes(struct bio *bio) 134static inline unsigned int bio_cur_bytes(struct bio *bio)
73{ 135{
74 if (bio->bi_vcnt) 136 if (bio_has_data(bio))
75 return bio_iovec(bio)->bv_len; 137 return bio_iovec(bio).bv_len;
76 else /* dataless requests such as discard */ 138 else /* dataless requests such as discard */
77 return bio->bi_size; 139 return bio->bi_iter.bi_size;
78} 140}
79 141
80static inline void *bio_data(struct bio *bio) 142static inline void *bio_data(struct bio *bio)
81{ 143{
82 if (bio->bi_vcnt) 144 if (bio_has_data(bio))
83 return page_address(bio_page(bio)) + bio_offset(bio); 145 return page_address(bio_page(bio)) + bio_offset(bio);
84 146
85 return NULL; 147 return NULL;
@@ -97,19 +159,16 @@ static inline void *bio_data(struct bio *bio)
97 * permanent PIO fall back, user is probably better off disabling highmem 159 * permanent PIO fall back, user is probably better off disabling highmem
98 * I/O completely on that queue (see ide-dma for example) 160 * I/O completely on that queue (see ide-dma for example)
99 */ 161 */
100#define __bio_kmap_atomic(bio, idx) \ 162#define __bio_kmap_atomic(bio, iter) \
101 (kmap_atomic(bio_iovec_idx((bio), (idx))->bv_page) + \ 163 (kmap_atomic(bio_iter_iovec((bio), (iter)).bv_page) + \
102 bio_iovec_idx((bio), (idx))->bv_offset) 164 bio_iter_iovec((bio), (iter)).bv_offset)
103 165
104#define __bio_kunmap_atomic(addr) kunmap_atomic(addr) 166#define __bio_kunmap_atomic(addr) kunmap_atomic(addr)
105 167
106/* 168/*
107 * merge helpers etc 169 * merge helpers etc
108 */ 170 */
109 171
110#define __BVEC_END(bio) bio_iovec_idx((bio), (bio)->bi_vcnt - 1)
111#define __BVEC_START(bio) bio_iovec_idx((bio), (bio)->bi_idx)
112
113/* Default implementation of BIOVEC_PHYS_MERGEABLE */ 172/* Default implementation of BIOVEC_PHYS_MERGEABLE */
114#define __BIOVEC_PHYS_MERGEABLE(vec1, vec2) \ 173#define __BIOVEC_PHYS_MERGEABLE(vec1, vec2) \
115 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) 174 ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2)))
@@ -126,33 +185,76 @@ static inline void *bio_data(struct bio *bio)
126 (((addr1) | (mask)) == (((addr2) - 1) | (mask))) 185 (((addr1) | (mask)) == (((addr2) - 1) | (mask)))
127#define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ 186#define BIOVEC_SEG_BOUNDARY(q, b1, b2) \
128 __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, queue_segment_boundary((q))) 187 __BIO_SEG_BOUNDARY(bvec_to_phys((b1)), bvec_to_phys((b2)) + (b2)->bv_len, queue_segment_boundary((q)))
129#define BIO_SEG_BOUNDARY(q, b1, b2) \
130 BIOVEC_SEG_BOUNDARY((q), __BVEC_END((b1)), __BVEC_START((b2)))
131 188
132#define bio_io_error(bio) bio_endio((bio), -EIO) 189#define bio_io_error(bio) bio_endio((bio), -EIO)
133 190
134/* 191/*
135 * drivers should not use the __ version unless they _really_ know what
136 * they're doing
137 */
138#define __bio_for_each_segment(bvl, bio, i, start_idx) \
139 for (bvl = bio_iovec_idx((bio), (start_idx)), i = (start_idx); \
140 i < (bio)->bi_vcnt; \
141 bvl++, i++)
142
143/*
144 * drivers should _never_ use the all version - the bio may have been split 192 * drivers should _never_ use the all version - the bio may have been split
145 * before it got to the driver and the driver won't own all of it 193 * before it got to the driver and the driver won't own all of it
146 */ 194 */
147#define bio_for_each_segment_all(bvl, bio, i) \ 195#define bio_for_each_segment_all(bvl, bio, i) \
148 for (i = 0; \ 196 for (i = 0, bvl = (bio)->bi_io_vec; i < (bio)->bi_vcnt; i++, bvl++)
149 bvl = bio_iovec_idx((bio), (i)), i < (bio)->bi_vcnt; \ 197
150 i++) 198static inline void bvec_iter_advance(struct bio_vec *bv, struct bvec_iter *iter,
199 unsigned bytes)
200{
201 WARN_ONCE(bytes > iter->bi_size,
202 "Attempted to advance past end of bvec iter\n");
203
204 while (bytes) {
205 unsigned len = min(bytes, bvec_iter_len(bv, *iter));
206
207 bytes -= len;
208 iter->bi_size -= len;
209 iter->bi_bvec_done += len;
210
211 if (iter->bi_bvec_done == __bvec_iter_bvec(bv, *iter)->bv_len) {
212 iter->bi_bvec_done = 0;
213 iter->bi_idx++;
214 }
215 }
216}
217
218#define for_each_bvec(bvl, bio_vec, iter, start) \
219 for ((iter) = start; \
220 (bvl) = bvec_iter_bvec((bio_vec), (iter)), \
221 (iter).bi_size; \
222 bvec_iter_advance((bio_vec), &(iter), (bvl).bv_len))
223
224
225static inline void bio_advance_iter(struct bio *bio, struct bvec_iter *iter,
226 unsigned bytes)
227{
228 iter->bi_sector += bytes >> 9;
229
230 if (bio->bi_rw & BIO_NO_ADVANCE_ITER_MASK)
231 iter->bi_size -= bytes;
232 else
233 bvec_iter_advance(bio->bi_io_vec, iter, bytes);
234}
151 235
152#define bio_for_each_segment(bvl, bio, i) \ 236#define __bio_for_each_segment(bvl, bio, iter, start) \
153 for (i = (bio)->bi_idx; \ 237 for (iter = (start); \
154 bvl = bio_iovec_idx((bio), (i)), i < (bio)->bi_vcnt; \ 238 (iter).bi_size && \
155 i++) 239 ((bvl = bio_iter_iovec((bio), (iter))), 1); \
240 bio_advance_iter((bio), &(iter), (bvl).bv_len))
241
242#define bio_for_each_segment(bvl, bio, iter) \
243 __bio_for_each_segment(bvl, bio, iter, (bio)->bi_iter)
244
245#define bio_iter_last(bvec, iter) ((iter).bi_size == (bvec).bv_len)
246
247static inline unsigned bio_segments(struct bio *bio)
248{
249 unsigned segs = 0;
250 struct bio_vec bv;
251 struct bvec_iter iter;
252
253 bio_for_each_segment(bv, bio, iter)
254 segs++;
255
256 return segs;
257}
156 258
157/* 259/*
158 * get a reference to a bio, so it won't disappear. the intended use is 260 * get a reference to a bio, so it won't disappear. the intended use is
@@ -177,16 +279,15 @@ static inline void *bio_data(struct bio *bio)
177struct bio_integrity_payload { 279struct bio_integrity_payload {
178 struct bio *bip_bio; /* parent bio */ 280 struct bio *bip_bio; /* parent bio */
179 281
180 sector_t bip_sector; /* virtual start sector */ 282 struct bvec_iter bip_iter;
181 283
284 /* kill - should just use bip_vec */
182 void *bip_buf; /* generated integrity data */ 285 void *bip_buf; /* generated integrity data */
183 bio_end_io_t *bip_end_io; /* saved I/O completion fn */
184 286
185 unsigned int bip_size; 287 bio_end_io_t *bip_end_io; /* saved I/O completion fn */
186 288
187 unsigned short bip_slab; /* slab the bip came from */ 289 unsigned short bip_slab; /* slab the bip came from */
188 unsigned short bip_vcnt; /* # of integrity bio_vecs */ 290 unsigned short bip_vcnt; /* # of integrity bio_vecs */
189 unsigned short bip_idx; /* current bip_vec index */
190 unsigned bip_owns_buf:1; /* should free bip_buf */ 291 unsigned bip_owns_buf:1; /* should free bip_buf */
191 292
192 struct work_struct bip_work; /* I/O completion */ 293 struct work_struct bip_work; /* I/O completion */
@@ -196,29 +297,28 @@ struct bio_integrity_payload {
196}; 297};
197#endif /* CONFIG_BLK_DEV_INTEGRITY */ 298#endif /* CONFIG_BLK_DEV_INTEGRITY */
198 299
199/* 300extern void bio_trim(struct bio *bio, int offset, int size);
200 * A bio_pair is used when we need to split a bio. 301extern struct bio *bio_split(struct bio *bio, int sectors,
201 * This can only happen for a bio that refers to just one 302 gfp_t gfp, struct bio_set *bs);
202 * page of data, and in the unusual situation when the 303
203 * page crosses a chunk/device boundary 304/**
305 * bio_next_split - get next @sectors from a bio, splitting if necessary
306 * @bio: bio to split
307 * @sectors: number of sectors to split from the front of @bio
308 * @gfp: gfp mask
309 * @bs: bio set to allocate from
204 * 310 *
205 * The address of the master bio is stored in bio1.bi_private 311 * Returns a bio representing the next @sectors of @bio - if the bio is smaller
206 * The address of the pool the pair was allocated from is stored 312 * than @sectors, returns the original bio unchanged.
207 * in bio2.bi_private
208 */ 313 */
209struct bio_pair { 314static inline struct bio *bio_next_split(struct bio *bio, int sectors,
210 struct bio bio1, bio2; 315 gfp_t gfp, struct bio_set *bs)
211 struct bio_vec bv1, bv2; 316{
212#if defined(CONFIG_BLK_DEV_INTEGRITY) 317 if (sectors >= bio_sectors(bio))
213 struct bio_integrity_payload bip1, bip2; 318 return bio;
214 struct bio_vec iv1, iv2; 319
215#endif 320 return bio_split(bio, sectors, gfp, bs);
216 atomic_t cnt; 321}
217 int error;
218};
219extern struct bio_pair *bio_split(struct bio *bi, int first_sectors);
220extern void bio_pair_release(struct bio_pair *dbio);
221extern void bio_trim(struct bio *bio, int offset, int size);
222 322
223extern struct bio_set *bioset_create(unsigned int, unsigned int); 323extern struct bio_set *bioset_create(unsigned int, unsigned int);
224extern void bioset_free(struct bio_set *); 324extern void bioset_free(struct bio_set *);
@@ -227,7 +327,8 @@ extern mempool_t *biovec_create_pool(struct bio_set *bs, int pool_entries);
227extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); 327extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *);
228extern void bio_put(struct bio *); 328extern void bio_put(struct bio *);
229 329
230extern void __bio_clone(struct bio *, struct bio *); 330extern void __bio_clone_fast(struct bio *, struct bio *);
331extern struct bio *bio_clone_fast(struct bio *, gfp_t, struct bio_set *);
231extern struct bio *bio_clone_bioset(struct bio *, gfp_t, struct bio_set *bs); 332extern struct bio *bio_clone_bioset(struct bio *, gfp_t, struct bio_set *bs);
232 333
233extern struct bio_set *fs_bio_set; 334extern struct bio_set *fs_bio_set;
@@ -254,6 +355,7 @@ static inline struct bio *bio_clone_kmalloc(struct bio *bio, gfp_t gfp_mask)
254} 355}
255 356
256extern void bio_endio(struct bio *, int); 357extern void bio_endio(struct bio *, int);
358extern void bio_endio_nodec(struct bio *, int);
257struct request_queue; 359struct request_queue;
258extern int bio_phys_segments(struct request_queue *, struct bio *); 360extern int bio_phys_segments(struct request_queue *, struct bio *);
259 361
@@ -262,12 +364,12 @@ extern void bio_advance(struct bio *, unsigned);
262 364
263extern void bio_init(struct bio *); 365extern void bio_init(struct bio *);
264extern void bio_reset(struct bio *); 366extern void bio_reset(struct bio *);
367void bio_chain(struct bio *, struct bio *);
265 368
266extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int); 369extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
267extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, 370extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *,
268 unsigned int, unsigned int); 371 unsigned int, unsigned int);
269extern int bio_get_nr_vecs(struct block_device *); 372extern int bio_get_nr_vecs(struct block_device *);
270extern sector_t bio_sector_offset(struct bio *, unsigned short, unsigned int);
271extern struct bio *bio_map_user(struct request_queue *, struct block_device *, 373extern struct bio *bio_map_user(struct request_queue *, struct block_device *,
272 unsigned long, unsigned int, int, gfp_t); 374 unsigned long, unsigned int, int, gfp_t);
273struct sg_iovec; 375struct sg_iovec;
@@ -357,48 +459,18 @@ static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags)
357} 459}
358#endif 460#endif
359 461
360static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx, 462static inline char *__bio_kmap_irq(struct bio *bio, struct bvec_iter iter,
361 unsigned long *flags) 463 unsigned long *flags)
362{ 464{
363 return bvec_kmap_irq(bio_iovec_idx(bio, idx), flags); 465 return bvec_kmap_irq(&bio_iter_iovec(bio, iter), flags);
364} 466}
365#define __bio_kunmap_irq(buf, flags) bvec_kunmap_irq(buf, flags) 467#define __bio_kunmap_irq(buf, flags) bvec_kunmap_irq(buf, flags)
366 468
367#define bio_kmap_irq(bio, flags) \ 469#define bio_kmap_irq(bio, flags) \
368 __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) 470 __bio_kmap_irq((bio), (bio)->bi_iter, (flags))
369#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) 471#define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags)
370 472
371/* 473/*
372 * Check whether this bio carries any data or not. A NULL bio is allowed.
373 */
374static inline bool bio_has_data(struct bio *bio)
375{
376 if (bio && bio->bi_vcnt)
377 return true;
378
379 return false;
380}
381
382static inline bool bio_is_rw(struct bio *bio)
383{
384 if (!bio_has_data(bio))
385 return false;
386
387 if (bio->bi_rw & REQ_WRITE_SAME)
388 return false;
389
390 return true;
391}
392
393static inline bool bio_mergeable(struct bio *bio)
394{
395 if (bio->bi_rw & REQ_NOMERGE_FLAGS)
396 return false;
397
398 return true;
399}
400
401/*
402 * BIO list management for use by remapping drivers (e.g. DM or MD) and loop. 474 * BIO list management for use by remapping drivers (e.g. DM or MD) and loop.
403 * 475 *
404 * A bio_list anchors a singly-linked list of bios chained through the bi_next 476 * A bio_list anchors a singly-linked list of bios chained through the bi_next
@@ -559,16 +631,12 @@ struct biovec_slab {
559 631
560#if defined(CONFIG_BLK_DEV_INTEGRITY) 632#if defined(CONFIG_BLK_DEV_INTEGRITY)
561 633
562#define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)]))
563#define bip_vec(bip) bip_vec_idx(bip, 0)
564 634
565#define __bip_for_each_vec(bvl, bip, i, start_idx) \
566 for (bvl = bip_vec_idx((bip), (start_idx)), i = (start_idx); \
567 i < (bip)->bip_vcnt; \
568 bvl++, i++)
569 635
570#define bip_for_each_vec(bvl, bip, i) \ 636#define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)]))
571 __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx) 637
638#define bip_for_each_vec(bvl, bip, iter) \
639 for_each_bvec(bvl, (bip)->bip_vec, iter, (bip)->bip_iter)
572 640
573#define bio_for_each_integrity_vec(_bvl, _bio, _iter) \ 641#define bio_for_each_integrity_vec(_bvl, _bio, _iter) \
574 for_each_bio(_bio) \ 642 for_each_bio(_bio) \
@@ -586,7 +654,6 @@ extern int bio_integrity_prep(struct bio *);
586extern void bio_integrity_endio(struct bio *, int); 654extern void bio_integrity_endio(struct bio *, int);
587extern void bio_integrity_advance(struct bio *, unsigned int); 655extern void bio_integrity_advance(struct bio *, unsigned int);
588extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); 656extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int);
589extern void bio_integrity_split(struct bio *, struct bio_pair *, int);
590extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t); 657extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t);
591extern int bioset_integrity_create(struct bio_set *, int); 658extern int bioset_integrity_create(struct bio_set *, int);
592extern void bioset_integrity_free(struct bio_set *); 659extern void bioset_integrity_free(struct bio_set *);
@@ -630,12 +697,6 @@ static inline int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
630 return 0; 697 return 0;
631} 698}
632 699
633static inline void bio_integrity_split(struct bio *bio, struct bio_pair *bp,
634 int sectors)
635{
636 return;
637}
638
639static inline void bio_integrity_advance(struct bio *bio, 700static inline void bio_integrity_advance(struct bio *bio,
640 unsigned int bytes_done) 701 unsigned int bytes_done)
641{ 702{
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index ab0e9b2025b3..161b23105b1e 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -113,7 +113,6 @@ enum {
113}; 113};
114 114
115struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *); 115struct request_queue *blk_mq_init_queue(struct blk_mq_reg *, void *);
116void blk_mq_free_queue(struct request_queue *);
117int blk_mq_register_disk(struct gendisk *); 116int blk_mq_register_disk(struct gendisk *);
118void blk_mq_unregister_disk(struct gendisk *); 117void blk_mq_unregister_disk(struct gendisk *);
119void blk_mq_init_commands(struct request_queue *, void (*init)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data); 118void blk_mq_init_commands(struct request_queue *, void (*init)(void *data, struct blk_mq_hw_ctx *, struct request *, unsigned int), void *data);
@@ -159,16 +158,16 @@ static inline struct request *blk_mq_tag_to_rq(struct blk_mq_hw_ctx *hctx,
159} 158}
160 159
161#define queue_for_each_hw_ctx(q, hctx, i) \ 160#define queue_for_each_hw_ctx(q, hctx, i) \
162 for ((i) = 0, hctx = (q)->queue_hw_ctx[0]; \ 161 for ((i) = 0; (i) < (q)->nr_hw_queues && \
163 (i) < (q)->nr_hw_queues; (i)++, hctx = (q)->queue_hw_ctx[i]) 162 ({ hctx = (q)->queue_hw_ctx[i]; 1; }); (i)++)
164 163
165#define queue_for_each_ctx(q, ctx, i) \ 164#define queue_for_each_ctx(q, ctx, i) \
166 for ((i) = 0, ctx = per_cpu_ptr((q)->queue_ctx, 0); \ 165 for ((i) = 0; (i) < (q)->nr_queues && \
167 (i) < (q)->nr_queues; (i)++, ctx = per_cpu_ptr(q->queue_ctx, (i))) 166 ({ ctx = per_cpu_ptr((q)->queue_ctx, (i)); 1; }); (i)++)
168 167
169#define hctx_for_each_ctx(hctx, ctx, i) \ 168#define hctx_for_each_ctx(hctx, ctx, i) \
170 for ((i) = 0, ctx = (hctx)->ctxs[0]; \ 169 for ((i) = 0; (i) < (hctx)->nr_ctx && \
171 (i) < (hctx)->nr_ctx; (i)++, ctx = (hctx)->ctxs[(i)]) 170 ({ ctx = (hctx)->ctxs[(i)]; 1; }); (i)++)
172 171
173#define blk_ctx_sum(q, sum) \ 172#define blk_ctx_sum(q, sum) \
174({ \ 173({ \
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 238ef0ed62f8..bbc3a6c88fce 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -28,13 +28,22 @@ struct bio_vec {
28 unsigned int bv_offset; 28 unsigned int bv_offset;
29}; 29};
30 30
31struct bvec_iter {
32 sector_t bi_sector; /* device address in 512 byte
33 sectors */
34 unsigned int bi_size; /* residual I/O count */
35
36 unsigned int bi_idx; /* current index into bvl_vec */
37
38 unsigned int bi_bvec_done; /* number of bytes completed in
39 current bvec */
40};
41
31/* 42/*
32 * main unit of I/O for the block layer and lower layers (ie drivers and 43 * main unit of I/O for the block layer and lower layers (ie drivers and
33 * stacking drivers) 44 * stacking drivers)
34 */ 45 */
35struct bio { 46struct bio {
36 sector_t bi_sector; /* device address in 512 byte
37 sectors */
38 struct bio *bi_next; /* request queue link */ 47 struct bio *bi_next; /* request queue link */
39 struct block_device *bi_bdev; 48 struct block_device *bi_bdev;
40 unsigned long bi_flags; /* status, command, etc */ 49 unsigned long bi_flags; /* status, command, etc */
@@ -42,16 +51,13 @@ struct bio {
42 * top bits priority 51 * top bits priority
43 */ 52 */
44 53
45 unsigned short bi_vcnt; /* how many bio_vec's */ 54 struct bvec_iter bi_iter;
46 unsigned short bi_idx; /* current index into bvl_vec */
47 55
48 /* Number of segments in this BIO after 56 /* Number of segments in this BIO after
49 * physical address coalescing is performed. 57 * physical address coalescing is performed.
50 */ 58 */
51 unsigned int bi_phys_segments; 59 unsigned int bi_phys_segments;
52 60
53 unsigned int bi_size; /* residual I/O count */
54
55 /* 61 /*
56 * To keep track of the max segment size, we account for the 62 * To keep track of the max segment size, we account for the
57 * sizes of the first and last mergeable segments in this bio. 63 * sizes of the first and last mergeable segments in this bio.
@@ -59,6 +65,8 @@ struct bio {
59 unsigned int bi_seg_front_size; 65 unsigned int bi_seg_front_size;
60 unsigned int bi_seg_back_size; 66 unsigned int bi_seg_back_size;
61 67
68 atomic_t bi_remaining;
69
62 bio_end_io_t *bi_end_io; 70 bio_end_io_t *bi_end_io;
63 71
64 void *bi_private; 72 void *bi_private;
@@ -74,11 +82,13 @@ struct bio {
74 struct bio_integrity_payload *bi_integrity; /* data integrity */ 82 struct bio_integrity_payload *bi_integrity; /* data integrity */
75#endif 83#endif
76 84
85 unsigned short bi_vcnt; /* how many bio_vec's */
86
77 /* 87 /*
78 * Everything starting with bi_max_vecs will be preserved by bio_reset() 88 * Everything starting with bi_max_vecs will be preserved by bio_reset()
79 */ 89 */
80 90
81 unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ 91 unsigned short bi_max_vecs; /* max bvl_vecs we can hold */
82 92
83 atomic_t bi_cnt; /* pin count */ 93 atomic_t bi_cnt; /* pin count */
84 94
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 1b135d49b279..8678c4322b44 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -95,10 +95,7 @@ enum rq_cmd_type_bits {
95 * as well! 95 * as well!
96 */ 96 */
97struct request { 97struct request {
98 union { 98 struct list_head queuelist;
99 struct list_head queuelist;
100 struct llist_node ll_list;
101 };
102 union { 99 union {
103 struct call_single_data csd; 100 struct call_single_data csd;
104 struct work_struct mq_flush_data; 101 struct work_struct mq_flush_data;
@@ -291,6 +288,7 @@ struct queue_limits {
291 unsigned char discard_misaligned; 288 unsigned char discard_misaligned;
292 unsigned char cluster; 289 unsigned char cluster;
293 unsigned char discard_zeroes_data; 290 unsigned char discard_zeroes_data;
291 unsigned char raid_partial_stripes_expensive;
294}; 292};
295 293
296struct request_queue { 294struct request_queue {
@@ -735,7 +733,7 @@ struct rq_map_data {
735}; 733};
736 734
737struct req_iterator { 735struct req_iterator {
738 int i; 736 struct bvec_iter iter;
739 struct bio *bio; 737 struct bio *bio;
740}; 738};
741 739
@@ -748,10 +746,11 @@ struct req_iterator {
748 746
749#define rq_for_each_segment(bvl, _rq, _iter) \ 747#define rq_for_each_segment(bvl, _rq, _iter) \
750 __rq_for_each_bio(_iter.bio, _rq) \ 748 __rq_for_each_bio(_iter.bio, _rq) \
751 bio_for_each_segment(bvl, _iter.bio, _iter.i) 749 bio_for_each_segment(bvl, _iter.bio, _iter.iter)
752 750
753#define rq_iter_last(rq, _iter) \ 751#define rq_iter_last(bvec, _iter) \
754 (_iter.bio->bi_next == NULL && _iter.i == _iter.bio->bi_vcnt-1) 752 (_iter.bio->bi_next == NULL && \
753 bio_iter_last(bvec, _iter.iter))
755 754
756#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 755#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
757# error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform" 756# error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform"
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index f1f07d31a3af..db51fe4fe317 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -5,6 +5,7 @@
5#define _LINUX_BOOTMEM_H 5#define _LINUX_BOOTMEM_H
6 6
7#include <linux/mmzone.h> 7#include <linux/mmzone.h>
8#include <linux/mm_types.h>
8#include <asm/dma.h> 9#include <asm/dma.h>
9 10
10/* 11/*
@@ -52,7 +53,6 @@ extern void free_bootmem_node(pg_data_t *pgdat,
52 unsigned long size); 53 unsigned long size);
53extern void free_bootmem(unsigned long physaddr, unsigned long size); 54extern void free_bootmem(unsigned long physaddr, unsigned long size);
54extern void free_bootmem_late(unsigned long physaddr, unsigned long size); 55extern void free_bootmem_late(unsigned long physaddr, unsigned long size);
55extern void __free_pages_bootmem(struct page *page, unsigned int order);
56 56
57/* 57/*
58 * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, 58 * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE,
@@ -142,6 +142,194 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
142#define alloc_bootmem_low_pages_node(pgdat, x) \ 142#define alloc_bootmem_low_pages_node(pgdat, x) \
143 __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) 143 __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)
144 144
145
146#if defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM)
147
148/* FIXME: use MEMBLOCK_ALLOC_* variants here */
149#define BOOTMEM_ALLOC_ACCESSIBLE 0
150#define BOOTMEM_ALLOC_ANYWHERE (~(phys_addr_t)0)
151
152/* FIXME: Move to memblock.h at a point where we remove nobootmem.c */
153void *memblock_virt_alloc_try_nid_nopanic(phys_addr_t size,
154 phys_addr_t align, phys_addr_t min_addr,
155 phys_addr_t max_addr, int nid);
156void *memblock_virt_alloc_try_nid(phys_addr_t size, phys_addr_t align,
157 phys_addr_t min_addr, phys_addr_t max_addr, int nid);
158void __memblock_free_early(phys_addr_t base, phys_addr_t size);
159void __memblock_free_late(phys_addr_t base, phys_addr_t size);
160
161static inline void * __init memblock_virt_alloc(
162 phys_addr_t size, phys_addr_t align)
163{
164 return memblock_virt_alloc_try_nid(size, align, BOOTMEM_LOW_LIMIT,
165 BOOTMEM_ALLOC_ACCESSIBLE,
166 NUMA_NO_NODE);
167}
168
169static inline void * __init memblock_virt_alloc_nopanic(
170 phys_addr_t size, phys_addr_t align)
171{
172 return memblock_virt_alloc_try_nid_nopanic(size, align,
173 BOOTMEM_LOW_LIMIT,
174 BOOTMEM_ALLOC_ACCESSIBLE,
175 NUMA_NO_NODE);
176}
177
178#ifndef ARCH_LOW_ADDRESS_LIMIT
179#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL
180#endif
181
182static inline void * __init memblock_virt_alloc_low(
183 phys_addr_t size, phys_addr_t align)
184{
185 return memblock_virt_alloc_try_nid(size, align,
186 BOOTMEM_LOW_LIMIT,
187 ARCH_LOW_ADDRESS_LIMIT,
188 NUMA_NO_NODE);
189}
190static inline void * __init memblock_virt_alloc_low_nopanic(
191 phys_addr_t size, phys_addr_t align)
192{
193 return memblock_virt_alloc_try_nid_nopanic(size, align,
194 BOOTMEM_LOW_LIMIT,
195 ARCH_LOW_ADDRESS_LIMIT,
196 NUMA_NO_NODE);
197}
198
199static inline void * __init memblock_virt_alloc_from_nopanic(
200 phys_addr_t size, phys_addr_t align, phys_addr_t min_addr)
201{
202 return memblock_virt_alloc_try_nid_nopanic(size, align, min_addr,
203 BOOTMEM_ALLOC_ACCESSIBLE,
204 NUMA_NO_NODE);
205}
206
207static inline void * __init memblock_virt_alloc_node(
208 phys_addr_t size, int nid)
209{
210 return memblock_virt_alloc_try_nid(size, 0, BOOTMEM_LOW_LIMIT,
211 BOOTMEM_ALLOC_ACCESSIBLE, nid);
212}
213
214static inline void * __init memblock_virt_alloc_node_nopanic(
215 phys_addr_t size, int nid)
216{
217 return memblock_virt_alloc_try_nid_nopanic(size, 0, BOOTMEM_LOW_LIMIT,
218 BOOTMEM_ALLOC_ACCESSIBLE,
219 nid);
220}
221
222static inline void __init memblock_free_early(
223 phys_addr_t base, phys_addr_t size)
224{
225 __memblock_free_early(base, size);
226}
227
228static inline void __init memblock_free_early_nid(
229 phys_addr_t base, phys_addr_t size, int nid)
230{
231 __memblock_free_early(base, size);
232}
233
234static inline void __init memblock_free_late(
235 phys_addr_t base, phys_addr_t size)
236{
237 __memblock_free_late(base, size);
238}
239
240#else
241
242#define BOOTMEM_ALLOC_ACCESSIBLE 0
243
244
245/* Fall back to all the existing bootmem APIs */
246static inline void * __init memblock_virt_alloc(
247 phys_addr_t size, phys_addr_t align)
248{
249 if (!align)
250 align = SMP_CACHE_BYTES;
251 return __alloc_bootmem(size, align, BOOTMEM_LOW_LIMIT);
252}
253
254static inline void * __init memblock_virt_alloc_nopanic(
255 phys_addr_t size, phys_addr_t align)
256{
257 if (!align)
258 align = SMP_CACHE_BYTES;
259 return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT);
260}
261
262static inline void * __init memblock_virt_alloc_low(
263 phys_addr_t size, phys_addr_t align)
264{
265 if (!align)
266 align = SMP_CACHE_BYTES;
267 return __alloc_bootmem_low(size, align, 0);
268}
269
270static inline void * __init memblock_virt_alloc_low_nopanic(
271 phys_addr_t size, phys_addr_t align)
272{
273 if (!align)
274 align = SMP_CACHE_BYTES;
275 return __alloc_bootmem_low_nopanic(size, align, 0);
276}
277
278static inline void * __init memblock_virt_alloc_from_nopanic(
279 phys_addr_t size, phys_addr_t align, phys_addr_t min_addr)
280{
281 return __alloc_bootmem_nopanic(size, align, min_addr);
282}
283
284static inline void * __init memblock_virt_alloc_node(
285 phys_addr_t size, int nid)
286{
287 return __alloc_bootmem_node(NODE_DATA(nid), size, SMP_CACHE_BYTES,
288 BOOTMEM_LOW_LIMIT);
289}
290
291static inline void * __init memblock_virt_alloc_node_nopanic(
292 phys_addr_t size, int nid)
293{
294 return __alloc_bootmem_node_nopanic(NODE_DATA(nid), size,
295 SMP_CACHE_BYTES,
296 BOOTMEM_LOW_LIMIT);
297}
298
299static inline void * __init memblock_virt_alloc_try_nid(phys_addr_t size,
300 phys_addr_t align, phys_addr_t min_addr, phys_addr_t max_addr, int nid)
301{
302 return __alloc_bootmem_node_high(NODE_DATA(nid), size, align,
303 min_addr);
304}
305
306static inline void * __init memblock_virt_alloc_try_nid_nopanic(
307 phys_addr_t size, phys_addr_t align,
308 phys_addr_t min_addr, phys_addr_t max_addr, int nid)
309{
310 return ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size, align,
311 min_addr, max_addr);
312}
313
314static inline void __init memblock_free_early(
315 phys_addr_t base, phys_addr_t size)
316{
317 free_bootmem(base, size);
318}
319
320static inline void __init memblock_free_early_nid(
321 phys_addr_t base, phys_addr_t size, int nid)
322{
323 free_bootmem_node(NODE_DATA(nid), base, size);
324}
325
326static inline void __init memblock_free_late(
327 phys_addr_t base, phys_addr_t size)
328{
329 free_bootmem_late(base, size);
330}
331#endif /* defined(CONFIG_HAVE_MEMBLOCK) && defined(CONFIG_NO_BOOTMEM) */
332
145#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP 333#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
146extern void *alloc_remap(int nid, unsigned long size); 334extern void *alloc_remap(int nid, unsigned long size);
147#else 335#else
diff --git a/include/linux/cache.h b/include/linux/cache.h
index 4c570653ab84..17e7e82d2aa7 100644
--- a/include/linux/cache.h
+++ b/include/linux/cache.h
@@ -1,11 +1,11 @@
1#ifndef __LINUX_CACHE_H 1#ifndef __LINUX_CACHE_H
2#define __LINUX_CACHE_H 2#define __LINUX_CACHE_H
3 3
4#include <linux/kernel.h> 4#include <uapi/linux/kernel.h>
5#include <asm/cache.h> 5#include <asm/cache.h>
6 6
7#ifndef L1_CACHE_ALIGN 7#ifndef L1_CACHE_ALIGN
8#define L1_CACHE_ALIGN(x) ALIGN(x, L1_CACHE_BYTES) 8#define L1_CACHE_ALIGN(x) __ALIGN_KERNEL(x, L1_CACHE_BYTES)
9#endif 9#endif
10 10
11#ifndef SMP_CACHE_BYTES 11#ifndef SMP_CACHE_BYTES
diff --git a/include/linux/ccp.h b/include/linux/ccp.h
new file mode 100644
index 000000000000..b941ab9f762b
--- /dev/null
+++ b/include/linux/ccp.h
@@ -0,0 +1,537 @@
1/*
2 * AMD Cryptographic Coprocessor (CCP) driver
3 *
4 * Copyright (C) 2013 Advanced Micro Devices, Inc.
5 *
6 * Author: Tom Lendacky <thomas.lendacky@amd.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 __CPP_H__
14#define __CPP_H__
15
16#include <linux/scatterlist.h>
17#include <linux/workqueue.h>
18#include <linux/list.h>
19#include <crypto/aes.h>
20#include <crypto/sha.h>
21
22
23struct ccp_device;
24struct ccp_cmd;
25
26#if defined(CONFIG_CRYPTO_DEV_CCP_DD) || \
27 defined(CONFIG_CRYPTO_DEV_CCP_DD_MODULE)
28
29/**
30 * ccp_enqueue_cmd - queue an operation for processing by the CCP
31 *
32 * @cmd: ccp_cmd struct to be processed
33 *
34 * Refer to the ccp_cmd struct below for required fields.
35 *
36 * Queue a cmd to be processed by the CCP. If queueing the cmd
37 * would exceed the defined length of the cmd queue the cmd will
38 * only be queued if the CCP_CMD_MAY_BACKLOG flag is set and will
39 * result in a return code of -EBUSY.
40 *
41 * The callback routine specified in the ccp_cmd struct will be
42 * called to notify the caller of completion (if the cmd was not
43 * backlogged) or advancement out of the backlog. If the cmd has
44 * advanced out of the backlog the "err" value of the callback
45 * will be -EINPROGRESS. Any other "err" value during callback is
46 * the result of the operation.
47 *
48 * The cmd has been successfully queued if:
49 * the return code is -EINPROGRESS or
50 * the return code is -EBUSY and CCP_CMD_MAY_BACKLOG flag is set
51 */
52int ccp_enqueue_cmd(struct ccp_cmd *cmd);
53
54#else /* CONFIG_CRYPTO_DEV_CCP_DD is not enabled */
55
56static inline int ccp_enqueue_cmd(struct ccp_cmd *cmd)
57{
58 return -ENODEV;
59}
60
61#endif /* CONFIG_CRYPTO_DEV_CCP_DD */
62
63
64/***** AES engine *****/
65/**
66 * ccp_aes_type - AES key size
67 *
68 * @CCP_AES_TYPE_128: 128-bit key
69 * @CCP_AES_TYPE_192: 192-bit key
70 * @CCP_AES_TYPE_256: 256-bit key
71 */
72enum ccp_aes_type {
73 CCP_AES_TYPE_128 = 0,
74 CCP_AES_TYPE_192,
75 CCP_AES_TYPE_256,
76 CCP_AES_TYPE__LAST,
77};
78
79/**
80 * ccp_aes_mode - AES operation mode
81 *
82 * @CCP_AES_MODE_ECB: ECB mode
83 * @CCP_AES_MODE_CBC: CBC mode
84 * @CCP_AES_MODE_OFB: OFB mode
85 * @CCP_AES_MODE_CFB: CFB mode
86 * @CCP_AES_MODE_CTR: CTR mode
87 * @CCP_AES_MODE_CMAC: CMAC mode
88 */
89enum ccp_aes_mode {
90 CCP_AES_MODE_ECB = 0,
91 CCP_AES_MODE_CBC,
92 CCP_AES_MODE_OFB,
93 CCP_AES_MODE_CFB,
94 CCP_AES_MODE_CTR,
95 CCP_AES_MODE_CMAC,
96 CCP_AES_MODE__LAST,
97};
98
99/**
100 * ccp_aes_mode - AES operation mode
101 *
102 * @CCP_AES_ACTION_DECRYPT: AES decrypt operation
103 * @CCP_AES_ACTION_ENCRYPT: AES encrypt operation
104 */
105enum ccp_aes_action {
106 CCP_AES_ACTION_DECRYPT = 0,
107 CCP_AES_ACTION_ENCRYPT,
108 CCP_AES_ACTION__LAST,
109};
110
111/**
112 * struct ccp_aes_engine - CCP AES operation
113 * @type: AES operation key size
114 * @mode: AES operation mode
115 * @action: AES operation (decrypt/encrypt)
116 * @key: key to be used for this AES operation
117 * @key_len: length in bytes of key
118 * @iv: IV to be used for this AES operation
119 * @iv_len: length in bytes of iv
120 * @src: data to be used for this operation
121 * @dst: data produced by this operation
122 * @src_len: length in bytes of data used for this operation
123 * @cmac_final: indicates final operation when running in CMAC mode
124 * @cmac_key: K1/K2 key used in final CMAC operation
125 * @cmac_key_len: length in bytes of cmac_key
126 *
127 * Variables required to be set when calling ccp_enqueue_cmd():
128 * - type, mode, action, key, key_len, src, dst, src_len
129 * - iv, iv_len for any mode other than ECB
130 * - cmac_final for CMAC mode
131 * - cmac_key, cmac_key_len for CMAC mode if cmac_final is non-zero
132 *
133 * The iv variable is used as both input and output. On completion of the
134 * AES operation the new IV overwrites the old IV.
135 */
136struct ccp_aes_engine {
137 enum ccp_aes_type type;
138 enum ccp_aes_mode mode;
139 enum ccp_aes_action action;
140
141 struct scatterlist *key;
142 u32 key_len; /* In bytes */
143
144 struct scatterlist *iv;
145 u32 iv_len; /* In bytes */
146
147 struct scatterlist *src, *dst;
148 u64 src_len; /* In bytes */
149
150 u32 cmac_final; /* Indicates final cmac cmd */
151 struct scatterlist *cmac_key; /* K1/K2 cmac key required for
152 * final cmac cmd */
153 u32 cmac_key_len; /* In bytes */
154};
155
156/***** XTS-AES engine *****/
157/**
158 * ccp_xts_aes_unit_size - XTS unit size
159 *
160 * @CCP_XTS_AES_UNIT_SIZE_16: Unit size of 16 bytes
161 * @CCP_XTS_AES_UNIT_SIZE_512: Unit size of 512 bytes
162 * @CCP_XTS_AES_UNIT_SIZE_1024: Unit size of 1024 bytes
163 * @CCP_XTS_AES_UNIT_SIZE_2048: Unit size of 2048 bytes
164 * @CCP_XTS_AES_UNIT_SIZE_4096: Unit size of 4096 bytes
165 */
166enum ccp_xts_aes_unit_size {
167 CCP_XTS_AES_UNIT_SIZE_16 = 0,
168 CCP_XTS_AES_UNIT_SIZE_512,
169 CCP_XTS_AES_UNIT_SIZE_1024,
170 CCP_XTS_AES_UNIT_SIZE_2048,
171 CCP_XTS_AES_UNIT_SIZE_4096,
172 CCP_XTS_AES_UNIT_SIZE__LAST,
173};
174
175/**
176 * struct ccp_xts_aes_engine - CCP XTS AES operation
177 * @action: AES operation (decrypt/encrypt)
178 * @unit_size: unit size of the XTS operation
179 * @key: key to be used for this XTS AES operation
180 * @key_len: length in bytes of key
181 * @iv: IV to be used for this XTS AES operation
182 * @iv_len: length in bytes of iv
183 * @src: data to be used for this operation
184 * @dst: data produced by this operation
185 * @src_len: length in bytes of data used for this operation
186 * @final: indicates final XTS operation
187 *
188 * Variables required to be set when calling ccp_enqueue_cmd():
189 * - action, unit_size, key, key_len, iv, iv_len, src, dst, src_len, final
190 *
191 * The iv variable is used as both input and output. On completion of the
192 * AES operation the new IV overwrites the old IV.
193 */
194struct ccp_xts_aes_engine {
195 enum ccp_aes_action action;
196 enum ccp_xts_aes_unit_size unit_size;
197
198 struct scatterlist *key;
199 u32 key_len; /* In bytes */
200
201 struct scatterlist *iv;
202 u32 iv_len; /* In bytes */
203
204 struct scatterlist *src, *dst;
205 u64 src_len; /* In bytes */
206
207 u32 final;
208};
209
210/***** SHA engine *****/
211#define CCP_SHA_BLOCKSIZE SHA256_BLOCK_SIZE
212#define CCP_SHA_CTXSIZE SHA256_DIGEST_SIZE
213
214/**
215 * ccp_sha_type - type of SHA operation
216 *
217 * @CCP_SHA_TYPE_1: SHA-1 operation
218 * @CCP_SHA_TYPE_224: SHA-224 operation
219 * @CCP_SHA_TYPE_256: SHA-256 operation
220 */
221enum ccp_sha_type {
222 CCP_SHA_TYPE_1 = 1,
223 CCP_SHA_TYPE_224,
224 CCP_SHA_TYPE_256,
225 CCP_SHA_TYPE__LAST,
226};
227
228/**
229 * struct ccp_sha_engine - CCP SHA operation
230 * @type: Type of SHA operation
231 * @ctx: current hash value
232 * @ctx_len: length in bytes of hash value
233 * @src: data to be used for this operation
234 * @src_len: length in bytes of data used for this operation
235 * @final: indicates final SHA operation
236 * @msg_bits: total length of the message in bits used in final SHA operation
237 *
238 * Variables required to be set when calling ccp_enqueue_cmd():
239 * - type, ctx, ctx_len, src, src_len, final
240 * - msg_bits if final is non-zero
241 *
242 * The ctx variable is used as both input and output. On completion of the
243 * SHA operation the new hash value overwrites the old hash value.
244 */
245struct ccp_sha_engine {
246 enum ccp_sha_type type;
247
248 struct scatterlist *ctx;
249 u32 ctx_len; /* In bytes */
250
251 struct scatterlist *src;
252 u64 src_len; /* In bytes */
253
254 u32 final; /* Indicates final sha cmd */
255 u64 msg_bits; /* Message length in bits required for
256 * final sha cmd */
257};
258
259/***** RSA engine *****/
260/**
261 * struct ccp_rsa_engine - CCP RSA operation
262 * @key_size: length in bits of RSA key
263 * @exp: RSA exponent
264 * @exp_len: length in bytes of exponent
265 * @mod: RSA modulus
266 * @mod_len: length in bytes of modulus
267 * @src: data to be used for this operation
268 * @dst: data produced by this operation
269 * @src_len: length in bytes of data used for this operation
270 *
271 * Variables required to be set when calling ccp_enqueue_cmd():
272 * - key_size, exp, exp_len, mod, mod_len, src, dst, src_len
273 */
274struct ccp_rsa_engine {
275 u32 key_size; /* In bits */
276
277 struct scatterlist *exp;
278 u32 exp_len; /* In bytes */
279
280 struct scatterlist *mod;
281 u32 mod_len; /* In bytes */
282
283 struct scatterlist *src, *dst;
284 u32 src_len; /* In bytes */
285};
286
287/***** Passthru engine *****/
288/**
289 * ccp_passthru_bitwise - type of bitwise passthru operation
290 *
291 * @CCP_PASSTHRU_BITWISE_NOOP: no bitwise operation performed
292 * @CCP_PASSTHRU_BITWISE_AND: perform bitwise AND of src with mask
293 * @CCP_PASSTHRU_BITWISE_OR: perform bitwise OR of src with mask
294 * @CCP_PASSTHRU_BITWISE_XOR: perform bitwise XOR of src with mask
295 * @CCP_PASSTHRU_BITWISE_MASK: overwrite with mask
296 */
297enum ccp_passthru_bitwise {
298 CCP_PASSTHRU_BITWISE_NOOP = 0,
299 CCP_PASSTHRU_BITWISE_AND,
300 CCP_PASSTHRU_BITWISE_OR,
301 CCP_PASSTHRU_BITWISE_XOR,
302 CCP_PASSTHRU_BITWISE_MASK,
303 CCP_PASSTHRU_BITWISE__LAST,
304};
305
306/**
307 * ccp_passthru_byteswap - type of byteswap passthru operation
308 *
309 * @CCP_PASSTHRU_BYTESWAP_NOOP: no byte swapping performed
310 * @CCP_PASSTHRU_BYTESWAP_32BIT: swap bytes within 32-bit words
311 * @CCP_PASSTHRU_BYTESWAP_256BIT: swap bytes within 256-bit words
312 */
313enum ccp_passthru_byteswap {
314 CCP_PASSTHRU_BYTESWAP_NOOP = 0,
315 CCP_PASSTHRU_BYTESWAP_32BIT,
316 CCP_PASSTHRU_BYTESWAP_256BIT,
317 CCP_PASSTHRU_BYTESWAP__LAST,
318};
319
320/**
321 * struct ccp_passthru_engine - CCP pass-through operation
322 * @bit_mod: bitwise operation to perform
323 * @byte_swap: byteswap operation to perform
324 * @mask: mask to be applied to data
325 * @mask_len: length in bytes of mask
326 * @src: data to be used for this operation
327 * @dst: data produced by this operation
328 * @src_len: length in bytes of data used for this operation
329 * @final: indicate final pass-through operation
330 *
331 * Variables required to be set when calling ccp_enqueue_cmd():
332 * - bit_mod, byte_swap, src, dst, src_len
333 * - mask, mask_len if bit_mod is not CCP_PASSTHRU_BITWISE_NOOP
334 */
335struct ccp_passthru_engine {
336 enum ccp_passthru_bitwise bit_mod;
337 enum ccp_passthru_byteswap byte_swap;
338
339 struct scatterlist *mask;
340 u32 mask_len; /* In bytes */
341
342 struct scatterlist *src, *dst;
343 u64 src_len; /* In bytes */
344
345 u32 final;
346};
347
348/***** ECC engine *****/
349#define CCP_ECC_MODULUS_BYTES 48 /* 384-bits */
350#define CCP_ECC_MAX_OPERANDS 6
351#define CCP_ECC_MAX_OUTPUTS 3
352
353/**
354 * ccp_ecc_function - type of ECC function
355 *
356 * @CCP_ECC_FUNCTION_MMUL_384BIT: 384-bit modular multiplication
357 * @CCP_ECC_FUNCTION_MADD_384BIT: 384-bit modular addition
358 * @CCP_ECC_FUNCTION_MINV_384BIT: 384-bit multiplicative inverse
359 * @CCP_ECC_FUNCTION_PADD_384BIT: 384-bit point addition
360 * @CCP_ECC_FUNCTION_PMUL_384BIT: 384-bit point multiplication
361 * @CCP_ECC_FUNCTION_PDBL_384BIT: 384-bit point doubling
362 */
363enum ccp_ecc_function {
364 CCP_ECC_FUNCTION_MMUL_384BIT = 0,
365 CCP_ECC_FUNCTION_MADD_384BIT,
366 CCP_ECC_FUNCTION_MINV_384BIT,
367 CCP_ECC_FUNCTION_PADD_384BIT,
368 CCP_ECC_FUNCTION_PMUL_384BIT,
369 CCP_ECC_FUNCTION_PDBL_384BIT,
370};
371
372/**
373 * struct ccp_ecc_modular_math - CCP ECC modular math parameters
374 * @operand_1: first operand for the modular math operation
375 * @operand_1_len: length of the first operand
376 * @operand_2: second operand for the modular math operation
377 * (not used for CCP_ECC_FUNCTION_MINV_384BIT)
378 * @operand_2_len: length of the second operand
379 * (not used for CCP_ECC_FUNCTION_MINV_384BIT)
380 * @result: result of the modular math operation
381 * @result_len: length of the supplied result buffer
382 */
383struct ccp_ecc_modular_math {
384 struct scatterlist *operand_1;
385 unsigned int operand_1_len; /* In bytes */
386
387 struct scatterlist *operand_2;
388 unsigned int operand_2_len; /* In bytes */
389
390 struct scatterlist *result;
391 unsigned int result_len; /* In bytes */
392};
393
394/**
395 * struct ccp_ecc_point - CCP ECC point definition
396 * @x: the x coordinate of the ECC point
397 * @x_len: the length of the x coordinate
398 * @y: the y coordinate of the ECC point
399 * @y_len: the length of the y coordinate
400 */
401struct ccp_ecc_point {
402 struct scatterlist *x;
403 unsigned int x_len; /* In bytes */
404
405 struct scatterlist *y;
406 unsigned int y_len; /* In bytes */
407};
408
409/**
410 * struct ccp_ecc_point_math - CCP ECC point math parameters
411 * @point_1: the first point of the ECC point math operation
412 * @point_2: the second point of the ECC point math operation
413 * (only used for CCP_ECC_FUNCTION_PADD_384BIT)
414 * @domain_a: the a parameter of the ECC curve
415 * @domain_a_len: the length of the a parameter
416 * @scalar: the scalar parameter for the point match operation
417 * (only used for CCP_ECC_FUNCTION_PMUL_384BIT)
418 * @scalar_len: the length of the scalar parameter
419 * (only used for CCP_ECC_FUNCTION_PMUL_384BIT)
420 * @result: the point resulting from the point math operation
421 */
422struct ccp_ecc_point_math {
423 struct ccp_ecc_point point_1;
424 struct ccp_ecc_point point_2;
425
426 struct scatterlist *domain_a;
427 unsigned int domain_a_len; /* In bytes */
428
429 struct scatterlist *scalar;
430 unsigned int scalar_len; /* In bytes */
431
432 struct ccp_ecc_point result;
433};
434
435/**
436 * struct ccp_ecc_engine - CCP ECC operation
437 * @function: ECC function to perform
438 * @mod: ECC modulus
439 * @mod_len: length in bytes of modulus
440 * @mm: module math parameters
441 * @pm: point math parameters
442 * @ecc_result: result of the ECC operation
443 *
444 * Variables required to be set when calling ccp_enqueue_cmd():
445 * - function, mod, mod_len
446 * - operand, operand_len, operand_count, output, output_len, output_count
447 * - ecc_result
448 */
449struct ccp_ecc_engine {
450 enum ccp_ecc_function function;
451
452 struct scatterlist *mod;
453 u32 mod_len; /* In bytes */
454
455 union {
456 struct ccp_ecc_modular_math mm;
457 struct ccp_ecc_point_math pm;
458 } u;
459
460 u16 ecc_result;
461};
462
463
464/**
465 * ccp_engine - CCP operation identifiers
466 *
467 * @CCP_ENGINE_AES: AES operation
468 * @CCP_ENGINE_XTS_AES: 128-bit XTS AES operation
469 * @CCP_ENGINE_RSVD1: unused
470 * @CCP_ENGINE_SHA: SHA operation
471 * @CCP_ENGINE_RSA: RSA operation
472 * @CCP_ENGINE_PASSTHRU: pass-through operation
473 * @CCP_ENGINE_ZLIB_DECOMPRESS: unused
474 * @CCP_ENGINE_ECC: ECC operation
475 */
476enum ccp_engine {
477 CCP_ENGINE_AES = 0,
478 CCP_ENGINE_XTS_AES_128,
479 CCP_ENGINE_RSVD1,
480 CCP_ENGINE_SHA,
481 CCP_ENGINE_RSA,
482 CCP_ENGINE_PASSTHRU,
483 CCP_ENGINE_ZLIB_DECOMPRESS,
484 CCP_ENGINE_ECC,
485 CCP_ENGINE__LAST,
486};
487
488/* Flag values for flags member of ccp_cmd */
489#define CCP_CMD_MAY_BACKLOG 0x00000001
490
491/**
492 * struct ccp_cmd - CPP operation request
493 * @entry: list element (ccp driver use only)
494 * @work: work element used for callbacks (ccp driver use only)
495 * @ccp: CCP device to be run on (ccp driver use only)
496 * @ret: operation return code (ccp driver use only)
497 * @flags: cmd processing flags
498 * @engine: CCP operation to perform
499 * @engine_error: CCP engine return code
500 * @u: engine specific structures, refer to specific engine struct below
501 * @callback: operation completion callback function
502 * @data: parameter value to be supplied to the callback function
503 *
504 * Variables required to be set when calling ccp_enqueue_cmd():
505 * - engine, callback
506 * - See the operation structures below for what is required for each
507 * operation.
508 */
509struct ccp_cmd {
510 /* The list_head, work_struct, ccp and ret variables are for use
511 * by the CCP driver only.
512 */
513 struct list_head entry;
514 struct work_struct work;
515 struct ccp_device *ccp;
516 int ret;
517
518 u32 flags;
519
520 enum ccp_engine engine;
521 u32 engine_error;
522
523 union {
524 struct ccp_aes_engine aes;
525 struct ccp_xts_aes_engine xts;
526 struct ccp_sha_engine sha;
527 struct ccp_rsa_engine rsa;
528 struct ccp_passthru_engine passthru;
529 struct ccp_ecc_engine ecc;
530 } u;
531
532 /* Completion callback support */
533 void (*callback)(void *data, int err);
534 void *data;
535};
536
537#endif
diff --git a/include/linux/ceph/buffer.h b/include/linux/ceph/buffer.h
index 58d19014068f..07ad423cc37f 100644
--- a/include/linux/ceph/buffer.h
+++ b/include/linux/ceph/buffer.h
@@ -17,7 +17,6 @@ struct ceph_buffer {
17 struct kref kref; 17 struct kref kref;
18 struct kvec vec; 18 struct kvec vec;
19 size_t alloc_len; 19 size_t alloc_len;
20 bool is_vmalloc;
21}; 20};
22 21
23extern struct ceph_buffer *ceph_buffer_new(size_t len, gfp_t gfp); 22extern struct ceph_buffer *ceph_buffer_new(size_t len, gfp_t gfp);
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h
index 4c42080347af..138448f766b4 100644
--- a/include/linux/ceph/ceph_features.h
+++ b/include/linux/ceph/ceph_features.h
@@ -4,42 +4,73 @@
4/* 4/*
5 * feature bits 5 * feature bits
6 */ 6 */
7#define CEPH_FEATURE_UID (1<<0) 7#define CEPH_FEATURE_UID (1ULL<<0)
8#define CEPH_FEATURE_NOSRCADDR (1<<1) 8#define CEPH_FEATURE_NOSRCADDR (1ULL<<1)
9#define CEPH_FEATURE_MONCLOCKCHECK (1<<2) 9#define CEPH_FEATURE_MONCLOCKCHECK (1ULL<<2)
10#define CEPH_FEATURE_FLOCK (1<<3) 10#define CEPH_FEATURE_FLOCK (1ULL<<3)
11#define CEPH_FEATURE_SUBSCRIBE2 (1<<4) 11#define CEPH_FEATURE_SUBSCRIBE2 (1ULL<<4)
12#define CEPH_FEATURE_MONNAMES (1<<5) 12#define CEPH_FEATURE_MONNAMES (1ULL<<5)
13#define CEPH_FEATURE_RECONNECT_SEQ (1<<6) 13#define CEPH_FEATURE_RECONNECT_SEQ (1ULL<<6)
14#define CEPH_FEATURE_DIRLAYOUTHASH (1<<7) 14#define CEPH_FEATURE_DIRLAYOUTHASH (1ULL<<7)
15#define CEPH_FEATURE_OBJECTLOCATOR (1<<8) 15#define CEPH_FEATURE_OBJECTLOCATOR (1ULL<<8)
16#define CEPH_FEATURE_PGID64 (1<<9) 16#define CEPH_FEATURE_PGID64 (1ULL<<9)
17#define CEPH_FEATURE_INCSUBOSDMAP (1<<10) 17#define CEPH_FEATURE_INCSUBOSDMAP (1ULL<<10)
18#define CEPH_FEATURE_PGPOOL3 (1<<11) 18#define CEPH_FEATURE_PGPOOL3 (1ULL<<11)
19#define CEPH_FEATURE_OSDREPLYMUX (1<<12) 19#define CEPH_FEATURE_OSDREPLYMUX (1ULL<<12)
20#define CEPH_FEATURE_OSDENC (1<<13) 20#define CEPH_FEATURE_OSDENC (1ULL<<13)
21#define CEPH_FEATURE_OMAP (1<<14) 21#define CEPH_FEATURE_OMAP (1ULL<<14)
22#define CEPH_FEATURE_MONENC (1<<15) 22#define CEPH_FEATURE_MONENC (1ULL<<15)
23#define CEPH_FEATURE_QUERY_T (1<<16) 23#define CEPH_FEATURE_QUERY_T (1ULL<<16)
24#define CEPH_FEATURE_INDEP_PG_MAP (1<<17) 24#define CEPH_FEATURE_INDEP_PG_MAP (1ULL<<17)
25#define CEPH_FEATURE_CRUSH_TUNABLES (1<<18) 25#define CEPH_FEATURE_CRUSH_TUNABLES (1ULL<<18)
26#define CEPH_FEATURE_CHUNKY_SCRUB (1<<19) 26#define CEPH_FEATURE_CHUNKY_SCRUB (1ULL<<19)
27#define CEPH_FEATURE_MON_NULLROUTE (1<<20) 27#define CEPH_FEATURE_MON_NULLROUTE (1ULL<<20)
28#define CEPH_FEATURE_MON_GV (1<<21) 28#define CEPH_FEATURE_MON_GV (1ULL<<21)
29#define CEPH_FEATURE_BACKFILL_RESERVATION (1<<22) 29#define CEPH_FEATURE_BACKFILL_RESERVATION (1ULL<<22)
30#define CEPH_FEATURE_MSG_AUTH (1<<23) 30#define CEPH_FEATURE_MSG_AUTH (1ULL<<23)
31#define CEPH_FEATURE_RECOVERY_RESERVATION (1<<24) 31#define CEPH_FEATURE_RECOVERY_RESERVATION (1ULL<<24)
32#define CEPH_FEATURE_CRUSH_TUNABLES2 (1<<25) 32#define CEPH_FEATURE_CRUSH_TUNABLES2 (1ULL<<25)
33#define CEPH_FEATURE_CREATEPOOLID (1<<26) 33#define CEPH_FEATURE_CREATEPOOLID (1ULL<<26)
34#define CEPH_FEATURE_REPLY_CREATE_INODE (1<<27) 34#define CEPH_FEATURE_REPLY_CREATE_INODE (1ULL<<27)
35#define CEPH_FEATURE_OSD_HBMSGS (1<<28) 35#define CEPH_FEATURE_OSD_HBMSGS (1ULL<<28)
36#define CEPH_FEATURE_MDSENC (1<<29) 36#define CEPH_FEATURE_MDSENC (1ULL<<29)
37#define CEPH_FEATURE_OSDHASHPSPOOL (1<<30) 37#define CEPH_FEATURE_OSDHASHPSPOOL (1ULL<<30)
38#define CEPH_FEATURE_MON_SINGLE_PAXOS (1ULL<<31)
39#define CEPH_FEATURE_OSD_SNAPMAPPER (1ULL<<32)
40#define CEPH_FEATURE_MON_SCRUB (1ULL<<33)
41#define CEPH_FEATURE_OSD_PACKED_RECOVERY (1ULL<<34)
42#define CEPH_FEATURE_OSD_CACHEPOOL (1ULL<<35)
43#define CEPH_FEATURE_CRUSH_V2 (1ULL<<36) /* new indep; SET_* steps */
44#define CEPH_FEATURE_EXPORT_PEER (1ULL<<37)
45#define CEPH_FEATURE_OSD_ERASURE_CODES (1ULL<<38)
46
47/*
48 * The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature
49 * vector to evaluate to 64 bit ~0. To cope, we designate 1ULL << 63
50 * to mean 33 bit ~0, and introduce a helper below to do the
51 * translation.
52 *
53 * This was introduced by ceph.git commit
54 * 9ea02b84104045c2ffd7e7f4e7af512953855ecd v0.58-657-g9ea02b8
55 * and fixed by ceph.git commit
56 * 4255b5c2fb54ae40c53284b3ab700fdfc7e61748 v0.65-263-g4255b5c
57 */
58#define CEPH_FEATURE_RESERVED (1ULL<<63)
59
60static inline u64 ceph_sanitize_features(u64 features)
61{
62 if (features & CEPH_FEATURE_RESERVED) {
63 /* everything through OSD_SNAPMAPPER */
64 return 0x1ffffffffull;
65 } else {
66 return features;
67 }
68}
38 69
39/* 70/*
40 * Features supported. 71 * Features supported.
41 */ 72 */
42#define CEPH_FEATURES_SUPPORTED_DEFAULT \ 73#define CEPH_FEATURES_SUPPORTED_DEFAULT \
43 (CEPH_FEATURE_NOSRCADDR | \ 74 (CEPH_FEATURE_NOSRCADDR | \
44 CEPH_FEATURE_RECONNECT_SEQ | \ 75 CEPH_FEATURE_RECONNECT_SEQ | \
45 CEPH_FEATURE_PGID64 | \ 76 CEPH_FEATURE_PGID64 | \
@@ -48,7 +79,10 @@
48 CEPH_FEATURE_CRUSH_TUNABLES | \ 79 CEPH_FEATURE_CRUSH_TUNABLES | \
49 CEPH_FEATURE_CRUSH_TUNABLES2 | \ 80 CEPH_FEATURE_CRUSH_TUNABLES2 | \
50 CEPH_FEATURE_REPLY_CREATE_INODE | \ 81 CEPH_FEATURE_REPLY_CREATE_INODE | \
51 CEPH_FEATURE_OSDHASHPSPOOL) 82 CEPH_FEATURE_OSDHASHPSPOOL | \
83 CEPH_FEATURE_OSD_CACHEPOOL | \
84 CEPH_FEATURE_CRUSH_V2 | \
85 CEPH_FEATURE_EXPORT_PEER)
52 86
53#define CEPH_FEATURES_REQUIRED_DEFAULT \ 87#define CEPH_FEATURES_REQUIRED_DEFAULT \
54 (CEPH_FEATURE_NOSRCADDR | \ 88 (CEPH_FEATURE_NOSRCADDR | \
@@ -56,4 +90,5 @@
56 CEPH_FEATURE_PGID64 | \ 90 CEPH_FEATURE_PGID64 | \
57 CEPH_FEATURE_PGPOOL3 | \ 91 CEPH_FEATURE_PGPOOL3 | \
58 CEPH_FEATURE_OSDENC) 92 CEPH_FEATURE_OSDENC)
93
59#endif 94#endif
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index 2ad7b860f062..2623cffc73a1 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -53,6 +53,29 @@ struct ceph_file_layout {
53 __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */ 53 __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */
54} __attribute__ ((packed)); 54} __attribute__ ((packed));
55 55
56#define ceph_file_layout_su(l) ((__s32)le32_to_cpu((l).fl_stripe_unit))
57#define ceph_file_layout_stripe_count(l) \
58 ((__s32)le32_to_cpu((l).fl_stripe_count))
59#define ceph_file_layout_object_size(l) ((__s32)le32_to_cpu((l).fl_object_size))
60#define ceph_file_layout_cas_hash(l) ((__s32)le32_to_cpu((l).fl_cas_hash))
61#define ceph_file_layout_object_su(l) \
62 ((__s32)le32_to_cpu((l).fl_object_stripe_unit))
63#define ceph_file_layout_pg_pool(l) \
64 ((__s32)le32_to_cpu((l).fl_pg_pool))
65
66static inline unsigned ceph_file_layout_stripe_width(struct ceph_file_layout *l)
67{
68 return le32_to_cpu(l->fl_stripe_unit) *
69 le32_to_cpu(l->fl_stripe_count);
70}
71
72/* "period" == bytes before i start on a new set of objects */
73static inline unsigned ceph_file_layout_period(struct ceph_file_layout *l)
74{
75 return le32_to_cpu(l->fl_object_size) *
76 le32_to_cpu(l->fl_stripe_count);
77}
78
56#define CEPH_MIN_STRIPE_UNIT 65536 79#define CEPH_MIN_STRIPE_UNIT 65536
57 80
58int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); 81int ceph_file_layout_is_valid(const struct ceph_file_layout *layout);
@@ -282,6 +305,8 @@ enum {
282 CEPH_SESSION_RENEWCAPS, 305 CEPH_SESSION_RENEWCAPS,
283 CEPH_SESSION_STALE, 306 CEPH_SESSION_STALE,
284 CEPH_SESSION_RECALL_STATE, 307 CEPH_SESSION_RECALL_STATE,
308 CEPH_SESSION_FLUSHMSG,
309 CEPH_SESSION_FLUSHMSG_ACK,
285}; 310};
286 311
287extern const char *ceph_session_op_name(int op); 312extern const char *ceph_session_op_name(int op);
@@ -457,7 +482,8 @@ struct ceph_mds_reply_cap {
457 __u8 flags; /* CEPH_CAP_FLAG_* */ 482 __u8 flags; /* CEPH_CAP_FLAG_* */
458} __attribute__ ((packed)); 483} __attribute__ ((packed));
459 484
460#define CEPH_CAP_FLAG_AUTH 1 /* cap is issued by auth mds */ 485#define CEPH_CAP_FLAG_AUTH (1 << 0) /* cap is issued by auth mds */
486#define CEPH_CAP_FLAG_RELEASE (1 << 1) /* release the cap */
461 487
462/* inode record, for bundling with mds reply */ 488/* inode record, for bundling with mds reply */
463struct ceph_mds_reply_inode { 489struct ceph_mds_reply_inode {
@@ -658,6 +684,14 @@ struct ceph_mds_caps {
658 __le32 time_warp_seq; 684 __le32 time_warp_seq;
659} __attribute__ ((packed)); 685} __attribute__ ((packed));
660 686
687struct ceph_mds_cap_peer {
688 __le64 cap_id;
689 __le32 seq;
690 __le32 mseq;
691 __le32 mds;
692 __u8 flags;
693} __attribute__ ((packed));
694
661/* cap release msg head */ 695/* cap release msg head */
662struct ceph_mds_cap_release { 696struct ceph_mds_cap_release {
663 __le32 num; /* number of cap_items that follow */ 697 __le32 num; /* number of cap_items that follow */
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h
index 0442c3d800f0..a6ef9cc267ec 100644
--- a/include/linux/ceph/decode.h
+++ b/include/linux/ceph/decode.h
@@ -8,23 +8,6 @@
8 8
9#include <linux/ceph/types.h> 9#include <linux/ceph/types.h>
10 10
11/* This seemed to be the easiest place to define these */
12
13#define U8_MAX ((u8)(~0U))
14#define U16_MAX ((u16)(~0U))
15#define U32_MAX ((u32)(~0U))
16#define U64_MAX ((u64)(~0ULL))
17
18#define S8_MAX ((s8)(U8_MAX >> 1))
19#define S16_MAX ((s16)(U16_MAX >> 1))
20#define S32_MAX ((s32)(U32_MAX >> 1))
21#define S64_MAX ((s64)(U64_MAX >> 1LL))
22
23#define S8_MIN ((s8)(-S8_MAX - 1))
24#define S16_MIN ((s16)(-S16_MAX - 1))
25#define S32_MIN ((s32)(-S32_MAX - 1))
26#define S64_MIN ((s64)(-S64_MAX - 1LL))
27
28/* 11/*
29 * in all cases, 12 * in all cases,
30 * void **p pointer to position pointer 13 * void **p pointer to position pointer
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 2e3024881a5e..2f49aa4c4f7f 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -122,8 +122,8 @@ struct ceph_client {
122 122
123 int (*extra_mon_dispatch)(struct ceph_client *, struct ceph_msg *); 123 int (*extra_mon_dispatch)(struct ceph_client *, struct ceph_msg *);
124 124
125 u32 supported_features; 125 u64 supported_features;
126 u32 required_features; 126 u64 required_features;
127 127
128 struct ceph_messenger msgr; /* messenger instance */ 128 struct ceph_messenger msgr; /* messenger instance */
129 struct ceph_mon_client monc; 129 struct ceph_mon_client monc;
@@ -173,15 +173,18 @@ static inline int calc_pages_for(u64 off, u64 len)
173 (off >> PAGE_CACHE_SHIFT); 173 (off >> PAGE_CACHE_SHIFT);
174} 174}
175 175
176extern struct kmem_cache *ceph_inode_cachep;
177extern struct kmem_cache *ceph_cap_cachep;
178extern struct kmem_cache *ceph_dentry_cachep;
179extern struct kmem_cache *ceph_file_cachep;
180
176/* ceph_common.c */ 181/* ceph_common.c */
177extern bool libceph_compatible(void *data); 182extern bool libceph_compatible(void *data);
178 183
179extern const char *ceph_msg_type_name(int type); 184extern const char *ceph_msg_type_name(int type);
180extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid); 185extern int ceph_check_fsid(struct ceph_client *client, struct ceph_fsid *fsid);
181extern struct kmem_cache *ceph_inode_cachep; 186extern void *ceph_kvmalloc(size_t size, gfp_t flags);
182extern struct kmem_cache *ceph_cap_cachep; 187extern void ceph_kvfree(const void *ptr);
183extern struct kmem_cache *ceph_dentry_cachep;
184extern struct kmem_cache *ceph_file_cachep;
185 188
186extern struct ceph_options *ceph_parse_options(char *options, 189extern struct ceph_options *ceph_parse_options(char *options,
187 const char *dev_name, const char *dev_name_end, 190 const char *dev_name, const char *dev_name_end,
@@ -192,8 +195,8 @@ extern int ceph_compare_options(struct ceph_options *new_opt,
192 struct ceph_client *client); 195 struct ceph_client *client);
193extern struct ceph_client *ceph_create_client(struct ceph_options *opt, 196extern struct ceph_client *ceph_create_client(struct ceph_options *opt,
194 void *private, 197 void *private,
195 unsigned supported_features, 198 u64 supported_features,
196 unsigned required_features); 199 u64 required_features);
197extern u64 ceph_client_id(struct ceph_client *client); 200extern u64 ceph_client_id(struct ceph_client *client);
198extern void ceph_destroy_client(struct ceph_client *client); 201extern void ceph_destroy_client(struct ceph_client *client);
199extern int __ceph_open_session(struct ceph_client *client, 202extern int __ceph_open_session(struct ceph_client *client,
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 7c1420bb1dce..d21f2dba0731 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -1,6 +1,7 @@
1#ifndef __FS_CEPH_MESSENGER_H 1#ifndef __FS_CEPH_MESSENGER_H
2#define __FS_CEPH_MESSENGER_H 2#define __FS_CEPH_MESSENGER_H
3 3
4#include <linux/blk_types.h>
4#include <linux/kref.h> 5#include <linux/kref.h>
5#include <linux/mutex.h> 6#include <linux/mutex.h>
6#include <linux/net.h> 7#include <linux/net.h>
@@ -60,8 +61,8 @@ struct ceph_messenger {
60 u32 global_seq; 61 u32 global_seq;
61 spinlock_t global_seq_lock; 62 spinlock_t global_seq_lock;
62 63
63 u32 supported_features; 64 u64 supported_features;
64 u32 required_features; 65 u64 required_features;
65}; 66};
66 67
67enum ceph_msg_data_type { 68enum ceph_msg_data_type {
@@ -119,8 +120,7 @@ struct ceph_msg_data_cursor {
119#ifdef CONFIG_BLOCK 120#ifdef CONFIG_BLOCK
120 struct { /* bio */ 121 struct { /* bio */
121 struct bio *bio; /* bio from list */ 122 struct bio *bio; /* bio from list */
122 unsigned int vector_index; /* vector from bio */ 123 struct bvec_iter bvec_iter;
123 unsigned int vector_offset; /* bytes from vector */
124 }; 124 };
125#endif /* CONFIG_BLOCK */ 125#endif /* CONFIG_BLOCK */
126 struct { /* pages */ 126 struct { /* pages */
@@ -154,10 +154,9 @@ struct ceph_msg {
154 struct list_head list_head; /* links for connection lists */ 154 struct list_head list_head; /* links for connection lists */
155 155
156 struct kref kref; 156 struct kref kref;
157 bool front_is_vmalloc;
158 bool more_to_follow; 157 bool more_to_follow;
159 bool needs_out_seq; 158 bool needs_out_seq;
160 int front_max; 159 int front_alloc_len;
161 unsigned long ack_stamp; /* tx: when we were acked */ 160 unsigned long ack_stamp; /* tx: when we were acked */
162 161
163 struct ceph_msgpool *pool; 162 struct ceph_msgpool *pool;
@@ -192,7 +191,7 @@ struct ceph_connection {
192 191
193 struct ceph_entity_name peer_name; /* peer name */ 192 struct ceph_entity_name peer_name; /* peer name */
194 193
195 unsigned peer_features; 194 u64 peer_features;
196 u32 connect_seq; /* identify the most recent connection 195 u32 connect_seq; /* identify the most recent connection
197 attempt for this connection, client */ 196 attempt for this connection, client */
198 u32 peer_global_seq; /* peer's global seq for this connection */ 197 u32 peer_global_seq; /* peer's global seq for this connection */
@@ -256,8 +255,8 @@ extern void ceph_msgr_flush(void);
256 255
257extern void ceph_messenger_init(struct ceph_messenger *msgr, 256extern void ceph_messenger_init(struct ceph_messenger *msgr,
258 struct ceph_entity_addr *myaddr, 257 struct ceph_entity_addr *myaddr,
259 u32 supported_features, 258 u64 supported_features,
260 u32 required_features, 259 u64 required_features,
261 bool nocrc); 260 bool nocrc);
262 261
263extern void ceph_con_init(struct ceph_connection *con, void *private, 262extern void ceph_con_init(struct ceph_connection *con, void *private,
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 8f47625a0661..fd47e872ebcc 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -12,12 +12,6 @@
12#include <linux/ceph/auth.h> 12#include <linux/ceph/auth.h>
13#include <linux/ceph/pagelist.h> 13#include <linux/ceph/pagelist.h>
14 14
15/*
16 * Maximum object name size
17 * (must be at least as big as RBD_MAX_MD_NAME_LEN -- currently 100)
18 */
19#define MAX_OBJ_NAME_SIZE 100
20
21struct ceph_msg; 15struct ceph_msg;
22struct ceph_snap_context; 16struct ceph_snap_context;
23struct ceph_osd_request; 17struct ceph_osd_request;
@@ -138,6 +132,7 @@ struct ceph_osd_request {
138 __le64 *r_request_pool; 132 __le64 *r_request_pool;
139 void *r_request_pgid; 133 void *r_request_pgid;
140 __le32 *r_request_attempts; 134 __le32 *r_request_attempts;
135 bool r_paused;
141 struct ceph_eversion *r_request_reassert_version; 136 struct ceph_eversion *r_request_reassert_version;
142 137
143 int r_result; 138 int r_result;
@@ -158,15 +153,21 @@ struct ceph_osd_request {
158 struct inode *r_inode; /* for use by callbacks */ 153 struct inode *r_inode; /* for use by callbacks */
159 void *r_priv; /* ditto */ 154 void *r_priv; /* ditto */
160 155
161 char r_oid[MAX_OBJ_NAME_SIZE]; /* object name */ 156 struct ceph_object_locator r_base_oloc;
162 int r_oid_len; 157 struct ceph_object_id r_base_oid;
158 struct ceph_object_locator r_target_oloc;
159 struct ceph_object_id r_target_oid;
160
163 u64 r_snapid; 161 u64 r_snapid;
164 unsigned long r_stamp; /* send OR check time */ 162 unsigned long r_stamp; /* send OR check time */
165 163
166 struct ceph_file_layout r_file_layout;
167 struct ceph_snap_context *r_snapc; /* snap context for writes */ 164 struct ceph_snap_context *r_snapc; /* snap context for writes */
168}; 165};
169 166
167struct ceph_request_redirect {
168 struct ceph_object_locator oloc;
169};
170
170struct ceph_osd_event { 171struct ceph_osd_event {
171 u64 cookie; 172 u64 cookie;
172 int one_shot; 173 int one_shot;
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h
index d05cc4451af6..49ff69f0746b 100644
--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -35,13 +35,26 @@ struct ceph_pg_pool_info {
35 u8 object_hash; 35 u8 object_hash;
36 u32 pg_num, pgp_num; 36 u32 pg_num, pgp_num;
37 int pg_num_mask, pgp_num_mask; 37 int pg_num_mask, pgp_num_mask;
38 s64 read_tier;
39 s64 write_tier; /* wins for read+write ops */
38 u64 flags; 40 u64 flags;
39 char *name; 41 char *name;
40}; 42};
41 43
42struct ceph_object_locator { 44struct ceph_object_locator {
43 uint64_t pool; 45 s64 pool;
44 char *key; 46};
47
48/*
49 * Maximum supported by kernel client object name length
50 *
51 * (probably outdated: must be >= RBD_MAX_MD_NAME_LEN -- currently 100)
52 */
53#define CEPH_MAX_OID_NAME_LEN 100
54
55struct ceph_object_id {
56 char name[CEPH_MAX_OID_NAME_LEN];
57 int name_len;
45}; 58};
46 59
47struct ceph_pg_mapping { 60struct ceph_pg_mapping {
@@ -73,33 +86,30 @@ struct ceph_osdmap {
73 struct crush_map *crush; 86 struct crush_map *crush;
74}; 87};
75 88
76/* 89static inline void ceph_oid_set_name(struct ceph_object_id *oid,
77 * file layout helpers 90 const char *name)
78 */
79#define ceph_file_layout_su(l) ((__s32)le32_to_cpu((l).fl_stripe_unit))
80#define ceph_file_layout_stripe_count(l) \
81 ((__s32)le32_to_cpu((l).fl_stripe_count))
82#define ceph_file_layout_object_size(l) ((__s32)le32_to_cpu((l).fl_object_size))
83#define ceph_file_layout_cas_hash(l) ((__s32)le32_to_cpu((l).fl_cas_hash))
84#define ceph_file_layout_object_su(l) \
85 ((__s32)le32_to_cpu((l).fl_object_stripe_unit))
86#define ceph_file_layout_pg_pool(l) \
87 ((__s32)le32_to_cpu((l).fl_pg_pool))
88
89static inline unsigned ceph_file_layout_stripe_width(struct ceph_file_layout *l)
90{ 91{
91 return le32_to_cpu(l->fl_stripe_unit) * 92 int len;
92 le32_to_cpu(l->fl_stripe_count); 93
94 len = strlen(name);
95 if (len > sizeof(oid->name)) {
96 WARN(1, "ceph_oid_set_name '%s' len %d vs %zu, truncating\n",
97 name, len, sizeof(oid->name));
98 len = sizeof(oid->name);
99 }
100
101 memcpy(oid->name, name, len);
102 oid->name_len = len;
93} 103}
94 104
95/* "period" == bytes before i start on a new set of objects */ 105static inline void ceph_oid_copy(struct ceph_object_id *dest,
96static inline unsigned ceph_file_layout_period(struct ceph_file_layout *l) 106 struct ceph_object_id *src)
97{ 107{
98 return le32_to_cpu(l->fl_object_size) * 108 BUG_ON(src->name_len > sizeof(dest->name));
99 le32_to_cpu(l->fl_stripe_count); 109 memcpy(dest->name, src->name, src->name_len);
110 dest->name_len = src->name_len;
100} 111}
101 112
102
103static inline int ceph_osd_is_up(struct ceph_osdmap *map, int osd) 113static inline int ceph_osd_is_up(struct ceph_osdmap *map, int osd)
104{ 114{
105 return (osd < map->max_osd) && (map->osd_state[osd] & CEPH_OSD_UP); 115 return (osd < map->max_osd) && (map->osd_state[osd] & CEPH_OSD_UP);
@@ -155,14 +165,20 @@ extern int ceph_calc_file_object_mapping(struct ceph_file_layout *layout,
155 u64 *bno, u64 *oxoff, u64 *oxlen); 165 u64 *bno, u64 *oxoff, u64 *oxlen);
156 166
157/* calculate mapping of object to a placement group */ 167/* calculate mapping of object to a placement group */
158extern int ceph_calc_ceph_pg(struct ceph_pg *pg, const char *oid, 168extern int ceph_oloc_oid_to_pg(struct ceph_osdmap *osdmap,
159 struct ceph_osdmap *osdmap, uint64_t pool); 169 struct ceph_object_locator *oloc,
170 struct ceph_object_id *oid,
171 struct ceph_pg *pg_out);
172
160extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap, 173extern int ceph_calc_pg_acting(struct ceph_osdmap *osdmap,
161 struct ceph_pg pgid, 174 struct ceph_pg pgid,
162 int *acting); 175 int *acting);
163extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap, 176extern int ceph_calc_pg_primary(struct ceph_osdmap *osdmap,
164 struct ceph_pg pgid); 177 struct ceph_pg pgid);
165 178
179extern struct ceph_pg_pool_info *ceph_pg_pool_by_id(struct ceph_osdmap *map,
180 u64 id);
181
166extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id); 182extern const char *ceph_pg_pool_name_by_id(struct ceph_osdmap *map, u64 id);
167extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name); 183extern int ceph_pg_poolid_by_name(struct ceph_osdmap *map, const char *name);
168 184
diff --git a/include/linux/ceph/rados.h b/include/linux/ceph/rados.h
index 68c96a508ac2..96292df4041b 100644
--- a/include/linux/ceph/rados.h
+++ b/include/linux/ceph/rados.h
@@ -344,6 +344,10 @@ enum {
344 CEPH_OSD_FLAG_EXEC_PUBLIC = 0x1000, /* DEPRECATED op may exec (public) */ 344 CEPH_OSD_FLAG_EXEC_PUBLIC = 0x1000, /* DEPRECATED op may exec (public) */
345 CEPH_OSD_FLAG_LOCALIZE_READS = 0x2000, /* read from nearby replica, if any */ 345 CEPH_OSD_FLAG_LOCALIZE_READS = 0x2000, /* read from nearby replica, if any */
346 CEPH_OSD_FLAG_RWORDERED = 0x4000, /* order wrt concurrent reads */ 346 CEPH_OSD_FLAG_RWORDERED = 0x4000, /* order wrt concurrent reads */
347 CEPH_OSD_FLAG_IGNORE_CACHE = 0x8000, /* ignore cache logic */
348 CEPH_OSD_FLAG_SKIPRWLOCKS = 0x10000, /* skip rw locks */
349 CEPH_OSD_FLAG_IGNORE_OVERLAY = 0x20000, /* ignore pool overlay */
350 CEPH_OSD_FLAG_FLUSH = 0x40000, /* this is part of flush */
347}; 351};
348 352
349enum { 353enum {
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 39c1d9469677..5c097596104b 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -21,6 +21,7 @@
21#include <linux/xattr.h> 21#include <linux/xattr.h>
22#include <linux/fs.h> 22#include <linux/fs.h>
23#include <linux/percpu-refcount.h> 23#include <linux/percpu-refcount.h>
24#include <linux/seq_file.h>
24 25
25#ifdef CONFIG_CGROUPS 26#ifdef CONFIG_CGROUPS
26 27
@@ -28,8 +29,6 @@ struct cgroupfs_root;
28struct cgroup_subsys; 29struct cgroup_subsys;
29struct inode; 30struct inode;
30struct cgroup; 31struct cgroup;
31struct css_id;
32struct eventfd_ctx;
33 32
34extern int cgroup_init_early(void); 33extern int cgroup_init_early(void);
35extern int cgroup_init(void); 34extern int cgroup_init(void);
@@ -79,8 +78,6 @@ struct cgroup_subsys_state {
79 struct cgroup_subsys_state *parent; 78 struct cgroup_subsys_state *parent;
80 79
81 unsigned long flags; 80 unsigned long flags;
82 /* ID for this css, if possible */
83 struct css_id __rcu *id;
84 81
85 /* percpu_ref killing and RCU release */ 82 /* percpu_ref killing and RCU release */
86 struct rcu_head rcu_head; 83 struct rcu_head rcu_head;
@@ -239,10 +236,6 @@ struct cgroup {
239 struct rcu_head rcu_head; 236 struct rcu_head rcu_head;
240 struct work_struct destroy_work; 237 struct work_struct destroy_work;
241 238
242 /* List of events which userspace want to receive */
243 struct list_head event_list;
244 spinlock_t event_list_lock;
245
246 /* directory xattrs */ 239 /* directory xattrs */
247 struct simple_xattrs xattrs; 240 struct simple_xattrs xattrs;
248}; 241};
@@ -280,6 +273,9 @@ enum {
280 * - "tasks" is removed. Everything should be at process 273 * - "tasks" is removed. Everything should be at process
281 * granularity. Use "cgroup.procs" instead. 274 * granularity. Use "cgroup.procs" instead.
282 * 275 *
276 * - "cgroup.procs" is not sorted. pids will be unique unless they
277 * got recycled inbetween reads.
278 *
283 * - "release_agent" and "notify_on_release" are removed. 279 * - "release_agent" and "notify_on_release" are removed.
284 * Replacement notification mechanism will be implemented. 280 * Replacement notification mechanism will be implemented.
285 * 281 *
@@ -320,9 +316,6 @@ struct cgroupfs_root {
320 /* Unique id for this hierarchy. */ 316 /* Unique id for this hierarchy. */
321 int hierarchy_id; 317 int hierarchy_id;
322 318
323 /* A list running through the attached subsystems */
324 struct list_head subsys_list;
325
326 /* The root cgroup for this hierarchy */ 319 /* The root cgroup for this hierarchy */
327 struct cgroup top_cgroup; 320 struct cgroup top_cgroup;
328 321
@@ -389,16 +382,6 @@ struct css_set {
389}; 382};
390 383
391/* 384/*
392 * cgroup_map_cb is an abstract callback API for reporting map-valued
393 * control files
394 */
395
396struct cgroup_map_cb {
397 int (*fill)(struct cgroup_map_cb *cb, const char *key, u64 value);
398 void *state;
399};
400
401/*
402 * struct cftype: handler definitions for cgroup control files 385 * struct cftype: handler definitions for cgroup control files
403 * 386 *
404 * When reading/writing to a file: 387 * When reading/writing to a file:
@@ -445,10 +428,6 @@ struct cftype {
445 */ 428 */
446 struct cgroup_subsys *ss; 429 struct cgroup_subsys *ss;
447 430
448 int (*open)(struct inode *inode, struct file *file);
449 ssize_t (*read)(struct cgroup_subsys_state *css, struct cftype *cft,
450 struct file *file,
451 char __user *buf, size_t nbytes, loff_t *ppos);
452 /* 431 /*
453 * read_u64() is a shortcut for the common case of returning a 432 * read_u64() is a shortcut for the common case of returning a
454 * single integer. Use it in place of read() 433 * single integer. Use it in place of read()
@@ -458,24 +437,14 @@ struct cftype {
458 * read_s64() is a signed version of read_u64() 437 * read_s64() is a signed version of read_u64()
459 */ 438 */
460 s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft); 439 s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft);
461 /*
462 * read_map() is used for defining a map of key/value
463 * pairs. It should call cb->fill(cb, key, value) for each
464 * entry. The key/value pairs (and their ordering) should not
465 * change between reboots.
466 */
467 int (*read_map)(struct cgroup_subsys_state *css, struct cftype *cft,
468 struct cgroup_map_cb *cb);
469 /*
470 * read_seq_string() is used for outputting a simple sequence
471 * using seqfile.
472 */
473 int (*read_seq_string)(struct cgroup_subsys_state *css,
474 struct cftype *cft, struct seq_file *m);
475 440
476 ssize_t (*write)(struct cgroup_subsys_state *css, struct cftype *cft, 441 /* generic seq_file read interface */
477 struct file *file, 442 int (*seq_show)(struct seq_file *sf, void *v);
478 const char __user *buf, size_t nbytes, loff_t *ppos); 443
444 /* optional ops, implement all or none */
445 void *(*seq_start)(struct seq_file *sf, loff_t *ppos);
446 void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos);
447 void (*seq_stop)(struct seq_file *sf, void *v);
479 448
480 /* 449 /*
481 * write_u64() is a shortcut for the common case of accepting 450 * write_u64() is a shortcut for the common case of accepting
@@ -504,27 +473,6 @@ struct cftype {
504 * kick type for multiplexing. 473 * kick type for multiplexing.
505 */ 474 */
506 int (*trigger)(struct cgroup_subsys_state *css, unsigned int event); 475 int (*trigger)(struct cgroup_subsys_state *css, unsigned int event);
507
508 int (*release)(struct inode *inode, struct file *file);
509
510 /*
511 * register_event() callback will be used to add new userspace
512 * waiter for changes related to the cftype. Implement it if
513 * you want to provide this functionality. Use eventfd_signal()
514 * on eventfd to send notification to userspace.
515 */
516 int (*register_event)(struct cgroup_subsys_state *css,
517 struct cftype *cft, struct eventfd_ctx *eventfd,
518 const char *args);
519 /*
520 * unregister_event() callback will be called when userspace
521 * closes the eventfd or on cgroup removing.
522 * This callback must be implemented, if you want provide
523 * notification functionality.
524 */
525 void (*unregister_event)(struct cgroup_subsys_state *css,
526 struct cftype *cft,
527 struct eventfd_ctx *eventfd);
528}; 476};
529 477
530/* 478/*
@@ -538,6 +486,26 @@ struct cftype_set {
538}; 486};
539 487
540/* 488/*
489 * cgroupfs file entry, pointed to from leaf dentry->d_fsdata. Don't
490 * access directly.
491 */
492struct cfent {
493 struct list_head node;
494 struct dentry *dentry;
495 struct cftype *type;
496 struct cgroup_subsys_state *css;
497
498 /* file xattrs */
499 struct simple_xattrs xattrs;
500};
501
502/* seq_file->private points to the following, only ->priv is public */
503struct cgroup_open_file {
504 struct cfent *cfe;
505 void *priv;
506};
507
508/*
541 * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This 509 * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This
542 * function can be called as long as @cgrp is accessible. 510 * function can be called as long as @cgrp is accessible.
543 */ 511 */
@@ -552,6 +520,18 @@ static inline const char *cgroup_name(const struct cgroup *cgrp)
552 return rcu_dereference(cgrp->name)->name; 520 return rcu_dereference(cgrp->name)->name;
553} 521}
554 522
523static inline struct cgroup_subsys_state *seq_css(struct seq_file *seq)
524{
525 struct cgroup_open_file *of = seq->private;
526 return of->cfe->css;
527}
528
529static inline struct cftype *seq_cft(struct seq_file *seq)
530{
531 struct cgroup_open_file *of = seq->private;
532 return of->cfe->type;
533}
534
555int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); 535int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
556int cgroup_rm_cftypes(struct cftype *cfts); 536int cgroup_rm_cftypes(struct cftype *cfts);
557 537
@@ -631,12 +611,8 @@ struct cgroup_subsys {
631#define MAX_CGROUP_TYPE_NAMELEN 32 611#define MAX_CGROUP_TYPE_NAMELEN 32
632 const char *name; 612 const char *name;
633 613
634 /* 614 /* link to parent, protected by cgroup_lock() */
635 * Link to parent, and list entry in parent's children.
636 * Protected by cgroup_lock()
637 */
638 struct cgroupfs_root *root; 615 struct cgroupfs_root *root;
639 struct list_head sibling;
640 616
641 /* list of cftype_sets */ 617 /* list of cftype_sets */
642 struct list_head cftsets; 618 struct list_head cftsets;
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h
index b613ffd402d1..7b99d717411d 100644
--- a/include/linux/cgroup_subsys.h
+++ b/include/linux/cgroup_subsys.h
@@ -31,7 +31,7 @@ SUBSYS(devices)
31SUBSYS(freezer) 31SUBSYS(freezer)
32#endif 32#endif
33 33
34#if IS_SUBSYS_ENABLED(CONFIG_NET_CLS_CGROUP) 34#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_NET_CLASSID)
35SUBSYS(net_cls) 35SUBSYS(net_cls)
36#endif 36#endif
37 37
@@ -43,7 +43,7 @@ SUBSYS(blkio)
43SUBSYS(perf) 43SUBSYS(perf)
44#endif 44#endif
45 45
46#if IS_SUBSYS_ENABLED(CONFIG_NETPRIO_CGROUP) 46#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_NET_PRIO)
47SUBSYS(net_prio) 47SUBSYS(net_prio)
48#endif 48#endif
49 49
diff --git a/include/linux/clk-private.h b/include/linux/clk-private.h
index 8138c94409f3..efbf70b9fd84 100644
--- a/include/linux/clk-private.h
+++ b/include/linux/clk-private.h
@@ -12,6 +12,7 @@
12#define __LINUX_CLK_PRIVATE_H 12#define __LINUX_CLK_PRIVATE_H
13 13
14#include <linux/clk-provider.h> 14#include <linux/clk-provider.h>
15#include <linux/kref.h>
15#include <linux/list.h> 16#include <linux/list.h>
16 17
17/* 18/*
@@ -25,10 +26,13 @@
25 26
26#ifdef CONFIG_COMMON_CLK 27#ifdef CONFIG_COMMON_CLK
27 28
29struct module;
30
28struct clk { 31struct clk {
29 const char *name; 32 const char *name;
30 const struct clk_ops *ops; 33 const struct clk_ops *ops;
31 struct clk_hw *hw; 34 struct clk_hw *hw;
35 struct module *owner;
32 struct clk *parent; 36 struct clk *parent;
33 const char **parent_names; 37 const char **parent_names;
34 struct clk **parents; 38 struct clk **parents;
@@ -41,12 +45,14 @@ struct clk {
41 unsigned long flags; 45 unsigned long flags;
42 unsigned int enable_count; 46 unsigned int enable_count;
43 unsigned int prepare_count; 47 unsigned int prepare_count;
48 unsigned long accuracy;
44 struct hlist_head children; 49 struct hlist_head children;
45 struct hlist_node child_node; 50 struct hlist_node child_node;
46 unsigned int notifier_count; 51 unsigned int notifier_count;
47#ifdef CONFIG_COMMON_CLK_DEBUG 52#ifdef CONFIG_DEBUG_FS
48 struct dentry *dentry; 53 struct dentry *dentry;
49#endif 54#endif
55 struct kref ref;
50}; 56};
51 57
52/* 58/*
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 7e59253b8603..939533da93a7 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -29,6 +29,7 @@
29#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() */
30#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 */ 31#define CLK_SET_RATE_NO_REPARENT BIT(7) /* don't re-parent on rate change */
32#define CLK_GET_ACCURACY_NOCACHE BIT(8) /* do not use the cached clk accuracy */
32 33
33struct clk_hw; 34struct clk_hw;
34 35
@@ -108,6 +109,25 @@ struct clk_hw;
108 * which is likely helpful for most .set_rate implementation. 109 * which is likely helpful for most .set_rate implementation.
109 * Returns 0 on success, -EERROR otherwise. 110 * Returns 0 on success, -EERROR otherwise.
110 * 111 *
112 * @recalc_accuracy: Recalculate the accuracy of this clock. The clock accuracy
113 * is expressed in ppb (parts per billion). The parent accuracy is
114 * an input parameter.
115 * Returns the calculated accuracy. Optional - if this op is not
116 * set then clock accuracy will be initialized to parent accuracy
117 * or 0 (perfect clock) if clock has no parent.
118 *
119 * @set_rate_and_parent: Change the rate and the parent of this clock. The
120 * requested rate is specified by the second argument, which
121 * should typically be the return of .round_rate call. The
122 * third argument gives the parent rate which is likely helpful
123 * for most .set_rate_and_parent implementation. The fourth
124 * argument gives the parent index. This callback is optional (and
125 * unnecessary) for clocks with 0 or 1 parents as well as
126 * for clocks that can tolerate switching the rate and the parent
127 * separately via calls to .set_parent and .set_rate.
128 * Returns 0 on success, -EERROR otherwise.
129 *
130 *
111 * The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow 131 * The clk_enable/clk_disable and clk_prepare/clk_unprepare pairs allow
112 * implementations to split any work between atomic (enable) and sleepable 132 * implementations to split any work between atomic (enable) and sleepable
113 * (prepare) contexts. If enabling a clock requires code that might sleep, 133 * (prepare) contexts. If enabling a clock requires code that might sleep,
@@ -139,6 +159,11 @@ struct clk_ops {
139 u8 (*get_parent)(struct clk_hw *hw); 159 u8 (*get_parent)(struct clk_hw *hw);
140 int (*set_rate)(struct clk_hw *hw, unsigned long, 160 int (*set_rate)(struct clk_hw *hw, unsigned long,
141 unsigned long); 161 unsigned long);
162 int (*set_rate_and_parent)(struct clk_hw *hw,
163 unsigned long rate,
164 unsigned long parent_rate, u8 index);
165 unsigned long (*recalc_accuracy)(struct clk_hw *hw,
166 unsigned long parent_accuracy);
142 void (*init)(struct clk_hw *hw); 167 void (*init)(struct clk_hw *hw);
143}; 168};
144 169
@@ -194,6 +219,7 @@ struct clk_hw {
194struct clk_fixed_rate { 219struct clk_fixed_rate {
195 struct clk_hw hw; 220 struct clk_hw hw;
196 unsigned long fixed_rate; 221 unsigned long fixed_rate;
222 unsigned long fixed_accuracy;
197 u8 flags; 223 u8 flags;
198}; 224};
199 225
@@ -201,6 +227,9 @@ extern const struct clk_ops clk_fixed_rate_ops;
201struct clk *clk_register_fixed_rate(struct device *dev, const char *name, 227struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
202 const char *parent_name, unsigned long flags, 228 const char *parent_name, unsigned long flags,
203 unsigned long fixed_rate); 229 unsigned long fixed_rate);
230struct clk *clk_register_fixed_rate_with_accuracy(struct device *dev,
231 const char *name, const char *parent_name, unsigned long flags,
232 unsigned long fixed_rate, unsigned long fixed_accuracy);
204 233
205void of_fixed_clk_setup(struct device_node *np); 234void of_fixed_clk_setup(struct device_node *np);
206 235
@@ -433,6 +462,7 @@ struct clk *clk_get_parent_by_index(struct clk *clk, u8 index);
433unsigned int __clk_get_enable_count(struct clk *clk); 462unsigned int __clk_get_enable_count(struct clk *clk);
434unsigned int __clk_get_prepare_count(struct clk *clk); 463unsigned int __clk_get_prepare_count(struct clk *clk);
435unsigned long __clk_get_rate(struct clk *clk); 464unsigned long __clk_get_rate(struct clk *clk);
465unsigned long __clk_get_accuracy(struct clk *clk);
436unsigned long __clk_get_flags(struct clk *clk); 466unsigned long __clk_get_flags(struct clk *clk);
437bool __clk_is_prepared(struct clk *clk); 467bool __clk_is_prepared(struct clk *clk);
438bool __clk_is_enabled(struct clk *clk); 468bool __clk_is_enabled(struct clk *clk);
@@ -458,6 +488,8 @@ struct clk_onecell_data {
458 unsigned int clk_num; 488 unsigned int clk_num;
459}; 489};
460 490
491extern struct of_device_id __clk_of_table;
492
461#define CLK_OF_DECLARE(name, compat, fn) \ 493#define CLK_OF_DECLARE(name, compat, fn) \
462 static const struct of_device_id __clk_of_table_##name \ 494 static const struct of_device_id __clk_of_table_##name \
463 __used __section(__clk_of_table) \ 495 __used __section(__clk_of_table) \
@@ -512,6 +544,20 @@ static inline const char *of_clk_get_parent_name(struct device_node *np,
512 * for improved portability across platforms 544 * for improved portability across platforms
513 */ 545 */
514 546
547#if IS_ENABLED(CONFIG_PPC)
548
549static inline u32 clk_readl(u32 __iomem *reg)
550{
551 return ioread32be(reg);
552}
553
554static inline void clk_writel(u32 val, u32 __iomem *reg)
555{
556 iowrite32be(val, reg);
557}
558
559#else /* platform dependent I/O accessors */
560
515static inline u32 clk_readl(u32 __iomem *reg) 561static inline u32 clk_readl(u32 __iomem *reg)
516{ 562{
517 return readl(reg); 563 return readl(reg);
@@ -522,5 +568,7 @@ static inline void clk_writel(u32 val, u32 __iomem *reg)
522 writel(val, reg); 568 writel(val, reg);
523} 569}
524 570
571#endif /* platform dependent I/O accessors */
572
525#endif /* CONFIG_COMMON_CLK */ 573#endif /* CONFIG_COMMON_CLK */
526#endif /* CLK_PROVIDER_H */ 574#endif /* CLK_PROVIDER_H */
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 9a6d04524b1a..0dd91148165e 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -82,6 +82,23 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb);
82 82
83int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb); 83int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb);
84 84
85/**
86 * clk_get_accuracy - obtain the clock accuracy in ppb (parts per billion)
87 * for a clock source.
88 * @clk: clock source
89 *
90 * This gets the clock source accuracy expressed in ppb.
91 * A perfect clock returns 0.
92 */
93long clk_get_accuracy(struct clk *clk);
94
95#else
96
97static inline long clk_get_accuracy(struct clk *clk)
98{
99 return -ENOTSUPP;
100}
101
85#endif 102#endif
86 103
87/** 104/**
diff --git a/include/linux/clk/at91_pmc.h b/include/linux/clk/at91_pmc.h
new file mode 100644
index 000000000000..a6911ebbd02a
--- /dev/null
+++ b/include/linux/clk/at91_pmc.h
@@ -0,0 +1,192 @@
1/*
2 * include/linux/clk/at91_pmc.h
3 *
4 * Copyright (C) 2005 Ivan Kokshaysky
5 * Copyright (C) SAN People
6 *
7 * Power Management Controller (PMC) - System peripherals registers.
8 * Based on AT91RM9200 datasheet revision E.
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 AT91_PMC_H
17#define AT91_PMC_H
18
19#ifndef __ASSEMBLY__
20extern void __iomem *at91_pmc_base;
21
22#define at91_pmc_read(field) \
23 __raw_readl(at91_pmc_base + field)
24
25#define at91_pmc_write(field, value) \
26 __raw_writel(value, at91_pmc_base + field)
27#else
28.extern at91_pmc_base
29#endif
30
31#define AT91_PMC_SCER 0x00 /* System Clock Enable Register */
32#define AT91_PMC_SCDR 0x04 /* System Clock Disable Register */
33
34#define AT91_PMC_SCSR 0x08 /* System Clock Status Register */
35#define AT91_PMC_PCK (1 << 0) /* Processor Clock */
36#define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */
37#define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */
38#define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */
39#define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */
40#define AT91SAM926x_PMC_UDP (1 << 7) /* USB Devcice Port Clock [AT91SAM926x only] */
41#define AT91_PMC_PCK0 (1 << 8) /* Programmable Clock 0 */
42#define AT91_PMC_PCK1 (1 << 9) /* Programmable Clock 1 */
43#define AT91_PMC_PCK2 (1 << 10) /* Programmable Clock 2 */
44#define AT91_PMC_PCK3 (1 << 11) /* Programmable Clock 3 */
45#define AT91_PMC_PCK4 (1 << 12) /* Programmable Clock 4 [AT572D940HF only] */
46#define AT91_PMC_HCK0 (1 << 16) /* AHB Clock (USB host) [AT91SAM9261 only] */
47#define AT91_PMC_HCK1 (1 << 17) /* AHB Clock (LCD) [AT91SAM9261 only] */
48
49#define AT91_PMC_PCER 0x10 /* Peripheral Clock Enable Register */
50#define AT91_PMC_PCDR 0x14 /* Peripheral Clock Disable Register */
51#define AT91_PMC_PCSR 0x18 /* Peripheral Clock Status Register */
52
53#define AT91_CKGR_UCKR 0x1C /* UTMI Clock Register [some SAM9] */
54#define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */
55#define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */
56#define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */
57#define AT91_PMC_BIASCOUNT (0xf << 28) /* UTMI BIAS Start-up Time */
58
59#define AT91_CKGR_MOR 0x20 /* Main Oscillator Register [not on SAM9RL] */
60#define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */
61#define AT91_PMC_OSCBYPASS (1 << 1) /* Oscillator Bypass */
62#define AT91_PMC_MOSCRCEN (1 << 3) /* Main On-Chip RC Oscillator Enable [some SAM9] */
63#define AT91_PMC_OSCOUNT (0xff << 8) /* Main Oscillator Start-up Time */
64#define AT91_PMC_KEY (0x37 << 16) /* MOR Writing Key */
65#define AT91_PMC_MOSCSEL (1 << 24) /* Main Oscillator Selection [some SAM9] */
66#define AT91_PMC_CFDEN (1 << 25) /* Clock Failure Detector Enable [some SAM9] */
67
68#define AT91_CKGR_MCFR 0x24 /* Main Clock Frequency Register */
69#define AT91_PMC_MAINF (0xffff << 0) /* Main Clock Frequency */
70#define AT91_PMC_MAINRDY (1 << 16) /* Main Clock Ready */
71
72#define AT91_CKGR_PLLAR 0x28 /* PLL A Register */
73#define AT91_CKGR_PLLBR 0x2c /* PLL B Register */
74#define AT91_PMC_DIV (0xff << 0) /* Divider */
75#define AT91_PMC_PLLCOUNT (0x3f << 8) /* PLL Counter */
76#define AT91_PMC_OUT (3 << 14) /* PLL Clock Frequency Range */
77#define AT91_PMC_MUL (0x7ff << 16) /* PLL Multiplier */
78#define AT91_PMC_MUL_GET(n) ((n) >> 16 & 0x7ff)
79#define AT91_PMC3_MUL (0x7f << 18) /* PLL Multiplier [SAMA5 only] */
80#define AT91_PMC3_MUL_GET(n) ((n) >> 18 & 0x7f)
81#define AT91_PMC_USBDIV (3 << 28) /* USB Divisor (PLLB only) */
82#define AT91_PMC_USBDIV_1 (0 << 28)
83#define AT91_PMC_USBDIV_2 (1 << 28)
84#define AT91_PMC_USBDIV_4 (2 << 28)
85#define AT91_PMC_USB96M (1 << 28) /* Divider by 2 Enable (PLLB only) */
86
87#define AT91_PMC_MCKR 0x30 /* Master Clock Register */
88#define AT91_PMC_CSS (3 << 0) /* Master Clock Selection */
89#define AT91_PMC_CSS_SLOW (0 << 0)
90#define AT91_PMC_CSS_MAIN (1 << 0)
91#define AT91_PMC_CSS_PLLA (2 << 0)
92#define AT91_PMC_CSS_PLLB (3 << 0)
93#define AT91_PMC_CSS_UPLL (3 << 0) /* [some SAM9 only] */
94#define PMC_PRES_OFFSET 2
95#define AT91_PMC_PRES (7 << PMC_PRES_OFFSET) /* Master Clock Prescaler */
96#define AT91_PMC_PRES_1 (0 << PMC_PRES_OFFSET)
97#define AT91_PMC_PRES_2 (1 << PMC_PRES_OFFSET)
98#define AT91_PMC_PRES_4 (2 << PMC_PRES_OFFSET)
99#define AT91_PMC_PRES_8 (3 << PMC_PRES_OFFSET)
100#define AT91_PMC_PRES_16 (4 << PMC_PRES_OFFSET)
101#define AT91_PMC_PRES_32 (5 << PMC_PRES_OFFSET)
102#define AT91_PMC_PRES_64 (6 << PMC_PRES_OFFSET)
103#define PMC_ALT_PRES_OFFSET 4
104#define AT91_PMC_ALT_PRES (7 << PMC_ALT_PRES_OFFSET) /* Master Clock Prescaler [alternate location] */
105#define AT91_PMC_ALT_PRES_1 (0 << PMC_ALT_PRES_OFFSET)
106#define AT91_PMC_ALT_PRES_2 (1 << PMC_ALT_PRES_OFFSET)
107#define AT91_PMC_ALT_PRES_4 (2 << PMC_ALT_PRES_OFFSET)
108#define AT91_PMC_ALT_PRES_8 (3 << PMC_ALT_PRES_OFFSET)
109#define AT91_PMC_ALT_PRES_16 (4 << PMC_ALT_PRES_OFFSET)
110#define AT91_PMC_ALT_PRES_32 (5 << PMC_ALT_PRES_OFFSET)
111#define AT91_PMC_ALT_PRES_64 (6 << PMC_ALT_PRES_OFFSET)
112#define AT91_PMC_MDIV (3 << 8) /* Master Clock Division */
113#define AT91RM9200_PMC_MDIV_1 (0 << 8) /* [AT91RM9200 only] */
114#define AT91RM9200_PMC_MDIV_2 (1 << 8)
115#define AT91RM9200_PMC_MDIV_3 (2 << 8)
116#define AT91RM9200_PMC_MDIV_4 (3 << 8)
117#define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9 only] */
118#define AT91SAM9_PMC_MDIV_2 (1 << 8)
119#define AT91SAM9_PMC_MDIV_4 (2 << 8)
120#define AT91SAM9_PMC_MDIV_6 (3 << 8) /* [some SAM9 only] */
121#define AT91SAM9_PMC_MDIV_3 (3 << 8) /* [some SAM9 only] */
122#define AT91_PMC_PDIV (1 << 12) /* Processor Clock Division [some SAM9 only] */
123#define AT91_PMC_PDIV_1 (0 << 12)
124#define AT91_PMC_PDIV_2 (1 << 12)
125#define AT91_PMC_PLLADIV2 (1 << 12) /* PLLA divisor by 2 [some SAM9 only] */
126#define AT91_PMC_PLLADIV2_OFF (0 << 12)
127#define AT91_PMC_PLLADIV2_ON (1 << 12)
128
129#define AT91_PMC_USB 0x38 /* USB Clock Register [some SAM9 only] */
130#define AT91_PMC_USBS (0x1 << 0) /* USB OHCI Input clock selection */
131#define AT91_PMC_USBS_PLLA (0 << 0)
132#define AT91_PMC_USBS_UPLL (1 << 0)
133#define AT91_PMC_USBS_PLLB (1 << 0) /* [AT91SAMN12 only] */
134#define AT91_PMC_OHCIUSBDIV (0xF << 8) /* Divider for USB OHCI Clock */
135#define AT91_PMC_OHCIUSBDIV_1 (0x0 << 8)
136#define AT91_PMC_OHCIUSBDIV_2 (0x1 << 8)
137
138#define AT91_PMC_SMD 0x3c /* Soft Modem Clock Register [some SAM9 only] */
139#define AT91_PMC_SMDS (0x1 << 0) /* SMD input clock selection */
140#define AT91_PMC_SMD_DIV (0x1f << 8) /* SMD input clock divider */
141#define AT91_PMC_SMDDIV(n) (((n) << 8) & AT91_PMC_SMD_DIV)
142
143#define AT91_PMC_PCKR(n) (0x40 + ((n) * 4)) /* Programmable Clock 0-N Registers */
144#define AT91_PMC_ALT_PCKR_CSS (0x7 << 0) /* Programmable Clock Source Selection [alternate length] */
145#define AT91_PMC_CSS_MASTER (4 << 0) /* [some SAM9 only] */
146#define AT91_PMC_CSSMCK (0x1 << 8) /* CSS or Master Clock Selection */
147#define AT91_PMC_CSSMCK_CSS (0 << 8)
148#define AT91_PMC_CSSMCK_MCK (1 << 8)
149
150#define AT91_PMC_IER 0x60 /* Interrupt Enable Register */
151#define AT91_PMC_IDR 0x64 /* Interrupt Disable Register */
152#define AT91_PMC_SR 0x68 /* Status Register */
153#define AT91_PMC_MOSCS (1 << 0) /* MOSCS Flag */
154#define AT91_PMC_LOCKA (1 << 1) /* PLLA Lock */
155#define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */
156#define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */
157#define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [some SAM9] */
158#define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */
159#define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */
160#define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */
161#define AT91_PMC_PCK3RDY (1 << 11) /* Programmable Clock 3 */
162#define AT91_PMC_MOSCSELS (1 << 16) /* Main Oscillator Selection [some SAM9] */
163#define AT91_PMC_MOSCRCS (1 << 17) /* Main On-Chip RC [some SAM9] */
164#define AT91_PMC_CFDEV (1 << 18) /* Clock Failure Detector Event [some SAM9] */
165#define AT91_PMC_IMR 0x6c /* Interrupt Mask Register */
166
167#define AT91_PMC_PLLICPR 0x80 /* PLL Charge Pump Current Register */
168
169#define AT91_PMC_PROT 0xe4 /* Write Protect Mode Register [some SAM9] */
170#define AT91_PMC_WPEN (0x1 << 0) /* Write Protect Enable */
171#define AT91_PMC_WPKEY (0xffffff << 8) /* Write Protect Key */
172#define AT91_PMC_PROTKEY (0x504d43 << 8) /* Activation Code */
173
174#define AT91_PMC_WPSR 0xe8 /* Write Protect Status Register [some SAM9] */
175#define AT91_PMC_WPVS (0x1 << 0) /* Write Protect Violation Status */
176#define AT91_PMC_WPVSRC (0xffff << 8) /* Write Protect Violation Source */
177
178#define AT91_PMC_PCER1 0x100 /* Peripheral Clock Enable Register 1 [SAMA5 only]*/
179#define AT91_PMC_PCDR1 0x104 /* Peripheral Clock Enable Register 1 */
180#define AT91_PMC_PCSR1 0x108 /* Peripheral Clock Enable Register 1 */
181
182#define AT91_PMC_PCR 0x10c /* Peripheral Control Register [some SAM9 and SAMA5] */
183#define AT91_PMC_PCR_PID (0x3f << 0) /* Peripheral ID */
184#define AT91_PMC_PCR_CMD (0x1 << 12) /* Command (read=0, write=1) */
185#define AT91_PMC_PCR_DIV(n) ((n) << 16) /* Divisor Value */
186#define AT91_PMC_PCR_DIV0 0x0 /* Peripheral clock is MCK */
187#define AT91_PMC_PCR_DIV2 0x1 /* Peripheral clock is MCK/2 */
188#define AT91_PMC_PCR_DIV4 0x2 /* Peripheral clock is MCK/4 */
189#define AT91_PMC_PCR_DIV8 0x3 /* Peripheral clock is MCK/8 */
190#define AT91_PMC_PCR_EN (0x1 << 28) /* Enable */
191
192#endif
diff --git a/include/linux/clk/shmobile.h b/include/linux/clk/shmobile.h
new file mode 100644
index 000000000000..f9bf080a1123
--- /dev/null
+++ b/include/linux/clk/shmobile.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright 2013 Ideas On Board SPRL
3 *
4 * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.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 __LINUX_CLK_SHMOBILE_H_
13#define __LINUX_CLK_SHMOBILE_H_
14
15#include <linux/types.h>
16
17void rcar_gen2_clocks_init(u32 mode);
18
19#endif
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h
index 23a0ceee831f..3ca9fca827a2 100644
--- a/include/linux/clk/tegra.h
+++ b/include/linux/clk/tegra.h
@@ -120,13 +120,6 @@ static inline void tegra_cpu_clock_resume(void)
120} 120}
121#endif 121#endif
122 122
123#ifdef CONFIG_ARCH_TEGRA
124void tegra_periph_reset_deassert(struct clk *c);
125void tegra_periph_reset_assert(struct clk *c);
126#else
127static inline void tegra_periph_reset_deassert(struct clk *c) {}
128static inline void tegra_periph_reset_assert(struct clk *c) {}
129#endif
130void tegra_clocks_apply_init_table(void); 123void tegra_clocks_apply_init_table(void);
131 124
132#endif /* __LINUX_CLK_TEGRA_H_ */ 125#endif /* __LINUX_CLK_TEGRA_H_ */
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
new file mode 100644
index 000000000000..092b64168d7f
--- /dev/null
+++ b/include/linux/clk/ti.h
@@ -0,0 +1,298 @@
1/*
2 * TI clock drivers support
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * 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 __LINUX_CLK_TI_H__
16#define __LINUX_CLK_TI_H__
17
18#include <linux/clkdev.h>
19
20/**
21 * struct dpll_data - DPLL registers and integration data
22 * @mult_div1_reg: register containing the DPLL M and N bitfields
23 * @mult_mask: mask of the DPLL M bitfield in @mult_div1_reg
24 * @div1_mask: mask of the DPLL N bitfield in @mult_div1_reg
25 * @clk_bypass: struct clk pointer to the clock's bypass clock input
26 * @clk_ref: struct clk pointer to the clock's reference clock input
27 * @control_reg: register containing the DPLL mode bitfield
28 * @enable_mask: mask of the DPLL mode bitfield in @control_reg
29 * @last_rounded_rate: cache of the last rate result of omap2_dpll_round_rate()
30 * @last_rounded_m: cache of the last M result of omap2_dpll_round_rate()
31 * @last_rounded_m4xen: cache of the last M4X result of
32 * omap4_dpll_regm4xen_round_rate()
33 * @last_rounded_lpmode: cache of the last lpmode result of
34 * omap4_dpll_lpmode_recalc()
35 * @max_multiplier: maximum valid non-bypass multiplier value (actual)
36 * @last_rounded_n: cache of the last N result of omap2_dpll_round_rate()
37 * @min_divider: minimum valid non-bypass divider value (actual)
38 * @max_divider: maximum valid non-bypass divider value (actual)
39 * @modes: possible values of @enable_mask
40 * @autoidle_reg: register containing the DPLL autoidle mode bitfield
41 * @idlest_reg: register containing the DPLL idle status bitfield
42 * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg
43 * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg
44 * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg
45 * @lpmode_mask: mask of the DPLL low-power mode bitfield in @control_reg
46 * @m4xen_mask: mask of the DPLL M4X multiplier bitfield in @control_reg
47 * @auto_recal_bit: bitshift of the driftguard enable bit in @control_reg
48 * @recal_en_bit: bitshift of the PRM_IRQENABLE_* bit for recalibration IRQs
49 * @recal_st_bit: bitshift of the PRM_IRQSTATUS_* bit for recalibration IRQs
50 * @flags: DPLL type/features (see below)
51 *
52 * Possible values for @flags:
53 * DPLL_J_TYPE: "J-type DPLL" (only some 36xx, 4xxx DPLLs)
54 *
55 * @freqsel_mask is only used on the OMAP34xx family and AM35xx.
56 *
57 * XXX Some DPLLs have multiple bypass inputs, so it's not technically
58 * correct to only have one @clk_bypass pointer.
59 *
60 * XXX The runtime-variable fields (@last_rounded_rate, @last_rounded_m,
61 * @last_rounded_n) should be separated from the runtime-fixed fields
62 * and placed into a different structure, so that the runtime-fixed data
63 * can be placed into read-only space.
64 */
65struct dpll_data {
66 void __iomem *mult_div1_reg;
67 u32 mult_mask;
68 u32 div1_mask;
69 struct clk *clk_bypass;
70 struct clk *clk_ref;
71 void __iomem *control_reg;
72 u32 enable_mask;
73 unsigned long last_rounded_rate;
74 u16 last_rounded_m;
75 u8 last_rounded_m4xen;
76 u8 last_rounded_lpmode;
77 u16 max_multiplier;
78 u8 last_rounded_n;
79 u8 min_divider;
80 u16 max_divider;
81 u8 modes;
82 void __iomem *autoidle_reg;
83 void __iomem *idlest_reg;
84 u32 autoidle_mask;
85 u32 freqsel_mask;
86 u32 idlest_mask;
87 u32 dco_mask;
88 u32 sddiv_mask;
89 u32 lpmode_mask;
90 u32 m4xen_mask;
91 u8 auto_recal_bit;
92 u8 recal_en_bit;
93 u8 recal_st_bit;
94 u8 flags;
95};
96
97struct clk_hw_omap_ops;
98
99/**
100 * struct clk_hw_omap - OMAP struct clk
101 * @node: list_head connecting this clock into the full clock list
102 * @enable_reg: register to write to enable the clock (see @enable_bit)
103 * @enable_bit: bitshift to write to enable/disable the clock (see @enable_reg)
104 * @flags: see "struct clk.flags possibilities" above
105 * @clksel_reg: for clksel clks, register va containing src/divisor select
106 * @clksel_mask: bitmask in @clksel_reg for the src/divisor selector
107 * @clksel: for clksel clks, pointer to struct clksel for this clock
108 * @dpll_data: for DPLLs, pointer to struct dpll_data for this clock
109 * @clkdm_name: clockdomain name that this clock is contained in
110 * @clkdm: pointer to struct clockdomain, resolved from @clkdm_name at runtime
111 * @ops: clock ops for this clock
112 */
113struct clk_hw_omap {
114 struct clk_hw hw;
115 struct list_head node;
116 unsigned long fixed_rate;
117 u8 fixed_div;
118 void __iomem *enable_reg;
119 u8 enable_bit;
120 u8 flags;
121 void __iomem *clksel_reg;
122 u32 clksel_mask;
123 const struct clksel *clksel;
124 struct dpll_data *dpll_data;
125 const char *clkdm_name;
126 struct clockdomain *clkdm;
127 const struct clk_hw_omap_ops *ops;
128};
129
130/*
131 * struct clk_hw_omap.flags possibilities
132 *
133 * XXX document the rest of the clock flags here
134 *
135 * ENABLE_REG_32BIT: (OMAP1 only) clock control register must be accessed
136 * with 32bit ops, by default OMAP1 uses 16bit ops.
137 * CLOCK_IDLE_CONTROL: (OMAP1 only) clock has autoidle support.
138 * CLOCK_NO_IDLE_PARENT: (OMAP1 only) when clock is enabled, its parent
139 * clock is put to no-idle mode.
140 * ENABLE_ON_INIT: Clock is enabled on init.
141 * INVERT_ENABLE: By default, clock enable bit behavior is '1' enable, '0'
142 * disable. This inverts the behavior making '0' enable and '1' disable.
143 * CLOCK_CLKOUTX2: (OMAP4 only) DPLL CLKOUT and CLKOUTX2 GATE_CTRL
144 * bits share the same register. This flag allows the
145 * omap4_dpllmx*() code to determine which GATE_CTRL bit field
146 * should be used. This is a temporary solution - a better approach
147 * would be to associate clock type-specific data with the clock,
148 * similar to the struct dpll_data approach.
149 * MEMMAP_ADDRESSING: Use memmap addressing to access clock registers.
150 */
151#define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */
152#define CLOCK_IDLE_CONTROL (1 << 1)
153#define CLOCK_NO_IDLE_PARENT (1 << 2)
154#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */
155#define INVERT_ENABLE (1 << 4) /* 0 enables, 1 disables */
156#define CLOCK_CLKOUTX2 (1 << 5)
157#define MEMMAP_ADDRESSING (1 << 6)
158
159/* CM_CLKEN_PLL*.EN* bit values - not all are available for every DPLL */
160#define DPLL_LOW_POWER_STOP 0x1
161#define DPLL_LOW_POWER_BYPASS 0x5
162#define DPLL_LOCKED 0x7
163
164/* DPLL Type and DCO Selection Flags */
165#define DPLL_J_TYPE 0x1
166
167/* Composite clock component types */
168enum {
169 CLK_COMPONENT_TYPE_GATE = 0,
170 CLK_COMPONENT_TYPE_DIVIDER,
171 CLK_COMPONENT_TYPE_MUX,
172 CLK_COMPONENT_TYPE_MAX,
173};
174
175/**
176 * struct ti_dt_clk - OMAP DT clock alias declarations
177 * @lk: clock lookup definition
178 * @node_name: clock DT node to map to
179 */
180struct ti_dt_clk {
181 struct clk_lookup lk;
182 char *node_name;
183};
184
185#define DT_CLK(dev, con, name) \
186 { \
187 .lk = { \
188 .dev_id = dev, \
189 .con_id = con, \
190 }, \
191 .node_name = name, \
192 }
193
194/* Maximum number of clock memmaps */
195#define CLK_MAX_MEMMAPS 4
196
197typedef void (*ti_of_clk_init_cb_t)(struct clk_hw *, struct device_node *);
198
199/**
200 * struct clk_omap_reg - OMAP register declaration
201 * @offset: offset from the master IP module base address
202 * @index: index of the master IP module
203 */
204struct clk_omap_reg {
205 u16 offset;
206 u16 index;
207};
208
209/**
210 * struct ti_clk_ll_ops - low-level register access ops for a clock
211 * @clk_readl: pointer to register read function
212 * @clk_writel: pointer to register write function
213 *
214 * Low-level register access ops are generally used by the basic clock types
215 * (clk-gate, clk-mux, clk-divider etc.) to provide support for various
216 * low-level hardware interfaces (direct MMIO, regmap etc.), but can also be
217 * used by other hardware-specific clock drivers if needed.
218 */
219struct ti_clk_ll_ops {
220 u32 (*clk_readl)(void __iomem *reg);
221 void (*clk_writel)(u32 val, void __iomem *reg);
222};
223
224extern struct ti_clk_ll_ops *ti_clk_ll_ops;
225
226extern const struct clk_ops ti_clk_divider_ops;
227extern const struct clk_ops ti_clk_mux_ops;
228
229#define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw)
230
231void omap2_init_clk_hw_omap_clocks(struct clk *clk);
232int omap3_noncore_dpll_enable(struct clk_hw *hw);
233void omap3_noncore_dpll_disable(struct clk_hw *hw);
234int omap3_noncore_dpll_set_rate(struct clk_hw *hw, unsigned long rate,
235 unsigned long parent_rate);
236unsigned long omap4_dpll_regm4xen_recalc(struct clk_hw *hw,
237 unsigned long parent_rate);
238long omap4_dpll_regm4xen_round_rate(struct clk_hw *hw,
239 unsigned long target_rate,
240 unsigned long *parent_rate);
241u8 omap2_init_dpll_parent(struct clk_hw *hw);
242unsigned long omap3_dpll_recalc(struct clk_hw *hw, unsigned long parent_rate);
243long omap2_dpll_round_rate(struct clk_hw *hw, unsigned long target_rate,
244 unsigned long *parent_rate);
245void omap2_init_clk_clkdm(struct clk_hw *clk);
246unsigned long omap3_clkoutx2_recalc(struct clk_hw *hw,
247 unsigned long parent_rate);
248int omap2_clkops_enable_clkdm(struct clk_hw *hw);
249void omap2_clkops_disable_clkdm(struct clk_hw *hw);
250int omap2_clk_disable_autoidle_all(void);
251void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks);
252int omap3_dpll4_set_rate(struct clk_hw *clk, unsigned long rate,
253 unsigned long parent_rate);
254int omap2_dflt_clk_enable(struct clk_hw *hw);
255void omap2_dflt_clk_disable(struct clk_hw *hw);
256int omap2_dflt_clk_is_enabled(struct clk_hw *hw);
257void omap3_clk_lock_dpll5(void);
258
259void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index);
260void ti_dt_clocks_register(struct ti_dt_clk *oclks);
261void ti_dt_clk_init_provider(struct device_node *np, int index);
262void ti_dt_clockdomains_setup(void);
263int ti_clk_retry_init(struct device_node *node, struct clk_hw *hw,
264 ti_of_clk_init_cb_t func);
265int of_ti_clk_autoidle_setup(struct device_node *node);
266int ti_clk_add_component(struct device_node *node, struct clk_hw *hw, int type);
267
268int omap3430_dt_clk_init(void);
269int omap3630_dt_clk_init(void);
270int am35xx_dt_clk_init(void);
271int ti81xx_dt_clk_init(void);
272int omap4xxx_dt_clk_init(void);
273int omap5xxx_dt_clk_init(void);
274int dra7xx_dt_clk_init(void);
275int am33xx_dt_clk_init(void);
276int am43xx_dt_clk_init(void);
277
278#ifdef CONFIG_OF
279void of_ti_clk_allow_autoidle_all(void);
280void of_ti_clk_deny_autoidle_all(void);
281#else
282static inline void of_ti_clk_allow_autoidle_all(void) { }
283static inline void of_ti_clk_deny_autoidle_all(void) { }
284#endif
285
286extern const struct clk_hw_omap_ops clkhwops_omap3_dpll;
287extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx;
288extern const struct clk_hw_omap_ops clkhwops_wait;
289extern const struct clk_hw_omap_ops clkhwops_omap3430es2_dss_usbhost_wait;
290extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_module_wait;
291extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait;
292extern const struct clk_hw_omap_ops clkhwops_iclk;
293extern const struct clk_hw_omap_ops clkhwops_iclk_wait;
294extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_ssi_wait;
295extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_dss_usbhost_wait;
296extern const struct clk_hw_omap_ops clkhwops_omap3430es2_iclk_hsotgusb_wait;
297
298#endif
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h
index a6a6f603103b..94bad77eeb4a 100644
--- a/include/linux/clkdev.h
+++ b/include/linux/clkdev.h
@@ -43,4 +43,9 @@ int clk_add_alias(const char *, const char *, char *, struct device *);
43int clk_register_clkdev(struct clk *, const char *, const char *, ...); 43int clk_register_clkdev(struct clk *, const char *, const char *, ...);
44int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t); 44int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t);
45 45
46#ifdef CONFIG_COMMON_CLK
47int __clk_get(struct clk *clk);
48void __clk_put(struct clk *clk);
49#endif
50
46#endif 51#endif
diff --git a/include/linux/cmdline-parser.h b/include/linux/cmdline-parser.h
index a0f9280421ec..2e6dce6e5c2a 100644
--- a/include/linux/cmdline-parser.h
+++ b/include/linux/cmdline-parser.h
@@ -37,9 +37,9 @@ int cmdline_parts_parse(struct cmdline_parts **parts, const char *cmdline);
37struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts, 37struct cmdline_parts *cmdline_parts_find(struct cmdline_parts *parts,
38 const char *bdev); 38 const char *bdev);
39 39
40void cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size, 40int cmdline_parts_set(struct cmdline_parts *parts, sector_t disk_size,
41 int slot, 41 int slot,
42 int (*add_part)(int, struct cmdline_subpart *, void *), 42 int (*add_part)(int, struct cmdline_subpart *, void *),
43 void *param); 43 void *param);
44 44
45#endif /* CMDLINEPARSEH */ 45#endif /* CMDLINEPARSEH */
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
index 091d72e70d8a..7e1c76e3cd68 100644
--- a/include/linux/compaction.h
+++ b/include/linux/compaction.h
@@ -62,6 +62,22 @@ static inline bool compaction_deferred(struct zone *zone, int order)
62 return zone->compact_considered < defer_limit; 62 return zone->compact_considered < defer_limit;
63} 63}
64 64
65/*
66 * Update defer tracking counters after successful compaction of given order,
67 * which means an allocation either succeeded (alloc_success == true) or is
68 * expected to succeed.
69 */
70static inline void compaction_defer_reset(struct zone *zone, int order,
71 bool alloc_success)
72{
73 if (alloc_success) {
74 zone->compact_considered = 0;
75 zone->compact_defer_shift = 0;
76 }
77 if (order >= zone->compact_order_failed)
78 zone->compact_order_failed = order + 1;
79}
80
65/* Returns true if restarting compaction after many failures */ 81/* Returns true if restarting compaction after many failures */
66static inline bool compaction_restarting(struct zone *zone, int order) 82static inline bool compaction_restarting(struct zone *zone, int order)
67{ 83{
diff --git a/include/linux/compat.h b/include/linux/compat.h
index eb8a49d75ab3..3f448c65511b 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -327,17 +327,17 @@ asmlinkage long compat_sys_keyctl(u32 option,
327 u32 arg2, u32 arg3, u32 arg4, u32 arg5); 327 u32 arg2, u32 arg3, u32 arg4, u32 arg5);
328asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32); 328asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32);
329 329
330asmlinkage ssize_t compat_sys_readv(unsigned long fd, 330asmlinkage ssize_t compat_sys_readv(compat_ulong_t fd,
331 const struct compat_iovec __user *vec, unsigned long vlen); 331 const struct compat_iovec __user *vec, compat_ulong_t vlen);
332asmlinkage ssize_t compat_sys_writev(unsigned long fd, 332asmlinkage ssize_t compat_sys_writev(compat_ulong_t fd,
333 const struct compat_iovec __user *vec, unsigned long vlen); 333 const struct compat_iovec __user *vec, compat_ulong_t vlen);
334asmlinkage ssize_t compat_sys_preadv(unsigned long fd, 334asmlinkage ssize_t compat_sys_preadv(compat_ulong_t fd,
335 const struct compat_iovec __user *vec, 335 const struct compat_iovec __user *vec,
336 unsigned long vlen, u32 pos_low, u32 pos_high); 336 compat_ulong_t vlen, u32 pos_low, u32 pos_high);
337asmlinkage ssize_t compat_sys_pwritev(unsigned long fd, 337asmlinkage ssize_t compat_sys_pwritev(compat_ulong_t fd,
338 const struct compat_iovec __user *vec, 338 const struct compat_iovec __user *vec,
339 unsigned long vlen, u32 pos_low, u32 pos_high); 339 compat_ulong_t vlen, u32 pos_low, u32 pos_high);
340asmlinkage long comat_sys_lseek(unsigned int, compat_off_t, unsigned int); 340asmlinkage long compat_sys_lseek(unsigned int, compat_off_t, unsigned int);
341 341
342asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, 342asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
343 const compat_uptr_t __user *envp); 343 const compat_uptr_t __user *envp);
@@ -422,7 +422,7 @@ extern long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
422asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid, 422asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
423 compat_long_t addr, compat_long_t data); 423 compat_long_t addr, compat_long_t data);
424 424
425asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, size_t); 425asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, compat_size_t);
426/* 426/*
427 * epoll (fs/eventpoll.c) compat bits follow ... 427 * epoll (fs/eventpoll.c) compat bits follow ...
428 */ 428 */
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 24545cd90a25..02ae99e8e6d3 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -37,6 +37,9 @@
37 __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ 37 __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
38 (typeof(ptr)) (__ptr + (off)); }) 38 (typeof(ptr)) (__ptr + (off)); })
39 39
40/* Make the optimizer believe the variable can be manipulated arbitrarily. */
41#define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var))
42
40#ifdef __CHECKER__ 43#ifdef __CHECKER__
41#define __must_be_array(arr) 0 44#define __must_be_array(arr) 0
42#else 45#else
diff --git a/include/linux/compiler-intel.h b/include/linux/compiler-intel.h
index dc1bd3dcf11f..5529c5239421 100644
--- a/include/linux/compiler-intel.h
+++ b/include/linux/compiler-intel.h
@@ -15,6 +15,7 @@
15 */ 15 */
16#undef barrier 16#undef barrier
17#undef RELOC_HIDE 17#undef RELOC_HIDE
18#undef OPTIMIZER_HIDE_VAR
18 19
19#define barrier() __memory_barrier() 20#define barrier() __memory_barrier()
20 21
@@ -23,6 +24,12 @@
23 __ptr = (unsigned long) (ptr); \ 24 __ptr = (unsigned long) (ptr); \
24 (typeof(ptr)) (__ptr + (off)); }) 25 (typeof(ptr)) (__ptr + (off)); })
25 26
27/* This should act as an optimization barrier on var.
28 * Given that this compiler does not have inline assembly, a compiler barrier
29 * is the best we can do.
30 */
31#define OPTIMIZER_HIDE_VAR(var) barrier()
32
26/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */ 33/* Intel ECC compiler doesn't support __builtin_types_compatible_p() */
27#define __must_be_array(a) 0 34#define __must_be_array(a) 0
28 35
diff --git a/include/linux/compiler.h b/include/linux/compiler.h
index fe7a686dfd8d..2472740d7ab2 100644
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -170,6 +170,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
170 (typeof(ptr)) (__ptr + (off)); }) 170 (typeof(ptr)) (__ptr + (off)); })
171#endif 171#endif
172 172
173#ifndef OPTIMIZER_HIDE_VAR
174#define OPTIMIZER_HIDE_VAR(var) barrier()
175#endif
176
173/* Not-quite-unique ID. */ 177/* Not-quite-unique ID. */
174#ifndef __UNIQUE_ID 178#ifndef __UNIQUE_ID
175# define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__) 179# define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__)
diff --git a/include/linux/component.h b/include/linux/component.h
new file mode 100644
index 000000000000..68870182ca1e
--- /dev/null
+++ b/include/linux/component.h
@@ -0,0 +1,32 @@
1#ifndef COMPONENT_H
2#define COMPONENT_H
3
4struct device;
5
6struct component_ops {
7 int (*bind)(struct device *, struct device *, void *);
8 void (*unbind)(struct device *, struct device *, void *);
9};
10
11int component_add(struct device *, const struct component_ops *);
12void component_del(struct device *, const struct component_ops *);
13
14int component_bind_all(struct device *, void *);
15void component_unbind_all(struct device *, void *);
16
17struct master;
18
19struct component_master_ops {
20 int (*add_components)(struct device *, struct master *);
21 int (*bind)(struct device *);
22 void (*unbind)(struct device *);
23};
24
25int component_master_add(struct device *, const struct component_master_ops *);
26void component_master_del(struct device *,
27 const struct component_master_ops *);
28
29int component_master_add_child(struct master *master,
30 int (*compare)(struct device *, void *), void *compare_data);
31
32#endif
diff --git a/include/linux/container.h b/include/linux/container.h
new file mode 100644
index 000000000000..3c03e6fd2035
--- /dev/null
+++ b/include/linux/container.h
@@ -0,0 +1,25 @@
1/*
2 * Definitions for container bus type.
3 *
4 * Copyright (C) 2013, Intel Corporation
5 * Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#include <linux/device.h>
13
14/* drivers/base/power/container.c */
15extern struct bus_type container_subsys;
16
17struct container_dev {
18 struct device dev;
19 int (*offline)(struct container_dev *cdev);
20};
21
22static inline struct container_dev *to_container_dev(struct device *dev)
23{
24 return container_of(dev, struct container_dev, dev);
25}
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h
index a5d52eea8232..c303d383def1 100644
--- a/include/linux/cpu_cooling.h
+++ b/include/linux/cpu_cooling.h
@@ -24,6 +24,7 @@
24#ifndef __CPU_COOLING_H__ 24#ifndef __CPU_COOLING_H__
25#define __CPU_COOLING_H__ 25#define __CPU_COOLING_H__
26 26
27#include <linux/of.h>
27#include <linux/thermal.h> 28#include <linux/thermal.h>
28#include <linux/cpumask.h> 29#include <linux/cpumask.h>
29 30
@@ -36,6 +37,24 @@ struct thermal_cooling_device *
36cpufreq_cooling_register(const struct cpumask *clip_cpus); 37cpufreq_cooling_register(const struct cpumask *clip_cpus);
37 38
38/** 39/**
40 * of_cpufreq_cooling_register - create cpufreq cooling device based on DT.
41 * @np: a valid struct device_node to the cooling device device tree node.
42 * @clip_cpus: cpumask of cpus where the frequency constraints will happen
43 */
44#ifdef CONFIG_THERMAL_OF
45struct thermal_cooling_device *
46of_cpufreq_cooling_register(struct device_node *np,
47 const struct cpumask *clip_cpus);
48#else
49static inline struct thermal_cooling_device *
50of_cpufreq_cooling_register(struct device_node *np,
51 const struct cpumask *clip_cpus)
52{
53 return NULL;
54}
55#endif
56
57/**
39 * cpufreq_cooling_unregister - function to remove cpufreq cooling device. 58 * cpufreq_cooling_unregister - function to remove cpufreq cooling device.
40 * @cdev: thermal cooling device pointer. 59 * @cdev: thermal cooling device pointer.
41 */ 60 */
@@ -48,6 +67,12 @@ cpufreq_cooling_register(const struct cpumask *clip_cpus)
48{ 67{
49 return NULL; 68 return NULL;
50} 69}
70static inline struct thermal_cooling_device *
71of_cpufreq_cooling_register(struct device_node *np,
72 const struct cpumask *clip_cpus)
73{
74 return NULL;
75}
51static inline 76static inline
52void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) 77void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
53{ 78{
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index dc196bbcf227..4d89e0e6f9cc 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -11,6 +11,7 @@
11#ifndef _LINUX_CPUFREQ_H 11#ifndef _LINUX_CPUFREQ_H
12#define _LINUX_CPUFREQ_H 12#define _LINUX_CPUFREQ_H
13 13
14#include <linux/clk.h>
14#include <linux/cpumask.h> 15#include <linux/cpumask.h>
15#include <linux/completion.h> 16#include <linux/completion.h>
16#include <linux/kobject.h> 17#include <linux/kobject.h>
@@ -66,6 +67,7 @@ struct cpufreq_policy {
66 unsigned int cpu; /* cpu nr of CPU managing this policy */ 67 unsigned int cpu; /* cpu nr of CPU managing this policy */
67 unsigned int last_cpu; /* cpu nr of previous CPU that managed 68 unsigned int last_cpu; /* cpu nr of previous CPU that managed
68 * this policy */ 69 * this policy */
70 struct clk *clk;
69 struct cpufreq_cpuinfo cpuinfo;/* see above */ 71 struct cpufreq_cpuinfo cpuinfo;/* see above */
70 72
71 unsigned int min; /* in kHz */ 73 unsigned int min; /* in kHz */
@@ -225,6 +227,11 @@ struct cpufreq_driver {
225 int (*suspend) (struct cpufreq_policy *policy); 227 int (*suspend) (struct cpufreq_policy *policy);
226 int (*resume) (struct cpufreq_policy *policy); 228 int (*resume) (struct cpufreq_policy *policy);
227 struct freq_attr **attr; 229 struct freq_attr **attr;
230
231 /* platform specific boost support code */
232 bool boost_supported;
233 bool boost_enabled;
234 int (*set_boost) (int state);
228}; 235};
229 236
230/* flags */ 237/* flags */
@@ -252,6 +259,15 @@ struct cpufreq_driver {
252 */ 259 */
253#define CPUFREQ_ASYNC_NOTIFICATION (1 << 4) 260#define CPUFREQ_ASYNC_NOTIFICATION (1 << 4)
254 261
262/*
263 * Set by drivers which want cpufreq core to check if CPU is running at a
264 * frequency present in freq-table exposed by the driver. For these drivers if
265 * CPU is found running at an out of table freq, we will try to set it to a freq
266 * from the table. And if that fails, we will stop further boot process by
267 * issuing a BUG_ON().
268 */
269#define CPUFREQ_NEED_INITIAL_FREQ_CHECK (1 << 5)
270
255int cpufreq_register_driver(struct cpufreq_driver *driver_data); 271int cpufreq_register_driver(struct cpufreq_driver *driver_data);
256int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); 272int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
257 273
@@ -299,6 +315,8 @@ cpufreq_verify_within_cpu_limits(struct cpufreq_policy *policy)
299#define CPUFREQ_NOTIFY (2) 315#define CPUFREQ_NOTIFY (2)
300#define CPUFREQ_START (3) 316#define CPUFREQ_START (3)
301#define CPUFREQ_UPDATE_POLICY_CPU (4) 317#define CPUFREQ_UPDATE_POLICY_CPU (4)
318#define CPUFREQ_CREATE_POLICY (5)
319#define CPUFREQ_REMOVE_POLICY (6)
302 320
303#ifdef CONFIG_CPU_FREQ 321#ifdef CONFIG_CPU_FREQ
304int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); 322int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);
@@ -306,6 +324,8 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
306 324
307void cpufreq_notify_transition(struct cpufreq_policy *policy, 325void cpufreq_notify_transition(struct cpufreq_policy *policy,
308 struct cpufreq_freqs *freqs, unsigned int state); 326 struct cpufreq_freqs *freqs, unsigned int state);
327void cpufreq_notify_post_transition(struct cpufreq_policy *policy,
328 struct cpufreq_freqs *freqs, int transition_failed);
309 329
310#else /* CONFIG_CPU_FREQ */ 330#else /* CONFIG_CPU_FREQ */
311static inline int cpufreq_register_notifier(struct notifier_block *nb, 331static inline int cpufreq_register_notifier(struct notifier_block *nb,
@@ -420,6 +440,7 @@ extern struct cpufreq_governor cpufreq_gov_conservative;
420 440
421#define CPUFREQ_ENTRY_INVALID ~0 441#define CPUFREQ_ENTRY_INVALID ~0
422#define CPUFREQ_TABLE_END ~1 442#define CPUFREQ_TABLE_END ~1
443#define CPUFREQ_BOOST_FREQ ~2
423 444
424struct cpufreq_frequency_table { 445struct cpufreq_frequency_table {
425 unsigned int driver_data; /* driver specific data, not used by core */ 446 unsigned int driver_data; /* driver specific data, not used by core */
@@ -439,10 +460,30 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
439 unsigned int target_freq, 460 unsigned int target_freq,
440 unsigned int relation, 461 unsigned int relation,
441 unsigned int *index); 462 unsigned int *index);
463int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy,
464 unsigned int freq);
442 465
443void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); 466void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy);
444ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf); 467ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
445 468
469#ifdef CONFIG_CPU_FREQ
470int cpufreq_boost_trigger_state(int state);
471int cpufreq_boost_supported(void);
472int cpufreq_boost_enabled(void);
473#else
474static inline int cpufreq_boost_trigger_state(int state)
475{
476 return 0;
477}
478static inline int cpufreq_boost_supported(void)
479{
480 return 0;
481}
482static inline int cpufreq_boost_enabled(void)
483{
484 return 0;
485}
486#endif
446/* the following funtion is for cpufreq core use only */ 487/* the following funtion is for cpufreq core use only */
447struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); 488struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu);
448 489
@@ -455,6 +496,7 @@ void cpufreq_frequency_table_put_attr(unsigned int cpu);
455int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, 496int cpufreq_table_validate_and_show(struct cpufreq_policy *policy,
456 struct cpufreq_frequency_table *table); 497 struct cpufreq_frequency_table *table);
457 498
499unsigned int cpufreq_generic_get(unsigned int cpu);
458int cpufreq_generic_init(struct cpufreq_policy *policy, 500int cpufreq_generic_init(struct cpufreq_policy *policy,
459 struct cpufreq_frequency_table *table, 501 struct cpufreq_frequency_table *table,
460 unsigned int transition_latency); 502 unsigned int transition_latency);
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h
deleted file mode 100644
index 133789609f23..000000000000
--- a/include/linux/cramfs_fs.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef __CRAMFS_H
2#define __CRAMFS_H
3
4#include <uapi/linux/cramfs_fs.h>
5
6/* Uncompression interfaces to the underlying zlib */
7int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen);
8int cramfs_uncompress_init(void);
9void cramfs_uncompress_exit(void);
10#endif
diff --git a/include/linux/cramfs_fs_sb.h b/include/linux/cramfs_fs_sb.h
deleted file mode 100644
index 8390693568fd..000000000000
--- a/include/linux/cramfs_fs_sb.h
+++ /dev/null
@@ -1,20 +0,0 @@
1#ifndef _CRAMFS_FS_SB
2#define _CRAMFS_FS_SB
3
4/*
5 * cramfs super-block data in memory
6 */
7struct cramfs_sb_info {
8 unsigned long magic;
9 unsigned long size;
10 unsigned long blocks;
11 unsigned long files;
12 unsigned long flags;
13};
14
15static inline struct cramfs_sb_info *CRAMFS_SB(struct super_block *sb)
16{
17 return sb->s_fs_info;
18}
19
20#endif
diff --git a/include/linux/crush/crush.h b/include/linux/crush/crush.h
index 6a1101f24cfb..acaa5615d634 100644
--- a/include/linux/crush/crush.h
+++ b/include/linux/crush/crush.h
@@ -19,11 +19,12 @@
19 19
20#define CRUSH_MAGIC 0x00010000ul /* for detecting algorithm revisions */ 20#define CRUSH_MAGIC 0x00010000ul /* for detecting algorithm revisions */
21 21
22
23#define CRUSH_MAX_DEPTH 10 /* max crush hierarchy depth */ 22#define CRUSH_MAX_DEPTH 10 /* max crush hierarchy depth */
24#define CRUSH_MAX_SET 10 /* max size of a mapping result */
25 23
26 24
25#define CRUSH_ITEM_UNDEF 0x7ffffffe /* undefined result (internal use only) */
26#define CRUSH_ITEM_NONE 0x7fffffff /* no result */
27
27/* 28/*
28 * CRUSH uses user-defined "rules" to describe how inputs should be 29 * CRUSH uses user-defined "rules" to describe how inputs should be
29 * mapped to devices. A rule consists of sequence of steps to perform 30 * mapped to devices. A rule consists of sequence of steps to perform
@@ -43,8 +44,13 @@ enum {
43 /* arg2 = type */ 44 /* arg2 = type */
44 CRUSH_RULE_CHOOSE_INDEP = 3, /* same */ 45 CRUSH_RULE_CHOOSE_INDEP = 3, /* same */
45 CRUSH_RULE_EMIT = 4, /* no args */ 46 CRUSH_RULE_EMIT = 4, /* no args */
46 CRUSH_RULE_CHOOSE_LEAF_FIRSTN = 6, 47 CRUSH_RULE_CHOOSELEAF_FIRSTN = 6,
47 CRUSH_RULE_CHOOSE_LEAF_INDEP = 7, 48 CRUSH_RULE_CHOOSELEAF_INDEP = 7,
49
50 CRUSH_RULE_SET_CHOOSE_TRIES = 8, /* override choose_total_tries */
51 CRUSH_RULE_SET_CHOOSELEAF_TRIES = 9, /* override chooseleaf_descend_once */
52 CRUSH_RULE_SET_CHOOSE_LOCAL_TRIES = 10,
53 CRUSH_RULE_SET_CHOOSE_LOCAL_FALLBACK_TRIES = 11,
48}; 54};
49 55
50/* 56/*
@@ -162,7 +168,10 @@ struct crush_map {
162 __u32 choose_local_fallback_tries; 168 __u32 choose_local_fallback_tries;
163 /* choose attempts before giving up */ 169 /* choose attempts before giving up */
164 __u32 choose_total_tries; 170 __u32 choose_total_tries;
165 /* attempt chooseleaf inner descent once; on failure retry outer descent */ 171 /* attempt chooseleaf inner descent once for firstn mode; on
172 * reject retry outer descent. Note that this does *not*
173 * apply to a collision: in that case we will retry as we used
174 * to. */
166 __u32 chooseleaf_descend_once; 175 __u32 chooseleaf_descend_once;
167}; 176};
168 177
@@ -174,6 +183,7 @@ extern void crush_destroy_bucket_list(struct crush_bucket_list *b);
174extern void crush_destroy_bucket_tree(struct crush_bucket_tree *b); 183extern void crush_destroy_bucket_tree(struct crush_bucket_tree *b);
175extern void crush_destroy_bucket_straw(struct crush_bucket_straw *b); 184extern void crush_destroy_bucket_straw(struct crush_bucket_straw *b);
176extern void crush_destroy_bucket(struct crush_bucket *b); 185extern void crush_destroy_bucket(struct crush_bucket *b);
186extern void crush_destroy_rule(struct crush_rule *r);
177extern void crush_destroy(struct crush_map *map); 187extern void crush_destroy(struct crush_map *map);
178 188
179static inline int crush_calc_tree_node(int i) 189static inline int crush_calc_tree_node(int i)
diff --git a/include/linux/crush/mapper.h b/include/linux/crush/mapper.h
index 5772dee3ecbf..eab367446eea 100644
--- a/include/linux/crush/mapper.h
+++ b/include/linux/crush/mapper.h
@@ -14,6 +14,7 @@ extern int crush_find_rule(const struct crush_map *map, int ruleset, int type, i
14extern int crush_do_rule(const struct crush_map *map, 14extern int crush_do_rule(const struct crush_map *map,
15 int ruleno, 15 int ruleno,
16 int x, int *result, int result_max, 16 int x, int *result, int result_max,
17 const __u32 *weights); 17 const __u32 *weights, int weight_max,
18 int *scratch);
18 19
19#endif 20#endif
diff --git a/include/linux/dm-io.h b/include/linux/dm-io.h
index f4b0aa3126f5..a68cbe59e6ad 100644
--- a/include/linux/dm-io.h
+++ b/include/linux/dm-io.h
@@ -29,7 +29,7 @@ typedef void (*io_notify_fn)(unsigned long error, void *context);
29 29
30enum dm_io_mem_type { 30enum dm_io_mem_type {
31 DM_IO_PAGE_LIST,/* Page list */ 31 DM_IO_PAGE_LIST,/* Page list */
32 DM_IO_BVEC, /* Bio vector */ 32 DM_IO_BIO, /* Bio vector */
33 DM_IO_VMA, /* Virtual memory area */ 33 DM_IO_VMA, /* Virtual memory area */
34 DM_IO_KMEM, /* Kernel memory */ 34 DM_IO_KMEM, /* Kernel memory */
35}; 35};
@@ -41,7 +41,7 @@ struct dm_io_memory {
41 41
42 union { 42 union {
43 struct page_list *pl; 43 struct page_list *pl;
44 struct bio_vec *bvec; 44 struct bio *bio;
45 void *vma; 45 void *vma;
46 void *addr; 46 void *addr;
47 } ptr; 47 } ptr;
diff --git a/include/linux/dma-debug.h b/include/linux/dma-debug.h
index fc0e34ce038f..fe8cb610deac 100644
--- a/include/linux/dma-debug.h
+++ b/include/linux/dma-debug.h
@@ -85,6 +85,8 @@ extern void debug_dma_sync_sg_for_device(struct device *dev,
85 85
86extern void debug_dma_dump_mappings(struct device *dev); 86extern void debug_dma_dump_mappings(struct device *dev);
87 87
88extern void debug_dma_assert_idle(struct page *page);
89
88#else /* CONFIG_DMA_API_DEBUG */ 90#else /* CONFIG_DMA_API_DEBUG */
89 91
90static inline void dma_debug_add_bus(struct bus_type *bus) 92static inline void dma_debug_add_bus(struct bus_type *bus)
@@ -183,6 +185,10 @@ static inline void debug_dma_dump_mappings(struct device *dev)
183{ 185{
184} 186}
185 187
188static inline void debug_dma_assert_idle(struct page *page)
189{
190}
191
186#endif /* CONFIG_DMA_API_DEBUG */ 192#endif /* CONFIG_DMA_API_DEBUG */
187 193
188#endif /* __DMA_DEBUG_H */ 194#endif /* __DMA_DEBUG_H */
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h
index 57c9a8ae4f2d..7ac17f57250e 100644
--- a/include/linux/dma_remapping.h
+++ b/include/linux/dma_remapping.h
@@ -27,7 +27,6 @@ struct root_entry;
27 27
28 28
29#ifdef CONFIG_INTEL_IOMMU 29#ifdef CONFIG_INTEL_IOMMU
30extern void free_dmar_iommu(struct intel_iommu *iommu);
31extern int iommu_calculate_agaw(struct intel_iommu *iommu); 30extern int iommu_calculate_agaw(struct intel_iommu *iommu);
32extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu); 31extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
33extern int dmar_disabled; 32extern int dmar_disabled;
@@ -41,9 +40,6 @@ static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu)
41{ 40{
42 return 0; 41 return 0;
43} 42}
44static inline void free_dmar_iommu(struct intel_iommu *iommu)
45{
46}
47#define dmar_disabled (1) 43#define dmar_disabled (1)
48#define intel_iommu_enabled (0) 44#define intel_iommu_enabled (0)
49#endif 45#endif
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 41cf0c399288..c5c92d59e531 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -22,6 +22,7 @@
22#define LINUX_DMAENGINE_H 22#define LINUX_DMAENGINE_H
23 23
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/err.h>
25#include <linux/uio.h> 26#include <linux/uio.h>
26#include <linux/bug.h> 27#include <linux/bug.h>
27#include <linux/scatterlist.h> 28#include <linux/scatterlist.h>
@@ -256,7 +257,7 @@ struct dma_chan_percpu {
256 * @dev: class device for sysfs 257 * @dev: class device for sysfs
257 * @device_node: used to add this to the device chan list 258 * @device_node: used to add this to the device chan list
258 * @local: per-cpu pointer to a struct dma_chan_percpu 259 * @local: per-cpu pointer to a struct dma_chan_percpu
259 * @client-count: how many clients are using this channel 260 * @client_count: how many clients are using this channel
260 * @table_count: number of appearances in the mem-to-mem allocation table 261 * @table_count: number of appearances in the mem-to-mem allocation table
261 * @private: private data for certain client-channel associations 262 * @private: private data for certain client-channel associations
262 */ 263 */
@@ -278,10 +279,10 @@ struct dma_chan {
278 279
279/** 280/**
280 * struct dma_chan_dev - relate sysfs device node to backing channel device 281 * struct dma_chan_dev - relate sysfs device node to backing channel device
281 * @chan - driver channel device 282 * @chan: driver channel device
282 * @device - sysfs device 283 * @device: sysfs device
283 * @dev_id - parent dma_device dev_id 284 * @dev_id: parent dma_device dev_id
284 * @idr_ref - reference count to gate release of dma_device dev_id 285 * @idr_ref: reference count to gate release of dma_device dev_id
285 */ 286 */
286struct dma_chan_dev { 287struct dma_chan_dev {
287 struct dma_chan *chan; 288 struct dma_chan *chan;
@@ -305,9 +306,8 @@ enum dma_slave_buswidth {
305/** 306/**
306 * struct dma_slave_config - dma slave channel runtime config 307 * struct dma_slave_config - dma slave channel runtime config
307 * @direction: whether the data shall go in or out on this slave 308 * @direction: whether the data shall go in or out on this slave
308 * channel, right now. DMA_TO_DEVICE and DMA_FROM_DEVICE are 309 * channel, right now. DMA_MEM_TO_DEV and DMA_DEV_TO_MEM are
309 * legal values, DMA_BIDIRECTIONAL is not acceptable since we 310 * legal values.
310 * need to differentiate source and target addresses.
311 * @src_addr: this is the physical address where DMA slave data 311 * @src_addr: this is the physical address where DMA slave data
312 * should be read (RX), if the source is memory this argument is 312 * should be read (RX), if the source is memory this argument is
313 * ignored. 313 * ignored.
@@ -363,6 +363,32 @@ struct dma_slave_config {
363 unsigned int slave_id; 363 unsigned int slave_id;
364}; 364};
365 365
366/**
367 * enum dma_residue_granularity - Granularity of the reported transfer residue
368 * @DMA_RESIDUE_GRANULARITY_DESCRIPTOR: Residue reporting is not support. The
369 * DMA channel is only able to tell whether a descriptor has been completed or
370 * not, which means residue reporting is not supported by this channel. The
371 * residue field of the dma_tx_state field will always be 0.
372 * @DMA_RESIDUE_GRANULARITY_SEGMENT: Residue is updated after each successfully
373 * completed segment of the transfer (For cyclic transfers this is after each
374 * period). This is typically implemented by having the hardware generate an
375 * interrupt after each transferred segment and then the drivers updates the
376 * outstanding residue by the size of the segment. Another possibility is if
377 * the hardware supports scatter-gather and the segment descriptor has a field
378 * which gets set after the segment has been completed. The driver then counts
379 * the number of segments without the flag set to compute the residue.
380 * @DMA_RESIDUE_GRANULARITY_BURST: Residue is updated after each transferred
381 * burst. This is typically only supported if the hardware has a progress
382 * register of some sort (E.g. a register with the current read/write address
383 * or a register with the amount of bursts/beats/bytes that have been
384 * transferred or still need to be transferred).
385 */
386enum dma_residue_granularity {
387 DMA_RESIDUE_GRANULARITY_DESCRIPTOR = 0,
388 DMA_RESIDUE_GRANULARITY_SEGMENT = 1,
389 DMA_RESIDUE_GRANULARITY_BURST = 2,
390};
391
366/* struct dma_slave_caps - expose capabilities of a slave channel only 392/* struct dma_slave_caps - expose capabilities of a slave channel only
367 * 393 *
368 * @src_addr_widths: bit mask of src addr widths the channel supports 394 * @src_addr_widths: bit mask of src addr widths the channel supports
@@ -373,6 +399,7 @@ struct dma_slave_config {
373 * should be checked by controller as well 399 * should be checked by controller as well
374 * @cmd_pause: true, if pause and thereby resume is supported 400 * @cmd_pause: true, if pause and thereby resume is supported
375 * @cmd_terminate: true, if terminate cmd is supported 401 * @cmd_terminate: true, if terminate cmd is supported
402 * @residue_granularity: granularity of the reported transfer residue
376 */ 403 */
377struct dma_slave_caps { 404struct dma_slave_caps {
378 u32 src_addr_widths; 405 u32 src_addr_widths;
@@ -380,6 +407,7 @@ struct dma_slave_caps {
380 u32 directions; 407 u32 directions;
381 bool cmd_pause; 408 bool cmd_pause;
382 bool cmd_terminate; 409 bool cmd_terminate;
410 enum dma_residue_granularity residue_granularity;
383}; 411};
384 412
385static inline const char *dma_chan_name(struct dma_chan *chan) 413static inline const char *dma_chan_name(struct dma_chan *chan)
@@ -1040,6 +1068,8 @@ enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
1040void dma_issue_pending_all(void); 1068void dma_issue_pending_all(void);
1041struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask, 1069struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
1042 dma_filter_fn fn, void *fn_param); 1070 dma_filter_fn fn, void *fn_param);
1071struct dma_chan *dma_request_slave_channel_reason(struct device *dev,
1072 const char *name);
1043struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name); 1073struct dma_chan *dma_request_slave_channel(struct device *dev, const char *name);
1044void dma_release_channel(struct dma_chan *chan); 1074void dma_release_channel(struct dma_chan *chan);
1045#else 1075#else
@@ -1063,6 +1093,11 @@ static inline struct dma_chan *__dma_request_channel(const dma_cap_mask_t *mask,
1063{ 1093{
1064 return NULL; 1094 return NULL;
1065} 1095}
1096static inline struct dma_chan *dma_request_slave_channel_reason(
1097 struct device *dev, const char *name)
1098{
1099 return ERR_PTR(-ENODEV);
1100}
1066static inline struct dma_chan *dma_request_slave_channel(struct device *dev, 1101static inline struct dma_chan *dma_request_slave_channel(struct device *dev,
1067 const char *name) 1102 const char *name)
1068{ 1103{
@@ -1079,6 +1114,7 @@ int dma_async_device_register(struct dma_device *device);
1079void dma_async_device_unregister(struct dma_device *device); 1114void dma_async_device_unregister(struct dma_device *device);
1080void dma_run_dependencies(struct dma_async_tx_descriptor *tx); 1115void dma_run_dependencies(struct dma_async_tx_descriptor *tx);
1081struct dma_chan *dma_get_slave_channel(struct dma_chan *chan); 1116struct dma_chan *dma_get_slave_channel(struct dma_chan *chan);
1117struct dma_chan *dma_get_any_slave_channel(struct dma_device *device);
1082struct dma_chan *net_dma_find_channel(void); 1118struct dma_chan *net_dma_find_channel(void);
1083#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y) 1119#define dma_request_channel(mask, x, y) __dma_request_channel(&(mask), x, y)
1084#define dma_request_slave_channel_compat(mask, x, y, dev, name) \ 1120#define dma_request_slave_channel_compat(mask, x, y, dev, name) \
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index b029d1aa2d12..eccb0c0c6cf6 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -33,6 +33,7 @@ struct acpi_dmar_header;
33#define DMAR_X2APIC_OPT_OUT 0x2 33#define DMAR_X2APIC_OPT_OUT 0x2
34 34
35struct intel_iommu; 35struct intel_iommu;
36
36#ifdef CONFIG_DMAR_TABLE 37#ifdef CONFIG_DMAR_TABLE
37extern struct acpi_table_header *dmar_tbl; 38extern struct acpi_table_header *dmar_tbl;
38struct dmar_drhd_unit { 39struct dmar_drhd_unit {
@@ -52,6 +53,10 @@ extern struct list_head dmar_drhd_units;
52#define for_each_drhd_unit(drhd) \ 53#define for_each_drhd_unit(drhd) \
53 list_for_each_entry(drhd, &dmar_drhd_units, list) 54 list_for_each_entry(drhd, &dmar_drhd_units, list)
54 55
56#define for_each_active_drhd_unit(drhd) \
57 list_for_each_entry(drhd, &dmar_drhd_units, list) \
58 if (drhd->ignored) {} else
59
55#define for_each_active_iommu(i, drhd) \ 60#define for_each_active_iommu(i, drhd) \
56 list_for_each_entry(drhd, &dmar_drhd_units, list) \ 61 list_for_each_entry(drhd, &dmar_drhd_units, list) \
57 if (i=drhd->iommu, drhd->ignored) {} else 62 if (i=drhd->iommu, drhd->ignored) {} else
@@ -62,13 +67,13 @@ extern struct list_head dmar_drhd_units;
62 67
63extern int dmar_table_init(void); 68extern int dmar_table_init(void);
64extern int dmar_dev_scope_init(void); 69extern int dmar_dev_scope_init(void);
70extern int dmar_parse_dev_scope(void *start, void *end, int *cnt,
71 struct pci_dev ***devices, u16 segment);
72extern void dmar_free_dev_scope(struct pci_dev ***devices, int *cnt);
65 73
66/* Intel IOMMU detection */ 74/* Intel IOMMU detection */
67extern int detect_intel_iommu(void); 75extern int detect_intel_iommu(void);
68extern int enable_drhd_fault_handling(void); 76extern int enable_drhd_fault_handling(void);
69
70extern int parse_ioapics_under_ir(void);
71extern int alloc_iommu(struct dmar_drhd_unit *);
72#else 77#else
73static inline int detect_intel_iommu(void) 78static inline int detect_intel_iommu(void)
74{ 79{
@@ -157,8 +162,6 @@ struct dmar_atsr_unit {
157int dmar_parse_rmrr_atsr_dev(void); 162int dmar_parse_rmrr_atsr_dev(void);
158extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header); 163extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header);
159extern int dmar_parse_one_atsr(struct acpi_dmar_header *header); 164extern int dmar_parse_one_atsr(struct acpi_dmar_header *header);
160extern int dmar_parse_dev_scope(void *start, void *end, int *cnt,
161 struct pci_dev ***devices, u16 segment);
162extern int intel_iommu_init(void); 165extern int intel_iommu_init(void);
163#else /* !CONFIG_INTEL_IOMMU: */ 166#else /* !CONFIG_INTEL_IOMMU: */
164static inline int intel_iommu_init(void) { return -ENODEV; } 167static inline int intel_iommu_init(void) { return -ENODEV; }
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index fc4a9aa7dd82..9c5529dc6d07 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -26,6 +26,7 @@
26#include <linux/netdevice.h> 26#include <linux/netdevice.h>
27#include <linux/random.h> 27#include <linux/random.h>
28#include <asm/unaligned.h> 28#include <asm/unaligned.h>
29#include <asm/bitsperlong.h>
29 30
30#ifdef __KERNEL__ 31#ifdef __KERNEL__
31__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev); 32__be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev);
@@ -60,6 +61,8 @@ static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) =
60 * 61 *
61 * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per 62 * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per
62 * IEEE 802.1Q 8.6.3 Frame filtering. 63 * IEEE 802.1Q 8.6.3 Frame filtering.
64 *
65 * Please note: addr must be aligned to u16.
63 */ 66 */
64static inline bool is_link_local_ether_addr(const u8 *addr) 67static inline bool is_link_local_ether_addr(const u8 *addr)
65{ 68{
@@ -67,7 +70,12 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
67 static const __be16 *b = (const __be16 *)eth_reserved_addr_base; 70 static const __be16 *b = (const __be16 *)eth_reserved_addr_base;
68 static const __be16 m = cpu_to_be16(0xfff0); 71 static const __be16 m = cpu_to_be16(0xfff0);
69 72
73#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
74 return (((*(const u32 *)addr) ^ (*(const u32 *)b)) |
75 ((a[2] ^ b[2]) & m)) == 0;
76#else
70 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0; 77 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
78#endif
71} 79}
72 80
73/** 81/**
@@ -75,10 +83,18 @@ static inline bool is_link_local_ether_addr(const u8 *addr)
75 * @addr: Pointer to a six-byte array containing the Ethernet address 83 * @addr: Pointer to a six-byte array containing the Ethernet address
76 * 84 *
77 * Return true if the address is all zeroes. 85 * Return true if the address is all zeroes.
86 *
87 * Please note: addr must be aligned to u16.
78 */ 88 */
79static inline bool is_zero_ether_addr(const u8 *addr) 89static inline bool is_zero_ether_addr(const u8 *addr)
80{ 90{
81 return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]); 91#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
92 return ((*(const u32 *)addr) | (*(const u16 *)(addr + 4))) == 0;
93#else
94 return (*(const u16 *)(addr + 0) |
95 *(const u16 *)(addr + 2) |
96 *(const u16 *)(addr + 4)) == 0;
97#endif
82} 98}
83 99
84/** 100/**
@@ -109,10 +125,14 @@ static inline bool is_local_ether_addr(const u8 *addr)
109 * @addr: Pointer to a six-byte array containing the Ethernet address 125 * @addr: Pointer to a six-byte array containing the Ethernet address
110 * 126 *
111 * Return true if the address is the broadcast address. 127 * Return true if the address is the broadcast address.
128 *
129 * Please note: addr must be aligned to u16.
112 */ 130 */
113static inline bool is_broadcast_ether_addr(const u8 *addr) 131static inline bool is_broadcast_ether_addr(const u8 *addr)
114{ 132{
115 return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff; 133 return (*(const u16 *)(addr + 0) &
134 *(const u16 *)(addr + 2) &
135 *(const u16 *)(addr + 4)) == 0xffff;
116} 136}
117 137
118/** 138/**
@@ -134,6 +154,8 @@ static inline bool is_unicast_ether_addr(const u8 *addr)
134 * a multicast address, and is not FF:FF:FF:FF:FF:FF. 154 * a multicast address, and is not FF:FF:FF:FF:FF:FF.
135 * 155 *
136 * Return true if the address is valid. 156 * Return true if the address is valid.
157 *
158 * Please note: addr must be aligned to u16.
137 */ 159 */
138static inline bool is_valid_ether_addr(const u8 *addr) 160static inline bool is_valid_ether_addr(const u8 *addr)
139{ 161{
@@ -196,6 +218,28 @@ static inline void eth_hw_addr_random(struct net_device *dev)
196} 218}
197 219
198/** 220/**
221 * ether_addr_copy - Copy an Ethernet address
222 * @dst: Pointer to a six-byte array Ethernet address destination
223 * @src: Pointer to a six-byte array Ethernet address source
224 *
225 * Please note: dst & src must both be aligned to u16.
226 */
227static inline void ether_addr_copy(u8 *dst, const u8 *src)
228{
229#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
230 *(u32 *)dst = *(const u32 *)src;
231 *(u16 *)(dst + 4) = *(const u16 *)(src + 4);
232#else
233 u16 *a = (u16 *)dst;
234 const u16 *b = (const u16 *)src;
235
236 a[0] = b[0];
237 a[1] = b[1];
238 a[2] = b[2];
239#endif
240}
241
242/**
199 * eth_hw_addr_inherit - Copy dev_addr from another net_device 243 * eth_hw_addr_inherit - Copy dev_addr from another net_device
200 * @dst: pointer to net_device to copy dev_addr to 244 * @dst: pointer to net_device to copy dev_addr to
201 * @src: pointer to net_device to copy dev_addr from 245 * @src: pointer to net_device to copy dev_addr from
@@ -207,24 +251,7 @@ static inline void eth_hw_addr_inherit(struct net_device *dst,
207 struct net_device *src) 251 struct net_device *src)
208{ 252{
209 dst->addr_assign_type = src->addr_assign_type; 253 dst->addr_assign_type = src->addr_assign_type;
210 memcpy(dst->dev_addr, src->dev_addr, ETH_ALEN); 254 ether_addr_copy(dst->dev_addr, src->dev_addr);
211}
212
213/**
214 * compare_ether_addr - Compare two Ethernet addresses
215 * @addr1: Pointer to a six-byte array containing the Ethernet address
216 * @addr2: Pointer other six-byte array containing the Ethernet address
217 *
218 * Compare two Ethernet addresses, returns 0 if equal, non-zero otherwise.
219 * Unlike memcmp(), it doesn't return a value suitable for sorting.
220 */
221static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2)
222{
223 const u16 *a = (const u16 *) addr1;
224 const u16 *b = (const u16 *) addr2;
225
226 BUILD_BUG_ON(ETH_ALEN != 6);
227 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0;
228} 255}
229 256
230/** 257/**
@@ -233,18 +260,21 @@ static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2)
233 * @addr2: Pointer other six-byte array containing the Ethernet address 260 * @addr2: Pointer other six-byte array containing the Ethernet address
234 * 261 *
235 * Compare two Ethernet addresses, returns true if equal 262 * Compare two Ethernet addresses, returns true if equal
263 *
264 * Please note: addr1 & addr2 must both be aligned to u16.
236 */ 265 */
237static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) 266static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2)
238{ 267{
239 return !compare_ether_addr(addr1, addr2); 268#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
240} 269 u32 fold = ((*(const u32 *)addr1) ^ (*(const u32 *)addr2)) |
270 ((*(const u16 *)(addr1 + 4)) ^ (*(const u16 *)(addr2 + 4)));
241 271
242static inline unsigned long zap_last_2bytes(unsigned long value) 272 return fold == 0;
243{
244#ifdef __BIG_ENDIAN
245 return value >> 16;
246#else 273#else
247 return value << 16; 274 const u16 *a = (const u16 *)addr1;
275 const u16 *b = (const u16 *)addr2;
276
277 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) == 0;
248#endif 278#endif
249} 279}
250 280
@@ -265,22 +295,38 @@ static inline unsigned long zap_last_2bytes(unsigned long value)
265static inline bool ether_addr_equal_64bits(const u8 addr1[6+2], 295static inline bool ether_addr_equal_64bits(const u8 addr1[6+2],
266 const u8 addr2[6+2]) 296 const u8 addr2[6+2])
267{ 297{
268#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS 298#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
269 unsigned long fold = ((*(unsigned long *)addr1) ^ 299 u64 fold = (*(const u64 *)addr1) ^ (*(const u64 *)addr2);
270 (*(unsigned long *)addr2));
271
272 if (sizeof(fold) == 8)
273 return zap_last_2bytes(fold) == 0;
274 300
275 fold |= zap_last_2bytes((*(unsigned long *)(addr1 + 4)) ^ 301#ifdef __BIG_ENDIAN
276 (*(unsigned long *)(addr2 + 4))); 302 return (fold >> 16) == 0;
277 return fold == 0; 303#else
304 return (fold << 16) == 0;
305#endif
278#else 306#else
279 return ether_addr_equal(addr1, addr2); 307 return ether_addr_equal(addr1, addr2);
280#endif 308#endif
281} 309}
282 310
283/** 311/**
312 * ether_addr_equal_unaligned - Compare two not u16 aligned Ethernet addresses
313 * @addr1: Pointer to a six-byte array containing the Ethernet address
314 * @addr2: Pointer other six-byte array containing the Ethernet address
315 *
316 * Compare two Ethernet addresses, returns true if equal
317 *
318 * Please note: Use only when any Ethernet address may not be u16 aligned.
319 */
320static inline bool ether_addr_equal_unaligned(const u8 *addr1, const u8 *addr2)
321{
322#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS)
323 return ether_addr_equal(addr1, addr2);
324#else
325 return memcmp(addr1, addr2, ETH_ALEN) == 0;
326#endif
327}
328
329/**
284 * is_etherdev_addr - Tell if given Ethernet address belongs to the device. 330 * is_etherdev_addr - Tell if given Ethernet address belongs to the device.
285 * @dev: Pointer to a device structure 331 * @dev: Pointer to a device structure
286 * @addr: Pointer to a six-byte array containing the Ethernet address 332 * @addr: Pointer to a six-byte array containing the Ethernet address
diff --git a/include/linux/export.h b/include/linux/export.h
index 3f2793d51899..96e45ea463e7 100644
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -59,6 +59,7 @@ extern struct module __this_module;
59 static const char __kstrtab_##sym[] \ 59 static const char __kstrtab_##sym[] \
60 __attribute__((section("__ksymtab_strings"), aligned(1))) \ 60 __attribute__((section("__ksymtab_strings"), aligned(1))) \
61 = VMLINUX_SYMBOL_STR(sym); \ 61 = VMLINUX_SYMBOL_STR(sym); \
62 extern const struct kernel_symbol __ksymtab_##sym; \
62 __visible const struct kernel_symbol __ksymtab_##sym \ 63 __visible const struct kernel_symbol __ksymtab_##sym \
63 __used \ 64 __used \
64 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \ 65 __attribute__((section("___ksymtab" sec "+" #sym), unused)) \
diff --git a/include/linux/extcon/extcon-gpio.h b/include/linux/extcon/extcon-gpio.h
index 4195810f87fe..8900fdf511c6 100644
--- a/include/linux/extcon/extcon-gpio.h
+++ b/include/linux/extcon/extcon-gpio.h
@@ -51,6 +51,7 @@ struct gpio_extcon_platform_data {
51 /* if NULL, "0" or "1" will be printed */ 51 /* if NULL, "0" or "1" will be printed */
52 const char *state_on; 52 const char *state_on;
53 const char *state_off; 53 const char *state_off;
54 bool check_on_resume;
54}; 55};
55 56
56#endif /* __EXTCON_GPIO_H__ */ 57#endif /* __EXTCON_GPIO_H__ */
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index bb942f6d5702..da74d878dc4f 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -153,6 +153,13 @@ struct f2fs_extent {
153#define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5) 153#define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5)
154 154
155#define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */ 155#define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */
156#define F2FS_INLINE_DATA 0x02 /* file inline data flag */
157
158#define MAX_INLINE_DATA (sizeof(__le32) * (DEF_ADDRS_PER_INODE - \
159 F2FS_INLINE_XATTR_ADDRS - 1))
160
161#define INLINE_DATA_OFFSET (PAGE_CACHE_SIZE - sizeof(struct node_footer) \
162 - sizeof(__le32) * (DEF_ADDRS_PER_INODE + 5 - 1))
156 163
157struct f2fs_inode { 164struct f2fs_inode {
158 __le16 i_mode; /* file mode */ 165 __le16 i_mode; /* file mode */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 70c4836e4a9f..fe6ac956550e 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -613,8 +613,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
613extern int register_framebuffer(struct fb_info *fb_info); 613extern int register_framebuffer(struct fb_info *fb_info);
614extern int unregister_framebuffer(struct fb_info *fb_info); 614extern int unregister_framebuffer(struct fb_info *fb_info);
615extern int unlink_framebuffer(struct fb_info *fb_info); 615extern int unlink_framebuffer(struct fb_info *fb_info);
616extern void remove_conflicting_framebuffers(struct apertures_struct *a, 616extern int remove_conflicting_framebuffers(struct apertures_struct *a,
617 const char *name, bool primary); 617 const char *name, bool primary);
618extern int fb_prepare_logo(struct fb_info *fb_info, int rotate); 618extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
619extern int fb_show_logo(struct fb_info *fb_info, int rotate); 619extern int fb_show_logo(struct fb_info *fb_info, int rotate);
620extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); 620extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size);
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 085197bd8812..70e8e21c0a30 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -59,29 +59,36 @@ struct files_struct {
59 struct file __rcu * fd_array[NR_OPEN_DEFAULT]; 59 struct file __rcu * fd_array[NR_OPEN_DEFAULT];
60}; 60};
61 61
62#define rcu_dereference_check_fdtable(files, fdtfd) \
63 (rcu_dereference_check((fdtfd), \
64 lockdep_is_held(&(files)->file_lock) || \
65 atomic_read(&(files)->count) == 1 || \
66 rcu_my_thread_group_empty()))
67
68#define files_fdtable(files) \
69 (rcu_dereference_check_fdtable((files), (files)->fdt))
70
71struct file_operations; 62struct file_operations;
72struct vfsmount; 63struct vfsmount;
73struct dentry; 64struct dentry;
74 65
75extern void __init files_defer_init(void); 66extern void __init files_defer_init(void);
76 67
77static inline struct file * fcheck_files(struct files_struct *files, unsigned int fd) 68#define rcu_dereference_check_fdtable(files, fdtfd) \
69 rcu_dereference_check((fdtfd), lockdep_is_held(&(files)->file_lock))
70
71#define files_fdtable(files) \
72 rcu_dereference_check_fdtable((files), (files)->fdt)
73
74/*
75 * The caller must ensure that fd table isn't shared or hold rcu or file lock
76 */
77static inline struct file *__fcheck_files(struct files_struct *files, unsigned int fd)
78{ 78{
79 struct file * file = NULL; 79 struct fdtable *fdt = rcu_dereference_raw(files->fdt);
80 struct fdtable *fdt = files_fdtable(files);
81 80
82 if (fd < fdt->max_fds) 81 if (fd < fdt->max_fds)
83 file = rcu_dereference_check_fdtable(files, fdt->fd[fd]); 82 return rcu_dereference_raw(fdt->fd[fd]);
84 return file; 83 return NULL;
84}
85
86static inline struct file *fcheck_files(struct files_struct *files, unsigned int fd)
87{
88 rcu_lockdep_assert(rcu_read_lock_held() ||
89 lockdep_is_held(&files->file_lock),
90 "suspicious rcu_dereference_check() usage");
91 return __fcheck_files(files, fd);
85} 92}
86 93
87/* 94/*
diff --git a/include/linux/filter.h b/include/linux/filter.h
index ff4e40cd45b1..e568c8ef896b 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -83,6 +83,11 @@ static inline void bpf_jit_free(struct sk_filter *fp)
83#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)
84#endif 84#endif
85 85
86static inline int bpf_tell_extensions(void)
87{
88 return SKF_AD_MAX;
89}
90
86enum { 91enum {
87 BPF_S_RET_K = 1, 92 BPF_S_RET_K = 1,
88 BPF_S_RET_A, 93 BPF_S_RET_A,
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index e154c1005cd1..59529330efd6 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -68,4 +68,11 @@ static inline void release_firmware(const struct firmware *fw)
68 68
69#endif 69#endif
70 70
71#ifdef CONFIG_FW_LOADER_USER_HELPER
72int request_firmware_direct(const struct firmware **fw, const char *name,
73 struct device *device);
74#else
75#define request_firmware_direct request_firmware
76#endif
77
71#endif 78#endif
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h
index 6843cf193a44..b6efb0c64408 100644
--- a/include/linux/flex_array.h
+++ b/include/linux/flex_array.h
@@ -2,6 +2,7 @@
2#define _FLEX_ARRAY_H 2#define _FLEX_ARRAY_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/reciprocal_div.h>
5#include <asm/page.h> 6#include <asm/page.h>
6 7
7#define FLEX_ARRAY_PART_SIZE PAGE_SIZE 8#define FLEX_ARRAY_PART_SIZE PAGE_SIZE
@@ -22,7 +23,7 @@ struct flex_array {
22 int element_size; 23 int element_size;
23 int total_nr_elements; 24 int total_nr_elements;
24 int elems_per_part; 25 int elems_per_part;
25 u32 reciprocal_elems; 26 struct reciprocal_value reciprocal_elems;
26 struct flex_array_part *parts[]; 27 struct flex_array_part *parts[];
27 }; 28 };
28 /* 29 /*
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 121f11f001c0..09f553c59813 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1580,6 +1580,7 @@ struct inode_operations {
1580 struct file *, unsigned open_flag, 1580 struct file *, unsigned open_flag,
1581 umode_t create_mode, int *opened); 1581 umode_t create_mode, int *opened);
1582 int (*tmpfile) (struct inode *, struct dentry *, umode_t); 1582 int (*tmpfile) (struct inode *, struct dentry *, umode_t);
1583 int (*set_acl)(struct inode *, struct posix_acl *, int);
1583} ____cacheline_aligned; 1584} ____cacheline_aligned;
1584 1585
1585ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, 1586ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 4b2ee8d12f5e..3d286ff49ab0 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -15,7 +15,6 @@
15#include <linux/path.h> /* struct path */ 15#include <linux/path.h> /* struct path */
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/types.h> 17#include <linux/types.h>
18
19#include <linux/atomic.h> 18#include <linux/atomic.h>
20 19
21/* 20/*
@@ -79,6 +78,7 @@ struct fsnotify_group;
79struct fsnotify_event; 78struct fsnotify_event;
80struct fsnotify_mark; 79struct fsnotify_mark;
81struct fsnotify_event_private_data; 80struct fsnotify_event_private_data;
81struct fsnotify_fname;
82 82
83/* 83/*
84 * Each group much define these ops. The fsnotify infrastructure will call 84 * Each group much define these ops. The fsnotify infrastructure will call
@@ -94,17 +94,27 @@ struct fsnotify_event_private_data;
94 * userspace messages that marks have been removed. 94 * userspace messages that marks have been removed.
95 */ 95 */
96struct fsnotify_ops { 96struct fsnotify_ops {
97 bool (*should_send_event)(struct fsnotify_group *group, struct inode *inode,
98 struct fsnotify_mark *inode_mark,
99 struct fsnotify_mark *vfsmount_mark,
100 __u32 mask, void *data, int data_type);
101 int (*handle_event)(struct fsnotify_group *group, 97 int (*handle_event)(struct fsnotify_group *group,
98 struct inode *inode,
102 struct fsnotify_mark *inode_mark, 99 struct fsnotify_mark *inode_mark,
103 struct fsnotify_mark *vfsmount_mark, 100 struct fsnotify_mark *vfsmount_mark,
104 struct fsnotify_event *event); 101 u32 mask, void *data, int data_type,
102 const unsigned char *file_name);
105 void (*free_group_priv)(struct fsnotify_group *group); 103 void (*free_group_priv)(struct fsnotify_group *group);
106 void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group); 104 void (*freeing_mark)(struct fsnotify_mark *mark, struct fsnotify_group *group);
107 void (*free_event_priv)(struct fsnotify_event_private_data *priv); 105 void (*free_event)(struct fsnotify_event *event);
106};
107
108/*
109 * all of the information about the original object we want to now send to
110 * a group. If you want to carry more info from the accessing task to the
111 * listener this structure is where you need to be adding fields.
112 */
113struct fsnotify_event {
114 struct list_head list;
115 /* inode may ONLY be dereferenced during handle_event(). */
116 struct inode *inode; /* either the inode the event happened to or its parent */
117 u32 mask; /* the type of access, bitwise OR for FS_* event types */
108}; 118};
109 119
110/* 120/*
@@ -148,7 +158,11 @@ struct fsnotify_group {
148 * a group */ 158 * a group */
149 struct list_head marks_list; /* all inode marks for this group */ 159 struct list_head marks_list; /* all inode marks for this group */
150 160
151 struct fasync_struct *fsn_fa; /* async notification */ 161 struct fasync_struct *fsn_fa; /* async notification */
162
163 struct fsnotify_event overflow_event; /* Event we queue when the
164 * notification list is too
165 * full */
152 166
153 /* groups can define private fields here or use the void *private */ 167 /* groups can define private fields here or use the void *private */
154 union { 168 union {
@@ -177,76 +191,10 @@ struct fsnotify_group {
177 }; 191 };
178}; 192};
179 193
180/*
181 * A single event can be queued in multiple group->notification_lists.
182 *
183 * each group->notification_list will point to an event_holder which in turns points
184 * to the actual event that needs to be sent to userspace.
185 *
186 * Seemed cheaper to create a refcnt'd event and a small holder for every group
187 * than create a different event for every group
188 *
189 */
190struct fsnotify_event_holder {
191 struct fsnotify_event *event;
192 struct list_head event_list;
193};
194
195/*
196 * Inotify needs to tack data onto an event. This struct lets us later find the
197 * correct private data of the correct group.
198 */
199struct fsnotify_event_private_data {
200 struct fsnotify_group *group;
201 struct list_head event_list;
202};
203
204/*
205 * all of the information about the original object we want to now send to
206 * a group. If you want to carry more info from the accessing task to the
207 * listener this structure is where you need to be adding fields.
208 */
209struct fsnotify_event {
210 /*
211 * If we create an event we are also likely going to need a holder
212 * to link to a group. So embed one holder in the event. Means only
213 * one allocation for the common case where we only have one group
214 */
215 struct fsnotify_event_holder holder;
216 spinlock_t lock; /* protection for the associated event_holder and private_list */
217 /* to_tell may ONLY be dereferenced during handle_event(). */
218 struct inode *to_tell; /* either the inode the event happened to or its parent */
219 /*
220 * depending on the event type we should have either a path or inode
221 * We hold a reference on path, but NOT on inode. Since we have the ref on
222 * the path, it may be dereferenced at any point during this object's
223 * lifetime. That reference is dropped when this object's refcnt hits
224 * 0. If this event contains an inode instead of a path, the inode may
225 * ONLY be used during handle_event().
226 */
227 union {
228 struct path path;
229 struct inode *inode;
230 };
231/* when calling fsnotify tell it if the data is a path or inode */ 194/* when calling fsnotify tell it if the data is a path or inode */
232#define FSNOTIFY_EVENT_NONE 0 195#define FSNOTIFY_EVENT_NONE 0
233#define FSNOTIFY_EVENT_PATH 1 196#define FSNOTIFY_EVENT_PATH 1
234#define FSNOTIFY_EVENT_INODE 2 197#define FSNOTIFY_EVENT_INODE 2
235 int data_type; /* which of the above union we have */
236 atomic_t refcnt; /* how many groups still are using/need to send this event */
237 __u32 mask; /* the type of access, bitwise OR for FS_* event types */
238
239 u32 sync_cookie; /* used to corrolate events, namely inotify mv events */
240 const unsigned char *file_name;
241 size_t name_len;
242 struct pid *tgid;
243
244#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
245 __u32 response; /* userspace answer to question */
246#endif /* CONFIG_FANOTIFY_ACCESS_PERMISSIONS */
247
248 struct list_head private_data_list; /* groups can store private data here */
249};
250 198
251/* 199/*
252 * Inode specific fields in an fsnotify_mark 200 * Inode specific fields in an fsnotify_mark
@@ -370,19 +318,14 @@ extern void fsnotify_put_group(struct fsnotify_group *group);
370extern void fsnotify_destroy_group(struct fsnotify_group *group); 318extern void fsnotify_destroy_group(struct fsnotify_group *group);
371/* fasync handler function */ 319/* fasync handler function */
372extern int fsnotify_fasync(int fd, struct file *file, int on); 320extern int fsnotify_fasync(int fd, struct file *file, int on);
373/* take a reference to an event */ 321/* Free event from memory */
374extern void fsnotify_get_event(struct fsnotify_event *event); 322extern void fsnotify_destroy_event(struct fsnotify_group *group,
375extern void fsnotify_put_event(struct fsnotify_event *event); 323 struct fsnotify_event *event);
376/* find private data previously attached to an event and unlink it */
377extern struct fsnotify_event_private_data *fsnotify_remove_priv_from_event(struct fsnotify_group *group,
378 struct fsnotify_event *event);
379
380/* attach the event to the group notification queue */ 324/* attach the event to the group notification queue */
381extern struct fsnotify_event *fsnotify_add_notify_event(struct fsnotify_group *group, 325extern int fsnotify_add_notify_event(struct fsnotify_group *group,
382 struct fsnotify_event *event, 326 struct fsnotify_event *event,
383 struct fsnotify_event_private_data *priv, 327 int (*merge)(struct list_head *,
384 struct fsnotify_event *(*merge)(struct list_head *, 328 struct fsnotify_event *));
385 struct fsnotify_event *));
386/* true if the group notification queue is empty */ 329/* true if the group notification queue is empty */
387extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group); 330extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group);
388/* return, but do not dequeue the first event on the notification queue */ 331/* return, but do not dequeue the first event on the notification queue */
@@ -430,15 +373,8 @@ extern void fsnotify_put_mark(struct fsnotify_mark *mark);
430extern void fsnotify_unmount_inodes(struct list_head *list); 373extern void fsnotify_unmount_inodes(struct list_head *list);
431 374
432/* put here because inotify does some weird stuff when destroying watches */ 375/* put here because inotify does some weird stuff when destroying watches */
433extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, 376extern void fsnotify_init_event(struct fsnotify_event *event,
434 void *data, int data_is, 377 struct inode *to_tell, u32 mask);
435 const unsigned char *name,
436 u32 cookie, gfp_t gfp);
437
438/* fanotify likes to change events after they are on lists... */
439extern struct fsnotify_event *fsnotify_clone_event(struct fsnotify_event *old_event);
440extern int fsnotify_replace_event(struct fsnotify_event_holder *old_holder,
441 struct fsnotify_event *new_event);
442 378
443#else 379#else
444 380
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 31ea4b428360..f4233b195dab 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -570,8 +570,6 @@ static inline int
570ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } 570ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; }
571#endif /* CONFIG_DYNAMIC_FTRACE */ 571#endif /* CONFIG_DYNAMIC_FTRACE */
572 572
573loff_t ftrace_filter_lseek(struct file *file, loff_t offset, int whence);
574
575/* totally disable ftrace - can not re-enable after this */ 573/* totally disable ftrace - can not re-enable after this */
576void ftrace_kill(void); 574void ftrace_kill(void);
577 575
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 8c9b7a1c4138..4e4cc28623ad 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -1,3 +1,4 @@
1
1#ifndef _LINUX_FTRACE_EVENT_H 2#ifndef _LINUX_FTRACE_EVENT_H
2#define _LINUX_FTRACE_EVENT_H 3#define _LINUX_FTRACE_EVENT_H
3 4
@@ -264,6 +265,8 @@ enum {
264 FTRACE_EVENT_FL_NO_SET_FILTER_BIT, 265 FTRACE_EVENT_FL_NO_SET_FILTER_BIT,
265 FTRACE_EVENT_FL_SOFT_MODE_BIT, 266 FTRACE_EVENT_FL_SOFT_MODE_BIT,
266 FTRACE_EVENT_FL_SOFT_DISABLED_BIT, 267 FTRACE_EVENT_FL_SOFT_DISABLED_BIT,
268 FTRACE_EVENT_FL_TRIGGER_MODE_BIT,
269 FTRACE_EVENT_FL_TRIGGER_COND_BIT,
267}; 270};
268 271
269/* 272/*
@@ -275,6 +278,8 @@ enum {
275 * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED 278 * SOFT_MODE - The event is enabled/disabled by SOFT_DISABLED
276 * SOFT_DISABLED - When set, do not trace the event (even though its 279 * SOFT_DISABLED - When set, do not trace the event (even though its
277 * tracepoint may be enabled) 280 * tracepoint may be enabled)
281 * TRIGGER_MODE - When set, invoke the triggers associated with the event
282 * TRIGGER_COND - When set, one or more triggers has an associated filter
278 */ 283 */
279enum { 284enum {
280 FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT), 285 FTRACE_EVENT_FL_ENABLED = (1 << FTRACE_EVENT_FL_ENABLED_BIT),
@@ -283,6 +288,8 @@ enum {
283 FTRACE_EVENT_FL_NO_SET_FILTER = (1 << FTRACE_EVENT_FL_NO_SET_FILTER_BIT), 288 FTRACE_EVENT_FL_NO_SET_FILTER = (1 << FTRACE_EVENT_FL_NO_SET_FILTER_BIT),
284 FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT), 289 FTRACE_EVENT_FL_SOFT_MODE = (1 << FTRACE_EVENT_FL_SOFT_MODE_BIT),
285 FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT), 290 FTRACE_EVENT_FL_SOFT_DISABLED = (1 << FTRACE_EVENT_FL_SOFT_DISABLED_BIT),
291 FTRACE_EVENT_FL_TRIGGER_MODE = (1 << FTRACE_EVENT_FL_TRIGGER_MODE_BIT),
292 FTRACE_EVENT_FL_TRIGGER_COND = (1 << FTRACE_EVENT_FL_TRIGGER_COND_BIT),
286}; 293};
287 294
288struct ftrace_event_file { 295struct ftrace_event_file {
@@ -292,6 +299,7 @@ struct ftrace_event_file {
292 struct dentry *dir; 299 struct dentry *dir;
293 struct trace_array *tr; 300 struct trace_array *tr;
294 struct ftrace_subsystem_dir *system; 301 struct ftrace_subsystem_dir *system;
302 struct list_head triggers;
295 303
296 /* 304 /*
297 * 32 bit flags: 305 * 32 bit flags:
@@ -299,6 +307,7 @@ struct ftrace_event_file {
299 * bit 1: enabled cmd record 307 * bit 1: enabled cmd record
300 * bit 2: enable/disable with the soft disable bit 308 * bit 2: enable/disable with the soft disable bit
301 * bit 3: soft disabled 309 * bit 3: soft disabled
310 * bit 4: trigger enabled
302 * 311 *
303 * Note: The bits must be set atomically to prevent races 312 * Note: The bits must be set atomically to prevent races
304 * from other writers. Reads of flags do not need to be in 313 * from other writers. Reads of flags do not need to be in
@@ -310,6 +319,7 @@ struct ftrace_event_file {
310 */ 319 */
311 unsigned long flags; 320 unsigned long flags;
312 atomic_t sm_ref; /* soft-mode reference counter */ 321 atomic_t sm_ref; /* soft-mode reference counter */
322 atomic_t tm_ref; /* trigger-mode reference counter */
313}; 323};
314 324
315#define __TRACE_EVENT_FLAGS(name, value) \ 325#define __TRACE_EVENT_FLAGS(name, value) \
@@ -337,6 +347,14 @@ struct ftrace_event_file {
337 347
338#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ 348#define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */
339 349
350enum event_trigger_type {
351 ETT_NONE = (0),
352 ETT_TRACE_ONOFF = (1 << 0),
353 ETT_SNAPSHOT = (1 << 1),
354 ETT_STACKTRACE = (1 << 2),
355 ETT_EVENT_ENABLE = (1 << 3),
356};
357
340extern void destroy_preds(struct ftrace_event_file *file); 358extern void destroy_preds(struct ftrace_event_file *file);
341extern void destroy_call_preds(struct ftrace_event_call *call); 359extern void destroy_call_preds(struct ftrace_event_call *call);
342extern int filter_match_preds(struct event_filter *filter, void *rec); 360extern int filter_match_preds(struct event_filter *filter, void *rec);
@@ -347,6 +365,127 @@ extern int filter_check_discard(struct ftrace_event_file *file, void *rec,
347extern int call_filter_check_discard(struct ftrace_event_call *call, void *rec, 365extern int call_filter_check_discard(struct ftrace_event_call *call, void *rec,
348 struct ring_buffer *buffer, 366 struct ring_buffer *buffer,
349 struct ring_buffer_event *event); 367 struct ring_buffer_event *event);
368extern enum event_trigger_type event_triggers_call(struct ftrace_event_file *file,
369 void *rec);
370extern void event_triggers_post_call(struct ftrace_event_file *file,
371 enum event_trigger_type tt);
372
373/**
374 * ftrace_trigger_soft_disabled - do triggers and test if soft disabled
375 * @file: The file pointer of the event to test
376 *
377 * If any triggers without filters are attached to this event, they
378 * will be called here. If the event is soft disabled and has no
379 * triggers that require testing the fields, it will return true,
380 * otherwise false.
381 */
382static inline bool
383ftrace_trigger_soft_disabled(struct ftrace_event_file *file)
384{
385 unsigned long eflags = file->flags;
386
387 if (!(eflags & FTRACE_EVENT_FL_TRIGGER_COND)) {
388 if (eflags & FTRACE_EVENT_FL_TRIGGER_MODE)
389 event_triggers_call(file, NULL);
390 if (eflags & FTRACE_EVENT_FL_SOFT_DISABLED)
391 return true;
392 }
393 return false;
394}
395
396/*
397 * Helper function for event_trigger_unlock_commit{_regs}().
398 * If there are event triggers attached to this event that requires
399 * filtering against its fields, then they wil be called as the
400 * entry already holds the field information of the current event.
401 *
402 * It also checks if the event should be discarded or not.
403 * It is to be discarded if the event is soft disabled and the
404 * event was only recorded to process triggers, or if the event
405 * filter is active and this event did not match the filters.
406 *
407 * Returns true if the event is discarded, false otherwise.
408 */
409static inline bool
410__event_trigger_test_discard(struct ftrace_event_file *file,
411 struct ring_buffer *buffer,
412 struct ring_buffer_event *event,
413 void *entry,
414 enum event_trigger_type *tt)
415{
416 unsigned long eflags = file->flags;
417
418 if (eflags & FTRACE_EVENT_FL_TRIGGER_COND)
419 *tt = event_triggers_call(file, entry);
420
421 if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, &file->flags))
422 ring_buffer_discard_commit(buffer, event);
423 else if (!filter_check_discard(file, entry, buffer, event))
424 return false;
425
426 return true;
427}
428
429/**
430 * event_trigger_unlock_commit - handle triggers and finish event commit
431 * @file: The file pointer assoctiated to the event
432 * @buffer: The ring buffer that the event is being written to
433 * @event: The event meta data in the ring buffer
434 * @entry: The event itself
435 * @irq_flags: The state of the interrupts at the start of the event
436 * @pc: The state of the preempt count at the start of the event.
437 *
438 * This is a helper function to handle triggers that require data
439 * from the event itself. It also tests the event against filters and
440 * if the event is soft disabled and should be discarded.
441 */
442static inline void
443event_trigger_unlock_commit(struct ftrace_event_file *file,
444 struct ring_buffer *buffer,
445 struct ring_buffer_event *event,
446 void *entry, unsigned long irq_flags, int pc)
447{
448 enum event_trigger_type tt = ETT_NONE;
449
450 if (!__event_trigger_test_discard(file, buffer, event, entry, &tt))
451 trace_buffer_unlock_commit(buffer, event, irq_flags, pc);
452
453 if (tt)
454 event_triggers_post_call(file, tt);
455}
456
457/**
458 * event_trigger_unlock_commit_regs - handle triggers and finish event commit
459 * @file: The file pointer assoctiated to the event
460 * @buffer: The ring buffer that the event is being written to
461 * @event: The event meta data in the ring buffer
462 * @entry: The event itself
463 * @irq_flags: The state of the interrupts at the start of the event
464 * @pc: The state of the preempt count at the start of the event.
465 *
466 * This is a helper function to handle triggers that require data
467 * from the event itself. It also tests the event against filters and
468 * if the event is soft disabled and should be discarded.
469 *
470 * Same as event_trigger_unlock_commit() but calls
471 * trace_buffer_unlock_commit_regs() instead of trace_buffer_unlock_commit().
472 */
473static inline void
474event_trigger_unlock_commit_regs(struct ftrace_event_file *file,
475 struct ring_buffer *buffer,
476 struct ring_buffer_event *event,
477 void *entry, unsigned long irq_flags, int pc,
478 struct pt_regs *regs)
479{
480 enum event_trigger_type tt = ETT_NONE;
481
482 if (!__event_trigger_test_discard(file, buffer, event, entry, &tt))
483 trace_buffer_unlock_commit_regs(buffer, event,
484 irq_flags, pc, regs);
485
486 if (tt)
487 event_triggers_post_call(file, tt);
488}
350 489
351enum { 490enum {
352 FILTER_OTHER = 0, 491 FILTER_OTHER = 0,
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h
index 1eda33d7cb10..1c2fdaa2ffc3 100644
--- a/include/linux/genalloc.h
+++ b/include/linux/genalloc.h
@@ -30,6 +30,8 @@
30#ifndef __GENALLOC_H__ 30#ifndef __GENALLOC_H__
31#define __GENALLOC_H__ 31#define __GENALLOC_H__
32 32
33#include <linux/spinlock_types.h>
34
33struct device; 35struct device;
34struct device_node; 36struct device_node;
35 37
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h
deleted file mode 100644
index b6d657544ef1..000000000000
--- a/include/linux/generic_acl.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef LINUX_GENERIC_ACL_H
2#define LINUX_GENERIC_ACL_H
3
4#include <linux/xattr.h>
5
6struct inode;
7
8extern const struct xattr_handler generic_acl_access_handler;
9extern const struct xattr_handler generic_acl_default_handler;
10
11int generic_acl_init(struct inode *, struct inode *);
12int generic_acl_chmod(struct inode *);
13
14#endif /* LINUX_GENERIC_ACL_H */
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 9b4dd491f7e8..0437439bc047 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -1,6 +1,7 @@
1#ifndef __LINUX_GFP_H 1#ifndef __LINUX_GFP_H
2#define __LINUX_GFP_H 2#define __LINUX_GFP_H
3 3
4#include <linux/mmdebug.h>
4#include <linux/mmzone.h> 5#include <linux/mmzone.h>
5#include <linux/stddef.h> 6#include <linux/stddef.h>
6#include <linux/linkage.h> 7#include <linux/linkage.h>
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 13dfd24d01ab..b581b13d29d9 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -90,7 +90,6 @@ void devm_gpio_free(struct device *dev, unsigned int gpio);
90 90
91#include <linux/kernel.h> 91#include <linux/kernel.h>
92#include <linux/types.h> 92#include <linux/types.h>
93#include <linux/errno.h>
94#include <linux/bug.h> 93#include <linux/bug.h>
95#include <linux/pinctrl/pinctrl.h> 94#include <linux/pinctrl/pinctrl.h>
96 95
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index 3ea2cf6b0e6c..a3e181e09636 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -39,14 +39,15 @@ struct seq_file;
39 * @ngpio: the number of GPIOs handled by this controller; the last GPIO 39 * @ngpio: the number of GPIOs handled by this controller; the last GPIO
40 * handled is (base + ngpio - 1). 40 * handled is (base + ngpio - 1).
41 * @desc: array of ngpio descriptors. Private. 41 * @desc: array of ngpio descriptors. Private.
42 * @can_sleep: flag must be set iff get()/set() methods sleep, as they
43 * must while accessing GPIO expander chips over I2C or SPI
44 * @names: if set, must be an array of strings to use as alternative 42 * @names: if set, must be an array of strings to use as alternative
45 * names for the GPIOs in this chip. Any entry in the array 43 * names for the GPIOs in this chip. Any entry in the array
46 * may be NULL if there is no alias for the GPIO, however the 44 * may be NULL if there is no alias for the GPIO, however the
47 * array must be @ngpio entries long. A name can include a single printk 45 * array must be @ngpio entries long. A name can include a single printk
48 * format specifier for an unsigned int. It is substituted by the actual 46 * format specifier for an unsigned int. It is substituted by the actual
49 * number of the gpio. 47 * number of the gpio.
48 * @can_sleep: flag must be set iff get()/set() methods sleep, as they
49 * must while accessing GPIO expander chips over I2C or SPI
50 * @exported: flags if the gpiochip is exported for use from sysfs. Private.
50 * 51 *
51 * A gpio_chip can help platforms abstract various sources of GPIOs so 52 * A gpio_chip can help platforms abstract various sources of GPIOs so
52 * they can all be accessed through a common programing interface. 53 * they can all be accessed through a common programing interface.
@@ -91,8 +92,8 @@ struct gpio_chip {
91 u16 ngpio; 92 u16 ngpio;
92 struct gpio_desc *desc; 93 struct gpio_desc *desc;
93 const char *const *names; 94 const char *const *names;
94 unsigned can_sleep:1; 95 bool can_sleep;
95 unsigned exported:1; 96 bool exported;
96 97
97#if defined(CONFIG_OF_GPIO) 98#if defined(CONFIG_OF_GPIO)
98 /* 99 /*
@@ -136,59 +137,50 @@ enum gpio_lookup_flags {
136}; 137};
137 138
138/** 139/**
139 * Lookup table for associating GPIOs to specific devices and functions using 140 * struct gpiod_lookup - lookup table
140 * platform data. 141 * @chip_label: name of the chip the GPIO belongs to
142 * @chip_hwnum: hardware number (i.e. relative to the chip) of the GPIO
143 * @con_id: name of the GPIO from the device's point of view
144 * @idx: index of the GPIO in case several GPIOs share the same name
145 * @flags: mask of GPIO_* values
146 *
147 * gpiod_lookup is a lookup table for associating GPIOs to specific devices and
148 * functions using platform data.
141 */ 149 */
142struct gpiod_lookup { 150struct gpiod_lookup {
143 struct list_head list;
144 /*
145 * name of the chip the GPIO belongs to
146 */
147 const char *chip_label; 151 const char *chip_label;
148 /*
149 * hardware number (i.e. relative to the chip) of the GPIO
150 */
151 u16 chip_hwnum; 152 u16 chip_hwnum;
152 /*
153 * name of device that can claim this GPIO
154 */
155 const char *dev_id;
156 /*
157 * name of the GPIO from the device's point of view
158 */
159 const char *con_id; 153 const char *con_id;
160 /*
161 * index of the GPIO in case several GPIOs share the same name
162 */
163 unsigned int idx; 154 unsigned int idx;
164 /*
165 * mask of GPIO_* values
166 */
167 enum gpio_lookup_flags flags; 155 enum gpio_lookup_flags flags;
168}; 156};
169 157
158struct gpiod_lookup_table {
159 struct list_head list;
160 const char *dev_id;
161 struct gpiod_lookup table[];
162};
163
170/* 164/*
171 * Simple definition of a single GPIO under a con_id 165 * Simple definition of a single GPIO under a con_id
172 */ 166 */
173#define GPIO_LOOKUP(_chip_label, _chip_hwnum, _dev_id, _con_id, _flags) \ 167#define GPIO_LOOKUP(_chip_label, _chip_hwnum, _con_id, _flags) \
174 GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, 0, _flags) 168 GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _con_id, 0, _flags)
175 169
176/* 170/*
177 * Use this macro if you need to have several GPIOs under the same con_id. 171 * Use this macro if you need to have several GPIOs under the same con_id.
178 * Each GPIO needs to use a different index and can be accessed using 172 * Each GPIO needs to use a different index and can be accessed using
179 * gpiod_get_index() 173 * gpiod_get_index()
180 */ 174 */
181#define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _dev_id, _con_id, _idx, \ 175#define GPIO_LOOKUP_IDX(_chip_label, _chip_hwnum, _con_id, _idx, _flags) \
182 _flags) \
183{ \ 176{ \
184 .chip_label = _chip_label, \ 177 .chip_label = _chip_label, \
185 .chip_hwnum = _chip_hwnum, \ 178 .chip_hwnum = _chip_hwnum, \
186 .dev_id = _dev_id, \
187 .con_id = _con_id, \ 179 .con_id = _con_id, \
188 .idx = _idx, \ 180 .idx = _idx, \
189 .flags = _flags, \ 181 .flags = _flags, \
190} 182}
191 183
192void gpiod_add_table(struct gpiod_lookup *table, size_t size); 184void gpiod_add_lookup_table(struct gpiod_lookup_table *table);
193 185
194#endif 186#endif
diff --git a/include/linux/hash.h b/include/linux/hash.h
index f09a0ae4d858..bd1754c7ecef 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -15,6 +15,7 @@
15 */ 15 */
16 16
17#include <asm/types.h> 17#include <asm/types.h>
18#include <asm/hash.h>
18#include <linux/compiler.h> 19#include <linux/compiler.h>
19 20
20/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */ 21/* 2^31 + 2^29 - 2^25 + 2^22 - 2^19 - 2^16 + 1 */
@@ -78,4 +79,39 @@ static inline u32 hash32_ptr(const void *ptr)
78#endif 79#endif
79 return (u32)val; 80 return (u32)val;
80} 81}
82
83struct fast_hash_ops {
84 u32 (*hash)(const void *data, u32 len, u32 seed);
85 u32 (*hash2)(const u32 *data, u32 len, u32 seed);
86};
87
88/**
89 * arch_fast_hash - Caclulates a hash over a given buffer that can have
90 * arbitrary size. This function will eventually use an
91 * architecture-optimized hashing implementation if
92 * available, and trades off distribution for speed.
93 *
94 * @data: buffer to hash
95 * @len: length of buffer in bytes
96 * @seed: start seed
97 *
98 * Returns 32bit hash.
99 */
100extern u32 arch_fast_hash(const void *data, u32 len, u32 seed);
101
102/**
103 * arch_fast_hash2 - Caclulates a hash over a given buffer that has a
104 * size that is of a multiple of 32bit words. This
105 * function will eventually use an architecture-
106 * optimized hashing implementation if available,
107 * and trades off distribution for speed.
108 *
109 * @data: buffer to hash (must be 32bit padded)
110 * @len: number of 32bit words
111 * @seed: start seed
112 *
113 * Returns 32bit hash.
114 */
115extern u32 arch_fast_hash2(const u32 *data, u32 len, u32 seed);
116
81#endif /* _LINUX_HASH_H */ 117#endif /* _LINUX_HASH_H */
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h
index 8323775ac21d..beaf965621c1 100644
--- a/include/linux/hid-sensor-ids.h
+++ b/include/linux/hid-sensor-ids.h
@@ -23,22 +23,26 @@
23 23
24/* Accel 3D (200073) */ 24/* Accel 3D (200073) */
25#define HID_USAGE_SENSOR_ACCEL_3D 0x200073 25#define HID_USAGE_SENSOR_ACCEL_3D 0x200073
26#define HID_USAGE_SENSOR_DATA_ACCELERATION 0x200452
26#define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453 27#define HID_USAGE_SENSOR_ACCEL_X_AXIS 0x200453
27#define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454 28#define HID_USAGE_SENSOR_ACCEL_Y_AXIS 0x200454
28#define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455 29#define HID_USAGE_SENSOR_ACCEL_Z_AXIS 0x200455
29 30
30/* ALS (200041) */ 31/* ALS (200041) */
31#define HID_USAGE_SENSOR_ALS 0x200041 32#define HID_USAGE_SENSOR_ALS 0x200041
33#define HID_USAGE_SENSOR_DATA_LIGHT 0x2004d0
32#define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1 34#define HID_USAGE_SENSOR_LIGHT_ILLUM 0x2004d1
33 35
34/* Gyro 3D: (200076) */ 36/* Gyro 3D: (200076) */
35#define HID_USAGE_SENSOR_GYRO_3D 0x200076 37#define HID_USAGE_SENSOR_GYRO_3D 0x200076
38#define HID_USAGE_SENSOR_DATA_ANGL_VELOCITY 0x200456
36#define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457 39#define HID_USAGE_SENSOR_ANGL_VELOCITY_X_AXIS 0x200457
37#define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 40#define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458
38#define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 41#define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459
39 42
40/* ORIENTATION: Compass 3D: (200083) */ 43/* ORIENTATION: Compass 3D: (200083) */
41#define HID_USAGE_SENSOR_COMPASS_3D 0x200083 44#define HID_USAGE_SENSOR_COMPASS_3D 0x200083
45#define HID_USAGE_SENSOR_DATA_ORIENTATION 0x200470
42#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 46#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471
43#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 47#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472
44#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473 48#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_Y 0x200473
@@ -54,10 +58,14 @@
54#define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B 58#define HID_USAGE_SENSOR_ORIENT_DISTANCE_Y 0x20047B
55#define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C 59#define HID_USAGE_SENSOR_ORIENT_DISTANCE_Z 0x20047C
56#define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D 60#define HID_USAGE_SENSOR_ORIENT_DISTANCE_OUT_OF_RANGE 0x20047D
61
62/* ORIENTATION: Inclinometer 3D: (200086) */
63#define HID_USAGE_SENSOR_INCLINOMETER_3D 0x200086
57#define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E 64#define HID_USAGE_SENSOR_ORIENT_TILT 0x20047E
58#define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F 65#define HID_USAGE_SENSOR_ORIENT_TILT_X 0x20047F
59#define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480 66#define HID_USAGE_SENSOR_ORIENT_TILT_Y 0x200480
60#define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481 67#define HID_USAGE_SENSOR_ORIENT_TILT_Z 0x200481
68
61#define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482 69#define HID_USAGE_SENSOR_ORIENT_ROTATION_MATRIX 0x200482
62#define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483 70#define HID_USAGE_SENSOR_ORIENT_QUATERNION 0x200483
63#define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484 71#define HID_USAGE_SENSOR_ORIENT_MAGN_FLUX 0x200484
@@ -117,6 +125,10 @@
117#define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316 125#define HID_USAGE_SENSOR_PROP_REPORT_STATE 0x200316
118#define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319 126#define HID_USAGE_SENSOR_PROY_POWER_STATE 0x200319
119 127
128/* Per data field properties */
129#define HID_USAGE_SENSOR_DATA_MOD_NONE 0x00
130#define HID_USAGE_SENSOR_DATA_MOD_CHANGE_SENSITIVITY_ABS 0x1000
131
120/* Power state enumerations */ 132/* Power state enumerations */
121#define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM 0x00 133#define HID_USAGE_SENSOR_PROP_POWER_STATE_UNDEFINED_ENUM 0x00
122#define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM 0x01 134#define HID_USAGE_SENSOR_PROP_POWER_STATE_D0_FULL_POWER_ENUM 0x01
diff --git a/include/linux/host1x.h b/include/linux/host1x.h
index f5b9b87ac9a9..3af847273277 100644
--- a/include/linux/host1x.h
+++ b/include/linux/host1x.h
@@ -281,4 +281,10 @@ int host1x_device_exit(struct host1x_device *device);
281int host1x_client_register(struct host1x_client *client); 281int host1x_client_register(struct host1x_client *client);
282int host1x_client_unregister(struct host1x_client *client); 282int host1x_client_unregister(struct host1x_client *client);
283 283
284struct tegra_mipi_device;
285
286struct tegra_mipi_device *tegra_mipi_request(struct device *device);
287void tegra_mipi_free(struct tegra_mipi_device *device);
288int tegra_mipi_calibrate(struct tegra_mipi_device *device);
289
284#endif 290#endif
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 91672e2deec3..db512014e061 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -157,6 +157,26 @@ static inline int hpage_nr_pages(struct page *page)
157 return HPAGE_PMD_NR; 157 return HPAGE_PMD_NR;
158 return 1; 158 return 1;
159} 159}
160/*
161 * compound_trans_head() should be used instead of compound_head(),
162 * whenever the "page" passed as parameter could be the tail of a
163 * transparent hugepage that could be undergoing a
164 * __split_huge_page_refcount(). The page structure layout often
165 * changes across releases and it makes extensive use of unions. So if
166 * the page structure layout will change in a way that
167 * page->first_page gets clobbered by __split_huge_page_refcount, the
168 * implementation making use of smp_rmb() will be required.
169 *
170 * Currently we define compound_trans_head as compound_head, because
171 * page->private is in the same union with page->first_page, and
172 * page->private isn't clobbered. However this also means we're
173 * currently leaving dirt into the page->private field of anonymous
174 * pages resulting from a THP split, instead of setting page->private
175 * to zero like for every other page that has PG_private not set. But
176 * anonymous pages don't use page->private so this is not a problem.
177 */
178#if 0
179/* This will be needed if page->private will be clobbered in split_huge_page */
160static inline struct page *compound_trans_head(struct page *page) 180static inline struct page *compound_trans_head(struct page *page)
161{ 181{
162 if (PageTail(page)) { 182 if (PageTail(page)) {
@@ -174,6 +194,9 @@ static inline struct page *compound_trans_head(struct page *page)
174 } 194 }
175 return page; 195 return page;
176} 196}
197#else
198#define compound_trans_head(page) compound_head(page)
199#endif
177 200
178extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma, 201extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
179 unsigned long addr, pmd_t pmd, pmd_t *pmdp); 202 unsigned long addr, pmd_t pmd, pmd_t *pmdp);
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index bd7e98752222..8c43cc469d78 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -2,6 +2,7 @@
2#define _LINUX_HUGETLB_H 2#define _LINUX_HUGETLB_H
3 3
4#include <linux/mm_types.h> 4#include <linux/mm_types.h>
5#include <linux/mmdebug.h>
5#include <linux/fs.h> 6#include <linux/fs.h>
6#include <linux/hugetlb_inline.h> 7#include <linux/hugetlb_inline.h>
7#include <linux/cgroup.h> 8#include <linux/cgroup.h>
@@ -31,7 +32,6 @@ struct hugepage_subpool *hugepage_new_subpool(long nr_blocks);
31void hugepage_put_subpool(struct hugepage_subpool *spool); 32void hugepage_put_subpool(struct hugepage_subpool *spool);
32 33
33int PageHuge(struct page *page); 34int PageHuge(struct page *page);
34int PageHeadHuge(struct page *page_head);
35 35
36void reset_vma_resv_huge_pages(struct vm_area_struct *vma); 36void reset_vma_resv_huge_pages(struct vm_area_struct *vma);
37int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); 37int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
@@ -104,11 +104,6 @@ static inline int PageHuge(struct page *page)
104 return 0; 104 return 0;
105} 105}
106 106
107static inline int PageHeadHuge(struct page *page_head)
108{
109 return 0;
110}
111
112static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) 107static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma)
113{ 108{
114} 109}
@@ -360,6 +355,7 @@ static inline pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma,
360 355
361static inline struct hstate *page_hstate(struct page *page) 356static inline struct hstate *page_hstate(struct page *page)
362{ 357{
358 VM_BUG_ON_PAGE(!PageHuge(page), page);
363 return size_to_hstate(PAGE_SIZE << compound_order(page)); 359 return size_to_hstate(PAGE_SIZE << compound_order(page));
364} 360}
365 361
diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h
index ce8217f7b5c2..787bba3bf552 100644
--- a/include/linux/hugetlb_cgroup.h
+++ b/include/linux/hugetlb_cgroup.h
@@ -15,6 +15,7 @@
15#ifndef _LINUX_HUGETLB_CGROUP_H 15#ifndef _LINUX_HUGETLB_CGROUP_H
16#define _LINUX_HUGETLB_CGROUP_H 16#define _LINUX_HUGETLB_CGROUP_H
17 17
18#include <linux/mmdebug.h>
18#include <linux/res_counter.h> 19#include <linux/res_counter.h>
19 20
20struct hugetlb_cgroup; 21struct hugetlb_cgroup;
@@ -28,7 +29,7 @@ struct hugetlb_cgroup;
28 29
29static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page) 30static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page)
30{ 31{
31 VM_BUG_ON(!PageHuge(page)); 32 VM_BUG_ON_PAGE(!PageHuge(page), page);
32 33
33 if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER) 34 if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER)
34 return NULL; 35 return NULL;
@@ -38,7 +39,7 @@ static inline struct hugetlb_cgroup *hugetlb_cgroup_from_page(struct page *page)
38static inline 39static inline
39int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg) 40int set_hugetlb_cgroup(struct page *page, struct hugetlb_cgroup *h_cg)
40{ 41{
41 VM_BUG_ON(!PageHuge(page)); 42 VM_BUG_ON_PAGE(!PageHuge(page), page);
42 43
43 if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER) 44 if (compound_order(page) < HUGETLB_CGROUP_MIN_ORDER)
44 return -1; 45 return -1;
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h
index 49ed17fdf055..5388326fbbff 100644
--- a/include/linux/i2c-pnx.h
+++ b/include/linux/i2c-pnx.h
@@ -31,7 +31,6 @@ struct i2c_pnx_algo_data {
31 int last; 31 int last;
32 struct clk *clk; 32 struct clk *clk;
33 struct i2c_adapter adapter; 33 struct i2c_adapter adapter;
34 phys_addr_t base;
35 int irq; 34 int irq;
36 u32 timeout; 35 u32 timeout;
37}; 36};
diff --git a/include/linux/i2c-smbus.h b/include/linux/i2c-smbus.h
index 017fb40f702a..8f1b086ca5bc 100644
--- a/include/linux/i2c-smbus.h
+++ b/include/linux/i2c-smbus.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * i2c-smbus.h - SMBus extensions to the I2C protocol 2 * i2c-smbus.h - SMBus extensions to the I2C protocol
3 * 3 *
4 * Copyright (C) 2010 Jean Delvare <khali@linux-fr.org> 4 * Copyright (C) 2010 Jean Delvare <jdelvare@suse.de>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License as published by
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index d9c8dbd3373f..deddeb8c337c 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -342,11 +342,25 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info,
342} 342}
343#endif /* I2C_BOARDINFO */ 343#endif /* I2C_BOARDINFO */
344 344
345/* 345/**
346 * struct i2c_algorithm - represent I2C transfer method
347 * @master_xfer: Issue a set of i2c transactions to the given I2C adapter
348 * defined by the msgs array, with num messages available to transfer via
349 * the adapter specified by adap.
350 * @smbus_xfer: Issue smbus transactions to the given I2C adapter. If this
351 * is not present, then the bus layer will try and convert the SMBus calls
352 * into I2C transfers instead.
353 * @functionality: Return the flags that this algorithm/adapter pair supports
354 * from the I2C_FUNC_* flags.
355 *
346 * The following structs are for those who like to implement new bus drivers: 356 * The following structs are for those who like to implement new bus drivers:
347 * i2c_algorithm is the interface to a class of hardware solutions which can 357 * i2c_algorithm is the interface to a class of hardware solutions which can
348 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584 358 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
349 * to name two of the most common. 359 * to name two of the most common.
360 *
361 * The return codes from the @master_xfer field should indicate the type of
362 * error code that occured during the transfer, as documented in the kernel
363 * Documentation file Documentation/i2c/fault-codes.
350 */ 364 */
351struct i2c_algorithm { 365struct i2c_algorithm {
352 /* If an adapter algorithm can't do I2C-level access, set master_xfer 366 /* If an adapter algorithm can't do I2C-level access, set master_xfer
diff --git a/include/linux/i2c/tsc2007.h b/include/linux/i2c/tsc2007.h
index 506a9f7af51e..4f35b6ad3889 100644
--- a/include/linux/i2c/tsc2007.h
+++ b/include/linux/i2c/tsc2007.h
@@ -7,16 +7,14 @@ struct tsc2007_platform_data {
7 u16 model; /* 2007. */ 7 u16 model; /* 2007. */
8 u16 x_plate_ohms; /* must be non-zero value */ 8 u16 x_plate_ohms; /* must be non-zero value */
9 u16 max_rt; /* max. resistance above which samples are ignored */ 9 u16 max_rt; /* max. resistance above which samples are ignored */
10 unsigned long poll_delay; /* delay (in ms) after pen-down event
11 before polling starts */
12 unsigned long poll_period; /* time (in ms) between samples */ 10 unsigned long poll_period; /* time (in ms) between samples */
13 int fuzzx; /* fuzz factor for X, Y and pressure axes */ 11 int fuzzx; /* fuzz factor for X, Y and pressure axes */
14 int fuzzy; 12 int fuzzy;
15 int fuzzz; 13 int fuzzz;
16 14
17 int (*get_pendown_state)(void); 15 int (*get_pendown_state)(struct device *);
18 void (*clear_penirq)(void); /* If needed, clear 2nd level 16 /* If needed, clear 2nd level interrupt source */
19 interrupt source */ 17 void (*clear_penirq)(void);
20 int (*init_platform_hw)(void); 18 int (*init_platform_hw)(void);
21 void (*exit_platform_hw)(void); 19 void (*exit_platform_hw)(void);
22}; 20};
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 673a3ce67f31..ade1c06d4ceb 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -175,6 +175,9 @@ static inline int twl_class_is_ ##class(void) \
175TWL_CLASS_IS(4030, TWL4030_CLASS_ID) 175TWL_CLASS_IS(4030, TWL4030_CLASS_ID)
176TWL_CLASS_IS(6030, TWL6030_CLASS_ID) 176TWL_CLASS_IS(6030, TWL6030_CLASS_ID)
177 177
178/* Set the regcache bypass for the regmap associated with the nodule */
179int twl_set_regcache_bypass(u8 mod_no, bool enable);
180
178/* 181/*
179 * Read and write several 8-bit registers at once. 182 * Read and write several 8-bit registers at once.
180 */ 183 */
@@ -667,8 +670,6 @@ struct twl4030_codec_data {
667 unsigned int digimic_delay; /* in ms */ 670 unsigned int digimic_delay; /* in ms */
668 unsigned int ramp_delay_value; 671 unsigned int ramp_delay_value;
669 unsigned int offset_cncl_path; 672 unsigned int offset_cncl_path;
670 unsigned int check_defaults:1;
671 unsigned int reset_registers:1;
672 unsigned int hs_extmute:1; 673 unsigned int hs_extmute:1;
673 int hs_extmute_gpio; 674 int hs_extmute_gpio;
674}; 675};
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 46a14229a162..93b5ca754b5b 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -18,14 +18,10 @@
18#include <linux/completion.h> 18#include <linux/completion.h>
19#include <linux/pm.h> 19#include <linux/pm.h>
20#include <linux/mutex.h> 20#include <linux/mutex.h>
21#ifdef CONFIG_BLK_DEV_IDEACPI
22#include <acpi/acpi.h>
23#endif
24#include <asm/byteorder.h>
25#include <asm/io.h>
26
27/* for request_sense */ 21/* for request_sense */
28#include <linux/cdrom.h> 22#include <linux/cdrom.h>
23#include <asm/byteorder.h>
24#include <asm/io.h>
29 25
30#if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300) 26#if defined(CONFIG_CRIS) || defined(CONFIG_FRV) || defined(CONFIG_MN10300)
31# define SUPPORT_VLB_SYNC 0 27# define SUPPORT_VLB_SYNC 0
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 8c3b26a21574..e526a8cecb70 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -1411,8 +1411,12 @@ struct ieee80211_vht_operation {
1411#define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700 1411#define IEEE80211_VHT_CAP_RXSTBC_MASK 0x00000700
1412#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 1412#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800
1413#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 1413#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000
1414#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MAX 0x0000e000 1414#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT 13
1415#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MAX 0x00070000 1415#define IEEE80211_VHT_CAP_BEAMFORMEE_STS_MASK \
1416 (7 << IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT)
1417#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT 16
1418#define IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_MASK \
1419 (7 << IEEE80211_VHT_CAP_SOUNDING_DIMENSIONS_SHIFT)
1416#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 1420#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000
1417#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 1421#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000
1418#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 1422#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000
@@ -1853,6 +1857,7 @@ enum ieee80211_key_len {
1853 WLAN_KEY_LEN_CCMP = 16, 1857 WLAN_KEY_LEN_CCMP = 16,
1854 WLAN_KEY_LEN_TKIP = 32, 1858 WLAN_KEY_LEN_TKIP = 32,
1855 WLAN_KEY_LEN_AES_CMAC = 16, 1859 WLAN_KEY_LEN_AES_CMAC = 16,
1860 WLAN_KEY_LEN_SMS4 = 32,
1856}; 1861};
1857 1862
1858#define IEEE80211_WEP_IV_LEN 4 1863#define IEEE80211_WEP_IV_LEN 4
@@ -1898,6 +1903,7 @@ enum ieee80211_tdls_actioncode {
1898#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6) 1903#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6)
1899 1904
1900#define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6) 1905#define WLAN_EXT_CAPA8_OPMODE_NOTIF BIT(6)
1906#define WLAN_EXT_CAPA8_TDLS_WIDE_BW_ENABLED BIT(7)
1901 1907
1902/* TDLS specific payload type in the LLC/SNAP header */ 1908/* TDLS specific payload type in the LLC/SNAP header */
1903#define WLAN_TDLS_SNAP_RFTYPE 0x2 1909#define WLAN_TDLS_SNAP_RFTYPE 0x2
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 84ba5ac39e03..7c8b20b120ea 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -2,6 +2,7 @@
2#define _LINUX_IF_MACVLAN_H 2#define _LINUX_IF_MACVLAN_H
3 3
4#include <linux/if_link.h> 4#include <linux/if_link.h>
5#include <linux/if_vlan.h>
5#include <linux/list.h> 6#include <linux/list.h>
6#include <linux/netdevice.h> 7#include <linux/netdevice.h>
7#include <linux/netlink.h> 8#include <linux/netlink.h>
@@ -24,28 +25,6 @@ static inline struct socket *macvtap_get_socket(struct file *f)
24struct macvlan_port; 25struct macvlan_port;
25struct macvtap_queue; 26struct macvtap_queue;
26 27
27/**
28 * struct macvlan_pcpu_stats - MACVLAN percpu stats
29 * @rx_packets: number of received packets
30 * @rx_bytes: number of received bytes
31 * @rx_multicast: number of received multicast packets
32 * @tx_packets: number of transmitted packets
33 * @tx_bytes: number of transmitted bytes
34 * @syncp: synchronization point for 64bit counters
35 * @rx_errors: number of rx errors
36 * @tx_dropped: number of tx dropped packets
37 */
38struct macvlan_pcpu_stats {
39 u64 rx_packets;
40 u64 rx_bytes;
41 u64 rx_multicast;
42 u64 tx_packets;
43 u64 tx_bytes;
44 struct u64_stats_sync syncp;
45 u32 rx_errors;
46 u32 tx_dropped;
47};
48
49/* 28/*
50 * Maximum times a macvtap device can be opened. This can be used to 29 * Maximum times a macvtap device can be opened. This can be used to
51 * configure the number of receive queue, e.g. for multiqueue virtio. 30 * configure the number of receive queue, e.g. for multiqueue virtio.
@@ -62,15 +41,13 @@ struct macvlan_dev {
62 struct macvlan_port *port; 41 struct macvlan_port *port;
63 struct net_device *lowerdev; 42 struct net_device *lowerdev;
64 void *fwd_priv; 43 void *fwd_priv;
65 struct macvlan_pcpu_stats __percpu *pcpu_stats; 44 struct vlan_pcpu_stats __percpu *pcpu_stats;
66 45
67 DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); 46 DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ);
68 47
69 netdev_features_t set_features; 48 netdev_features_t set_features;
70 enum macvlan_mode mode; 49 enum macvlan_mode mode;
71 u16 flags; 50 u16 flags;
72 int (*receive)(struct sk_buff *skb);
73 int (*forward)(struct net_device *dev, struct sk_buff *skb);
74 /* This array tracks active taps. */ 51 /* This array tracks active taps. */
75 struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES]; 52 struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES];
76 /* This list tracks all taps (both enabled and disabled) */ 53 /* This list tracks all taps (both enabled and disabled) */
@@ -86,7 +63,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
86 bool multicast) 63 bool multicast)
87{ 64{
88 if (likely(success)) { 65 if (likely(success)) {
89 struct macvlan_pcpu_stats *pcpu_stats; 66 struct vlan_pcpu_stats *pcpu_stats;
90 67
91 pcpu_stats = this_cpu_ptr(vlan->pcpu_stats); 68 pcpu_stats = this_cpu_ptr(vlan->pcpu_stats);
92 u64_stats_update_begin(&pcpu_stats->syncp); 69 u64_stats_update_begin(&pcpu_stats->syncp);
@@ -103,10 +80,7 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
103extern void macvlan_common_setup(struct net_device *dev); 80extern void macvlan_common_setup(struct net_device *dev);
104 81
105extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, 82extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
106 struct nlattr *tb[], struct nlattr *data[], 83 struct nlattr *tb[], struct nlattr *data[]);
107 int (*receive)(struct sk_buff *skb),
108 int (*forward)(struct net_device *dev,
109 struct sk_buff *skb));
110 84
111extern void macvlan_count_rx(const struct macvlan_dev *vlan, 85extern void macvlan_count_rx(const struct macvlan_dev *vlan,
112 unsigned int len, bool success, 86 unsigned int len, bool success,
@@ -116,9 +90,6 @@ extern void macvlan_dellink(struct net_device *dev, struct list_head *head);
116 90
117extern int macvlan_link_register(struct rtnl_link_ops *ops); 91extern int macvlan_link_register(struct rtnl_link_ops *ops);
118 92
119extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
120 struct net_device *dev);
121
122#if IS_ENABLED(CONFIG_MACVLAN) 93#if IS_ENABLED(CONFIG_MACVLAN)
123static inline struct net_device * 94static inline struct net_device *
124macvlan_dev_real_dev(const struct net_device *dev) 95macvlan_dev_real_dev(const struct net_device *dev)
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index f4e56ecd0b1a..712710bc0580 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -13,13 +13,4 @@
13#define for_each_ip_tunnel_rcu(pos, start) \ 13#define for_each_ip_tunnel_rcu(pos, start) \
14 for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next)) 14 for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next))
15 15
16/* often modified stats are per cpu, other are shared (netdev->stats) */
17struct pcpu_tstats {
18 u64 rx_packets;
19 u64 rx_bytes;
20 u64 tx_packets;
21 u64 tx_bytes;
22 struct u64_stats_sync syncp;
23};
24
25#endif /* _IF_TUNNEL_H_ */ 16#endif /* _IF_TUNNEL_H_ */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index f252deb99454..bbedfb56bd66 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -82,25 +82,6 @@ static inline int is_vlan_dev(struct net_device *dev)
82#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) 82#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
83#define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK) 83#define vlan_tx_tag_get_id(__skb) ((__skb)->vlan_tci & VLAN_VID_MASK)
84 84
85#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
86
87extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
88 __be16 vlan_proto, u16 vlan_id);
89extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
90extern u16 vlan_dev_vlan_id(const struct net_device *dev);
91
92/**
93 * struct vlan_priority_tci_mapping - vlan egress priority mappings
94 * @priority: skb priority
95 * @vlan_qos: vlan priority: (skb->priority << 13) & 0xE000
96 * @next: pointer to next struct
97 */
98struct vlan_priority_tci_mapping {
99 u32 priority;
100 u16 vlan_qos;
101 struct vlan_priority_tci_mapping *next;
102};
103
104/** 85/**
105 * struct vlan_pcpu_stats - VLAN percpu rx/tx stats 86 * struct vlan_pcpu_stats - VLAN percpu rx/tx stats
106 * @rx_packets: number of received packets 87 * @rx_packets: number of received packets
@@ -123,6 +104,25 @@ struct vlan_pcpu_stats {
123 u32 tx_dropped; 104 u32 tx_dropped;
124}; 105};
125 106
107#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
108
109extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
110 __be16 vlan_proto, u16 vlan_id);
111extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
112extern u16 vlan_dev_vlan_id(const struct net_device *dev);
113
114/**
115 * struct vlan_priority_tci_mapping - vlan egress priority mappings
116 * @priority: skb priority
117 * @vlan_qos: vlan priority: (skb->priority << 13) & 0xE000
118 * @next: pointer to next struct
119 */
120struct vlan_priority_tci_mapping {
121 u32 priority;
122 u16 vlan_qos;
123 struct vlan_priority_tci_mapping *next;
124};
125
126struct proc_dir_entry; 126struct proc_dir_entry;
127struct netpoll; 127struct netpoll;
128 128
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
index 15607b45221a..519392763393 100644
--- a/include/linux/iio/buffer.h
+++ b/include/linux/iio/buffer.h
@@ -21,6 +21,8 @@ struct iio_buffer;
21 * struct iio_buffer_access_funcs - access functions for buffers. 21 * struct iio_buffer_access_funcs - access functions for buffers.
22 * @store_to: actually store stuff to the buffer 22 * @store_to: actually store stuff to the buffer
23 * @read_first_n: try to get a specified number of bytes (must exist) 23 * @read_first_n: try to get a specified number of bytes (must exist)
24 * @data_available: indicates whether data for reading from the buffer is
25 * available.
24 * @request_update: if a parameter change has been marked, update underlying 26 * @request_update: if a parameter change has been marked, update underlying
25 * storage. 27 * storage.
26 * @get_bytes_per_datum:get current bytes per datum 28 * @get_bytes_per_datum:get current bytes per datum
@@ -43,6 +45,7 @@ struct iio_buffer_access_funcs {
43 int (*read_first_n)(struct iio_buffer *buffer, 45 int (*read_first_n)(struct iio_buffer *buffer,
44 size_t n, 46 size_t n,
45 char __user *buf); 47 char __user *buf);
48 bool (*data_available)(struct iio_buffer *buffer);
46 49
47 int (*request_update)(struct iio_buffer *buffer); 50 int (*request_update)(struct iio_buffer *buffer);
48 51
diff --git a/include/linux/iio/events.h b/include/linux/iio/events.h
index 5dab2c41031f..8bbd7bc1043d 100644
--- a/include/linux/iio/events.h
+++ b/include/linux/iio/events.h
@@ -46,10 +46,6 @@ struct iio_event_data {
46 ((u16)chan)) 46 ((u16)chan))
47 47
48 48
49#define IIO_EV_DIR_MAX 4
50#define IIO_EV_BIT(type, direction) \
51 (1 << (type*IIO_EV_DIR_MAX + direction))
52
53/** 49/**
54 * IIO_MOD_EVENT_CODE() - create event identifier for modified channels 50 * IIO_MOD_EVENT_CODE() - create event identifier for modified channels
55 * @chan_type: Type of the channel. Should be one of enum iio_chan_type. 51 * @chan_type: Type of the channel. Should be one of enum iio_chan_type.
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 256a90a1bea6..75a8a20c8179 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -185,7 +185,6 @@ struct iio_event_spec {
185 * by all channels of the same direction. 185 * by all channels of the same direction.
186 * @info_mask_shared_by_all: What information is to be exported that is shared 186 * @info_mask_shared_by_all: What information is to be exported that is shared
187 * by all channels. 187 * by all channels.
188 * @event_mask: What events can this channel produce.
189 * @event_spec: Array of events which should be registered for this 188 * @event_spec: Array of events which should be registered for this
190 * channel. 189 * channel.
191 * @num_event_specs: Size of the event_spec array. 190 * @num_event_specs: Size of the event_spec array.
@@ -226,7 +225,6 @@ struct iio_chan_spec {
226 long info_mask_shared_by_type; 225 long info_mask_shared_by_type;
227 long info_mask_shared_by_dir; 226 long info_mask_shared_by_dir;
228 long info_mask_shared_by_all; 227 long info_mask_shared_by_all;
229 long event_mask;
230 const struct iio_event_spec *event_spec; 228 const struct iio_event_spec *event_spec;
231 unsigned int num_event_specs; 229 unsigned int num_event_specs;
232 const struct iio_chan_spec_ext_info *ext_info; 230 const struct iio_chan_spec_ext_info *ext_info;
@@ -307,16 +305,8 @@ struct iio_dev;
307 * returns IIO_VAL_INT_PLUS_MICRO. 305 * returns IIO_VAL_INT_PLUS_MICRO.
308 * @read_event_config: find out if the event is enabled. 306 * @read_event_config: find out if the event is enabled.
309 * @write_event_config: set if the event is enabled. 307 * @write_event_config: set if the event is enabled.
310 * @read_event_value: read a value associated with the event. Meaning 308 * @read_event_value: read a configuration value associated with the event.
311 * is event dependant. event_code specifies which event. 309 * @write_event_value: write a configuration value for the event.
312 * @write_event_value: write the value associated with the event.
313 * Meaning is event dependent.
314 * @read_event_config_new: find out if the event is enabled. New style interface.
315 * @write_event_config_new: set if the event is enabled. New style interface.
316 * @read_event_value_new: read a configuration value associated with the event.
317 * New style interface.
318 * @write_event_value_new: write a configuration value for the event. New style
319 * interface.
320 * @validate_trigger: function to validate the trigger when the 310 * @validate_trigger: function to validate the trigger when the
321 * current trigger gets changed. 311 * current trigger gets changed.
322 * @update_scan_mode: function to configure device and scan buffer when 312 * @update_scan_mode: function to configure device and scan buffer when
@@ -345,37 +335,23 @@ struct iio_info {
345 long mask); 335 long mask);
346 336
347 int (*read_event_config)(struct iio_dev *indio_dev, 337 int (*read_event_config)(struct iio_dev *indio_dev,
348 u64 event_code);
349
350 int (*write_event_config)(struct iio_dev *indio_dev,
351 u64 event_code,
352 int state);
353
354 int (*read_event_value)(struct iio_dev *indio_dev,
355 u64 event_code,
356 int *val);
357 int (*write_event_value)(struct iio_dev *indio_dev,
358 u64 event_code,
359 int val);
360
361 int (*read_event_config_new)(struct iio_dev *indio_dev,
362 const struct iio_chan_spec *chan, 338 const struct iio_chan_spec *chan,
363 enum iio_event_type type, 339 enum iio_event_type type,
364 enum iio_event_direction dir); 340 enum iio_event_direction dir);
365 341
366 int (*write_event_config_new)(struct iio_dev *indio_dev, 342 int (*write_event_config)(struct iio_dev *indio_dev,
367 const struct iio_chan_spec *chan, 343 const struct iio_chan_spec *chan,
368 enum iio_event_type type, 344 enum iio_event_type type,
369 enum iio_event_direction dir, 345 enum iio_event_direction dir,
370 int state); 346 int state);
371 347
372 int (*read_event_value_new)(struct iio_dev *indio_dev, 348 int (*read_event_value)(struct iio_dev *indio_dev,
373 const struct iio_chan_spec *chan, 349 const struct iio_chan_spec *chan,
374 enum iio_event_type type, 350 enum iio_event_type type,
375 enum iio_event_direction dir, 351 enum iio_event_direction dir,
376 enum iio_event_info info, int *val, int *val2); 352 enum iio_event_info info, int *val, int *val2);
377 353
378 int (*write_event_value_new)(struct iio_dev *indio_dev, 354 int (*write_event_value)(struct iio_dev *indio_dev,
379 const struct iio_chan_spec *chan, 355 const struct iio_chan_spec *chan,
380 enum iio_event_type type, 356 enum iio_event_type type,
381 enum iio_event_direction dir, 357 enum iio_event_direction dir,
@@ -490,32 +466,12 @@ struct iio_dev {
490#endif 466#endif
491}; 467};
492 468
493/**
494 * iio_find_channel_from_si() - get channel from its scan index
495 * @indio_dev: device
496 * @si: scan index to match
497 */
498const struct iio_chan_spec 469const struct iio_chan_spec
499*iio_find_channel_from_si(struct iio_dev *indio_dev, int si); 470*iio_find_channel_from_si(struct iio_dev *indio_dev, int si);
500
501/**
502 * iio_device_register() - register a device with the IIO subsystem
503 * @indio_dev: Device structure filled by the device driver
504 **/
505int iio_device_register(struct iio_dev *indio_dev); 471int iio_device_register(struct iio_dev *indio_dev);
506
507/**
508 * iio_device_unregister() - unregister a device from the IIO subsystem
509 * @indio_dev: Device structure representing the device.
510 **/
511void iio_device_unregister(struct iio_dev *indio_dev); 472void iio_device_unregister(struct iio_dev *indio_dev);
512 473int devm_iio_device_register(struct device *dev, struct iio_dev *indio_dev);
513/** 474void devm_iio_device_unregister(struct device *dev, struct iio_dev *indio_dev);
514 * iio_push_event() - try to add event to the list for userspace reading
515 * @indio_dev: IIO device structure
516 * @ev_code: What event
517 * @timestamp: When the event occurred
518 **/
519int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp); 475int iio_push_event(struct iio_dev *indio_dev, u64 ev_code, s64 timestamp);
520 476
521extern struct bus_type iio_bus_type; 477extern struct bus_type iio_bus_type;
@@ -579,10 +535,6 @@ static inline void *iio_device_get_drvdata(struct iio_dev *indio_dev)
579 535
580/* Can we make this smaller? */ 536/* Can we make this smaller? */
581#define IIO_ALIGN L1_CACHE_BYTES 537#define IIO_ALIGN L1_CACHE_BYTES
582/**
583 * iio_device_alloc() - allocate an iio_dev from a driver
584 * @sizeof_priv: Space to allocate for private structure.
585 **/
586struct iio_dev *iio_device_alloc(int sizeof_priv); 538struct iio_dev *iio_device_alloc(int sizeof_priv);
587 539
588static inline void *iio_priv(const struct iio_dev *indio_dev) 540static inline void *iio_priv(const struct iio_dev *indio_dev)
@@ -596,64 +548,11 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv)
596 ALIGN(sizeof(struct iio_dev), IIO_ALIGN)); 548 ALIGN(sizeof(struct iio_dev), IIO_ALIGN));
597} 549}
598 550
599/**
600 * iio_device_free() - free an iio_dev from a driver
601 * @indio_dev: the iio_dev associated with the device
602 **/
603void iio_device_free(struct iio_dev *indio_dev); 551void iio_device_free(struct iio_dev *indio_dev);
604
605/**
606 * devm_iio_device_alloc - Resource-managed iio_device_alloc()
607 * @dev: Device to allocate iio_dev for
608 * @sizeof_priv: Space to allocate for private structure.
609 *
610 * Managed iio_device_alloc. iio_dev allocated with this function is
611 * automatically freed on driver detach.
612 *
613 * If an iio_dev allocated with this function needs to be freed separately,
614 * devm_iio_device_free() must be used.
615 *
616 * RETURNS:
617 * Pointer to allocated iio_dev on success, NULL on failure.
618 */
619struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv); 552struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv);
620
621/**
622 * devm_iio_device_free - Resource-managed iio_device_free()
623 * @dev: Device this iio_dev belongs to
624 * @indio_dev: the iio_dev associated with the device
625 *
626 * Free iio_dev allocated with devm_iio_device_alloc().
627 */
628void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev); 553void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev);
629
630/**
631 * devm_iio_trigger_alloc - Resource-managed iio_trigger_alloc()
632 * @dev: Device to allocate iio_trigger for
633 * @fmt: trigger name format. If it includes format
634 * specifiers, the additional arguments following
635 * format are formatted and inserted in the resulting
636 * string replacing their respective specifiers.
637 *
638 * Managed iio_trigger_alloc. iio_trigger allocated with this function is
639 * automatically freed on driver detach.
640 *
641 * If an iio_trigger allocated with this function needs to be freed separately,
642 * devm_iio_trigger_free() must be used.
643 *
644 * RETURNS:
645 * Pointer to allocated iio_trigger on success, NULL on failure.
646 */
647struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, 554struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
648 const char *fmt, ...); 555 const char *fmt, ...);
649
650/**
651 * devm_iio_trigger_free - Resource-managed iio_trigger_free()
652 * @dev: Device this iio_dev belongs to
653 * @iio_trig: the iio_trigger associated with the device
654 *
655 * Free iio_trigger allocated with devm_iio_trigger_alloc().
656 */
657void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig); 556void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);
658 557
659/** 558/**
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
index 4ac928ee31c5..084d882fe01b 100644
--- a/include/linux/iio/types.h
+++ b/include/linux/iio/types.h
@@ -29,6 +29,7 @@ enum iio_chan_type {
29 IIO_ALTVOLTAGE, 29 IIO_ALTVOLTAGE,
30 IIO_CCT, 30 IIO_CCT,
31 IIO_PRESSURE, 31 IIO_PRESSURE,
32 IIO_HUMIDITYRELATIVE,
32}; 33};
33 34
34enum iio_modifier { 35enum iio_modifier {
diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h
index 2cf55afbcd4e..9a715cfa1fe3 100644
--- a/include/linux/inet_lro.h
+++ b/include/linux/inet_lro.h
@@ -133,33 +133,10 @@ struct net_lro_mgr {
133void lro_receive_skb(struct net_lro_mgr *lro_mgr, 133void lro_receive_skb(struct net_lro_mgr *lro_mgr,
134 struct sk_buff *skb, 134 struct sk_buff *skb,
135 void *priv); 135 void *priv);
136
137/*
138 * Processes a fragment list
139 *
140 * This functions aggregate fragments and generate SKBs do pass
141 * the packets to the stack.
142 *
143 * @lro_mgr: LRO manager to use
144 * @frags: Fragment to be processed. Must contain entire header in first
145 * element.
146 * @len: Length of received data
147 * @true_size: Actual size of memory the fragment is consuming
148 * @priv: Private data that may be used by driver functions
149 * (for example get_tcp_ip_hdr)
150 */
151
152void lro_receive_frags(struct net_lro_mgr *lro_mgr,
153 struct skb_frag_struct *frags,
154 int len, int true_size, void *priv, __wsum sum);
155
156/* 136/*
157 * Forward all aggregated SKBs held by lro_mgr to network stack 137 * Forward all aggregated SKBs held by lro_mgr to network stack
158 */ 138 */
159 139
160void lro_flush_all(struct net_lro_mgr *lro_mgr); 140void lro_flush_all(struct net_lro_mgr *lro_mgr);
161 141
162void lro_flush_pkt(struct net_lro_mgr *lro_mgr,
163 struct iphdr *iph, struct tcphdr *tcph);
164
165#endif 142#endif
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 0d678aefe69d..0068708161ff 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -136,8 +136,8 @@ struct in_ifaddr {
136 __be32 ifa_mask; 136 __be32 ifa_mask;
137 __be32 ifa_broadcast; 137 __be32 ifa_broadcast;
138 unsigned char ifa_scope; 138 unsigned char ifa_scope;
139 unsigned char ifa_flags;
140 unsigned char ifa_prefixlen; 139 unsigned char ifa_prefixlen;
140 __u32 ifa_flags;
141 char ifa_label[IFNAMSIZ]; 141 char ifa_label[IFNAMSIZ];
142 142
143 /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */ 143 /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */
@@ -164,11 +164,10 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *);
164void devinet_init(void); 164void devinet_init(void);
165struct in_device *inetdev_by_index(struct net *, int); 165struct in_device *inetdev_by_index(struct net *, int);
166__be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); 166__be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope);
167__be32 inet_confirm_addr(struct in_device *in_dev, __be32 dst, __be32 local, 167__be32 inet_confirm_addr(struct net *net, struct in_device *in_dev, __be32 dst,
168 int scope); 168 __be32 local, int scope);
169struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, 169struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix,
170 __be32 mask); 170 __be32 mask);
171
172static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) 171static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
173{ 172{
174 return !((addr^ifa->ifa_address)&ifa->ifa_mask); 173 return !((addr^ifa->ifa_address)&ifa->ifa_mask);
@@ -220,6 +219,13 @@ static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev)
220 return rtnl_dereference(dev->ip_ptr); 219 return rtnl_dereference(dev->ip_ptr);
221} 220}
222 221
222static inline struct neigh_parms *__in_dev_arp_parms_get_rcu(const struct net_device *dev)
223{
224 struct in_device *in_dev = __in_dev_get_rcu(dev);
225
226 return in_dev ? in_dev->arp_parms : NULL;
227}
228
223void in_dev_finish_destroy(struct in_device *idev); 229void in_dev_finish_destroy(struct in_device *idev);
224 230
225static inline void in_dev_put(struct in_device *idev) 231static inline void in_dev_put(struct in_device *idev)
diff --git a/include/linux/init.h b/include/linux/init.h
index 8e68a64bfe00..e1688802964f 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -286,9 +286,11 @@ void __init parse_early_options(char *cmdline);
286#define arch_initcall(fn) module_init(fn) 286#define arch_initcall(fn) module_init(fn)
287#define subsys_initcall(fn) module_init(fn) 287#define subsys_initcall(fn) module_init(fn)
288#define fs_initcall(fn) module_init(fn) 288#define fs_initcall(fn) module_init(fn)
289#define rootfs_initcall(fn) module_init(fn)
289#define device_initcall(fn) module_init(fn) 290#define device_initcall(fn) module_init(fn)
290#define late_initcall(fn) module_init(fn) 291#define late_initcall(fn) module_init(fn)
291 292
293#define console_initcall(fn) module_init(fn)
292#define security_initcall(fn) module_init(fn) 294#define security_initcall(fn) module_init(fn)
293 295
294/* Each module must use one module_init(). */ 296/* Each module must use one module_init(). */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index f0e52383a001..6df7f9fe0d01 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -41,6 +41,7 @@ extern struct fs_struct init_fs;
41 41
42#define INIT_SIGNALS(sig) { \ 42#define INIT_SIGNALS(sig) { \
43 .nr_threads = 1, \ 43 .nr_threads = 1, \
44 .thread_head = LIST_HEAD_INIT(init_task.thread_node), \
44 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ 45 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
45 .shared_pending = { \ 46 .shared_pending = { \
46 .list = LIST_HEAD_INIT(sig.shared_pending.list), \ 47 .list = LIST_HEAD_INIT(sig.shared_pending.list), \
@@ -96,7 +97,7 @@ extern struct group_info init_groups;
96#ifdef CONFIG_AUDITSYSCALL 97#ifdef CONFIG_AUDITSYSCALL
97#define INIT_IDS \ 98#define INIT_IDS \
98 .loginuid = INVALID_UID, \ 99 .loginuid = INVALID_UID, \
99 .sessionid = -1, 100 .sessionid = (unsigned int)-1,
100#else 101#else
101#define INIT_IDS 102#define INIT_IDS
102#endif 103#endif
@@ -222,6 +223,7 @@ extern struct task_group root_task_group;
222 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ 223 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \
223 }, \ 224 }, \
224 .thread_group = LIST_HEAD_INIT(tsk.thread_group), \ 225 .thread_group = LIST_HEAD_INIT(tsk.thread_group), \
226 .thread_node = LIST_HEAD_INIT(init_signals.thread_head), \
225 INIT_IDS \ 227 INIT_IDS \
226 INIT_PERF_EVENTS(tsk) \ 228 INIT_PERF_EVENTS(tsk) \
227 INIT_TRACE_IRQFLAGS \ 229 INIT_TRACE_IRQFLAGS \
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index d380c5e68008..2c4bed593b32 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -288,6 +288,7 @@ struct q_inval {
288 288
289struct ir_table { 289struct ir_table {
290 struct irte *base; 290 struct irte *base;
291 unsigned long *bitmap;
291}; 292};
292#endif 293#endif
293 294
@@ -347,8 +348,6 @@ static inline void __iommu_flush_cache(
347extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev); 348extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev);
348extern int dmar_find_matched_atsr_unit(struct pci_dev *dev); 349extern int dmar_find_matched_atsr_unit(struct pci_dev *dev);
349 350
350extern int alloc_iommu(struct dmar_drhd_unit *drhd);
351extern void free_iommu(struct intel_iommu *iommu);
352extern int dmar_enable_qi(struct intel_iommu *iommu); 351extern int dmar_enable_qi(struct intel_iommu *iommu);
353extern void dmar_disable_qi(struct intel_iommu *iommu); 352extern void dmar_disable_qi(struct intel_iommu *iommu);
354extern int dmar_reenable_qi(struct intel_iommu *iommu); 353extern int dmar_reenable_qi(struct intel_iommu *iommu);
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index db43b58a3355..0053adde0ed9 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -360,7 +360,7 @@ enum
360/* map softirq index to softirq name. update 'softirq_to_name' in 360/* map softirq index to softirq name. update 'softirq_to_name' in
361 * kernel/softirq.c when adding a new softirq. 361 * kernel/softirq.c when adding a new softirq.
362 */ 362 */
363extern char *softirq_to_name[NR_SOFTIRQS]; 363extern const char * const softirq_to_name[NR_SOFTIRQS];
364 364
365/* softirq mask and active fields moved to irq_cpustat_t in 365/* softirq mask and active fields moved to irq_cpustat_t in
366 * asm/hardirq.h to get better cache usage. KAO 366 * asm/hardirq.h to get better cache usage. KAO
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index a444c790fa72..b96a5b2136e4 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -24,9 +24,10 @@
24#include <linux/types.h> 24#include <linux/types.h>
25#include <trace/events/iommu.h> 25#include <trace/events/iommu.h>
26 26
27#define IOMMU_READ (1) 27#define IOMMU_READ (1 << 0)
28#define IOMMU_WRITE (2) 28#define IOMMU_WRITE (1 << 1)
29#define IOMMU_CACHE (4) /* DMA cache coherency */ 29#define IOMMU_CACHE (1 << 2) /* DMA cache coherency */
30#define IOMMU_EXEC (1 << 3)
30 31
31struct iommu_ops; 32struct iommu_ops;
32struct iommu_group; 33struct iommu_group;
@@ -247,6 +248,11 @@ static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
247 return NULL; 248 return NULL;
248} 249}
249 250
251static inline struct iommu_group *iommu_group_get_by_id(int id)
252{
253 return NULL;
254}
255
250static inline void iommu_domain_free(struct iommu_domain *domain) 256static inline void iommu_domain_free(struct iommu_domain *domain)
251{ 257{
252} 258}
@@ -291,8 +297,8 @@ static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_ad
291 return 0; 297 return 0;
292} 298}
293 299
294static inline int domain_has_cap(struct iommu_domain *domain, 300static inline int iommu_domain_has_cap(struct iommu_domain *domain,
295 unsigned long cap) 301 unsigned long cap)
296{ 302{
297 return 0; 303 return 0;
298} 304}
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 8d861b2651f7..9d84942ae2e5 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -11,7 +11,7 @@
11struct kern_ipc_perm 11struct kern_ipc_perm
12{ 12{
13 spinlock_t lock; 13 spinlock_t lock;
14 int deleted; 14 bool deleted;
15 int id; 15 int id;
16 key_t key; 16 key_t key;
17 kuid_t uid; 17 kuid_t uid;
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
index f6c82de12541..e7831d203737 100644
--- a/include/linux/ipc_namespace.h
+++ b/include/linux/ipc_namespace.h
@@ -21,7 +21,6 @@ struct user_namespace;
21struct ipc_ids { 21struct ipc_ids {
22 int in_use; 22 int in_use;
23 unsigned short seq; 23 unsigned short seq;
24 unsigned short seq_max;
25 struct rw_semaphore rwsem; 24 struct rw_semaphore rwsem;
26 struct idr ipcs_idr; 25 struct idr ipcs_idr;
27 int next_id; 26 int next_id;
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index c56c350324e4..2faef339d8f2 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -191,7 +191,8 @@ struct ipv6_pinfo {
191 /* sockopt flags */ 191 /* sockopt flags */
192 __u16 recverr:1, 192 __u16 recverr:1,
193 sndflow:1, 193 sndflow:1,
194 pmtudisc:2, 194 repflow:1,
195 pmtudisc:3,
195 ipv6only:1, 196 ipv6only:1,
196 srcprefs:3, /* 001: prefer temporary address 197 srcprefs:3, /* 001: prefer temporary address
197 * 010: prefer public address 198 * 010: prefer public address
@@ -200,7 +201,7 @@ struct ipv6_pinfo {
200 dontfrag:1; 201 dontfrag:1;
201 __u8 min_hopcount; 202 __u8 min_hopcount;
202 __u8 tclass; 203 __u8 tclass;
203 __u8 rcv_tclass; 204 __be32 rcv_flowinfo;
204 205
205 __u32 dst_cookie; 206 __u32 dst_cookie;
206 __u32 rx_dst_cookie; 207 __u32 rx_dst_cookie;
@@ -283,6 +284,8 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
283 284
284#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) 285#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
285#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) 286#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))
287#define ipv6_sk_rxinfo(sk) ((sk)->sk_family == PF_INET6 && \
288 inet6_sk(sk)->rxopt.bits.rxinfo)
286 289
287static inline const struct in6_addr *inet6_rcv_saddr(const struct sock *sk) 290static inline const struct in6_addr *inet6_rcv_saddr(const struct sock *sk)
288{ 291{
@@ -299,6 +302,7 @@ static inline int inet_v6_ipv6only(const struct sock *sk)
299#else 302#else
300#define __ipv6_only_sock(sk) 0 303#define __ipv6_only_sock(sk) 0
301#define ipv6_only_sock(sk) 0 304#define ipv6_only_sock(sk) 0
305#define ipv6_sk_rxinfo(sk) 0
302 306
303static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) 307static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
304{ 308{
diff --git a/include/linux/irqchip/arm-gic.h b/include/linux/irqchip/arm-gic.h
index cac496b1e279..0ceb389dba6c 100644
--- a/include/linux/irqchip/arm-gic.h
+++ b/include/linux/irqchip/arm-gic.h
@@ -17,6 +17,9 @@
17#define GIC_CPU_EOI 0x10 17#define GIC_CPU_EOI 0x10
18#define GIC_CPU_RUNNINGPRI 0x14 18#define GIC_CPU_RUNNINGPRI 0x14
19#define GIC_CPU_HIGHPRI 0x18 19#define GIC_CPU_HIGHPRI 0x18
20#define GIC_CPU_ALIAS_BINPOINT 0x1c
21#define GIC_CPU_ACTIVEPRIO 0xd0
22#define GIC_CPU_IDENT 0xfc
20 23
21#define GIC_DIST_CTRL 0x000 24#define GIC_DIST_CTRL 0x000
22#define GIC_DIST_CTR 0x004 25#define GIC_DIST_CTR 0x004
@@ -56,6 +59,15 @@
56#define GICH_LR_ACTIVE_BIT (1 << 29) 59#define GICH_LR_ACTIVE_BIT (1 << 29)
57#define GICH_LR_EOI (1 << 19) 60#define GICH_LR_EOI (1 << 19)
58 61
62#define GICH_VMCR_CTRL_SHIFT 0
63#define GICH_VMCR_CTRL_MASK (0x21f << GICH_VMCR_CTRL_SHIFT)
64#define GICH_VMCR_PRIMASK_SHIFT 27
65#define GICH_VMCR_PRIMASK_MASK (0x1f << GICH_VMCR_PRIMASK_SHIFT)
66#define GICH_VMCR_BINPOINT_SHIFT 21
67#define GICH_VMCR_BINPOINT_MASK (0x7 << GICH_VMCR_BINPOINT_SHIFT)
68#define GICH_VMCR_ALIAS_BINPOINT_SHIFT 18
69#define GICH_VMCR_ALIAS_BINPOINT_MASK (0x7 << GICH_VMCR_ALIAS_BINPOINT_SHIFT)
70
59#define GICH_MISR_EOI (1 << 0) 71#define GICH_MISR_EOI (1 << 0)
60#define GICH_MISR_U (1 << 1) 72#define GICH_MISR_U (1 << 1)
61 73
diff --git a/include/linux/irqchip/xtensa-mx.h b/include/linux/irqchip/xtensa-mx.h
new file mode 100644
index 000000000000..9c3b6ecc8b2f
--- /dev/null
+++ b/include/linux/irqchip/xtensa-mx.h
@@ -0,0 +1,17 @@
1/*
2 * Xtensa MX interrupt distributor
3 *
4 * Copyright (C) 2002 - 2013 Tensilica, Inc.
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#ifndef __LINUX_IRQCHIP_XTENSA_MX_H
12#define __LINUX_IRQCHIP_XTENSA_MX_H
13
14struct device_node;
15int xtensa_mx_init_legacy(struct device_node *interrupt_parent);
16
17#endif /* __LINUX_IRQCHIP_XTENSA_MX_H */
diff --git a/include/linux/irqchip/xtensa-pic.h b/include/linux/irqchip/xtensa-pic.h
new file mode 100644
index 000000000000..48718ae5ab68
--- /dev/null
+++ b/include/linux/irqchip/xtensa-pic.h
@@ -0,0 +1,18 @@
1/*
2 * Xtensa built-in interrupt controller
3 *
4 * Copyright (C) 2002 - 2013 Tensilica, Inc.
5 * Copyright (C) 1992, 1998 Linus Torvalds, Ingo Molnar
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11
12#ifndef __LINUX_IRQCHIP_XTENSA_PIC_H
13#define __LINUX_IRQCHIP_XTENSA_PIC_H
14
15struct device_node;
16int xtensa_pic_init_legacy(struct device_node *interrupt_parent);
17
18#endif /* __LINUX_IRQCHIP_XTENSA_PIC_H */
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 56fb646909dc..26e2661d3935 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -152,6 +152,14 @@ static inline int irq_balancing_disabled(unsigned int irq)
152 return desc->status_use_accessors & IRQ_NO_BALANCING_MASK; 152 return desc->status_use_accessors & IRQ_NO_BALANCING_MASK;
153} 153}
154 154
155static inline int irq_is_percpu(unsigned int irq)
156{
157 struct irq_desc *desc;
158
159 desc = irq_to_desc(irq);
160 return desc->status_use_accessors & IRQ_PER_CPU;
161}
162
155static inline void 163static inline void
156irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class) 164irq_set_lockdep_class(unsigned int irq, struct lock_class_key *class)
157{ 165{
diff --git a/include/linux/iscsi_ibft.h b/include/linux/iscsi_ibft.h
index 8ba7e5b9d62c..605cc5c333d9 100644
--- a/include/linux/iscsi_ibft.h
+++ b/include/linux/iscsi_ibft.h
@@ -21,7 +21,7 @@
21#ifndef ISCSI_IBFT_H 21#ifndef ISCSI_IBFT_H
22#define ISCSI_IBFT_H 22#define ISCSI_IBFT_H
23 23
24#include <acpi/acpi.h> 24#include <linux/acpi.h>
25 25
26/* 26/*
27 * Logical location of iSCSI Boot Format Table. 27 * Logical location of iSCSI Boot Format Table.
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index d235e88cfd7c..1f44466c1e9d 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -294,6 +294,12 @@ extern unsigned long preset_lpj;
294 */ 294 */
295extern unsigned int jiffies_to_msecs(const unsigned long j); 295extern unsigned int jiffies_to_msecs(const unsigned long j);
296extern unsigned int jiffies_to_usecs(const unsigned long j); 296extern unsigned int jiffies_to_usecs(const unsigned long j);
297
298static inline u64 jiffies_to_nsecs(const unsigned long j)
299{
300 return (u64)jiffies_to_usecs(j) * NSEC_PER_USEC;
301}
302
297extern unsigned long msecs_to_jiffies(const unsigned int m); 303extern unsigned long msecs_to_jiffies(const unsigned int m);
298extern unsigned long usecs_to_jiffies(const unsigned int u); 304extern unsigned long usecs_to_jiffies(const unsigned int u);
299extern unsigned long timespec_to_jiffies(const struct timespec *value); 305extern unsigned long timespec_to_jiffies(const struct timespec *value);
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 39999775b922..5c1dfb2a9e73 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -81,18 +81,21 @@ struct module;
81#include <linux/atomic.h> 81#include <linux/atomic.h>
82#ifdef HAVE_JUMP_LABEL 82#ifdef HAVE_JUMP_LABEL
83 83
84#define JUMP_LABEL_TRUE_BRANCH 1UL 84#define JUMP_LABEL_TYPE_FALSE_BRANCH 0UL
85#define JUMP_LABEL_TYPE_TRUE_BRANCH 1UL
86#define JUMP_LABEL_TYPE_MASK 1UL
85 87
86static 88static
87inline struct jump_entry *jump_label_get_entries(struct static_key *key) 89inline struct jump_entry *jump_label_get_entries(struct static_key *key)
88{ 90{
89 return (struct jump_entry *)((unsigned long)key->entries 91 return (struct jump_entry *)((unsigned long)key->entries
90 & ~JUMP_LABEL_TRUE_BRANCH); 92 & ~JUMP_LABEL_TYPE_MASK);
91} 93}
92 94
93static inline bool jump_label_get_branch_default(struct static_key *key) 95static inline bool jump_label_get_branch_default(struct static_key *key)
94{ 96{
95 if ((unsigned long)key->entries & JUMP_LABEL_TRUE_BRANCH) 97 if (((unsigned long)key->entries & JUMP_LABEL_TYPE_MASK) ==
98 JUMP_LABEL_TYPE_TRUE_BRANCH)
96 return true; 99 return true;
97 return false; 100 return false;
98} 101}
@@ -122,10 +125,12 @@ extern void static_key_slow_inc(struct static_key *key);
122extern void static_key_slow_dec(struct static_key *key); 125extern void static_key_slow_dec(struct static_key *key);
123extern void jump_label_apply_nops(struct module *mod); 126extern void jump_label_apply_nops(struct module *mod);
124 127
125#define STATIC_KEY_INIT_TRUE ((struct static_key) \ 128#define STATIC_KEY_INIT_TRUE ((struct static_key) \
126 { .enabled = ATOMIC_INIT(1), .entries = (void *)1 }) 129 { .enabled = ATOMIC_INIT(1), \
127#define STATIC_KEY_INIT_FALSE ((struct static_key) \ 130 .entries = (void *)JUMP_LABEL_TYPE_TRUE_BRANCH })
128 { .enabled = ATOMIC_INIT(0), .entries = (void *)0 }) 131#define STATIC_KEY_INIT_FALSE ((struct static_key) \
132 { .enabled = ATOMIC_INIT(0), \
133 .entries = (void *)JUMP_LABEL_TYPE_FALSE_BRANCH })
129 134
130#else /* !HAVE_JUMP_LABEL */ 135#else /* !HAVE_JUMP_LABEL */
131 136
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 2aa3d4b000e6..196d1ea86df0 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -29,6 +29,19 @@
29#define ULLONG_MAX (~0ULL) 29#define ULLONG_MAX (~0ULL)
30#define SIZE_MAX (~(size_t)0) 30#define SIZE_MAX (~(size_t)0)
31 31
32#define U8_MAX ((u8)~0U)
33#define S8_MAX ((s8)(U8_MAX>>1))
34#define S8_MIN ((s8)(-S8_MAX - 1))
35#define U16_MAX ((u16)~0U)
36#define S16_MAX ((s16)(U16_MAX>>1))
37#define S16_MIN ((s16)(-S16_MAX - 1))
38#define U32_MAX ((u32)~0U)
39#define S32_MAX ((s32)(U32_MAX>>1))
40#define S32_MIN ((s32)(-S32_MAX - 1))
41#define U64_MAX ((u64)~0ULL)
42#define S64_MAX ((s64)(U64_MAX>>1))
43#define S64_MIN ((s64)(-S64_MAX - 1))
44
32#define STACK_MAGIC 0xdeadbeef 45#define STACK_MAGIC 0xdeadbeef
33 46
34#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) 47#define REPEAT_BYTE(x) ((~0ul / 0xff) * (x))
@@ -193,6 +206,25 @@ extern int _cond_resched(void);
193 (__x < 0) ? -__x : __x; \ 206 (__x < 0) ? -__x : __x; \
194 }) 207 })
195 208
209/**
210 * reciprocal_scale - "scale" a value into range [0, ep_ro)
211 * @val: value
212 * @ep_ro: right open interval endpoint
213 *
214 * Perform a "reciprocal multiplication" in order to "scale" a value into
215 * range [0, ep_ro), where the upper interval endpoint is right-open.
216 * This is useful, e.g. for accessing a index of an array containing
217 * ep_ro elements, for example. Think of it as sort of modulus, only that
218 * the result isn't that of modulo. ;) Note that if initial input is a
219 * small value, then result will return 0.
220 *
221 * Return: a result based on val in interval [0, ep_ro).
222 */
223static inline u32 reciprocal_scale(u32 val, u32 ep_ro)
224{
225 return (u32)(((u64) val * ep_ro) >> 32);
226}
227
196#if defined(CONFIG_MMU) && \ 228#if defined(CONFIG_MMU) && \
197 (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP)) 229 (defined(CONFIG_PROVE_LOCKING) || defined(CONFIG_DEBUG_ATOMIC_SLEEP))
198void might_fault(void); 230void might_fault(void);
diff --git a/include/linux/kernfs.h b/include/linux/kernfs.h
new file mode 100644
index 000000000000..5be9f0228a3b
--- /dev/null
+++ b/include/linux/kernfs.h
@@ -0,0 +1,376 @@
1/*
2 * kernfs.h - pseudo filesystem decoupled from vfs locking
3 *
4 * This file is released under the GPLv2.
5 */
6
7#ifndef __LINUX_KERNFS_H
8#define __LINUX_KERNFS_H
9
10#include <linux/kernel.h>
11#include <linux/err.h>
12#include <linux/list.h>
13#include <linux/mutex.h>
14#include <linux/idr.h>
15#include <linux/lockdep.h>
16#include <linux/rbtree.h>
17#include <linux/atomic.h>
18#include <linux/completion.h>
19
20struct file;
21struct dentry;
22struct iattr;
23struct seq_file;
24struct vm_area_struct;
25struct super_block;
26struct file_system_type;
27
28struct kernfs_open_node;
29struct kernfs_iattrs;
30
31enum kernfs_node_type {
32 KERNFS_DIR = 0x0001,
33 KERNFS_FILE = 0x0002,
34 KERNFS_LINK = 0x0004,
35};
36
37#define KERNFS_TYPE_MASK 0x000f
38#define KERNFS_ACTIVE_REF KERNFS_FILE
39#define KERNFS_FLAG_MASK ~KERNFS_TYPE_MASK
40
41enum kernfs_node_flag {
42 KERNFS_REMOVED = 0x0010,
43 KERNFS_NS = 0x0020,
44 KERNFS_HAS_SEQ_SHOW = 0x0040,
45 KERNFS_HAS_MMAP = 0x0080,
46 KERNFS_LOCKDEP = 0x0100,
47 KERNFS_STATIC_NAME = 0x0200,
48};
49
50/* type-specific structures for kernfs_node union members */
51struct kernfs_elem_dir {
52 unsigned long subdirs;
53 /* children rbtree starts here and goes through kn->rb */
54 struct rb_root children;
55
56 /*
57 * The kernfs hierarchy this directory belongs to. This fits
58 * better directly in kernfs_node but is here to save space.
59 */
60 struct kernfs_root *root;
61};
62
63struct kernfs_elem_symlink {
64 struct kernfs_node *target_kn;
65};
66
67struct kernfs_elem_attr {
68 const struct kernfs_ops *ops;
69 struct kernfs_open_node *open;
70 loff_t size;
71};
72
73/*
74 * kernfs_node - the building block of kernfs hierarchy. Each and every
75 * kernfs node is represented by single kernfs_node. Most fields are
76 * private to kernfs and shouldn't be accessed directly by kernfs users.
77 *
78 * As long as s_count reference is held, the kernfs_node itself is
79 * accessible. Dereferencing elem or any other outer entity requires
80 * active reference.
81 */
82struct kernfs_node {
83 atomic_t count;
84 atomic_t active;
85#ifdef CONFIG_DEBUG_LOCK_ALLOC
86 struct lockdep_map dep_map;
87#endif
88 /* the following two fields are published */
89 struct kernfs_node *parent;
90 const char *name;
91
92 struct rb_node rb;
93
94 union {
95 struct completion *completion;
96 struct kernfs_node *removed_list;
97 } u;
98
99 const void *ns; /* namespace tag */
100 unsigned int hash; /* ns + name hash */
101 union {
102 struct kernfs_elem_dir dir;
103 struct kernfs_elem_symlink symlink;
104 struct kernfs_elem_attr attr;
105 };
106
107 void *priv;
108
109 unsigned short flags;
110 umode_t mode;
111 unsigned int ino;
112 struct kernfs_iattrs *iattr;
113};
114
115/*
116 * kernfs_dir_ops may be specified on kernfs_create_root() to support
117 * directory manipulation syscalls. These optional callbacks are invoked
118 * on the matching syscalls and can perform any kernfs operations which
119 * don't necessarily have to be the exact operation requested.
120 */
121struct kernfs_dir_ops {
122 int (*mkdir)(struct kernfs_node *parent, const char *name,
123 umode_t mode);
124 int (*rmdir)(struct kernfs_node *kn);
125 int (*rename)(struct kernfs_node *kn, struct kernfs_node *new_parent,
126 const char *new_name);
127};
128
129struct kernfs_root {
130 /* published fields */
131 struct kernfs_node *kn;
132
133 /* private fields, do not use outside kernfs proper */
134 struct ida ino_ida;
135 struct kernfs_dir_ops *dir_ops;
136};
137
138struct kernfs_open_file {
139 /* published fields */
140 struct kernfs_node *kn;
141 struct file *file;
142
143 /* private fields, do not use outside kernfs proper */
144 struct mutex mutex;
145 int event;
146 struct list_head list;
147
148 bool mmapped;
149 const struct vm_operations_struct *vm_ops;
150};
151
152struct kernfs_ops {
153 /*
154 * Read is handled by either seq_file or raw_read().
155 *
156 * If seq_show() is present, seq_file path is active. Other seq
157 * operations are optional and if not implemented, the behavior is
158 * equivalent to single_open(). @sf->private points to the
159 * associated kernfs_open_file.
160 *
161 * read() is bounced through kernel buffer and a read larger than
162 * PAGE_SIZE results in partial operation of PAGE_SIZE.
163 */
164 int (*seq_show)(struct seq_file *sf, void *v);
165
166 void *(*seq_start)(struct seq_file *sf, loff_t *ppos);
167 void *(*seq_next)(struct seq_file *sf, void *v, loff_t *ppos);
168 void (*seq_stop)(struct seq_file *sf, void *v);
169
170 ssize_t (*read)(struct kernfs_open_file *of, char *buf, size_t bytes,
171 loff_t off);
172
173 /*
174 * write() is bounced through kernel buffer and a write larger than
175 * PAGE_SIZE results in partial operation of PAGE_SIZE.
176 */
177 ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t bytes,
178 loff_t off);
179
180 int (*mmap)(struct kernfs_open_file *of, struct vm_area_struct *vma);
181
182#ifdef CONFIG_DEBUG_LOCK_ALLOC
183 struct lock_class_key lockdep_key;
184#endif
185};
186
187#ifdef CONFIG_SYSFS
188
189static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
190{
191 return kn->flags & KERNFS_TYPE_MASK;
192}
193
194/**
195 * kernfs_enable_ns - enable namespace under a directory
196 * @kn: directory of interest, should be empty
197 *
198 * This is to be called right after @kn is created to enable namespace
199 * under it. All children of @kn must have non-NULL namespace tags and
200 * only the ones which match the super_block's tag will be visible.
201 */
202static inline void kernfs_enable_ns(struct kernfs_node *kn)
203{
204 WARN_ON_ONCE(kernfs_type(kn) != KERNFS_DIR);
205 WARN_ON_ONCE(!RB_EMPTY_ROOT(&kn->dir.children));
206 kn->flags |= KERNFS_NS;
207}
208
209/**
210 * kernfs_ns_enabled - test whether namespace is enabled
211 * @kn: the node to test
212 *
213 * Test whether namespace filtering is enabled for the children of @ns.
214 */
215static inline bool kernfs_ns_enabled(struct kernfs_node *kn)
216{
217 return kn->flags & KERNFS_NS;
218}
219
220struct kernfs_node *kernfs_find_and_get_ns(struct kernfs_node *parent,
221 const char *name, const void *ns);
222void kernfs_get(struct kernfs_node *kn);
223void kernfs_put(struct kernfs_node *kn);
224
225struct kernfs_root *kernfs_create_root(struct kernfs_dir_ops *kdops,
226 void *priv);
227void kernfs_destroy_root(struct kernfs_root *root);
228
229struct kernfs_node *kernfs_create_dir_ns(struct kernfs_node *parent,
230 const char *name, umode_t mode,
231 void *priv, const void *ns);
232struct kernfs_node *__kernfs_create_file(struct kernfs_node *parent,
233 const char *name,
234 umode_t mode, loff_t size,
235 const struct kernfs_ops *ops,
236 void *priv, const void *ns,
237 bool name_is_static,
238 struct lock_class_key *key);
239struct kernfs_node *kernfs_create_link(struct kernfs_node *parent,
240 const char *name,
241 struct kernfs_node *target);
242void kernfs_remove(struct kernfs_node *kn);
243int kernfs_remove_by_name_ns(struct kernfs_node *parent, const char *name,
244 const void *ns);
245int kernfs_rename_ns(struct kernfs_node *kn, struct kernfs_node *new_parent,
246 const char *new_name, const void *new_ns);
247int kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr);
248void kernfs_notify(struct kernfs_node *kn);
249
250const void *kernfs_super_ns(struct super_block *sb);
251struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags,
252 struct kernfs_root *root, const void *ns);
253void kernfs_kill_sb(struct super_block *sb);
254
255void kernfs_init(void);
256
257#else /* CONFIG_SYSFS */
258
259static inline enum kernfs_node_type kernfs_type(struct kernfs_node *kn)
260{ return 0; } /* whatever */
261
262static inline void kernfs_enable_ns(struct kernfs_node *kn) { }
263
264static inline bool kernfs_ns_enabled(struct kernfs_node *kn)
265{ return false; }
266
267static inline struct kernfs_node *
268kernfs_find_and_get_ns(struct kernfs_node *parent, const char *name,
269 const void *ns)
270{ return NULL; }
271
272static inline void kernfs_get(struct kernfs_node *kn) { }
273static inline void kernfs_put(struct kernfs_node *kn) { }
274
275static inline struct kernfs_root *
276kernfs_create_root(struct kernfs_dir_ops *kdops, void *priv)
277{ return ERR_PTR(-ENOSYS); }
278
279static inline void kernfs_destroy_root(struct kernfs_root *root) { }
280
281static inline struct kernfs_node *
282kernfs_create_dir_ns(struct kernfs_node *parent, const char *name,
283 umode_t mode, void *priv, const void *ns)
284{ return ERR_PTR(-ENOSYS); }
285
286static inline struct kernfs_node *
287__kernfs_create_file(struct kernfs_node *parent, const char *name,
288 umode_t mode, loff_t size, const struct kernfs_ops *ops,
289 void *priv, const void *ns, bool name_is_static,
290 struct lock_class_key *key)
291{ return ERR_PTR(-ENOSYS); }
292
293static inline struct kernfs_node *
294kernfs_create_link(struct kernfs_node *parent, const char *name,
295 struct kernfs_node *target)
296{ return ERR_PTR(-ENOSYS); }
297
298static inline void kernfs_remove(struct kernfs_node *kn) { }
299
300static inline int kernfs_remove_by_name_ns(struct kernfs_node *kn,
301 const char *name, const void *ns)
302{ return -ENOSYS; }
303
304static inline int kernfs_rename_ns(struct kernfs_node *kn,
305 struct kernfs_node *new_parent,
306 const char *new_name, const void *new_ns)
307{ return -ENOSYS; }
308
309static inline int kernfs_setattr(struct kernfs_node *kn,
310 const struct iattr *iattr)
311{ return -ENOSYS; }
312
313static inline void kernfs_notify(struct kernfs_node *kn) { }
314
315static inline const void *kernfs_super_ns(struct super_block *sb)
316{ return NULL; }
317
318static inline struct dentry *
319kernfs_mount_ns(struct file_system_type *fs_type, int flags,
320 struct kernfs_root *root, const void *ns)
321{ return ERR_PTR(-ENOSYS); }
322
323static inline void kernfs_kill_sb(struct super_block *sb) { }
324
325static inline void kernfs_init(void) { }
326
327#endif /* CONFIG_SYSFS */
328
329static inline struct kernfs_node *
330kernfs_find_and_get(struct kernfs_node *kn, const char *name)
331{
332 return kernfs_find_and_get_ns(kn, name, NULL);
333}
334
335static inline struct kernfs_node *
336kernfs_create_dir(struct kernfs_node *parent, const char *name, umode_t mode,
337 void *priv)
338{
339 return kernfs_create_dir_ns(parent, name, mode, priv, NULL);
340}
341
342static inline struct kernfs_node *
343kernfs_create_file_ns(struct kernfs_node *parent, const char *name,
344 umode_t mode, loff_t size, const struct kernfs_ops *ops,
345 void *priv, const void *ns)
346{
347 struct lock_class_key *key = NULL;
348
349#ifdef CONFIG_DEBUG_LOCK_ALLOC
350 key = (struct lock_class_key *)&ops->lockdep_key;
351#endif
352 return __kernfs_create_file(parent, name, mode, size, ops, priv, ns,
353 false, key);
354}
355
356static inline struct kernfs_node *
357kernfs_create_file(struct kernfs_node *parent, const char *name, umode_t mode,
358 loff_t size, const struct kernfs_ops *ops, void *priv)
359{
360 return kernfs_create_file_ns(parent, name, mode, size, ops, priv, NULL);
361}
362
363static inline int kernfs_remove_by_name(struct kernfs_node *parent,
364 const char *name)
365{
366 return kernfs_remove_by_name_ns(parent, name, NULL);
367}
368
369static inline struct dentry *
370kernfs_mount(struct file_system_type *fs_type, int flags,
371 struct kernfs_root *root)
372{
373 return kernfs_mount_ns(fs_type, flags, root, NULL);
374}
375
376#endif /* __LINUX_KERNFS_H */
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 5fd33dc1fe3a..6d4066cdb5b5 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -170,6 +170,7 @@ unsigned long paddr_vmcoreinfo_note(void);
170 170
171extern struct kimage *kexec_image; 171extern struct kimage *kexec_image;
172extern struct kimage *kexec_crash_image; 172extern struct kimage *kexec_crash_image;
173extern int kexec_load_disabled;
173 174
174#ifndef kexec_flush_icache_page 175#ifndef kexec_flush_icache_page
175#define kexec_flush_icache_page(page) 176#define kexec_flush_icache_page(page)
diff --git a/include/linux/kobj_completion.h b/include/linux/kobj_completion.h
deleted file mode 100644
index a428f6436063..000000000000
--- a/include/linux/kobj_completion.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifndef _KOBJ_COMPLETION_H_
2#define _KOBJ_COMPLETION_H_
3
4#include <linux/kobject.h>
5#include <linux/completion.h>
6
7struct kobj_completion {
8 struct kobject kc_kobj;
9 struct completion kc_unregister;
10};
11
12#define kobj_to_kobj_completion(kobj) \
13 container_of(kobj, struct kobj_completion, kc_kobj)
14
15void kobj_completion_init(struct kobj_completion *kc, struct kobj_type *ktype);
16void kobj_completion_release(struct kobject *kobj);
17void kobj_completion_del_and_wait(struct kobj_completion *kc);
18#endif /* _KOBJ_COMPLETION_H_ */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index e7ba650086ce..926afb6f6b5f 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -64,7 +64,7 @@ struct kobject {
64 struct kobject *parent; 64 struct kobject *parent;
65 struct kset *kset; 65 struct kset *kset;
66 struct kobj_type *ktype; 66 struct kobj_type *ktype;
67 struct sysfs_dirent *sd; 67 struct kernfs_node *sd;
68 struct kref kref; 68 struct kref kref;
69#ifdef CONFIG_DEBUG_KOBJECT_RELEASE 69#ifdef CONFIG_DEBUG_KOBJECT_RELEASE
70 struct delayed_work release; 70 struct delayed_work release;
diff --git a/include/linux/ksm.h b/include/linux/ksm.h
index 45c9b6a17bcb..3be6bb18562d 100644
--- a/include/linux/ksm.h
+++ b/include/linux/ksm.h
@@ -73,11 +73,7 @@ static inline void set_page_stable_node(struct page *page,
73struct page *ksm_might_need_to_copy(struct page *page, 73struct page *ksm_might_need_to_copy(struct page *page,
74 struct vm_area_struct *vma, unsigned long address); 74 struct vm_area_struct *vma, unsigned long address);
75 75
76int page_referenced_ksm(struct page *page, 76int rmap_walk_ksm(struct page *page, struct rmap_walk_control *rwc);
77 struct mem_cgroup *memcg, unsigned long *vm_flags);
78int try_to_unmap_ksm(struct page *page, enum ttu_flags flags);
79int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page *,
80 struct vm_area_struct *, unsigned long, void *), void *arg);
81void ksm_migrate_page(struct page *newpage, struct page *oldpage); 77void ksm_migrate_page(struct page *newpage, struct page *oldpage);
82 78
83#else /* !CONFIG_KSM */ 79#else /* !CONFIG_KSM */
@@ -115,13 +111,8 @@ static inline int page_referenced_ksm(struct page *page,
115 return 0; 111 return 0;
116} 112}
117 113
118static inline int try_to_unmap_ksm(struct page *page, enum ttu_flags flags) 114static inline int rmap_walk_ksm(struct page *page,
119{ 115 struct rmap_walk_control *rwc)
120 return 0;
121}
122
123static inline int rmap_walk_ksm(struct page *page, int (*rmap_one)(struct page*,
124 struct vm_area_struct *, unsigned long, void *), void *arg)
125{ 116{
126 return 0; 117 return 0;
127} 118}
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 9523d2ad7535..b8e9a43e501a 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -172,8 +172,6 @@ int kvm_io_bus_write_cookie(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
172 int len, const void *val, long cookie); 172 int len, const void *val, long cookie);
173int 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,
174 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);
177int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, 175int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
178 int len, struct kvm_io_device *dev); 176 int len, struct kvm_io_device *dev);
179int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, 177int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
@@ -463,8 +461,6 @@ void kvm_exit(void);
463 461
464void kvm_get_kvm(struct kvm *kvm); 462void kvm_get_kvm(struct kvm *kvm);
465void kvm_put_kvm(struct kvm *kvm); 463void kvm_put_kvm(struct kvm *kvm);
466void update_memslots(struct kvm_memslots *slots, struct kvm_memory_slot *new,
467 u64 last_generation);
468 464
469static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm) 465static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm)
470{ 466{
@@ -537,7 +533,6 @@ unsigned long gfn_to_hva_prot(struct kvm *kvm, gfn_t gfn, bool *writable);
537unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn); 533unsigned long gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn);
538void kvm_release_page_clean(struct page *page); 534void kvm_release_page_clean(struct page *page);
539void kvm_release_page_dirty(struct page *page); 535void kvm_release_page_dirty(struct page *page);
540void kvm_set_page_dirty(struct page *page);
541void kvm_set_page_accessed(struct page *page); 536void kvm_set_page_accessed(struct page *page);
542 537
543pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn); 538pfn_t gfn_to_pfn_atomic(struct kvm *kvm, gfn_t gfn);
@@ -549,7 +544,6 @@ pfn_t gfn_to_pfn_prot(struct kvm *kvm, gfn_t gfn, bool write_fault,
549pfn_t gfn_to_pfn_memslot(struct kvm_memory_slot *slot, gfn_t gfn); 544pfn_t gfn_to_pfn_memslot(struct kvm_memory_slot *slot, gfn_t gfn);
550pfn_t gfn_to_pfn_memslot_atomic(struct kvm_memory_slot *slot, gfn_t gfn); 545pfn_t gfn_to_pfn_memslot_atomic(struct kvm_memory_slot *slot, gfn_t gfn);
551 546
552void kvm_release_pfn_dirty(pfn_t pfn);
553void kvm_release_pfn_clean(pfn_t pfn); 547void kvm_release_pfn_clean(pfn_t pfn);
554void kvm_set_pfn_dirty(pfn_t pfn); 548void kvm_set_pfn_dirty(pfn_t pfn);
555void kvm_set_pfn_accessed(pfn_t pfn); 549void kvm_set_pfn_accessed(pfn_t pfn);
@@ -576,14 +570,11 @@ struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn);
576int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); 570int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn);
577unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn); 571unsigned long kvm_host_page_size(struct kvm *kvm, gfn_t gfn);
578void mark_page_dirty(struct kvm *kvm, gfn_t gfn); 572void mark_page_dirty(struct kvm *kvm, gfn_t gfn);
579void mark_page_dirty_in_slot(struct kvm *kvm, struct kvm_memory_slot *memslot,
580 gfn_t gfn);
581 573
582void kvm_vcpu_block(struct kvm_vcpu *vcpu); 574void kvm_vcpu_block(struct kvm_vcpu *vcpu);
583void kvm_vcpu_kick(struct kvm_vcpu *vcpu); 575void kvm_vcpu_kick(struct kvm_vcpu *vcpu);
584bool kvm_vcpu_yield_to(struct kvm_vcpu *target); 576bool kvm_vcpu_yield_to(struct kvm_vcpu *target);
585void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); 577void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu);
586void kvm_resched(struct kvm_vcpu *vcpu);
587void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); 578void kvm_load_guest_fpu(struct kvm_vcpu *vcpu);
588void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); 579void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
589 580
@@ -605,8 +596,6 @@ int kvm_get_dirty_log(struct kvm *kvm,
605int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, 596int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
606 struct kvm_dirty_log *log); 597 struct kvm_dirty_log *log);
607 598
608int kvm_vm_ioctl_set_memory_region(struct kvm *kvm,
609 struct kvm_userspace_memory_region *mem);
610int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level, 599int kvm_vm_ioctl_irq_line(struct kvm *kvm, struct kvm_irq_level *irq_level,
611 bool line_status); 600 bool line_status);
612long kvm_arch_vm_ioctl(struct file *filp, 601long kvm_arch_vm_ioctl(struct file *filp,
@@ -654,8 +643,6 @@ void kvm_arch_check_processor_compat(void *rtn);
654int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); 643int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
655int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu); 644int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu);
656 645
657void kvm_free_physmem(struct kvm *kvm);
658
659void *kvm_kvzalloc(unsigned long size); 646void *kvm_kvzalloc(unsigned long size);
660void kvm_kvfree(const void *addr); 647void kvm_kvfree(const void *addr);
661 648
@@ -1076,6 +1063,7 @@ struct kvm_device *kvm_device_from_filp(struct file *filp);
1076extern struct kvm_device_ops kvm_mpic_ops; 1063extern struct kvm_device_ops kvm_mpic_ops;
1077extern struct kvm_device_ops kvm_xics_ops; 1064extern struct kvm_device_ops kvm_xics_ops;
1078extern struct kvm_device_ops kvm_vfio_ops; 1065extern struct kvm_device_ops kvm_vfio_ops;
1066extern struct kvm_device_ops kvm_arm_vgic_v2_ops;
1079 1067
1080#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT 1068#ifdef CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT
1081 1069
@@ -1097,12 +1085,6 @@ static inline void kvm_vcpu_set_in_spin_loop(struct kvm_vcpu *vcpu, bool val)
1097static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val) 1085static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val)
1098{ 1086{
1099} 1087}
1100
1101static inline bool kvm_vcpu_eligible_for_directed_yield(struct kvm_vcpu *vcpu)
1102{
1103 return true;
1104}
1105
1106#endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */ 1088#endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */
1107#endif 1089#endif
1108 1090
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 9b503376738f..bec6dbe939a0 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -419,6 +419,8 @@ enum {
419 ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ 419 ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */
420 ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ 420 ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */
421 ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */ 421 ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */
422 ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */
423 ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */
422 424
423 /* DMA mask for user DMA control: User visible values; DO NOT 425 /* DMA mask for user DMA control: User visible values; DO NOT
424 renumber */ 426 renumber */
diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index d3e8ad23a8e0..a6a42dd02466 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -6,6 +6,11 @@
6#include <linux/export.h> 6#include <linux/export.h>
7#include <asm/linkage.h> 7#include <asm/linkage.h>
8 8
9/* Some toolchains use other characters (e.g. '`') to mark new line in macro */
10#ifndef ASM_NL
11#define ASM_NL ;
12#endif
13
9#ifdef __cplusplus 14#ifdef __cplusplus
10#define CPP_ASMLINKAGE extern "C" 15#define CPP_ASMLINKAGE extern "C"
11#else 16#else
@@ -75,21 +80,21 @@
75 80
76#ifndef ENTRY 81#ifndef ENTRY
77#define ENTRY(name) \ 82#define ENTRY(name) \
78 .globl name; \ 83 .globl name ASM_NL \
79 ALIGN; \ 84 ALIGN ASM_NL \
80 name: 85 name:
81#endif 86#endif
82#endif /* LINKER_SCRIPT */ 87#endif /* LINKER_SCRIPT */
83 88
84#ifndef WEAK 89#ifndef WEAK
85#define WEAK(name) \ 90#define WEAK(name) \
86 .weak name; \ 91 .weak name ASM_NL \
87 name: 92 name:
88#endif 93#endif
89 94
90#ifndef END 95#ifndef END
91#define END(name) \ 96#define END(name) \
92 .size name, .-name 97 .size name, .-name
93#endif 98#endif
94 99
95/* If symbol 'name' is treated as a subroutine (gets called, and returns) 100/* If symbol 'name' is treated as a subroutine (gets called, and returns)
@@ -98,8 +103,8 @@
98 */ 103 */
99#ifndef ENDPROC 104#ifndef ENDPROC
100#define ENDPROC(name) \ 105#define ENDPROC(name) \
101 .type name, @function; \ 106 .type name, @function ASM_NL \
102 END(name) 107 END(name)
103#endif 108#endif
104 109
105#endif 110#endif
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index 3d15c838116c..b42963bc81dd 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -70,9 +70,6 @@ extern int mdio45_nway_restart(const struct mdio_if_info *mdio);
70extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio, 70extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio,
71 struct ethtool_cmd *ecmd, 71 struct ethtool_cmd *ecmd,
72 u32 npage_adv, u32 npage_lpa); 72 u32 npage_adv, u32 npage_lpa);
73extern void
74mdio45_ethtool_spauseparam_an(const struct mdio_if_info *mdio,
75 const struct ethtool_pauseparam *ecmd);
76 73
77/** 74/**
78 * mdio45_ethtool_gset - get settings for ETHTOOL_GSET 75 * mdio45_ethtool_gset - get settings for ETHTOOL_GSET
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 77c60e52939d..1ef66360f0b0 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -19,9 +19,13 @@
19 19
20#define INIT_MEMBLOCK_REGIONS 128 20#define INIT_MEMBLOCK_REGIONS 128
21 21
22/* Definition of memblock flags. */
23#define MEMBLOCK_HOTPLUG 0x1 /* hotpluggable region */
24
22struct memblock_region { 25struct memblock_region {
23 phys_addr_t base; 26 phys_addr_t base;
24 phys_addr_t size; 27 phys_addr_t size;
28 unsigned long flags;
25#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 29#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
26 int nid; 30 int nid;
27#endif 31#endif
@@ -43,15 +47,21 @@ struct memblock {
43 47
44extern struct memblock memblock; 48extern struct memblock memblock;
45extern int memblock_debug; 49extern int memblock_debug;
50#ifdef CONFIG_MOVABLE_NODE
51/* If movable_node boot option specified */
52extern bool movable_node_enabled;
53#endif /* CONFIG_MOVABLE_NODE */
46 54
47#define memblock_dbg(fmt, ...) \ 55#define memblock_dbg(fmt, ...) \
48 if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) 56 if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
49 57
50phys_addr_t memblock_find_in_range_node(phys_addr_t start, phys_addr_t end, 58phys_addr_t memblock_find_in_range_node(phys_addr_t size, phys_addr_t align,
51 phys_addr_t size, phys_addr_t align, int nid); 59 phys_addr_t start, phys_addr_t end,
60 int nid);
52phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end, 61phys_addr_t memblock_find_in_range(phys_addr_t start, phys_addr_t end,
53 phys_addr_t size, phys_addr_t align); 62 phys_addr_t size, phys_addr_t align);
54phys_addr_t get_allocated_memblock_reserved_regions_info(phys_addr_t *addr); 63phys_addr_t get_allocated_memblock_reserved_regions_info(phys_addr_t *addr);
64phys_addr_t get_allocated_memblock_memory_regions_info(phys_addr_t *addr);
55void memblock_allow_resize(void); 65void memblock_allow_resize(void);
56int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid); 66int memblock_add_node(phys_addr_t base, phys_addr_t size, int nid);
57int memblock_add(phys_addr_t base, phys_addr_t size); 67int memblock_add(phys_addr_t base, phys_addr_t size);
@@ -59,6 +69,28 @@ int memblock_remove(phys_addr_t base, phys_addr_t size);
59int memblock_free(phys_addr_t base, phys_addr_t size); 69int memblock_free(phys_addr_t base, phys_addr_t size);
60int memblock_reserve(phys_addr_t base, phys_addr_t size); 70int memblock_reserve(phys_addr_t base, phys_addr_t size);
61void memblock_trim_memory(phys_addr_t align); 71void memblock_trim_memory(phys_addr_t align);
72int memblock_mark_hotplug(phys_addr_t base, phys_addr_t size);
73int memblock_clear_hotplug(phys_addr_t base, phys_addr_t size);
74#ifdef CONFIG_MOVABLE_NODE
75static inline bool memblock_is_hotpluggable(struct memblock_region *m)
76{
77 return m->flags & MEMBLOCK_HOTPLUG;
78}
79
80static inline bool movable_node_is_enabled(void)
81{
82 return movable_node_enabled;
83}
84#else
85static inline bool memblock_is_hotpluggable(struct memblock_region *m)
86{
87 return false;
88}
89static inline bool movable_node_is_enabled(void)
90{
91 return false;
92}
93#endif
62 94
63#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 95#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
64int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn, 96int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn,
@@ -87,7 +119,7 @@ void __next_free_mem_range(u64 *idx, int nid, phys_addr_t *out_start,
87/** 119/**
88 * for_each_free_mem_range - iterate through free memblock areas 120 * for_each_free_mem_range - iterate through free memblock areas
89 * @i: u64 used as loop variable 121 * @i: u64 used as loop variable
90 * @nid: node selector, %MAX_NUMNODES for all nodes 122 * @nid: node selector, %NUMA_NO_NODE for all nodes
91 * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL 123 * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
92 * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL 124 * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
93 * @p_nid: ptr to int for nid of the range, can be %NULL 125 * @p_nid: ptr to int for nid of the range, can be %NULL
@@ -107,7 +139,7 @@ void __next_free_mem_range_rev(u64 *idx, int nid, phys_addr_t *out_start,
107/** 139/**
108 * for_each_free_mem_range_reverse - rev-iterate through free memblock areas 140 * for_each_free_mem_range_reverse - rev-iterate through free memblock areas
109 * @i: u64 used as loop variable 141 * @i: u64 used as loop variable
110 * @nid: node selector, %MAX_NUMNODES for all nodes 142 * @nid: node selector, %NUMA_NO_NODE for all nodes
111 * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL 143 * @p_start: ptr to phys_addr_t for start address of the range, can be %NULL
112 * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL 144 * @p_end: ptr to phys_addr_t for end address of the range, can be %NULL
113 * @p_nid: ptr to int for nid of the range, can be %NULL 145 * @p_nid: ptr to int for nid of the range, can be %NULL
@@ -121,8 +153,21 @@ void __next_free_mem_range_rev(u64 *idx, int nid, phys_addr_t *out_start,
121 i != (u64)ULLONG_MAX; \ 153 i != (u64)ULLONG_MAX; \
122 __next_free_mem_range_rev(&i, nid, p_start, p_end, p_nid)) 154 __next_free_mem_range_rev(&i, nid, p_start, p_end, p_nid))
123 155
156static inline void memblock_set_region_flags(struct memblock_region *r,
157 unsigned long flags)
158{
159 r->flags |= flags;
160}
161
162static inline void memblock_clear_region_flags(struct memblock_region *r,
163 unsigned long flags)
164{
165 r->flags &= ~flags;
166}
167
124#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 168#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
125int memblock_set_node(phys_addr_t base, phys_addr_t size, int nid); 169int memblock_set_node(phys_addr_t base, phys_addr_t size,
170 struct memblock_type *type, int nid);
126 171
127static inline void memblock_set_region_node(struct memblock_region *r, int nid) 172static inline void memblock_set_region_node(struct memblock_region *r, int nid)
128{ 173{
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index b3e7a667e03c..abd0113b6620 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -497,10 +497,11 @@ void __memcg_kmem_commit_charge(struct page *page,
497void __memcg_kmem_uncharge_pages(struct page *page, int order); 497void __memcg_kmem_uncharge_pages(struct page *page, int order);
498 498
499int memcg_cache_id(struct mem_cgroup *memcg); 499int memcg_cache_id(struct mem_cgroup *memcg);
500int memcg_register_cache(struct mem_cgroup *memcg, struct kmem_cache *s, 500int memcg_alloc_cache_params(struct mem_cgroup *memcg, struct kmem_cache *s,
501 struct kmem_cache *root_cache); 501 struct kmem_cache *root_cache);
502void memcg_release_cache(struct kmem_cache *cachep); 502void memcg_free_cache_params(struct kmem_cache *s);
503void memcg_cache_list_add(struct mem_cgroup *memcg, struct kmem_cache *cachep); 503void memcg_register_cache(struct kmem_cache *s);
504void memcg_unregister_cache(struct kmem_cache *s);
504 505
505int memcg_update_cache_size(struct kmem_cache *s, int num_groups); 506int memcg_update_cache_size(struct kmem_cache *s, int num_groups);
506void memcg_update_array_size(int num_groups); 507void memcg_update_array_size(int num_groups);
@@ -640,19 +641,21 @@ static inline int memcg_cache_id(struct mem_cgroup *memcg)
640 return -1; 641 return -1;
641} 642}
642 643
643static inline int 644static inline int memcg_alloc_cache_params(struct mem_cgroup *memcg,
644memcg_register_cache(struct mem_cgroup *memcg, struct kmem_cache *s, 645 struct kmem_cache *s, struct kmem_cache *root_cache)
645 struct kmem_cache *root_cache)
646{ 646{
647 return 0; 647 return 0;
648} 648}
649 649
650static inline void memcg_release_cache(struct kmem_cache *cachep) 650static inline void memcg_free_cache_params(struct kmem_cache *s)
651{
652}
653
654static inline void memcg_register_cache(struct kmem_cache *s)
651{ 655{
652} 656}
653 657
654static inline void memcg_cache_list_add(struct mem_cgroup *memcg, 658static inline void memcg_unregister_cache(struct kmem_cache *s)
655 struct kmem_cache *s)
656{ 659{
657} 660}
658 661
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 9a6bbf76452d..bb7384e3c3d8 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -35,6 +35,7 @@ struct memory_block {
35}; 35};
36 36
37int arch_get_memory_phys_device(unsigned long start_pfn); 37int arch_get_memory_phys_device(unsigned long start_pfn);
38unsigned long __weak memory_block_size_bytes(void);
38 39
39/* These states are exposed to userspace as text strings in sysfs */ 40/* These states are exposed to userspace as text strings in sysfs */
40#define MEM_ONLINE (1<<0) /* exposed to userspace */ 41#define MEM_ONLINE (1<<0) /* exposed to userspace */
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 9fe426b30a41..5f1ea756aace 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -211,20 +211,8 @@ static inline void mpol_get(struct mempolicy *pol)
211{ 211{
212} 212}
213 213
214static inline struct mempolicy *mpol_dup(struct mempolicy *old)
215{
216 return NULL;
217}
218
219struct shared_policy {}; 214struct shared_policy {};
220 215
221static inline int mpol_set_shared_policy(struct shared_policy *info,
222 struct vm_area_struct *vma,
223 struct mempolicy *new)
224{
225 return -EINVAL;
226}
227
228static inline void mpol_shared_policy_init(struct shared_policy *sp, 216static inline void mpol_shared_policy_init(struct shared_policy *sp,
229 struct mempolicy *mpol) 217 struct mempolicy *mpol)
230{ 218{
@@ -234,12 +222,6 @@ static inline void mpol_free_shared_policy(struct shared_policy *p)
234{ 222{
235} 223}
236 224
237static inline struct mempolicy *
238mpol_shared_policy_lookup(struct shared_policy *sp, unsigned long idx)
239{
240 return NULL;
241}
242
243#define vma_policy(vma) NULL 225#define vma_policy(vma) NULL
244 226
245static inline int 227static inline int
@@ -266,10 +248,6 @@ static inline void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new)
266{ 248{
267} 249}
268 250
269static inline void mpol_fix_fork_child_flag(struct task_struct *p)
270{
271}
272
273static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, 251static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma,
274 unsigned long addr, gfp_t gfp_flags, 252 unsigned long addr, gfp_t gfp_flags,
275 struct mempolicy **mpol, nodemask_t **nodemask) 253 struct mempolicy **mpol, nodemask_t **nodemask)
@@ -284,12 +262,6 @@ static inline bool init_nodemask_of_mempolicy(nodemask_t *m)
284 return false; 262 return false;
285} 263}
286 264
287static inline bool mempolicy_nodemask_intersects(struct task_struct *tsk,
288 const nodemask_t *mask)
289{
290 return false;
291}
292
293static inline int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from, 265static inline int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
294 const nodemask_t *to, int flags) 266 const nodemask_t *to, int flags)
295{ 267{
@@ -307,10 +279,6 @@ static inline int mpol_parse_str(char *str, struct mempolicy **mpol)
307} 279}
308#endif 280#endif
309 281
310static inline void mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol)
311{
312}
313
314static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma, 282static inline int mpol_misplaced(struct page *page, struct vm_area_struct *vma,
315 unsigned long address) 283 unsigned long address)
316{ 284{
diff --git a/include/linux/mfd/abx500/ab8500-gpio.h b/include/linux/mfd/abx500/ab8500-gpio.h
deleted file mode 100644
index 172b2f201ae0..000000000000
--- a/include/linux/mfd/abx500/ab8500-gpio.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * Copyright ST-Ericsson 2010.
3 *
4 * Author: Bibek Basu <bibek.basu@stericsson.com>
5 * Licensed under GPLv2.
6 */
7
8#ifndef _AB8500_GPIO_H
9#define _AB8500_GPIO_H
10
11/*
12 * Platform data to register a block: only the initial gpio/irq number.
13 * Array sizes are large enough to contain all AB8500 and AB9540 GPIO
14 * registers.
15 */
16
17struct abx500_gpio_platform_data {
18 int gpio_base;
19};
20
21enum abx500_gpio_pull_updown {
22 ABX500_GPIO_PULL_DOWN = 0x0,
23 ABX500_GPIO_PULL_NONE = 0x1,
24 ABX500_GPIO_PULL_UP = 0x3,
25};
26
27enum abx500_gpio_vinsel {
28 ABX500_GPIO_VINSEL_VBAT = 0x0,
29 ABX500_GPIO_VINSEL_VIN_1V8 = 0x1,
30 ABX500_GPIO_VINSEL_VDD_BIF = 0x2,
31};
32
33#endif /* _AB8500_GPIO_H */
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index f4acd898dac9..a86ca1406fb8 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -368,7 +368,6 @@ struct ab8500 {
368}; 368};
369 369
370struct ab8500_regulator_platform_data; 370struct ab8500_regulator_platform_data;
371struct ab8500_gpio_platform_data;
372struct ab8500_codec_platform_data; 371struct ab8500_codec_platform_data;
373struct ab8500_sysctrl_platform_data; 372struct ab8500_sysctrl_platform_data;
374 373
@@ -382,7 +381,6 @@ struct ab8500_platform_data {
382 int irq_base; 381 int irq_base;
383 void (*init) (struct ab8500 *); 382 void (*init) (struct ab8500 *);
384 struct ab8500_regulator_platform_data *regulator; 383 struct ab8500_regulator_platform_data *regulator;
385 struct abx500_gpio_platform_data *gpio;
386 struct ab8500_codec_platform_data *codec; 384 struct ab8500_codec_platform_data *codec;
387 struct ab8500_sysctrl_platform_data *sysctrl; 385 struct ab8500_sysctrl_platform_data *sysctrl;
388}; 386};
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h
index cb49417f8ba9..fdf3aa376eb2 100644
--- a/include/linux/mfd/arizona/registers.h
+++ b/include/linux/mfd/arizona/registers.h
@@ -139,6 +139,7 @@
139#define ARIZONA_INPUT_ENABLES_STATUS 0x301 139#define ARIZONA_INPUT_ENABLES_STATUS 0x301
140#define ARIZONA_INPUT_RATE 0x308 140#define ARIZONA_INPUT_RATE 0x308
141#define ARIZONA_INPUT_VOLUME_RAMP 0x309 141#define ARIZONA_INPUT_VOLUME_RAMP 0x309
142#define ARIZONA_HPF_CONTROL 0x30C
142#define ARIZONA_IN1L_CONTROL 0x310 143#define ARIZONA_IN1L_CONTROL 0x310
143#define ARIZONA_ADC_DIGITAL_VOLUME_1L 0x311 144#define ARIZONA_ADC_DIGITAL_VOLUME_1L 0x311
144#define ARIZONA_DMIC1L_CONTROL 0x312 145#define ARIZONA_DMIC1L_CONTROL 0x312
@@ -160,6 +161,7 @@
160#define ARIZONA_IN4L_CONTROL 0x328 161#define ARIZONA_IN4L_CONTROL 0x328
161#define ARIZONA_ADC_DIGITAL_VOLUME_4L 0x329 162#define ARIZONA_ADC_DIGITAL_VOLUME_4L 0x329
162#define ARIZONA_DMIC4L_CONTROL 0x32A 163#define ARIZONA_DMIC4L_CONTROL 0x32A
164#define ARIZONA_IN4R_CONTROL 0x32C
163#define ARIZONA_ADC_DIGITAL_VOLUME_4R 0x32D 165#define ARIZONA_ADC_DIGITAL_VOLUME_4R 0x32D
164#define ARIZONA_DMIC4R_CONTROL 0x32E 166#define ARIZONA_DMIC4R_CONTROL 0x32E
165#define ARIZONA_OUTPUT_ENABLES_1 0x400 167#define ARIZONA_OUTPUT_ENABLES_1 0x400
@@ -224,6 +226,9 @@
224#define ARIZONA_PDM_SPK1_CTRL_2 0x491 226#define ARIZONA_PDM_SPK1_CTRL_2 0x491
225#define ARIZONA_PDM_SPK2_CTRL_1 0x492 227#define ARIZONA_PDM_SPK2_CTRL_1 0x492
226#define ARIZONA_PDM_SPK2_CTRL_2 0x493 228#define ARIZONA_PDM_SPK2_CTRL_2 0x493
229#define ARIZONA_HP1_SHORT_CIRCUIT_CTRL 0x4A0
230#define ARIZONA_HP2_SHORT_CIRCUIT_CTRL 0x4A1
231#define ARIZONA_HP3_SHORT_CIRCUIT_CTRL 0x4A2
227#define ARIZONA_SPK_CTRL_2 0x4B5 232#define ARIZONA_SPK_CTRL_2 0x4B5
228#define ARIZONA_SPK_CTRL_3 0x4B6 233#define ARIZONA_SPK_CTRL_3 0x4B6
229#define ARIZONA_DAC_COMP_1 0x4DC 234#define ARIZONA_DAC_COMP_1 0x4DC
@@ -511,6 +516,38 @@
511#define ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME 0x74D 516#define ARIZONA_AIF2TX2MIX_INPUT_3_VOLUME 0x74D
512#define ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE 0x74E 517#define ARIZONA_AIF2TX2MIX_INPUT_4_SOURCE 0x74E
513#define ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME 0x74F 518#define ARIZONA_AIF2TX2MIX_INPUT_4_VOLUME 0x74F
519#define ARIZONA_AIF2TX3MIX_INPUT_1_SOURCE 0x750
520#define ARIZONA_AIF2TX3MIX_INPUT_1_VOLUME 0x751
521#define ARIZONA_AIF2TX3MIX_INPUT_2_SOURCE 0x752
522#define ARIZONA_AIF2TX3MIX_INPUT_2_VOLUME 0x753
523#define ARIZONA_AIF2TX3MIX_INPUT_3_SOURCE 0x754
524#define ARIZONA_AIF2TX3MIX_INPUT_3_VOLUME 0x755
525#define ARIZONA_AIF2TX3MIX_INPUT_4_SOURCE 0x756
526#define ARIZONA_AIF2TX3MIX_INPUT_4_VOLUME 0x757
527#define ARIZONA_AIF2TX4MIX_INPUT_1_SOURCE 0x758
528#define ARIZONA_AIF2TX4MIX_INPUT_1_VOLUME 0x759
529#define ARIZONA_AIF2TX4MIX_INPUT_2_SOURCE 0x75A
530#define ARIZONA_AIF2TX4MIX_INPUT_2_VOLUME 0x75B
531#define ARIZONA_AIF2TX4MIX_INPUT_3_SOURCE 0x75C
532#define ARIZONA_AIF2TX4MIX_INPUT_3_VOLUME 0x75D
533#define ARIZONA_AIF2TX4MIX_INPUT_4_SOURCE 0x75E
534#define ARIZONA_AIF2TX4MIX_INPUT_4_VOLUME 0x75F
535#define ARIZONA_AIF2TX5MIX_INPUT_1_SOURCE 0x760
536#define ARIZONA_AIF2TX5MIX_INPUT_1_VOLUME 0x761
537#define ARIZONA_AIF2TX5MIX_INPUT_2_SOURCE 0x762
538#define ARIZONA_AIF2TX5MIX_INPUT_2_VOLUME 0x763
539#define ARIZONA_AIF2TX5MIX_INPUT_3_SOURCE 0x764
540#define ARIZONA_AIF2TX5MIX_INPUT_3_VOLUME 0x765
541#define ARIZONA_AIF2TX5MIX_INPUT_4_SOURCE 0x766
542#define ARIZONA_AIF2TX5MIX_INPUT_4_VOLUME 0x767
543#define ARIZONA_AIF2TX6MIX_INPUT_1_SOURCE 0x768
544#define ARIZONA_AIF2TX6MIX_INPUT_1_VOLUME 0x769
545#define ARIZONA_AIF2TX6MIX_INPUT_2_SOURCE 0x76A
546#define ARIZONA_AIF2TX6MIX_INPUT_2_VOLUME 0x76B
547#define ARIZONA_AIF2TX6MIX_INPUT_3_SOURCE 0x76C
548#define ARIZONA_AIF2TX6MIX_INPUT_3_VOLUME 0x76D
549#define ARIZONA_AIF2TX6MIX_INPUT_4_SOURCE 0x76E
550#define ARIZONA_AIF2TX6MIX_INPUT_4_VOLUME 0x76F
514#define ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE 0x780 551#define ARIZONA_AIF3TX1MIX_INPUT_1_SOURCE 0x780
515#define ARIZONA_AIF3TX1MIX_INPUT_1_VOLUME 0x781 552#define ARIZONA_AIF3TX1MIX_INPUT_1_VOLUME 0x781
516#define ARIZONA_AIF3TX1MIX_INPUT_2_SOURCE 0x782 553#define ARIZONA_AIF3TX1MIX_INPUT_2_SOURCE 0x782
@@ -2196,6 +2233,15 @@
2196/* 2233/*
2197 * R677 (0x2A5) - Mic Detect 3 2234 * R677 (0x2A5) - Mic Detect 3
2198 */ 2235 */
2236#define ARIZONA_MICD_LVL_0 0x0004 /* MICD_LVL - [2] */
2237#define ARIZONA_MICD_LVL_1 0x0008 /* MICD_LVL - [3] */
2238#define ARIZONA_MICD_LVL_2 0x0010 /* MICD_LVL - [4] */
2239#define ARIZONA_MICD_LVL_3 0x0020 /* MICD_LVL - [5] */
2240#define ARIZONA_MICD_LVL_4 0x0040 /* MICD_LVL - [6] */
2241#define ARIZONA_MICD_LVL_5 0x0080 /* MICD_LVL - [7] */
2242#define ARIZONA_MICD_LVL_6 0x0100 /* MICD_LVL - [8] */
2243#define ARIZONA_MICD_LVL_7 0x0200 /* MICD_LVL - [9] */
2244#define ARIZONA_MICD_LVL_8 0x0400 /* MICD_LVL - [10] */
2199#define ARIZONA_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */ 2245#define ARIZONA_MICD_LVL_MASK 0x07FC /* MICD_LVL - [10:2] */
2200#define ARIZONA_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */ 2246#define ARIZONA_MICD_LVL_SHIFT 2 /* MICD_LVL - [10:2] */
2201#define ARIZONA_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */ 2247#define ARIZONA_MICD_LVL_WIDTH 9 /* MICD_LVL - [10:2] */
@@ -2293,8 +2339,18 @@
2293#define ARIZONA_IN_VI_RAMP_WIDTH 3 /* IN_VI_RAMP - [2:0] */ 2339#define ARIZONA_IN_VI_RAMP_WIDTH 3 /* IN_VI_RAMP - [2:0] */
2294 2340
2295/* 2341/*
2342 * R780 (0x30C) - HPF Control
2343 */
2344#define ARIZONA_IN_HPF_CUT_MASK 0x0007 /* IN_HPF_CUT [2:0] */
2345#define ARIZONA_IN_HPF_CUT_SHIFT 0 /* IN_HPF_CUT [2:0] */
2346#define ARIZONA_IN_HPF_CUT_WIDTH 3 /* IN_HPF_CUT [2:0] */
2347
2348/*
2296 * R784 (0x310) - IN1L Control 2349 * R784 (0x310) - IN1L Control
2297 */ 2350 */
2351#define ARIZONA_IN1L_HPF_MASK 0x8000 /* IN1L_HPF - [15] */
2352#define ARIZONA_IN1L_HPF_SHIFT 15 /* IN1L_HPF - [15] */
2353#define ARIZONA_IN1L_HPF_WIDTH 1 /* IN1L_HPF - [15] */
2298#define ARIZONA_IN1_OSR_MASK 0x6000 /* IN1_OSR - [14:13] */ 2354#define ARIZONA_IN1_OSR_MASK 0x6000 /* IN1_OSR - [14:13] */
2299#define ARIZONA_IN1_OSR_SHIFT 13 /* IN1_OSR - [14:13] */ 2355#define ARIZONA_IN1_OSR_SHIFT 13 /* IN1_OSR - [14:13] */
2300#define ARIZONA_IN1_OSR_WIDTH 2 /* IN1_OSR - [14:13] */ 2356#define ARIZONA_IN1_OSR_WIDTH 2 /* IN1_OSR - [14:13] */
@@ -2333,6 +2389,9 @@
2333/* 2389/*
2334 * R788 (0x314) - IN1R Control 2390 * R788 (0x314) - IN1R Control
2335 */ 2391 */
2392#define ARIZONA_IN1R_HPF_MASK 0x8000 /* IN1R_HPF - [15] */
2393#define ARIZONA_IN1R_HPF_SHIFT 15 /* IN1R_HPF - [15] */
2394#define ARIZONA_IN1R_HPF_WIDTH 1 /* IN1R_HPF - [15] */
2336#define ARIZONA_IN1R_PGA_VOL_MASK 0x00FE /* IN1R_PGA_VOL - [7:1] */ 2395#define ARIZONA_IN1R_PGA_VOL_MASK 0x00FE /* IN1R_PGA_VOL - [7:1] */
2337#define ARIZONA_IN1R_PGA_VOL_SHIFT 1 /* IN1R_PGA_VOL - [7:1] */ 2396#define ARIZONA_IN1R_PGA_VOL_SHIFT 1 /* IN1R_PGA_VOL - [7:1] */
2338#define ARIZONA_IN1R_PGA_VOL_WIDTH 7 /* IN1R_PGA_VOL - [7:1] */ 2397#define ARIZONA_IN1R_PGA_VOL_WIDTH 7 /* IN1R_PGA_VOL - [7:1] */
@@ -2362,6 +2421,9 @@
2362/* 2421/*
2363 * R792 (0x318) - IN2L Control 2422 * R792 (0x318) - IN2L Control
2364 */ 2423 */
2424#define ARIZONA_IN2L_HPF_MASK 0x8000 /* IN2L_HPF - [15] */
2425#define ARIZONA_IN2L_HPF_SHIFT 15 /* IN2L_HPF - [15] */
2426#define ARIZONA_IN2L_HPF_WIDTH 1 /* IN2L_HPF - [15] */
2365#define ARIZONA_IN2_OSR_MASK 0x6000 /* IN2_OSR - [14:13] */ 2427#define ARIZONA_IN2_OSR_MASK 0x6000 /* IN2_OSR - [14:13] */
2366#define ARIZONA_IN2_OSR_SHIFT 13 /* IN2_OSR - [14:13] */ 2428#define ARIZONA_IN2_OSR_SHIFT 13 /* IN2_OSR - [14:13] */
2367#define ARIZONA_IN2_OSR_WIDTH 2 /* IN2_OSR - [14:13] */ 2429#define ARIZONA_IN2_OSR_WIDTH 2 /* IN2_OSR - [14:13] */
@@ -2400,6 +2462,9 @@
2400/* 2462/*
2401 * R796 (0x31C) - IN2R Control 2463 * R796 (0x31C) - IN2R Control
2402 */ 2464 */
2465#define ARIZONA_IN2R_HPF_MASK 0x8000 /* IN2R_HPF - [15] */
2466#define ARIZONA_IN2R_HPF_SHIFT 15 /* IN2R_HPF - [15] */
2467#define ARIZONA_IN2R_HPF_WIDTH 1 /* IN2R_HPF - [15] */
2403#define ARIZONA_IN2R_PGA_VOL_MASK 0x00FE /* IN2R_PGA_VOL - [7:1] */ 2468#define ARIZONA_IN2R_PGA_VOL_MASK 0x00FE /* IN2R_PGA_VOL - [7:1] */
2404#define ARIZONA_IN2R_PGA_VOL_SHIFT 1 /* IN2R_PGA_VOL - [7:1] */ 2469#define ARIZONA_IN2R_PGA_VOL_SHIFT 1 /* IN2R_PGA_VOL - [7:1] */
2405#define ARIZONA_IN2R_PGA_VOL_WIDTH 7 /* IN2R_PGA_VOL - [7:1] */ 2470#define ARIZONA_IN2R_PGA_VOL_WIDTH 7 /* IN2R_PGA_VOL - [7:1] */
@@ -2429,6 +2494,9 @@
2429/* 2494/*
2430 * R800 (0x320) - IN3L Control 2495 * R800 (0x320) - IN3L Control
2431 */ 2496 */
2497#define ARIZONA_IN3L_HPF_MASK 0x8000 /* IN3L_HPF - [15] */
2498#define ARIZONA_IN3L_HPF_SHIFT 15 /* IN3L_HPF - [15] */
2499#define ARIZONA_IN3L_HPF_WIDTH 1 /* IN3L_HPF - [15] */
2432#define ARIZONA_IN3_OSR_MASK 0x6000 /* IN3_OSR - [14:13] */ 2500#define ARIZONA_IN3_OSR_MASK 0x6000 /* IN3_OSR - [14:13] */
2433#define ARIZONA_IN3_OSR_SHIFT 13 /* IN3_OSR - [14:13] */ 2501#define ARIZONA_IN3_OSR_SHIFT 13 /* IN3_OSR - [14:13] */
2434#define ARIZONA_IN3_OSR_WIDTH 2 /* IN3_OSR - [14:13] */ 2502#define ARIZONA_IN3_OSR_WIDTH 2 /* IN3_OSR - [14:13] */
@@ -2467,6 +2535,9 @@
2467/* 2535/*
2468 * R804 (0x324) - IN3R Control 2536 * R804 (0x324) - IN3R Control
2469 */ 2537 */
2538#define ARIZONA_IN3R_HPF_MASK 0x8000 /* IN3R_HPF - [15] */
2539#define ARIZONA_IN3R_HPF_SHIFT 15 /* IN3R_HPF - [15] */
2540#define ARIZONA_IN3R_HPF_WIDTH 1 /* IN3R_HPF - [15] */
2470#define ARIZONA_IN3R_PGA_VOL_MASK 0x00FE /* IN3R_PGA_VOL - [7:1] */ 2541#define ARIZONA_IN3R_PGA_VOL_MASK 0x00FE /* IN3R_PGA_VOL - [7:1] */
2471#define ARIZONA_IN3R_PGA_VOL_SHIFT 1 /* IN3R_PGA_VOL - [7:1] */ 2542#define ARIZONA_IN3R_PGA_VOL_SHIFT 1 /* IN3R_PGA_VOL - [7:1] */
2472#define ARIZONA_IN3R_PGA_VOL_WIDTH 7 /* IN3R_PGA_VOL - [7:1] */ 2543#define ARIZONA_IN3R_PGA_VOL_WIDTH 7 /* IN3R_PGA_VOL - [7:1] */
@@ -2496,6 +2567,9 @@
2496/* 2567/*
2497 * R808 (0x328) - IN4 Control 2568 * R808 (0x328) - IN4 Control
2498 */ 2569 */
2570#define ARIZONA_IN4L_HPF_MASK 0x8000 /* IN4L_HPF - [15] */
2571#define ARIZONA_IN4L_HPF_SHIFT 15 /* IN4L_HPF - [15] */
2572#define ARIZONA_IN4L_HPF_WIDTH 1 /* IN4L_HPF - [15] */
2499#define ARIZONA_IN4_OSR_MASK 0x6000 /* IN4_OSR - [14:13] */ 2573#define ARIZONA_IN4_OSR_MASK 0x6000 /* IN4_OSR - [14:13] */
2500#define ARIZONA_IN4_OSR_SHIFT 13 /* IN4_OSR - [14:13] */ 2574#define ARIZONA_IN4_OSR_SHIFT 13 /* IN4_OSR - [14:13] */
2501#define ARIZONA_IN4_OSR_WIDTH 2 /* IN4_OSR - [14:13] */ 2575#define ARIZONA_IN4_OSR_WIDTH 2 /* IN4_OSR - [14:13] */
@@ -2526,6 +2600,13 @@
2526#define ARIZONA_IN4L_DMIC_DLY_WIDTH 6 /* IN4L_DMIC_DLY - [5:0] */ 2600#define ARIZONA_IN4L_DMIC_DLY_WIDTH 6 /* IN4L_DMIC_DLY - [5:0] */
2527 2601
2528/* 2602/*
2603 * R812 (0x32C) - IN4R Control
2604 */
2605#define ARIZONA_IN4R_HPF_MASK 0x8000 /* IN4R_HPF - [15] */
2606#define ARIZONA_IN4R_HPF_SHIFT 15 /* IN4R_HPF - [15] */
2607#define ARIZONA_IN4R_HPF_WIDTH 1 /* IN4R_HPF - [15] */
2608
2609/*
2529 * R813 (0x32D) - ADC Digital Volume 4R 2610 * R813 (0x32D) - ADC Digital Volume 4R
2530 */ 2611 */
2531#define ARIZONA_IN_VU 0x0200 /* IN_VU */ 2612#define ARIZONA_IN_VU 0x0200 /* IN_VU */
@@ -3138,6 +3219,10 @@
3138/* 3219/*
3139 * R1088 (0x440) - DRE Enable 3220 * R1088 (0x440) - DRE Enable
3140 */ 3221 */
3222#define ARIZONA_DRE3R_ENA 0x0020 /* DRE3R_ENA */
3223#define ARIZONA_DRE3R_ENA_MASK 0x0020 /* DRE3R_ENA */
3224#define ARIZONA_DRE3R_ENA_SHIFT 5 /* DRE3R_ENA */
3225#define ARIZONA_DRE3R_ENA_WIDTH 1 /* DRE3R_ENA */
3141#define ARIZONA_DRE3L_ENA 0x0010 /* DRE3L_ENA */ 3226#define ARIZONA_DRE3L_ENA 0x0010 /* DRE3L_ENA */
3142#define ARIZONA_DRE3L_ENA_MASK 0x0010 /* DRE3L_ENA */ 3227#define ARIZONA_DRE3L_ENA_MASK 0x0010 /* DRE3L_ENA */
3143#define ARIZONA_DRE3L_ENA_SHIFT 4 /* DRE3L_ENA */ 3228#define ARIZONA_DRE3L_ENA_SHIFT 4 /* DRE3L_ENA */
@@ -3260,6 +3345,30 @@
3260#define ARIZONA_SPK2_FMT_WIDTH 1 /* SPK2_FMT */ 3345#define ARIZONA_SPK2_FMT_WIDTH 1 /* SPK2_FMT */
3261 3346
3262/* 3347/*
3348 * R1184 (0x4A0) - HP1 Short Circuit Ctrl
3349 */
3350#define ARIZONA_HP1_SC_ENA 0x1000 /* HP1_SC_ENA */
3351#define ARIZONA_HP1_SC_ENA_MASK 0x1000 /* HP1_SC_ENA */
3352#define ARIZONA_HP1_SC_ENA_SHIFT 12 /* HP1_SC_ENA */
3353#define ARIZONA_HP1_SC_ENA_WIDTH 1 /* HP1_SC_ENA */
3354
3355/*
3356 * R1185 (0x4A1) - HP2 Short Circuit Ctrl
3357 */
3358#define ARIZONA_HP2_SC_ENA 0x1000 /* HP2_SC_ENA */
3359#define ARIZONA_HP2_SC_ENA_MASK 0x1000 /* HP2_SC_ENA */
3360#define ARIZONA_HP2_SC_ENA_SHIFT 12 /* HP2_SC_ENA */
3361#define ARIZONA_HP2_SC_ENA_WIDTH 1 /* HP2_SC_ENA */
3362
3363/*
3364 * R1186 (0x4A2) - HP3 Short Circuit Ctrl
3365 */
3366#define ARIZONA_HP3_SC_ENA 0x1000 /* HP3_SC_ENA */
3367#define ARIZONA_HP3_SC_ENA_MASK 0x1000 /* HP3_SC_ENA */
3368#define ARIZONA_HP3_SC_ENA_SHIFT 12 /* HP3_SC_ENA */
3369#define ARIZONA_HP3_SC_ENA_WIDTH 1 /* HP3_SC_ENA */
3370
3371/*
3263 * R1244 (0x4DC) - DAC comp 1 3372 * R1244 (0x4DC) - DAC comp 1
3264 */ 3373 */
3265#define ARIZONA_OUT_COMP_COEFF_MASK 0xFFFF /* OUT_COMP_COEFF - [15:0] */ 3374#define ARIZONA_OUT_COMP_COEFF_MASK 0xFFFF /* OUT_COMP_COEFF - [15:0] */
@@ -3726,6 +3835,35 @@
3726#define ARIZONA_AIF2TX2_SLOT_WIDTH 6 /* AIF2TX2_SLOT - [5:0] */ 3835#define ARIZONA_AIF2TX2_SLOT_WIDTH 6 /* AIF2TX2_SLOT - [5:0] */
3727 3836
3728/* 3837/*
3838 * R1355 (0x54B) - AIF2 Frame Ctrl 5
3839 */
3840#define ARIZONA_AIF2TX3_SLOT_MASK 0x003F /* AIF2TX3_SLOT - [5:0] */
3841#define ARIZONA_AIF2TX3_SLOT_SHIFT 0 /* AIF2TX3_SLOT - [5:0] */
3842#define ARIZONA_AIF2TX3_SLOT_WIDTH 6 /* AIF2TX3_SLOT - [5:0] */
3843
3844/*
3845 * R1356 (0x54C) - AIF2 Frame Ctrl 6
3846 */
3847#define ARIZONA_AIF2TX4_SLOT_MASK 0x003F /* AIF2TX4_SLOT - [5:0] */
3848#define ARIZONA_AIF2TX4_SLOT_SHIFT 0 /* AIF2TX4_SLOT - [5:0] */
3849#define ARIZONA_AIF2TX4_SLOT_WIDTH 6 /* AIF2TX4_SLOT - [5:0] */
3850
3851
3852/*
3853 * R1357 (0x54D) - AIF2 Frame Ctrl 7
3854 */
3855#define ARIZONA_AIF2TX5_SLOT_MASK 0x003F /* AIF2TX5_SLOT - [5:0] */
3856#define ARIZONA_AIF2TX5_SLOT_SHIFT 0 /* AIF2TX5_SLOT - [5:0] */
3857#define ARIZONA_AIF2TX5_SLOT_WIDTH 6 /* AIF2TX5_SLOT - [5:0] */
3858
3859/*
3860 * R1358 (0x54E) - AIF2 Frame Ctrl 8
3861 */
3862#define ARIZONA_AIF2TX6_SLOT_MASK 0x003F /* AIF2TX6_SLOT - [5:0] */
3863#define ARIZONA_AIF2TX6_SLOT_SHIFT 0 /* AIF2TX6_SLOT - [5:0] */
3864#define ARIZONA_AIF2TX6_SLOT_WIDTH 6 /* AIF2TX6_SLOT - [5:0] */
3865
3866/*
3729 * R1361 (0x551) - AIF2 Frame Ctrl 11 3867 * R1361 (0x551) - AIF2 Frame Ctrl 11
3730 */ 3868 */
3731#define ARIZONA_AIF2RX1_SLOT_MASK 0x003F /* AIF2RX1_SLOT - [5:0] */ 3869#define ARIZONA_AIF2RX1_SLOT_MASK 0x003F /* AIF2RX1_SLOT - [5:0] */
@@ -3740,8 +3878,52 @@
3740#define ARIZONA_AIF2RX2_SLOT_WIDTH 6 /* AIF2RX2_SLOT - [5:0] */ 3878#define ARIZONA_AIF2RX2_SLOT_WIDTH 6 /* AIF2RX2_SLOT - [5:0] */
3741 3879
3742/* 3880/*
3881 * R1363 (0x553) - AIF2 Frame Ctrl 13
3882 */
3883#define ARIZONA_AIF2RX3_SLOT_MASK 0x003F /* AIF2RX3_SLOT - [5:0] */
3884#define ARIZONA_AIF2RX3_SLOT_SHIFT 0 /* AIF2RX3_SLOT - [5:0] */
3885#define ARIZONA_AIF2RX3_SLOT_WIDTH 6 /* AIF2RX3_SLOT - [5:0] */
3886
3887/*
3888 * R1364 (0x554) - AIF2 Frame Ctrl 14
3889 */
3890#define ARIZONA_AIF2RX4_SLOT_MASK 0x003F /* AIF2RX4_SLOT - [5:0] */
3891#define ARIZONA_AIF2RX4_SLOT_SHIFT 0 /* AIF2RX4_SLOT - [5:0] */
3892#define ARIZONA_AIF2RX4_SLOT_WIDTH 6 /* AIF2RX4_SLOT - [5:0] */
3893
3894/*
3895 * R1365 (0x555) - AIF2 Frame Ctrl 15
3896 */
3897#define ARIZONA_AIF2RX5_SLOT_MASK 0x003F /* AIF2RX5_SLOT - [5:0] */
3898#define ARIZONA_AIF2RX5_SLOT_SHIFT 0 /* AIF2RX5_SLOT - [5:0] */
3899#define ARIZONA_AIF2RX5_SLOT_WIDTH 6 /* AIF2RX5_SLOT - [5:0] */
3900
3901/*
3902 * R1366 (0x556) - AIF2 Frame Ctrl 16
3903 */
3904#define ARIZONA_AIF2RX6_SLOT_MASK 0x003F /* AIF2RX6_SLOT - [5:0] */
3905#define ARIZONA_AIF2RX6_SLOT_SHIFT 0 /* AIF2RX6_SLOT - [5:0] */
3906#define ARIZONA_AIF2RX6_SLOT_WIDTH 6 /* AIF2RX6_SLOT - [5:0] */
3907
3908/*
3743 * R1369 (0x559) - AIF2 Tx Enables 3909 * R1369 (0x559) - AIF2 Tx Enables
3744 */ 3910 */
3911#define ARIZONA_AIF2TX6_ENA 0x0020 /* AIF2TX6_ENA */
3912#define ARIZONA_AIF2TX6_ENA_MASK 0x0020 /* AIF2TX6_ENA */
3913#define ARIZONA_AIF2TX6_ENA_SHIFT 5 /* AIF2TX6_ENA */
3914#define ARIZONA_AIF2TX6_ENA_WIDTH 1 /* AIF2TX6_ENA */
3915#define ARIZONA_AIF2TX5_ENA 0x0010 /* AIF2TX5_ENA */
3916#define ARIZONA_AIF2TX5_ENA_MASK 0x0010 /* AIF2TX5_ENA */
3917#define ARIZONA_AIF2TX5_ENA_SHIFT 4 /* AIF2TX5_ENA */
3918#define ARIZONA_AIF2TX5_ENA_WIDTH 1 /* AIF2TX5_ENA */
3919#define ARIZONA_AIF2TX4_ENA 0x0008 /* AIF2TX4_ENA */
3920#define ARIZONA_AIF2TX4_ENA_MASK 0x0008 /* AIF2TX4_ENA */
3921#define ARIZONA_AIF2TX4_ENA_SHIFT 3 /* AIF2TX4_ENA */
3922#define ARIZONA_AIF2TX4_ENA_WIDTH 1 /* AIF2TX4_ENA */
3923#define ARIZONA_AIF2TX3_ENA 0x0004 /* AIF2TX3_ENA */
3924#define ARIZONA_AIF2TX3_ENA_MASK 0x0004 /* AIF2TX3_ENA */
3925#define ARIZONA_AIF2TX3_ENA_SHIFT 2 /* AIF2TX3_ENA */
3926#define ARIZONA_AIF2TX3_ENA_WIDTH 1 /* AIF2TX3_ENA */
3745#define ARIZONA_AIF2TX2_ENA 0x0002 /* AIF2TX2_ENA */ 3927#define ARIZONA_AIF2TX2_ENA 0x0002 /* AIF2TX2_ENA */
3746#define ARIZONA_AIF2TX2_ENA_MASK 0x0002 /* AIF2TX2_ENA */ 3928#define ARIZONA_AIF2TX2_ENA_MASK 0x0002 /* AIF2TX2_ENA */
3747#define ARIZONA_AIF2TX2_ENA_SHIFT 1 /* AIF2TX2_ENA */ 3929#define ARIZONA_AIF2TX2_ENA_SHIFT 1 /* AIF2TX2_ENA */
@@ -3754,6 +3936,22 @@
3754/* 3936/*
3755 * R1370 (0x55A) - AIF2 Rx Enables 3937 * R1370 (0x55A) - AIF2 Rx Enables
3756 */ 3938 */
3939#define ARIZONA_AIF2RX6_ENA 0x0020 /* AIF2RX6_ENA */
3940#define ARIZONA_AIF2RX6_ENA_MASK 0x0020 /* AIF2RX6_ENA */
3941#define ARIZONA_AIF2RX6_ENA_SHIFT 5 /* AIF2RX6_ENA */
3942#define ARIZONA_AIF2RX6_ENA_WIDTH 1 /* AIF2RX6_ENA */
3943#define ARIZONA_AIF2RX5_ENA 0x0010 /* AIF2RX5_ENA */
3944#define ARIZONA_AIF2RX5_ENA_MASK 0x0010 /* AIF2RX5_ENA */
3945#define ARIZONA_AIF2RX5_ENA_SHIFT 4 /* AIF2RX5_ENA */
3946#define ARIZONA_AIF2RX5_ENA_WIDTH 1 /* AIF2RX5_ENA */
3947#define ARIZONA_AIF2RX4_ENA 0x0008 /* AIF2RX4_ENA */
3948#define ARIZONA_AIF2RX4_ENA_MASK 0x0008 /* AIF2RX4_ENA */
3949#define ARIZONA_AIF2RX4_ENA_SHIFT 3 /* AIF2RX4_ENA */
3950#define ARIZONA_AIF2RX4_ENA_WIDTH 1 /* AIF2RX4_ENA */
3951#define ARIZONA_AIF2RX3_ENA 0x0004 /* AIF2RX3_ENA */
3952#define ARIZONA_AIF2RX3_ENA_MASK 0x0004 /* AIF2RX3_ENA */
3953#define ARIZONA_AIF2RX3_ENA_SHIFT 2 /* AIF2RX3_ENA */
3954#define ARIZONA_AIF2RX3_ENA_WIDTH 1 /* AIF2RX3_ENA */
3757#define ARIZONA_AIF2RX2_ENA 0x0002 /* AIF2RX2_ENA */ 3955#define ARIZONA_AIF2RX2_ENA 0x0002 /* AIF2RX2_ENA */
3758#define ARIZONA_AIF2RX2_ENA_MASK 0x0002 /* AIF2RX2_ENA */ 3956#define ARIZONA_AIF2RX2_ENA_MASK 0x0002 /* AIF2RX2_ENA */
3759#define ARIZONA_AIF2RX2_ENA_SHIFT 1 /* AIF2RX2_ENA */ 3957#define ARIZONA_AIF2RX2_ENA_SHIFT 1 /* AIF2RX2_ENA */
diff --git a/include/linux/mfd/as3722.h b/include/linux/mfd/as3722.h
index 16bf8a0dcd97..8d43e9f2a842 100644
--- a/include/linux/mfd/as3722.h
+++ b/include/linux/mfd/as3722.h
@@ -151,6 +151,7 @@
151#define AS3722_ASIC_ID1_REG 0x90 151#define AS3722_ASIC_ID1_REG 0x90
152#define AS3722_ASIC_ID2_REG 0x91 152#define AS3722_ASIC_ID2_REG 0x91
153#define AS3722_LOCK_REG 0x9E 153#define AS3722_LOCK_REG 0x9E
154#define AS3722_FUSE7_REG 0xA7
154#define AS3722_MAX_REGISTER 0xF4 155#define AS3722_MAX_REGISTER 0xF4
155 156
156#define AS3722_SD0_EXT_ENABLE_MASK 0x03 157#define AS3722_SD0_EXT_ENABLE_MASK 0x03
@@ -224,6 +225,7 @@
224#define AS3722_SD_VSEL_MASK 0x7F 225#define AS3722_SD_VSEL_MASK 0x7F
225#define AS3722_SD0_VSEL_MIN 0x01 226#define AS3722_SD0_VSEL_MIN 0x01
226#define AS3722_SD0_VSEL_MAX 0x5A 227#define AS3722_SD0_VSEL_MAX 0x5A
228#define AS3722_SD0_VSEL_LOW_VOL_MAX 0x6E
227#define AS3722_SD2_VSEL_MIN 0x01 229#define AS3722_SD2_VSEL_MIN 0x01
228#define AS3722_SD2_VSEL_MAX 0x7F 230#define AS3722_SD2_VSEL_MAX 0x7F
229 231
@@ -314,6 +316,7 @@
314#define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN AS3722_GPIO_IOSF_VAL(3) 316#define AS3722_GPIO_IOSF_GPIO_INTERRUPT_IN AS3722_GPIO_IOSF_VAL(3)
315#define AS3722_GPIO_IOSF_ISINK_PWM_IN AS3722_GPIO_IOSF_VAL(4) 317#define AS3722_GPIO_IOSF_ISINK_PWM_IN AS3722_GPIO_IOSF_VAL(4)
316#define AS3722_GPIO_IOSF_VOLTAGE_STBY AS3722_GPIO_IOSF_VAL(5) 318#define AS3722_GPIO_IOSF_VOLTAGE_STBY AS3722_GPIO_IOSF_VAL(5)
319#define AS3722_GPIO_IOSF_SD0_OUT AS3722_GPIO_IOSF_VAL(6)
317#define AS3722_GPIO_IOSF_PWR_GOOD_OUT AS3722_GPIO_IOSF_VAL(7) 320#define AS3722_GPIO_IOSF_PWR_GOOD_OUT AS3722_GPIO_IOSF_VAL(7)
318#define AS3722_GPIO_IOSF_Q32K_OUT AS3722_GPIO_IOSF_VAL(8) 321#define AS3722_GPIO_IOSF_Q32K_OUT AS3722_GPIO_IOSF_VAL(8)
319#define AS3722_GPIO_IOSF_WATCHDOG_IN AS3722_GPIO_IOSF_VAL(9) 322#define AS3722_GPIO_IOSF_WATCHDOG_IN AS3722_GPIO_IOSF_VAL(9)
@@ -341,6 +344,8 @@
341#define AS3722_EXT_CONTROL_ENABLE2 0x2 344#define AS3722_EXT_CONTROL_ENABLE2 0x2
342#define AS3722_EXT_CONTROL_ENABLE3 0x3 345#define AS3722_EXT_CONTROL_ENABLE3 0x3
343 346
347#define AS3722_FUSE7_SD0_LOW_VOLTAGE BIT(4)
348
344/* Interrupt IDs */ 349/* Interrupt IDs */
345enum as3722_irq { 350enum as3722_irq {
346 AS3722_IRQ_LID, 351 AS3722_IRQ_LID,
diff --git a/include/linux/mfd/lp3943.h b/include/linux/mfd/lp3943.h
new file mode 100644
index 000000000000..3490db782988
--- /dev/null
+++ b/include/linux/mfd/lp3943.h
@@ -0,0 +1,114 @@
1/*
2 * TI/National Semiconductor LP3943 Device
3 *
4 * Copyright 2013 Texas Instruments
5 *
6 * Author: Milo Kim <milo.kim@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12 */
13
14#ifndef __MFD_LP3943_H__
15#define __MFD_LP3943_H__
16
17#include <linux/gpio.h>
18#include <linux/pwm.h>
19#include <linux/regmap.h>
20
21/* Registers */
22#define LP3943_REG_GPIO_A 0x00
23#define LP3943_REG_GPIO_B 0x01
24#define LP3943_REG_PRESCALE0 0x02
25#define LP3943_REG_PWM0 0x03
26#define LP3943_REG_PRESCALE1 0x04
27#define LP3943_REG_PWM1 0x05
28#define LP3943_REG_MUX0 0x06
29#define LP3943_REG_MUX1 0x07
30#define LP3943_REG_MUX2 0x08
31#define LP3943_REG_MUX3 0x09
32
33/* Bit description for LP3943_REG_MUX0 ~ 3 */
34#define LP3943_GPIO_IN 0x00
35#define LP3943_GPIO_OUT_HIGH 0x00
36#define LP3943_GPIO_OUT_LOW 0x01
37#define LP3943_DIM_PWM0 0x02
38#define LP3943_DIM_PWM1 0x03
39
40#define LP3943_NUM_PWMS 2
41
42enum lp3943_pwm_output {
43 LP3943_PWM_OUT0,
44 LP3943_PWM_OUT1,
45 LP3943_PWM_OUT2,
46 LP3943_PWM_OUT3,
47 LP3943_PWM_OUT4,
48 LP3943_PWM_OUT5,
49 LP3943_PWM_OUT6,
50 LP3943_PWM_OUT7,
51 LP3943_PWM_OUT8,
52 LP3943_PWM_OUT9,
53 LP3943_PWM_OUT10,
54 LP3943_PWM_OUT11,
55 LP3943_PWM_OUT12,
56 LP3943_PWM_OUT13,
57 LP3943_PWM_OUT14,
58 LP3943_PWM_OUT15,
59};
60
61/*
62 * struct lp3943_pwm_map
63 * @output: Output pins which are mapped to each PWM channel
64 * @num_outputs: Number of outputs
65 */
66struct lp3943_pwm_map {
67 enum lp3943_pwm_output *output;
68 int num_outputs;
69};
70
71/*
72 * struct lp3943_platform_data
73 * @pwms: Output channel definitions for PWM channel 0 and 1
74 */
75struct lp3943_platform_data {
76 struct lp3943_pwm_map *pwms[LP3943_NUM_PWMS];
77};
78
79/*
80 * struct lp3943_reg_cfg
81 * @reg: Register address
82 * @mask: Register bit mask to be updated
83 * @shift: Register bit shift
84 */
85struct lp3943_reg_cfg {
86 u8 reg;
87 u8 mask;
88 u8 shift;
89};
90
91/*
92 * struct lp3943
93 * @dev: Parent device pointer
94 * @regmap: Used for I2C communication on accessing registers
95 * @pdata: LP3943 platform specific data
96 * @mux_cfg: Register configuration for pin MUX
97 * @pin_used: Bit mask for output pin used.
98 * This bitmask is used for pin assignment management.
99 * 1 = pin used, 0 = available.
100 * Only LSB 16 bits are used, but it is unsigned long type
101 * for atomic bitwise operations.
102 */
103struct lp3943 {
104 struct device *dev;
105 struct regmap *regmap;
106 struct lp3943_platform_data *pdata;
107 const struct lp3943_reg_cfg *mux_cfg;
108 unsigned long pin_used;
109};
110
111int lp3943_read_byte(struct lp3943 *lp3943, u8 reg, u8 *read);
112int lp3943_write_byte(struct lp3943 *lp3943, u8 reg, u8 data);
113int lp3943_update_bits(struct lp3943 *lp3943, u8 reg, u8 mask, u8 data);
114#endif
diff --git a/include/linux/mfd/max14577-private.h b/include/linux/mfd/max14577-private.h
new file mode 100644
index 000000000000..a3d0185196d3
--- /dev/null
+++ b/include/linux/mfd/max14577-private.h
@@ -0,0 +1,330 @@
1/*
2 * max14577-private.h - Common API for the Maxim 14577 internal sub chip
3 *
4 * Copyright (C) 2013 Samsung Electrnoics
5 * Chanwoo Choi <cw00.choi@samsung.com>
6 * Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 */
18
19#ifndef __MAX14577_PRIVATE_H__
20#define __MAX14577_PRIVATE_H__
21
22#include <linux/i2c.h>
23#include <linux/regmap.h>
24
25#define MAX14577_REG_INVALID (0xff)
26
27/* Slave addr = 0x4A: Interrupt */
28enum max14577_reg {
29 MAX14577_REG_DEVICEID = 0x00,
30 MAX14577_REG_INT1 = 0x01,
31 MAX14577_REG_INT2 = 0x02,
32 MAX14577_REG_INT3 = 0x03,
33 MAX14577_REG_STATUS1 = 0x04,
34 MAX14577_REG_STATUS2 = 0x05,
35 MAX14577_REG_STATUS3 = 0x06,
36 MAX14577_REG_INTMASK1 = 0x07,
37 MAX14577_REG_INTMASK2 = 0x08,
38 MAX14577_REG_INTMASK3 = 0x09,
39 MAX14577_REG_CDETCTRL1 = 0x0A,
40 MAX14577_REG_RFU = 0x0B,
41 MAX14577_REG_CONTROL1 = 0x0C,
42 MAX14577_REG_CONTROL2 = 0x0D,
43 MAX14577_REG_CONTROL3 = 0x0E,
44 MAX14577_REG_CHGCTRL1 = 0x0F,
45 MAX14577_REG_CHGCTRL2 = 0x10,
46 MAX14577_REG_CHGCTRL3 = 0x11,
47 MAX14577_REG_CHGCTRL4 = 0x12,
48 MAX14577_REG_CHGCTRL5 = 0x13,
49 MAX14577_REG_CHGCTRL6 = 0x14,
50 MAX14577_REG_CHGCTRL7 = 0x15,
51
52 MAX14577_REG_END,
53};
54
55/* Slave addr = 0x4A: MUIC */
56enum max14577_muic_reg {
57 MAX14577_MUIC_REG_STATUS1 = 0x04,
58 MAX14577_MUIC_REG_STATUS2 = 0x05,
59 MAX14577_MUIC_REG_CONTROL1 = 0x0C,
60 MAX14577_MUIC_REG_CONTROL3 = 0x0E,
61
62 MAX14577_MUIC_REG_END,
63};
64
65enum max14577_muic_charger_type {
66 MAX14577_CHARGER_TYPE_NONE = 0,
67 MAX14577_CHARGER_TYPE_USB,
68 MAX14577_CHARGER_TYPE_DOWNSTREAM_PORT,
69 MAX14577_CHARGER_TYPE_DEDICATED_CHG,
70 MAX14577_CHARGER_TYPE_SPECIAL_500MA,
71 MAX14577_CHARGER_TYPE_SPECIAL_1A,
72 MAX14577_CHARGER_TYPE_RESERVED,
73 MAX14577_CHARGER_TYPE_DEAD_BATTERY = 7,
74};
75
76/* MAX14577 interrupts */
77#define INT1_ADC_MASK (0x1 << 0)
78#define INT1_ADCLOW_MASK (0x1 << 1)
79#define INT1_ADCERR_MASK (0x1 << 2)
80
81#define INT2_CHGTYP_MASK (0x1 << 0)
82#define INT2_CHGDETRUN_MASK (0x1 << 1)
83#define INT2_DCDTMR_MASK (0x1 << 2)
84#define INT2_DBCHG_MASK (0x1 << 3)
85#define INT2_VBVOLT_MASK (0x1 << 4)
86
87#define INT3_EOC_MASK (0x1 << 0)
88#define INT3_CGMBC_MASK (0x1 << 1)
89#define INT3_OVP_MASK (0x1 << 2)
90#define INT3_MBCCHGERR_MASK (0x1 << 3)
91
92/* MAX14577 DEVICE ID register */
93#define DEVID_VENDORID_SHIFT 0
94#define DEVID_DEVICEID_SHIFT 3
95#define DEVID_VENDORID_MASK (0x07 << DEVID_VENDORID_SHIFT)
96#define DEVID_DEVICEID_MASK (0x1f << DEVID_DEVICEID_SHIFT)
97
98/* MAX14577 STATUS1 register */
99#define STATUS1_ADC_SHIFT 0
100#define STATUS1_ADCLOW_SHIFT 5
101#define STATUS1_ADCERR_SHIFT 6
102#define STATUS1_ADC_MASK (0x1f << STATUS1_ADC_SHIFT)
103#define STATUS1_ADCLOW_MASK (0x1 << STATUS1_ADCLOW_SHIFT)
104#define STATUS1_ADCERR_MASK (0x1 << STATUS1_ADCERR_SHIFT)
105
106/* MAX14577 STATUS2 register */
107#define STATUS2_CHGTYP_SHIFT 0
108#define STATUS2_CHGDETRUN_SHIFT 3
109#define STATUS2_DCDTMR_SHIFT 4
110#define STATUS2_DBCHG_SHIFT 5
111#define STATUS2_VBVOLT_SHIFT 6
112#define STATUS2_CHGTYP_MASK (0x7 << STATUS2_CHGTYP_SHIFT)
113#define STATUS2_CHGDETRUN_MASK (0x1 << STATUS2_CHGDETRUN_SHIFT)
114#define STATUS2_DCDTMR_MASK (0x1 << STATUS2_DCDTMR_SHIFT)
115#define STATUS2_DBCHG_MASK (0x1 << STATUS2_DBCHG_SHIFT)
116#define STATUS2_VBVOLT_MASK (0x1 << STATUS2_VBVOLT_SHIFT)
117
118/* MAX14577 CONTROL1 register */
119#define COMN1SW_SHIFT 0
120#define COMP2SW_SHIFT 3
121#define MICEN_SHIFT 6
122#define IDBEN_SHIFT 7
123#define COMN1SW_MASK (0x7 << COMN1SW_SHIFT)
124#define COMP2SW_MASK (0x7 << COMP2SW_SHIFT)
125#define MICEN_MASK (0x1 << MICEN_SHIFT)
126#define IDBEN_MASK (0x1 << IDBEN_SHIFT)
127#define CLEAR_IDBEN_MICEN_MASK (COMN1SW_MASK | COMP2SW_MASK)
128#define CTRL1_SW_USB ((1 << COMP2SW_SHIFT) \
129 | (1 << COMN1SW_SHIFT))
130#define CTRL1_SW_AUDIO ((2 << COMP2SW_SHIFT) \
131 | (2 << COMN1SW_SHIFT))
132#define CTRL1_SW_UART ((3 << COMP2SW_SHIFT) \
133 | (3 << COMN1SW_SHIFT))
134#define CTRL1_SW_OPEN ((0 << COMP2SW_SHIFT) \
135 | (0 << COMN1SW_SHIFT))
136
137/* MAX14577 CONTROL2 register */
138#define CTRL2_LOWPWR_SHIFT (0)
139#define CTRL2_ADCEN_SHIFT (1)
140#define CTRL2_CPEN_SHIFT (2)
141#define CTRL2_SFOUTASRT_SHIFT (3)
142#define CTRL2_SFOUTORD_SHIFT (4)
143#define CTRL2_ACCDET_SHIFT (5)
144#define CTRL2_USBCPINT_SHIFT (6)
145#define CTRL2_RCPS_SHIFT (7)
146#define CTRL2_LOWPWR_MASK (0x1 << CTRL2_LOWPWR_SHIFT)
147#define CTRL2_ADCEN_MASK (0x1 << CTRL2_ADCEN_SHIFT)
148#define CTRL2_CPEN_MASK (0x1 << CTRL2_CPEN_SHIFT)
149#define CTRL2_SFOUTASRT_MASK (0x1 << CTRL2_SFOUTASRT_SHIFT)
150#define CTRL2_SFOUTORD_MASK (0x1 << CTRL2_SFOUTORD_SHIFT)
151#define CTRL2_ACCDET_MASK (0x1 << CTRL2_ACCDET_SHIFT)
152#define CTRL2_USBCPINT_MASK (0x1 << CTRL2_USBCPINT_SHIFT)
153#define CTRL2_RCPS_MASK (0x1 << CTR2_RCPS_SHIFT)
154
155#define CTRL2_CPEN1_LOWPWR0 ((1 << CTRL2_CPEN_SHIFT) | \
156 (0 << CTRL2_LOWPWR_SHIFT))
157#define CTRL2_CPEN0_LOWPWR1 ((0 << CTRL2_CPEN_SHIFT) | \
158 (1 << CTRL2_LOWPWR_SHIFT))
159
160/* MAX14577 CONTROL3 register */
161#define CTRL3_JIGSET_SHIFT 0
162#define CTRL3_BOOTSET_SHIFT 2
163#define CTRL3_ADCDBSET_SHIFT 4
164#define CTRL3_JIGSET_MASK (0x3 << CTRL3_JIGSET_SHIFT)
165#define CTRL3_BOOTSET_MASK (0x3 << CTRL3_BOOTSET_SHIFT)
166#define CTRL3_ADCDBSET_MASK (0x3 << CTRL3_ADCDBSET_SHIFT)
167
168/* Slave addr = 0x4A: Charger */
169enum max14577_charger_reg {
170 MAX14577_CHG_REG_STATUS3 = 0x06,
171 MAX14577_CHG_REG_CHG_CTRL1 = 0x0F,
172 MAX14577_CHG_REG_CHG_CTRL2 = 0x10,
173 MAX14577_CHG_REG_CHG_CTRL3 = 0x11,
174 MAX14577_CHG_REG_CHG_CTRL4 = 0x12,
175 MAX14577_CHG_REG_CHG_CTRL5 = 0x13,
176 MAX14577_CHG_REG_CHG_CTRL6 = 0x14,
177 MAX14577_CHG_REG_CHG_CTRL7 = 0x15,
178
179 MAX14577_CHG_REG_END,
180};
181
182/* MAX14577 STATUS3 register */
183#define STATUS3_EOC_SHIFT 0
184#define STATUS3_CGMBC_SHIFT 1
185#define STATUS3_OVP_SHIFT 2
186#define STATUS3_MBCCHGERR_SHIFT 3
187#define STATUS3_EOC_MASK (0x1 << STATUS3_EOC_SHIFT)
188#define STATUS3_CGMBC_MASK (0x1 << STATUS3_CGMBC_SHIFT)
189#define STATUS3_OVP_MASK (0x1 << STATUS3_OVP_SHIFT)
190#define STATUS3_MBCCHGERR_MASK (0x1 << STATUS3_MBCCHGERR_SHIFT)
191
192/* MAX14577 CDETCTRL1 register */
193#define CDETCTRL1_CHGDETEN_SHIFT 0
194#define CDETCTRL1_CHGTYPMAN_SHIFT 1
195#define CDETCTRL1_DCDEN_SHIFT 2
196#define CDETCTRL1_DCD2SCT_SHIFT 3
197#define CDETCTRL1_DCHKTM_SHIFT 4
198#define CDETCTRL1_DBEXIT_SHIFT 5
199#define CDETCTRL1_DBIDLE_SHIFT 6
200#define CDETCTRL1_CDPDET_SHIFT 7
201#define CDETCTRL1_CHGDETEN_MASK (0x1 << CDETCTRL1_CHGDETEN_SHIFT)
202#define CDETCTRL1_CHGTYPMAN_MASK (0x1 << CDETCTRL1_CHGTYPMAN_SHIFT)
203#define CDETCTRL1_DCDEN_MASK (0x1 << CDETCTRL1_DCDEN_SHIFT)
204#define CDETCTRL1_DCD2SCT_MASK (0x1 << CDETCTRL1_DCD2SCT_SHIFT)
205#define CDETCTRL1_DCHKTM_MASK (0x1 << CDETCTRL1_DCHKTM_SHIFT)
206#define CDETCTRL1_DBEXIT_MASK (0x1 << CDETCTRL1_DBEXIT_SHIFT)
207#define CDETCTRL1_DBIDLE_MASK (0x1 << CDETCTRL1_DBIDLE_SHIFT)
208#define CDETCTRL1_CDPDET_MASK (0x1 << CDETCTRL1_CDPDET_SHIFT)
209
210/* MAX14577 CHGCTRL1 register */
211#define CHGCTRL1_TCHW_SHIFT 4
212#define CHGCTRL1_TCHW_MASK (0x7 << CHGCTRL1_TCHW_SHIFT)
213
214/* MAX14577 CHGCTRL2 register */
215#define CHGCTRL2_MBCHOSTEN_SHIFT 6
216#define CHGCTRL2_MBCHOSTEN_MASK (0x1 << CHGCTRL2_MBCHOSTEN_SHIFT)
217#define CHGCTRL2_VCHGR_RC_SHIFT 7
218#define CHGCTRL2_VCHGR_RC_MASK (0x1 << CHGCTRL2_VCHGR_RC_SHIFT)
219
220/* MAX14577 CHGCTRL3 register */
221#define CHGCTRL3_MBCCVWRC_SHIFT 0
222#define CHGCTRL3_MBCCVWRC_MASK (0xf << CHGCTRL3_MBCCVWRC_SHIFT)
223
224/* MAX14577 CHGCTRL4 register */
225#define CHGCTRL4_MBCICHWRCH_SHIFT 0
226#define CHGCTRL4_MBCICHWRCH_MASK (0xf << CHGCTRL4_MBCICHWRCH_SHIFT)
227#define CHGCTRL4_MBCICHWRCL_SHIFT 4
228#define CHGCTRL4_MBCICHWRCL_MASK (0x1 << CHGCTRL4_MBCICHWRCL_SHIFT)
229
230/* MAX14577 CHGCTRL5 register */
231#define CHGCTRL5_EOCS_SHIFT 0
232#define CHGCTRL5_EOCS_MASK (0xf << CHGCTRL5_EOCS_SHIFT)
233
234/* MAX14577 CHGCTRL6 register */
235#define CHGCTRL6_AUTOSTOP_SHIFT 5
236#define CHGCTRL6_AUTOSTOP_MASK (0x1 << CHGCTRL6_AUTOSTOP_SHIFT)
237
238/* MAX14577 CHGCTRL7 register */
239#define CHGCTRL7_OTPCGHCVS_SHIFT 0
240#define CHGCTRL7_OTPCGHCVS_MASK (0x3 << CHGCTRL7_OTPCGHCVS_SHIFT)
241
242/* MAX14577 regulator current limits (as in CHGCTRL4 register), uA */
243#define MAX14577_REGULATOR_CURRENT_LIMIT_MIN 90000
244#define MAX14577_REGULATOR_CURRENT_LIMIT_HIGH_START 200000
245#define MAX14577_REGULATOR_CURRENT_LIMIT_HIGH_STEP 50000
246#define MAX14577_REGULATOR_CURRENT_LIMIT_MAX 950000
247
248/* MAX14577 regulator SFOUT LDO voltage, fixed, uV */
249#define MAX14577_REGULATOR_SAFEOUT_VOLTAGE 4900000
250
251enum max14577_irq_source {
252 MAX14577_IRQ_INT1 = 0,
253 MAX14577_IRQ_INT2,
254 MAX14577_IRQ_INT3,
255
256 MAX14577_IRQ_REGS_NUM,
257};
258
259enum max14577_irq {
260 /* INT1 */
261 MAX14577_IRQ_INT1_ADC,
262 MAX14577_IRQ_INT1_ADCLOW,
263 MAX14577_IRQ_INT1_ADCERR,
264
265 /* INT2 */
266 MAX14577_IRQ_INT2_CHGTYP,
267 MAX14577_IRQ_INT2_CHGDETRUN,
268 MAX14577_IRQ_INT2_DCDTMR,
269 MAX14577_IRQ_INT2_DBCHG,
270 MAX14577_IRQ_INT2_VBVOLT,
271
272 /* INT3 */
273 MAX14577_IRQ_INT3_EOC,
274 MAX14577_IRQ_INT3_CGMBC,
275 MAX14577_IRQ_INT3_OVP,
276 MAX14577_IRQ_INT3_MBCCHGERR,
277
278 MAX14577_IRQ_NUM,
279};
280
281struct max14577 {
282 struct device *dev;
283 struct i2c_client *i2c; /* Slave addr = 0x4A */
284
285 struct regmap *regmap;
286
287 struct regmap_irq_chip_data *irq_data;
288 int irq;
289
290 /* Device ID */
291 u8 vendor_id; /* Vendor Identification */
292 u8 device_id; /* Chip Version */
293};
294
295/* MAX14577 shared regmap API function */
296static inline int max14577_read_reg(struct regmap *map, u8 reg, u8 *dest)
297{
298 unsigned int val;
299 int ret;
300
301 ret = regmap_read(map, reg, &val);
302 *dest = val;
303
304 return ret;
305}
306
307static inline int max14577_bulk_read(struct regmap *map, u8 reg, u8 *buf,
308 int count)
309{
310 return regmap_bulk_read(map, reg, buf, count);
311}
312
313static inline int max14577_write_reg(struct regmap *map, u8 reg, u8 value)
314{
315 return regmap_write(map, reg, value);
316}
317
318static inline int max14577_bulk_write(struct regmap *map, u8 reg, u8 *buf,
319 int count)
320{
321 return regmap_bulk_write(map, reg, buf, count);
322}
323
324static inline int max14577_update_reg(struct regmap *map, u8 reg, u8 mask,
325 u8 val)
326{
327 return regmap_update_bits(map, reg, mask, val);
328}
329
330#endif /* __MAX14577_PRIVATE_H__ */
diff --git a/include/linux/mfd/max14577.h b/include/linux/mfd/max14577.h
new file mode 100644
index 000000000000..247b021dfaaf
--- /dev/null
+++ b/include/linux/mfd/max14577.h
@@ -0,0 +1,69 @@
1/*
2 * max14577.h - Driver for the Maxim 14577
3 *
4 * Copyright (C) 2013 Samsung Electrnoics
5 * Chanwoo Choi <cw00.choi@samsung.com>
6 * Krzysztof Kozlowski <k.kozlowski@samsung.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * This driver is based on max8997.h
19 *
20 * MAX14577 has MUIC, Charger devices.
21 * The devices share the same I2C bus and interrupt line
22 * included in this mfd driver.
23 */
24
25#ifndef __MAX14577_H__
26#define __MAX14577_H__
27
28#include <linux/mfd/max14577-private.h>
29#include <linux/regulator/consumer.h>
30
31/*
32 * MAX14577 Regulator
33 */
34
35/* MAX14577 regulator IDs */
36enum max14577_regulators {
37 MAX14577_SAFEOUT = 0,
38 MAX14577_CHARGER,
39
40 MAX14577_REG_MAX,
41};
42
43struct max14577_regulator_platform_data {
44 int id;
45 struct regulator_init_data *initdata;
46 struct device_node *of_node;
47};
48
49/*
50 * MAX14577 MFD platform data
51 */
52struct max14577_platform_data {
53 /* IRQ */
54 int irq_base;
55
56 /* current control GPIOs */
57 int gpio_pogo_vbatt_en;
58 int gpio_pogo_vbus_en;
59
60 /* current control GPIO control function */
61 int (*set_gpio_pogo_vbatt_en) (int gpio_val);
62 int (*set_gpio_pogo_vbus_en) (int gpio_val);
63
64 int (*set_gpio_pogo_cb) (int new_dev);
65
66 struct max14577_regulator_platform_data *regulators;
67};
68
69#endif /* __MAX14577_H__ */
diff --git a/include/linux/mfd/max77686-private.h b/include/linux/mfd/max77686-private.h
index d327d4971e4f..8c75a9c8dfab 100644
--- a/include/linux/mfd/max77686-private.h
+++ b/include/linux/mfd/max77686-private.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * max77686.h - Voltage regulator driver for the Maxim 77686 2 * max77686-private.h - Voltage regulator driver for the Maxim 77686
3 * 3 *
4 * Copyright (C) 2012 Samsung Electrnoics 4 * Copyright (C) 2012 Samsung Electrnoics
5 * Chiwoong Byun <woong.byun@samsung.com> 5 * Chiwoong Byun <woong.byun@samsung.com>
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index fb465dfbb59e..ad1ae7f345ad 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * max8997.h - Voltage regulator driver for the Maxim 8997 2 * max8997-private.h - Voltage regulator driver for the Maxim 8997
3 * 3 *
4 * Copyright (C) 2010 Samsung Electrnoics 4 * Copyright (C) 2010 Samsung Electrnoics
5 * MyungJoo Ham <myungjoo.ham@samsung.com> 5 * MyungJoo Ham <myungjoo.ham@samsung.com>
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h
index 84844e0a5704..4ecb24b4b863 100644
--- a/include/linux/mfd/max8998-private.h
+++ b/include/linux/mfd/max8998-private.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * max8998.h - Voltage regulator driver for the Maxim 8998 2 * max8998-private.h - Voltage regulator driver for the Maxim 8998
3 * 3 *
4 * Copyright (C) 2009-2010 Samsung Electrnoics 4 * Copyright (C) 2009-2010 Samsung Electrnoics
5 * Kyungmin Park <kyungmin.park@samsung.com> 5 * Kyungmin Park <kyungmin.park@samsung.com>
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index 67c17b5a6f44..ac39d910e70b 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -21,8 +21,6 @@ int mc13xxx_reg_write(struct mc13xxx *mc13xxx, unsigned int offset, u32 val);
21int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset, 21int mc13xxx_reg_rmw(struct mc13xxx *mc13xxx, unsigned int offset,
22 u32 mask, u32 val); 22 u32 mask, u32 val);
23 23
24int mc13xxx_get_flags(struct mc13xxx *mc13xxx);
25
26int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq, 24int mc13xxx_irq_request(struct mc13xxx *mc13xxx, int irq,
27 irq_handler_t handler, const char *name, void *dev); 25 irq_handler_t handler, const char *name, void *dev);
28int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq, 26int mc13xxx_irq_request_nounmask(struct mc13xxx *mc13xxx, int irq,
@@ -112,9 +110,6 @@ struct mc13xxx_led_platform_data {
112 int id; 110 int id;
113 const char *name; 111 const char *name;
114 const char *default_trigger; 112 const char *default_trigger;
115
116/* Three or two bits current selection depending on the led */
117 char max_current;
118}; 113};
119 114
120#define MAX_LED_CONTROL_REGS 6 115#define MAX_LED_CONTROL_REGS 6
@@ -123,7 +118,7 @@ struct mc13xxx_leds_platform_data {
123 struct mc13xxx_led_platform_data *led; 118 struct mc13xxx_led_platform_data *led;
124 int num_leds; 119 int num_leds;
125 120
126/* LED Control 0 */ 121/* MC13783 LED Control 0 */
127#define MC13783_LED_C0_ENABLE (1 << 0) 122#define MC13783_LED_C0_ENABLE (1 << 0)
128#define MC13783_LED_C0_TRIODE_MD (1 << 7) 123#define MC13783_LED_C0_TRIODE_MD (1 << 7)
129#define MC13783_LED_C0_TRIODE_AD (1 << 8) 124#define MC13783_LED_C0_TRIODE_AD (1 << 8)
@@ -131,21 +126,43 @@ struct mc13xxx_leds_platform_data {
131#define MC13783_LED_C0_BOOST (1 << 10) 126#define MC13783_LED_C0_BOOST (1 << 10)
132#define MC13783_LED_C0_ABMODE(x) (((x) & 0x7) << 11) 127#define MC13783_LED_C0_ABMODE(x) (((x) & 0x7) << 11)
133#define MC13783_LED_C0_ABREF(x) (((x) & 0x3) << 14) 128#define MC13783_LED_C0_ABREF(x) (((x) & 0x3) << 14)
134/* LED Control 1 */ 129/* MC13783 LED Control 1 */
135#define MC13783_LED_C1_TC1HALF (1 << 18) 130#define MC13783_LED_C1_TC1HALF (1 << 18)
136#define MC13783_LED_C1_SLEWLIM (1 << 23) 131#define MC13783_LED_C1_SLEWLIM (1 << 23)
137/* LED Control 2 */ 132/* MC13783 LED Control 2 */
133#define MC13783_LED_C2_CURRENT_MD(x) (((x) & 0x7) << 0)
134#define MC13783_LED_C2_CURRENT_AD(x) (((x) & 0x7) << 3)
135#define MC13783_LED_C2_CURRENT_KP(x) (((x) & 0x7) << 6)
138#define MC13783_LED_C2_PERIOD(x) (((x) & 0x3) << 21) 136#define MC13783_LED_C2_PERIOD(x) (((x) & 0x3) << 21)
139#define MC13783_LED_C2_SLEWLIM (1 << 23) 137#define MC13783_LED_C2_SLEWLIM (1 << 23)
140/* LED Control 3 */ 138/* MC13783 LED Control 3 */
139#define MC13783_LED_C3_CURRENT_R1(x) (((x) & 0x3) << 0)
140#define MC13783_LED_C3_CURRENT_G1(x) (((x) & 0x3) << 2)
141#define MC13783_LED_C3_CURRENT_B1(x) (((x) & 0x3) << 4)
141#define MC13783_LED_C3_PERIOD(x) (((x) & 0x3) << 21) 142#define MC13783_LED_C3_PERIOD(x) (((x) & 0x3) << 21)
142#define MC13783_LED_C3_TRIODE_TC1 (1 << 23) 143#define MC13783_LED_C3_TRIODE_TC1 (1 << 23)
143/* LED Control 4 */ 144/* MC13783 LED Control 4 */
145#define MC13783_LED_C4_CURRENT_R2(x) (((x) & 0x3) << 0)
146#define MC13783_LED_C4_CURRENT_G2(x) (((x) & 0x3) << 2)
147#define MC13783_LED_C4_CURRENT_B2(x) (((x) & 0x3) << 4)
144#define MC13783_LED_C4_PERIOD(x) (((x) & 0x3) << 21) 148#define MC13783_LED_C4_PERIOD(x) (((x) & 0x3) << 21)
145#define MC13783_LED_C4_TRIODE_TC2 (1 << 23) 149#define MC13783_LED_C4_TRIODE_TC2 (1 << 23)
146/* LED Control 5 */ 150/* MC13783 LED Control 5 */
151#define MC13783_LED_C5_CURRENT_R3(x) (((x) & 0x3) << 0)
152#define MC13783_LED_C5_CURRENT_G3(x) (((x) & 0x3) << 2)
153#define MC13783_LED_C5_CURRENT_B3(x) (((x) & 0x3) << 4)
147#define MC13783_LED_C5_PERIOD(x) (((x) & 0x3) << 21) 154#define MC13783_LED_C5_PERIOD(x) (((x) & 0x3) << 21)
148#define MC13783_LED_C5_TRIODE_TC3 (1 << 23) 155#define MC13783_LED_C5_TRIODE_TC3 (1 << 23)
156/* MC13892 LED Control 0 */
157#define MC13892_LED_C0_CURRENT_MD(x) (((x) & 0x7) << 9)
158#define MC13892_LED_C0_CURRENT_AD(x) (((x) & 0x7) << 21)
159/* MC13892 LED Control 1 */
160#define MC13892_LED_C1_CURRENT_KP(x) (((x) & 0x7) << 9)
161/* MC13892 LED Control 2 */
162#define MC13892_LED_C2_CURRENT_R(x) (((x) & 0x7) << 9)
163#define MC13892_LED_C2_CURRENT_G(x) (((x) & 0x7) << 21)
164/* MC13892 LED Control 3 */
165#define MC13892_LED_C3_CURRENT_B(x) (((x) & 0x7) << 9)
149 u32 led_control[MAX_LED_CONTROL_REGS]; 166 u32 led_control[MAX_LED_CONTROL_REGS];
150}; 167};
151 168
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index cab2dd279076..41c9bde410c5 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -59,12 +59,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic);
59void sec_irq_exit(struct sec_pmic_dev *sec_pmic); 59void sec_irq_exit(struct sec_pmic_dev *sec_pmic);
60int sec_irq_resume(struct sec_pmic_dev *sec_pmic); 60int sec_irq_resume(struct sec_pmic_dev *sec_pmic);
61 61
62extern int sec_reg_read(struct sec_pmic_dev *sec_pmic, u8 reg, void *dest);
63extern int sec_bulk_read(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
64extern int sec_reg_write(struct sec_pmic_dev *sec_pmic, u8 reg, u8 value);
65extern int sec_bulk_write(struct sec_pmic_dev *sec_pmic, u8 reg, int count, u8 *buf);
66extern int sec_reg_update(struct sec_pmic_dev *sec_pmic, u8 reg, u8 val, u8 mask);
67
68struct sec_platform_data { 62struct sec_platform_data {
69 struct sec_regulator_data *regulators; 63 struct sec_regulator_data *regulators;
70 struct sec_opmode_data *opmode; 64 struct sec_opmode_data *opmode;
diff --git a/include/linux/mfd/samsung/s5m8767.h b/include/linux/mfd/samsung/s5m8767.h
index 306a95fc558c..2ab0b0f03641 100644
--- a/include/linux/mfd/samsung/s5m8767.h
+++ b/include/linux/mfd/samsung/s5m8767.h
@@ -183,6 +183,22 @@ enum s5m8767_regulators {
183 S5M8767_REG_MAX, 183 S5M8767_REG_MAX,
184}; 184};
185 185
186#define S5M8767_ENCTRL_SHIFT 6 186#define S5M8767_ENCTRL_SHIFT 6
187#define S5M8767_ENCTRL_MASK (0x3 << S5M8767_ENCTRL_SHIFT)
188
189/*
190 * Values for BUCK_RAMP field in DVS_RAMP register, matching raw values
191 * in mV/us.
192 */
193enum s5m8767_dvs_buck_ramp_values {
194 S5M8767_DVS_BUCK_RAMP_5 = 0x4,
195 S5M8767_DVS_BUCK_RAMP_10 = 0x9,
196 S5M8767_DVS_BUCK_RAMP_12_5 = 0xb,
197 S5M8767_DVS_BUCK_RAMP_25 = 0xd,
198 S5M8767_DVS_BUCK_RAMP_50 = 0xe,
199 S5M8767_DVS_BUCK_RAMP_100 = 0xf,
200};
201#define S5M8767_DVS_BUCK_RAMP_SHIFT 4
202#define S5M8767_DVS_BUCK_RAMP_MASK (0xf << S5M8767_DVS_BUCK_RAMP_SHIFT)
187 203
188#endif /* __LINUX_MFD_S5M8767_H */ 204#endif /* __LINUX_MFD_S5M8767_H */
diff --git a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
index b6d36b38b99c..866e355fa409 100644
--- a/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
+++ b/include/linux/mfd/syscon/imx6q-iomuxc-gpr.h
@@ -212,6 +212,7 @@
212#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU1_DI1 (0x1 << 4) 212#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU1_DI1 (0x1 << 4)
213#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI0 (0x2 << 4) 213#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI0 (0x2 << 4)
214#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI1 (0x3 << 4) 214#define IMX6Q_GPR3_MIPI_MUX_CTL_IPU2_DI1 (0x3 << 4)
215#define IMX6Q_GPR3_HDMI_MUX_CTL_SHIFT 2
215#define IMX6Q_GPR3_HDMI_MUX_CTL_MASK (0x3 << 2) 216#define IMX6Q_GPR3_HDMI_MUX_CTL_MASK (0x3 << 2)
216#define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI0 (0x0 << 2) 217#define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI0 (0x0 << 2)
217#define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI1 (0x1 << 2) 218#define IMX6Q_GPR3_HDMI_MUX_CTL_IPU1_DI1 (0x1 << 2)
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
index d498d98f0c2c..fb96c84dada5 100644
--- a/include/linux/mfd/ti_am335x_tscadc.h
+++ b/include/linux/mfd/ti_am335x_tscadc.h
@@ -159,6 +159,9 @@ struct ti_tscadc_dev {
159 int adc_cell; /* -1 if not used */ 159 int adc_cell; /* -1 if not used */
160 struct mfd_cell cells[TSCADC_CELLS]; 160 struct mfd_cell cells[TSCADC_CELLS];
161 u32 reg_se_cache; 161 u32 reg_se_cache;
162 bool adc_waiting;
163 bool adc_in_use;
164 wait_queue_head_t reg_se_wait;
162 spinlock_t reg_lock; 165 spinlock_t reg_lock;
163 unsigned int clk_div; 166 unsigned int clk_div;
164 167
@@ -176,8 +179,9 @@ static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p)
176 return *tscadc_dev; 179 return *tscadc_dev;
177} 180}
178 181
179void am335x_tsc_se_update(struct ti_tscadc_dev *tsadc); 182void am335x_tsc_se_set_cache(struct ti_tscadc_dev *tsadc, u32 val);
180void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val); 183void am335x_tsc_se_set_once(struct ti_tscadc_dev *tsadc, u32 val);
181void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val); 184void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val);
185void am335x_tsc_se_adc_done(struct ti_tscadc_dev *tsadc);
182 186
183#endif 187#endif
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index b22883d60500..8f6f2e91e7ae 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -76,6 +76,13 @@
76 */ 76 */
77#define TMIO_MMC_USE_GPIO_CD (1 << 5) 77#define TMIO_MMC_USE_GPIO_CD (1 << 5)
78 78
79/*
80 * Some controllers doesn't have over 0x100 register.
81 * it is used to checking accessibility of
82 * CTL_SD_CARD_CLK_CTL / CTL_CLK_AND_WAIT_CTL
83 */
84#define TMIO_MMC_HAVE_HIGH_REG (1 << 6)
85
79int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); 86int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
80int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); 87int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
81void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); 88void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
@@ -102,6 +109,7 @@ struct tmio_mmc_data {
102 unsigned long capabilities; 109 unsigned long capabilities;
103 unsigned long capabilities2; 110 unsigned long capabilities2;
104 unsigned long flags; 111 unsigned long flags;
112 unsigned long bus_shift;
105 u32 ocr_mask; /* available voltages */ 113 u32 ocr_mask; /* available voltages */
106 struct tmio_mmc_dma *dma; 114 struct tmio_mmc_dma *dma;
107 struct device *dev; 115 struct device *dev;
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index 87994542573b..cbecec2e353a 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -13,6 +13,12 @@
13#define TPS6586X_SLEW_RATE_SET 0x08 13#define TPS6586X_SLEW_RATE_SET 0x08
14#define TPS6586X_SLEW_RATE_MASK 0x07 14#define TPS6586X_SLEW_RATE_MASK 0x07
15 15
16/* VERSION CRC */
17#define TPS658621A 0x15
18#define TPS658621CD 0x2c
19#define TPS658623 0x1b
20#define TPS658643 0x03
21
16enum { 22enum {
17 TPS6586X_ID_SYS, 23 TPS6586X_ID_SYS,
18 TPS6586X_ID_SM_0, 24 TPS6586X_ID_SM_0,
@@ -97,5 +103,6 @@ extern int tps6586x_clr_bits(struct device *dev, int reg, uint8_t bit_mask);
97extern int tps6586x_update(struct device *dev, int reg, uint8_t val, 103extern int tps6586x_update(struct device *dev, int reg, uint8_t val,
98 uint8_t mask); 104 uint8_t mask);
99extern int tps6586x_irq_get_virq(struct device *dev, int irq); 105extern int tps6586x_irq_get_virq(struct device *dev, int irq);
106extern int tps6586x_get_version(struct device *dev);
100 107
101#endif /*__LINUX_MFD_TPS6586X_H */ 108#endif /*__LINUX_MFD_TPS6586X_H */
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index 20e433e551e3..16c2335c2856 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -358,8 +358,6 @@
358/*Register BBCH (0x80) register.RegisterDescription */ 358/*Register BBCH (0x80) register.RegisterDescription */
359#define BBCH_BBSEL_MASK 0x06 359#define BBCH_BBSEL_MASK 0x06
360#define BBCH_BBSEL_SHIFT 1 360#define BBCH_BBSEL_SHIFT 1
361#define BBCH_BBCHEN_MASK 0x01
362#define BBCH_BBCHEN_SHIFT 0
363 361
364 362
365/*Register DCDCCTRL (0x80) register.RegisterDescription */ 363/*Register DCDCCTRL (0x80) register.RegisterDescription */
@@ -833,6 +831,7 @@
833#define TPS65910_REG_VAUX2 10 831#define TPS65910_REG_VAUX2 10
834#define TPS65910_REG_VAUX33 11 832#define TPS65910_REG_VAUX33 11
835#define TPS65910_REG_VMMC 12 833#define TPS65910_REG_VMMC 12
834#define TPS65910_REG_VBB 13
836 835
837#define TPS65911_REG_VDDCTRL 4 836#define TPS65911_REG_VDDCTRL 4
838#define TPS65911_REG_LDO1 5 837#define TPS65911_REG_LDO1 5
@@ -845,7 +844,7 @@
845#define TPS65911_REG_LDO8 12 844#define TPS65911_REG_LDO8 12
846 845
847/* Max number of TPS65910/11 regulators */ 846/* Max number of TPS65910/11 regulators */
848#define TPS65910_NUM_REGS 13 847#define TPS65910_NUM_REGS 14
849 848
850/* External sleep controls through EN1/EN2/EN3/SLEEP inputs */ 849/* External sleep controls through EN1/EN2/EN3/SLEEP inputs */
851#define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 0x1 850#define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 0x1
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index f015c059e159..84a31ad0b791 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -35,16 +35,12 @@ enum migrate_reason {
35 35
36#ifdef CONFIG_MIGRATION 36#ifdef CONFIG_MIGRATION
37 37
38extern void putback_lru_pages(struct list_head *l);
39extern void putback_movable_pages(struct list_head *l); 38extern void putback_movable_pages(struct list_head *l);
40extern int migrate_page(struct address_space *, 39extern int migrate_page(struct address_space *,
41 struct page *, struct page *, enum migrate_mode); 40 struct page *, struct page *, enum migrate_mode);
42extern int migrate_pages(struct list_head *l, new_page_t x, 41extern int migrate_pages(struct list_head *l, new_page_t x,
43 unsigned long private, enum migrate_mode mode, int reason); 42 unsigned long private, enum migrate_mode mode, int reason);
44 43
45extern int fail_migrate_page(struct address_space *,
46 struct page *, struct page *);
47
48extern int migrate_prep(void); 44extern int migrate_prep(void);
49extern int migrate_prep_local(void); 45extern int migrate_prep_local(void);
50extern int migrate_vmas(struct mm_struct *mm, 46extern int migrate_vmas(struct mm_struct *mm,
@@ -59,7 +55,6 @@ extern int migrate_page_move_mapping(struct address_space *mapping,
59 int extra_count); 55 int extra_count);
60#else 56#else
61 57
62static inline void putback_lru_pages(struct list_head *l) {}
63static inline void putback_movable_pages(struct list_head *l) {} 58static inline void putback_movable_pages(struct list_head *l) {}
64static inline int migrate_pages(struct list_head *l, new_page_t x, 59static inline int migrate_pages(struct list_head *l, new_page_t x,
65 unsigned long private, enum migrate_mode mode, int reason) 60 unsigned long private, enum migrate_mode mode, int reason)
@@ -86,7 +81,6 @@ static inline int migrate_huge_page_move_mapping(struct address_space *mapping,
86 81
87/* Possible settings for the migrate_page() method in address_operations */ 82/* Possible settings for the migrate_page() method in address_operations */
88#define migrate_page NULL 83#define migrate_page NULL
89#define fail_migrate_page NULL
90 84
91#endif /* CONFIG_MIGRATION */ 85#endif /* CONFIG_MIGRATION */
92 86
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index f7eaf2d60083..3737f7218f51 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -30,6 +30,7 @@
30#define STORE_QUEUE_MINOR 155 30#define STORE_QUEUE_MINOR 155
31#define I2O_MINOR 166 31#define I2O_MINOR 166
32#define MICROCODE_MINOR 184 32#define MICROCODE_MINOR 184
33#define VFIO_MINOR 196
33#define TUN_MINOR 200 34#define TUN_MINOR 200
34#define CUSE_MINOR 203 35#define CUSE_MINOR 203
35#define MWAVE_MINOR 219 /* ACP/Mwave Modem */ 36#define MWAVE_MINOR 219 /* ACP/Mwave Modem */
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 8df61bc5da00..79a347238168 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -157,6 +157,7 @@ enum {
157 /* register/delete flow steering network rules */ 157 /* register/delete flow steering network rules */
158 MLX4_QP_FLOW_STEERING_ATTACH = 0x65, 158 MLX4_QP_FLOW_STEERING_ATTACH = 0x65,
159 MLX4_QP_FLOW_STEERING_DETACH = 0x66, 159 MLX4_QP_FLOW_STEERING_DETACH = 0x66,
160 MLX4_FLOW_STEERING_IB_UC_QP_RANGE = 0x64,
160}; 161};
161 162
162enum { 163enum {
@@ -180,6 +181,7 @@ enum {
180 MLX4_SET_PORT_GID_TABLE = 0x5, 181 MLX4_SET_PORT_GID_TABLE = 0x5,
181 MLX4_SET_PORT_PRIO2TC = 0x8, 182 MLX4_SET_PORT_PRIO2TC = 0x8,
182 MLX4_SET_PORT_SCHEDULER = 0x9, 183 MLX4_SET_PORT_SCHEDULER = 0x9,
184 MLX4_SET_PORT_VXLAN = 0xB
183}; 185};
184 186
185enum { 187enum {
diff --git a/include/linux/mlx4/cq.h b/include/linux/mlx4/cq.h
index 98fa492cf406..e7ecc12a1163 100644
--- a/include/linux/mlx4/cq.h
+++ b/include/linux/mlx4/cq.h
@@ -34,6 +34,7 @@
34#define MLX4_CQ_H 34#define MLX4_CQ_H
35 35
36#include <linux/types.h> 36#include <linux/types.h>
37#include <uapi/linux/if_ether.h>
37 38
38#include <linux/mlx4/device.h> 39#include <linux/mlx4/device.h>
39#include <linux/mlx4/doorbell.h> 40#include <linux/mlx4/doorbell.h>
@@ -43,10 +44,15 @@ struct mlx4_cqe {
43 __be32 immed_rss_invalid; 44 __be32 immed_rss_invalid;
44 __be32 g_mlpath_rqpn; 45 __be32 g_mlpath_rqpn;
45 __be16 sl_vid; 46 __be16 sl_vid;
46 __be16 rlid; 47 union {
47 __be16 status; 48 struct {
48 u8 ipv6_ext_mask; 49 __be16 rlid;
49 u8 badfcs_enc; 50 __be16 status;
51 u8 ipv6_ext_mask;
52 u8 badfcs_enc;
53 };
54 u8 smac[ETH_ALEN];
55 };
50 __be32 byte_cnt; 56 __be32 byte_cnt;
51 __be16 wqe_index; 57 __be16 wqe_index;
52 __be16 checksum; 58 __be16 checksum;
@@ -81,8 +87,14 @@ struct mlx4_ts_cqe {
81} __packed; 87} __packed;
82 88
83enum { 89enum {
90 MLX4_CQE_L2_TUNNEL_IPOK = 1 << 31,
84 MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29, 91 MLX4_CQE_VLAN_PRESENT_MASK = 1 << 29,
92 MLX4_CQE_L2_TUNNEL = 1 << 27,
93 MLX4_CQE_L2_TUNNEL_CSUM = 1 << 26,
94 MLX4_CQE_L2_TUNNEL_IPV4 = 1 << 25,
95
85 MLX4_CQE_QPN_MASK = 0xffffff, 96 MLX4_CQE_QPN_MASK = 0xffffff,
97 MLX4_CQE_VID_MASK = 0xfff,
86}; 98};
87 99
88enum { 100enum {
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 7d3a523160ba..5edd2c68274d 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -119,6 +119,11 @@ static inline const char *mlx4_steering_mode_str(int steering_mode)
119} 119}
120 120
121enum { 121enum {
122 MLX4_TUNNEL_OFFLOAD_MODE_NONE,
123 MLX4_TUNNEL_OFFLOAD_MODE_VXLAN
124};
125
126enum {
122 MLX4_DEV_CAP_FLAG_RC = 1LL << 0, 127 MLX4_DEV_CAP_FLAG_RC = 1LL << 0,
123 MLX4_DEV_CAP_FLAG_UC = 1LL << 1, 128 MLX4_DEV_CAP_FLAG_UC = 1LL << 1,
124 MLX4_DEV_CAP_FLAG_UD = 1LL << 2, 129 MLX4_DEV_CAP_FLAG_UD = 1LL << 2,
@@ -160,7 +165,9 @@ enum {
160 MLX4_DEV_CAP_FLAG2_TS = 1LL << 5, 165 MLX4_DEV_CAP_FLAG2_TS = 1LL << 5,
161 MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6, 166 MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6,
162 MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7, 167 MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7,
163 MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8 168 MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8,
169 MLX4_DEV_CAP_FLAG2_DMFS_IPOIB = 1LL << 9,
170 MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS = 1LL << 10,
164}; 171};
165 172
166enum { 173enum {
@@ -454,6 +461,8 @@ struct mlx4_caps {
454 u32 userspace_caps; /* userspace must be aware of these */ 461 u32 userspace_caps; /* userspace must be aware of these */
455 u32 function_caps; /* VFs must be aware of these */ 462 u32 function_caps; /* VFs must be aware of these */
456 u16 hca_core_clock; 463 u16 hca_core_clock;
464 u64 phys_port_id[MLX4_MAX_PORTS + 1];
465 int tunnel_offload_mode;
457}; 466};
458 467
459struct mlx4_buf_list { 468struct mlx4_buf_list {
@@ -908,6 +917,7 @@ enum mlx4_net_trans_rule_id {
908 MLX4_NET_TRANS_RULE_ID_IPV4, 917 MLX4_NET_TRANS_RULE_ID_IPV4,
909 MLX4_NET_TRANS_RULE_ID_TCP, 918 MLX4_NET_TRANS_RULE_ID_TCP,
910 MLX4_NET_TRANS_RULE_ID_UDP, 919 MLX4_NET_TRANS_RULE_ID_UDP,
920 MLX4_NET_TRANS_RULE_ID_VXLAN,
911 MLX4_NET_TRANS_RULE_NUM, /* should be last */ 921 MLX4_NET_TRANS_RULE_NUM, /* should be last */
912}; 922};
913 923
@@ -965,6 +975,12 @@ struct mlx4_spec_ib {
965 u8 dst_gid_msk[16]; 975 u8 dst_gid_msk[16];
966}; 976};
967 977
978struct mlx4_spec_vxlan {
979 __be32 vni;
980 __be32 vni_mask;
981
982};
983
968struct mlx4_spec_list { 984struct mlx4_spec_list {
969 struct list_head list; 985 struct list_head list;
970 enum mlx4_net_trans_rule_id id; 986 enum mlx4_net_trans_rule_id id;
@@ -973,6 +989,7 @@ struct mlx4_spec_list {
973 struct mlx4_spec_ib ib; 989 struct mlx4_spec_ib ib;
974 struct mlx4_spec_ipv4 ipv4; 990 struct mlx4_spec_ipv4 ipv4;
975 struct mlx4_spec_tcp_udp tcp_udp; 991 struct mlx4_spec_tcp_udp tcp_udp;
992 struct mlx4_spec_vxlan vxlan;
976 }; 993 };
977}; 994};
978 995
@@ -1059,6 +1076,15 @@ struct mlx4_net_trans_rule_hw_ipv4 {
1059 __be32 src_ip_msk; 1076 __be32 src_ip_msk;
1060} __packed; 1077} __packed;
1061 1078
1079struct mlx4_net_trans_rule_hw_vxlan {
1080 u8 size;
1081 u8 rsvd;
1082 __be16 id;
1083 __be32 rsvd1;
1084 __be32 vni;
1085 __be32 vni_mask;
1086} __packed;
1087
1062struct _rule_hw { 1088struct _rule_hw {
1063 union { 1089 union {
1064 struct { 1090 struct {
@@ -1070,9 +1096,19 @@ struct _rule_hw {
1070 struct mlx4_net_trans_rule_hw_ib ib; 1096 struct mlx4_net_trans_rule_hw_ib ib;
1071 struct mlx4_net_trans_rule_hw_ipv4 ipv4; 1097 struct mlx4_net_trans_rule_hw_ipv4 ipv4;
1072 struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp; 1098 struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp;
1099 struct mlx4_net_trans_rule_hw_vxlan vxlan;
1073 }; 1100 };
1074}; 1101};
1075 1102
1103enum {
1104 VXLAN_STEER_BY_OUTER_MAC = 1 << 0,
1105 VXLAN_STEER_BY_OUTER_VLAN = 1 << 1,
1106 VXLAN_STEER_BY_VSID_VNI = 1 << 2,
1107 VXLAN_STEER_BY_INNER_MAC = 1 << 3,
1108 VXLAN_STEER_BY_INNER_VLAN = 1 << 4,
1109};
1110
1111
1076int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn, 1112int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn,
1077 enum mlx4_net_trans_promisc_mode mode); 1113 enum mlx4_net_trans_promisc_mode mode);
1078int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port, 1114int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port,
@@ -1095,6 +1131,8 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
1095int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc); 1131int mlx4_SET_PORT_PRIO2TC(struct mlx4_dev *dev, u8 port, u8 *prio2tc);
1096int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw, 1132int mlx4_SET_PORT_SCHEDULER(struct mlx4_dev *dev, u8 port, u8 *tc_tx_bw,
1097 u8 *pg, u16 *ratelimit); 1133 u8 *pg, u16 *ratelimit);
1134int mlx4_SET_PORT_VXLAN(struct mlx4_dev *dev, u8 port, u8 steering);
1135int mlx4_find_cached_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *idx);
1098int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx); 1136int mlx4_find_cached_vlan(struct mlx4_dev *dev, u8 port, u16 vid, int *idx);
1099int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index); 1137int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index);
1100void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan); 1138void mlx4_unregister_vlan(struct mlx4_dev *dev, u8 port, u16 vlan);
@@ -1113,6 +1151,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char *name, struct cpu_rmap *rmap,
1113 int *vector); 1151 int *vector);
1114void mlx4_release_eq(struct mlx4_dev *dev, int vec); 1152void mlx4_release_eq(struct mlx4_dev *dev, int vec);
1115 1153
1154int mlx4_get_phys_port_id(struct mlx4_dev *dev);
1116int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); 1155int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port);
1117int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); 1156int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port);
1118 1157
@@ -1144,6 +1183,9 @@ int set_and_calc_slave_port_state(struct mlx4_dev *dev, int slave, u8 port, int
1144void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid); 1183void mlx4_put_slave_node_guid(struct mlx4_dev *dev, int slave, __be64 guid);
1145__be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave); 1184__be64 mlx4_get_slave_node_guid(struct mlx4_dev *dev, int slave);
1146 1185
1186int mlx4_FLOW_STEERING_IB_UC_QP_RANGE(struct mlx4_dev *dev, u32 min_range_qpn,
1187 u32 max_range_qpn);
1188
1147cycle_t mlx4_read_clock(struct mlx4_dev *dev); 1189cycle_t mlx4_read_clock(struct mlx4_dev *dev);
1148 1190
1149#endif /* MLX4_DEVICE_H */ 1191#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 6d351473c292..59f8ba84568b 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -109,6 +109,10 @@ enum {
109 MLX4_RSS_TCP_IPV4 = 1 << 4, 109 MLX4_RSS_TCP_IPV4 = 1 << 4,
110 MLX4_RSS_IPV4 = 1 << 5, 110 MLX4_RSS_IPV4 = 1 << 5,
111 111
112 MLX4_RSS_BY_OUTER_HEADERS = 0 << 6,
113 MLX4_RSS_BY_INNER_HEADERS = 2 << 6,
114 MLX4_RSS_BY_INNER_HEADERS_IPONLY = 3 << 6,
115
112 /* offset of mlx4_rss_context within mlx4_qp_context.pri_path */ 116 /* offset of mlx4_rss_context within mlx4_qp_context.pri_path */
113 MLX4_RSS_OFFSET_IN_QPC_PRI_PATH = 0x24, 117 MLX4_RSS_OFFSET_IN_QPC_PRI_PATH = 0x24,
114 /* offset of being RSS indirection QP within mlx4_qp_context.flags */ 118 /* offset of being RSS indirection QP within mlx4_qp_context.flags */
@@ -252,6 +256,8 @@ enum { /* param3 */
252 256
253enum { 257enum {
254 MLX4_WQE_CTRL_NEC = 1 << 29, 258 MLX4_WQE_CTRL_NEC = 1 << 29,
259 MLX4_WQE_CTRL_IIP = 1 << 28,
260 MLX4_WQE_CTRL_ILP = 1 << 27,
255 MLX4_WQE_CTRL_FENCE = 1 << 6, 261 MLX4_WQE_CTRL_FENCE = 1 << 6,
256 MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2, 262 MLX4_WQE_CTRL_CQ_UPDATE = 3 << 2,
257 MLX4_WQE_CTRL_SOLICITED = 1 << 1, 263 MLX4_WQE_CTRL_SOLICITED = 1 << 1,
diff --git a/include/linux/mlx5/cq.h b/include/linux/mlx5/cq.h
index 3db67f73d96d..2202c7f72b75 100644
--- a/include/linux/mlx5/cq.h
+++ b/include/linux/mlx5/cq.h
@@ -79,15 +79,23 @@ enum {
79 MLX5_CQE_RESP_SEND = 2, 79 MLX5_CQE_RESP_SEND = 2,
80 MLX5_CQE_RESP_SEND_IMM = 3, 80 MLX5_CQE_RESP_SEND_IMM = 3,
81 MLX5_CQE_RESP_SEND_INV = 4, 81 MLX5_CQE_RESP_SEND_INV = 4,
82 MLX5_CQE_RESIZE_CQ = 0xff, /* TBD */ 82 MLX5_CQE_RESIZE_CQ = 5,
83 MLX5_CQE_REQ_ERR = 13, 83 MLX5_CQE_REQ_ERR = 13,
84 MLX5_CQE_RESP_ERR = 14, 84 MLX5_CQE_RESP_ERR = 14,
85 MLX5_CQE_INVALID = 15,
85}; 86};
86 87
87enum { 88enum {
88 MLX5_CQ_MODIFY_RESEIZE = 0, 89 MLX5_CQ_MODIFY_PERIOD = 1 << 0,
89 MLX5_CQ_MODIFY_MODER = 1, 90 MLX5_CQ_MODIFY_COUNT = 1 << 1,
90 MLX5_CQ_MODIFY_MAPPING = 2, 91 MLX5_CQ_MODIFY_OVERRUN = 1 << 2,
92};
93
94enum {
95 MLX5_CQ_OPMOD_RESIZE = 1,
96 MLX5_MODIFY_CQ_MASK_LOG_SIZE = 1 << 0,
97 MLX5_MODIFY_CQ_MASK_PG_OFFSET = 1 << 1,
98 MLX5_MODIFY_CQ_MASK_PG_SIZE = 1 << 2,
91}; 99};
92 100
93struct mlx5_cq_modify_params { 101struct mlx5_cq_modify_params {
@@ -158,7 +166,7 @@ int mlx5_core_destroy_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq);
158int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, 166int mlx5_core_query_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
159 struct mlx5_query_cq_mbox_out *out); 167 struct mlx5_query_cq_mbox_out *out);
160int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq, 168int mlx5_core_modify_cq(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq,
161 int type, struct mlx5_cq_modify_params *params); 169 struct mlx5_modify_cq_mbox_in *in, int in_sz);
162int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); 170int mlx5_debug_cq_add(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq);
163void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq); 171void mlx5_debug_cq_remove(struct mlx5_core_dev *dev, struct mlx5_core_cq *cq);
164 172
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index da78875807fc..817a6fae6d2c 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -104,9 +104,10 @@ enum {
104}; 104};
105 105
106enum { 106enum {
107 MLX5_BF_REGS_PER_PAGE = 4, 107 MLX5_BF_REGS_PER_PAGE = 4,
108 MLX5_MAX_UAR_PAGES = 1 << 8, 108 MLX5_MAX_UAR_PAGES = 1 << 8,
109 MLX5_MAX_UUARS = MLX5_MAX_UAR_PAGES * MLX5_BF_REGS_PER_PAGE, 109 MLX5_NON_FP_BF_REGS_PER_PAGE = 2,
110 MLX5_MAX_UUARS = MLX5_MAX_UAR_PAGES * MLX5_NON_FP_BF_REGS_PER_PAGE,
110}; 111};
111 112
112enum { 113enum {
@@ -176,6 +177,8 @@ enum {
176 MLX5_DEV_CAP_FLAG_APM = 1LL << 17, 177 MLX5_DEV_CAP_FLAG_APM = 1LL << 17,
177 MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18, 178 MLX5_DEV_CAP_FLAG_ATOMIC = 1LL << 18,
178 MLX5_DEV_CAP_FLAG_ON_DMND_PG = 1LL << 24, 179 MLX5_DEV_CAP_FLAG_ON_DMND_PG = 1LL << 24,
180 MLX5_DEV_CAP_FLAG_CQ_MODER = 1LL << 29,
181 MLX5_DEV_CAP_FLAG_RESIZE_CQ = 1LL << 30,
179 MLX5_DEV_CAP_FLAG_RESIZE_SRQ = 1LL << 32, 182 MLX5_DEV_CAP_FLAG_RESIZE_SRQ = 1LL << 32,
180 MLX5_DEV_CAP_FLAG_REMOTE_FENCE = 1LL << 38, 183 MLX5_DEV_CAP_FLAG_REMOTE_FENCE = 1LL << 38,
181 MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39, 184 MLX5_DEV_CAP_FLAG_TLP_HINTS = 1LL << 39,
@@ -231,7 +234,8 @@ enum {
231}; 234};
232 235
233enum { 236enum {
234 MLX5_ADAPTER_PAGE_SHIFT = 12 237 MLX5_ADAPTER_PAGE_SHIFT = 12,
238 MLX5_ADAPTER_PAGE_SIZE = 1 << MLX5_ADAPTER_PAGE_SHIFT,
235}; 239};
236 240
237enum { 241enum {
@@ -697,6 +701,20 @@ struct mlx5_query_cq_mbox_out {
697 __be64 pas[0]; 701 __be64 pas[0];
698}; 702};
699 703
704struct mlx5_modify_cq_mbox_in {
705 struct mlx5_inbox_hdr hdr;
706 __be32 cqn;
707 __be32 field_select;
708 struct mlx5_cq_context ctx;
709 u8 rsvd[192];
710 __be64 pas[0];
711};
712
713struct mlx5_modify_cq_mbox_out {
714 struct mlx5_outbox_hdr hdr;
715 u8 rsvd[8];
716};
717
700struct mlx5_enable_hca_mbox_in { 718struct mlx5_enable_hca_mbox_in {
701 struct mlx5_inbox_hdr hdr; 719 struct mlx5_inbox_hdr hdr;
702 u8 rsvd[8]; 720 u8 rsvd[8];
@@ -831,8 +849,8 @@ struct mlx5_create_mkey_mbox_in {
831 struct mlx5_mkey_seg seg; 849 struct mlx5_mkey_seg seg;
832 u8 rsvd1[16]; 850 u8 rsvd1[16];
833 __be32 xlat_oct_act_size; 851 __be32 xlat_oct_act_size;
834 __be32 bsf_coto_act_size; 852 __be32 rsvd2;
835 u8 rsvd2[168]; 853 u8 rsvd3[168];
836 __be64 pas[0]; 854 __be64 pas[0];
837}; 855};
838 856
@@ -871,6 +889,7 @@ struct mlx5_modify_mkey_mbox_in {
871 889
872struct mlx5_modify_mkey_mbox_out { 890struct mlx5_modify_mkey_mbox_out {
873 struct mlx5_outbox_hdr hdr; 891 struct mlx5_outbox_hdr hdr;
892 u8 rsvd[8];
874}; 893};
875 894
876struct mlx5_dump_mkey_mbox_in { 895struct mlx5_dump_mkey_mbox_in {
diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h
index d9e3eacb3a7f..d51eff713549 100644
--- a/include/linux/mlx5/qp.h
+++ b/include/linux/mlx5/qp.h
@@ -464,4 +464,49 @@ void mlx5_cleanup_qp_table(struct mlx5_core_dev *dev);
464int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); 464int mlx5_debug_qp_add(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp);
465void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp); 465void mlx5_debug_qp_remove(struct mlx5_core_dev *dev, struct mlx5_core_qp *qp);
466 466
467static inline const char *mlx5_qp_type_str(int type)
468{
469 switch (type) {
470 case MLX5_QP_ST_RC: return "RC";
471 case MLX5_QP_ST_UC: return "C";
472 case MLX5_QP_ST_UD: return "UD";
473 case MLX5_QP_ST_XRC: return "XRC";
474 case MLX5_QP_ST_MLX: return "MLX";
475 case MLX5_QP_ST_QP0: return "QP0";
476 case MLX5_QP_ST_QP1: return "QP1";
477 case MLX5_QP_ST_RAW_ETHERTYPE: return "RAW_ETHERTYPE";
478 case MLX5_QP_ST_RAW_IPV6: return "RAW_IPV6";
479 case MLX5_QP_ST_SNIFFER: return "SNIFFER";
480 case MLX5_QP_ST_SYNC_UMR: return "SYNC_UMR";
481 case MLX5_QP_ST_PTP_1588: return "PTP_1588";
482 case MLX5_QP_ST_REG_UMR: return "REG_UMR";
483 default: return "Invalid transport type";
484 }
485}
486
487static inline const char *mlx5_qp_state_str(int state)
488{
489 switch (state) {
490 case MLX5_QP_STATE_RST:
491 return "RST";
492 case MLX5_QP_STATE_INIT:
493 return "INIT";
494 case MLX5_QP_STATE_RTR:
495 return "RTR";
496 case MLX5_QP_STATE_RTS:
497 return "RTS";
498 case MLX5_QP_STATE_SQER:
499 return "SQER";
500 case MLX5_QP_STATE_SQD:
501 return "SQD";
502 case MLX5_QP_STATE_ERR:
503 return "ERR";
504 case MLX5_QP_STATE_SQ_DRAINING:
505 return "SQ_DRAINING";
506 case MLX5_QP_STATE_SUSPENDED:
507 return "SUSPENDED";
508 default: return "Invalid QP state";
509 }
510}
511
467#endif /* MLX5_QP_H */ 512#endif /* MLX5_QP_H */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 35527173cf50..f28f46eade6a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -5,6 +5,7 @@
5 5
6#ifdef __KERNEL__ 6#ifdef __KERNEL__
7 7
8#include <linux/mmdebug.h>
8#include <linux/gfp.h> 9#include <linux/gfp.h>
9#include <linux/bug.h> 10#include <linux/bug.h>
10#include <linux/list.h> 11#include <linux/list.h>
@@ -57,6 +58,15 @@ extern int sysctl_legacy_va_layout;
57extern unsigned long sysctl_user_reserve_kbytes; 58extern unsigned long sysctl_user_reserve_kbytes;
58extern unsigned long sysctl_admin_reserve_kbytes; 59extern unsigned long sysctl_admin_reserve_kbytes;
59 60
61extern int sysctl_overcommit_memory;
62extern int sysctl_overcommit_ratio;
63extern unsigned long sysctl_overcommit_kbytes;
64
65extern int overcommit_ratio_handler(struct ctl_table *, int, void __user *,
66 size_t *, loff_t *);
67extern int overcommit_kbytes_handler(struct ctl_table *, int, void __user *,
68 size_t *, loff_t *);
69
60#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n)) 70#define nth_page(page,n) pfn_to_page(page_to_pfn((page)) + (n))
61 71
62/* to align the pointer to the (next) page boundary */ 72/* to align the pointer to the (next) page boundary */
@@ -294,7 +304,7 @@ static inline int get_freepage_migratetype(struct page *page)
294 */ 304 */
295static inline int put_page_testzero(struct page *page) 305static inline int put_page_testzero(struct page *page)
296{ 306{
297 VM_BUG_ON(atomic_read(&page->_count) == 0); 307 VM_BUG_ON_PAGE(atomic_read(&page->_count) == 0, page);
298 return atomic_dec_and_test(&page->_count); 308 return atomic_dec_and_test(&page->_count);
299} 309}
300 310
@@ -355,7 +365,7 @@ static inline int is_vmalloc_or_module_addr(const void *x)
355static inline void compound_lock(struct page *page) 365static inline void compound_lock(struct page *page)
356{ 366{
357#ifdef CONFIG_TRANSPARENT_HUGEPAGE 367#ifdef CONFIG_TRANSPARENT_HUGEPAGE
358 VM_BUG_ON(PageSlab(page)); 368 VM_BUG_ON_PAGE(PageSlab(page), page);
359 bit_spin_lock(PG_compound_lock, &page->flags); 369 bit_spin_lock(PG_compound_lock, &page->flags);
360#endif 370#endif
361} 371}
@@ -363,7 +373,7 @@ static inline void compound_lock(struct page *page)
363static inline void compound_unlock(struct page *page) 373static inline void compound_unlock(struct page *page)
364{ 374{
365#ifdef CONFIG_TRANSPARENT_HUGEPAGE 375#ifdef CONFIG_TRANSPARENT_HUGEPAGE
366 VM_BUG_ON(PageSlab(page)); 376 VM_BUG_ON_PAGE(PageSlab(page), page);
367 bit_spin_unlock(PG_compound_lock, &page->flags); 377 bit_spin_unlock(PG_compound_lock, &page->flags);
368#endif 378#endif
369} 379}
@@ -414,15 +424,44 @@ static inline int page_count(struct page *page)
414 return atomic_read(&compound_head(page)->_count); 424 return atomic_read(&compound_head(page)->_count);
415} 425}
416 426
427#ifdef CONFIG_HUGETLB_PAGE
428extern int PageHeadHuge(struct page *page_head);
429#else /* CONFIG_HUGETLB_PAGE */
430static inline int PageHeadHuge(struct page *page_head)
431{
432 return 0;
433}
434#endif /* CONFIG_HUGETLB_PAGE */
435
436static inline bool __compound_tail_refcounted(struct page *page)
437{
438 return !PageSlab(page) && !PageHeadHuge(page);
439}
440
441/*
442 * This takes a head page as parameter and tells if the
443 * tail page reference counting can be skipped.
444 *
445 * For this to be safe, PageSlab and PageHeadHuge must remain true on
446 * any given page where they return true here, until all tail pins
447 * have been released.
448 */
449static inline bool compound_tail_refcounted(struct page *page)
450{
451 VM_BUG_ON_PAGE(!PageHead(page), page);
452 return __compound_tail_refcounted(page);
453}
454
417static inline void get_huge_page_tail(struct page *page) 455static inline void get_huge_page_tail(struct page *page)
418{ 456{
419 /* 457 /*
420 * __split_huge_page_refcount() cannot run 458 * __split_huge_page_refcount() cannot run from under us.
421 * from under us.
422 */ 459 */
423 VM_BUG_ON(page_mapcount(page) < 0); 460 VM_BUG_ON_PAGE(!PageTail(page), page);
424 VM_BUG_ON(atomic_read(&page->_count) != 0); 461 VM_BUG_ON_PAGE(page_mapcount(page) < 0, page);
425 atomic_inc(&page->_mapcount); 462 VM_BUG_ON_PAGE(atomic_read(&page->_count) != 0, page);
463 if (compound_tail_refcounted(page->first_page))
464 atomic_inc(&page->_mapcount);
426} 465}
427 466
428extern bool __get_page_tail(struct page *page); 467extern bool __get_page_tail(struct page *page);
@@ -436,7 +475,7 @@ static inline void get_page(struct page *page)
436 * Getting a normal page or the head of a compound page 475 * Getting a normal page or the head of a compound page
437 * requires to already have an elevated page->_count. 476 * requires to already have an elevated page->_count.
438 */ 477 */
439 VM_BUG_ON(atomic_read(&page->_count) <= 0); 478 VM_BUG_ON_PAGE(atomic_read(&page->_count) <= 0, page);
440 atomic_inc(&page->_count); 479 atomic_inc(&page->_count);
441} 480}
442 481
@@ -473,13 +512,13 @@ static inline int PageBuddy(struct page *page)
473 512
474static inline void __SetPageBuddy(struct page *page) 513static inline void __SetPageBuddy(struct page *page)
475{ 514{
476 VM_BUG_ON(atomic_read(&page->_mapcount) != -1); 515 VM_BUG_ON_PAGE(atomic_read(&page->_mapcount) != -1, page);
477 atomic_set(&page->_mapcount, PAGE_BUDDY_MAPCOUNT_VALUE); 516 atomic_set(&page->_mapcount, PAGE_BUDDY_MAPCOUNT_VALUE);
478} 517}
479 518
480static inline void __ClearPageBuddy(struct page *page) 519static inline void __ClearPageBuddy(struct page *page)
481{ 520{
482 VM_BUG_ON(!PageBuddy(page)); 521 VM_BUG_ON_PAGE(!PageBuddy(page), page);
483 atomic_set(&page->_mapcount, -1); 522 atomic_set(&page->_mapcount, -1);
484} 523}
485 524
@@ -846,11 +885,14 @@ static __always_inline void *lowmem_page_address(const struct page *page)
846#endif 885#endif
847 886
848#if defined(WANT_PAGE_VIRTUAL) 887#if defined(WANT_PAGE_VIRTUAL)
849#define page_address(page) ((page)->virtual) 888static inline void *page_address(const struct page *page)
850#define set_page_address(page, address) \ 889{
851 do { \ 890 return page->virtual;
852 (page)->virtual = (address); \ 891}
853 } while(0) 892static inline void set_page_address(struct page *page, void *address)
893{
894 page->virtual = address;
895}
854#define page_address_init() do { } while(0) 896#define page_address_init() do { } while(0)
855#endif 897#endif
856 898
@@ -984,7 +1026,6 @@ extern void pagefault_out_of_memory(void);
984 * various contexts. 1026 * various contexts.
985 */ 1027 */
986#define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */ 1028#define SHOW_MEM_FILTER_NODES (0x0001u) /* disallowed nodes */
987#define SHOW_MEM_FILTER_PAGE_COUNT (0x0002u) /* page type count */
988 1029
989extern void show_free_areas(unsigned int flags); 1030extern void show_free_areas(unsigned int flags);
990extern bool skip_free_areas_node(unsigned int flags, int nid); 1031extern bool skip_free_areas_node(unsigned int flags, int nid);
@@ -1318,6 +1359,7 @@ static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long a
1318 1359
1319#if USE_SPLIT_PTE_PTLOCKS 1360#if USE_SPLIT_PTE_PTLOCKS
1320#if ALLOC_SPLIT_PTLOCKS 1361#if ALLOC_SPLIT_PTLOCKS
1362void __init ptlock_cache_init(void);
1321extern bool ptlock_alloc(struct page *page); 1363extern bool ptlock_alloc(struct page *page);
1322extern void ptlock_free(struct page *page); 1364extern void ptlock_free(struct page *page);
1323 1365
@@ -1326,6 +1368,10 @@ static inline spinlock_t *ptlock_ptr(struct page *page)
1326 return page->ptl; 1368 return page->ptl;
1327} 1369}
1328#else /* ALLOC_SPLIT_PTLOCKS */ 1370#else /* ALLOC_SPLIT_PTLOCKS */
1371static inline void ptlock_cache_init(void)
1372{
1373}
1374
1329static inline bool ptlock_alloc(struct page *page) 1375static inline bool ptlock_alloc(struct page *page)
1330{ 1376{
1331 return true; 1377 return true;
@@ -1356,7 +1402,7 @@ static inline bool ptlock_init(struct page *page)
1356 * slab code uses page->slab_cache and page->first_page (for tail 1402 * slab code uses page->slab_cache and page->first_page (for tail
1357 * pages), which share storage with page->ptl. 1403 * pages), which share storage with page->ptl.
1358 */ 1404 */
1359 VM_BUG_ON(*(unsigned long *)&page->ptl); 1405 VM_BUG_ON_PAGE(*(unsigned long *)&page->ptl, page);
1360 if (!ptlock_alloc(page)) 1406 if (!ptlock_alloc(page))
1361 return false; 1407 return false;
1362 spin_lock_init(ptlock_ptr(page)); 1408 spin_lock_init(ptlock_ptr(page));
@@ -1378,10 +1424,17 @@ static inline spinlock_t *pte_lockptr(struct mm_struct *mm, pmd_t *pmd)
1378{ 1424{
1379 return &mm->page_table_lock; 1425 return &mm->page_table_lock;
1380} 1426}
1427static inline void ptlock_cache_init(void) {}
1381static inline bool ptlock_init(struct page *page) { return true; } 1428static inline bool ptlock_init(struct page *page) { return true; }
1382static inline void pte_lock_deinit(struct page *page) {} 1429static inline void pte_lock_deinit(struct page *page) {}
1383#endif /* USE_SPLIT_PTE_PTLOCKS */ 1430#endif /* USE_SPLIT_PTE_PTLOCKS */
1384 1431
1432static inline void pgtable_init(void)
1433{
1434 ptlock_cache_init();
1435 pgtable_cache_init();
1436}
1437
1385static inline bool pgtable_page_ctor(struct page *page) 1438static inline bool pgtable_page_ctor(struct page *page)
1386{ 1439{
1387 inc_zone_page_state(page, NR_PAGETABLE); 1440 inc_zone_page_state(page, NR_PAGETABLE);
@@ -1440,7 +1493,7 @@ static inline bool pgtable_pmd_page_ctor(struct page *page)
1440static inline void pgtable_pmd_page_dtor(struct page *page) 1493static inline void pgtable_pmd_page_dtor(struct page *page)
1441{ 1494{
1442#ifdef CONFIG_TRANSPARENT_HUGEPAGE 1495#ifdef CONFIG_TRANSPARENT_HUGEPAGE
1443 VM_BUG_ON(page->pmd_huge_pte); 1496 VM_BUG_ON_PAGE(page->pmd_huge_pte, page);
1444#endif 1497#endif
1445 ptlock_free(page); 1498 ptlock_free(page);
1446} 1499}
@@ -1842,7 +1895,7 @@ static inline pgprot_t vm_get_page_prot(unsigned long vm_flags)
1842} 1895}
1843#endif 1896#endif
1844 1897
1845#ifdef CONFIG_ARCH_USES_NUMA_PROT_NONE 1898#ifdef CONFIG_NUMA_BALANCING
1846unsigned long change_prot_numa(struct vm_area_struct *vma, 1899unsigned long change_prot_numa(struct vm_area_struct *vma,
1847 unsigned long start, unsigned long end); 1900 unsigned long start, unsigned long end);
1848#endif 1901#endif
@@ -1977,8 +2030,6 @@ extern void shake_page(struct page *p, int access);
1977extern atomic_long_t num_poisoned_pages; 2030extern atomic_long_t num_poisoned_pages;
1978extern int soft_offline_page(struct page *page, int flags); 2031extern int soft_offline_page(struct page *page, int flags);
1979 2032
1980extern void dump_page(struct page *page);
1981
1982#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS) 2033#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLBFS)
1983extern void clear_huge_page(struct page *page, 2034extern void clear_huge_page(struct page *page,
1984 unsigned long addr, 2035 unsigned long addr,
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 7f7f8dae4b1d..16373c8f5f57 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -9,6 +9,7 @@
9 9
10extern int sysctl_overcommit_memory; 10extern int sysctl_overcommit_memory;
11extern int sysctl_overcommit_ratio; 11extern int sysctl_overcommit_ratio;
12extern unsigned long sysctl_overcommit_kbytes;
12extern struct percpu_counter vm_committed_as; 13extern struct percpu_counter vm_committed_as;
13 14
14#ifdef CONFIG_SMP 15#ifdef CONFIG_SMP
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 176fdf824b14..b73027298b3a 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -271,9 +271,10 @@ struct mmc_card {
271#define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ 271#define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */
272#define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ 272#define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */
273#define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */ 273#define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */
274 /* byte mode */
274#define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */ 275#define MMC_QUIRK_LONG_READ_TIME (1<<9) /* Data read time > CSD says */
275#define MMC_QUIRK_SEC_ERASE_TRIM_BROKEN (1<<10) /* Skip secure for erase/trim */ 276#define MMC_QUIRK_SEC_ERASE_TRIM_BROKEN (1<<10) /* Skip secure for erase/trim */
276 /* byte mode */ 277#define MMC_QUIRK_BROKEN_IRQ_POLLING (1<<11) /* Polling SDIO_CCCR_INTx could create a fake interrupt */
277 278
278 unsigned int erase_size; /* erase size in sectors */ 279 unsigned int erase_size; /* erase size in sectors */
279 unsigned int erase_shift; /* if erase unit is power 2 */ 280 unsigned int erase_shift; /* if erase unit is power 2 */
@@ -505,6 +506,11 @@ static inline int mmc_card_long_read_time(const struct mmc_card *c)
505 return c->quirks & MMC_QUIRK_LONG_READ_TIME; 506 return c->quirks & MMC_QUIRK_LONG_READ_TIME;
506} 507}
507 508
509static inline int mmc_card_broken_irq_polling(const struct mmc_card *c)
510{
511 return c->quirks & MMC_QUIRK_BROKEN_IRQ_POLLING;
512}
513
508#define mmc_card_name(c) ((c)->cid.prod_name) 514#define mmc_card_name(c) ((c)->cid.prod_name)
509#define mmc_card_id(c) (dev_name(&(c)->dev)) 515#define mmc_card_id(c) (dev_name(&(c)->dev))
510 516
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 3e781b8c0be7..362927c48f97 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -98,6 +98,8 @@ struct sdhci_host {
98#define SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON (1<<4) 98#define SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON (1<<4)
99/* Controller has a non-standard host control register */ 99/* Controller has a non-standard host control register */
100#define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5) 100#define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5)
101/* Controller does not support HS200 */
102#define SDHCI_QUIRK2_BROKEN_HS200 (1<<6)
101 103
102 int irq; /* Device IRQ */ 104 int irq; /* Device IRQ */
103 void __iomem *ioaddr; /* Mapped address */ 105 void __iomem *ioaddr; /* Mapped address */
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index 9f03feedc8e7..d8836623f36a 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -23,6 +23,15 @@
23/* 23/*
24 * Vendors and devices. Sort key: vendor first, device next. 24 * Vendors and devices. Sort key: vendor first, device next.
25 */ 25 */
26#define SDIO_VENDOR_ID_BROADCOM 0x02d0
27#define SDIO_DEVICE_ID_BROADCOM_43143 43143
28#define SDIO_DEVICE_ID_BROADCOM_43241 0x4324
29#define SDIO_DEVICE_ID_BROADCOM_4329 0x4329
30#define SDIO_DEVICE_ID_BROADCOM_4330 0x4330
31#define SDIO_DEVICE_ID_BROADCOM_4334 0x4334
32#define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335
33#define SDIO_DEVICE_ID_BROADCOM_43362 43362
34
26#define SDIO_VENDOR_ID_INTEL 0x0089 35#define SDIO_VENDOR_ID_INTEL 0x0089
27#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402 36#define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402
28#define SDIO_DEVICE_ID_INTEL_IWMC3200WIFI 0x1403 37#define SDIO_DEVICE_ID_INTEL_IWMC3200WIFI 0x1403
diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h
index a1c1f321e519..84d9053b5dca 100644
--- a/include/linux/mmc/tmio.h
+++ b/include/linux/mmc/tmio.h
@@ -33,6 +33,7 @@
33#define CTL_SDIO_IRQ_MASK 0x38 33#define CTL_SDIO_IRQ_MASK 0x38
34#define CTL_DMA_ENABLE 0xd8 34#define CTL_DMA_ENABLE 0xd8
35#define CTL_RESET_SD 0xe0 35#define CTL_RESET_SD 0xe0
36#define CTL_VERSION 0xe2
36#define CTL_SDIO_REGS 0x100 37#define CTL_SDIO_REGS 0x100
37#define CTL_CLK_AND_WAIT_CTL 0x138 38#define CTL_CLK_AND_WAIT_CTL 0x138
38#define CTL_RESET_SDIO 0x1e0 39#define CTL_RESET_SDIO 0x1e0
diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h
index 580bd587d916..5042c036dda9 100644
--- a/include/linux/mmdebug.h
+++ b/include/linux/mmdebug.h
@@ -1,10 +1,19 @@
1#ifndef LINUX_MM_DEBUG_H 1#ifndef LINUX_MM_DEBUG_H
2#define LINUX_MM_DEBUG_H 1 2#define LINUX_MM_DEBUG_H 1
3 3
4struct page;
5
6extern void dump_page(struct page *page, char *reason);
7extern void dump_page_badflags(struct page *page, char *reason,
8 unsigned long badflags);
9
4#ifdef CONFIG_DEBUG_VM 10#ifdef CONFIG_DEBUG_VM
5#define VM_BUG_ON(cond) BUG_ON(cond) 11#define VM_BUG_ON(cond) BUG_ON(cond)
12#define VM_BUG_ON_PAGE(cond, page) \
13 do { if (unlikely(cond)) { dump_page(page, NULL); BUG(); } } while (0)
6#else 14#else
7#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) 15#define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond)
16#define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond)
8#endif 17#endif
9 18
10#ifdef CONFIG_DEBUG_VIRTUAL 19#ifdef CONFIG_DEBUG_VIRTUAL
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index bd791e452ad7..5f2052c83154 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -490,6 +490,12 @@ struct zone {
490 unsigned long managed_pages; 490 unsigned long managed_pages;
491 491
492 /* 492 /*
493 * Number of MIGRATE_RESEVE page block. To maintain for just
494 * optimization. Protected by zone->lock.
495 */
496 int nr_migrate_reserve_block;
497
498 /*
493 * rarely used fields: 499 * rarely used fields:
494 */ 500 */
495 const char *name; 501 const char *name;
@@ -758,10 +764,7 @@ typedef struct pglist_data {
758 int kswapd_max_order; 764 int kswapd_max_order;
759 enum zone_type classzone_idx; 765 enum zone_type classzone_idx;
760#ifdef CONFIG_NUMA_BALANCING 766#ifdef CONFIG_NUMA_BALANCING
761 /* 767 /* Lock serializing the migrate rate limiting window */
762 * Lock serializing the per destination node AutoNUMA memory
763 * migration rate limiting data.
764 */
765 spinlock_t numabalancing_migrate_lock; 768 spinlock_t numabalancing_migrate_lock;
766 769
767 /* Rate limiting time interval */ 770 /* Rate limiting time interval */
diff --git a/include/linux/module.h b/include/linux/module.h
index 15cd6b1b211e..eaf60ff9ba94 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -29,8 +29,7 @@
29 29
30#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN 30#define MODULE_NAME_LEN MAX_PARAM_PREFIX_LEN
31 31
32struct modversion_info 32struct modversion_info {
33{
34 unsigned long crc; 33 unsigned long crc;
35 char name[MODULE_NAME_LEN]; 34 char name[MODULE_NAME_LEN];
36}; 35};
@@ -84,12 +83,12 @@ void sort_main_extable(void);
84void trim_init_extable(struct module *m); 83void trim_init_extable(struct module *m);
85 84
86#ifdef MODULE 85#ifdef MODULE
87#define MODULE_GENERIC_TABLE(gtype,name) \ 86#define MODULE_GENERIC_TABLE(gtype, name) \
88extern const struct gtype##_id __mod_##gtype##_table \ 87extern const struct gtype##_id __mod_##gtype##_table \
89 __attribute__ ((unused, alias(__stringify(name)))) 88 __attribute__ ((unused, alias(__stringify(name))))
90 89
91#else /* !MODULE */ 90#else /* !MODULE */
92#define MODULE_GENERIC_TABLE(gtype,name) 91#define MODULE_GENERIC_TABLE(gtype, name)
93#endif 92#endif
94 93
95/* Generic info of form tag = "info" */ 94/* Generic info of form tag = "info" */
@@ -126,7 +125,7 @@ extern const struct gtype##_id __mod_##gtype##_table \
126 * is a GPL combined work. 125 * is a GPL combined work.
127 * 126 *
128 * This exists for several reasons 127 * This exists for several reasons
129 * 1. So modinfo can show license info for users wanting to vet their setup 128 * 1. So modinfo can show license info for users wanting to vet their setup
130 * is free 129 * is free
131 * 2. So the community can ignore bug reports including proprietary modules 130 * 2. So the community can ignore bug reports including proprietary modules
132 * 3. So vendors can do likewise based on their own policies 131 * 3. So vendors can do likewise based on their own policies
@@ -138,27 +137,29 @@ extern const struct gtype##_id __mod_##gtype##_table \
138 * authors use multiple MODULE_AUTHOR() statements/lines. 137 * authors use multiple MODULE_AUTHOR() statements/lines.
139 */ 138 */
140#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) 139#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author)
141 140
142/* What your module does. */ 141/* What your module does. */
143#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) 142#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description)
144 143
145#define MODULE_DEVICE_TABLE(type,name) \ 144#define MODULE_DEVICE_TABLE(type, name) \
146 MODULE_GENERIC_TABLE(type##_device,name) 145 MODULE_GENERIC_TABLE(type##_device, name)
147 146
148/* Version of form [<epoch>:]<version>[-<extra-version>]. 147/* Version of form [<epoch>:]<version>[-<extra-version>].
149 Or for CVS/RCS ID version, everything but the number is stripped. 148 * Or for CVS/RCS ID version, everything but the number is stripped.
150 <epoch>: A (small) unsigned integer which allows you to start versions 149 * <epoch>: A (small) unsigned integer which allows you to start versions
151 anew. If not mentioned, it's zero. eg. "2:1.0" is after 150 * anew. If not mentioned, it's zero. eg. "2:1.0" is after
152 "1:2.0". 151 * "1:2.0".
153 <version>: The <version> may contain only alphanumerics and the 152
154 character `.'. Ordered by numeric sort for numeric parts, 153 * <version>: The <version> may contain only alphanumerics and the
155 ascii sort for ascii parts (as per RPM or DEB algorithm). 154 * character `.'. Ordered by numeric sort for numeric parts,
156 <extraversion>: Like <version>, but inserted for local 155 * ascii sort for ascii parts (as per RPM or DEB algorithm).
157 customizations, eg "rh3" or "rusty1". 156
158 157 * <extraversion>: Like <version>, but inserted for local
159 Using this automatically adds a checksum of the .c files and the 158 * customizations, eg "rh3" or "rusty1".
160 local headers in "srcversion". 159
161*/ 160 * Using this automatically adds a checksum of the .c files and the
161 * local headers in "srcversion".
162 */
162 163
163#if defined(MODULE) || !defined(CONFIG_SYSFS) 164#if defined(MODULE) || !defined(CONFIG_SYSFS)
164#define MODULE_VERSION(_version) MODULE_INFO(version, _version) 165#define MODULE_VERSION(_version) MODULE_INFO(version, _version)
@@ -226,8 +227,7 @@ struct module_ref {
226 unsigned long decs; 227 unsigned long decs;
227} __attribute((aligned(2 * sizeof(unsigned long)))); 228} __attribute((aligned(2 * sizeof(unsigned long))));
228 229
229struct module 230struct module {
230{
231 enum module_state state; 231 enum module_state state;
232 232
233 /* Member of list of modules */ 233 /* Member of list of modules */
@@ -451,7 +451,7 @@ int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
451 451
452extern void __module_put_and_exit(struct module *mod, long code) 452extern void __module_put_and_exit(struct module *mod, long code)
453 __attribute__((noreturn)); 453 __attribute__((noreturn));
454#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code); 454#define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code)
455 455
456#ifdef CONFIG_MODULE_UNLOAD 456#ifdef CONFIG_MODULE_UNLOAD
457unsigned long module_refcount(struct module *mod); 457unsigned long module_refcount(struct module *mod);
@@ -480,8 +480,8 @@ static inline void module_put(struct module *module)
480static inline void __module_get(struct module *module) 480static inline void __module_get(struct module *module)
481{ 481{
482} 482}
483#define symbol_put(x) do { } while(0) 483#define symbol_put(x) do { } while (0)
484#define symbol_put_addr(p) do { } while(0) 484#define symbol_put_addr(p) do { } while (0)
485 485
486#endif /* CONFIG_MODULE_UNLOAD */ 486#endif /* CONFIG_MODULE_UNLOAD */
487int ref_module(struct module *a, struct module *b); 487int ref_module(struct module *a, struct module *b);
@@ -507,8 +507,8 @@ int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size, unsigned
507/* For extable.c to search modules' exception tables. */ 507/* For extable.c to search modules' exception tables. */
508const struct exception_table_entry *search_module_extables(unsigned long addr); 508const struct exception_table_entry *search_module_extables(unsigned long addr);
509 509
510int register_module_notifier(struct notifier_block * nb); 510int register_module_notifier(struct notifier_block *nb);
511int unregister_module_notifier(struct notifier_block * nb); 511int unregister_module_notifier(struct notifier_block *nb);
512 512
513extern void print_modules(void); 513extern void print_modules(void);
514 514
@@ -548,8 +548,8 @@ static inline bool is_module_text_address(unsigned long addr)
548 548
549/* Get/put a kernel symbol (calls should be symmetric) */ 549/* Get/put a kernel symbol (calls should be symmetric) */
550#define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); }) 550#define symbol_get(x) ({ extern typeof(x) x __attribute__((weak)); &(x); })
551#define symbol_put(x) do { } while(0) 551#define symbol_put(x) do { } while (0)
552#define symbol_put_addr(x) do { } while(0) 552#define symbol_put_addr(x) do { } while (0)
553 553
554static inline void __module_get(struct module *module) 554static inline void __module_get(struct module *module)
555{ 555{
@@ -606,13 +606,13 @@ static inline int module_kallsyms_on_each_symbol(int (*fn)(void *, const char *,
606 return 0; 606 return 0;
607} 607}
608 608
609static inline int register_module_notifier(struct notifier_block * nb) 609static inline int register_module_notifier(struct notifier_block *nb)
610{ 610{
611 /* no events will happen anyway, so this can always succeed */ 611 /* no events will happen anyway, so this can always succeed */
612 return 0; 612 return 0;
613} 613}
614 614
615static inline int unregister_module_notifier(struct notifier_block * nb) 615static inline int unregister_module_notifier(struct notifier_block *nb)
616{ 616{
617 return 0; 617 return 0;
618} 618}
diff --git a/include/linux/msg.h b/include/linux/msg.h
index e21f9d44307f..f3f302f9c197 100644
--- a/include/linux/msg.h
+++ b/include/linux/msg.h
@@ -9,7 +9,7 @@ struct msg_msg {
9 struct list_head m_list; 9 struct list_head m_list;
10 long m_type; 10 long m_type;
11 size_t m_ts; /* message text size */ 11 size_t m_ts; /* message text size */
12 struct msg_msgseg* next; 12 struct msg_msgseg *next;
13 void *security; 13 void *security;
14 /* the actual message follows immediately */ 14 /* the actual message follows immediately */
15}; 15};
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 009b02481436..92a2f991262a 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -60,10 +60,10 @@ void arch_teardown_msi_irq(unsigned int irq);
60int 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);
61void arch_teardown_msi_irqs(struct pci_dev *dev); 61void arch_teardown_msi_irqs(struct pci_dev *dev);
62int 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); 63void arch_restore_msi_irqs(struct pci_dev *dev);
64 64
65void default_teardown_msi_irqs(struct pci_dev *dev); 65void default_teardown_msi_irqs(struct pci_dev *dev);
66void default_restore_msi_irqs(struct pci_dev *dev, int irq); 66void default_restore_msi_irqs(struct pci_dev *dev);
67u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag); 67u32 default_msi_mask_irq(struct msi_desc *desc, u32 mask, u32 flag);
68u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag); 68u32 default_msix_mask_irq(struct msi_desc *desc, u32 flag);
69 69
diff --git a/include/linux/mtd/mtdram.h b/include/linux/mtd/mtdram.h
index 68891313875d..628a6a21ddf0 100644
--- a/include/linux/mtd/mtdram.h
+++ b/include/linux/mtd/mtdram.h
@@ -3,6 +3,6 @@
3 3
4#include <linux/mtd/mtd.h> 4#include <linux/mtd/mtd.h>
5int mtdram_init_device(struct mtd_info *mtd, void *mapped_address, 5int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,
6 unsigned long size, char *name); 6 unsigned long size, const char *name);
7 7
8#endif /* __MTD_MTDRAM_H__ */ 8#endif /* __MTD_MTDRAM_H__ */
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 9e6c8f9f306e..32f8612469d8 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -219,6 +219,9 @@ struct nand_chip;
219/* ONFI feature address */ 219/* ONFI feature address */
220#define ONFI_FEATURE_ADDR_TIMING_MODE 0x1 220#define ONFI_FEATURE_ADDR_TIMING_MODE 0x1
221 221
222/* Vendor-specific feature address (Micron) */
223#define ONFI_FEATURE_ADDR_READ_RETRY 0x89
224
222/* ONFI subfeature parameters length */ 225/* ONFI subfeature parameters length */
223#define ONFI_SUBFEATURE_PARAM_LEN 4 226#define ONFI_SUBFEATURE_PARAM_LEN 4
224 227
@@ -279,16 +282,17 @@ struct nand_onfi_params {
279 __le16 io_pin_capacitance_typ; 282 __le16 io_pin_capacitance_typ;
280 __le16 input_pin_capacitance_typ; 283 __le16 input_pin_capacitance_typ;
281 u8 input_pin_capacitance_max; 284 u8 input_pin_capacitance_max;
282 u8 driver_strenght_support; 285 u8 driver_strength_support;
283 __le16 t_int_r; 286 __le16 t_int_r;
284 __le16 t_ald; 287 __le16 t_ald;
285 u8 reserved4[7]; 288 u8 reserved4[7];
286 289
287 /* vendor */ 290 /* vendor */
288 u8 reserved5[90]; 291 __le16 vendor_revision;
292 u8 vendor[88];
289 293
290 __le16 crc; 294 __le16 crc;
291} __attribute__((packed)); 295} __packed;
292 296
293#define ONFI_CRC_BASE 0x4F4E 297#define ONFI_CRC_BASE 0x4F4E
294 298
@@ -326,6 +330,26 @@ struct onfi_ext_param_page {
326 */ 330 */
327} __packed; 331} __packed;
328 332
333struct nand_onfi_vendor_micron {
334 u8 two_plane_read;
335 u8 read_cache;
336 u8 read_unique_id;
337 u8 dq_imped;
338 u8 dq_imped_num_settings;
339 u8 dq_imped_feat_addr;
340 u8 rb_pulldown_strength;
341 u8 rb_pulldown_strength_feat_addr;
342 u8 rb_pulldown_strength_num_settings;
343 u8 otp_mode;
344 u8 otp_page_start;
345 u8 otp_data_prot_addr;
346 u8 otp_num_pages;
347 u8 otp_feat_addr;
348 u8 read_retry_options;
349 u8 reserved[72];
350 u8 param_revision;
351} __packed;
352
329/** 353/**
330 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices 354 * struct nand_hw_control - Control structure for hardware controller (e.g ECC generator) shared among independent devices
331 * @lock: protection lock 355 * @lock: protection lock
@@ -432,6 +456,8 @@ struct nand_buffers {
432 * flash device. 456 * flash device.
433 * @read_byte: [REPLACEABLE] read one byte from the chip 457 * @read_byte: [REPLACEABLE] read one byte from the chip
434 * @read_word: [REPLACEABLE] read one word from the chip 458 * @read_word: [REPLACEABLE] read one word from the chip
459 * @write_byte: [REPLACEABLE] write a single byte to the chip on the
460 * low 8 I/O lines
435 * @write_buf: [REPLACEABLE] write data from the buffer to the chip 461 * @write_buf: [REPLACEABLE] write data from the buffer to the chip
436 * @read_buf: [REPLACEABLE] read data from the chip into the buffer 462 * @read_buf: [REPLACEABLE] read data from the chip into the buffer
437 * @select_chip: [REPLACEABLE] select chip nr 463 * @select_chip: [REPLACEABLE] select chip nr
@@ -451,6 +477,8 @@ struct nand_buffers {
451 * commands to the chip. 477 * commands to the chip.
452 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on 478 * @waitfunc: [REPLACEABLE] hardwarespecific function for wait on
453 * ready. 479 * ready.
480 * @setup_read_retry: [FLASHSPECIFIC] flash (vendor) specific function for
481 * setting the read-retry mode. Mostly needed for MLC NAND.
454 * @ecc: [BOARDSPECIFIC] ECC control structure 482 * @ecc: [BOARDSPECIFIC] ECC control structure
455 * @buffers: buffer structure for read/write 483 * @buffers: buffer structure for read/write
456 * @hwcontrol: platform-specific hardware control structure 484 * @hwcontrol: platform-specific hardware control structure
@@ -497,6 +525,7 @@ struct nand_buffers {
497 * non 0 if ONFI supported. 525 * non 0 if ONFI supported.
498 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is 526 * @onfi_params: [INTERN] holds the ONFI page parameter when ONFI is
499 * supported, 0 otherwise. 527 * supported, 0 otherwise.
528 * @read_retries: [INTERN] the number of read retry modes supported
500 * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand 529 * @onfi_set_features: [REPLACEABLE] set the features for ONFI nand
501 * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand 530 * @onfi_get_features: [REPLACEABLE] get the features for ONFI nand
502 * @bbt: [INTERN] bad block table pointer 531 * @bbt: [INTERN] bad block table pointer
@@ -521,6 +550,7 @@ struct nand_chip {
521 550
522 uint8_t (*read_byte)(struct mtd_info *mtd); 551 uint8_t (*read_byte)(struct mtd_info *mtd);
523 u16 (*read_word)(struct mtd_info *mtd); 552 u16 (*read_word)(struct mtd_info *mtd);
553 void (*write_byte)(struct mtd_info *mtd, uint8_t byte);
524 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); 554 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
525 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); 555 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
526 void (*select_chip)(struct mtd_info *mtd, int chip); 556 void (*select_chip)(struct mtd_info *mtd, int chip);
@@ -544,6 +574,7 @@ struct nand_chip {
544 int feature_addr, uint8_t *subfeature_para); 574 int feature_addr, uint8_t *subfeature_para);
545 int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip, 575 int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip,
546 int feature_addr, uint8_t *subfeature_para); 576 int feature_addr, uint8_t *subfeature_para);
577 int (*setup_read_retry)(struct mtd_info *mtd, int retry_mode);
547 578
548 int chip_delay; 579 int chip_delay;
549 unsigned int options; 580 unsigned int options;
@@ -568,6 +599,8 @@ struct nand_chip {
568 int onfi_version; 599 int onfi_version;
569 struct nand_onfi_params onfi_params; 600 struct nand_onfi_params onfi_params;
570 601
602 int read_retries;
603
571 flstate_t state; 604 flstate_t state;
572 605
573 uint8_t *oob_poi; 606 uint8_t *oob_poi;
@@ -600,6 +633,8 @@ struct nand_chip {
600#define NAND_MFR_AMD 0x01 633#define NAND_MFR_AMD 0x01
601#define NAND_MFR_MACRONIX 0xc2 634#define NAND_MFR_MACRONIX 0xc2
602#define NAND_MFR_EON 0x92 635#define NAND_MFR_EON 0x92
636#define NAND_MFR_SANDISK 0x45
637#define NAND_MFR_INTEL 0x89
603 638
604/* The maximum expected count of bytes in the NAND ID sequence */ 639/* The maximum expected count of bytes in the NAND ID sequence */
605#define NAND_MAX_ID_LEN 8 640#define NAND_MAX_ID_LEN 8
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h
index 1f8d24bdafda..6a35e6de5da1 100644
--- a/include/linux/mtd/partitions.h
+++ b/include/linux/mtd/partitions.h
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39struct mtd_partition { 39struct mtd_partition {
40 char *name; /* identifier string */ 40 const char *name; /* identifier string */
41 uint64_t size; /* partition size */ 41 uint64_t size; /* partition size */
42 uint64_t offset; /* offset within the master MTD space */ 42 uint64_t offset; /* offset within the master MTD space */
43 uint32_t mask_flags; /* master MTD flags to mask out for this partition */ 43 uint32_t mask_flags; /* master MTD flags to mask out for this partition */
@@ -76,11 +76,11 @@ struct mtd_part_parser {
76 struct mtd_part_parser_data *); 76 struct mtd_part_parser_data *);
77}; 77};
78 78
79extern int register_mtd_parser(struct mtd_part_parser *parser); 79extern void register_mtd_parser(struct mtd_part_parser *parser);
80extern int deregister_mtd_parser(struct mtd_part_parser *parser); 80extern void deregister_mtd_parser(struct mtd_part_parser *parser);
81 81
82int mtd_is_partition(const struct mtd_info *mtd); 82int mtd_is_partition(const struct mtd_info *mtd);
83int mtd_add_partition(struct mtd_info *master, char *name, 83int mtd_add_partition(struct mtd_info *master, const char *name,
84 long long offset, long long length); 84 long long offset, long long length);
85int mtd_del_partition(struct mtd_info *master, int partno); 85int mtd_del_partition(struct mtd_info *master, int partno);
86uint64_t mtd_get_device_size(const struct mtd_info *mtd); 86uint64_t mtd_get_device_size(const struct mtd_info *mtd);
diff --git a/include/linux/net.h b/include/linux/net.h
index 69be3e6079c8..94734a6259a4 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -245,9 +245,6 @@ do { \
245#define net_dbg_ratelimited(fmt, ...) \ 245#define net_dbg_ratelimited(fmt, ...) \
246 net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__) 246 net_ratelimited_function(pr_debug, fmt, ##__VA_ARGS__)
247 247
248#define net_random() prandom_u32()
249#define net_srandom(seed) prandom_seed((__force u32)(seed))
250
251bool __net_get_random_once(void *buf, int nbytes, bool *done, 248bool __net_get_random_once(void *buf, int nbytes, bool *done,
252 struct static_key *done_key); 249 struct static_key *done_key);
253 250
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ce2a1f5f9a1e..440a02ee6f92 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -668,15 +668,28 @@ extern struct rps_sock_flow_table __rcu *rps_sock_flow_table;
668bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id, 668bool rps_may_expire_flow(struct net_device *dev, u16 rxq_index, u32 flow_id,
669 u16 filter_id); 669 u16 filter_id);
670#endif 670#endif
671#endif /* CONFIG_RPS */
671 672
672/* This structure contains an instance of an RX queue. */ 673/* This structure contains an instance of an RX queue. */
673struct netdev_rx_queue { 674struct netdev_rx_queue {
675#ifdef CONFIG_RPS
674 struct rps_map __rcu *rps_map; 676 struct rps_map __rcu *rps_map;
675 struct rps_dev_flow_table __rcu *rps_flow_table; 677 struct rps_dev_flow_table __rcu *rps_flow_table;
678#endif
676 struct kobject kobj; 679 struct kobject kobj;
677 struct net_device *dev; 680 struct net_device *dev;
678} ____cacheline_aligned_in_smp; 681} ____cacheline_aligned_in_smp;
679#endif /* CONFIG_RPS */ 682
683/*
684 * RX queue sysfs structures and functions.
685 */
686struct rx_queue_attribute {
687 struct attribute attr;
688 ssize_t (*show)(struct netdev_rx_queue *queue,
689 struct rx_queue_attribute *attr, char *buf);
690 ssize_t (*store)(struct netdev_rx_queue *queue,
691 struct rx_queue_attribute *attr, const char *buf, size_t len);
692};
680 693
681#ifdef CONFIG_XPS 694#ifdef CONFIG_XPS
682/* 695/*
@@ -1285,6 +1298,9 @@ struct net_device {
1285#if IS_ENABLED(CONFIG_NET_DSA) 1298#if IS_ENABLED(CONFIG_NET_DSA)
1286 struct dsa_switch_tree *dsa_ptr; /* dsa specific data */ 1299 struct dsa_switch_tree *dsa_ptr; /* dsa specific data */
1287#endif 1300#endif
1301#if IS_ENABLED(CONFIG_TIPC)
1302 struct tipc_bearer __rcu *tipc_ptr; /* TIPC specific data */
1303#endif
1288 void *atalk_ptr; /* AppleTalk link */ 1304 void *atalk_ptr; /* AppleTalk link */
1289 struct in_device __rcu *ip_ptr; /* IPv4 specific data */ 1305 struct in_device __rcu *ip_ptr; /* IPv4 specific data */
1290 struct dn_dev __rcu *dn_ptr; /* DECnet specific data */ 1306 struct dn_dev __rcu *dn_ptr; /* DECnet specific data */
@@ -1310,7 +1326,7 @@ struct net_device {
1310 unicast) */ 1326 unicast) */
1311 1327
1312 1328
1313#ifdef CONFIG_RPS 1329#ifdef CONFIG_SYSFS
1314 struct netdev_rx_queue *_rx; 1330 struct netdev_rx_queue *_rx;
1315 1331
1316 /* Number of RX queues allocated at register_netdev() time */ 1332 /* Number of RX queues allocated at register_netdev() time */
@@ -1408,7 +1424,7 @@ struct net_device {
1408 union { 1424 union {
1409 void *ml_priv; 1425 void *ml_priv;
1410 struct pcpu_lstats __percpu *lstats; /* loopback stats */ 1426 struct pcpu_lstats __percpu *lstats; /* loopback stats */
1411 struct pcpu_tstats __percpu *tstats; /* tunnel stats */ 1427 struct pcpu_sw_netstats __percpu *tstats;
1412 struct pcpu_dstats __percpu *dstats; /* dummy stats */ 1428 struct pcpu_dstats __percpu *dstats; /* dummy stats */
1413 struct pcpu_vstats __percpu *vstats; /* veth stats */ 1429 struct pcpu_vstats __percpu *vstats; /* veth stats */
1414 }; 1430 };
@@ -1421,6 +1437,8 @@ struct net_device {
1421 struct device dev; 1437 struct device dev;
1422 /* space for optional device, statistics, and wireless sysfs groups */ 1438 /* space for optional device, statistics, and wireless sysfs groups */
1423 const struct attribute_group *sysfs_groups[4]; 1439 const struct attribute_group *sysfs_groups[4];
1440 /* space for optional per-rx queue attributes */
1441 const struct attribute_group *sysfs_rx_queue_group;
1424 1442
1425 /* rtnetlink link ops */ 1443 /* rtnetlink link ops */
1426 const struct rtnl_link_ops *rtnl_link_ops; 1444 const struct rtnl_link_ops *rtnl_link_ops;
@@ -1443,7 +1461,7 @@ struct net_device {
1443 /* max exchange id for FCoE LRO by ddp */ 1461 /* max exchange id for FCoE LRO by ddp */
1444 unsigned int fcoe_ddp_xid; 1462 unsigned int fcoe_ddp_xid;
1445#endif 1463#endif
1446#if IS_ENABLED(CONFIG_NETPRIO_CGROUP) 1464#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
1447 struct netprio_map __rcu *priomap; 1465 struct netprio_map __rcu *priomap;
1448#endif 1466#endif
1449 /* phy device may attach itself for hardware timestamping */ 1467 /* phy device may attach itself for hardware timestamping */
@@ -1632,7 +1650,10 @@ struct napi_gro_cb {
1632 int data_offset; 1650 int data_offset;
1633 1651
1634 /* This is non-zero if the packet cannot be merged with the new skb. */ 1652 /* This is non-zero if the packet cannot be merged with the new skb. */
1635 int flush; 1653 u16 flush;
1654
1655 /* Save the IP ID here and check when we get to the transport layer */
1656 u16 flush_id;
1636 1657
1637 /* Number of segments aggregated. */ 1658 /* Number of segments aggregated. */
1638 u16 count; 1659 u16 count;
@@ -1649,7 +1670,13 @@ struct napi_gro_cb {
1649 unsigned long age; 1670 unsigned long age;
1650 1671
1651 /* Used in ipv6_gro_receive() */ 1672 /* Used in ipv6_gro_receive() */
1652 int proto; 1673 u16 proto;
1674
1675 /* Used in udp_gro_receive */
1676 u16 udp_mark;
1677
1678 /* used to support CHECKSUM_COMPLETE for tunneling protocols */
1679 __wsum csum;
1653 1680
1654 /* used in skb_gro_receive() slow path */ 1681 /* used in skb_gro_receive() slow path */
1655 struct sk_buff *last; 1682 struct sk_buff *last;
@@ -1676,7 +1703,7 @@ struct offload_callbacks {
1676 int (*gso_send_check)(struct sk_buff *skb); 1703 int (*gso_send_check)(struct sk_buff *skb);
1677 struct sk_buff **(*gro_receive)(struct sk_buff **head, 1704 struct sk_buff **(*gro_receive)(struct sk_buff **head,
1678 struct sk_buff *skb); 1705 struct sk_buff *skb);
1679 int (*gro_complete)(struct sk_buff *skb); 1706 int (*gro_complete)(struct sk_buff *skb, int nhoff);
1680}; 1707};
1681 1708
1682struct packet_offload { 1709struct packet_offload {
@@ -1685,6 +1712,20 @@ struct packet_offload {
1685 struct list_head list; 1712 struct list_head list;
1686}; 1713};
1687 1714
1715struct udp_offload {
1716 __be16 port;
1717 struct offload_callbacks callbacks;
1718};
1719
1720/* often modified stats are per cpu, other are shared (netdev->stats) */
1721struct pcpu_sw_netstats {
1722 u64 rx_packets;
1723 u64 rx_bytes;
1724 u64 tx_packets;
1725 u64 tx_bytes;
1726 struct u64_stats_sync syncp;
1727};
1728
1688#include <linux/notifier.h> 1729#include <linux/notifier.h>
1689 1730
1690/* netdevice notifier chain. Please remember to update the rtnetlink 1731/* netdevice notifier chain. Please remember to update the rtnetlink
@@ -1700,7 +1741,7 @@ struct packet_offload {
1700#define NETDEV_CHANGE 0x0004 /* Notify device state change */ 1741#define NETDEV_CHANGE 0x0004 /* Notify device state change */
1701#define NETDEV_REGISTER 0x0005 1742#define NETDEV_REGISTER 0x0005
1702#define NETDEV_UNREGISTER 0x0006 1743#define NETDEV_UNREGISTER 0x0006
1703#define NETDEV_CHANGEMTU 0x0007 1744#define NETDEV_CHANGEMTU 0x0007 /* notify after mtu change happened */
1704#define NETDEV_CHANGEADDR 0x0008 1745#define NETDEV_CHANGEADDR 0x0008
1705#define NETDEV_GOING_DOWN 0x0009 1746#define NETDEV_GOING_DOWN 0x0009
1706#define NETDEV_CHANGENAME 0x000A 1747#define NETDEV_CHANGENAME 0x000A
@@ -1716,6 +1757,7 @@ struct packet_offload {
1716#define NETDEV_JOIN 0x0014 1757#define NETDEV_JOIN 0x0014
1717#define NETDEV_CHANGEUPPER 0x0015 1758#define NETDEV_CHANGEUPPER 0x0015
1718#define NETDEV_RESEND_IGMP 0x0016 1759#define NETDEV_RESEND_IGMP 0x0016
1760#define NETDEV_PRECHANGEMTU 0x0017 /* notify before mtu change happened */
1719 1761
1720int register_netdevice_notifier(struct notifier_block *nb); 1762int register_netdevice_notifier(struct notifier_block *nb);
1721int unregister_netdevice_notifier(struct notifier_block *nb); 1763int unregister_netdevice_notifier(struct notifier_block *nb);
@@ -1741,8 +1783,6 @@ netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
1741 return info->dev; 1783 return info->dev;
1742} 1784}
1743 1785
1744int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev,
1745 struct netdev_notifier_info *info);
1746int call_netdevice_notifiers(unsigned long val, struct net_device *dev); 1786int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1747 1787
1748 1788
@@ -1809,7 +1849,6 @@ void dev_remove_pack(struct packet_type *pt);
1809void __dev_remove_pack(struct packet_type *pt); 1849void __dev_remove_pack(struct packet_type *pt);
1810void dev_add_offload(struct packet_offload *po); 1850void dev_add_offload(struct packet_offload *po);
1811void dev_remove_offload(struct packet_offload *po); 1851void dev_remove_offload(struct packet_offload *po);
1812void __dev_remove_offload(struct packet_offload *po);
1813 1852
1814struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, 1853struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags,
1815 unsigned short mask); 1854 unsigned short mask);
@@ -1895,6 +1934,14 @@ static inline void *skb_gro_network_header(struct sk_buff *skb)
1895 skb_network_offset(skb); 1934 skb_network_offset(skb);
1896} 1935}
1897 1936
1937static inline void skb_gro_postpull_rcsum(struct sk_buff *skb,
1938 const void *start, unsigned int len)
1939{
1940 if (skb->ip_summed == CHECKSUM_COMPLETE)
1941 NAPI_GRO_CB(skb)->csum = csum_sub(NAPI_GRO_CB(skb)->csum,
1942 csum_partial(start, len, 0));
1943}
1944
1898static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, 1945static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
1899 unsigned short type, 1946 unsigned short type,
1900 const void *daddr, const void *saddr, 1947 const void *daddr, const void *saddr,
@@ -2351,7 +2398,7 @@ static inline bool netif_is_multiqueue(const struct net_device *dev)
2351 2398
2352int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq); 2399int netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq);
2353 2400
2354#ifdef CONFIG_RPS 2401#ifdef CONFIG_SYSFS
2355int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq); 2402int netif_set_real_num_rx_queues(struct net_device *dev, unsigned int rxq);
2356#else 2403#else
2357static inline int netif_set_real_num_rx_queues(struct net_device *dev, 2404static inline int netif_set_real_num_rx_queues(struct net_device *dev,
@@ -2370,7 +2417,7 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2370 from_dev->real_num_tx_queues); 2417 from_dev->real_num_tx_queues);
2371 if (err) 2418 if (err)
2372 return err; 2419 return err;
2373#ifdef CONFIG_RPS 2420#ifdef CONFIG_SYSFS
2374 return netif_set_real_num_rx_queues(to_dev, 2421 return netif_set_real_num_rx_queues(to_dev,
2375 from_dev->real_num_rx_queues); 2422 from_dev->real_num_rx_queues);
2376#else 2423#else
@@ -2378,20 +2425,67 @@ static inline int netif_copy_real_num_queues(struct net_device *to_dev,
2378#endif 2425#endif
2379} 2426}
2380 2427
2428#ifdef CONFIG_SYSFS
2429static inline unsigned int get_netdev_rx_queue_index(
2430 struct netdev_rx_queue *queue)
2431{
2432 struct net_device *dev = queue->dev;
2433 int index = queue - dev->_rx;
2434
2435 BUG_ON(index >= dev->num_rx_queues);
2436 return index;
2437}
2438#endif
2439
2381#define DEFAULT_MAX_NUM_RSS_QUEUES (8) 2440#define DEFAULT_MAX_NUM_RSS_QUEUES (8)
2382int netif_get_num_default_rss_queues(void); 2441int netif_get_num_default_rss_queues(void);
2383 2442
2384/* Use this variant when it is known for sure that it 2443enum skb_free_reason {
2385 * is executing from hardware interrupt context or with hardware interrupts 2444 SKB_REASON_CONSUMED,
2386 * disabled. 2445 SKB_REASON_DROPPED,
2387 */ 2446};
2388void dev_kfree_skb_irq(struct sk_buff *skb);
2389 2447
2390/* Use this variant in places where it could be invoked 2448void __dev_kfree_skb_irq(struct sk_buff *skb, enum skb_free_reason reason);
2391 * from either hardware interrupt or other context, with hardware interrupts 2449void __dev_kfree_skb_any(struct sk_buff *skb, enum skb_free_reason reason);
2392 * either disabled or enabled. 2450
2451/*
2452 * It is not allowed to call kfree_skb() or consume_skb() from hardware
2453 * interrupt context or with hardware interrupts being disabled.
2454 * (in_irq() || irqs_disabled())
2455 *
2456 * We provide four helpers that can be used in following contexts :
2457 *
2458 * dev_kfree_skb_irq(skb) when caller drops a packet from irq context,
2459 * replacing kfree_skb(skb)
2460 *
2461 * dev_consume_skb_irq(skb) when caller consumes a packet from irq context.
2462 * Typically used in place of consume_skb(skb) in TX completion path
2463 *
2464 * dev_kfree_skb_any(skb) when caller doesn't know its current irq context,
2465 * replacing kfree_skb(skb)
2466 *
2467 * dev_consume_skb_any(skb) when caller doesn't know its current irq context,
2468 * and consumed a packet. Used in place of consume_skb(skb)
2393 */ 2469 */
2394void dev_kfree_skb_any(struct sk_buff *skb); 2470static inline void dev_kfree_skb_irq(struct sk_buff *skb)
2471{
2472 __dev_kfree_skb_irq(skb, SKB_REASON_DROPPED);
2473}
2474
2475static inline void dev_consume_skb_irq(struct sk_buff *skb)
2476{
2477 __dev_kfree_skb_irq(skb, SKB_REASON_CONSUMED);
2478}
2479
2480static inline void dev_kfree_skb_any(struct sk_buff *skb)
2481{
2482 __dev_kfree_skb_any(skb, SKB_REASON_DROPPED);
2483}
2484
2485static inline void dev_consume_skb_any(struct sk_buff *skb)
2486{
2487 __dev_kfree_skb_any(skb, SKB_REASON_CONSUMED);
2488}
2395 2489
2396int netif_rx(struct sk_buff *skb); 2490int netif_rx(struct sk_buff *skb);
2397int netif_rx_ni(struct sk_buff *skb); 2491int netif_rx_ni(struct sk_buff *skb);
@@ -2400,6 +2494,8 @@ gro_result_t napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb);
2400void napi_gro_flush(struct napi_struct *napi, bool flush_old); 2494void napi_gro_flush(struct napi_struct *napi, bool flush_old);
2401struct sk_buff *napi_get_frags(struct napi_struct *napi); 2495struct sk_buff *napi_get_frags(struct napi_struct *napi);
2402gro_result_t napi_gro_frags(struct napi_struct *napi); 2496gro_result_t napi_gro_frags(struct napi_struct *napi);
2497struct packet_offload *gro_find_receive_by_type(__be16 type);
2498struct packet_offload *gro_find_complete_by_type(__be16 type);
2403 2499
2404static inline void napi_free_frags(struct napi_struct *napi) 2500static inline void napi_free_frags(struct napi_struct *napi)
2405{ 2501{
@@ -2785,17 +2881,10 @@ int register_netdev(struct net_device *dev);
2785void unregister_netdev(struct net_device *dev); 2881void unregister_netdev(struct net_device *dev);
2786 2882
2787/* General hardware address lists handling functions */ 2883/* General hardware address lists handling functions */
2788int __hw_addr_add_multiple(struct netdev_hw_addr_list *to_list,
2789 struct netdev_hw_addr_list *from_list,
2790 int addr_len, unsigned char addr_type);
2791void __hw_addr_del_multiple(struct netdev_hw_addr_list *to_list,
2792 struct netdev_hw_addr_list *from_list,
2793 int addr_len, unsigned char addr_type);
2794int __hw_addr_sync(struct netdev_hw_addr_list *to_list, 2884int __hw_addr_sync(struct netdev_hw_addr_list *to_list,
2795 struct netdev_hw_addr_list *from_list, int addr_len); 2885 struct netdev_hw_addr_list *from_list, int addr_len);
2796void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, 2886void __hw_addr_unsync(struct netdev_hw_addr_list *to_list,
2797 struct netdev_hw_addr_list *from_list, int addr_len); 2887 struct netdev_hw_addr_list *from_list, int addr_len);
2798void __hw_addr_flush(struct netdev_hw_addr_list *list);
2799void __hw_addr_init(struct netdev_hw_addr_list *list); 2888void __hw_addr_init(struct netdev_hw_addr_list *list);
2800 2889
2801/* Functions used for device addresses handling */ 2890/* Functions used for device addresses handling */
@@ -2803,10 +2892,6 @@ int dev_addr_add(struct net_device *dev, const unsigned char *addr,
2803 unsigned char addr_type); 2892 unsigned char addr_type);
2804int dev_addr_del(struct net_device *dev, const unsigned char *addr, 2893int dev_addr_del(struct net_device *dev, const unsigned char *addr,
2805 unsigned char addr_type); 2894 unsigned char addr_type);
2806int dev_addr_add_multiple(struct net_device *to_dev,
2807 struct net_device *from_dev, unsigned char addr_type);
2808int dev_addr_del_multiple(struct net_device *to_dev,
2809 struct net_device *from_dev, unsigned char addr_type);
2810void dev_addr_flush(struct net_device *dev); 2895void dev_addr_flush(struct net_device *dev);
2811int dev_addr_init(struct net_device *dev); 2896int dev_addr_init(struct net_device *dev);
2812 2897
@@ -2853,7 +2938,6 @@ extern int weight_p;
2853extern int bpf_jit_enable; 2938extern int bpf_jit_enable;
2854 2939
2855bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev); 2940bool netdev_has_upper_dev(struct net_device *dev, struct net_device *upper_dev);
2856bool netdev_has_any_upper_dev(struct net_device *dev);
2857struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev, 2941struct net_device *netdev_all_upper_get_next_dev_rcu(struct net_device *dev,
2858 struct list_head **iter); 2942 struct list_head **iter);
2859 2943
@@ -2882,6 +2966,7 @@ void *netdev_lower_get_next_private_rcu(struct net_device *dev,
2882 priv = netdev_lower_get_next_private_rcu(dev, &(iter))) 2966 priv = netdev_lower_get_next_private_rcu(dev, &(iter)))
2883 2967
2884void *netdev_adjacent_get_private(struct list_head *adj_list); 2968void *netdev_adjacent_get_private(struct list_head *adj_list);
2969void *netdev_lower_get_first_private_rcu(struct net_device *dev);
2885struct net_device *netdev_master_upper_dev_get(struct net_device *dev); 2970struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
2886struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); 2971struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
2887int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev); 2972int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev);
@@ -2892,8 +2977,7 @@ int netdev_master_upper_dev_link_private(struct net_device *dev,
2892 void *private); 2977 void *private);
2893void netdev_upper_dev_unlink(struct net_device *dev, 2978void netdev_upper_dev_unlink(struct net_device *dev,
2894 struct net_device *upper_dev); 2979 struct net_device *upper_dev);
2895void *netdev_lower_dev_get_private_rcu(struct net_device *dev, 2980void netdev_adjacent_rename_links(struct net_device *dev, char *oldname);
2896 struct net_device *lower_dev);
2897void *netdev_lower_dev_get_private(struct net_device *dev, 2981void *netdev_lower_dev_get_private(struct net_device *dev,
2898 struct net_device *lower_dev); 2982 struct net_device *lower_dev);
2899int skb_checksum_help(struct sk_buff *skb); 2983int skb_checksum_help(struct sk_buff *skb);
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index c7174b816674..0c7d01eae56c 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -331,7 +331,6 @@ extern ip_set_id_t ip_set_get_byname(struct net *net,
331 const char *name, struct ip_set **set); 331 const char *name, struct ip_set **set);
332extern void ip_set_put_byindex(struct net *net, ip_set_id_t index); 332extern void ip_set_put_byindex(struct net *net, ip_set_id_t index);
333extern const char *ip_set_name_byindex(struct net *net, ip_set_id_t index); 333extern const char *ip_set_name_byindex(struct net *net, ip_set_id_t index);
334extern ip_set_id_t ip_set_nfnl_get(struct net *net, const char *name);
335extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index); 334extern ip_set_id_t ip_set_nfnl_get_byindex(struct net *net, ip_set_id_t index);
336extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index); 335extern void ip_set_nfnl_put(struct net *net, ip_set_id_t index);
337 336
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 7a6c396a263b..aad8eeaf416d 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -62,7 +62,6 @@ extern void netlink_kernel_release(struct sock *sk);
62extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups); 62extern int __netlink_change_ngroups(struct sock *sk, unsigned int groups);
63extern int netlink_change_ngroups(struct sock *sk, unsigned int groups); 63extern int netlink_change_ngroups(struct sock *sk, unsigned int groups);
64extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group); 64extern void __netlink_clear_multicast_users(struct sock *sk, unsigned int group);
65extern void netlink_clear_multicast_users(struct sock *sk, unsigned int group);
66extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); 65extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
67extern int netlink_has_listeners(struct sock *sk, unsigned int group); 66extern int netlink_has_listeners(struct sock *sk, unsigned int group);
68extern struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size, 67extern struct sk_buff *netlink_alloc_skb(struct sock *ssk, unsigned int size,
@@ -168,7 +167,6 @@ struct netlink_tap {
168}; 167};
169 168
170extern int netlink_add_tap(struct netlink_tap *nt); 169extern int netlink_add_tap(struct netlink_tap *nt);
171extern int __netlink_remove_tap(struct netlink_tap *nt);
172extern int netlink_remove_tap(struct netlink_tap *nt); 170extern int netlink_remove_tap(struct netlink_tap *nt);
173 171
174#endif /* __LINUX_NETLINK_H */ 172#endif /* __LINUX_NETLINK_H */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 48997374eaf0..0ae5807480f4 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -154,10 +154,6 @@ struct nfs_inode {
154 struct rb_root access_cache; 154 struct rb_root access_cache;
155 struct list_head access_cache_entry_lru; 155 struct list_head access_cache_entry_lru;
156 struct list_head access_cache_inode_lru; 156 struct list_head access_cache_inode_lru;
157#ifdef CONFIG_NFS_V3_ACL
158 struct posix_acl *acl_access;
159 struct posix_acl *acl_default;
160#endif
161 157
162 /* 158 /*
163 * This is the cookie verifier used for NFSv3 readdir 159 * This is the cookie verifier used for NFSv3 readdir
@@ -215,6 +211,7 @@ struct nfs_inode {
215#define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */ 211#define NFS_INO_ADVISE_RDPLUS (0) /* advise readdirplus */
216#define NFS_INO_STALE (1) /* possible stale inode */ 212#define NFS_INO_STALE (1) /* possible stale inode */
217#define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */ 213#define NFS_INO_ACL_LRU_SET (2) /* Inode is on the LRU list */
214#define NFS_INO_INVALIDATING (3) /* inode is being invalidated */
218#define NFS_INO_FLUSHING (4) /* inode is flushing out data */ 215#define NFS_INO_FLUSHING (4) /* inode is flushing out data */
219#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ 216#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */
220#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ 217#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */
@@ -564,23 +561,17 @@ extern int nfs_readpage_async(struct nfs_open_context *, struct inode *,
564 * linux/fs/nfs3proc.c 561 * linux/fs/nfs3proc.c
565 */ 562 */
566#ifdef CONFIG_NFS_V3_ACL 563#ifdef CONFIG_NFS_V3_ACL
567extern struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type); 564extern struct posix_acl *nfs3_get_acl(struct inode *inode, int type);
568extern int nfs3_proc_setacl(struct inode *inode, int type, 565extern int nfs3_set_acl(struct inode *inode, struct posix_acl *acl, int type);
569 struct posix_acl *acl); 566extern int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
570extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, 567 struct posix_acl *dfacl);
571 umode_t mode); 568extern const struct xattr_handler *nfs3_xattr_handlers[];
572extern void nfs3_forget_cached_acls(struct inode *inode);
573#else 569#else
574static inline int nfs3_proc_set_default_acl(struct inode *dir, 570static inline int nfs3_proc_setacls(struct inode *inode, struct posix_acl *acl,
575 struct inode *inode, 571 struct posix_acl *dfacl)
576 umode_t mode)
577{ 572{
578 return 0; 573 return 0;
579} 574}
580
581static inline void nfs3_forget_cached_acls(struct inode *inode)
582{
583}
584#endif /* CONFIG_NFS_V3_ACL */ 575#endif /* CONFIG_NFS_V3_ACL */
585 576
586/* 577/*
diff --git a/include/linux/nls.h b/include/linux/nls.h
index 5dc635f8d79e..520681b68208 100644
--- a/include/linux/nls.h
+++ b/include/linux/nls.h
@@ -44,11 +44,12 @@ enum utf16_endian {
44}; 44};
45 45
46/* nls_base.c */ 46/* nls_base.c */
47extern int register_nls(struct nls_table *); 47extern int __register_nls(struct nls_table *, struct module *);
48extern int unregister_nls(struct nls_table *); 48extern int unregister_nls(struct nls_table *);
49extern struct nls_table *load_nls(char *); 49extern struct nls_table *load_nls(char *);
50extern void unload_nls(struct nls_table *); 50extern void unload_nls(struct nls_table *);
51extern struct nls_table *load_nls_default(void); 51extern struct nls_table *load_nls_default(void);
52#define register_nls(nls) __register_nls((nls), THIS_MODULE)
52 53
53extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu); 54extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu);
54extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen); 55extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen);
diff --git a/include/linux/of.h b/include/linux/of.h
index 276c546980d8..70c64ba17fa5 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -377,8 +377,13 @@ static inline bool of_have_populated_dt(void)
377 return false; 377 return false;
378} 378}
379 379
380/* Kill an unused variable warning on a device_node pointer */
381static inline void __of_use_dn(const struct device_node *np)
382{
383}
384
380#define for_each_child_of_node(parent, child) \ 385#define for_each_child_of_node(parent, child) \
381 while (0) 386 while (__of_use_dn(parent), __of_use_dn(child), 0)
382 387
383#define for_each_available_child_of_node(parent, child) \ 388#define for_each_available_child_of_node(parent, child) \
384 while (0) 389 while (0)
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 82ce324fdce7..8d7dd6768cb7 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -64,6 +64,12 @@ static inline int of_driver_match_device(struct device *dev,
64static inline void of_device_uevent(struct device *dev, 64static inline void of_device_uevent(struct device *dev,
65 struct kobj_uevent_env *env) { } 65 struct kobj_uevent_env *env) { }
66 66
67static inline int of_device_get_modalias(struct device *dev,
68 char *str, ssize_t len)
69{
70 return -ENODEV;
71}
72
67static inline int of_device_uevent_modalias(struct device *dev, 73static inline int of_device_uevent_modalias(struct device *dev,
68 struct kobj_uevent_env *env) 74 struct kobj_uevent_env *env)
69{ 75{
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 0beaee9dac1f..2b77058a7335 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -116,6 +116,7 @@ extern const void *of_flat_dt_match_machine(const void *default_match,
116extern void unflatten_device_tree(void); 116extern void unflatten_device_tree(void);
117extern void unflatten_and_copy_device_tree(void); 117extern void unflatten_and_copy_device_tree(void);
118extern void early_init_devtree(void *); 118extern void early_init_devtree(void *);
119extern void early_get_first_memblock_info(void *, phys_addr_t *);
119#else /* CONFIG_OF_FLATTREE */ 120#else /* CONFIG_OF_FLATTREE */
120static inline const char *of_flat_dt_get_machine_name(void) { return NULL; } 121static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }
121static inline void unflatten_device_tree(void) {} 122static inline void unflatten_device_tree(void) {}
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
index 8163107b94b4..6fe8464ed767 100644
--- a/include/linux/of_mdio.h
+++ b/include/linux/of_mdio.h
@@ -19,6 +19,9 @@ extern struct phy_device *of_phy_connect(struct net_device *dev,
19 struct device_node *phy_np, 19 struct device_node *phy_np,
20 void (*hndlr)(struct net_device *), 20 void (*hndlr)(struct net_device *),
21 u32 flags, phy_interface_t iface); 21 u32 flags, phy_interface_t iface);
22struct phy_device *of_phy_attach(struct net_device *dev,
23 struct device_node *phy_np, u32 flags,
24 phy_interface_t iface);
22extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, 25extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
23 void (*hndlr)(struct net_device *), 26 void (*hndlr)(struct net_device *),
24 phy_interface_t iface); 27 phy_interface_t iface);
@@ -44,6 +47,13 @@ static inline struct phy_device *of_phy_connect(struct net_device *dev,
44 return NULL; 47 return NULL;
45} 48}
46 49
50static inline struct phy_device *of_phy_attach(struct net_device *dev,
51 struct device_node *phy_np,
52 u32 flags, phy_interface_t iface)
53{
54 return NULL;
55}
56
47static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, 57static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
48 void (*hndlr)(struct net_device *), 58 void (*hndlr)(struct net_device *),
49 phy_interface_t iface) 59 phy_interface_t iface)
diff --git a/include/linux/of_mtd.h b/include/linux/of_mtd.h
index 6f10e938ff7e..cb32d9c1e8dc 100644
--- a/include/linux/of_mtd.h
+++ b/include/linux/of_mtd.h
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9#ifndef __LINUX_OF_MTD_H 9#ifndef __LINUX_OF_MTD_H
10#define __LINUX_OF_NET_H 10#define __LINUX_OF_MTD_H
11 11
12#ifdef CONFIG_OF_MTD 12#ifdef CONFIG_OF_MTD
13 13
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 98ada58f9942..e464b4e987e8 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -412,7 +412,7 @@ static inline void ClearPageCompound(struct page *page)
412 */ 412 */
413static inline int PageTransHuge(struct page *page) 413static inline int PageTransHuge(struct page *page)
414{ 414{
415 VM_BUG_ON(PageTail(page)); 415 VM_BUG_ON_PAGE(PageTail(page), page);
416 return PageHead(page); 416 return PageHead(page);
417} 417}
418 418
@@ -460,25 +460,25 @@ static inline int PageTransTail(struct page *page)
460 */ 460 */
461static inline int PageSlabPfmemalloc(struct page *page) 461static inline int PageSlabPfmemalloc(struct page *page)
462{ 462{
463 VM_BUG_ON(!PageSlab(page)); 463 VM_BUG_ON_PAGE(!PageSlab(page), page);
464 return PageActive(page); 464 return PageActive(page);
465} 465}
466 466
467static inline void SetPageSlabPfmemalloc(struct page *page) 467static inline void SetPageSlabPfmemalloc(struct page *page)
468{ 468{
469 VM_BUG_ON(!PageSlab(page)); 469 VM_BUG_ON_PAGE(!PageSlab(page), page);
470 SetPageActive(page); 470 SetPageActive(page);
471} 471}
472 472
473static inline void __ClearPageSlabPfmemalloc(struct page *page) 473static inline void __ClearPageSlabPfmemalloc(struct page *page)
474{ 474{
475 VM_BUG_ON(!PageSlab(page)); 475 VM_BUG_ON_PAGE(!PageSlab(page), page);
476 __ClearPageActive(page); 476 __ClearPageActive(page);
477} 477}
478 478
479static inline void ClearPageSlabPfmemalloc(struct page *page) 479static inline void ClearPageSlabPfmemalloc(struct page *page)
480{ 480{
481 VM_BUG_ON(!PageSlab(page)); 481 VM_BUG_ON_PAGE(!PageSlab(page), page);
482 ClearPageActive(page); 482 ClearPageActive(page);
483} 483}
484 484
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index e3dea75a078b..1710d1b060ba 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -162,7 +162,7 @@ static inline int page_cache_get_speculative(struct page *page)
162 * disabling preempt, and hence no need for the "speculative get" that 162 * disabling preempt, and hence no need for the "speculative get" that
163 * SMP requires. 163 * SMP requires.
164 */ 164 */
165 VM_BUG_ON(page_count(page) == 0); 165 VM_BUG_ON_PAGE(page_count(page) == 0, page);
166 atomic_inc(&page->_count); 166 atomic_inc(&page->_count);
167 167
168#else 168#else
@@ -175,7 +175,7 @@ static inline int page_cache_get_speculative(struct page *page)
175 return 0; 175 return 0;
176 } 176 }
177#endif 177#endif
178 VM_BUG_ON(PageTail(page)); 178 VM_BUG_ON_PAGE(PageTail(page), page);
179 179
180 return 1; 180 return 1;
181} 181}
@@ -191,14 +191,14 @@ static inline int page_cache_add_speculative(struct page *page, int count)
191# ifdef CONFIG_PREEMPT_COUNT 191# ifdef CONFIG_PREEMPT_COUNT
192 VM_BUG_ON(!in_atomic()); 192 VM_BUG_ON(!in_atomic());
193# endif 193# endif
194 VM_BUG_ON(page_count(page) == 0); 194 VM_BUG_ON_PAGE(page_count(page) == 0, page);
195 atomic_add(count, &page->_count); 195 atomic_add(count, &page->_count);
196 196
197#else 197#else
198 if (unlikely(!atomic_add_unless(&page->_count, count, 0))) 198 if (unlikely(!atomic_add_unless(&page->_count, count, 0)))
199 return 0; 199 return 0;
200#endif 200#endif
201 VM_BUG_ON(PageCompound(page) && page != compound_head(page)); 201 VM_BUG_ON_PAGE(PageCompound(page) && page != compound_head(page), page);
202 202
203 return 1; 203 return 1;
204} 204}
@@ -210,7 +210,7 @@ static inline int page_freeze_refs(struct page *page, int count)
210 210
211static inline void page_unfreeze_refs(struct page *page, int count) 211static inline void page_unfreeze_refs(struct page *page, int count)
212{ 212{
213 VM_BUG_ON(page_count(page) != 0); 213 VM_BUG_ON_PAGE(page_count(page) != 0, page);
214 VM_BUG_ON(count == 0); 214 VM_BUG_ON(count == 0);
215 215
216 atomic_set(&page->_count, count); 216 atomic_set(&page->_count, count);
diff --git a/include/linux/parser.h b/include/linux/parser.h
index ea2281e726f6..39d5b7955b23 100644
--- a/include/linux/parser.h
+++ b/include/linux/parser.h
@@ -29,5 +29,6 @@ int match_token(char *, const match_table_t table, substring_t args[]);
29int match_int(substring_t *, int *result); 29int match_int(substring_t *, int *result);
30int match_octal(substring_t *, int *result); 30int match_octal(substring_t *, int *result);
31int match_hex(substring_t *, int *result); 31int match_hex(substring_t *, int *result);
32bool match_wildcard(const char *pattern, const char *str);
32size_t match_strlcpy(char *, const substring_t *, size_t); 33size_t match_strlcpy(char *, const substring_t *, size_t);
33char *match_strdup(const substring_t *); 34char *match_strdup(const substring_t *);
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h
index 68bcefd7fca0..72031785fe1d 100644
--- a/include/linux/pci-ats.h
+++ b/include/linux/pci-ats.h
@@ -56,10 +56,7 @@ static inline int pci_ats_enabled(struct pci_dev *dev)
56 56
57int pci_enable_pri(struct pci_dev *pdev, u32 reqs); 57int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
58void pci_disable_pri(struct pci_dev *pdev); 58void pci_disable_pri(struct pci_dev *pdev);
59bool pci_pri_enabled(struct pci_dev *pdev);
60int pci_reset_pri(struct pci_dev *pdev); 59int pci_reset_pri(struct pci_dev *pdev);
61bool pci_pri_stopped(struct pci_dev *pdev);
62int pci_pri_status(struct pci_dev *pdev);
63 60
64#else /* CONFIG_PCI_PRI */ 61#else /* CONFIG_PCI_PRI */
65 62
@@ -72,25 +69,11 @@ static inline void pci_disable_pri(struct pci_dev *pdev)
72{ 69{
73} 70}
74 71
75static inline bool pci_pri_enabled(struct pci_dev *pdev)
76{
77 return false;
78}
79
80static inline int pci_reset_pri(struct pci_dev *pdev) 72static inline int pci_reset_pri(struct pci_dev *pdev)
81{ 73{
82 return -ENODEV; 74 return -ENODEV;
83} 75}
84 76
85static inline bool pci_pri_stopped(struct pci_dev *pdev)
86{
87 return true;
88}
89
90static inline int pci_pri_status(struct pci_dev *pdev)
91{
92 return -ENODEV;
93}
94#endif /* CONFIG_PCI_PRI */ 77#endif /* CONFIG_PCI_PRI */
95 78
96#ifdef CONFIG_PCI_PASID 79#ifdef CONFIG_PCI_PASID
diff --git a/include/linux/pci.h b/include/linux/pci.h
index a13d6825e586..fb57c892b214 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -224,7 +224,8 @@ enum pci_bus_speed {
224}; 224};
225 225
226struct pci_cap_saved_data { 226struct pci_cap_saved_data {
227 char cap_nr; 227 u16 cap_nr;
228 bool cap_extended;
228 unsigned int size; 229 unsigned int size;
229 u32 data[0]; 230 u32 data[0];
230}; 231};
@@ -351,7 +352,7 @@ struct pci_dev {
351 struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */ 352 struct bin_attribute *res_attr_wc[DEVICE_COUNT_RESOURCE]; /* sysfs file for WC mapping of resources */
352#ifdef CONFIG_PCI_MSI 353#ifdef CONFIG_PCI_MSI
353 struct list_head msi_list; 354 struct list_head msi_list;
354 struct kset *msi_kset; 355 const struct attribute_group **msi_irq_groups;
355#endif 356#endif
356 struct pci_vpd *vpd; 357 struct pci_vpd *vpd;
357#ifdef CONFIG_PCI_ATS 358#ifdef CONFIG_PCI_ATS
@@ -375,7 +376,6 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
375} 376}
376 377
377struct pci_dev *pci_alloc_dev(struct pci_bus *bus); 378struct pci_dev *pci_alloc_dev(struct pci_bus *bus);
378struct pci_dev * __deprecated alloc_pci_dev(void);
379 379
380#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 380#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
381#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 381#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
@@ -385,8 +385,6 @@ static inline int pci_channel_offline(struct pci_dev *pdev)
385 return (pdev->error_state != pci_channel_io_normal); 385 return (pdev->error_state != pci_channel_io_normal);
386} 386}
387 387
388extern struct resource busn_resource;
389
390struct pci_host_bridge_window { 388struct pci_host_bridge_window {
391 struct list_head list; 389 struct list_head list;
392 struct resource *res; /* host bridge aperture (CPU address) */ 390 struct resource *res; /* host bridge aperture (CPU address) */
@@ -551,8 +549,8 @@ int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,
551 int reg, int len, u32 val); 549 int reg, int len, u32 val);
552 550
553struct pci_bus_region { 551struct pci_bus_region {
554 resource_size_t start; 552 dma_addr_t start;
555 resource_size_t end; 553 dma_addr_t end;
556}; 554};
557 555
558struct pci_dynids { 556struct pci_dynids {
@@ -634,8 +632,7 @@ struct pci_driver {
634 * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table 632 * DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table
635 * @_table: device table name 633 * @_table: device table name
636 * 634 *
637 * This macro is used to create a struct pci_device_id array (a device table) 635 * This macro is deprecated and should not be used in new code.
638 * in a generic manner.
639 */ 636 */
640#define DEFINE_PCI_DEVICE_TABLE(_table) \ 637#define DEFINE_PCI_DEVICE_TABLE(_table) \
641 const struct pci_device_id _table[] 638 const struct pci_device_id _table[]
@@ -737,9 +734,9 @@ void pci_fixup_cardbus(struct pci_bus *);
737 734
738/* Generic PCI functions used internally */ 735/* Generic PCI functions used internally */
739 736
740void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, 737void pcibios_resource_to_bus(struct pci_bus *bus, struct pci_bus_region *region,
741 struct resource *res); 738 struct resource *res);
742void pcibios_bus_to_resource(struct pci_dev *dev, struct resource *res, 739void pcibios_bus_to_resource(struct pci_bus *bus, struct resource *res,
743 struct pci_bus_region *region); 740 struct pci_bus_region *region);
744void pcibios_scan_specific_bus(int busn); 741void pcibios_scan_specific_bus(int busn);
745struct pci_bus *pci_find_bus(int domain, int busnr); 742struct pci_bus *pci_find_bus(int domain, int busnr);
@@ -763,7 +760,6 @@ struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr,
763 const char *name, 760 const char *name,
764 struct hotplug_slot *hotplug); 761 struct hotplug_slot *hotplug);
765void pci_destroy_slot(struct pci_slot *slot); 762void pci_destroy_slot(struct pci_slot *slot);
766void pci_renumber_slot(struct pci_slot *slot, int slot_nr);
767int pci_scan_slot(struct pci_bus *bus, int devfn); 763int pci_scan_slot(struct pci_bus *bus, int devfn);
768struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn); 764struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn);
769void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); 765void pci_device_add(struct pci_dev *dev, struct pci_bus *bus);
@@ -779,6 +775,7 @@ struct pci_dev *pci_dev_get(struct pci_dev *dev);
779void pci_dev_put(struct pci_dev *dev); 775void pci_dev_put(struct pci_dev *dev);
780void pci_remove_bus(struct pci_bus *b); 776void pci_remove_bus(struct pci_bus *b);
781void pci_stop_and_remove_bus_device(struct pci_dev *dev); 777void pci_stop_and_remove_bus_device(struct pci_dev *dev);
778void pci_stop_and_remove_bus_device_locked(struct pci_dev *dev);
782void pci_stop_root_bus(struct pci_bus *bus); 779void pci_stop_root_bus(struct pci_bus *bus);
783void pci_remove_root_bus(struct pci_bus *bus); 780void pci_remove_root_bus(struct pci_bus *bus);
784void pci_setup_cardbus(struct pci_bus *bus); 781void pci_setup_cardbus(struct pci_bus *bus);
@@ -938,6 +935,7 @@ bool pci_check_and_unmask_intx(struct pci_dev *dev);
938void pci_msi_off(struct pci_dev *dev); 935void pci_msi_off(struct pci_dev *dev);
939int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); 936int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size);
940int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); 937int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask);
938int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask);
941int pci_wait_for_pending_transaction(struct pci_dev *dev); 939int pci_wait_for_pending_transaction(struct pci_dev *dev);
942int pcix_get_max_mmrbc(struct pci_dev *dev); 940int pcix_get_max_mmrbc(struct pci_dev *dev);
943int pcix_get_mmrbc(struct pci_dev *dev); 941int pcix_get_mmrbc(struct pci_dev *dev);
@@ -951,10 +949,13 @@ int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
951int __pci_reset_function(struct pci_dev *dev); 949int __pci_reset_function(struct pci_dev *dev);
952int __pci_reset_function_locked(struct pci_dev *dev); 950int __pci_reset_function_locked(struct pci_dev *dev);
953int pci_reset_function(struct pci_dev *dev); 951int pci_reset_function(struct pci_dev *dev);
952int pci_try_reset_function(struct pci_dev *dev);
954int pci_probe_reset_slot(struct pci_slot *slot); 953int pci_probe_reset_slot(struct pci_slot *slot);
955int pci_reset_slot(struct pci_slot *slot); 954int pci_reset_slot(struct pci_slot *slot);
955int pci_try_reset_slot(struct pci_slot *slot);
956int pci_probe_reset_bus(struct pci_bus *bus); 956int pci_probe_reset_bus(struct pci_bus *bus);
957int pci_reset_bus(struct pci_bus *bus); 957int pci_reset_bus(struct pci_bus *bus);
958int pci_try_reset_bus(struct pci_bus *bus);
958void pci_reset_bridge_secondary_bus(struct pci_dev *dev); 959void pci_reset_bridge_secondary_bus(struct pci_dev *dev);
959void pci_update_resource(struct pci_dev *dev, int resno); 960void pci_update_resource(struct pci_dev *dev, int resno);
960int __must_check pci_assign_resource(struct pci_dev *dev, int i); 961int __must_check pci_assign_resource(struct pci_dev *dev, int i);
@@ -974,9 +975,14 @@ void __iomem __must_check *pci_platform_rom(struct pci_dev *pdev, size_t *size);
974int pci_save_state(struct pci_dev *dev); 975int pci_save_state(struct pci_dev *dev);
975void pci_restore_state(struct pci_dev *dev); 976void pci_restore_state(struct pci_dev *dev);
976struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev); 977struct pci_saved_state *pci_store_saved_state(struct pci_dev *dev);
977int pci_load_saved_state(struct pci_dev *dev, struct pci_saved_state *state);
978int pci_load_and_free_saved_state(struct pci_dev *dev, 978int pci_load_and_free_saved_state(struct pci_dev *dev,
979 struct pci_saved_state **state); 979 struct pci_saved_state **state);
980struct pci_cap_saved_state *pci_find_saved_cap(struct pci_dev *dev, char cap);
981struct pci_cap_saved_state *pci_find_saved_ext_cap(struct pci_dev *dev,
982 u16 cap);
983int pci_add_cap_save_buffer(struct pci_dev *dev, char cap, unsigned int size);
984int pci_add_ext_cap_save_buffer(struct pci_dev *dev,
985 u16 cap, unsigned int size);
980int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state); 986int __pci_complete_power_transition(struct pci_dev *dev, pci_power_t state);
981int pci_set_power_state(struct pci_dev *dev, pci_power_t state); 987int pci_set_power_state(struct pci_dev *dev, pci_power_t state);
982pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); 988pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state);
@@ -985,7 +991,6 @@ void pci_pme_active(struct pci_dev *dev, bool enable);
985int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, 991int __pci_enable_wake(struct pci_dev *dev, pci_power_t state,
986 bool runtime, bool enable); 992 bool runtime, bool enable);
987int pci_wake_from_d3(struct pci_dev *dev, bool enable); 993int pci_wake_from_d3(struct pci_dev *dev, bool enable);
988pci_power_t pci_target_state(struct pci_dev *dev);
989int pci_prepare_to_sleep(struct pci_dev *dev); 994int pci_prepare_to_sleep(struct pci_dev *dev);
990int pci_back_from_sleep(struct pci_dev *dev); 995int pci_back_from_sleep(struct pci_dev *dev);
991bool pci_dev_run_wake(struct pci_dev *dev); 996bool pci_dev_run_wake(struct pci_dev *dev);
@@ -998,21 +1003,10 @@ static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
998 return __pci_enable_wake(dev, state, false, enable); 1003 return __pci_enable_wake(dev, state, false, enable);
999} 1004}
1000 1005
1001#define PCI_EXP_IDO_REQUEST (1<<0) 1006/* PCI Virtual Channel */
1002#define PCI_EXP_IDO_COMPLETION (1<<1) 1007int pci_save_vc_state(struct pci_dev *dev);
1003void pci_enable_ido(struct pci_dev *dev, unsigned long type); 1008void pci_restore_vc_state(struct pci_dev *dev);
1004void pci_disable_ido(struct pci_dev *dev, unsigned long type); 1009void pci_allocate_vc_save_buffers(struct pci_dev *dev);
1005
1006enum pci_obff_signal_type {
1007 PCI_EXP_OBFF_SIGNAL_L0 = 0,
1008 PCI_EXP_OBFF_SIGNAL_ALWAYS = 1,
1009};
1010int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
1011void pci_disable_obff(struct pci_dev *dev);
1012
1013int pci_enable_ltr(struct pci_dev *dev);
1014void pci_disable_ltr(struct pci_dev *dev);
1015int pci_set_ltr(struct pci_dev *dev, int snoop_lat_ns, int nosnoop_lat_ns);
1016 1010
1017/* For use by arch with custom probe code */ 1011/* For use by arch with custom probe code */
1018void set_pcie_port_type(struct pci_dev *pdev); 1012void set_pcie_port_type(struct pci_dev *pdev);
@@ -1022,11 +1016,12 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev);
1022int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); 1016int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
1023unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); 1017unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge);
1024unsigned int pci_rescan_bus(struct pci_bus *bus); 1018unsigned int pci_rescan_bus(struct pci_bus *bus);
1019void pci_lock_rescan_remove(void);
1020void pci_unlock_rescan_remove(void);
1025 1021
1026/* Vital product data routines */ 1022/* Vital product data routines */
1027ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); 1023ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf);
1028ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf); 1024ssize_t pci_write_vpd(struct pci_dev *dev, loff_t pos, size_t count, const void *buf);
1029int pci_vpd_truncate(struct pci_dev *dev, size_t size);
1030 1025
1031/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */ 1026/* Helper functions for low-level code (drivers/pci/setup-[bus,res].c) */
1032resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); 1027resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx);
@@ -1078,6 +1073,14 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
1078 resource_size_t), 1073 resource_size_t),
1079 void *alignf_data); 1074 void *alignf_data);
1080 1075
1076static inline dma_addr_t pci_bus_address(struct pci_dev *pdev, int bar)
1077{
1078 struct pci_bus_region region;
1079
1080 pcibios_resource_to_bus(pdev->bus, &region, &pdev->resource[bar]);
1081 return region.start;
1082}
1083
1081/* Proper probing supporting hot-pluggable devices */ 1084/* Proper probing supporting hot-pluggable devices */
1082int __must_check __pci_register_driver(struct pci_driver *, struct module *, 1085int __must_check __pci_register_driver(struct pci_driver *, struct module *,
1083 const char *mod_name); 1086 const char *mod_name);
@@ -1115,7 +1118,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
1115 1118
1116void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), 1119void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *),
1117 void *userdata); 1120 void *userdata);
1118int pci_cfg_space_size_ext(struct pci_dev *dev);
1119int pci_cfg_space_size(struct pci_dev *dev); 1121int pci_cfg_space_size(struct pci_dev *dev);
1120unsigned char pci_bus_max_busnr(struct pci_bus *bus); 1122unsigned char pci_bus_max_busnr(struct pci_bus *bus);
1121void pci_setup_bridge(struct pci_bus *bus); 1123void pci_setup_bridge(struct pci_bus *bus);
@@ -1154,59 +1156,42 @@ struct msix_entry {
1154}; 1156};
1155 1157
1156 1158
1157#ifndef CONFIG_PCI_MSI 1159#ifdef CONFIG_PCI_MSI
1158static inline int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec) 1160int pci_msi_vec_count(struct pci_dev *dev);
1159{ 1161int pci_enable_msi_block(struct pci_dev *dev, int nvec);
1160 return -1;
1161}
1162
1163static inline int
1164pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec)
1165{
1166 return -1;
1167}
1168
1169static inline void pci_msi_shutdown(struct pci_dev *dev)
1170{ }
1171static inline void pci_disable_msi(struct pci_dev *dev)
1172{ }
1173
1174static inline int pci_msix_table_size(struct pci_dev *dev)
1175{
1176 return 0;
1177}
1178static inline int pci_enable_msix(struct pci_dev *dev,
1179 struct msix_entry *entries, int nvec)
1180{
1181 return -1;
1182}
1183
1184static inline void pci_msix_shutdown(struct pci_dev *dev)
1185{ }
1186static inline void pci_disable_msix(struct pci_dev *dev)
1187{ }
1188
1189static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev)
1190{ }
1191
1192static inline void pci_restore_msi_state(struct pci_dev *dev)
1193{ }
1194static inline int pci_msi_enabled(void)
1195{
1196 return 0;
1197}
1198#else
1199int pci_enable_msi_block(struct pci_dev *dev, unsigned int nvec);
1200int pci_enable_msi_block_auto(struct pci_dev *dev, unsigned int *maxvec);
1201void pci_msi_shutdown(struct pci_dev *dev); 1162void pci_msi_shutdown(struct pci_dev *dev);
1202void pci_disable_msi(struct pci_dev *dev); 1163void pci_disable_msi(struct pci_dev *dev);
1203int pci_msix_table_size(struct pci_dev *dev); 1164int pci_msix_vec_count(struct pci_dev *dev);
1204int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec); 1165int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec);
1205void pci_msix_shutdown(struct pci_dev *dev); 1166void pci_msix_shutdown(struct pci_dev *dev);
1206void pci_disable_msix(struct pci_dev *dev); 1167void pci_disable_msix(struct pci_dev *dev);
1207void msi_remove_pci_irq_vectors(struct pci_dev *dev); 1168void msi_remove_pci_irq_vectors(struct pci_dev *dev);
1208void pci_restore_msi_state(struct pci_dev *dev); 1169void pci_restore_msi_state(struct pci_dev *dev);
1209int pci_msi_enabled(void); 1170int pci_msi_enabled(void);
1171int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec);
1172int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
1173 int minvec, int maxvec);
1174#else
1175static inline int pci_msi_vec_count(struct pci_dev *dev) { return -ENOSYS; }
1176static inline int pci_enable_msi_block(struct pci_dev *dev, int nvec)
1177{ return -ENOSYS; }
1178static inline void pci_msi_shutdown(struct pci_dev *dev) { }
1179static inline void pci_disable_msi(struct pci_dev *dev) { }
1180static inline int pci_msix_vec_count(struct pci_dev *dev) { return -ENOSYS; }
1181static inline int pci_enable_msix(struct pci_dev *dev,
1182 struct msix_entry *entries, int nvec)
1183{ return -ENOSYS; }
1184static inline void pci_msix_shutdown(struct pci_dev *dev) { }
1185static inline void pci_disable_msix(struct pci_dev *dev) { }
1186static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) { }
1187static inline void pci_restore_msi_state(struct pci_dev *dev) { }
1188static inline int pci_msi_enabled(void) { return 0; }
1189static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec,
1190 int maxvec)
1191{ return -ENOSYS; }
1192static inline int pci_enable_msix_range(struct pci_dev *dev,
1193 struct msix_entry *entries, int minvec, int maxvec)
1194{ return -ENOSYS; }
1210#endif 1195#endif
1211 1196
1212#ifdef CONFIG_PCIEPORTBUS 1197#ifdef CONFIG_PCIEPORTBUS
@@ -1217,12 +1202,10 @@ extern bool pcie_ports_auto;
1217#define pcie_ports_auto false 1202#define pcie_ports_auto false
1218#endif 1203#endif
1219 1204
1220#ifndef CONFIG_PCIEASPM 1205#ifdef CONFIG_PCIEASPM
1221static inline int pcie_aspm_enabled(void) { return 0; }
1222static inline bool pcie_aspm_support_enabled(void) { return false; }
1223#else
1224int pcie_aspm_enabled(void);
1225bool pcie_aspm_support_enabled(void); 1206bool pcie_aspm_support_enabled(void);
1207#else
1208static inline bool pcie_aspm_support_enabled(void) { return false; }
1226#endif 1209#endif
1227 1210
1228#ifdef CONFIG_PCIEAER 1211#ifdef CONFIG_PCIEAER
@@ -1233,15 +1216,12 @@ static inline void pci_no_aer(void) { }
1233static inline bool pci_aer_available(void) { return false; } 1216static inline bool pci_aer_available(void) { return false; }
1234#endif 1217#endif
1235 1218
1236#ifndef CONFIG_PCIE_ECRC 1219#ifdef CONFIG_PCIE_ECRC
1237static inline void pcie_set_ecrc_checking(struct pci_dev *dev)
1238{
1239 return;
1240}
1241static inline void pcie_ecrc_get_policy(char *str) {};
1242#else
1243void pcie_set_ecrc_checking(struct pci_dev *dev); 1220void pcie_set_ecrc_checking(struct pci_dev *dev);
1244void pcie_ecrc_get_policy(char *str); 1221void pcie_ecrc_get_policy(char *str);
1222#else
1223static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { }
1224static inline void pcie_ecrc_get_policy(char *str) { }
1245#endif 1225#endif
1246 1226
1247#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) 1227#define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1)
@@ -1265,15 +1245,8 @@ void pci_cfg_access_unlock(struct pci_dev *dev);
1265extern int pci_domains_supported; 1245extern int pci_domains_supported;
1266#else 1246#else
1267enum { pci_domains_supported = 0 }; 1247enum { pci_domains_supported = 0 };
1268static inline int pci_domain_nr(struct pci_bus *bus) 1248static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
1269{ 1249static inline int pci_proc_domain(struct pci_bus *bus) { return 0; }
1270 return 0;
1271}
1272
1273static inline int pci_proc_domain(struct pci_bus *bus)
1274{
1275 return 0;
1276}
1277#endif /* CONFIG_PCI_DOMAINS */ 1250#endif /* CONFIG_PCI_DOMAINS */
1278 1251
1279/* some architectures require additional setup to direct VGA traffic */ 1252/* some architectures require additional setup to direct VGA traffic */
@@ -1302,180 +1275,88 @@ _PCI_NOP_ALL(write,)
1302static inline struct pci_dev *pci_get_device(unsigned int vendor, 1275static inline struct pci_dev *pci_get_device(unsigned int vendor,
1303 unsigned int device, 1276 unsigned int device,
1304 struct pci_dev *from) 1277 struct pci_dev *from)
1305{ 1278{ return NULL; }
1306 return NULL;
1307}
1308 1279
1309static inline struct pci_dev *pci_get_subsys(unsigned int vendor, 1280static inline struct pci_dev *pci_get_subsys(unsigned int vendor,
1310 unsigned int device, 1281 unsigned int device,
1311 unsigned int ss_vendor, 1282 unsigned int ss_vendor,
1312 unsigned int ss_device, 1283 unsigned int ss_device,
1313 struct pci_dev *from) 1284 struct pci_dev *from)
1314{ 1285{ return NULL; }
1315 return NULL;
1316}
1317 1286
1318static inline struct pci_dev *pci_get_class(unsigned int class, 1287static inline struct pci_dev *pci_get_class(unsigned int class,
1319 struct pci_dev *from) 1288 struct pci_dev *from)
1320{ 1289{ return NULL; }
1321 return NULL;
1322}
1323 1290
1324#define pci_dev_present(ids) (0) 1291#define pci_dev_present(ids) (0)
1325#define no_pci_devices() (1) 1292#define no_pci_devices() (1)
1326#define pci_dev_put(dev) do { } while (0) 1293#define pci_dev_put(dev) do { } while (0)
1327 1294
1328static inline void pci_set_master(struct pci_dev *dev) 1295static inline void pci_set_master(struct pci_dev *dev) { }
1329{ } 1296static inline int pci_enable_device(struct pci_dev *dev) { return -EIO; }
1330 1297static inline void pci_disable_device(struct pci_dev *dev) { }
1331static inline int pci_enable_device(struct pci_dev *dev)
1332{
1333 return -EIO;
1334}
1335
1336static inline void pci_disable_device(struct pci_dev *dev)
1337{ }
1338
1339static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) 1298static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
1340{ 1299{ return -EIO; }
1341 return -EIO;
1342}
1343
1344static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) 1300static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
1345{ 1301{ return -EIO; }
1346 return -EIO;
1347}
1348
1349static inline int pci_set_dma_max_seg_size(struct pci_dev *dev, 1302static inline int pci_set_dma_max_seg_size(struct pci_dev *dev,
1350 unsigned int size) 1303 unsigned int size)
1351{ 1304{ return -EIO; }
1352 return -EIO;
1353}
1354
1355static inline int pci_set_dma_seg_boundary(struct pci_dev *dev, 1305static inline int pci_set_dma_seg_boundary(struct pci_dev *dev,
1356 unsigned long mask) 1306 unsigned long mask)
1357{ 1307{ return -EIO; }
1358 return -EIO;
1359}
1360
1361static inline int pci_assign_resource(struct pci_dev *dev, int i) 1308static inline int pci_assign_resource(struct pci_dev *dev, int i)
1362{ 1309{ return -EBUSY; }
1363 return -EBUSY;
1364}
1365
1366static inline int __pci_register_driver(struct pci_driver *drv, 1310static inline int __pci_register_driver(struct pci_driver *drv,
1367 struct module *owner) 1311 struct module *owner)
1368{ 1312{ return 0; }
1369 return 0;
1370}
1371
1372static inline int pci_register_driver(struct pci_driver *drv) 1313static inline int pci_register_driver(struct pci_driver *drv)
1373{ 1314{ return 0; }
1374 return 0; 1315static inline void pci_unregister_driver(struct pci_driver *drv) { }
1375}
1376
1377static inline void pci_unregister_driver(struct pci_driver *drv)
1378{ }
1379
1380static inline int pci_find_capability(struct pci_dev *dev, int cap) 1316static inline int pci_find_capability(struct pci_dev *dev, int cap)
1381{ 1317{ return 0; }
1382 return 0;
1383}
1384
1385static inline int pci_find_next_capability(struct pci_dev *dev, u8 post, 1318static inline int pci_find_next_capability(struct pci_dev *dev, u8 post,
1386 int cap) 1319 int cap)
1387{ 1320{ return 0; }
1388 return 0;
1389}
1390
1391static inline int pci_find_ext_capability(struct pci_dev *dev, int cap) 1321static inline int pci_find_ext_capability(struct pci_dev *dev, int cap)
1392{ 1322{ return 0; }
1393 return 0;
1394}
1395 1323
1396/* Power management related routines */ 1324/* Power management related routines */
1397static inline int pci_save_state(struct pci_dev *dev) 1325static inline int pci_save_state(struct pci_dev *dev) { return 0; }
1398{ 1326static inline void pci_restore_state(struct pci_dev *dev) { }
1399 return 0;
1400}
1401
1402static inline void pci_restore_state(struct pci_dev *dev)
1403{ }
1404
1405static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state) 1327static inline int pci_set_power_state(struct pci_dev *dev, pci_power_t state)
1406{ 1328{ return 0; }
1407 return 0;
1408}
1409
1410static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable) 1329static inline int pci_wake_from_d3(struct pci_dev *dev, bool enable)
1411{ 1330{ return 0; }
1412 return 0;
1413}
1414
1415static inline pci_power_t pci_choose_state(struct pci_dev *dev, 1331static inline pci_power_t pci_choose_state(struct pci_dev *dev,
1416 pm_message_t state) 1332 pm_message_t state)
1417{ 1333{ return PCI_D0; }
1418 return PCI_D0;
1419}
1420
1421static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, 1334static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state,
1422 int enable) 1335 int enable)
1423{ 1336{ return 0; }
1424 return 0;
1425}
1426
1427static inline void pci_enable_ido(struct pci_dev *dev, unsigned long type)
1428{
1429}
1430
1431static inline void pci_disable_ido(struct pci_dev *dev, unsigned long type)
1432{
1433}
1434
1435static inline int pci_enable_obff(struct pci_dev *dev, unsigned long type)
1436{
1437 return 0;
1438}
1439
1440static inline void pci_disable_obff(struct pci_dev *dev)
1441{
1442}
1443 1337
1444static inline int pci_request_regions(struct pci_dev *dev, const char *res_name) 1338static inline int pci_request_regions(struct pci_dev *dev, const char *res_name)
1445{ 1339{ return -EIO; }
1446 return -EIO; 1340static inline void pci_release_regions(struct pci_dev *dev) { }
1447}
1448
1449static inline void pci_release_regions(struct pci_dev *dev)
1450{ }
1451 1341
1452#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0) 1342#define pci_dma_burst_advice(pdev, strat, strategy_parameter) do { } while (0)
1453 1343
1454static inline void pci_block_cfg_access(struct pci_dev *dev) 1344static inline void pci_block_cfg_access(struct pci_dev *dev) { }
1455{ }
1456
1457static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev) 1345static inline int pci_block_cfg_access_in_atomic(struct pci_dev *dev)
1458{ return 0; } 1346{ return 0; }
1459 1347static inline void pci_unblock_cfg_access(struct pci_dev *dev) { }
1460static inline void pci_unblock_cfg_access(struct pci_dev *dev)
1461{ }
1462 1348
1463static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from) 1349static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
1464{ return NULL; } 1350{ return NULL; }
1465
1466static inline struct pci_dev *pci_get_slot(struct pci_bus *bus, 1351static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
1467 unsigned int devfn) 1352 unsigned int devfn)
1468{ return NULL; } 1353{ return NULL; }
1469
1470static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, 1354static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
1471 unsigned int devfn) 1355 unsigned int devfn)
1472{ return NULL; } 1356{ return NULL; }
1473 1357
1474static inline int pci_domain_nr(struct pci_bus *bus) 1358static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
1475{ return 0; } 1359static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; }
1476
1477static inline struct pci_dev *pci_dev_get(struct pci_dev *dev)
1478{ return NULL; }
1479 1360
1480#define dev_is_pci(d) (false) 1361#define dev_is_pci(d) (false)
1481#define dev_is_pf(d) (false) 1362#define dev_is_pf(d) (false)
@@ -1486,10 +1367,6 @@ static inline struct pci_dev *pci_dev_get(struct pci_dev *dev)
1486 1367
1487#include <asm/pci.h> 1368#include <asm/pci.h>
1488 1369
1489#ifndef PCIBIOS_MAX_MEM_32
1490#define PCIBIOS_MAX_MEM_32 (-1)
1491#endif
1492
1493/* these helpers provide future and backwards compatibility 1370/* these helpers provide future and backwards compatibility
1494 * for accessing popular PCI BAR info */ 1371 * for accessing popular PCI BAR info */
1495#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) 1372#define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start)
@@ -1635,7 +1512,7 @@ struct pci_dev *pci_get_dma_source(struct pci_dev *dev);
1635int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags); 1512int pci_dev_specific_acs_enabled(struct pci_dev *dev, u16 acs_flags);
1636#else 1513#else
1637static inline void pci_fixup_device(enum pci_fixup_pass pass, 1514static inline void pci_fixup_device(enum pci_fixup_pass pass,
1638 struct pci_dev *dev) {} 1515 struct pci_dev *dev) { }
1639static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev) 1516static inline struct pci_dev *pci_get_dma_source(struct pci_dev *dev)
1640{ 1517{
1641 return pci_dev_get(dev); 1518 return pci_dev_get(dev);
@@ -1707,32 +1584,17 @@ int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
1707int pci_sriov_get_totalvfs(struct pci_dev *dev); 1584int pci_sriov_get_totalvfs(struct pci_dev *dev);
1708#else 1585#else
1709static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) 1586static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
1710{ 1587{ return -ENODEV; }
1711 return -ENODEV; 1588static inline void pci_disable_sriov(struct pci_dev *dev) { }
1712}
1713static inline void pci_disable_sriov(struct pci_dev *dev)
1714{
1715}
1716static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) 1589static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev)
1717{ 1590{ return IRQ_NONE; }
1718 return IRQ_NONE; 1591static inline int pci_num_vf(struct pci_dev *dev) { return 0; }
1719}
1720static inline int pci_num_vf(struct pci_dev *dev)
1721{
1722 return 0;
1723}
1724static inline int pci_vfs_assigned(struct pci_dev *dev) 1592static inline int pci_vfs_assigned(struct pci_dev *dev)
1725{ 1593{ return 0; }
1726 return 0;
1727}
1728static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs) 1594static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs)
1729{ 1595{ return 0; }
1730 return 0;
1731}
1732static inline int pci_sriov_get_totalvfs(struct pci_dev *dev) 1596static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
1733{ 1597{ return 0; }
1734 return 0;
1735}
1736#endif 1598#endif
1737 1599
1738#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) 1600#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index a2e2f1d17e16..5f2e559af6b0 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -175,8 +175,7 @@ struct hotplug_params {
175}; 175};
176 176
177#ifdef CONFIG_ACPI 177#ifdef CONFIG_ACPI
178#include <acpi/acpi.h> 178#include <linux/acpi.h>
179#include <acpi/acpi_bus.h>
180int pci_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp); 179int pci_get_hp_params(struct pci_dev *dev, struct hotplug_params *hpp);
181int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); 180int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags);
182int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); 181int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle);
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 9e4761caa80c..e3817d2441b6 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -1,6 +1,7 @@
1#ifndef __LINUX_PERCPU_H 1#ifndef __LINUX_PERCPU_H
2#define __LINUX_PERCPU_H 2#define __LINUX_PERCPU_H
3 3
4#include <linux/mmdebug.h>
4#include <linux/preempt.h> 5#include <linux/preempt.h>
5#include <linux/smp.h> 6#include <linux/smp.h>
6#include <linux/cpumask.h> 7#include <linux/cpumask.h>
diff --git a/include/linux/percpu_ida.h b/include/linux/percpu_ida.h
index 1900bd0fa639..f5cfdd6a5539 100644
--- a/include/linux/percpu_ida.h
+++ b/include/linux/percpu_ida.h
@@ -4,6 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/bitops.h> 5#include <linux/bitops.h>
6#include <linux/init.h> 6#include <linux/init.h>
7#include <linux/sched.h>
7#include <linux/spinlock_types.h> 8#include <linux/spinlock_types.h>
8#include <linux/wait.h> 9#include <linux/wait.h>
9#include <linux/cpumask.h> 10#include <linux/cpumask.h>
@@ -61,7 +62,7 @@ struct percpu_ida {
61/* Max size of percpu freelist, */ 62/* Max size of percpu freelist, */
62#define IDA_DEFAULT_PCPU_SIZE ((IDA_DEFAULT_PCPU_BATCH_MOVE * 3) / 2) 63#define IDA_DEFAULT_PCPU_SIZE ((IDA_DEFAULT_PCPU_BATCH_MOVE * 3) / 2)
63 64
64int percpu_ida_alloc(struct percpu_ida *pool, gfp_t gfp); 65int percpu_ida_alloc(struct percpu_ida *pool, int state);
65void percpu_ida_free(struct percpu_ida *pool, unsigned tag); 66void percpu_ida_free(struct percpu_ida *pool, unsigned tag);
66 67
67void percpu_ida_destroy(struct percpu_ida *pool); 68void percpu_ida_destroy(struct percpu_ida *pool);
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 48a4dc3cb8cf..565188ca328f 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * include/linux/phy.h
3 *
4 * Framework and drivers for configuring and reading different PHYs 2 * Framework and drivers for configuring and reading different PHYs
5 * Based on code in sungem_phy.c and gianfar_phy.c 3 * Based on code in sungem_phy.c and gianfar_phy.c
6 * 4 *
@@ -27,18 +25,27 @@
27 25
28#include <linux/atomic.h> 26#include <linux/atomic.h>
29 27
30#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ 28#define PHY_DEFAULT_FEATURES (SUPPORTED_Autoneg | \
31 SUPPORTED_10baseT_Full | \
32 SUPPORTED_100baseT_Half | \
33 SUPPORTED_100baseT_Full | \
34 SUPPORTED_Autoneg | \
35 SUPPORTED_TP | \ 29 SUPPORTED_TP | \
36 SUPPORTED_MII) 30 SUPPORTED_MII)
37 31
38#define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \ 32#define PHY_10BT_FEATURES (SUPPORTED_10baseT_Half | \
39 SUPPORTED_1000baseT_Half | \ 33 SUPPORTED_10baseT_Full)
34
35#define PHY_100BT_FEATURES (SUPPORTED_100baseT_Half | \
36 SUPPORTED_100baseT_Full)
37
38#define PHY_1000BT_FEATURES (SUPPORTED_1000baseT_Half | \
40 SUPPORTED_1000baseT_Full) 39 SUPPORTED_1000baseT_Full)
41 40
41#define PHY_BASIC_FEATURES (PHY_10BT_FEATURES | \
42 PHY_100BT_FEATURES | \
43 PHY_DEFAULT_FEATURES)
44
45#define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \
46 PHY_1000BT_FEATURES)
47
48
42/* 49/*
43 * Set phydev->irq to PHY_POLL if interrupts are not supported, 50 * Set phydev->irq to PHY_POLL if interrupts are not supported,
44 * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if 51 * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if
@@ -66,6 +73,7 @@ typedef enum {
66 PHY_INTERFACE_MODE_RGMII_TXID, 73 PHY_INTERFACE_MODE_RGMII_TXID,
67 PHY_INTERFACE_MODE_RTBI, 74 PHY_INTERFACE_MODE_RTBI,
68 PHY_INTERFACE_MODE_SMII, 75 PHY_INTERFACE_MODE_SMII,
76 PHY_INTERFACE_MODE_XGMII,
69} phy_interface_t; 77} phy_interface_t;
70 78
71 79
@@ -231,7 +239,7 @@ int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val);
231 * - phy_stop moves to HALTED 239 * - phy_stop moves to HALTED
232 */ 240 */
233enum phy_state { 241enum phy_state {
234 PHY_DOWN=0, 242 PHY_DOWN = 0,
235 PHY_STARTING, 243 PHY_STARTING,
236 PHY_READY, 244 PHY_READY,
237 PHY_PENDING, 245 PHY_PENDING,
@@ -275,11 +283,9 @@ struct phy_c45_device_ids {
275 * attached_dev: The attached enet driver's device instance ptr 283 * attached_dev: The attached enet driver's device instance ptr
276 * adjust_link: Callback for the enet controller to respond to 284 * adjust_link: Callback for the enet controller to respond to
277 * changes in the link state. 285 * changes in the link state.
278 * adjust_state: Callback for the enet driver to respond to
279 * changes in the state machine.
280 * 286 *
281 * speed, duplex, pause, supported, advertising, and 287 * speed, duplex, pause, supported, advertising, lp_advertising,
282 * autoneg are used like in mii_if_info 288 * and autoneg are used like in mii_if_info
283 * 289 *
284 * interrupts currently only supports enabled or disabled, 290 * interrupts currently only supports enabled or disabled,
285 * but could be changed in the future to support enabling 291 * but could be changed in the future to support enabling
@@ -331,6 +337,7 @@ struct phy_device {
331 /* See mii.h for more info */ 337 /* See mii.h for more info */
332 u32 supported; 338 u32 supported;
333 u32 advertising; 339 u32 advertising;
340 u32 lp_advertising;
334 341
335 int autoneg; 342 int autoneg;
336 343
@@ -356,8 +363,6 @@ struct phy_device {
356 struct net_device *attached_dev; 363 struct net_device *attached_dev;
357 364
358 void (*adjust_link)(struct net_device *dev); 365 void (*adjust_link)(struct net_device *dev);
359
360 void (*adjust_state)(struct net_device *dev);
361}; 366};
362#define to_phy_device(d) container_of(d, struct phy_device, dev) 367#define to_phy_device(d) container_of(d, struct phy_device, dev)
363 368
@@ -484,6 +489,24 @@ struct phy_fixup {
484}; 489};
485 490
486/** 491/**
492 * phy_read_mmd - Convenience function for reading a register
493 * from an MMD on a given PHY.
494 * @phydev: The phy_device struct
495 * @devad: The MMD to read from
496 * @regnum: The register on the MMD to read
497 *
498 * Same rules as for phy_read();
499 */
500static inline int phy_read_mmd(struct phy_device *phydev, int devad, u32 regnum)
501{
502 if (!phydev->is_c45)
503 return -EOPNOTSUPP;
504
505 return mdiobus_read(phydev->bus, phydev->addr,
506 MII_ADDR_C45 | (devad << 16) | (regnum & 0xffff));
507}
508
509/**
487 * phy_read - Convenience function for reading a given PHY register 510 * phy_read - Convenience function for reading a given PHY register
488 * @phydev: the phy_device struct 511 * @phydev: the phy_device struct
489 * @regnum: register number to read 512 * @regnum: register number to read
@@ -533,20 +556,46 @@ static inline bool phy_is_internal(struct phy_device *phydev)
533 return phydev->is_internal; 556 return phydev->is_internal;
534} 557}
535 558
559/**
560 * phy_write_mmd - Convenience function for writing a register
561 * on an MMD on a given PHY.
562 * @phydev: The phy_device struct
563 * @devad: The MMD to read from
564 * @regnum: The register on the MMD to read
565 * @val: value to write to @regnum
566 *
567 * Same rules as for phy_write();
568 */
569static inline int phy_write_mmd(struct phy_device *phydev, int devad,
570 u32 regnum, u16 val)
571{
572 if (!phydev->is_c45)
573 return -EOPNOTSUPP;
574
575 regnum = MII_ADDR_C45 | ((devad & 0x1f) << 16) | (regnum & 0xffff);
576
577 return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
578}
579
536struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, 580struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
537 bool is_c45, struct phy_c45_device_ids *c45_ids); 581 bool is_c45,
582 struct phy_c45_device_ids *c45_ids);
538struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); 583struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);
539int phy_device_register(struct phy_device *phy); 584int phy_device_register(struct phy_device *phy);
540int phy_init_hw(struct phy_device *phydev); 585int phy_init_hw(struct phy_device *phydev);
541struct phy_device * phy_attach(struct net_device *dev, 586int phy_suspend(struct phy_device *phydev);
542 const char *bus_id, phy_interface_t interface); 587int phy_resume(struct phy_device *phydev);
588struct phy_device *phy_attach(struct net_device *dev, const char *bus_id,
589 phy_interface_t interface);
543struct phy_device *phy_find_first(struct mii_bus *bus); 590struct phy_device *phy_find_first(struct mii_bus *bus);
591int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
592 u32 flags, phy_interface_t interface);
544int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, 593int phy_connect_direct(struct net_device *dev, struct phy_device *phydev,
545 void (*handler)(struct net_device *), 594 void (*handler)(struct net_device *),
546 phy_interface_t interface); 595 phy_interface_t interface);
547struct phy_device * phy_connect(struct net_device *dev, const char *bus_id, 596struct phy_device *phy_connect(struct net_device *dev, const char *bus_id,
548 void (*handler)(struct net_device *), 597 void (*handler)(struct net_device *),
549 phy_interface_t interface); 598 phy_interface_t interface);
550void phy_disconnect(struct phy_device *phydev); 599void phy_disconnect(struct phy_device *phydev);
551void phy_detach(struct phy_device *phydev); 600void phy_detach(struct phy_device *phydev);
552void phy_start(struct phy_device *phydev); 601void phy_start(struct phy_device *phydev);
@@ -555,7 +604,8 @@ int phy_start_aneg(struct phy_device *phydev);
555 604
556int phy_stop_interrupts(struct phy_device *phydev); 605int phy_stop_interrupts(struct phy_device *phydev);
557 606
558static inline int phy_read_status(struct phy_device *phydev) { 607static inline int phy_read_status(struct phy_device *phydev)
608{
559 return phydev->drv->read_status(phydev); 609 return phydev->drv->read_status(phydev);
560} 610}
561 611
@@ -573,31 +623,29 @@ int phy_drivers_register(struct phy_driver *new_driver, int n);
573void phy_state_machine(struct work_struct *work); 623void phy_state_machine(struct work_struct *work);
574void phy_change(struct work_struct *work); 624void phy_change(struct work_struct *work);
575void phy_mac_interrupt(struct phy_device *phydev, int new_link); 625void phy_mac_interrupt(struct phy_device *phydev, int new_link);
576void phy_start_machine(struct phy_device *phydev, 626void phy_start_machine(struct phy_device *phydev);
577 void (*handler)(struct net_device *));
578void phy_stop_machine(struct phy_device *phydev); 627void phy_stop_machine(struct phy_device *phydev);
579int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); 628int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
580int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); 629int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
581int phy_mii_ioctl(struct phy_device *phydev, 630int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd);
582 struct ifreq *ifr, int cmd);
583int phy_start_interrupts(struct phy_device *phydev); 631int phy_start_interrupts(struct phy_device *phydev);
584void phy_print_status(struct phy_device *phydev); 632void phy_print_status(struct phy_device *phydev);
585void phy_device_free(struct phy_device *phydev); 633void phy_device_free(struct phy_device *phydev);
586 634
587int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask, 635int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
588 int (*run)(struct phy_device *)); 636 int (*run)(struct phy_device *));
589int phy_register_fixup_for_id(const char *bus_id, 637int phy_register_fixup_for_id(const char *bus_id,
590 int (*run)(struct phy_device *)); 638 int (*run)(struct phy_device *));
591int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask, 639int phy_register_fixup_for_uid(u32 phy_uid, u32 phy_uid_mask,
592 int (*run)(struct phy_device *)); 640 int (*run)(struct phy_device *));
593int phy_scan_fixups(struct phy_device *phydev);
594 641
595int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable); 642int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable);
596int phy_get_eee_err(struct phy_device *phydev); 643int phy_get_eee_err(struct phy_device *phydev);
597int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data); 644int phy_ethtool_set_eee(struct phy_device *phydev, struct ethtool_eee *data);
598int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data); 645int phy_ethtool_get_eee(struct phy_device *phydev, struct ethtool_eee *data);
599int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol); 646int phy_ethtool_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol);
600void phy_ethtool_get_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol); 647void phy_ethtool_get_wol(struct phy_device *phydev,
648 struct ethtool_wolinfo *wol);
601 649
602int __init mdio_bus_init(void); 650int __init mdio_bus_init(void);
603void mdio_bus_exit(void); 651void mdio_bus_exit(void);
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index 6d722695e027..e273e5ac19c9 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -38,6 +38,14 @@ struct phy_ops {
38}; 38};
39 39
40/** 40/**
41 * struct phy_attrs - represents phy attributes
42 * @bus_width: Data path width implemented by PHY
43 */
44struct phy_attrs {
45 u32 bus_width;
46};
47
48/**
41 * struct phy - represents the phy device 49 * struct phy - represents the phy device
42 * @dev: phy device 50 * @dev: phy device
43 * @id: id of the phy device 51 * @id: id of the phy device
@@ -46,6 +54,7 @@ struct phy_ops {
46 * @mutex: mutex to protect phy_ops 54 * @mutex: mutex to protect phy_ops
47 * @init_count: used to protect when the PHY is used by multiple consumers 55 * @init_count: used to protect when the PHY is used by multiple consumers
48 * @power_count: used to protect when the PHY is used by multiple consumers 56 * @power_count: used to protect when the PHY is used by multiple consumers
57 * @phy_attrs: used to specify PHY specific attributes
49 */ 58 */
50struct phy { 59struct phy {
51 struct device dev; 60 struct device dev;
@@ -55,6 +64,7 @@ struct phy {
55 struct mutex mutex; 64 struct mutex mutex;
56 int init_count; 65 int init_count;
57 int power_count; 66 int power_count;
67 struct phy_attrs attrs;
58}; 68};
59 69
60/** 70/**
@@ -127,6 +137,14 @@ int phy_init(struct phy *phy);
127int phy_exit(struct phy *phy); 137int phy_exit(struct phy *phy);
128int phy_power_on(struct phy *phy); 138int phy_power_on(struct phy *phy);
129int phy_power_off(struct phy *phy); 139int phy_power_off(struct phy *phy);
140static inline int phy_get_bus_width(struct phy *phy)
141{
142 return phy->attrs.bus_width;
143}
144static inline void phy_set_bus_width(struct phy *phy, int bus_width)
145{
146 phy->attrs.bus_width = bus_width;
147}
130struct phy *phy_get(struct device *dev, const char *string); 148struct phy *phy_get(struct device *dev, const char *string);
131struct phy *devm_phy_get(struct device *dev, const char *string); 149struct phy *devm_phy_get(struct device *dev, const char *string);
132void phy_put(struct phy *phy); 150void phy_put(struct phy *phy);
@@ -199,6 +217,16 @@ static inline int phy_power_off(struct phy *phy)
199 return -ENOSYS; 217 return -ENOSYS;
200} 218}
201 219
220static inline int phy_get_bus_width(struct phy *phy)
221{
222 return -ENOSYS;
223}
224
225static inline void phy_set_bus_width(struct phy *phy, int bus_width)
226{
227 return;
228}
229
202static inline struct phy *phy_get(struct device *dev, const char *string) 230static inline struct phy *phy_get(struct device *dev, const char *string)
203{ 231{
204 return ERR_PTR(-ENOSYS); 232 return ERR_PTR(-ENOSYS);
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index fb90ef5eb038..a15f10727eb8 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -61,6 +61,9 @@
61 * argument is ignored. 61 * argument is ignored.
62 * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current 62 * @PIN_CONFIG_DRIVE_STRENGTH: the pin will sink or source at most the current
63 * passed as argument. The argument is in mA. 63 * passed as argument. The argument is in mA.
64 * @PIN_CONFIG_INPUT_ENABLE: enable the pin's input. Note that this does not
65 * affect the pin's ability to drive output. 1 enables input, 0 disables
66 * input.
64 * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin. 67 * @PIN_CONFIG_INPUT_SCHMITT_ENABLE: control schmitt-trigger mode on the pin.
65 * If the argument != 0, schmitt-trigger mode is enabled. If it's 0, 68 * If the argument != 0, schmitt-trigger mode is enabled. If it's 0,
66 * schmitt-trigger mode is disabled. 69 * schmitt-trigger mode is disabled.
@@ -82,8 +85,10 @@
82 * operation, if several modes of operation are supported these can be 85 * operation, if several modes of operation are supported these can be
83 * passed in the argument on a custom form, else just use argument 1 86 * passed in the argument on a custom form, else just use argument 1
84 * to indicate low power mode, argument 0 turns low power mode off. 87 * to indicate low power mode, argument 0 turns low power mode off.
85 * @PIN_CONFIG_OUTPUT: this will configure the pin in output, use argument 88 * @PIN_CONFIG_OUTPUT: this will configure the pin as an output. Use argument
86 * 1 to indicate high level, argument 0 to indicate low level. 89 * 1 to indicate high level, argument 0 to indicate low level. (Please
90 * see Documentation/pinctrl.txt, section "GPIO mode pitfalls" for a
91 * discussion around this parameter.)
87 * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if 92 * @PIN_CONFIG_END: this is the last enumerator for pin configurations, if
88 * you need to pass in custom configurations to the pin controller, use 93 * you need to pass in custom configurations to the pin controller, use
89 * PIN_CONFIG_END+1 as the base offset. 94 * PIN_CONFIG_END+1 as the base offset.
@@ -99,6 +104,7 @@ enum pin_config_param {
99 PIN_CONFIG_DRIVE_OPEN_DRAIN, 104 PIN_CONFIG_DRIVE_OPEN_DRAIN,
100 PIN_CONFIG_DRIVE_OPEN_SOURCE, 105 PIN_CONFIG_DRIVE_OPEN_SOURCE,
101 PIN_CONFIG_DRIVE_STRENGTH, 106 PIN_CONFIG_DRIVE_STRENGTH,
107 PIN_CONFIG_INPUT_ENABLE,
102 PIN_CONFIG_INPUT_SCHMITT_ENABLE, 108 PIN_CONFIG_INPUT_SCHMITT_ENABLE,
103 PIN_CONFIG_INPUT_SCHMITT, 109 PIN_CONFIG_INPUT_SCHMITT,
104 PIN_CONFIG_INPUT_DEBOUNCE, 110 PIN_CONFIG_INPUT_DEBOUNCE,
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index fefb88663975..cc8e1aff0e28 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -32,10 +32,12 @@ struct device_node;
32 * pins, pads or other muxable units in this struct 32 * pins, pads or other muxable units in this struct
33 * @number: unique pin number from the global pin number space 33 * @number: unique pin number from the global pin number space
34 * @name: a name for this pin 34 * @name: a name for this pin
35 * @drv_data: driver-defined per-pin data. pinctrl core does not touch this
35 */ 36 */
36struct pinctrl_pin_desc { 37struct pinctrl_pin_desc {
37 unsigned number; 38 unsigned number;
38 const char *name; 39 const char *name;
40 void *drv_data;
39}; 41};
40 42
41/* Convenience macro to define a single named or anonymous pin descriptor */ 43/* Convenience macro to define a single named or anonymous pin descriptor */
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index b8809fef61f5..ab5752692113 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -157,6 +157,8 @@ int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
157int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); 157int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
158void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); 158void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
159 159
160extern const struct pipe_buf_operations nosteal_pipe_buf_ops;
161
160/* for F_SETPIPE_SZ and F_GETPIPE_SZ */ 162/* for F_SETPIPE_SZ and F_GETPIPE_SZ */
161long pipe_fcntl(struct file *, unsigned int, unsigned long arg); 163long pipe_fcntl(struct file *, unsigned int, unsigned long arg);
162struct pipe_inode_info *get_pipe_info(struct file *file); 164struct pipe_inode_info *get_pipe_info(struct file *file);
diff --git a/include/linux/platform_data/asoc-ti-mcbsp.h b/include/linux/platform_data/asoc-ti-mcbsp.h
index c78d90b28b19..3c73c045f8da 100644
--- a/include/linux/platform_data/asoc-ti-mcbsp.h
+++ b/include/linux/platform_data/asoc-ti-mcbsp.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/mcbsp.h
3 *
4 * Defines for Multi-Channel Buffered Serial Port 2 * Defines for Multi-Channel Buffered Serial Port
5 * 3 *
6 * Copyright (C) 2002 RidgeRun, Inc. 4 * Copyright (C) 2002 RidgeRun, Inc.
@@ -21,8 +19,8 @@
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 * 20 *
23 */ 21 */
24#ifndef __ASM_ARCH_OMAP_MCBSP_H 22#ifndef __ASOC_TI_MCBSP_H
25#define __ASM_ARCH_OMAP_MCBSP_H 23#define __ASOC_TI_MCBSP_H
26 24
27#include <linux/spinlock.h> 25#include <linux/spinlock.h>
28#include <linux/clk.h> 26#include <linux/clk.h>
diff --git a/include/linux/platform_data/asoc-ux500-msp.h b/include/linux/platform_data/asoc-ux500-msp.h
index 9991aea3d577..2f34bb98fe2a 100644
--- a/include/linux/platform_data/asoc-ux500-msp.h
+++ b/include/linux/platform_data/asoc-ux500-msp.h
@@ -10,16 +10,9 @@
10 10
11#include <linux/platform_data/dma-ste-dma40.h> 11#include <linux/platform_data/dma-ste-dma40.h>
12 12
13enum msp_i2s_id {
14 MSP_I2S_0 = 0,
15 MSP_I2S_1,
16 MSP_I2S_2,
17 MSP_I2S_3,
18};
19
20/* Platform data structure for a MSP I2S-device */ 13/* Platform data structure for a MSP I2S-device */
21struct msp_i2s_platform_data { 14struct msp_i2s_platform_data {
22 enum msp_i2s_id id; 15 int id;
23 struct stedma40_chan_cfg *msp_i2s_dma_rx; 16 struct stedma40_chan_cfg *msp_i2s_dma_rx;
24 struct stedma40_chan_cfg *msp_i2s_dma_tx; 17 struct stedma40_chan_cfg *msp_i2s_dma_tx;
25}; 18};
diff --git a/include/linux/platform_data/clocksource-nomadik-mtu.h b/include/linux/platform_data/clocksource-nomadik-mtu.h
deleted file mode 100644
index 80088973b734..000000000000
--- a/include/linux/platform_data/clocksource-nomadik-mtu.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef __PLAT_MTU_H
2#define __PLAT_MTU_H
3
4void nmdk_timer_init(void __iomem *base, int irq);
5void nmdk_clkevt_reset(void);
6void nmdk_clksrc_reset(void);
7
8#endif /* __PLAT_MTU_H */
9
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h
index 689a856b86f9..5245992b0367 100644
--- a/include/linux/platform_data/davinci_asp.h
+++ b/include/linux/platform_data/davinci_asp.h
@@ -92,6 +92,7 @@ enum {
92 MCASP_VERSION_1 = 0, /* DM646x */ 92 MCASP_VERSION_1 = 0, /* DM646x */
93 MCASP_VERSION_2, /* DA8xx/OMAPL1x */ 93 MCASP_VERSION_2, /* DA8xx/OMAPL1x */
94 MCASP_VERSION_3, /* TI81xx/AM33xx */ 94 MCASP_VERSION_3, /* TI81xx/AM33xx */
95 MCASP_VERSION_4, /* DRA7xxx */
95}; 96};
96 97
97enum mcbsp_clk_input_pin { 98enum mcbsp_clk_input_pin {
diff --git a/include/linux/platform_data/dma-imx-sdma.h b/include/linux/platform_data/dma-imx-sdma.h
index 3a3942823c20..eabac4e2fc99 100644
--- a/include/linux/platform_data/dma-imx-sdma.h
+++ b/include/linux/platform_data/dma-imx-sdma.h
@@ -43,6 +43,11 @@ struct sdma_script_start_addrs {
43 s32 dptc_dvfs_addr; 43 s32 dptc_dvfs_addr;
44 s32 utra_addr; 44 s32 utra_addr;
45 s32 ram_code_start_addr; 45 s32 ram_code_start_addr;
46 /* End of v1 array */
47 s32 mcu_2_ssish_addr;
48 s32 ssish_2_mcu_addr;
49 s32 hdmi_dma_addr;
50 /* End of v2 array */
46}; 51};
47 52
48/** 53/**
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h
index beac6b8b6a7b..bcbc6c3c14c0 100644
--- a/include/linux/platform_data/dma-imx.h
+++ b/include/linux/platform_data/dma-imx.h
@@ -39,6 +39,7 @@ enum sdma_peripheral_type {
39 IMX_DMATYPE_IPU_MEMORY, /* IPU Memory */ 39 IMX_DMATYPE_IPU_MEMORY, /* IPU Memory */
40 IMX_DMATYPE_ASRC, /* ASRC */ 40 IMX_DMATYPE_ASRC, /* ASRC */
41 IMX_DMATYPE_ESAI, /* ESAI */ 41 IMX_DMATYPE_ESAI, /* ESAI */
42 IMX_DMATYPE_SSI_DUAL, /* SSI Dual FIFO */
42}; 43};
43 44
44enum imx_dma_prio { 45enum imx_dma_prio {
diff --git a/include/linux/platform_data/dma-mmp_tdma.h b/include/linux/platform_data/dma-mmp_tdma.h
index 239e0fc1bb1f..66574ea39f97 100644
--- a/include/linux/platform_data/dma-mmp_tdma.h
+++ b/include/linux/platform_data/dma-mmp_tdma.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/arm/mach-mmp/include/mach/sram.h
3 *
4 * SRAM Memory Management 2 * SRAM Memory Management
5 * 3 *
6 * Copyright (c) 2011 Marvell Semiconductors Inc. 4 * Copyright (c) 2011 Marvell Semiconductors Inc.
@@ -11,8 +9,8 @@
11 * 9 *
12 */ 10 */
13 11
14#ifndef __ASM_ARCH_SRAM_H 12#ifndef __DMA_MMP_TDMA_H
15#define __ASM_ARCH_SRAM_H 13#define __DMA_MMP_TDMA_H
16 14
17#include <linux/genalloc.h> 15#include <linux/genalloc.h>
18 16
@@ -32,4 +30,4 @@ struct sram_platdata {
32 30
33extern struct gen_pool *sram_get_gpool(char *pool_name); 31extern struct gen_pool *sram_get_gpool(char *pool_name);
34 32
35#endif /* __ASM_ARCH_SRAM_H */ 33#endif /* __DMA_MMP_TDMA_H */
diff --git a/include/linux/platform_data/dma-mv_xor.h b/include/linux/platform_data/dma-mv_xor.h
index 8ec18f64e396..92ffd3245f76 100644
--- a/include/linux/platform_data/dma-mv_xor.h
+++ b/include/linux/platform_data/dma-mv_xor.h
@@ -1,11 +1,9 @@
1/* 1/*
2 * arch/arm/plat-orion/include/plat/mv_xor.h
3 *
4 * Marvell XOR platform device data definition file. 2 * Marvell XOR platform device data definition file.
5 */ 3 */
6 4
7#ifndef __PLAT_MV_XOR_H 5#ifndef __DMA_MV_XOR_H
8#define __PLAT_MV_XOR_H 6#define __DMA_MV_XOR_H
9 7
10#include <linux/dmaengine.h> 8#include <linux/dmaengine.h>
11#include <linux/mbus.h> 9#include <linux/mbus.h>
diff --git a/include/linux/platform_data/eth-netx.h b/include/linux/platform_data/eth-netx.h
index 88af1ac28ead..a395159725d5 100644
--- a/include/linux/platform_data/eth-netx.h
+++ b/include/linux/platform_data/eth-netx.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-netx/include/mach/eth.h
3 *
4 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix 2 * Copyright (c) 2005 Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
@@ -17,8 +15,8 @@
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 16 */
19 17
20#ifndef ASMARM_ARCH_ETH_H 18#ifndef __ETH_NETX_H
21#define ASMARM_ARCH_ETH_H 19#define __ETH_NETX_H
22 20
23struct netxeth_platform_data { 21struct netxeth_platform_data {
24 unsigned int xcno; /* number of xmac/xpec engine this eth uses */ 22 unsigned int xcno; /* number of xmac/xpec engine this eth uses */
diff --git a/include/linux/platform_data/gpio-davinci.h b/include/linux/platform_data/gpio-davinci.h
index 6efd20264585..fbe2f7535741 100644
--- a/include/linux/platform_data/gpio-davinci.h
+++ b/include/linux/platform_data/gpio-davinci.h
@@ -28,13 +28,12 @@ enum davinci_gpio_type {
28struct davinci_gpio_platform_data { 28struct davinci_gpio_platform_data {
29 u32 ngpio; 29 u32 ngpio;
30 u32 gpio_unbanked; 30 u32 gpio_unbanked;
31 u32 intc_irq_num;
32}; 31};
33 32
34 33
35struct davinci_gpio_controller { 34struct davinci_gpio_controller {
36 struct gpio_chip chip; 35 struct gpio_chip chip;
37 int irq_base; 36 struct irq_domain *irq_domain;
38 /* Serialize access to GPIO registers */ 37 /* Serialize access to GPIO registers */
39 spinlock_t lock; 38 spinlock_t lock;
40 void __iomem *regs; 39 void __iomem *regs;
diff --git a/include/linux/platform_data/gpio-lpc32xx.h b/include/linux/platform_data/gpio-lpc32xx.h
new file mode 100644
index 000000000000..a544e962a818
--- /dev/null
+++ b/include/linux/platform_data/gpio-lpc32xx.h
@@ -0,0 +1,50 @@
1/*
2 * Author: Kevin Wells <kevin.wells@nxp.com>
3 *
4 * Copyright (C) 2010 NXP Semiconductors
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __MACH_GPIO_LPC32XX_H
18#define __MACH_GPIO_LPC32XX_H
19
20/*
21 * Note!
22 * Muxed GP pins need to be setup to the GP state in the board level
23 * code prior to using this driver.
24 * GPI pins : 28xP3 group
25 * GPO pins : 24xP3 group
26 * GPIO pins: 8xP0 group, 24xP1 group, 13xP2 group, 6xP3 group
27 */
28
29#define LPC32XX_GPIO_P0_MAX 8
30#define LPC32XX_GPIO_P1_MAX 24
31#define LPC32XX_GPIO_P2_MAX 13
32#define LPC32XX_GPIO_P3_MAX 6
33#define LPC32XX_GPI_P3_MAX 29
34#define LPC32XX_GPO_P3_MAX 24
35
36#define LPC32XX_GPIO_P0_GRP 0
37#define LPC32XX_GPIO_P1_GRP (LPC32XX_GPIO_P0_GRP + LPC32XX_GPIO_P0_MAX)
38#define LPC32XX_GPIO_P2_GRP (LPC32XX_GPIO_P1_GRP + LPC32XX_GPIO_P1_MAX)
39#define LPC32XX_GPIO_P3_GRP (LPC32XX_GPIO_P2_GRP + LPC32XX_GPIO_P2_MAX)
40#define LPC32XX_GPI_P3_GRP (LPC32XX_GPIO_P3_GRP + LPC32XX_GPIO_P3_MAX)
41#define LPC32XX_GPO_P3_GRP (LPC32XX_GPI_P3_GRP + LPC32XX_GPI_P3_MAX)
42
43/*
44 * A specific GPIO can be selected with this macro
45 * ie, GPIO_05 can be selected with LPC32XX_GPIO(LPC32XX_GPIO_P3_GRP, 5)
46 * See the LPC32x0 User's guide for GPIO group numbers
47 */
48#define LPC32XX_GPIO(x, y) ((x) + (y))
49
50#endif /* __MACH_GPIO_LPC32XX_H */
diff --git a/include/linux/platform_data/i2c-nomadik.h b/include/linux/platform_data/i2c-nomadik.h
deleted file mode 100644
index 3a8be9cdc95c..000000000000
--- a/include/linux/platform_data/i2c-nomadik.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
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 __PDATA_I2C_NOMADIK_H
9#define __PDATA_I2C_NOMADIK_H
10
11enum i2c_freq_mode {
12 I2C_FREQ_MODE_STANDARD, /* up to 100 Kb/s */
13 I2C_FREQ_MODE_FAST, /* up to 400 Kb/s */
14 I2C_FREQ_MODE_HIGH_SPEED, /* up to 3.4 Mb/s */
15 I2C_FREQ_MODE_FAST_PLUS, /* up to 1 Mb/s */
16};
17
18/**
19 * struct nmk_i2c_controller - client specific controller configuration
20 * @clk_freq: clock frequency for the operation mode
21 * @slsu: Slave data setup time in ns.
22 * The needed setup time for three modes of operation
23 * are 250ns, 100ns and 10ns respectively thus leading
24 * to the values of 14, 6, 2 for a 48 MHz i2c clk
25 * @tft: Tx FIFO Threshold in bytes
26 * @rft: Rx FIFO Threshold in bytes
27 * @timeout Slave response timeout(ms)
28 * @sm: speed mode
29 */
30struct nmk_i2c_controller {
31 u32 clk_freq;
32 unsigned short slsu;
33 unsigned char tft;
34 unsigned char rft;
35 int timeout;
36 enum i2c_freq_mode sm;
37};
38
39#endif /* __PDATA_I2C_NOMADIK_H */
diff --git a/include/linux/platform_data/keypad-ep93xx.h b/include/linux/platform_data/keypad-ep93xx.h
index 1e2f4e97f428..adccee25b162 100644
--- a/include/linux/platform_data/keypad-ep93xx.h
+++ b/include/linux/platform_data/keypad-ep93xx.h
@@ -1,9 +1,5 @@
1/* 1#ifndef __KEYPAD_EP93XX_H
2 * arch/arm/mach-ep93xx/include/mach/ep93xx_keypad.h 2#define __KEYPAD_EP93XX_H
3 */
4
5#ifndef __ASM_ARCH_EP93XX_KEYPAD_H
6#define __ASM_ARCH_EP93XX_KEYPAD_H
7 3
8struct matrix_keymap_data; 4struct matrix_keymap_data;
9 5
@@ -32,4 +28,4 @@ struct ep93xx_keypad_platform_data {
32#define EP93XX_MATRIX_ROWS (8) 28#define EP93XX_MATRIX_ROWS (8)
33#define EP93XX_MATRIX_COLS (8) 29#define EP93XX_MATRIX_COLS (8)
34 30
35#endif /* __ASM_ARCH_EP93XX_KEYPAD_H */ 31#endif /* __KEYPAD_EP93XX_H */
diff --git a/include/linux/platform_data/keypad-omap.h b/include/linux/platform_data/keypad-omap.h
index a6b21eddb212..c3a3abae98f0 100644
--- a/include/linux/platform_data/keypad-omap.h
+++ b/include/linux/platform_data/keypad-omap.h
@@ -1,14 +1,12 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/keypad.h
3 *
4 * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com> 2 * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com>
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
9 */ 7 */
10#ifndef ASMARM_ARCH_KEYPAD_H 8#ifndef __KEYPAD_OMAP_H
11#define ASMARM_ARCH_KEYPAD_H 9#define __KEYPAD_OMAP_H
12 10
13#ifndef CONFIG_ARCH_OMAP1 11#ifndef CONFIG_ARCH_OMAP1
14#warning Please update the board to use matrix-keypad driver 12#warning Please update the board to use matrix-keypad driver
diff --git a/include/linux/platform_data/leds-kirkwood-netxbig.h b/include/linux/platform_data/leds-kirkwood-netxbig.h
index 24b536ebdf13..d2be19a51acd 100644
--- a/include/linux/platform_data/leds-kirkwood-netxbig.h
+++ b/include/linux/platform_data/leds-kirkwood-netxbig.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-kirkwood/include/mach/leds-netxbig.h
3 *
4 * Platform data structure for netxbig LED driver 2 * Platform data structure for netxbig LED driver
5 * 3 *
6 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
@@ -8,8 +6,8 @@
8 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
9 */ 7 */
10 8
11#ifndef __MACH_LEDS_NETXBIG_H 9#ifndef __LEDS_KIRKWOOD_NETXBIG_H
12#define __MACH_LEDS_NETXBIG_H 10#define __LEDS_KIRKWOOD_NETXBIG_H
13 11
14struct netxbig_gpio_ext { 12struct netxbig_gpio_ext {
15 unsigned *addr; 13 unsigned *addr;
@@ -52,4 +50,4 @@ struct netxbig_led_platform_data {
52 int num_leds; 50 int num_leds;
53}; 51};
54 52
55#endif /* __MACH_LEDS_NETXBIG_H */ 53#endif /* __LEDS_KIRKWOOD_NETXBIG_H */
diff --git a/include/linux/platform_data/leds-kirkwood-ns2.h b/include/linux/platform_data/leds-kirkwood-ns2.h
index e21272e5f668..6a9fed57f346 100644
--- a/include/linux/platform_data/leds-kirkwood-ns2.h
+++ b/include/linux/platform_data/leds-kirkwood-ns2.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-kirkwood/include/mach/leds-ns2.h
3 *
4 * Platform data structure for Network Space v2 LED driver 2 * Platform data structure for Network Space v2 LED driver
5 * 3 *
6 * This file is licensed under the terms of the GNU General Public 4 * This file is licensed under the terms of the GNU General Public
@@ -8,8 +6,8 @@
8 * warranty of any kind, whether express or implied. 6 * warranty of any kind, whether express or implied.
9 */ 7 */
10 8
11#ifndef __MACH_LEDS_NS2_H 9#ifndef __LEDS_KIRKWOOD_NS2_H
12#define __MACH_LEDS_NS2_H 10#define __LEDS_KIRKWOOD_NS2_H
13 11
14struct ns2_led { 12struct ns2_led {
15 const char *name; 13 const char *name;
@@ -23,4 +21,4 @@ struct ns2_led_platform_data {
23 struct ns2_led *leds; 21 struct ns2_led *leds;
24}; 22};
25 23
26#endif /* __MACH_LEDS_NS2_H */ 24#endif /* __LEDS_KIRKWOOD_NS2_H */
diff --git a/include/linux/platform_data/mfd-mcp-sa11x0.h b/include/linux/platform_data/mfd-mcp-sa11x0.h
index 4b2860ae3828..747cd6baf711 100644
--- a/include/linux/platform_data/mfd-mcp-sa11x0.h
+++ b/include/linux/platform_data/mfd-mcp-sa11x0.h
@@ -1,14 +1,12 @@
1/* 1/*
2 * arch/arm/mach-sa1100/include/mach/mcp.h
3 *
4 * Copyright (C) 2005 Russell King. 2 * Copyright (C) 2005 Russell King.
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 5 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation. 6 * published by the Free Software Foundation.
9 */ 7 */
10#ifndef __ASM_ARM_ARCH_MCP_H 8#ifndef __MFD_MCP_SA11X0_H
11#define __ASM_ARM_ARCH_MCP_H 9#define __MFD_MCP_SA11X0_H
12 10
13#include <linux/types.h> 11#include <linux/types.h>
14 12
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
index 4da5bfa2147f..3e9dd6676b97 100644
--- a/include/linux/platform_data/mtd-nand-omap2.h
+++ b/include/linux/platform_data/mtd-nand-omap2.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/nand.h
3 *
4 * Copyright (C) 2006 Micron Technology Inc. 2 * Copyright (C) 2006 Micron Technology Inc.
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
diff --git a/include/linux/platform_data/mtd-nand-pxa3xx.h b/include/linux/platform_data/mtd-nand-pxa3xx.h
index ffb801998e5d..a94147124929 100644
--- a/include/linux/platform_data/mtd-nand-pxa3xx.h
+++ b/include/linux/platform_data/mtd-nand-pxa3xx.h
@@ -55,6 +55,9 @@ struct pxa3xx_nand_platform_data {
55 /* indicate how many chip selects will be used */ 55 /* indicate how many chip selects will be used */
56 int num_cs; 56 int num_cs;
57 57
58 /* use an flash-based bad block table */
59 bool flash_bbt;
60
58 const struct mtd_partition *parts[NUM_CHIP_SELECT]; 61 const struct mtd_partition *parts[NUM_CHIP_SELECT];
59 unsigned int nr_parts[NUM_CHIP_SELECT]; 62 unsigned int nr_parts[NUM_CHIP_SELECT];
60 63
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h
index e9a9fb188f97..56ff0e6f5ad1 100644
--- a/include/linux/platform_data/mtd-onenand-omap2.h
+++ b/include/linux/platform_data/mtd-onenand-omap2.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/plat-omap/include/mach/onenand.h
3 *
4 * Copyright (C) 2006 Nokia Corporation 2 * Copyright (C) 2006 Nokia Corporation
5 * Author: Juha Yrjola 3 * Author: Juha Yrjola
6 * 4 *
diff --git a/include/linux/platform_data/mtd-orion_nand.h b/include/linux/platform_data/mtd-orion_nand.h
index 9f3c180834d1..a7ce77c7c1a8 100644
--- a/include/linux/platform_data/mtd-orion_nand.h
+++ b/include/linux/platform_data/mtd-orion_nand.h
@@ -1,13 +1,11 @@
1/* 1/*
2 * arch/arm/plat-orion/include/plat/orion_nand.h
3 *
4 * This file is licensed under the terms of the GNU General Public 2 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any 3 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied. 4 * warranty of any kind, whether express or implied.
7 */ 5 */
8 6
9#ifndef __PLAT_ORION_NAND_H 7#ifndef __MTD_ORION_NAND_H
10#define __PLAT_ORION_NAND_H 8#define __MTD_ORION_NAND_H
11 9
12/* 10/*
13 * Device bus NAND private data 11 * Device bus NAND private data
diff --git a/include/linux/platform_data/pinctrl-nomadik.h b/include/linux/platform_data/pinctrl-nomadik.h
deleted file mode 100644
index abf5bed84df3..000000000000
--- a/include/linux/platform_data/pinctrl-nomadik.h
+++ /dev/null
@@ -1,242 +0,0 @@
1/*
2 * Structures and registers for GPIO access in the Nomadik SoC
3 *
4 * Copyright (C) 2008 STMicroelectronics
5 * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com>
6 * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
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 __PLAT_NOMADIK_GPIO
14#define __PLAT_NOMADIK_GPIO
15
16/*
17 * pin configurations are represented by 32-bit integers:
18 *
19 * bit 0.. 8 - Pin Number (512 Pins Maximum)
20 * bit 9..10 - Alternate Function Selection
21 * bit 11..12 - Pull up/down state
22 * bit 13 - Sleep mode behaviour
23 * bit 14 - Direction
24 * bit 15 - Value (if output)
25 * bit 16..18 - SLPM pull up/down state
26 * bit 19..20 - SLPM direction
27 * bit 21..22 - SLPM Value (if output)
28 * bit 23..25 - PDIS value (if input)
29 * bit 26 - Gpio mode
30 * bit 27 - Sleep mode
31 *
32 * to facilitate the definition, the following macros are provided
33 *
34 * PIN_CFG_DEFAULT - default config (0):
35 * pull up/down = disabled
36 * sleep mode = input/wakeup
37 * direction = input
38 * value = low
39 * SLPM direction = same as normal
40 * SLPM pull = same as normal
41 * SLPM value = same as normal
42 *
43 * PIN_CFG - default config with alternate function
44 */
45
46typedef unsigned long pin_cfg_t;
47
48#define PIN_NUM_MASK 0x1ff
49#define PIN_NUM(x) ((x) & PIN_NUM_MASK)
50
51#define PIN_ALT_SHIFT 9
52#define PIN_ALT_MASK (0x3 << PIN_ALT_SHIFT)
53#define PIN_ALT(x) (((x) & PIN_ALT_MASK) >> PIN_ALT_SHIFT)
54#define PIN_GPIO (NMK_GPIO_ALT_GPIO << PIN_ALT_SHIFT)
55#define PIN_ALT_A (NMK_GPIO_ALT_A << PIN_ALT_SHIFT)
56#define PIN_ALT_B (NMK_GPIO_ALT_B << PIN_ALT_SHIFT)
57#define PIN_ALT_C (NMK_GPIO_ALT_C << PIN_ALT_SHIFT)
58
59#define PIN_PULL_SHIFT 11
60#define PIN_PULL_MASK (0x3 << PIN_PULL_SHIFT)
61#define PIN_PULL(x) (((x) & PIN_PULL_MASK) >> PIN_PULL_SHIFT)
62#define PIN_PULL_NONE (NMK_GPIO_PULL_NONE << PIN_PULL_SHIFT)
63#define PIN_PULL_UP (NMK_GPIO_PULL_UP << PIN_PULL_SHIFT)
64#define PIN_PULL_DOWN (NMK_GPIO_PULL_DOWN << PIN_PULL_SHIFT)
65
66#define PIN_SLPM_SHIFT 13
67#define PIN_SLPM_MASK (0x1 << PIN_SLPM_SHIFT)
68#define PIN_SLPM(x) (((x) & PIN_SLPM_MASK) >> PIN_SLPM_SHIFT)
69#define PIN_SLPM_MAKE_INPUT (NMK_GPIO_SLPM_INPUT << PIN_SLPM_SHIFT)
70#define PIN_SLPM_NOCHANGE (NMK_GPIO_SLPM_NOCHANGE << PIN_SLPM_SHIFT)
71/* These two replace the above in DB8500v2+ */
72#define PIN_SLPM_WAKEUP_ENABLE (NMK_GPIO_SLPM_WAKEUP_ENABLE << PIN_SLPM_SHIFT)
73#define PIN_SLPM_WAKEUP_DISABLE (NMK_GPIO_SLPM_WAKEUP_DISABLE << PIN_SLPM_SHIFT)
74#define PIN_SLPM_USE_MUX_SETTINGS_IN_SLEEP PIN_SLPM_WAKEUP_DISABLE
75
76#define PIN_SLPM_GPIO PIN_SLPM_WAKEUP_ENABLE /* In SLPM, pin is a gpio */
77#define PIN_SLPM_ALTFUNC PIN_SLPM_WAKEUP_DISABLE /* In SLPM, pin is altfunc */
78
79#define PIN_DIR_SHIFT 14
80#define PIN_DIR_MASK (0x1 << PIN_DIR_SHIFT)
81#define PIN_DIR(x) (((x) & PIN_DIR_MASK) >> PIN_DIR_SHIFT)
82#define PIN_DIR_INPUT (0 << PIN_DIR_SHIFT)
83#define PIN_DIR_OUTPUT (1 << PIN_DIR_SHIFT)
84
85#define PIN_VAL_SHIFT 15
86#define PIN_VAL_MASK (0x1 << PIN_VAL_SHIFT)
87#define PIN_VAL(x) (((x) & PIN_VAL_MASK) >> PIN_VAL_SHIFT)
88#define PIN_VAL_LOW (0 << PIN_VAL_SHIFT)
89#define PIN_VAL_HIGH (1 << PIN_VAL_SHIFT)
90
91#define PIN_SLPM_PULL_SHIFT 16
92#define PIN_SLPM_PULL_MASK (0x7 << PIN_SLPM_PULL_SHIFT)
93#define PIN_SLPM_PULL(x) \
94 (((x) & PIN_SLPM_PULL_MASK) >> PIN_SLPM_PULL_SHIFT)
95#define PIN_SLPM_PULL_NONE \
96 ((1 + NMK_GPIO_PULL_NONE) << PIN_SLPM_PULL_SHIFT)
97#define PIN_SLPM_PULL_UP \
98 ((1 + NMK_GPIO_PULL_UP) << PIN_SLPM_PULL_SHIFT)
99#define PIN_SLPM_PULL_DOWN \
100 ((1 + NMK_GPIO_PULL_DOWN) << PIN_SLPM_PULL_SHIFT)
101
102#define PIN_SLPM_DIR_SHIFT 19
103#define PIN_SLPM_DIR_MASK (0x3 << PIN_SLPM_DIR_SHIFT)
104#define PIN_SLPM_DIR(x) \
105 (((x) & PIN_SLPM_DIR_MASK) >> PIN_SLPM_DIR_SHIFT)
106#define PIN_SLPM_DIR_INPUT ((1 + 0) << PIN_SLPM_DIR_SHIFT)
107#define PIN_SLPM_DIR_OUTPUT ((1 + 1) << PIN_SLPM_DIR_SHIFT)
108
109#define PIN_SLPM_VAL_SHIFT 21
110#define PIN_SLPM_VAL_MASK (0x3 << PIN_SLPM_VAL_SHIFT)
111#define PIN_SLPM_VAL(x) \
112 (((x) & PIN_SLPM_VAL_MASK) >> PIN_SLPM_VAL_SHIFT)
113#define PIN_SLPM_VAL_LOW ((1 + 0) << PIN_SLPM_VAL_SHIFT)
114#define PIN_SLPM_VAL_HIGH ((1 + 1) << PIN_SLPM_VAL_SHIFT)
115
116#define PIN_SLPM_PDIS_SHIFT 23
117#define PIN_SLPM_PDIS_MASK (0x3 << PIN_SLPM_PDIS_SHIFT)
118#define PIN_SLPM_PDIS(x) \
119 (((x) & PIN_SLPM_PDIS_MASK) >> PIN_SLPM_PDIS_SHIFT)
120#define PIN_SLPM_PDIS_NO_CHANGE (0 << PIN_SLPM_PDIS_SHIFT)
121#define PIN_SLPM_PDIS_DISABLED (1 << PIN_SLPM_PDIS_SHIFT)
122#define PIN_SLPM_PDIS_ENABLED (2 << PIN_SLPM_PDIS_SHIFT)
123
124#define PIN_LOWEMI_SHIFT 25
125#define PIN_LOWEMI_MASK (0x1 << PIN_LOWEMI_SHIFT)
126#define PIN_LOWEMI(x) (((x) & PIN_LOWEMI_MASK) >> PIN_LOWEMI_SHIFT)
127#define PIN_LOWEMI_DISABLED (0 << PIN_LOWEMI_SHIFT)
128#define PIN_LOWEMI_ENABLED (1 << PIN_LOWEMI_SHIFT)
129
130#define PIN_GPIOMODE_SHIFT 26
131#define PIN_GPIOMODE_MASK (0x1 << PIN_GPIOMODE_SHIFT)
132#define PIN_GPIOMODE(x) (((x) & PIN_GPIOMODE_MASK) >> PIN_GPIOMODE_SHIFT)
133#define PIN_GPIOMODE_DISABLED (0 << PIN_GPIOMODE_SHIFT)
134#define PIN_GPIOMODE_ENABLED (1 << PIN_GPIOMODE_SHIFT)
135
136#define PIN_SLEEPMODE_SHIFT 27
137#define PIN_SLEEPMODE_MASK (0x1 << PIN_SLEEPMODE_SHIFT)
138#define PIN_SLEEPMODE(x) (((x) & PIN_SLEEPMODE_MASK) >> PIN_SLEEPMODE_SHIFT)
139#define PIN_SLEEPMODE_DISABLED (0 << PIN_SLEEPMODE_SHIFT)
140#define PIN_SLEEPMODE_ENABLED (1 << PIN_SLEEPMODE_SHIFT)
141
142
143/* Shortcuts. Use these instead of separate DIR, PULL, and VAL. */
144#define PIN_INPUT_PULLDOWN (PIN_DIR_INPUT | PIN_PULL_DOWN)
145#define PIN_INPUT_PULLUP (PIN_DIR_INPUT | PIN_PULL_UP)
146#define PIN_INPUT_NOPULL (PIN_DIR_INPUT | PIN_PULL_NONE)
147#define PIN_OUTPUT_LOW (PIN_DIR_OUTPUT | PIN_VAL_LOW)
148#define PIN_OUTPUT_HIGH (PIN_DIR_OUTPUT | PIN_VAL_HIGH)
149
150#define PIN_SLPM_INPUT_PULLDOWN (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_DOWN)
151#define PIN_SLPM_INPUT_PULLUP (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_UP)
152#define PIN_SLPM_INPUT_NOPULL (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_NONE)
153#define PIN_SLPM_OUTPUT_LOW (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_LOW)
154#define PIN_SLPM_OUTPUT_HIGH (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_HIGH)
155
156#define PIN_CFG_DEFAULT (0)
157
158#define PIN_CFG(num, alt) \
159 (PIN_CFG_DEFAULT |\
160 (PIN_NUM(num) | PIN_##alt))
161
162#define PIN_CFG_INPUT(num, alt, pull) \
163 (PIN_CFG_DEFAULT |\
164 (PIN_NUM(num) | PIN_##alt | PIN_INPUT_##pull))
165
166#define PIN_CFG_OUTPUT(num, alt, val) \
167 (PIN_CFG_DEFAULT |\
168 (PIN_NUM(num) | PIN_##alt | PIN_OUTPUT_##val))
169
170/*
171 * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving
172 * the "gpio" namespace for generic and cross-machine functions
173 */
174
175#define GPIO_BLOCK_SHIFT 5
176#define NMK_GPIO_PER_CHIP (1 << GPIO_BLOCK_SHIFT)
177
178/* Register in the logic block */
179#define NMK_GPIO_DAT 0x00
180#define NMK_GPIO_DATS 0x04
181#define NMK_GPIO_DATC 0x08
182#define NMK_GPIO_PDIS 0x0c
183#define NMK_GPIO_DIR 0x10
184#define NMK_GPIO_DIRS 0x14
185#define NMK_GPIO_DIRC 0x18
186#define NMK_GPIO_SLPC 0x1c
187#define NMK_GPIO_AFSLA 0x20
188#define NMK_GPIO_AFSLB 0x24
189#define NMK_GPIO_LOWEMI 0x28
190
191#define NMK_GPIO_RIMSC 0x40
192#define NMK_GPIO_FIMSC 0x44
193#define NMK_GPIO_IS 0x48
194#define NMK_GPIO_IC 0x4c
195#define NMK_GPIO_RWIMSC 0x50
196#define NMK_GPIO_FWIMSC 0x54
197#define NMK_GPIO_WKS 0x58
198/* These appear in DB8540 and later ASICs */
199#define NMK_GPIO_EDGELEVEL 0x5C
200#define NMK_GPIO_LEVEL 0x60
201
202/* Alternate functions: function C is set in hw by setting both A and B */
203#define NMK_GPIO_ALT_GPIO 0
204#define NMK_GPIO_ALT_A 1
205#define NMK_GPIO_ALT_B 2
206#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B)
207
208#define NMK_GPIO_ALT_CX_SHIFT 2
209#define NMK_GPIO_ALT_C1 ((1<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
210#define NMK_GPIO_ALT_C2 ((2<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
211#define NMK_GPIO_ALT_C3 ((3<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
212#define NMK_GPIO_ALT_C4 ((4<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
213
214/* Pull up/down values */
215enum nmk_gpio_pull {
216 NMK_GPIO_PULL_NONE,
217 NMK_GPIO_PULL_UP,
218 NMK_GPIO_PULL_DOWN,
219};
220
221/* Sleep mode */
222enum nmk_gpio_slpm {
223 NMK_GPIO_SLPM_INPUT,
224 NMK_GPIO_SLPM_WAKEUP_ENABLE = NMK_GPIO_SLPM_INPUT,
225 NMK_GPIO_SLPM_NOCHANGE,
226 NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE,
227};
228
229/*
230 * Platform data to register a block: only the initial gpio/irq number.
231 */
232struct nmk_gpio_platform_data {
233 char *name;
234 int first_gpio;
235 int first_irq;
236 int num_gpio;
237 u32 (*get_secondary_status)(unsigned int bank);
238 void (*set_ioforce)(bool enable);
239 bool supports_sleepmode;
240};
241
242#endif /* __PLAT_NOMADIK_GPIO */
diff --git a/include/linux/platform_data/pn544.h b/include/linux/platform_data/pn544.h
index 713bfd703342..5ce1ab983f44 100644
--- a/include/linux/platform_data/pn544.h
+++ b/include/linux/platform_data/pn544.h
@@ -16,8 +16,7 @@
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 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 19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 20 */
22 21
23#ifndef _PN544_H_ 22#ifndef _PN544_H_
diff --git a/include/linux/platform_data/si5351.h b/include/linux/platform_data/si5351.h
index 54334393ab92..a947ab8b441a 100644
--- a/include/linux/platform_data/si5351.h
+++ b/include/linux/platform_data/si5351.h
@@ -8,20 +8,6 @@
8struct clk; 8struct clk;
9 9
10/** 10/**
11 * enum si5351_variant - SiLabs Si5351 chip variant
12 * @SI5351_VARIANT_A: Si5351A (8 output clocks, XTAL input)
13 * @SI5351_VARIANT_A3: Si5351A MSOP10 (3 output clocks, XTAL input)
14 * @SI5351_VARIANT_B: Si5351B (8 output clocks, XTAL/VXCO input)
15 * @SI5351_VARIANT_C: Si5351C (8 output clocks, XTAL/CLKIN input)
16 */
17enum si5351_variant {
18 SI5351_VARIANT_A = 1,
19 SI5351_VARIANT_A3 = 2,
20 SI5351_VARIANT_B = 3,
21 SI5351_VARIANT_C = 4,
22};
23
24/**
25 * enum si5351_pll_src - Si5351 pll clock source 11 * enum si5351_pll_src - Si5351 pll clock source
26 * @SI5351_PLL_SRC_DEFAULT: default, do not change eeprom config 12 * @SI5351_PLL_SRC_DEFAULT: default, do not change eeprom config
27 * @SI5351_PLL_SRC_XTAL: pll source clock is XTAL input 13 * @SI5351_PLL_SRC_XTAL: pll source clock is XTAL input
@@ -115,14 +101,12 @@ struct si5351_clkout_config {
115 101
116/** 102/**
117 * struct si5351_platform_data - Platform data for the Si5351 clock driver 103 * struct si5351_platform_data - Platform data for the Si5351 clock driver
118 * @variant: Si5351 chip variant
119 * @clk_xtal: xtal input clock 104 * @clk_xtal: xtal input clock
120 * @clk_clkin: clkin input clock 105 * @clk_clkin: clkin input clock
121 * @pll_src: array of pll source clock setting 106 * @pll_src: array of pll source clock setting
122 * @clkout: array of clkout configuration 107 * @clkout: array of clkout configuration
123 */ 108 */
124struct si5351_platform_data { 109struct si5351_platform_data {
125 enum si5351_variant variant;
126 struct clk *clk_xtal; 110 struct clk *clk_xtal;
127 struct clk *clk_clkin; 111 struct clk *clk_clkin;
128 enum si5351_pll_src pll_src[2]; 112 enum si5351_pll_src pll_src[2];
diff --git a/include/linux/platform_data/spi-nuc900.h b/include/linux/platform_data/spi-nuc900.h
index 2c4e0c128501..4b3f46832e19 100644
--- a/include/linux/platform_data/spi-nuc900.h
+++ b/include/linux/platform_data/spi-nuc900.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-w90x900/include/mach/nuc900_spi.h
3 *
4 * Copyright (c) 2009 Nuvoton technology corporation. 2 * Copyright (c) 2009 Nuvoton technology corporation.
5 * 3 *
6 * Wan ZongShun <mcuos.com@gmail.com> 4 * Wan ZongShun <mcuos.com@gmail.com>
@@ -11,8 +9,8 @@
11 * 9 *
12 */ 10 */
13 11
14#ifndef __ASM_ARCH_SPI_H 12#ifndef __SPI_NUC900_H
15#define __ASM_ARCH_SPI_H 13#define __SPI_NUC900_H
16 14
17extern void mfp_set_groupg(struct device *dev, const char *subname); 15extern void mfp_set_groupg(struct device *dev, const char *subname);
18 16
@@ -32,4 +30,4 @@ struct nuc900_spi_chip {
32 unsigned char bits_per_word; 30 unsigned char bits_per_word;
33}; 31};
34 32
35#endif /* __ASM_ARCH_SPI_H */ 33#endif /* __SPI_NUC900_H */
diff --git a/include/linux/platform_data/usb-ehci-orion.h b/include/linux/platform_data/usb-ehci-orion.h
index 6fc78e430420..52b0acb35fd7 100644
--- a/include/linux/platform_data/usb-ehci-orion.h
+++ b/include/linux/platform_data/usb-ehci-orion.h
@@ -1,13 +1,11 @@
1/* 1/*
2 * arch/arm/plat-orion/include/plat/ehci-orion.h
3 *
4 * This file is licensed under the terms of the GNU General Public 2 * This file is licensed under the terms of the GNU General Public
5 * License version 2. This program is licensed "as is" without any 3 * License version 2. This program is licensed "as is" without any
6 * warranty of any kind, whether express or implied. 4 * warranty of any kind, whether express or implied.
7 */ 5 */
8 6
9#ifndef __PLAT_EHCI_ORION_H 7#ifndef __USB_EHCI_ORION_H
10#define __PLAT_EHCI_ORION_H 8#define __USB_EHCI_ORION_H
11 9
12#include <linux/mbus.h> 10#include <linux/mbus.h>
13 11
diff --git a/include/linux/platform_data/usb-omap1.h b/include/linux/platform_data/usb-omap1.h
new file mode 100644
index 000000000000..43b5ce139c37
--- /dev/null
+++ b/include/linux/platform_data/usb-omap1.h
@@ -0,0 +1,53 @@
1/*
2 * Platform data for OMAP1 USB
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file "COPYING" in the main directory of this archive for
6 * more details.
7 */
8#ifndef __LINUX_USB_OMAP1_H
9#define __LINUX_USB_OMAP1_H
10
11#include <linux/platform_device.h>
12
13struct omap_usb_config {
14 /* Configure drivers according to the connectors on your board:
15 * - "A" connector (rectagular)
16 * ... for host/OHCI use, set "register_host".
17 * - "B" connector (squarish) or "Mini-B"
18 * ... for device/gadget use, set "register_dev".
19 * - "Mini-AB" connector (very similar to Mini-B)
20 * ... for OTG use as device OR host, initialize "otg"
21 */
22 unsigned register_host:1;
23 unsigned register_dev:1;
24 u8 otg; /* port number, 1-based: usb1 == 2 */
25
26 const char *extcon; /* extcon device for OTG */
27
28 u8 hmc_mode;
29
30 /* implicitly true if otg: host supports remote wakeup? */
31 u8 rwc;
32
33 /* signaling pins used to talk to transceiver on usbN:
34 * 0 == usbN unused
35 * 2 == usb0-only, using internal transceiver
36 * 3 == 3 wire bidirectional
37 * 4 == 4 wire bidirectional
38 * 6 == 6 wire unidirectional (or TLL)
39 */
40 u8 pins[3];
41
42 struct platform_device *udc_device;
43 struct platform_device *ohci_device;
44 struct platform_device *otg_device;
45
46 u32 (*usb0_init)(unsigned nwires, unsigned is_device);
47 u32 (*usb1_init)(unsigned nwires);
48 u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup);
49
50 int (*ocpi_enable)(void);
51};
52
53#endif /* __LINUX_USB_OMAP1_H */
diff --git a/include/linux/platform_data/video-ep93xx.h b/include/linux/platform_data/video-ep93xx.h
index d5ae11d7c453..92fc2b2232e7 100644
--- a/include/linux/platform_data/video-ep93xx.h
+++ b/include/linux/platform_data/video-ep93xx.h
@@ -1,9 +1,5 @@
1/* 1#ifndef __VIDEO_EP93XX_H
2 * arch/arm/mach-ep93xx/include/mach/fb.h 2#define __VIDEO_EP93XX_H
3 */
4
5#ifndef __ASM_ARCH_EP93XXFB_H
6#define __ASM_ARCH_EP93XXFB_H
7 3
8struct platform_device; 4struct platform_device;
9struct fb_videomode; 5struct fb_videomode;
@@ -53,4 +49,4 @@ struct ep93xxfb_mach_info {
53 void (*blank)(int blank_mode, struct fb_info *info); 49 void (*blank)(int blank_mode, struct fb_info *info);
54}; 50};
55 51
56#endif /* __ASM_ARCH_EP93XXFB_H */ 52#endif /* __VIDEO_EP93XX_H */
diff --git a/include/linux/platform_data/video-msm_fb.h b/include/linux/platform_data/video-msm_fb.h
index 1f4fc81b3d8f..31449be3eadb 100644
--- a/include/linux/platform_data/video-msm_fb.h
+++ b/include/linux/platform_data/video-msm_fb.h
@@ -1,5 +1,4 @@
1/* arch/arm/mach-msm/include/mach/msm_fb.h 1/*
2 *
3 * Internal shared definitions for various MSM framebuffer parts. 2 * Internal shared definitions for various MSM framebuffer parts.
4 * 3 *
5 * Copyright (C) 2007 Google Incorporated 4 * Copyright (C) 2007 Google Incorporated
diff --git a/include/linux/platform_data/video-pxafb.h b/include/linux/platform_data/video-pxafb.h
index 486b4c519ae2..07c6c1e153f8 100644
--- a/include/linux/platform_data/video-pxafb.h
+++ b/include/linux/platform_data/video-pxafb.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * arch/arm/mach-pxa/include/mach/pxafb.h
3 *
4 * Support for the xscale frame buffer. 2 * Support for the xscale frame buffer.
5 * 3 *
6 * Author: Jean-Frederic Clere 4 * Author: Jean-Frederic Clere
diff --git a/include/linux/platform_data/vsp1.h b/include/linux/platform_data/vsp1.h
index a73a456d7f11..63170e2614b3 100644
--- a/include/linux/platform_data/vsp1.h
+++ b/include/linux/platform_data/vsp1.h
@@ -14,6 +14,8 @@
14#define __PLATFORM_VSP1_H__ 14#define __PLATFORM_VSP1_H__
15 15
16#define VSP1_HAS_LIF (1 << 0) 16#define VSP1_HAS_LIF (1 << 0)
17#define VSP1_HAS_LUT (1 << 1)
18#define VSP1_HAS_SRU (1 << 2)
17 19
18struct vsp1_platform_data { 20struct vsp1_platform_data {
19 unsigned int features; 21 unsigned int features;
diff --git a/include/linux/pm.h b/include/linux/pm.h
index a224c7f5c377..8c6583a53a06 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -311,6 +311,18 @@ struct dev_pm_ops {
311#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) 311#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
312#endif 312#endif
313 313
314#ifdef CONFIG_PM_SLEEP
315#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
316 .suspend_late = suspend_fn, \
317 .resume_early = resume_fn, \
318 .freeze_late = suspend_fn, \
319 .thaw_early = resume_fn, \
320 .poweroff_late = suspend_fn, \
321 .restore_early = resume_fn,
322#else
323#define SET_LATE_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
324#endif
325
314#ifdef CONFIG_PM_RUNTIME 326#ifdef CONFIG_PM_RUNTIME
315#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \ 327#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
316 .runtime_suspend = suspend_fn, \ 328 .runtime_suspend = suspend_fn, \
@@ -320,6 +332,15 @@ struct dev_pm_ops {
320#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) 332#define SET_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
321#endif 333#endif
322 334
335#ifdef CONFIG_PM
336#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn) \
337 .runtime_suspend = suspend_fn, \
338 .runtime_resume = resume_fn, \
339 .runtime_idle = idle_fn,
340#else
341#define SET_PM_RUNTIME_PM_OPS(suspend_fn, resume_fn, idle_fn)
342#endif
343
323/* 344/*
324 * Use this if you want to use the same suspend and resume callbacks for suspend 345 * Use this if you want to use the same suspend and resume callbacks for suspend
325 * to RAM and hibernation. 346 * to RAM and hibernation.
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 6fa7cea25da9..16c9a62fa1c0 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -23,6 +23,14 @@
23 usage_count */ 23 usage_count */
24#define RPM_AUTO 0x08 /* Use autosuspend_delay */ 24#define RPM_AUTO 0x08 /* Use autosuspend_delay */
25 25
26#ifdef CONFIG_PM
27extern int pm_generic_runtime_suspend(struct device *dev);
28extern int pm_generic_runtime_resume(struct device *dev);
29#else
30static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
31static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
32#endif
33
26#ifdef CONFIG_PM_RUNTIME 34#ifdef CONFIG_PM_RUNTIME
27 35
28extern struct workqueue_struct *pm_wq; 36extern struct workqueue_struct *pm_wq;
@@ -37,8 +45,6 @@ extern void pm_runtime_enable(struct device *dev);
37extern void __pm_runtime_disable(struct device *dev, bool check_resume); 45extern void __pm_runtime_disable(struct device *dev, bool check_resume);
38extern void pm_runtime_allow(struct device *dev); 46extern void pm_runtime_allow(struct device *dev);
39extern void pm_runtime_forbid(struct device *dev); 47extern void pm_runtime_forbid(struct device *dev);
40extern int pm_generic_runtime_suspend(struct device *dev);
41extern int pm_generic_runtime_resume(struct device *dev);
42extern void pm_runtime_no_callbacks(struct device *dev); 48extern void pm_runtime_no_callbacks(struct device *dev);
43extern void pm_runtime_irq_safe(struct device *dev); 49extern void pm_runtime_irq_safe(struct device *dev);
44extern void __pm_runtime_use_autosuspend(struct device *dev, bool use); 50extern void __pm_runtime_use_autosuspend(struct device *dev, bool use);
@@ -142,8 +148,6 @@ static inline bool pm_runtime_active(struct device *dev) { return true; }
142static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } 148static inline bool pm_runtime_status_suspended(struct device *dev) { return false; }
143static inline bool pm_runtime_enabled(struct device *dev) { return false; } 149static inline bool pm_runtime_enabled(struct device *dev) { return false; }
144 150
145static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
146static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
147static inline void pm_runtime_no_callbacks(struct device *dev) {} 151static inline void pm_runtime_no_callbacks(struct device *dev) {}
148static inline void pm_runtime_irq_safe(struct device *dev) {} 152static inline void pm_runtime_irq_safe(struct device *dev) {}
149 153
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index 7931efe71175..3e96a6a76103 100644
--- a/include/linux/posix_acl.h
+++ b/include/linux/posix_acl.h
@@ -39,9 +39,6 @@ struct posix_acl_entry {
39 union { 39 union {
40 kuid_t e_uid; 40 kuid_t e_uid;
41 kgid_t e_gid; 41 kgid_t e_gid;
42#ifndef CONFIG_UIDGID_STRICT_TYPE_CHECKS
43 unsigned int e_id;
44#endif
45 }; 42 };
46}; 43};
47 44
@@ -88,91 +85,60 @@ extern int posix_acl_valid(const struct posix_acl *);
88extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); 85extern int posix_acl_permission(struct inode *, const struct posix_acl *, int);
89extern struct posix_acl *posix_acl_from_mode(umode_t, gfp_t); 86extern struct posix_acl *posix_acl_from_mode(umode_t, gfp_t);
90extern int posix_acl_equiv_mode(const struct posix_acl *, umode_t *); 87extern int posix_acl_equiv_mode(const struct posix_acl *, umode_t *);
91extern int posix_acl_create(struct posix_acl **, gfp_t, umode_t *); 88extern int __posix_acl_create(struct posix_acl **, gfp_t, umode_t *);
92extern int posix_acl_chmod(struct posix_acl **, gfp_t, umode_t); 89extern int __posix_acl_chmod(struct posix_acl **, gfp_t, umode_t);
93 90
94extern struct posix_acl *get_posix_acl(struct inode *, int); 91extern struct posix_acl *get_posix_acl(struct inode *, int);
95extern int set_posix_acl(struct inode *, int, struct posix_acl *); 92extern int set_posix_acl(struct inode *, int, struct posix_acl *);
96 93
97#ifdef CONFIG_FS_POSIX_ACL 94#ifdef CONFIG_FS_POSIX_ACL
98static inline struct posix_acl **acl_by_type(struct inode *inode, int type) 95extern int posix_acl_chmod(struct inode *, umode_t);
96extern int posix_acl_create(struct inode *, umode_t *, struct posix_acl **,
97 struct posix_acl **);
98
99extern int simple_set_acl(struct inode *, struct posix_acl *, int);
100extern int simple_acl_create(struct inode *, struct inode *);
101
102struct posix_acl **acl_by_type(struct inode *inode, int type);
103struct posix_acl *get_cached_acl(struct inode *inode, int type);
104struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type);
105void set_cached_acl(struct inode *inode, int type, struct posix_acl *acl);
106void forget_cached_acl(struct inode *inode, int type);
107void forget_all_cached_acls(struct inode *inode);
108
109static inline void cache_no_acl(struct inode *inode)
99{ 110{
100 switch (type) { 111 inode->i_acl = NULL;
101 case ACL_TYPE_ACCESS: 112 inode->i_default_acl = NULL;
102 return &inode->i_acl;
103 case ACL_TYPE_DEFAULT:
104 return &inode->i_default_acl;
105 default:
106 BUG();
107 }
108} 113}
109 114#else
110static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) 115static inline int posix_acl_chmod(struct inode *inode, umode_t mode)
111{ 116{
112 struct posix_acl **p = acl_by_type(inode, type); 117 return 0;
113 struct posix_acl *acl = ACCESS_ONCE(*p);
114 if (acl) {
115 spin_lock(&inode->i_lock);
116 acl = *p;
117 if (acl != ACL_NOT_CACHED)
118 acl = posix_acl_dup(acl);
119 spin_unlock(&inode->i_lock);
120 }
121 return acl;
122} 118}
123 119
124static inline struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type) 120#define simple_set_acl NULL
121
122static inline int simple_acl_create(struct inode *dir, struct inode *inode)
125{ 123{
126 return rcu_dereference(*acl_by_type(inode, type)); 124 return 0;
127} 125}
128 126static inline void cache_no_acl(struct inode *inode)
129static inline void set_cached_acl(struct inode *inode,
130 int type,
131 struct posix_acl *acl)
132{ 127{
133 struct posix_acl **p = acl_by_type(inode, type);
134 struct posix_acl *old;
135 spin_lock(&inode->i_lock);
136 old = *p;
137 rcu_assign_pointer(*p, posix_acl_dup(acl));
138 spin_unlock(&inode->i_lock);
139 if (old != ACL_NOT_CACHED)
140 posix_acl_release(old);
141} 128}
142 129
143static inline void forget_cached_acl(struct inode *inode, int type) 130static inline int posix_acl_create(struct inode *inode, umode_t *mode,
131 struct posix_acl **default_acl, struct posix_acl **acl)
144{ 132{
145 struct posix_acl **p = acl_by_type(inode, type); 133 *default_acl = *acl = NULL;
146 struct posix_acl *old; 134 return 0;
147 spin_lock(&inode->i_lock);
148 old = *p;
149 *p = ACL_NOT_CACHED;
150 spin_unlock(&inode->i_lock);
151 if (old != ACL_NOT_CACHED)
152 posix_acl_release(old);
153} 135}
154 136
155static inline void forget_all_cached_acls(struct inode *inode) 137static inline void forget_all_cached_acls(struct inode *inode)
156{ 138{
157 struct posix_acl *old_access, *old_default;
158 spin_lock(&inode->i_lock);
159 old_access = inode->i_acl;
160 old_default = inode->i_default_acl;
161 inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED;
162 spin_unlock(&inode->i_lock);
163 if (old_access != ACL_NOT_CACHED)
164 posix_acl_release(old_access);
165 if (old_default != ACL_NOT_CACHED)
166 posix_acl_release(old_default);
167} 139}
168#endif 140#endif /* CONFIG_FS_POSIX_ACL */
169 141
170static inline void cache_no_acl(struct inode *inode) 142struct posix_acl *get_acl(struct inode *inode, int type);
171{
172#ifdef CONFIG_FS_POSIX_ACL
173 inode->i_acl = NULL;
174 inode->i_default_acl = NULL;
175#endif
176}
177 143
178#endif /* __LINUX_POSIX_ACL_H */ 144#endif /* __LINUX_POSIX_ACL_H */
diff --git a/include/linux/posix_acl_xattr.h b/include/linux/posix_acl_xattr.h
index ad93ad0f1db0..6f14ee295822 100644
--- a/include/linux/posix_acl_xattr.h
+++ b/include/linux/posix_acl_xattr.h
@@ -69,4 +69,7 @@ struct posix_acl *posix_acl_from_xattr(struct user_namespace *user_ns,
69int posix_acl_to_xattr(struct user_namespace *user_ns, 69int posix_acl_to_xattr(struct user_namespace *user_ns,
70 const struct posix_acl *acl, void *buffer, size_t size); 70 const struct posix_acl *acl, void *buffer, size_t size);
71 71
72extern const struct xattr_handler posix_acl_access_xattr_handler;
73extern const struct xattr_handler posix_acl_default_xattr_handler;
74
72#endif /* _POSIX_ACL_XATTR_H */ 75#endif /* _POSIX_ACL_XATTR_H */
diff --git a/include/linux/power/bq2415x_charger.h b/include/linux/power/bq2415x_charger.h
index 8dcc0f46fc0a..50762af8b834 100644
--- a/include/linux/power/bq2415x_charger.h
+++ b/include/linux/power/bq2415x_charger.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * bq2415x charger driver 2 * bq2415x charger driver
3 * 3 *
4 * Copyright (C) 2011-2012 Pali Rohár <pali.rohar@gmail.com> 4 * Copyright (C) 2011-2013 Pali Rohár <pali.rohar@gmail.com>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 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 7 * it under the terms of the GNU General Public License as published by
@@ -31,46 +31,9 @@
31 * termination current. It it is less or equal to zero, configuring charge 31 * termination current. It it is less or equal to zero, configuring charge
32 * and termination current will not be possible. 32 * and termination current will not be possible.
33 * 33 *
34 * Function set_mode_hook is needed for automode (setting correct current 34 * For automode support is needed to provide name of power supply device
35 * limit when charger is connected/disconnected or setting boost mode). 35 * in value notify_device. Device driver must immediately report property
36 * When is NULL, automode function is disabled. When is not NULL, it must 36 * POWER_SUPPLY_PROP_CURRENT_MAX when current changed.
37 * have this prototype:
38 *
39 * int (*set_mode_hook)(
40 * void (*hook)(enum bq2415x_mode mode, void *data),
41 * void *data)
42 *
43 * hook is hook function (see below) and data is pointer to driver private
44 * data
45 *
46 * bq2415x driver will call it as:
47 *
48 * platform_data->set_mode_hook(bq2415x_hook_function, bq2415x_device);
49 *
50 * Board/platform function set_mode_hook return non zero value when hook
51 * function was successful registered. Platform code should call that hook
52 * function (which get from pointer, with data) every time when charger
53 * was connected/disconnected or require to enable boost mode. bq2415x
54 * driver then will set correct current limit, enable/disable charger or
55 * boost mode.
56 *
57 * Hook function has this prototype:
58 *
59 * void hook(enum bq2415x_mode mode, void *data);
60 *
61 * mode is bq2415x mode (charger or boost)
62 * data is pointer to driver private data (which get from
63 * set_charger_type_hook)
64 *
65 * When bq driver is being unloaded, it call function:
66 *
67 * platform_data->set_mode_hook(NULL, NULL);
68 *
69 * (hook function and driver private data are NULL)
70 *
71 * After that board/platform code must not call driver hook function! It
72 * is possible that pointer to hook function will not be valid and calling
73 * will cause undefined result.
74 */ 37 */
75 38
76/* Supported modes with maximal current limit */ 39/* Supported modes with maximal current limit */
@@ -89,8 +52,7 @@ struct bq2415x_platform_data {
89 int charge_current; /* mA */ 52 int charge_current; /* mA */
90 int termination_current; /* mA */ 53 int termination_current; /* mA */
91 int resistor_sense; /* m ohm */ 54 int resistor_sense; /* m ohm */
92 int (*set_mode_hook)(void (*hook)(enum bq2415x_mode mode, void *data), 55 const char *notify_device; /* name */
93 void *data);
94}; 56};
95 57
96#endif 58#endif
diff --git a/include/linux/power/charger-manager.h b/include/linux/power/charger-manager.h
index 0e86840eb603..07e7945a1ff2 100644
--- a/include/linux/power/charger-manager.h
+++ b/include/linux/power/charger-manager.h
@@ -37,6 +37,8 @@ enum cm_event_types {
37 CM_EVENT_BATT_FULL, 37 CM_EVENT_BATT_FULL,
38 CM_EVENT_BATT_IN, 38 CM_EVENT_BATT_IN,
39 CM_EVENT_BATT_OUT, 39 CM_EVENT_BATT_OUT,
40 CM_EVENT_BATT_OVERHEAT,
41 CM_EVENT_BATT_COLD,
40 CM_EVENT_EXT_PWR_IN_OUT, 42 CM_EVENT_EXT_PWR_IN_OUT,
41 CM_EVENT_CHG_START_STOP, 43 CM_EVENT_CHG_START_STOP,
42 CM_EVENT_OTHERS, 44 CM_EVENT_OTHERS,
@@ -173,11 +175,10 @@ struct charger_regulator {
173 * @num_charger_regulator: the number of entries in charger_regulators 175 * @num_charger_regulator: the number of entries in charger_regulators
174 * @charger_regulators: array of charger regulators 176 * @charger_regulators: array of charger regulators
175 * @psy_fuel_gauge: the name of power-supply for fuel gauge 177 * @psy_fuel_gauge: the name of power-supply for fuel gauge
176 * @temperature_out_of_range: 178 * @thermal_zone : the name of thermal zone for battery
177 * Determine whether the status is overheat or cold or normal. 179 * @temp_min : Minimum battery temperature for charging.
178 * return_value > 0: overheat 180 * @temp_max : Maximum battery temperature for charging.
179 * return_value == 0: normal 181 * @temp_diff : Temperature diffential to restart charging.
180 * return_value < 0: cold
181 * @measure_battery_temp: 182 * @measure_battery_temp:
182 * true: measure battery temperature 183 * true: measure battery temperature
183 * false: measure ambient temperature 184 * false: measure ambient temperature
@@ -190,7 +191,7 @@ struct charger_regulator {
190 * max_duration_ms', cm start charging. 191 * max_duration_ms', cm start charging.
191 */ 192 */
192struct charger_desc { 193struct charger_desc {
193 char *psy_name; 194 const char *psy_name;
194 195
195 enum polling_modes polling_mode; 196 enum polling_modes polling_mode;
196 unsigned int polling_interval_ms; 197 unsigned int polling_interval_ms;
@@ -203,18 +204,23 @@ struct charger_desc {
203 204
204 enum data_source battery_present; 205 enum data_source battery_present;
205 206
206 char **psy_charger_stat; 207 const char **psy_charger_stat;
207 208
208 int num_charger_regulators; 209 int num_charger_regulators;
209 struct charger_regulator *charger_regulators; 210 struct charger_regulator *charger_regulators;
210 211
211 char *psy_fuel_gauge; 212 const char *psy_fuel_gauge;
213
214 const char *thermal_zone;
215
216 int temp_min;
217 int temp_max;
218 int temp_diff;
212 219
213 int (*temperature_out_of_range)(int *mC);
214 bool measure_battery_temp; 220 bool measure_battery_temp;
215 221
216 u64 charging_max_duration_ms; 222 u32 charging_max_duration_ms;
217 u64 discharging_max_duration_ms; 223 u32 discharging_max_duration_ms;
218}; 224};
219 225
220#define PSY_NAME_MAX 30 226#define PSY_NAME_MAX 30
@@ -226,13 +232,13 @@ struct charger_desc {
226 * @desc: instance of charger_desc 232 * @desc: instance of charger_desc
227 * @fuel_gauge: power_supply for fuel gauge 233 * @fuel_gauge: power_supply for fuel gauge
228 * @charger_stat: array of power_supply for chargers 234 * @charger_stat: array of power_supply for chargers
235 * @tzd_batt : thermal zone device for battery
229 * @charger_enabled: the state of charger 236 * @charger_enabled: the state of charger
230 * @fullbatt_vchk_jiffies_at: 237 * @fullbatt_vchk_jiffies_at:
231 * jiffies at the time full battery check will occur. 238 * jiffies at the time full battery check will occur.
232 * @fullbatt_vchk_work: work queue for full battery check 239 * @fullbatt_vchk_work: work queue for full battery check
233 * @emergency_stop: 240 * @emergency_stop:
234 * When setting true, stop charging 241 * When setting true, stop charging
235 * @last_temp_mC: the measured temperature in milli-Celsius
236 * @psy_name_buf: the name of power-supply-class for charger manager 242 * @psy_name_buf: the name of power-supply-class for charger manager
237 * @charger_psy: power_supply for charger manager 243 * @charger_psy: power_supply for charger manager
238 * @status_save_ext_pwr_inserted: 244 * @status_save_ext_pwr_inserted:
@@ -250,13 +256,15 @@ struct charger_manager {
250 struct power_supply *fuel_gauge; 256 struct power_supply *fuel_gauge;
251 struct power_supply **charger_stat; 257 struct power_supply **charger_stat;
252 258
259#ifdef CONFIG_THERMAL
260 struct thermal_zone_device *tzd_batt;
261#endif
253 bool charger_enabled; 262 bool charger_enabled;
254 263
255 unsigned long fullbatt_vchk_jiffies_at; 264 unsigned long fullbatt_vchk_jiffies_at;
256 struct delayed_work fullbatt_vchk_work; 265 struct delayed_work fullbatt_vchk_work;
257 266
258 int emergency_stop; 267 int emergency_stop;
259 int last_temp_mC;
260 268
261 char psy_name_buf[PSY_NAME_MAX + 1]; 269 char psy_name_buf[PSY_NAME_MAX + 1];
262 struct power_supply charger_psy; 270 struct power_supply charger_psy;
diff --git a/include/linux/power/isp1704_charger.h b/include/linux/power/isp1704_charger.h
index 68096a6aa2d7..0105d9e7af85 100644
--- a/include/linux/power/isp1704_charger.h
+++ b/include/linux/power/isp1704_charger.h
@@ -24,6 +24,7 @@
24 24
25struct isp1704_charger_data { 25struct isp1704_charger_data {
26 void (*set_power)(bool on); 26 void (*set_power)(bool on);
27 int enable_gpio;
27}; 28};
28 29
29#endif 30#endif
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 5c2600630dc9..c9dc4e09854c 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -16,6 +16,7 @@
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#include <linux/spinlock.h>
19#include <linux/notifier.h>
19 20
20struct device; 21struct device;
21 22
@@ -158,6 +159,10 @@ enum power_supply_type {
158 POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */ 159 POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */
159}; 160};
160 161
162enum power_supply_notifier_events {
163 PSY_EVENT_PROP_CHANGED,
164};
165
161union power_supply_propval { 166union power_supply_propval {
162 int intval; 167 int intval;
163 const char *strval; 168 const char *strval;
@@ -235,7 +240,18 @@ struct power_supply_info {
235 int use_for_apm; 240 int use_for_apm;
236}; 241};
237 242
243extern struct atomic_notifier_head power_supply_notifier;
244extern int power_supply_reg_notifier(struct notifier_block *nb);
245extern void power_supply_unreg_notifier(struct notifier_block *nb);
238extern struct power_supply *power_supply_get_by_name(const char *name); 246extern struct power_supply *power_supply_get_by_name(const char *name);
247#ifdef CONFIG_OF
248extern struct power_supply *power_supply_get_by_phandle(struct device_node *np,
249 const char *property);
250#else /* !CONFIG_OF */
251static inline struct power_supply *
252power_supply_get_by_phandle(struct device_node *np, const char *property)
253{ return NULL; }
254#endif /* CONFIG_OF */
239extern void power_supply_changed(struct power_supply *psy); 255extern void power_supply_changed(struct power_supply *psy);
240extern int power_supply_am_i_supplied(struct power_supply *psy); 256extern int power_supply_am_i_supplied(struct power_supply *psy);
241extern int power_supply_set_battery_charged(struct power_supply *psy); 257extern int power_supply_set_battery_charged(struct power_supply *psy);
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 59749fc48328..de83b4eb1642 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -134,7 +134,6 @@ do { \
134#undef preempt_check_resched 134#undef preempt_check_resched
135#endif 135#endif
136 136
137#ifdef CONFIG_PREEMPT
138#define preempt_set_need_resched() \ 137#define preempt_set_need_resched() \
139do { \ 138do { \
140 set_preempt_need_resched(); \ 139 set_preempt_need_resched(); \
@@ -144,10 +143,6 @@ do { \
144 if (tif_need_resched()) \ 143 if (tif_need_resched()) \
145 set_preempt_need_resched(); \ 144 set_preempt_need_resched(); \
146} while (0) 145} while (0)
147#else
148#define preempt_set_need_resched() do { } while (0)
149#define preempt_fold_need_resched() do { } while (0)
150#endif
151 146
152#ifdef CONFIG_PREEMPT_NOTIFIERS 147#ifdef CONFIG_PREEMPT_NOTIFIERS
153 148
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 694925837a16..fa47e2708c01 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -5,6 +5,7 @@
5#include <linux/init.h> 5#include <linux/init.h>
6#include <linux/kern_levels.h> 6#include <linux/kern_levels.h>
7#include <linux/linkage.h> 7#include <linux/linkage.h>
8#include <linux/cache.h>
8 9
9extern const char linux_banner[]; 10extern const char linux_banner[];
10extern const char linux_proc_banner[]; 11extern const char linux_proc_banner[];
@@ -88,6 +89,13 @@ struct va_format {
88#define HW_ERR "[Hardware Error]: " 89#define HW_ERR "[Hardware Error]: "
89 90
90/* 91/*
92 * DEPRECATED
93 * Add this to a message whenever you want to warn user space about the use
94 * of a deprecated aspect of an API so they can stop using it
95 */
96#define DEPRECATED "[Deprecated]: "
97
98/*
91 * Dummy printk for disabled debugging statements to use whilst maintaining 99 * Dummy printk for disabled debugging statements to use whilst maintaining
92 * gcc's format and side-effect checking. 100 * gcc's format and side-effect checking.
93 */ 101 */
@@ -253,17 +261,17 @@ extern asmlinkage void dump_stack(void) __cold;
253 */ 261 */
254 262
255#ifdef CONFIG_PRINTK 263#ifdef CONFIG_PRINTK
256#define printk_once(fmt, ...) \ 264#define printk_once(fmt, ...) \
257({ \ 265({ \
258 static bool __print_once; \ 266 static bool __print_once __read_mostly; \
259 \ 267 \
260 if (!__print_once) { \ 268 if (!__print_once) { \
261 __print_once = true; \ 269 __print_once = true; \
262 printk(fmt, ##__VA_ARGS__); \ 270 printk(fmt, ##__VA_ARGS__); \
263 } \ 271 } \
264}) 272})
265#else 273#else
266#define printk_once(fmt, ...) \ 274#define printk_once(fmt, ...) \
267 no_printk(fmt, ##__VA_ARGS__) 275 no_printk(fmt, ##__VA_ARGS__)
268#endif 276#endif
269 277
diff --git a/include/linux/projid.h b/include/linux/projid.h
index 36517b95be5c..8c1f2c55226d 100644
--- a/include/linux/projid.h
+++ b/include/linux/projid.h
@@ -18,8 +18,6 @@ extern struct user_namespace init_user_ns;
18 18
19typedef __kernel_uid32_t projid_t; 19typedef __kernel_uid32_t projid_t;
20 20
21#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
22
23typedef struct { 21typedef struct {
24 projid_t val; 22 projid_t val;
25} kprojid_t; 23} kprojid_t;
@@ -31,19 +29,6 @@ static inline projid_t __kprojid_val(kprojid_t projid)
31 29
32#define KPROJIDT_INIT(value) (kprojid_t){ value } 30#define KPROJIDT_INIT(value) (kprojid_t){ value }
33 31
34#else
35
36typedef projid_t kprojid_t;
37
38static inline projid_t __kprojid_val(kprojid_t projid)
39{
40 return projid;
41}
42
43#define KPROJIDT_INIT(value) ((kprojid_t) value )
44
45#endif
46
47#define INVALID_PROJID KPROJIDT_INIT(-1) 32#define INVALID_PROJID KPROJIDT_INIT(-1)
48#define OVERFLOW_PROJID 65534 33#define OVERFLOW_PROJID 65534
49 34
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 753207c8ce20..ecc730977a5a 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -14,13 +14,6 @@ ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize)
14} 14}
15#else 15#else
16extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); 16extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize);
17extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
18 unsigned long addr,
19 unsigned long len,
20 unsigned long pgoff,
21 unsigned long flags);
22
23extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma);
24#endif 17#endif
25 18
26extern const struct file_operations ramfs_file_operations; 19extern const struct file_operations ramfs_file_operations;
diff --git a/include/linux/random.h b/include/linux/random.h
index 4002b3df4c85..1cfce0e24dbd 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -8,7 +8,6 @@
8 8
9#include <uapi/linux/random.h> 9#include <uapi/linux/random.h>
10 10
11
12extern void add_device_randomness(const void *, unsigned int); 11extern void add_device_randomness(const void *, unsigned int);
13extern void add_input_randomness(unsigned int type, unsigned int code, 12extern void add_input_randomness(unsigned int type, unsigned int code,
14 unsigned int value); 13 unsigned int value);
@@ -38,6 +37,23 @@ struct rnd_state {
38u32 prandom_u32_state(struct rnd_state *state); 37u32 prandom_u32_state(struct rnd_state *state);
39void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes); 38void prandom_bytes_state(struct rnd_state *state, void *buf, int nbytes);
40 39
40/**
41 * prandom_u32_max - returns a pseudo-random number in interval [0, ep_ro)
42 * @ep_ro: right open interval endpoint
43 *
44 * Returns a pseudo-random number that is in interval [0, ep_ro). Note
45 * that the result depends on PRNG being well distributed in [0, ~0U]
46 * u32 space. Here we use maximally equidistributed combined Tausworthe
47 * generator, that is, prandom_u32(). This is useful when requesting a
48 * random index of an array containing ep_ro elements, for example.
49 *
50 * Returns: pseudo-random number in interval [0, ep_ro)
51 */
52static inline u32 prandom_u32_max(u32 ep_ro)
53{
54 return (u32)(((u64) prandom_u32() * ep_ro) >> 32);
55}
56
41/* 57/*
42 * Handle minimum values for seeds 58 * Handle minimum values for seeds
43 */ 59 */
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 3e355c688618..72bf3a01a4ee 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -449,8 +449,6 @@ static inline int rcu_read_lock_sched_held(void)
449 449
450#ifdef CONFIG_PROVE_RCU 450#ifdef CONFIG_PROVE_RCU
451 451
452int rcu_my_thread_group_empty(void);
453
454/** 452/**
455 * rcu_lockdep_assert - emit lockdep splat if specified condition not met 453 * rcu_lockdep_assert - emit lockdep splat if specified condition not met
456 * @c: condition to check 454 * @c: condition to check
diff --git a/include/linux/reciprocal_div.h b/include/linux/reciprocal_div.h
index f9c90b33285b..8c5a3fb6c6c5 100644
--- a/include/linux/reciprocal_div.h
+++ b/include/linux/reciprocal_div.h
@@ -4,29 +4,32 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6/* 6/*
7 * This file describes reciprocical division. 7 * This algorithm is based on the paper "Division by Invariant
8 * Integers Using Multiplication" by Torbjörn Granlund and Peter
9 * L. Montgomery.
8 * 10 *
9 * This optimizes the (A/B) problem, when A and B are two u32 11 * The assembler implementation from Agner Fog, which this code is
10 * and B is a known value (but not known at compile time) 12 * based on, can be found here:
13 * http://www.agner.org/optimize/asmlib.zip
11 * 14 *
12 * The math principle used is : 15 * This optimization for A/B is helpful if the divisor B is mostly
13 * Let RECIPROCAL_VALUE(B) be (((1LL << 32) + (B - 1))/ B) 16 * runtime invariant. The reciprocal of B is calculated in the
14 * Then A / B = (u32)(((u64)(A) * (R)) >> 32) 17 * slow-path with reciprocal_value(). The fast-path can then just use
15 * 18 * a much faster multiplication operation with a variable dividend A
16 * This replaces a divide by a multiply (and a shift), and 19 * to calculate the division A/B.
17 * is generally less expensive in CPU cycles.
18 */ 20 */
19 21
20/* 22struct reciprocal_value {
21 * Computes the reciprocal value (R) for the value B of the divisor. 23 u32 m;
22 * Should not be called before each reciprocal_divide(), 24 u8 sh1, sh2;
23 * or else the performance is slower than a normal divide. 25};
24 */
25extern u32 reciprocal_value(u32 B);
26 26
27struct reciprocal_value reciprocal_value(u32 d);
27 28
28static inline u32 reciprocal_divide(u32 A, u32 R) 29static inline u32 reciprocal_divide(u32 a, struct reciprocal_value R)
29{ 30{
30 return (u32)(((u64)A * R) >> 32); 31 u32 t = (u32)(((u64)a * R.m) >> 32);
32 return (t + ((a - t) >> R.sh1)) >> R.sh2;
31} 33}
32#endif 34
35#endif /* _LINUX_RECIPROCAL_DIV_H */
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index e55907804d39..4149f1a9b003 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -122,9 +122,9 @@ typedef void (*regmap_unlock)(void *);
122 * volatile_table (see below) is not, the check is performed on 122 * volatile_table (see below) is not, the check is performed on
123 * such table (a register is volatile if it belongs to one of 123 * such table (a register is volatile if it belongs to one of
124 * the ranges specified by volatile_table). 124 * the ranges specified by volatile_table).
125 * @precious_reg: Optional callback returning true if the rgister 125 * @precious_reg: Optional callback returning true if the register
126 * should not be read outside of a call from the driver 126 * should not be read outside of a call from the driver
127 * (eg, a clear on read interrupt status register). If this 127 * (e.g., a clear on read interrupt status register). If this
128 * field is NULL but precious_table (see below) is not, the 128 * field is NULL but precious_table (see below) is not, the
129 * check is performed on such table (a register is precious if 129 * check is performed on such table (a register is precious if
130 * it belongs to one of the ranges specified by precious_table). 130 * it belongs to one of the ranges specified by precious_table).
@@ -136,9 +136,9 @@ typedef void (*regmap_unlock)(void *);
136 * are not overridden). 136 * are not overridden).
137 * @reg_read: Optional callback that if filled will be used to perform 137 * @reg_read: Optional callback that if filled will be used to perform
138 * all the reads from the registers. Should only be provided for 138 * all the reads from the registers. Should only be provided for
139 * devices whos read operation cannot be represented as a simple read 139 * devices whose read operation cannot be represented as a simple
140 * operation on a bus such as SPI, I2C, etc. Most of the devices do 140 * read operation on a bus such as SPI, I2C, etc. Most of the
141 * not need this. 141 * devices do not need this.
142 * @reg_write: Same as above for writing. 142 * @reg_write: Same as above for writing.
143 * @fast_io: Register IO is fast. Use a spinlock instead of a mutex 143 * @fast_io: Register IO is fast. Use a spinlock instead of a mutex
144 * to perform locking. This field is ignored if custom lock/unlock 144 * to perform locking. This field is ignored if custom lock/unlock
@@ -497,11 +497,13 @@ struct regmap_irq {
497 * 497 *
498 * @status_base: Base status register address. 498 * @status_base: Base status register address.
499 * @mask_base: Base mask register address. 499 * @mask_base: Base mask register address.
500 * @ack_base: Base ack address. If zero then the chip is clear on read. 500 * @ack_base: Base ack address. If zero then the chip is clear on read.
501 * Using zero value is possible with @use_ack bit.
501 * @wake_base: Base address for wake enables. If zero unsupported. 502 * @wake_base: Base address for wake enables. If zero unsupported.
502 * @irq_reg_stride: Stride to use for chips where registers are not contiguous. 503 * @irq_reg_stride: Stride to use for chips where registers are not contiguous.
503 * @init_ack_masked: Ack all masked interrupts once during initalization. 504 * @init_ack_masked: Ack all masked interrupts once during initalization.
504 * @mask_invert: Inverted mask register: cleared bits are masked out. 505 * @mask_invert: Inverted mask register: cleared bits are masked out.
506 * @use_ack: Use @ack register even if it is zero.
505 * @wake_invert: Inverted wake register: cleared bits are wake enabled. 507 * @wake_invert: Inverted wake register: cleared bits are wake enabled.
506 * @runtime_pm: Hold a runtime PM lock on the device when accessing it. 508 * @runtime_pm: Hold a runtime PM lock on the device when accessing it.
507 * 509 *
@@ -520,6 +522,7 @@ struct regmap_irq_chip {
520 unsigned int irq_reg_stride; 522 unsigned int irq_reg_stride;
521 bool init_ack_masked:1; 523 bool init_ack_masked:1;
522 bool mask_invert:1; 524 bool mask_invert:1;
525 bool use_ack:1;
523 bool wake_invert:1; 526 bool wake_invert:1;
524 bool runtime_pm:1; 527 bool runtime_pm:1;
525 528
diff --git a/include/linux/regulator/act8865.h b/include/linux/regulator/act8865.h
new file mode 100644
index 000000000000..49206c1b4905
--- /dev/null
+++ b/include/linux/regulator/act8865.h
@@ -0,0 +1,53 @@
1/*
2 * act8865.h -- Voltage regulation for the active-semi act8865
3 *
4 * Copyright (C) 2013 Atmel Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#ifndef __LINUX_REGULATOR_ACT8865_H
17#define __LINUX_REGULATOR_ACT8865_H
18
19#include <linux/regulator/machine.h>
20
21enum {
22 ACT8865_ID_DCDC1,
23 ACT8865_ID_DCDC2,
24 ACT8865_ID_DCDC3,
25 ACT8865_ID_LDO1,
26 ACT8865_ID_LDO2,
27 ACT8865_ID_LDO3,
28 ACT8865_ID_LDO4,
29 ACT8865_REG_NUM,
30};
31
32/**
33 * act8865_regulator_data - regulator data
34 * @id: regulator id
35 * @name: regulator name
36 * @platform_data: regulator init data
37 */
38struct act8865_regulator_data {
39 int id;
40 const char *name;
41 struct regulator_init_data *platform_data;
42};
43
44/**
45 * act8865_platform_data - platform data for act8865
46 * @num_regulators: number of regulators used
47 * @regulators: pointer to regulators used
48 */
49struct act8865_platform_data {
50 int num_regulators;
51 struct act8865_regulator_data *regulators;
52};
53#endif
diff --git a/include/linux/reset-controller.h b/include/linux/reset-controller.h
index 2f61311ae3e0..41a4695fde08 100644
--- a/include/linux/reset-controller.h
+++ b/include/linux/reset-controller.h
@@ -21,6 +21,7 @@ struct reset_control_ops {
21 21
22struct module; 22struct module;
23struct device_node; 23struct device_node;
24struct of_phandle_args;
24 25
25/** 26/**
26 * struct reset_controller_dev - reset controller entity that might 27 * struct reset_controller_dev - reset controller entity that might
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 6dacb93a6d94..1da693d51255 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -184,13 +184,13 @@ static inline void page_dup_rmap(struct page *page)
184int page_referenced(struct page *, int is_locked, 184int page_referenced(struct page *, int is_locked,
185 struct mem_cgroup *memcg, unsigned long *vm_flags); 185 struct mem_cgroup *memcg, unsigned long *vm_flags);
186int page_referenced_one(struct page *, struct vm_area_struct *, 186int page_referenced_one(struct page *, struct vm_area_struct *,
187 unsigned long address, unsigned int *mapcount, unsigned long *vm_flags); 187 unsigned long address, void *arg);
188 188
189#define TTU_ACTION(x) ((x) & TTU_ACTION_MASK) 189#define TTU_ACTION(x) ((x) & TTU_ACTION_MASK)
190 190
191int try_to_unmap(struct page *, enum ttu_flags flags); 191int try_to_unmap(struct page *, enum ttu_flags flags);
192int try_to_unmap_one(struct page *, struct vm_area_struct *, 192int try_to_unmap_one(struct page *, struct vm_area_struct *,
193 unsigned long address, enum ttu_flags flags); 193 unsigned long address, void *arg);
194 194
195/* 195/*
196 * Called from mm/filemap_xip.c to unmap empty zero page 196 * Called from mm/filemap_xip.c to unmap empty zero page
@@ -236,10 +236,27 @@ void page_unlock_anon_vma_read(struct anon_vma *anon_vma);
236int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma); 236int page_mapped_in_vma(struct page *page, struct vm_area_struct *vma);
237 237
238/* 238/*
239 * Called by migrate.c to remove migration ptes, but might be used more later. 239 * rmap_walk_control: To control rmap traversing for specific needs
240 *
241 * arg: passed to rmap_one() and invalid_vma()
242 * rmap_one: executed on each vma where page is mapped
243 * done: for checking traversing termination condition
244 * file_nonlinear: for handling file nonlinear mapping
245 * anon_lock: for getting anon_lock by optimized way rather than default
246 * invalid_vma: for skipping uninterested vma
240 */ 247 */
241int rmap_walk(struct page *page, int (*rmap_one)(struct page *, 248struct rmap_walk_control {
242 struct vm_area_struct *, unsigned long, void *), void *arg); 249 void *arg;
250 int (*rmap_one)(struct page *page, struct vm_area_struct *vma,
251 unsigned long addr, void *arg);
252 int (*done)(struct page *page);
253 int (*file_nonlinear)(struct page *, struct address_space *,
254 struct vm_area_struct *vma);
255 struct anon_vma *(*anon_lock)(struct page *page);
256 bool (*invalid_vma)(struct vm_area_struct *vma, void *arg);
257};
258
259int rmap_walk(struct page *page, struct rmap_walk_control *rwc);
243 260
244#else /* !CONFIG_MMU */ 261#else /* !CONFIG_MMU */
245 262
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 0616ffe45702..03f3b05e8ec1 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -75,6 +75,17 @@ do { \
75} while (0) 75} while (0)
76 76
77/* 77/*
78 * This is the same regardless of which rwsem implementation that is being used.
79 * It is just a heuristic meant to be called by somebody alreadying holding the
80 * rwsem to see if somebody from an incompatible type is wanting access to the
81 * lock.
82 */
83static inline int rwsem_is_contended(struct rw_semaphore *sem)
84{
85 return !list_empty(&sem->wait_list);
86}
87
88/*
78 * lock for reading 89 * lock for reading
79 */ 90 */
80extern void down_read(struct rw_semaphore *sem); 91extern void down_read(struct rw_semaphore *sem);
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index adae88f5b0ab..a964f7285600 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -345,6 +345,7 @@ struct sg_mapping_iter {
345 345
346void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl, 346void sg_miter_start(struct sg_mapping_iter *miter, struct scatterlist *sgl,
347 unsigned int nents, unsigned int flags); 347 unsigned int nents, unsigned int flags);
348bool sg_miter_skip(struct sg_mapping_iter *miter, off_t offset);
348bool sg_miter_next(struct sg_mapping_iter *miter); 349bool sg_miter_next(struct sg_mapping_iter *miter);
349void sg_miter_stop(struct sg_mapping_iter *miter); 350void sg_miter_stop(struct sg_mapping_iter *miter);
350 351
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ffccdad050b5..68a0e84463a0 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -229,7 +229,7 @@ extern char ___assert_task_state[1 - 2*!!(
229/* get_task_state() */ 229/* get_task_state() */
230#define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \ 230#define TASK_REPORT (TASK_RUNNING | TASK_INTERRUPTIBLE | \
231 TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \ 231 TASK_UNINTERRUPTIBLE | __TASK_STOPPED | \
232 __TASK_TRACED) 232 __TASK_TRACED | EXIT_ZOMBIE | EXIT_DEAD)
233 233
234#define task_is_traced(task) ((task->state & __TASK_TRACED) != 0) 234#define task_is_traced(task) ((task->state & __TASK_TRACED) != 0)
235#define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0) 235#define task_is_stopped(task) ((task->state & __TASK_STOPPED) != 0)
@@ -391,22 +391,33 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
391static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} 391static inline void arch_pick_mmap_layout(struct mm_struct *mm) {}
392#endif 392#endif
393 393
394
395extern void set_dumpable(struct mm_struct *mm, int value);
396extern int get_dumpable(struct mm_struct *mm);
397
398#define SUID_DUMP_DISABLE 0 /* No setuid dumping */ 394#define SUID_DUMP_DISABLE 0 /* No setuid dumping */
399#define SUID_DUMP_USER 1 /* Dump as user of process */ 395#define SUID_DUMP_USER 1 /* Dump as user of process */
400#define SUID_DUMP_ROOT 2 /* Dump as root */ 396#define SUID_DUMP_ROOT 2 /* Dump as root */
401 397
402/* mm flags */ 398/* mm flags */
403/* dumpable bits */
404#define MMF_DUMPABLE 0 /* core dump is permitted */
405#define MMF_DUMP_SECURELY 1 /* core file is readable only by root */
406 399
400/* for SUID_DUMP_* above */
407#define MMF_DUMPABLE_BITS 2 401#define MMF_DUMPABLE_BITS 2
408#define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1) 402#define MMF_DUMPABLE_MASK ((1 << MMF_DUMPABLE_BITS) - 1)
409 403
404extern void set_dumpable(struct mm_struct *mm, int value);
405/*
406 * This returns the actual value of the suid_dumpable flag. For things
407 * that are using this for checking for privilege transitions, it must
408 * test against SUID_DUMP_USER rather than treating it as a boolean
409 * value.
410 */
411static inline int __get_dumpable(unsigned long mm_flags)
412{
413 return mm_flags & MMF_DUMPABLE_MASK;
414}
415
416static inline int get_dumpable(struct mm_struct *mm)
417{
418 return __get_dumpable(mm->flags);
419}
420
410/* coredump filter bits */ 421/* coredump filter bits */
411#define MMF_DUMP_ANON_PRIVATE 2 422#define MMF_DUMP_ANON_PRIVATE 2
412#define MMF_DUMP_ANON_SHARED 3 423#define MMF_DUMP_ANON_SHARED 3
@@ -549,6 +560,7 @@ struct signal_struct {
549 atomic_t sigcnt; 560 atomic_t sigcnt;
550 atomic_t live; 561 atomic_t live;
551 int nr_threads; 562 int nr_threads;
563 struct list_head thread_head;
552 564
553 wait_queue_head_t wait_chldexit; /* for wait4() */ 565 wait_queue_head_t wait_chldexit; /* for wait4() */
554 566
@@ -1227,7 +1239,6 @@ struct task_struct {
1227 /* Used for emulating ABI behavior of previous Linux versions */ 1239 /* Used for emulating ABI behavior of previous Linux versions */
1228 unsigned int personality; 1240 unsigned int personality;
1229 1241
1230 unsigned did_exec:1;
1231 unsigned in_execve:1; /* Tell the LSMs that the process is doing an 1242 unsigned in_execve:1; /* Tell the LSMs that the process is doing an
1232 * execve */ 1243 * execve */
1233 unsigned in_iowait:1; 1244 unsigned in_iowait:1;
@@ -1271,6 +1282,7 @@ struct task_struct {
1271 /* PID/PID hash table linkage. */ 1282 /* PID/PID hash table linkage. */
1272 struct pid_link pids[PIDTYPE_MAX]; 1283 struct pid_link pids[PIDTYPE_MAX];
1273 struct list_head thread_group; 1284 struct list_head thread_group;
1285 struct list_head thread_node;
1274 1286
1275 struct completion *vfork_done; /* for vfork() */ 1287 struct completion *vfork_done; /* for vfork() */
1276 int __user *set_child_tid; /* CLONE_CHILD_SETTID */ 1288 int __user *set_child_tid; /* CLONE_CHILD_SETTID */
@@ -2282,8 +2294,6 @@ extern struct mm_struct *get_task_mm(struct task_struct *task);
2282extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode); 2294extern struct mm_struct *mm_access(struct task_struct *task, unsigned int mode);
2283/* Remove the current tasks stale references to the old mm_struct */ 2295/* Remove the current tasks stale references to the old mm_struct */
2284extern void mm_release(struct task_struct *, struct mm_struct *); 2296extern void mm_release(struct task_struct *, struct mm_struct *);
2285/* Allocate a new mm structure and copy contents from tsk->mm */
2286extern struct mm_struct *dup_mm(struct task_struct *tsk);
2287 2297
2288extern int copy_thread(unsigned long, unsigned long, unsigned long, 2298extern int copy_thread(unsigned long, unsigned long, unsigned long,
2289 struct task_struct *); 2299 struct task_struct *);
@@ -2341,6 +2351,16 @@ extern bool current_is_single_threaded(void);
2341#define while_each_thread(g, t) \ 2351#define while_each_thread(g, t) \
2342 while ((t = next_thread(t)) != g) 2352 while ((t = next_thread(t)) != g)
2343 2353
2354#define __for_each_thread(signal, t) \
2355 list_for_each_entry_rcu(t, &(signal)->thread_head, thread_node)
2356
2357#define for_each_thread(p, t) \
2358 __for_each_thread((p)->signal, t)
2359
2360/* Careful: this is a double loop, 'break' won't work as expected. */
2361#define for_each_process_thread(p, t) \
2362 for_each_process(p) for_each_thread(p, t)
2363
2344static inline int get_nr_threads(struct task_struct *tsk) 2364static inline int get_nr_threads(struct task_struct *tsk)
2345{ 2365{
2346 return tsk->signal->nr_threads; 2366 return tsk->signal->nr_threads;
diff --git a/include/linux/sched/sysctl.h b/include/linux/sched/sysctl.h
index 3a93f842306a..8045a554cafb 100644
--- a/include/linux/sched/sysctl.h
+++ b/include/linux/sched/sysctl.h
@@ -99,4 +99,8 @@ extern int sched_rt_handler(struct ctl_table *table, int write,
99 void __user *buffer, size_t *lenp, 99 void __user *buffer, size_t *lenp,
100 loff_t *ppos); 100 loff_t *ppos);
101 101
102extern int sysctl_numa_balancing(struct ctl_table *table, int write,
103 void __user *buffer, size_t *lenp,
104 loff_t *ppos);
105
102#endif /* _SCHED_SYSCTL_H */ 106#endif /* _SCHED_SYSCTL_H */
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 3bfe8d6ee248..a9414fd49dc6 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -23,13 +23,12 @@
23 * See the GNU General Public License for more details. 23 * See the GNU General Public License for more details.
24 * 24 *
25 * You should have received a copy of the GNU General Public License 25 * You should have received a copy of the GNU General Public License
26 * along with GNU CC; see the file COPYING. If not, write to 26 * along with GNU CC; see the file COPYING. If not, see
27 * the Free Software Foundation, 59 Temple Place - Suite 330, 27 * <http://www.gnu.org/licenses/>.
28 * Boston, MA 02111-1307, USA.
29 * 28 *
30 * Please send any bug reports or fixes you make to the 29 * Please send any bug reports or fixes you make to the
31 * email address(es): 30 * email address(es):
32 * lksctp developers <lksctp-developerst@lists.sourceforge.net> 31 * lksctp developers <linux-sctp@vger.kernel.org>
33 * 32 *
34 * Or submit a bug report through the following website: 33 * Or submit a bug report through the following website:
35 * http://www.sf.net/projects/lksctp 34 * http://www.sf.net/projects/lksctp
diff --git a/include/linux/serial_bcm63xx.h b/include/linux/serial_bcm63xx.h
new file mode 100644
index 000000000000..570e964dc899
--- /dev/null
+++ b/include/linux/serial_bcm63xx.h
@@ -0,0 +1,119 @@
1#ifndef _LINUX_SERIAL_BCM63XX_H
2#define _LINUX_SERIAL_BCM63XX_H
3
4/* UART Control Register */
5#define UART_CTL_REG 0x0
6#define UART_CTL_RXTMOUTCNT_SHIFT 0
7#define UART_CTL_RXTMOUTCNT_MASK (0x1f << UART_CTL_RXTMOUTCNT_SHIFT)
8#define UART_CTL_RSTTXDN_SHIFT 5
9#define UART_CTL_RSTTXDN_MASK (1 << UART_CTL_RSTTXDN_SHIFT)
10#define UART_CTL_RSTRXFIFO_SHIFT 6
11#define UART_CTL_RSTRXFIFO_MASK (1 << UART_CTL_RSTRXFIFO_SHIFT)
12#define UART_CTL_RSTTXFIFO_SHIFT 7
13#define UART_CTL_RSTTXFIFO_MASK (1 << UART_CTL_RSTTXFIFO_SHIFT)
14#define UART_CTL_STOPBITS_SHIFT 8
15#define UART_CTL_STOPBITS_MASK (0xf << UART_CTL_STOPBITS_SHIFT)
16#define UART_CTL_STOPBITS_1 (0x7 << UART_CTL_STOPBITS_SHIFT)
17#define UART_CTL_STOPBITS_2 (0xf << UART_CTL_STOPBITS_SHIFT)
18#define UART_CTL_BITSPERSYM_SHIFT 12
19#define UART_CTL_BITSPERSYM_MASK (0x3 << UART_CTL_BITSPERSYM_SHIFT)
20#define UART_CTL_XMITBRK_SHIFT 14
21#define UART_CTL_XMITBRK_MASK (1 << UART_CTL_XMITBRK_SHIFT)
22#define UART_CTL_RSVD_SHIFT 15
23#define UART_CTL_RSVD_MASK (1 << UART_CTL_RSVD_SHIFT)
24#define UART_CTL_RXPAREVEN_SHIFT 16
25#define UART_CTL_RXPAREVEN_MASK (1 << UART_CTL_RXPAREVEN_SHIFT)
26#define UART_CTL_RXPAREN_SHIFT 17
27#define UART_CTL_RXPAREN_MASK (1 << UART_CTL_RXPAREN_SHIFT)
28#define UART_CTL_TXPAREVEN_SHIFT 18
29#define UART_CTL_TXPAREVEN_MASK (1 << UART_CTL_TXPAREVEN_SHIFT)
30#define UART_CTL_TXPAREN_SHIFT 18
31#define UART_CTL_TXPAREN_MASK (1 << UART_CTL_TXPAREN_SHIFT)
32#define UART_CTL_LOOPBACK_SHIFT 20
33#define UART_CTL_LOOPBACK_MASK (1 << UART_CTL_LOOPBACK_SHIFT)
34#define UART_CTL_RXEN_SHIFT 21
35#define UART_CTL_RXEN_MASK (1 << UART_CTL_RXEN_SHIFT)
36#define UART_CTL_TXEN_SHIFT 22
37#define UART_CTL_TXEN_MASK (1 << UART_CTL_TXEN_SHIFT)
38#define UART_CTL_BRGEN_SHIFT 23
39#define UART_CTL_BRGEN_MASK (1 << UART_CTL_BRGEN_SHIFT)
40
41/* UART Baudword register */
42#define UART_BAUD_REG 0x4
43
44/* UART Misc Control register */
45#define UART_MCTL_REG 0x8
46#define UART_MCTL_DTR_SHIFT 0
47#define UART_MCTL_DTR_MASK (1 << UART_MCTL_DTR_SHIFT)
48#define UART_MCTL_RTS_SHIFT 1
49#define UART_MCTL_RTS_MASK (1 << UART_MCTL_RTS_SHIFT)
50#define UART_MCTL_RXFIFOTHRESH_SHIFT 8
51#define UART_MCTL_RXFIFOTHRESH_MASK (0xf << UART_MCTL_RXFIFOTHRESH_SHIFT)
52#define UART_MCTL_TXFIFOTHRESH_SHIFT 12
53#define UART_MCTL_TXFIFOTHRESH_MASK (0xf << UART_MCTL_TXFIFOTHRESH_SHIFT)
54#define UART_MCTL_RXFIFOFILL_SHIFT 16
55#define UART_MCTL_RXFIFOFILL_MASK (0x1f << UART_MCTL_RXFIFOFILL_SHIFT)
56#define UART_MCTL_TXFIFOFILL_SHIFT 24
57#define UART_MCTL_TXFIFOFILL_MASK (0x1f << UART_MCTL_TXFIFOFILL_SHIFT)
58
59/* UART External Input Configuration register */
60#define UART_EXTINP_REG 0xc
61#define UART_EXTINP_RI_SHIFT 0
62#define UART_EXTINP_RI_MASK (1 << UART_EXTINP_RI_SHIFT)
63#define UART_EXTINP_CTS_SHIFT 1
64#define UART_EXTINP_CTS_MASK (1 << UART_EXTINP_CTS_SHIFT)
65#define UART_EXTINP_DCD_SHIFT 2
66#define UART_EXTINP_DCD_MASK (1 << UART_EXTINP_DCD_SHIFT)
67#define UART_EXTINP_DSR_SHIFT 3
68#define UART_EXTINP_DSR_MASK (1 << UART_EXTINP_DSR_SHIFT)
69#define UART_EXTINP_IRSTAT(x) (1 << (x + 4))
70#define UART_EXTINP_IRMASK(x) (1 << (x + 8))
71#define UART_EXTINP_IR_RI 0
72#define UART_EXTINP_IR_CTS 1
73#define UART_EXTINP_IR_DCD 2
74#define UART_EXTINP_IR_DSR 3
75#define UART_EXTINP_RI_NOSENSE_SHIFT 16
76#define UART_EXTINP_RI_NOSENSE_MASK (1 << UART_EXTINP_RI_NOSENSE_SHIFT)
77#define UART_EXTINP_CTS_NOSENSE_SHIFT 17
78#define UART_EXTINP_CTS_NOSENSE_MASK (1 << UART_EXTINP_CTS_NOSENSE_SHIFT)
79#define UART_EXTINP_DCD_NOSENSE_SHIFT 18
80#define UART_EXTINP_DCD_NOSENSE_MASK (1 << UART_EXTINP_DCD_NOSENSE_SHIFT)
81#define UART_EXTINP_DSR_NOSENSE_SHIFT 19
82#define UART_EXTINP_DSR_NOSENSE_MASK (1 << UART_EXTINP_DSR_NOSENSE_SHIFT)
83
84/* UART Interrupt register */
85#define UART_IR_REG 0x10
86#define UART_IR_MASK(x) (1 << (x + 16))
87#define UART_IR_STAT(x) (1 << (x))
88#define UART_IR_EXTIP 0
89#define UART_IR_TXUNDER 1
90#define UART_IR_TXOVER 2
91#define UART_IR_TXTRESH 3
92#define UART_IR_TXRDLATCH 4
93#define UART_IR_TXEMPTY 5
94#define UART_IR_RXUNDER 6
95#define UART_IR_RXOVER 7
96#define UART_IR_RXTIMEOUT 8
97#define UART_IR_RXFULL 9
98#define UART_IR_RXTHRESH 10
99#define UART_IR_RXNOTEMPTY 11
100#define UART_IR_RXFRAMEERR 12
101#define UART_IR_RXPARERR 13
102#define UART_IR_RXBRK 14
103#define UART_IR_TXDONE 15
104
105/* UART Fifo register */
106#define UART_FIFO_REG 0x14
107#define UART_FIFO_VALID_SHIFT 0
108#define UART_FIFO_VALID_MASK 0xff
109#define UART_FIFO_FRAMEERR_SHIFT 8
110#define UART_FIFO_FRAMEERR_MASK (1 << UART_FIFO_FRAMEERR_SHIFT)
111#define UART_FIFO_PARERR_SHIFT 9
112#define UART_FIFO_PARERR_MASK (1 << UART_FIFO_PARERR_SHIFT)
113#define UART_FIFO_BRKDET_SHIFT 10
114#define UART_FIFO_BRKDET_MASK (1 << UART_FIFO_BRKDET_SHIFT)
115#define UART_FIFO_ANYERR_MASK (UART_FIFO_FRAMEERR_MASK | \
116 UART_FIFO_PARERR_MASK | \
117 UART_FIFO_BRKDET_MASK)
118
119#endif /* _LINUX_SERIAL_BCM63XX_H */
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index 50fe651da965..22b3640c9424 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -10,15 +10,6 @@
10 10
11#define SCIx_NOT_SUPPORTED (-1) 11#define SCIx_NOT_SUPPORTED (-1)
12 12
13enum {
14 SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */
15 SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */
16 SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */
17 SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */
18 SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */
19 SCBRR_ALGO_6, /* HSCIF variable sample rate algorithm */
20};
21
22#define SCSCR_TIE (1 << 7) 13#define SCSCR_TIE (1 << 7)
23#define SCSCR_RIE (1 << 6) 14#define SCSCR_RIE (1 << 6)
24#define SCSCR_TE (1 << 5) 15#define SCSCR_TE (1 << 5)
@@ -59,28 +50,6 @@ enum {
59/* HSSRR HSCIF */ 50/* HSSRR HSCIF */
60#define HSCIF_SRE 0x8000 51#define HSCIF_SRE 0x8000
61 52
62/* Offsets into the sci_port->irqs array */
63enum {
64 SCIx_ERI_IRQ,
65 SCIx_RXI_IRQ,
66 SCIx_TXI_IRQ,
67 SCIx_BRI_IRQ,
68 SCIx_NR_IRQS,
69
70 SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */
71};
72
73/* Offsets into the sci_port->gpios array */
74enum {
75 SCIx_SCK,
76 SCIx_RXD,
77 SCIx_TXD,
78 SCIx_CTS,
79 SCIx_RTS,
80
81 SCIx_NR_FNS,
82};
83
84enum { 53enum {
85 SCIx_PROBE_REGTYPE, 54 SCIx_PROBE_REGTYPE,
86 55
@@ -99,19 +68,6 @@ enum {
99 SCIx_NR_REGTYPES, 68 SCIx_NR_REGTYPES,
100}; 69};
101 70
102#define SCIx_IRQ_MUXED(irq) \
103{ \
104 [SCIx_ERI_IRQ] = (irq), \
105 [SCIx_RXI_IRQ] = (irq), \
106 [SCIx_TXI_IRQ] = (irq), \
107 [SCIx_BRI_IRQ] = (irq), \
108}
109
110#define SCIx_IRQ_IS_MUXED(port) \
111 ((port)->cfg->irqs[SCIx_ERI_IRQ] == \
112 (port)->cfg->irqs[SCIx_RXI_IRQ]) || \
113 ((port)->cfg->irqs[SCIx_ERI_IRQ] && \
114 !(port)->cfg->irqs[SCIx_RXI_IRQ])
115/* 71/*
116 * SCI register subset common for all port types. 72 * SCI register subset common for all port types.
117 * Not all registers will exist on all parts. 73 * Not all registers will exist on all parts.
@@ -140,22 +96,16 @@ struct plat_sci_port_ops {
140 * Platform device specific platform_data struct 96 * Platform device specific platform_data struct
141 */ 97 */
142struct plat_sci_port { 98struct plat_sci_port {
143 unsigned long mapbase; /* resource base */
144 unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */
145 unsigned int gpios[SCIx_NR_FNS]; /* SCK, RXD, TXD, CTS, RTS */
146 unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ 99 unsigned int type; /* SCI / SCIF / IRDA / HSCIF */
147 upf_t flags; /* UPF_* flags */ 100 upf_t flags; /* UPF_* flags */
148 unsigned long capabilities; /* Port features/capabilities */ 101 unsigned long capabilities; /* Port features/capabilities */
149 102
150 unsigned int scbrr_algo_id; /* SCBRR calculation algo */ 103 unsigned int sampling_rate;
151 unsigned int scscr; /* SCSCR initialization */ 104 unsigned int scscr; /* SCSCR initialization */
152 105
153 /* 106 /*
154 * Platform overrides if necessary, defaults otherwise. 107 * Platform overrides if necessary, defaults otherwise.
155 */ 108 */
156 int overrun_bit;
157 unsigned int error_mask;
158
159 int port_reg; 109 int port_reg;
160 unsigned char regshift; 110 unsigned char regshift;
161 unsigned char regtype; 111 unsigned char regtype;
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h
index 631af63af42d..4723bbfa1c26 100644
--- a/include/linux/sfi_acpi.h
+++ b/include/linux/sfi_acpi.h
@@ -59,8 +59,11 @@
59#ifndef _LINUX_SFI_ACPI_H 59#ifndef _LINUX_SFI_ACPI_H
60#define _LINUX_SFI_ACPI_H 60#define _LINUX_SFI_ACPI_H
61 61
62#include <linux/acpi.h>
63#include <linux/sfi.h>
64
62#ifdef CONFIG_SFI 65#ifdef CONFIG_SFI
63#include <acpi/acpi.h> /* struct acpi_table_header */ 66#include <acpi/acpi.h> /* FIXME: inclusion should be removed */
64 67
65extern int sfi_acpi_table_parse(char *signature, char *oem_id, 68extern int sfi_acpi_table_parse(char *signature, char *oem_id,
66 char *oem_table_id, 69 char *oem_table_id,
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
index 90b5e30c2f22..8c9131db2b25 100644
--- a/include/linux/sh_eth.h
+++ b/include/linux/sh_eth.h
@@ -8,6 +8,7 @@ enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
8 8
9struct sh_eth_plat_data { 9struct sh_eth_plat_data {
10 int phy; 10 int phy;
11 int phy_irq;
11 int edmac_endian; 12 int edmac_endian;
12 phy_interface_t phy_interface; 13 phy_interface_t phy_interface;
13 void (*set_mdio_gate)(void *addr); 14 void (*set_mdio_gate)(void *addr);
diff --git a/include/linux/shm.h b/include/linux/shm.h
index 429c1995d756..1e2cd2e6b540 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -9,7 +9,7 @@
9struct shmid_kernel /* private to the kernel */ 9struct shmid_kernel /* private to the kernel */
10{ 10{
11 struct kern_ipc_perm shm_perm; 11 struct kern_ipc_perm shm_perm;
12 struct file * shm_file; 12 struct file *shm_file;
13 unsigned long shm_nattch; 13 unsigned long shm_nattch;
14 unsigned long shm_segsz; 14 unsigned long shm_segsz;
15 time_t shm_atim; 15 time_t shm_atim;
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 6f69b3f914fb..f589c9af8cbf 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -34,11 +34,82 @@
34#include <linux/netdev_features.h> 34#include <linux/netdev_features.h>
35#include <net/flow_keys.h> 35#include <net/flow_keys.h>
36 36
37/* A. Checksumming of received packets by device.
38 *
39 * CHECKSUM_NONE:
40 *
41 * Device failed to checksum this packet e.g. due to lack of capabilities.
42 * The packet contains full (though not verified) checksum in packet but
43 * not in skb->csum. Thus, skb->csum is undefined in this case.
44 *
45 * CHECKSUM_UNNECESSARY:
46 *
47 * The hardware you're dealing with doesn't calculate the full checksum
48 * (as in CHECKSUM_COMPLETE), but it does parse headers and verify checksums
49 * for specific protocols e.g. TCP/UDP/SCTP, then, for such packets it will
50 * set CHECKSUM_UNNECESSARY if their checksums are okay. skb->csum is still
51 * undefined in this case though. It is a bad option, but, unfortunately,
52 * nowadays most vendors do this. Apparently with the secret goal to sell
53 * you new devices, when you will add new protocol to your host, f.e. IPv6 8)
54 *
55 * CHECKSUM_COMPLETE:
56 *
57 * This is the most generic way. The device supplied checksum of the _whole_
58 * packet as seen by netif_rx() and fills out in skb->csum. Meaning, the
59 * hardware doesn't need to parse L3/L4 headers to implement this.
60 *
61 * Note: Even if device supports only some protocols, but is able to produce
62 * skb->csum, it MUST use CHECKSUM_COMPLETE, not CHECKSUM_UNNECESSARY.
63 *
64 * CHECKSUM_PARTIAL:
65 *
66 * This is identical to the case for output below. This may occur on a packet
67 * received directly from another Linux OS, e.g., a virtualized Linux kernel
68 * on the same host. The packet can be treated in the same way as
69 * CHECKSUM_UNNECESSARY, except that on output (i.e., forwarding) the
70 * checksum must be filled in by the OS or the hardware.
71 *
72 * B. Checksumming on output.
73 *
74 * CHECKSUM_NONE:
75 *
76 * The skb was already checksummed by the protocol, or a checksum is not
77 * required.
78 *
79 * CHECKSUM_PARTIAL:
80 *
81 * The device is required to checksum the packet as seen by hard_start_xmit()
82 * from skb->csum_start up to the end, and to record/write the checksum at
83 * offset skb->csum_start + skb->csum_offset.
84 *
85 * The device must show its capabilities in dev->features, set up at device
86 * setup time, e.g. netdev_features.h:
87 *
88 * NETIF_F_HW_CSUM - It's a clever device, it's able to checksum everything.
89 * NETIF_F_IP_CSUM - Device is dumb, it's able to checksum only TCP/UDP over
90 * IPv4. Sigh. Vendors like this way for an unknown reason.
91 * Though, see comment above about CHECKSUM_UNNECESSARY. 8)
92 * NETIF_F_IPV6_CSUM - About as dumb as the last one but does IPv6 instead.
93 * NETIF_F_... - Well, you get the picture.
94 *
95 * CHECKSUM_UNNECESSARY:
96 *
97 * Normally, the device will do per protocol specific checksumming. Protocol
98 * implementations that do not want the NIC to perform the checksum
99 * calculation should use this flag in their outgoing skbs.
100 *
101 * NETIF_F_FCOE_CRC - This indicates that the device can do FCoE FC CRC
102 * offload. Correspondingly, the FCoE protocol driver
103 * stack should use CHECKSUM_UNNECESSARY.
104 *
105 * Any questions? No questions, good. --ANK
106 */
107
37/* Don't change this without changing skb_csum_unnecessary! */ 108/* Don't change this without changing skb_csum_unnecessary! */
38#define CHECKSUM_NONE 0 109#define CHECKSUM_NONE 0
39#define CHECKSUM_UNNECESSARY 1 110#define CHECKSUM_UNNECESSARY 1
40#define CHECKSUM_COMPLETE 2 111#define CHECKSUM_COMPLETE 2
41#define CHECKSUM_PARTIAL 3 112#define CHECKSUM_PARTIAL 3
42 113
43#define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \ 114#define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \
44 ~(SMP_CACHE_BYTES - 1)) 115 ~(SMP_CACHE_BYTES - 1))
@@ -54,58 +125,6 @@
54 SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \ 125 SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \
55 SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) 126 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
56 127
57/* A. Checksumming of received packets by device.
58 *
59 * NONE: device failed to checksum this packet.
60 * skb->csum is undefined.
61 *
62 * UNNECESSARY: device parsed packet and wouldbe verified checksum.
63 * skb->csum is undefined.
64 * It is bad option, but, unfortunately, many of vendors do this.
65 * Apparently with secret goal to sell you new device, when you
66 * will add new protocol to your host. F.e. IPv6. 8)
67 *
68 * COMPLETE: the most generic way. Device supplied checksum of _all_
69 * the packet as seen by netif_rx in skb->csum.
70 * NOTE: Even if device supports only some protocols, but
71 * is able to produce some skb->csum, it MUST use COMPLETE,
72 * not UNNECESSARY.
73 *
74 * PARTIAL: identical to the case for output below. This may occur
75 * on a packet received directly from another Linux OS, e.g.,
76 * a virtualised Linux kernel on the same host. The packet can
77 * be treated in the same way as UNNECESSARY except that on
78 * output (i.e., forwarding) the checksum must be filled in
79 * by the OS or the hardware.
80 *
81 * B. Checksumming on output.
82 *
83 * NONE: skb is checksummed by protocol or csum is not required.
84 *
85 * PARTIAL: device is required to csum packet as seen by hard_start_xmit
86 * from skb->csum_start to the end and to record the checksum
87 * at skb->csum_start + skb->csum_offset.
88 *
89 * Device must show its capabilities in dev->features, set
90 * at device setup time.
91 * NETIF_F_HW_CSUM - it is clever device, it is able to checksum
92 * everything.
93 * NETIF_F_IP_CSUM - device is dumb. It is able to csum only
94 * TCP/UDP over IPv4. Sigh. Vendors like this
95 * way by an unknown reason. Though, see comment above
96 * about CHECKSUM_UNNECESSARY. 8)
97 * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead.
98 *
99 * UNNECESSARY: device will do per protocol specific csum. Protocol drivers
100 * that do not want net to perform the checksum calculation should use
101 * this flag in their outgoing skbs.
102 * NETIF_F_FCOE_CRC this indicates the device can do FCoE FC CRC
103 * offload. Correspondingly, the FCoE protocol driver
104 * stack should use CHECKSUM_UNNECESSARY.
105 *
106 * Any questions? No questions, good. --ANK
107 */
108
109struct net_device; 128struct net_device;
110struct scatterlist; 129struct scatterlist;
111struct pipe_inode_info; 130struct pipe_inode_info;
@@ -703,15 +722,78 @@ unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
703 unsigned int to, struct ts_config *config, 722 unsigned int to, struct ts_config *config,
704 struct ts_state *state); 723 struct ts_state *state);
705 724
706void __skb_get_rxhash(struct sk_buff *skb); 725/*
707static inline __u32 skb_get_rxhash(struct sk_buff *skb) 726 * Packet hash types specify the type of hash in skb_set_hash.
727 *
728 * Hash types refer to the protocol layer addresses which are used to
729 * construct a packet's hash. The hashes are used to differentiate or identify
730 * flows of the protocol layer for the hash type. Hash types are either
731 * layer-2 (L2), layer-3 (L3), or layer-4 (L4).
732 *
733 * Properties of hashes:
734 *
735 * 1) Two packets in different flows have different hash values
736 * 2) Two packets in the same flow should have the same hash value
737 *
738 * A hash at a higher layer is considered to be more specific. A driver should
739 * set the most specific hash possible.
740 *
741 * A driver cannot indicate a more specific hash than the layer at which a hash
742 * was computed. For instance an L3 hash cannot be set as an L4 hash.
743 *
744 * A driver may indicate a hash level which is less specific than the
745 * actual layer the hash was computed on. For instance, a hash computed
746 * at L4 may be considered an L3 hash. This should only be done if the
747 * driver can't unambiguously determine that the HW computed the hash at
748 * the higher layer. Note that the "should" in the second property above
749 * permits this.
750 */
751enum pkt_hash_types {
752 PKT_HASH_TYPE_NONE, /* Undefined type */
753 PKT_HASH_TYPE_L2, /* Input: src_MAC, dest_MAC */
754 PKT_HASH_TYPE_L3, /* Input: src_IP, dst_IP */
755 PKT_HASH_TYPE_L4, /* Input: src_IP, dst_IP, src_port, dst_port */
756};
757
758static inline void
759skb_set_hash(struct sk_buff *skb, __u32 hash, enum pkt_hash_types type)
760{
761 skb->l4_rxhash = (type == PKT_HASH_TYPE_L4);
762 skb->rxhash = hash;
763}
764
765void __skb_get_hash(struct sk_buff *skb);
766static inline __u32 skb_get_hash(struct sk_buff *skb)
708{ 767{
709 if (!skb->l4_rxhash) 768 if (!skb->l4_rxhash)
710 __skb_get_rxhash(skb); 769 __skb_get_hash(skb);
711 770
712 return skb->rxhash; 771 return skb->rxhash;
713} 772}
714 773
774static inline __u32 skb_get_hash_raw(const struct sk_buff *skb)
775{
776 return skb->rxhash;
777}
778
779static inline void skb_clear_hash(struct sk_buff *skb)
780{
781 skb->rxhash = 0;
782 skb->l4_rxhash = 0;
783}
784
785static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb)
786{
787 if (!skb->l4_rxhash)
788 skb_clear_hash(skb);
789}
790
791static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from)
792{
793 to->rxhash = from->rxhash;
794 to->l4_rxhash = from->l4_rxhash;
795};
796
715#ifdef NET_SKBUFF_DATA_USES_OFFSET 797#ifdef NET_SKBUFF_DATA_USES_OFFSET
716static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) 798static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
717{ 799{
@@ -750,7 +832,7 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb)
750 */ 832 */
751static inline int skb_queue_empty(const struct sk_buff_head *list) 833static inline int skb_queue_empty(const struct sk_buff_head *list)
752{ 834{
753 return list->next == (struct sk_buff *)list; 835 return list->next == (const struct sk_buff *) list;
754} 836}
755 837
756/** 838/**
@@ -763,7 +845,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
763static inline bool skb_queue_is_last(const struct sk_buff_head *list, 845static inline bool skb_queue_is_last(const struct sk_buff_head *list,
764 const struct sk_buff *skb) 846 const struct sk_buff *skb)
765{ 847{
766 return skb->next == (struct sk_buff *)list; 848 return skb->next == (const struct sk_buff *) list;
767} 849}
768 850
769/** 851/**
@@ -776,7 +858,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
776static inline bool skb_queue_is_first(const struct sk_buff_head *list, 858static inline bool skb_queue_is_first(const struct sk_buff_head *list,
777 const struct sk_buff *skb) 859 const struct sk_buff *skb)
778{ 860{
779 return skb->prev == (struct sk_buff *)list; 861 return skb->prev == (const struct sk_buff *) list;
780} 862}
781 863
782/** 864/**
@@ -2368,9 +2450,13 @@ int skb_splice_bits(struct sk_buff *skb, unsigned int offset,
2368 struct pipe_inode_info *pipe, unsigned int len, 2450 struct pipe_inode_info *pipe, unsigned int len,
2369 unsigned int flags); 2451 unsigned int flags);
2370void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); 2452void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
2453unsigned int skb_zerocopy_headlen(const struct sk_buff *from);
2454void skb_zerocopy(struct sk_buff *to, const struct sk_buff *from,
2455 int len, int hlen);
2371void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len); 2456void skb_split(struct sk_buff *skb, struct sk_buff *skb1, const u32 len);
2372int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen); 2457int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, int shiftlen);
2373void skb_scrub_packet(struct sk_buff *skb, bool xnet); 2458void skb_scrub_packet(struct sk_buff *skb, bool xnet);
2459unsigned int skb_gso_transport_seglen(const struct sk_buff *skb);
2374struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features); 2460struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features);
2375 2461
2376struct skb_checksum_ops { 2462struct skb_checksum_ops {
@@ -2397,6 +2483,24 @@ static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
2397 return buffer; 2483 return buffer;
2398} 2484}
2399 2485
2486/**
2487 * skb_needs_linearize - check if we need to linearize a given skb
2488 * depending on the given device features.
2489 * @skb: socket buffer to check
2490 * @features: net device features
2491 *
2492 * Returns true if either:
2493 * 1. skb has frag_list and the device doesn't support FRAGLIST, or
2494 * 2. skb is fragmented and the device does not support SG.
2495 */
2496static inline bool skb_needs_linearize(struct sk_buff *skb,
2497 netdev_features_t features)
2498{
2499 return skb_is_nonlinear(skb) &&
2500 ((skb_has_frag_list(skb) && !(features & NETIF_F_FRAGLIST)) ||
2501 (skb_shinfo(skb)->nr_frags && !(features & NETIF_F_SG)));
2502}
2503
2400static inline void skb_copy_from_linear_data(const struct sk_buff *skb, 2504static inline void skb_copy_from_linear_data(const struct sk_buff *skb,
2401 void *to, 2505 void *to,
2402 const unsigned int len) 2506 const unsigned int len)
@@ -2795,6 +2899,8 @@ static inline void skb_checksum_none_assert(const struct sk_buff *skb)
2795 2899
2796bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2900bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2797 2901
2902int skb_checksum_setup(struct sk_buff *skb, bool recalculate);
2903
2798u32 __skb_get_poff(const struct sk_buff *skb); 2904u32 __skb_get_poff(const struct sk_buff *skb);
2799 2905
2800/** 2906/**
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 1e2f4fe12773..a060142aa5f5 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -513,7 +513,9 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
513 * 513 *
514 * Both the root cache and the child caches will have it. For the root cache, 514 * Both the root cache and the child caches will have it. For the root cache,
515 * this will hold a dynamically allocated array large enough to hold 515 * this will hold a dynamically allocated array large enough to hold
516 * information about the currently limited memcgs in the system. 516 * information about the currently limited memcgs in the system. To allow the
517 * array to be accessed without taking any locks, on relocation we free the old
518 * version only after a grace period.
517 * 519 *
518 * Child caches will hold extra metadata needed for its operation. Fields are: 520 * Child caches will hold extra metadata needed for its operation. Fields are:
519 * 521 *
@@ -528,7 +530,10 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
528struct memcg_cache_params { 530struct memcg_cache_params {
529 bool is_root_cache; 531 bool is_root_cache;
530 union { 532 union {
531 struct kmem_cache *memcg_caches[0]; 533 struct {
534 struct rcu_head rcu_head;
535 struct kmem_cache *memcg_caches[0];
536 };
532 struct { 537 struct {
533 struct mem_cgroup *memcg; 538 struct mem_cgroup *memcg;
534 struct list_head list; 539 struct list_head list;
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 09bfffb08a56..8235dfbb3b05 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -1,18 +1,20 @@
1#ifndef _LINUX_SLAB_DEF_H 1#ifndef _LINUX_SLAB_DEF_H
2#define _LINUX_SLAB_DEF_H 2#define _LINUX_SLAB_DEF_H
3 3
4#include <linux/reciprocal_div.h>
5
4/* 6/*
5 * Definitions unique to the original Linux SLAB allocator. 7 * Definitions unique to the original Linux SLAB allocator.
6 */ 8 */
7 9
8struct kmem_cache { 10struct kmem_cache {
9/* 1) Cache tunables. Protected by cache_chain_mutex */ 11/* 1) Cache tunables. Protected by slab_mutex */
10 unsigned int batchcount; 12 unsigned int batchcount;
11 unsigned int limit; 13 unsigned int limit;
12 unsigned int shared; 14 unsigned int shared;
13 15
14 unsigned int size; 16 unsigned int size;
15 u32 reciprocal_buffer_size; 17 struct reciprocal_value reciprocal_buffer_size;
16/* 2) touched by every alloc & free from the backend */ 18/* 2) touched by every alloc & free from the backend */
17 19
18 unsigned int flags; /* constant flags */ 20 unsigned int flags; /* constant flags */
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 5da22ee42e16..3834f43f9993 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -11,12 +11,16 @@
11#include <linux/list.h> 11#include <linux/list.h>
12#include <linux/cpumask.h> 12#include <linux/cpumask.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/llist.h>
14 15
15extern void cpu_idle(void); 16extern void cpu_idle(void);
16 17
17typedef void (*smp_call_func_t)(void *info); 18typedef void (*smp_call_func_t)(void *info);
18struct call_single_data { 19struct call_single_data {
19 struct list_head list; 20 union {
21 struct list_head list;
22 struct llist_node llist;
23 };
20 smp_call_func_t func; 24 smp_call_func_t func;
21 void *info; 25 void *info;
22 u16 flags; 26 u16 flags;
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 445ef7519dc2..8e98297f1388 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -45,13 +45,13 @@ struct linger {
45 */ 45 */
46 46
47struct msghdr { 47struct msghdr {
48 void * msg_name; /* Socket name */ 48 void *msg_name; /* ptr to socket address structure */
49 int msg_namelen; /* Length of name */ 49 int msg_namelen; /* size of socket address structure */
50 struct iovec * msg_iov; /* Data blocks */ 50 struct iovec *msg_iov; /* scatter/gather array */
51 __kernel_size_t msg_iovlen; /* Number of blocks */ 51 __kernel_size_t msg_iovlen; /* # elements in msg_iov */
52 void * msg_control; /* Per protocol magic (eg BSD file descriptor passing) */ 52 void *msg_control; /* ancillary data */
53 __kernel_size_t msg_controllen; /* Length of cmsg list */ 53 __kernel_size_t msg_controllen; /* ancillary data buffer length */
54 unsigned int msg_flags; 54 unsigned int msg_flags; /* flags on received message */
55}; 55};
56 56
57/* For recvmmsg/sendmmsg */ 57/* For recvmmsg/sendmmsg */
@@ -305,8 +305,6 @@ struct ucred {
305/* IPX options */ 305/* IPX options */
306#define IPX_TYPE 1 306#define IPX_TYPE 1
307 307
308extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred);
309
310extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, 308extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
311 int offset, int len); 309 int offset, int len);
312extern int csum_partial_copy_fromiovecend(unsigned char *kdata, 310extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h
deleted file mode 100644
index 0aa6acc73317..000000000000
--- a/include/linux/spi/74x164.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef LINUX_SPI_74X164_H
2#define LINUX_SPI_74X164_H
3
4struct gen_74x164_chip_platform_data {
5 /* number assigned to the first GPIO */
6 unsigned base;
7};
8
9#endif
diff --git a/include/linux/spi/s3c24xx.h b/include/linux/spi/s3c24xx.h
index c23b923e493b..ca271c06c591 100644
--- a/include/linux/spi/s3c24xx.h
+++ b/include/linux/spi/s3c24xx.h
@@ -23,4 +23,6 @@ struct s3c2410_spi_info {
23 void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); 23 void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol);
24}; 24};
25 25
26extern int s3c24xx_set_fiq(unsigned int irq, bool on);
27
26#endif /* __LINUX_SPI_S3C24XX_H */ 28#endif /* __LINUX_SPI_S3C24XX_H */
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 8c62ba74dd91..a1d4ca290862 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -75,6 +75,7 @@ struct spi_device {
75 struct spi_master *master; 75 struct spi_master *master;
76 u32 max_speed_hz; 76 u32 max_speed_hz;
77 u8 chip_select; 77 u8 chip_select;
78 u8 bits_per_word;
78 u16 mode; 79 u16 mode;
79#define SPI_CPHA 0x01 /* clock phase */ 80#define SPI_CPHA 0x01 /* clock phase */
80#define SPI_CPOL 0x02 /* clock polarity */ 81#define SPI_CPOL 0x02 /* clock polarity */
@@ -92,7 +93,6 @@ struct spi_device {
92#define SPI_TX_QUAD 0x200 /* transmit with 4 wires */ 93#define SPI_TX_QUAD 0x200 /* transmit with 4 wires */
93#define SPI_RX_DUAL 0x400 /* receive with 2 wires */ 94#define SPI_RX_DUAL 0x400 /* receive with 2 wires */
94#define SPI_RX_QUAD 0x800 /* receive with 4 wires */ 95#define SPI_RX_QUAD 0x800 /* receive with 4 wires */
95 u8 bits_per_word;
96 int irq; 96 int irq;
97 void *controller_state; 97 void *controller_state;
98 void *controller_data; 98 void *controller_data;
@@ -277,15 +277,17 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
277 * @unprepare_transfer_hardware: there are currently no more messages on the 277 * @unprepare_transfer_hardware: there are currently no more messages on the
278 * queue so the subsystem notifies the driver that it may relax the 278 * queue so the subsystem notifies the driver that it may relax the
279 * hardware by issuing this call 279 * hardware by issuing this call
280 * @set_cs: assert or deassert chip select, true to assert. May be called 280 * @set_cs: set the logic level of the chip select line. May be called
281 * from interrupt context. 281 * from interrupt context.
282 * @prepare_message: set up the controller to transfer a single message, 282 * @prepare_message: set up the controller to transfer a single message,
283 * for example doing DMA mapping. Called from threaded 283 * for example doing DMA mapping. Called from threaded
284 * context. 284 * context.
285 * @transfer_one: transfer a single spi_transfer. When the 285 * @transfer_one: transfer a single spi_transfer.
286 * driver is finished with this transfer it must call 286 * - return 0 if the transfer is finished,
287 * spi_finalize_current_transfer() so the subsystem can issue 287 * - return 1 if the transfer is still in progress. When
288 * the next transfer 288 * the driver is finished with this transfer it must
289 * call spi_finalize_current_transfer() so the subsystem
290 * can issue the next transfer
289 * @unprepare_message: undo any work done by prepare_message(). 291 * @unprepare_message: undo any work done by prepare_message().
290 * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS 292 * @cs_gpios: Array of GPIOs to use as chip select lines; one per CS
291 * number. Any individual value may be -ENOENT for CS lines that 293 * number. Any individual value may be -ENOENT for CS lines that
@@ -576,8 +578,8 @@ struct spi_transfer {
576 dma_addr_t rx_dma; 578 dma_addr_t rx_dma;
577 579
578 unsigned cs_change:1; 580 unsigned cs_change:1;
579 u8 tx_nbits; 581 unsigned tx_nbits:3;
580 u8 rx_nbits; 582 unsigned rx_nbits:3;
581#define SPI_NBITS_SINGLE 0x01 /* 1bit transfer */ 583#define SPI_NBITS_SINGLE 0x01 /* 1bit transfer */
582#define SPI_NBITS_DUAL 0x02 /* 2bits transfer */ 584#define SPI_NBITS_DUAL 0x02 /* 2bits transfer */
583#define SPI_NBITS_QUAD 0x04 /* 4bits transfer */ 585#define SPI_NBITS_QUAD 0x04 /* 4bits transfer */
@@ -847,7 +849,7 @@ static inline ssize_t spi_w8r16(struct spi_device *spi, u8 cmd)
847 ssize_t status; 849 ssize_t status;
848 u16 result; 850 u16 result;
849 851
850 status = spi_write_then_read(spi, &cmd, 1, (u8 *) &result, 2); 852 status = spi_write_then_read(spi, &cmd, 1, &result, 2);
851 853
852 /* return negative errno or unsigned value */ 854 /* return negative errno or unsigned value */
853 return (status < 0) ? status : result; 855 return (status < 0) ? status : result;
diff --git a/include/linux/splice.h b/include/linux/splice.h
index 74575cbf2d6f..0e43906d2fda 100644
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
@@ -24,7 +24,8 @@
24 * Passed to the actors 24 * Passed to the actors
25 */ 25 */
26struct splice_desc { 26struct splice_desc {
27 unsigned int len, total_len; /* current and remaining length */ 27 size_t total_len; /* remaining length */
28 unsigned int len; /* current length */
28 unsigned int flags; /* splice flags */ 29 unsigned int flags; /* splice flags */
29 /* 30 /*
30 * actor() private data 31 * actor() private data
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index c64999fd1660..07ef9b82b66d 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -486,6 +486,7 @@ struct ssb_bus {
486#endif /* EMBEDDED */ 486#endif /* EMBEDDED */
487#ifdef CONFIG_SSB_DRIVER_GPIO 487#ifdef CONFIG_SSB_DRIVER_GPIO
488 struct gpio_chip gpio; 488 struct gpio_chip gpio;
489 struct irq_domain *irq_domain;
489#endif /* DRIVER_GPIO */ 490#endif /* DRIVER_GPIO */
490 491
491 /* Internal-only stuff follows. Do not touch. */ 492 /* Internal-only stuff follows. Do not touch. */
diff --git a/include/linux/ssbi.h b/include/linux/ssbi.h
index 44ef5da21470..bcbb642a7641 100644
--- a/include/linux/ssbi.h
+++ b/include/linux/ssbi.h
@@ -17,22 +17,7 @@
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19 19
20struct ssbi_slave_info { 20int ssbi_write(struct device *dev, u16 addr, const u8 *buf, int len);
21 const char *name;
22 void *platform_data;
23};
24
25enum ssbi_controller_type {
26 MSM_SBI_CTRL_SSBI = 0,
27 MSM_SBI_CTRL_SSBI2,
28 MSM_SBI_CTRL_PMIC_ARBITER,
29};
30
31struct ssbi_platform_data {
32 struct ssbi_slave_info slave;
33 enum ssbi_controller_type controller_type;
34};
35
36int ssbi_write(struct device *dev, u16 addr, u8 *buf, int len);
37int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len); 21int ssbi_read(struct device *dev, u16 addr, u8 *buf, int len);
22
38#endif 23#endif
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index bb5deb0feb6b..6f27d4f957bd 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -110,12 +110,34 @@ struct plat_stmmacenet_data {
110 int force_sf_dma_mode; 110 int force_sf_dma_mode;
111 int force_thresh_dma_mode; 111 int force_thresh_dma_mode;
112 int riwt_off; 112 int riwt_off;
113 int max_speed;
114 int maxmtu;
113 void (*fix_mac_speed)(void *priv, unsigned int speed); 115 void (*fix_mac_speed)(void *priv, unsigned int speed);
114 void (*bus_setup)(void __iomem *ioaddr); 116 void (*bus_setup)(void __iomem *ioaddr);
115 int (*init)(struct platform_device *pdev); 117 void *(*setup)(struct platform_device *pdev);
116 void (*exit)(struct platform_device *pdev); 118 void (*free)(struct platform_device *pdev, void *priv);
119 int (*init)(struct platform_device *pdev, void *priv);
120 void (*exit)(struct platform_device *pdev, void *priv);
117 void *custom_cfg; 121 void *custom_cfg;
118 void *custom_data; 122 void *custom_data;
119 void *bsp_priv; 123 void *bsp_priv;
120}; 124};
125
126/* of_data for SoC glue layer device tree bindings */
127
128struct stmmac_of_data {
129 int has_gmac;
130 int enh_desc;
131 int tx_coe;
132 int rx_coe;
133 int bugged_jumbo;
134 int pmt;
135 int riwt_off;
136 void (*fix_mac_speed)(void *priv, unsigned int speed);
137 void (*bus_setup)(void __iomem *ioaddr);
138 void *(*setup)(struct platform_device *pdev);
139 void (*free)(struct platform_device *pdev, void *priv);
140 int (*init)(struct platform_device *pdev, void *priv);
141 void (*exit)(struct platform_device *pdev, void *priv);
142};
121#endif 143#endif
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index a353e0300b54..7f490bef9e99 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -84,7 +84,8 @@ enum {
84 84
85extern struct dentry *rpc_d_lookup_sb(const struct super_block *sb, 85extern struct dentry *rpc_d_lookup_sb(const struct super_block *sb,
86 const unsigned char *dir_name); 86 const unsigned char *dir_name);
87extern void rpc_pipefs_init_net(struct net *net); 87extern int rpc_pipefs_init_net(struct net *net);
88extern void rpc_pipefs_exit_net(struct net *net);
88extern struct super_block *rpc_get_sb_net(const struct net *net); 89extern struct super_block *rpc_get_sb_net(const struct net *net);
89extern void rpc_put_sb_net(const struct net *net); 90extern void rpc_put_sb_net(const struct net *net);
90 91
@@ -130,5 +131,7 @@ extern int rpc_unlink(struct dentry *);
130extern int register_rpc_pipefs(void); 131extern int register_rpc_pipefs(void);
131extern void unregister_rpc_pipefs(void); 132extern void unregister_rpc_pipefs(void);
132 133
134extern bool gssd_running(struct net *net);
135
133#endif 136#endif
134#endif 137#endif
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 6eecfc2e4f98..04e763221246 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -368,7 +368,7 @@ struct svc_program {
368 struct svc_program * pg_next; /* other programs (same xprt) */ 368 struct svc_program * pg_next; /* other programs (same xprt) */
369 u32 pg_prog; /* program number */ 369 u32 pg_prog; /* program number */
370 unsigned int pg_lovers; /* lowest version */ 370 unsigned int pg_lovers; /* lowest version */
371 unsigned int pg_hivers; /* lowest version */ 371 unsigned int pg_hivers; /* highest version */
372 unsigned int pg_nvers; /* number of versions */ 372 unsigned int pg_nvers; /* number of versions */
373 struct svc_version ** pg_vers; /* version array */ 373 struct svc_version ** pg_vers; /* version array */
374 char * pg_name; /* service name */ 374 char * pg_name; /* service name */
@@ -386,8 +386,10 @@ struct svc_version {
386 struct svc_procedure * vs_proc; /* per-procedure info */ 386 struct svc_procedure * vs_proc; /* per-procedure info */
387 u32 vs_xdrsize; /* xdrsize needed for this version */ 387 u32 vs_xdrsize; /* xdrsize needed for this version */
388 388
389 unsigned int vs_hidden : 1; /* Don't register with portmapper. 389 unsigned int vs_hidden : 1, /* Don't register with portmapper.
390 * Only used for nfsacl so far. */ 390 * Only used for nfsacl so far. */
391 vs_rpcb_optnl:1;/* Don't care the result of register.
392 * Only used for nfsv4. */
391 393
392 /* Override dispatch function (e.g. when caching replies). 394 /* Override dispatch function (e.g. when caching replies).
393 * A return value of 0 means drop the request. 395 * A return value of 0 means drop the request.
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 6695040a0317..30b2ebee6439 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -12,6 +12,7 @@
12#ifndef _SYSFS_H_ 12#ifndef _SYSFS_H_
13#define _SYSFS_H_ 13#define _SYSFS_H_
14 14
15#include <linux/kernfs.h>
15#include <linux/compiler.h> 16#include <linux/compiler.h>
16#include <linux/errno.h> 17#include <linux/errno.h>
17#include <linux/list.h> 18#include <linux/list.h>
@@ -175,8 +176,6 @@ struct sysfs_ops {
175 ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t); 176 ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t);
176}; 177};
177 178
178struct sysfs_dirent;
179
180#ifdef CONFIG_SYSFS 179#ifdef CONFIG_SYSFS
181 180
182int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), 181int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *),
@@ -244,12 +243,6 @@ void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name,
244 const char *link_name); 243 const char *link_name);
245 244
246void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); 245void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr);
247void sysfs_notify_dirent(struct sysfs_dirent *sd);
248struct sysfs_dirent *sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd,
249 const unsigned char *name,
250 const void *ns);
251struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd);
252void sysfs_put(struct sysfs_dirent *sd);
253 246
254int __must_check sysfs_init(void); 247int __must_check sysfs_init(void);
255 248
@@ -419,22 +412,6 @@ static inline void sysfs_notify(struct kobject *kobj, const char *dir,
419 const char *attr) 412 const char *attr)
420{ 413{
421} 414}
422static inline void sysfs_notify_dirent(struct sysfs_dirent *sd)
423{
424}
425static inline struct sysfs_dirent *
426sysfs_get_dirent_ns(struct sysfs_dirent *parent_sd, const unsigned char *name,
427 const void *ns)
428{
429 return NULL;
430}
431static inline struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd)
432{
433 return NULL;
434}
435static inline void sysfs_put(struct sysfs_dirent *sd)
436{
437}
438 415
439static inline int __must_check sysfs_init(void) 416static inline int __must_check sysfs_init(void)
440{ 417{
@@ -461,10 +438,26 @@ static inline int sysfs_rename_link(struct kobject *kobj, struct kobject *target
461 return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL); 438 return sysfs_rename_link_ns(kobj, target, old_name, new_name, NULL);
462} 439}
463 440
464static inline struct sysfs_dirent * 441static inline void sysfs_notify_dirent(struct kernfs_node *kn)
465sysfs_get_dirent(struct sysfs_dirent *parent_sd, const unsigned char *name) 442{
443 kernfs_notify(kn);
444}
445
446static inline struct kernfs_node *sysfs_get_dirent(struct kernfs_node *parent,
447 const unsigned char *name)
448{
449 return kernfs_find_and_get(parent, name);
450}
451
452static inline struct kernfs_node *sysfs_get(struct kernfs_node *kn)
453{
454 kernfs_get(kn);
455 return kn;
456}
457
458static inline void sysfs_put(struct kernfs_node *kn)
466{ 459{
467 return sysfs_get_dirent_ns(parent_sd, name, NULL); 460 kernfs_put(kn);
468} 461}
469 462
470#endif /* _SYSFS_H_ */ 463#endif /* _SYSFS_H_ */
diff --git a/include/linux/tboot.h b/include/linux/tboot.h
index c75128bed5fa..9a54b331f938 100644
--- a/include/linux/tboot.h
+++ b/include/linux/tboot.h
@@ -34,7 +34,7 @@ enum {
34}; 34};
35 35
36#ifdef CONFIG_INTEL_TXT 36#ifdef CONFIG_INTEL_TXT
37#include <acpi/acpi.h> 37#include <linux/acpi.h>
38/* used to communicate between tboot and the launched kernel */ 38/* used to communicate between tboot and the launched kernel */
39 39
40#define TB_KEY_SIZE 64 /* 512 bits */ 40#define TB_KEY_SIZE 64 /* 512 bits */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index d68633452d9b..4ad0706d40eb 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -248,7 +248,10 @@ struct tcp_sock {
248 struct sk_buff* lost_skb_hint; 248 struct sk_buff* lost_skb_hint;
249 struct sk_buff *retransmit_skb_hint; 249 struct sk_buff *retransmit_skb_hint;
250 250
251 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ 251 /* OOO segments go in this list. Note that socket lock must be held,
252 * as we do not use sk_buff_head lock.
253 */
254 struct sk_buff_head out_of_order_queue;
252 255
253 /* SACKs data, these 2 need to be together (see tcp_options_write) */ 256 /* SACKs data, these 2 need to be together (see tcp_options_write) */
254 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ 257 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
diff --git a/include/linux/tegra-powergate.h b/include/linux/tegra-powergate.h
index fd4498329c7c..46f0a07812b4 100644
--- a/include/linux/tegra-powergate.h
+++ b/include/linux/tegra-powergate.h
@@ -19,6 +19,7 @@
19#define _MACH_TEGRA_POWERGATE_H_ 19#define _MACH_TEGRA_POWERGATE_H_
20 20
21struct clk; 21struct clk;
22struct reset_control;
22 23
23#define TEGRA_POWERGATE_CPU 0 24#define TEGRA_POWERGATE_CPU 0
24#define TEGRA_POWERGATE_3D 1 25#define TEGRA_POWERGATE_3D 1
@@ -37,14 +38,49 @@ struct clk;
37#define TEGRA_POWERGATE_CPU0 14 38#define TEGRA_POWERGATE_CPU0 14
38#define TEGRA_POWERGATE_C0NC 15 39#define TEGRA_POWERGATE_C0NC 15
39#define TEGRA_POWERGATE_C1NC 16 40#define TEGRA_POWERGATE_C1NC 16
41#define TEGRA_POWERGATE_SOR 17
40#define TEGRA_POWERGATE_DIS 18 42#define TEGRA_POWERGATE_DIS 18
41#define TEGRA_POWERGATE_DISB 19 43#define TEGRA_POWERGATE_DISB 19
42#define TEGRA_POWERGATE_XUSBA 20 44#define TEGRA_POWERGATE_XUSBA 20
43#define TEGRA_POWERGATE_XUSBB 21 45#define TEGRA_POWERGATE_XUSBB 21
44#define TEGRA_POWERGATE_XUSBC 22 46#define TEGRA_POWERGATE_XUSBC 22
47#define TEGRA_POWERGATE_VIC 23
48#define TEGRA_POWERGATE_IRAM 24
45 49
46#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D 50#define TEGRA_POWERGATE_3D0 TEGRA_POWERGATE_3D
47 51
52#define TEGRA_IO_RAIL_CSIA 0
53#define TEGRA_IO_RAIL_CSIB 1
54#define TEGRA_IO_RAIL_DSI 2
55#define TEGRA_IO_RAIL_MIPI_BIAS 3
56#define TEGRA_IO_RAIL_PEX_BIAS 4
57#define TEGRA_IO_RAIL_PEX_CLK1 5
58#define TEGRA_IO_RAIL_PEX_CLK2 6
59#define TEGRA_IO_RAIL_USB0 9
60#define TEGRA_IO_RAIL_USB1 10
61#define TEGRA_IO_RAIL_USB2 11
62#define TEGRA_IO_RAIL_USB_BIAS 12
63#define TEGRA_IO_RAIL_NAND 13
64#define TEGRA_IO_RAIL_UART 14
65#define TEGRA_IO_RAIL_BB 15
66#define TEGRA_IO_RAIL_AUDIO 17
67#define TEGRA_IO_RAIL_HSIC 19
68#define TEGRA_IO_RAIL_COMP 22
69#define TEGRA_IO_RAIL_HDMI 28
70#define TEGRA_IO_RAIL_PEX_CNTRL 32
71#define TEGRA_IO_RAIL_SDMMC1 33
72#define TEGRA_IO_RAIL_SDMMC3 34
73#define TEGRA_IO_RAIL_SDMMC4 35
74#define TEGRA_IO_RAIL_CAM 36
75#define TEGRA_IO_RAIL_RES 37
76#define TEGRA_IO_RAIL_HV 38
77#define TEGRA_IO_RAIL_DSIB 39
78#define TEGRA_IO_RAIL_DSIC 40
79#define TEGRA_IO_RAIL_DSID 41
80#define TEGRA_IO_RAIL_CSIE 44
81#define TEGRA_IO_RAIL_LVDS 57
82#define TEGRA_IO_RAIL_SYS_DDC 58
83
48#ifdef CONFIG_ARCH_TEGRA 84#ifdef CONFIG_ARCH_TEGRA
49int tegra_powergate_is_powered(int id); 85int tegra_powergate_is_powered(int id);
50int tegra_powergate_power_on(int id); 86int tegra_powergate_power_on(int id);
@@ -52,7 +88,11 @@ int tegra_powergate_power_off(int id);
52int tegra_powergate_remove_clamping(int id); 88int tegra_powergate_remove_clamping(int id);
53 89
54/* Must be called with clk disabled, and returns with clk enabled */ 90/* Must be called with clk disabled, and returns with clk enabled */
55int tegra_powergate_sequence_power_up(int id, struct clk *clk); 91int tegra_powergate_sequence_power_up(int id, struct clk *clk,
92 struct reset_control *rst);
93
94int tegra_io_rail_power_on(int id);
95int tegra_io_rail_power_off(int id);
56#else 96#else
57static inline int tegra_powergate_is_powered(int id) 97static inline int tegra_powergate_is_powered(int id)
58{ 98{
@@ -74,7 +114,18 @@ static inline int tegra_powergate_remove_clamping(int id)
74 return -ENOSYS; 114 return -ENOSYS;
75} 115}
76 116
77static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk) 117static inline int tegra_powergate_sequence_power_up(int id, struct clk *clk,
118 struct reset_control *rst)
119{
120 return -ENOSYS;
121}
122
123static inline int tegra_io_rail_power_on(int id)
124{
125 return -ENOSYS;
126}
127
128static inline int tegra_io_rail_power_off(int id)
78{ 129{
79 return -ENOSYS; 130 return -ENOSYS;
80} 131}
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index b268d3cf7ae3..f7e11c7ea7d9 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -25,6 +25,7 @@
25#ifndef __THERMAL_H__ 25#ifndef __THERMAL_H__
26#define __THERMAL_H__ 26#define __THERMAL_H__
27 27
28#include <linux/of.h>
28#include <linux/idr.h> 29#include <linux/idr.h>
29#include <linux/device.h> 30#include <linux/device.h>
30#include <linux/workqueue.h> 31#include <linux/workqueue.h>
@@ -143,6 +144,7 @@ struct thermal_cooling_device {
143 int id; 144 int id;
144 char type[THERMAL_NAME_LENGTH]; 145 char type[THERMAL_NAME_LENGTH];
145 struct device device; 146 struct device device;
147 struct device_node *np;
146 void *devdata; 148 void *devdata;
147 const struct thermal_cooling_device_ops *ops; 149 const struct thermal_cooling_device_ops *ops;
148 bool updated; /* true if the cooling device does not need update */ 150 bool updated; /* true if the cooling device does not need update */
@@ -172,7 +174,7 @@ struct thermal_zone_device {
172 int emul_temperature; 174 int emul_temperature;
173 int passive; 175 int passive;
174 unsigned int forced_passive; 176 unsigned int forced_passive;
175 const struct thermal_zone_device_ops *ops; 177 struct thermal_zone_device_ops *ops;
176 const struct thermal_zone_params *tzp; 178 const struct thermal_zone_params *tzp;
177 struct thermal_governor *governor; 179 struct thermal_governor *governor;
178 struct list_head thermal_instances; 180 struct list_head thermal_instances;
@@ -242,8 +244,31 @@ struct thermal_genl_event {
242}; 244};
243 245
244/* Function declarations */ 246/* Function declarations */
247#ifdef CONFIG_THERMAL_OF
248struct thermal_zone_device *
249thermal_zone_of_sensor_register(struct device *dev, int id,
250 void *data, int (*get_temp)(void *, long *),
251 int (*get_trend)(void *, long *));
252void thermal_zone_of_sensor_unregister(struct device *dev,
253 struct thermal_zone_device *tz);
254#else
255static inline struct thermal_zone_device *
256thermal_zone_of_sensor_register(struct device *dev, int id,
257 void *data, int (*get_temp)(void *, long *),
258 int (*get_trend)(void *, long *))
259{
260 return NULL;
261}
262
263static inline
264void thermal_zone_of_sensor_unregister(struct device *dev,
265 struct thermal_zone_device *tz)
266{
267}
268
269#endif
245struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, 270struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
246 void *, const struct thermal_zone_device_ops *, 271 void *, struct thermal_zone_device_ops *,
247 const struct thermal_zone_params *, int, int); 272 const struct thermal_zone_params *, int, int);
248void thermal_zone_device_unregister(struct thermal_zone_device *); 273void thermal_zone_device_unregister(struct thermal_zone_device *);
249 274
@@ -256,6 +281,9 @@ void thermal_zone_device_update(struct thermal_zone_device *);
256 281
257struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, 282struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
258 const struct thermal_cooling_device_ops *); 283 const struct thermal_cooling_device_ops *);
284struct thermal_cooling_device *
285thermal_of_cooling_device_register(struct device_node *np, char *, void *,
286 const struct thermal_cooling_device_ops *);
259void thermal_cooling_device_unregister(struct thermal_cooling_device *); 287void thermal_cooling_device_unregister(struct thermal_cooling_device *);
260struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name); 288struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name);
261int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp); 289int thermal_zone_get_temp(struct thermal_zone_device *tz, unsigned long *temp);
diff --git a/include/linux/tick.h b/include/linux/tick.h
index 0175d8663b6c..b84773cb9f4c 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -104,7 +104,7 @@ extern struct cpumask *tick_get_broadcast_oneshot_mask(void);
104extern void tick_clock_notify(void); 104extern void tick_clock_notify(void);
105extern int tick_check_oneshot_change(int allow_nohz); 105extern int tick_check_oneshot_change(int allow_nohz);
106extern struct tick_sched *tick_get_tick_sched(int cpu); 106extern struct tick_sched *tick_get_tick_sched(int cpu);
107extern void tick_check_idle(void); 107extern void tick_irq_enter(void);
108extern int tick_oneshot_mode_active(void); 108extern int tick_oneshot_mode_active(void);
109# ifndef arch_needs_cpu 109# ifndef arch_needs_cpu
110# define arch_needs_cpu(cpu) (0) 110# define arch_needs_cpu(cpu) (0)
@@ -112,7 +112,7 @@ extern int tick_oneshot_mode_active(void);
112# else 112# else
113static inline void tick_clock_notify(void) { } 113static inline void tick_clock_notify(void) { }
114static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } 114static inline int tick_check_oneshot_change(int allow_nohz) { return 0; }
115static inline void tick_check_idle(void) { } 115static inline void tick_irq_enter(void) { }
116static inline int tick_oneshot_mode_active(void) { return 0; } 116static inline int tick_oneshot_mode_active(void) { return 0; }
117# endif 117# endif
118 118
@@ -121,7 +121,7 @@ static inline void tick_init(void) { }
121static inline void tick_cancel_sched_timer(int cpu) { } 121static inline void tick_cancel_sched_timer(int cpu) { }
122static inline void tick_clock_notify(void) { } 122static inline void tick_clock_notify(void) { }
123static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } 123static inline int tick_check_oneshot_change(int allow_nohz) { return 0; }
124static inline void tick_check_idle(void) { } 124static inline void tick_irq_enter(void) { }
125static inline int tick_oneshot_mode_active(void) { return 0; } 125static inline int tick_oneshot_mode_active(void) { return 0; }
126#endif /* !CONFIG_GENERIC_CLOCKEVENTS */ 126#endif /* !CONFIG_GENERIC_CLOCKEVENTS */
127 127
diff --git a/include/linux/tpm.h b/include/linux/tpm.h
index 9a9051bb1a03..fff1d0976f80 100644
--- a/include/linux/tpm.h
+++ b/include/linux/tpm.h
@@ -29,6 +29,18 @@
29 */ 29 */
30#define TPM_ANY_NUM 0xFFFF 30#define TPM_ANY_NUM 0xFFFF
31 31
32struct tpm_chip;
33
34struct tpm_class_ops {
35 const u8 req_complete_mask;
36 const u8 req_complete_val;
37 bool (*req_canceled)(struct tpm_chip *chip, u8 status);
38 int (*recv) (struct tpm_chip *chip, u8 *buf, size_t len);
39 int (*send) (struct tpm_chip *chip, u8 *buf, size_t len);
40 void (*cancel) (struct tpm_chip *chip);
41 u8 (*status) (struct tpm_chip *chip);
42};
43
32#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) 44#if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE)
33 45
34extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); 46extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf);
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index f16dc0a40049..accc497f8d72 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -276,7 +276,7 @@ static inline void tracepoint_synchronize_unregister(void)
276 * For use with the TRACE_EVENT macro: 276 * For use with the TRACE_EVENT macro:
277 * 277 *
278 * We define a tracepoint, its arguments, its printk format 278 * We define a tracepoint, its arguments, its printk format
279 * and its 'fast binay record' layout. 279 * and its 'fast binary record' layout.
280 * 280 *
281 * Firstly, name your tracepoint via TRACE_EVENT(name : the 281 * Firstly, name your tracepoint via TRACE_EVENT(name : the
282 * 'subsystem_event' notation is fine. 282 * 'subsystem_event' notation is fine.
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 97d660ed70c1..90b4fdc8a61f 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -39,10 +39,14 @@ struct tty_buffer {
39 int size; 39 int size;
40 int commit; 40 int commit;
41 int read; 41 int read;
42 int flags;
42 /* Data points here */ 43 /* Data points here */
43 unsigned long data[0]; 44 unsigned long data[0];
44}; 45};
45 46
47/* Values for .flags field of tty_buffer */
48#define TTYB_NORMAL 1 /* buffer has no flags buffer */
49
46static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs) 50static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs)
47{ 51{
48 return ((unsigned char *)b->data) + ofs; 52 return ((unsigned char *)b->data) + ofs;
@@ -60,7 +64,8 @@ struct tty_bufhead {
60 atomic_t priority; 64 atomic_t priority;
61 struct tty_buffer sentinel; 65 struct tty_buffer sentinel;
62 struct llist_head free; /* Free queue head */ 66 struct llist_head free; /* Free queue head */
63 atomic_t memory_used; /* In-use buffers excluding free list */ 67 atomic_t mem_used; /* In-use buffers excluding free list */
68 int mem_limit;
64 struct tty_buffer *tail; /* Active buffer */ 69 struct tty_buffer *tail; /* Active buffer */
65}; 70};
66/* 71/*
@@ -137,6 +142,7 @@ struct tty_bufhead {
137#define C_CLOCAL(tty) _C_FLAG((tty), CLOCAL) 142#define C_CLOCAL(tty) _C_FLAG((tty), CLOCAL)
138#define C_CIBAUD(tty) _C_FLAG((tty), CIBAUD) 143#define C_CIBAUD(tty) _C_FLAG((tty), CIBAUD)
139#define C_CRTSCTS(tty) _C_FLAG((tty), CRTSCTS) 144#define C_CRTSCTS(tty) _C_FLAG((tty), CRTSCTS)
145#define C_CMSPAR(tty) _C_FLAG((tty), CMSPAR)
140 146
141#define L_ISIG(tty) _L_FLAG((tty), ISIG) 147#define L_ISIG(tty) _L_FLAG((tty), ISIG)
142#define L_ICANON(tty) _L_FLAG((tty), ICANON) 148#define L_ICANON(tty) _L_FLAG((tty), ICANON)
@@ -422,7 +428,6 @@ extern int is_ignored(int sig);
422extern int tty_signal(int sig, struct tty_struct *tty); 428extern int tty_signal(int sig, struct tty_struct *tty);
423extern void tty_hangup(struct tty_struct *tty); 429extern void tty_hangup(struct tty_struct *tty);
424extern void tty_vhangup(struct tty_struct *tty); 430extern void tty_vhangup(struct tty_struct *tty);
425extern void tty_vhangup_locked(struct tty_struct *tty);
426extern void tty_unhangup(struct file *filp); 431extern void tty_unhangup(struct file *filp);
427extern int tty_hung_up_p(struct file *filp); 432extern int tty_hung_up_p(struct file *filp);
428extern void do_SAK(struct tty_struct *tty); 433extern void do_SAK(struct tty_struct *tty);
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index 21ddd7d9ea1f..c28dd523f96e 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_set_limit(struct tty_port *port, int limit);
4extern int tty_buffer_space_avail(struct tty_port *port); 5extern int tty_buffer_space_avail(struct tty_port *port);
5extern int tty_buffer_request_room(struct tty_port *port, size_t size); 6extern int tty_buffer_request_room(struct tty_port *port, size_t size);
6extern int tty_insert_flip_string_flags(struct tty_port *port, 7extern int tty_insert_flip_string_flags(struct tty_port *port,
@@ -9,8 +10,6 @@ extern int tty_insert_flip_string_fixed_flag(struct tty_port *port,
9 const unsigned char *chars, char flag, size_t size); 10 const unsigned char *chars, char flag, size_t size);
10extern int tty_prepare_flip_string(struct tty_port *port, 11extern int tty_prepare_flip_string(struct tty_port *port,
11 unsigned char **chars, size_t size); 12 unsigned char **chars, size_t size);
12extern int tty_prepare_flip_string_flags(struct tty_port *port,
13 unsigned char **chars, char **flags, size_t size);
14extern void tty_flip_buffer_push(struct tty_port *port); 13extern void tty_flip_buffer_push(struct tty_port *port);
15void tty_schedule_flip(struct tty_port *port); 14void tty_schedule_flip(struct tty_port *port);
16 15
@@ -18,8 +17,12 @@ static inline int tty_insert_flip_char(struct tty_port *port,
18 unsigned char ch, char flag) 17 unsigned char ch, char flag)
19{ 18{
20 struct tty_buffer *tb = port->buf.tail; 19 struct tty_buffer *tb = port->buf.tail;
21 if (tb && tb->used < tb->size) { 20 int change;
22 *flag_buf_ptr(tb, tb->used) = flag; 21
22 change = (tb->flags & TTYB_NORMAL) && (flag != TTY_NORMAL);
23 if (!change && tb->used < tb->size) {
24 if (~tb->flags & TTYB_NORMAL)
25 *flag_buf_ptr(tb, tb->used) = flag;
23 *char_buf_ptr(tb, tb->used++) = ch; 26 *char_buf_ptr(tb, tb->used++) = ch;
24 return 1; 27 return 1;
25 } 28 }
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index f15c898ff462..b8347c207cb8 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -84,7 +84,8 @@
84 * processing. <cp> is a pointer to the buffer of input 84 * processing. <cp> is a pointer to the buffer of input
85 * character received by the device. <fp> is a pointer to a 85 * character received by the device. <fp> is a pointer to a
86 * pointer of flag bytes which indicate whether a character was 86 * pointer of flag bytes which indicate whether a character was
87 * received with a parity error, etc. 87 * received with a parity error, etc. <fp> may be NULL to indicate
88 * all data received is TTY_NORMAL.
88 * 89 *
89 * void (*write_wakeup)(struct tty_struct *); 90 * void (*write_wakeup)(struct tty_struct *);
90 * 91 *
@@ -118,7 +119,8 @@
118 * processing. <cp> is a pointer to the buffer of input 119 * processing. <cp> is a pointer to the buffer of input
119 * character received by the device. <fp> is a pointer to a 120 * character received by the device. <fp> is a pointer to a
120 * pointer of flag bytes which indicate whether a character was 121 * pointer of flag bytes which indicate whether a character was
121 * received with a parity error, etc. 122 * received with a parity error, etc. <fp> may be NULL to indicate
123 * all data received is TTY_NORMAL.
122 * If assigned, prefer this function for automatic flow control. 124 * If assigned, prefer this function for automatic flow control.
123 */ 125 */
124 126
diff --git a/include/linux/uidgid.h b/include/linux/uidgid.h
index 8e522cbcef29..2d1f9b627f91 100644
--- a/include/linux/uidgid.h
+++ b/include/linux/uidgid.h
@@ -17,8 +17,6 @@
17struct user_namespace; 17struct user_namespace;
18extern struct user_namespace init_user_ns; 18extern struct user_namespace init_user_ns;
19 19
20#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
21
22typedef struct { 20typedef struct {
23 uid_t val; 21 uid_t val;
24} kuid_t; 22} kuid_t;
@@ -41,26 +39,6 @@ static inline gid_t __kgid_val(kgid_t gid)
41 return gid.val; 39 return gid.val;
42} 40}
43 41
44#else
45
46typedef uid_t kuid_t;
47typedef gid_t kgid_t;
48
49static inline uid_t __kuid_val(kuid_t uid)
50{
51 return uid;
52}
53
54static inline gid_t __kgid_val(kgid_t gid)
55{
56 return gid;
57}
58
59#define KUIDT_INIT(value) ((kuid_t) value )
60#define KGIDT_INIT(value) ((kgid_t) value )
61
62#endif
63
64#define GLOBAL_ROOT_UID KUIDT_INIT(0) 42#define GLOBAL_ROOT_UID KUIDT_INIT(0)
65#define GLOBAL_ROOT_GID KGIDT_INIT(0) 43#define GLOBAL_ROOT_GID KGIDT_INIT(0)
66 44
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 512ab162832c..c716da18c668 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -965,6 +965,7 @@ struct usb_dynid {
965}; 965};
966 966
967extern ssize_t usb_store_new_id(struct usb_dynids *dynids, 967extern ssize_t usb_store_new_id(struct usb_dynids *dynids,
968 const struct usb_device_id *id_table,
968 struct device_driver *driver, 969 struct device_driver *driver,
969 const char *buf, size_t count); 970 const char *buf, size_t count);
970 971
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index 7d399671a566..708bd119627f 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -24,6 +24,7 @@ struct ci_hdrc_platform_data {
24 * but otg is not supported (no register otgsc). 24 * but otg is not supported (no register otgsc).
25 */ 25 */
26#define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4) 26#define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4)
27#define CI_HDRC_IMX28_WRITE_FIX BIT(5)
27 enum usb_dr_mode dr_mode; 28 enum usb_dr_mode dr_mode;
28#define CI_HDRC_CONTROLLER_RESET_EVENT 0 29#define CI_HDRC_CONTROLLER_RESET_EVENT 0
29#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 30#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 5e61589fc166..dba63f53906c 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -468,6 +468,8 @@ struct usb_function_instance {
468 struct config_group group; 468 struct config_group group;
469 struct list_head cfs_list; 469 struct list_head cfs_list;
470 struct usb_function_driver *fd; 470 struct usb_function_driver *fd;
471 int (*set_inst_name)(struct usb_function_instance *inst,
472 const char *name);
471 void (*free_func_inst)(struct usb_function_instance *inst); 473 void (*free_func_inst)(struct usb_function_instance *inst);
472}; 474};
473 475
diff --git a/include/linux/usb/functionfs.h b/include/linux/usb/functionfs.h
index 65d0a88dbc67..71190663f1ee 100644
--- a/include/linux/usb/functionfs.h
+++ b/include/linux/usb/functionfs.h
@@ -3,34 +3,4 @@
3 3
4#include <uapi/linux/usb/functionfs.h> 4#include <uapi/linux/usb/functionfs.h>
5 5
6
7struct ffs_data;
8struct usb_composite_dev;
9struct usb_configuration;
10
11
12static int functionfs_init(void) __attribute__((warn_unused_result));
13static void functionfs_cleanup(void);
14
15static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
16 __attribute__((warn_unused_result, nonnull));
17static void functionfs_unbind(struct ffs_data *ffs)
18 __attribute__((nonnull));
19
20static int functionfs_bind_config(struct usb_composite_dev *cdev,
21 struct usb_configuration *c,
22 struct ffs_data *ffs)
23 __attribute__((warn_unused_result, nonnull));
24
25
26static int functionfs_ready_callback(struct ffs_data *ffs)
27 __attribute__((warn_unused_result, nonnull));
28static void functionfs_closed_callback(struct ffs_data *ffs)
29 __attribute__((nonnull));
30static void *functionfs_acquire_dev_callback(const char *dev_name)
31 __attribute__((warn_unused_result, nonnull));
32static void functionfs_release_dev_callback(struct ffs_data *ffs_data)
33 __attribute__((nonnull));
34
35
36#endif 6#endif
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 942ef5e053bf..c3a61853cd13 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -148,6 +148,9 @@ struct usb_ep_ops {
148 * @maxpacket:The maximum packet size used on this endpoint. The initial 148 * @maxpacket:The maximum packet size used on this endpoint. The initial
149 * value can sometimes be reduced (hardware allowing), according to 149 * value can sometimes be reduced (hardware allowing), according to
150 * the endpoint descriptor used to configure the endpoint. 150 * the endpoint descriptor used to configure the endpoint.
151 * @maxpacket_limit:The maximum packet size value which can be handled by this
152 * endpoint. It's set once by UDC driver when endpoint is initialized, and
153 * should not be changed. Should not be confused with maxpacket.
151 * @max_streams: The maximum number of streams supported 154 * @max_streams: The maximum number of streams supported
152 * by this EP (0 - 16, actual number is 2^n) 155 * by this EP (0 - 16, actual number is 2^n)
153 * @mult: multiplier, 'mult' value for SS Isoc EPs 156 * @mult: multiplier, 'mult' value for SS Isoc EPs
@@ -171,6 +174,7 @@ struct usb_ep {
171 const struct usb_ep_ops *ops; 174 const struct usb_ep_ops *ops;
172 struct list_head ep_list; 175 struct list_head ep_list;
173 unsigned maxpacket:16; 176 unsigned maxpacket:16;
177 unsigned maxpacket_limit:16;
174 unsigned max_streams:16; 178 unsigned max_streams:16;
175 unsigned mult:2; 179 unsigned mult:2;
176 unsigned maxburst:5; 180 unsigned maxburst:5;
@@ -182,6 +186,21 @@ struct usb_ep {
182/*-------------------------------------------------------------------------*/ 186/*-------------------------------------------------------------------------*/
183 187
184/** 188/**
189 * usb_ep_set_maxpacket_limit - set maximum packet size limit for endpoint
190 * @ep:the endpoint being configured
191 * @maxpacket_limit:value of maximum packet size limit
192 *
193 * This function shoud be used only in UDC drivers to initialize endpoint
194 * (usually in probe function).
195 */
196static inline void usb_ep_set_maxpacket_limit(struct usb_ep *ep,
197 unsigned maxpacket_limit)
198{
199 ep->maxpacket_limit = maxpacket_limit;
200 ep->maxpacket = maxpacket_limit;
201}
202
203/**
185 * usb_ep_enable - configure endpoint, making it usable 204 * usb_ep_enable - configure endpoint, making it usable
186 * @ep:the endpoint being configured. may not be the endpoint named "ep0". 205 * @ep:the endpoint being configured. may not be the endpoint named "ep0".
187 * drivers discover endpoints through the ep_list of a usb_gadget. 206 * drivers discover endpoints through the ep_list of a usb_gadget.
@@ -485,6 +504,11 @@ struct usb_gadget_ops {
485 * @max_speed: Maximal speed the UDC can handle. UDC must support this 504 * @max_speed: Maximal speed the UDC can handle. UDC must support this
486 * and all slower speeds. 505 * and all slower speeds.
487 * @state: the state we are now (attached, suspended, configured, etc) 506 * @state: the state we are now (attached, suspended, configured, etc)
507 * @name: Identifies the controller hardware type. Used in diagnostics
508 * and sometimes configuration.
509 * @dev: Driver model state for this abstract device.
510 * @out_epnum: last used out ep number
511 * @in_epnum: last used in ep number
488 * @sg_supported: true if we can handle scatter-gather 512 * @sg_supported: true if we can handle scatter-gather
489 * @is_otg: True if the USB device port uses a Mini-AB jack, so that the 513 * @is_otg: True if the USB device port uses a Mini-AB jack, so that the
490 * gadget driver must provide a USB OTG descriptor. 514 * gadget driver must provide a USB OTG descriptor.
@@ -497,11 +521,8 @@ struct usb_gadget_ops {
497 * only supports HNP on a different root port. 521 * only supports HNP on a different root port.
498 * @b_hnp_enable: OTG device feature flag, indicating that the A-Host 522 * @b_hnp_enable: OTG device feature flag, indicating that the A-Host
499 * enabled HNP support. 523 * enabled HNP support.
500 * @name: Identifies the controller hardware type. Used in diagnostics 524 * @quirk_ep_out_aligned_size: epout requires buffer size to be aligned to
501 * and sometimes configuration. 525 * MaxPacketSize.
502 * @dev: Driver model state for this abstract device.
503 * @out_epnum: last used out ep number
504 * @in_epnum: last used in ep number
505 * 526 *
506 * Gadgets have a mostly-portable "gadget driver" implementing device 527 * Gadgets have a mostly-portable "gadget driver" implementing device
507 * functions, handling all usb configurations and interfaces. Gadget 528 * functions, handling all usb configurations and interfaces. Gadget
@@ -530,16 +551,18 @@ struct usb_gadget {
530 enum usb_device_speed speed; 551 enum usb_device_speed speed;
531 enum usb_device_speed max_speed; 552 enum usb_device_speed max_speed;
532 enum usb_device_state state; 553 enum usb_device_state state;
554 const char *name;
555 struct device dev;
556 unsigned out_epnum;
557 unsigned in_epnum;
558
533 unsigned sg_supported:1; 559 unsigned sg_supported:1;
534 unsigned is_otg:1; 560 unsigned is_otg:1;
535 unsigned is_a_peripheral:1; 561 unsigned is_a_peripheral:1;
536 unsigned b_hnp_enable:1; 562 unsigned b_hnp_enable:1;
537 unsigned a_hnp_support:1; 563 unsigned a_hnp_support:1;
538 unsigned a_alt_hnp_support:1; 564 unsigned a_alt_hnp_support:1;
539 const char *name; 565 unsigned quirk_ep_out_aligned_size:1;
540 struct device dev;
541 unsigned out_epnum;
542 unsigned in_epnum;
543}; 566};
544#define work_to_gadget(w) (container_of((w), struct usb_gadget, work)) 567#define work_to_gadget(w) (container_of((w), struct usb_gadget, work))
545 568
@@ -558,6 +581,23 @@ static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev)
558 581
559 582
560/** 583/**
584 * usb_ep_align_maybe - returns @len aligned to ep's maxpacketsize if gadget
585 * requires quirk_ep_out_aligned_size, otherwise reguens len.
586 * @g: controller to check for quirk
587 * @ep: the endpoint whose maxpacketsize is used to align @len
588 * @len: buffer size's length to align to @ep's maxpacketsize
589 *
590 * This helper is used in case it's required for any reason to check and maybe
591 * align buffer's size to an ep's maxpacketsize.
592 */
593static inline size_t
594usb_ep_align_maybe(struct usb_gadget *g, struct usb_ep *ep, size_t len)
595{
596 return !g->quirk_ep_out_aligned_size ? len :
597 round_up(len, (size_t)ep->desc->wMaxPacketSize);
598}
599
600/**
561 * gadget_is_dualspeed - return true iff the hardware handles high speed 601 * gadget_is_dualspeed - return true iff the hardware handles high speed
562 * @g: controller that might support both high and full speeds 602 * @g: controller that might support both high and full speeds
563 */ 603 */
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index b8aba196f7f1..efe8d8a7c7ad 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -134,6 +134,7 @@ struct usb_hcd {
134 unsigned rh_registered:1;/* is root hub registered? */ 134 unsigned rh_registered:1;/* is root hub registered? */
135 unsigned rh_pollable:1; /* may we poll the root hub? */ 135 unsigned rh_pollable:1; /* may we poll the root hub? */
136 unsigned msix_enabled:1; /* driver has MSI-X enabled? */ 136 unsigned msix_enabled:1; /* driver has MSI-X enabled? */
137 unsigned remove_phy:1; /* auto-remove USB phy */
137 138
138 /* The next flag is a stopgap, to be removed when all the HCDs 139 /* The next flag is a stopgap, to be removed when all the HCDs
139 * support the new root-hub polling mechanism. */ 140 * support the new root-hub polling mechanism. */
@@ -352,6 +353,8 @@ struct hc_driver {
352 void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); 353 void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *);
353 /* Returns the hardware-chosen device address */ 354 /* Returns the hardware-chosen device address */
354 int (*address_device)(struct usb_hcd *, struct usb_device *udev); 355 int (*address_device)(struct usb_hcd *, struct usb_device *udev);
356 /* prepares the hardware to send commands to the device */
357 int (*enable_device)(struct usb_hcd *, struct usb_device *udev);
355 /* Notifies the HCD after a hub descriptor is fetched. 358 /* Notifies the HCD after a hub descriptor is fetched.
356 * Will block. 359 * Will block.
357 */ 360 */
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h
index 22a396c13f3a..32754835a39b 100644
--- a/include/linux/usb/msm_hsusb.h
+++ b/include/linux/usb/msm_hsusb.h
@@ -20,6 +20,7 @@
20 20
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/usb/otg.h> 22#include <linux/usb/otg.h>
23#include <linux/clk.h>
23 24
24/** 25/**
25 * Supported USB modes 26 * Supported USB modes
@@ -135,6 +136,8 @@ struct msm_otg_platform_data {
135 enum msm_usb_phy_type phy_type; 136 enum msm_usb_phy_type phy_type;
136 void (*setup_gpio)(enum usb_otg_state state); 137 void (*setup_gpio)(enum usb_otg_state state);
137 char *pclk_src_name; 138 char *pclk_src_name;
139 int (*link_clk_reset)(struct clk *link_clk, bool assert);
140 int (*phy_clk_reset)(struct clk *phy_clk);
138}; 141};
139 142
140/** 143/**
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index eb505250940a..a4ee1b582183 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -76,6 +76,9 @@ struct musb_hdrc_config {
76 unsigned dma:1 __deprecated; /* supports DMA */ 76 unsigned dma:1 __deprecated; /* supports DMA */
77 unsigned vendor_req:1 __deprecated; /* vendor registers required */ 77 unsigned vendor_req:1 __deprecated; /* vendor registers required */
78 78
79 /* need to explicitly de-assert the port reset after resume? */
80 unsigned host_port_deassert_reset_at_resume:1;
81
79 u8 num_eps; /* number of endpoints _with_ ep0 */ 82 u8 num_eps; /* number of endpoints _with_ ep0 */
80 u8 dma_channels __deprecated; /* number of dma channels */ 83 u8 dma_channels __deprecated; /* number of dma channels */
81 u8 dyn_fifo_size; /* dynamic size in bytes */ 84 u8 dyn_fifo_size; /* dynamic size in bytes */
diff --git a/include/linux/usb/omap_control_usb.h b/include/linux/usb/omap_control_usb.h
index 596b01918813..69ae383ee3cc 100644
--- a/include/linux/usb/omap_control_usb.h
+++ b/include/linux/usb/omap_control_usb.h
@@ -24,6 +24,7 @@ enum omap_control_usb_type {
24 OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */ 24 OMAP_CTRL_TYPE_USB2, /* USB2_PHY, power down in CONTROL_DEV_CONF */
25 OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */ 25 OMAP_CTRL_TYPE_PIPE3, /* PIPE3 PHY, DPLL & seperate Rx/Tx power */
26 OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */ 26 OMAP_CTRL_TYPE_DRA7USB2, /* USB2 PHY, power and power_aux e.g. DRA7 */
27 OMAP_CTRL_TYPE_AM437USB2, /* USB2 PHY, power e.g. AM437x */
27}; 28};
28 29
29struct omap_control_usb { 30struct omap_control_usb {
@@ -64,6 +65,11 @@ enum omap_control_usb_mode {
64 65
65#define OMAP_CTRL_USB2_PHY_PD BIT(28) 66#define OMAP_CTRL_USB2_PHY_PD BIT(28)
66 67
68#define AM437X_CTRL_USB2_PHY_PD BIT(0)
69#define AM437X_CTRL_USB2_OTG_PD BIT(1)
70#define AM437X_CTRL_USB2_OTGVDET_EN BIT(19)
71#define AM437X_CTRL_USB2_OTGSESSEND_EN BIT(20)
72
67#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB) 73#if IS_ENABLED(CONFIG_OMAP_CONTROL_USB)
68extern void omap_control_usb_phy_power(struct device *dev, int on); 74extern void omap_control_usb_phy_power(struct device *dev, int on);
69extern void omap_control_usb_set_mode(struct device *dev, 75extern void omap_control_usb_set_mode(struct device *dev,
diff --git a/include/linux/usb/otg-fsm.h b/include/linux/usb/otg-fsm.h
new file mode 100644
index 000000000000..b6ba1bfb86f2
--- /dev/null
+++ b/include/linux/usb/otg-fsm.h
@@ -0,0 +1,244 @@
1/* Copyright (C) 2007,2008 Freescale Semiconductor, Inc.
2 *
3 * This program is free software; you can redistribute it and/or modify it
4 * under the terms of the GNU General Public License as published by the
5 * Free Software Foundation; either version 2 of the License, or (at your
6 * option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 675 Mass Ave, Cambridge, MA 02139, USA.
16 */
17
18#ifndef __LINUX_USB_OTG_FSM_H
19#define __LINUX_USB_OTG_FSM_H
20
21#include <linux/mutex.h>
22#include <linux/errno.h>
23
24#undef VERBOSE
25
26#ifdef VERBOSE
27#define VDBG(fmt, args...) pr_debug("[%s] " fmt , \
28 __func__, ## args)
29#else
30#define VDBG(stuff...) do {} while (0)
31#endif
32
33#ifdef VERBOSE
34#define MPC_LOC printk("Current Location [%s]:[%d]\n", __FILE__, __LINE__)
35#else
36#define MPC_LOC do {} while (0)
37#endif
38
39#define PROTO_UNDEF (0)
40#define PROTO_HOST (1)
41#define PROTO_GADGET (2)
42
43enum otg_fsm_timer {
44 /* Standard OTG timers */
45 A_WAIT_VRISE,
46 A_WAIT_VFALL,
47 A_WAIT_BCON,
48 A_AIDL_BDIS,
49 B_ASE0_BRST,
50 A_BIDL_ADIS,
51
52 /* Auxiliary timers */
53 B_SE0_SRP,
54 B_SRP_FAIL,
55 A_WAIT_ENUM,
56
57 NUM_OTG_FSM_TIMERS,
58};
59
60/* OTG state machine according to the OTG spec */
61struct otg_fsm {
62 /* Input */
63 int id;
64 int adp_change;
65 int power_up;
66 int test_device;
67 int a_bus_drop;
68 int a_bus_req;
69 int a_srp_det;
70 int a_vbus_vld;
71 int b_conn;
72 int a_bus_resume;
73 int a_bus_suspend;
74 int a_conn;
75 int b_bus_req;
76 int b_se0_srp;
77 int b_ssend_srp;
78 int b_sess_vld;
79 /* Auxilary inputs */
80 int a_sess_vld;
81 int b_bus_resume;
82 int b_bus_suspend;
83
84 /* Output */
85 int data_pulse;
86 int drv_vbus;
87 int loc_conn;
88 int loc_sof;
89 int adp_prb;
90 int adp_sns;
91
92 /* Internal variables */
93 int a_set_b_hnp_en;
94 int b_srp_done;
95 int b_hnp_enable;
96 int a_clr_err;
97
98 /* Informative variables */
99 int a_bus_drop_inf;
100 int a_bus_req_inf;
101 int a_clr_err_inf;
102 int b_bus_req_inf;
103 /* Auxilary informative variables */
104 int a_suspend_req_inf;
105
106 /* Timeout indicator for timers */
107 int a_wait_vrise_tmout;
108 int a_wait_vfall_tmout;
109 int a_wait_bcon_tmout;
110 int a_aidl_bdis_tmout;
111 int b_ase0_brst_tmout;
112 int a_bidl_adis_tmout;
113
114 struct otg_fsm_ops *ops;
115 struct usb_otg *otg;
116
117 /* Current usb protocol used: 0:undefine; 1:host; 2:client */
118 int protocol;
119 struct mutex lock;
120};
121
122struct otg_fsm_ops {
123 void (*chrg_vbus)(struct otg_fsm *fsm, int on);
124 void (*drv_vbus)(struct otg_fsm *fsm, int on);
125 void (*loc_conn)(struct otg_fsm *fsm, int on);
126 void (*loc_sof)(struct otg_fsm *fsm, int on);
127 void (*start_pulse)(struct otg_fsm *fsm);
128 void (*start_adp_prb)(struct otg_fsm *fsm);
129 void (*start_adp_sns)(struct otg_fsm *fsm);
130 void (*add_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
131 void (*del_timer)(struct otg_fsm *fsm, enum otg_fsm_timer timer);
132 int (*start_host)(struct otg_fsm *fsm, int on);
133 int (*start_gadget)(struct otg_fsm *fsm, int on);
134};
135
136
137static inline int otg_chrg_vbus(struct otg_fsm *fsm, int on)
138{
139 if (!fsm->ops->chrg_vbus)
140 return -EOPNOTSUPP;
141 fsm->ops->chrg_vbus(fsm, on);
142 return 0;
143}
144
145static inline int otg_drv_vbus(struct otg_fsm *fsm, int on)
146{
147 if (!fsm->ops->drv_vbus)
148 return -EOPNOTSUPP;
149 if (fsm->drv_vbus != on) {
150 fsm->drv_vbus = on;
151 fsm->ops->drv_vbus(fsm, on);
152 }
153 return 0;
154}
155
156static inline int otg_loc_conn(struct otg_fsm *fsm, int on)
157{
158 if (!fsm->ops->loc_conn)
159 return -EOPNOTSUPP;
160 if (fsm->loc_conn != on) {
161 fsm->loc_conn = on;
162 fsm->ops->loc_conn(fsm, on);
163 }
164 return 0;
165}
166
167static inline int otg_loc_sof(struct otg_fsm *fsm, int on)
168{
169 if (!fsm->ops->loc_sof)
170 return -EOPNOTSUPP;
171 if (fsm->loc_sof != on) {
172 fsm->loc_sof = on;
173 fsm->ops->loc_sof(fsm, on);
174 }
175 return 0;
176}
177
178static inline int otg_start_pulse(struct otg_fsm *fsm)
179{
180 if (!fsm->ops->start_pulse)
181 return -EOPNOTSUPP;
182 if (!fsm->data_pulse) {
183 fsm->data_pulse = 1;
184 fsm->ops->start_pulse(fsm);
185 }
186 return 0;
187}
188
189static inline int otg_start_adp_prb(struct otg_fsm *fsm)
190{
191 if (!fsm->ops->start_adp_prb)
192 return -EOPNOTSUPP;
193 if (!fsm->adp_prb) {
194 fsm->adp_sns = 0;
195 fsm->adp_prb = 1;
196 fsm->ops->start_adp_prb(fsm);
197 }
198 return 0;
199}
200
201static inline int otg_start_adp_sns(struct otg_fsm *fsm)
202{
203 if (!fsm->ops->start_adp_sns)
204 return -EOPNOTSUPP;
205 if (!fsm->adp_sns) {
206 fsm->adp_sns = 1;
207 fsm->ops->start_adp_sns(fsm);
208 }
209 return 0;
210}
211
212static inline int otg_add_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer)
213{
214 if (!fsm->ops->add_timer)
215 return -EOPNOTSUPP;
216 fsm->ops->add_timer(fsm, timer);
217 return 0;
218}
219
220static inline int otg_del_timer(struct otg_fsm *fsm, enum otg_fsm_timer timer)
221{
222 if (!fsm->ops->del_timer)
223 return -EOPNOTSUPP;
224 fsm->ops->del_timer(fsm, timer);
225 return 0;
226}
227
228static inline int otg_start_host(struct otg_fsm *fsm, int on)
229{
230 if (!fsm->ops->start_host)
231 return -EOPNOTSUPP;
232 return fsm->ops->start_host(fsm, on);
233}
234
235static inline int otg_start_gadget(struct otg_fsm *fsm, int on)
236{
237 if (!fsm->ops->start_gadget)
238 return -EOPNOTSUPP;
239 return fsm->ops->start_gadget(fsm, on);
240}
241
242int otg_statemachine(struct otg_fsm *fsm);
243
244#endif /* __LINUX_USB_OTG_FSM_H */
diff --git a/include/linux/uwb/umc.h b/include/linux/uwb/umc.h
index 891d1d5f3947..ba82f03d8287 100644
--- a/include/linux/uwb/umc.h
+++ b/include/linux/uwb/umc.h
@@ -143,7 +143,7 @@ int umc_match_pci_id(struct umc_driver *umc_drv, struct umc_dev *umc);
143static inline struct pci_dev *umc_parent_pci_dev(struct umc_dev *umc_dev) 143static inline struct pci_dev *umc_parent_pci_dev(struct umc_dev *umc_dev)
144{ 144{
145 struct pci_dev *pci_dev = NULL; 145 struct pci_dev *pci_dev = NULL;
146 if (umc_dev->dev.parent->bus == &pci_bus_type) 146 if (dev_is_pci(umc_dev->dev.parent))
147 pci_dev = to_pci_dev(umc_dev->dev.parent); 147 pci_dev = to_pci_dev(umc_dev->dev.parent);
148 return pci_dev; 148 return pci_dev;
149} 149}
diff --git a/include/linux/vme.h b/include/linux/vme.h
index c9d65bf14cec..8cd6f19ca518 100644
--- a/include/linux/vme.h
+++ b/include/linux/vme.h
@@ -164,7 +164,8 @@ int vme_lm_attach(struct vme_resource *, int, void (*callback)(int));
164int vme_lm_detach(struct vme_resource *, int); 164int vme_lm_detach(struct vme_resource *, int);
165void vme_lm_free(struct vme_resource *); 165void vme_lm_free(struct vme_resource *);
166 166
167int vme_slot_get(struct vme_dev *); 167int vme_slot_num(struct vme_dev *);
168int vme_bus_num(struct vme_dev *);
168 169
169int vme_register_driver(struct vme_driver *, unsigned int); 170int vme_register_driver(struct vme_driver *, unsigned int);
170void vme_unregister_driver(struct vme_driver *); 171void vme_unregister_driver(struct vme_driver *);
diff --git a/include/linux/vmpressure.h b/include/linux/vmpressure.h
index 3f3788d49362..3e4535876d37 100644
--- a/include/linux/vmpressure.h
+++ b/include/linux/vmpressure.h
@@ -7,6 +7,7 @@
7#include <linux/gfp.h> 7#include <linux/gfp.h>
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/cgroup.h> 9#include <linux/cgroup.h>
10#include <linux/eventfd.h>
10 11
11struct vmpressure { 12struct vmpressure {
12 unsigned long scanned; 13 unsigned long scanned;
@@ -33,13 +34,10 @@ extern void vmpressure_init(struct vmpressure *vmpr);
33extern void vmpressure_cleanup(struct vmpressure *vmpr); 34extern void vmpressure_cleanup(struct vmpressure *vmpr);
34extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); 35extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg);
35extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); 36extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr);
36extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); 37extern int vmpressure_register_event(struct mem_cgroup *memcg,
37extern int vmpressure_register_event(struct cgroup_subsys_state *css,
38 struct cftype *cft,
39 struct eventfd_ctx *eventfd, 38 struct eventfd_ctx *eventfd,
40 const char *args); 39 const char *args);
41extern void vmpressure_unregister_event(struct cgroup_subsys_state *css, 40extern void vmpressure_unregister_event(struct mem_cgroup *memcg,
42 struct cftype *cft,
43 struct eventfd_ctx *eventfd); 41 struct eventfd_ctx *eventfd);
44#else 42#else
45static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, 43static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index e4b948080d20..a67b38415768 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -142,8 +142,6 @@ static inline unsigned long zone_page_state_snapshot(struct zone *zone,
142 return x; 142 return x;
143} 143}
144 144
145extern unsigned long global_reclaimable_pages(void);
146
147#ifdef CONFIG_NUMA 145#ifdef CONFIG_NUMA
148/* 146/*
149 * Determine the per node value of a stat item. This function 147 * Determine the per node value of a stat item. This function
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h
index 065e3ae79ab0..d58594a32324 100644
--- a/include/linux/w1-gpio.h
+++ b/include/linux/w1-gpio.h
@@ -20,6 +20,7 @@ struct w1_gpio_platform_data {
20 unsigned int is_open_drain:1; 20 unsigned int is_open_drain:1;
21 void (*enable_external_pullup)(int enable); 21 void (*enable_external_pullup)(int enable);
22 unsigned int ext_pullup_enable_pin; 22 unsigned int ext_pullup_enable_pin;
23 unsigned int pullup_duration;
23}; 24};
24 25
25#endif /* _LINUX_W1_GPIO_H */ 26#endif /* _LINUX_W1_GPIO_H */
diff --git a/include/linux/wait.h b/include/linux/wait.h
index eaa00b10abaa..559044c79232 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -286,8 +286,8 @@ do { \
286 * wait_event_cmd - sleep until a condition gets true 286 * wait_event_cmd - sleep until a condition gets true
287 * @wq: the waitqueue to wait on 287 * @wq: the waitqueue to wait on
288 * @condition: a C expression for the event to wait for 288 * @condition: a C expression for the event to wait for
289 * cmd1: the command will be executed before sleep 289 * @cmd1: the command will be executed before sleep
290 * cmd2: the command will be executed after sleep 290 * @cmd2: the command will be executed after sleep
291 * 291 *
292 * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the 292 * The process is put to sleep (TASK_UNINTERRUPTIBLE) until the
293 * @condition evaluates to true. The @condition is checked each time 293 * @condition evaluates to true. The @condition is checked each time
diff --git a/include/linux/zsmalloc.h b/include/linux/zsmalloc.h
new file mode 100644
index 000000000000..e44d634e7fb7
--- /dev/null
+++ b/include/linux/zsmalloc.h
@@ -0,0 +1,51 @@
1/*
2 * zsmalloc memory allocator
3 *
4 * Copyright (C) 2011 Nitin Gupta
5 * Copyright (C) 2012, 2013 Minchan Kim
6 *
7 * This code is released using a dual license strategy: BSD/GPL
8 * You can choose the license that better fits your requirements.
9 *
10 * Released under the terms of 3-clause BSD License
11 * Released under the terms of GNU General Public License Version 2.0
12 */
13
14#ifndef _ZS_MALLOC_H_
15#define _ZS_MALLOC_H_
16
17#include <linux/types.h>
18
19/*
20 * zsmalloc mapping modes
21 *
22 * NOTE: These only make a difference when a mapped object spans pages.
23 * They also have no effect when PGTABLE_MAPPING is selected.
24 */
25enum zs_mapmode {
26 ZS_MM_RW, /* normal read-write mapping */
27 ZS_MM_RO, /* read-only (no copy-out at unmap time) */
28 ZS_MM_WO /* write-only (no copy-in at map time) */
29 /*
30 * NOTE: ZS_MM_WO should only be used for initializing new
31 * (uninitialized) allocations. Partial writes to already
32 * initialized allocations should use ZS_MM_RW to preserve the
33 * existing data.
34 */
35};
36
37struct zs_pool;
38
39struct zs_pool *zs_create_pool(gfp_t flags);
40void zs_destroy_pool(struct zs_pool *pool);
41
42unsigned long zs_malloc(struct zs_pool *pool, size_t size);
43void zs_free(struct zs_pool *pool, unsigned long obj);
44
45void *zs_map_object(struct zs_pool *pool, unsigned long handle,
46 enum zs_mapmode mm);
47void zs_unmap_object(struct zs_pool *pool, unsigned long handle);
48
49u64 zs_get_total_size_bytes(struct zs_pool *pool);
50
51#endif
diff --git a/include/math-emu/op-common.h b/include/math-emu/op-common.h
index 9696a5e2c437..6bdf8c61d221 100644
--- a/include/math-emu/op-common.h
+++ b/include/math-emu/op-common.h
@@ -685,7 +685,7 @@ do { \
685 else \ 685 else \
686 { \ 686 { \
687 r = 0; \ 687 r = 0; \
688 if (X##_s) \ 688 if (!X##_s) \
689 r = ~r; \ 689 r = ~r; \
690 } \ 690 } \
691 FP_SET_EXCEPTION(FP_EX_INVALID); \ 691 FP_SET_EXCEPTION(FP_EX_INVALID); \
@@ -743,12 +743,17 @@ do { \
743 } \ 743 } \
744 else \ 744 else \
745 { \ 745 { \
746 int _lz0, _lz1; \
746 if (X##_e <= -_FP_WORKBITS - 1) \ 747 if (X##_e <= -_FP_WORKBITS - 1) \
747 _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc); \ 748 _FP_FRAC_SET_##wc(X, _FP_MINFRAC_##wc); \
748 else \ 749 else \
749 _FP_FRAC_SRS_##wc(X, _FP_FRACBITS_##fs - 1 - X##_e, \ 750 _FP_FRAC_SRS_##wc(X, _FP_FRACBITS_##fs - 1 - X##_e, \
750 _FP_WFRACBITS_##fs); \ 751 _FP_WFRACBITS_##fs); \
752 _FP_FRAC_CLZ_##wc(_lz0, X); \
751 _FP_ROUND(wc, X); \ 753 _FP_ROUND(wc, X); \
754 _FP_FRAC_CLZ_##wc(_lz1, X); \
755 if (_lz1 < _lz0) \
756 X##_e++; /* For overflow detection. */ \
752 _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \ 757 _FP_FRAC_SRL_##wc(X, _FP_WORKBITS); \
753 _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \ 758 _FP_FRAC_ASSEMBLE_##wc(r, X, rsize); \
754 } \ 759 } \
@@ -762,7 +767,7 @@ do { \
762 if (!rsigned) \ 767 if (!rsigned) \
763 { \ 768 { \
764 r = 0; \ 769 r = 0; \
765 if (X##_s) \ 770 if (!X##_s) \
766 r = ~r; \ 771 r = ~r; \
767 } \ 772 } \
768 else if (rsigned != 2) \ 773 else if (rsigned != 2) \
diff --git a/include/media/adv7604.h b/include/media/adv7604.h
index dc004bc926c9..d262a3a922bd 100644
--- a/include/media/adv7604.h
+++ b/include/media/adv7604.h
@@ -78,11 +78,14 @@ enum adv7604_op_format_sel {
78 ADV7604_OP_FORMAT_SEL_SDR_ITU656_24_MODE2 = 0x8a, 78 ADV7604_OP_FORMAT_SEL_SDR_ITU656_24_MODE2 = 0x8a,
79}; 79};
80 80
81enum adv7604_drive_strength {
82 ADV7604_DR_STR_MEDIUM_LOW = 1,
83 ADV7604_DR_STR_MEDIUM_HIGH = 2,
84 ADV7604_DR_STR_HIGH = 3,
85};
86
81/* Platform dependent definition */ 87/* Platform dependent definition */
82struct adv7604_platform_data { 88struct adv7604_platform_data {
83 /* connector - HDMI or DVI? */
84 unsigned connector_hdmi:1;
85
86 /* DIS_PWRDNB: 1 if the PWRDNB pin is unused and unconnected */ 89 /* DIS_PWRDNB: 1 if the PWRDNB pin is unused and unconnected */
87 unsigned disable_pwrdnb:1; 90 unsigned disable_pwrdnb:1;
88 91
@@ -110,6 +113,15 @@ struct adv7604_platform_data {
110 unsigned replicate_av_codes:1; 113 unsigned replicate_av_codes:1;
111 unsigned invert_cbcr:1; 114 unsigned invert_cbcr:1;
112 115
116 /* IO register 0x06 */
117 unsigned inv_vs_pol:1;
118 unsigned inv_hs_pol:1;
119
120 /* IO register 0x14 */
121 enum adv7604_drive_strength dr_str_data;
122 enum adv7604_drive_strength dr_str_clk;
123 enum adv7604_drive_strength dr_str_sync;
124
113 /* IO register 0x30 */ 125 /* IO register 0x30 */
114 unsigned output_bus_lsb_to_msb:1; 126 unsigned output_bus_lsb_to_msb:1;
115 127
@@ -131,16 +143,20 @@ struct adv7604_platform_data {
131 u8 i2c_vdp; 143 u8 i2c_vdp;
132}; 144};
133 145
134/* 146enum adv7604_input_port {
135 * Mode of operation. 147 ADV7604_INPUT_HDMI_PORT_A,
136 * This is used as the input argument of the s_routing video op. 148 ADV7604_INPUT_HDMI_PORT_B,
137 */ 149 ADV7604_INPUT_HDMI_PORT_C,
138enum adv7604_mode { 150 ADV7604_INPUT_HDMI_PORT_D,
139 ADV7604_MODE_COMP, 151 ADV7604_INPUT_VGA_RGB,
140 ADV7604_MODE_GR, 152 ADV7604_INPUT_VGA_COMP,
141 ADV7604_MODE_HDMI,
142}; 153};
143 154
155#define ADV7604_EDID_PORT_A 0
156#define ADV7604_EDID_PORT_B 1
157#define ADV7604_EDID_PORT_C 2
158#define ADV7604_EDID_PORT_D 3
159
144#define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000) 160#define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000)
145#define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001) 161#define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001)
146#define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002) 162#define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002)
diff --git a/include/media/adv7842.h b/include/media/adv7842.h
index c02201d1c092..39322091e8b0 100644
--- a/include/media/adv7842.h
+++ b/include/media/adv7842.h
@@ -108,6 +108,13 @@ enum adv7842_select_input {
108 ADV7842_SELECT_SDP_YC, 108 ADV7842_SELECT_SDP_YC,
109}; 109};
110 110
111enum adv7842_drive_strength {
112 ADV7842_DR_STR_LOW = 0,
113 ADV7842_DR_STR_MEDIUM_LOW = 1,
114 ADV7842_DR_STR_MEDIUM_HIGH = 2,
115 ADV7842_DR_STR_HIGH = 3,
116};
117
111struct adv7842_sdp_csc_coeff { 118struct adv7842_sdp_csc_coeff {
112 bool manual; 119 bool manual;
113 uint16_t scaling; 120 uint16_t scaling;
@@ -131,13 +138,18 @@ struct adv7842_sdp_io_sync_adjustment {
131 uint16_t hs_width; 138 uint16_t hs_width;
132 uint16_t de_beg; 139 uint16_t de_beg;
133 uint16_t de_end; 140 uint16_t de_end;
141 uint8_t vs_beg_o;
142 uint8_t vs_beg_e;
143 uint8_t vs_end_o;
144 uint8_t vs_end_e;
145 uint8_t de_v_beg_o;
146 uint8_t de_v_beg_e;
147 uint8_t de_v_end_o;
148 uint8_t de_v_end_e;
134}; 149};
135 150
136/* Platform dependent definition */ 151/* Platform dependent definition */
137struct adv7842_platform_data { 152struct adv7842_platform_data {
138 /* connector - HDMI or DVI? */
139 unsigned connector_hdmi:1;
140
141 /* chip reset during probe */ 153 /* chip reset during probe */
142 unsigned chip_reset:1; 154 unsigned chip_reset:1;
143 155
@@ -156,12 +168,12 @@ struct adv7842_platform_data {
156 /* Default mode */ 168 /* Default mode */
157 enum adv7842_mode mode; 169 enum adv7842_mode mode;
158 170
171 /* Default input */
172 unsigned input;
173
159 /* Video standard */ 174 /* Video standard */
160 enum adv7842_vid_std_select vid_std_select; 175 enum adv7842_vid_std_select vid_std_select;
161 176
162 /* Input Color Space */
163 enum adv7842_inp_color_space inp_color_space;
164
165 /* Select output format */ 177 /* Select output format */
166 enum adv7842_op_format_sel op_format_sel; 178 enum adv7842_op_format_sel op_format_sel;
167 179
@@ -181,22 +193,37 @@ struct adv7842_platform_data {
181 unsigned output_bus_lsb_to_msb:1; 193 unsigned output_bus_lsb_to_msb:1;
182 194
183 /* IO register 0x14 */ 195 /* IO register 0x14 */
184 struct { 196 enum adv7842_drive_strength dr_str_data;
185 unsigned data:2; 197 enum adv7842_drive_strength dr_str_clk;
186 unsigned clock:2; 198 enum adv7842_drive_strength dr_str_sync;
187 unsigned sync:2; 199
188 } drive_strength; 200 /*
201 * IO register 0x19: Adjustment to the LLC DLL phase in
202 * increments of 1/32 of a clock period.
203 */
204 unsigned llc_dll_phase:5;
189 205
190 /* External RAM for 3-D comb or frame synchronizer */ 206 /* External RAM for 3-D comb or frame synchronizer */
191 unsigned sd_ram_size; /* ram size in MB */ 207 unsigned sd_ram_size; /* ram size in MB */
192 unsigned sd_ram_ddr:1; /* ddr or sdr sdram */ 208 unsigned sd_ram_ddr:1; /* ddr or sdr sdram */
193 209
194 /* Free run */ 210 /* HDMI free run, CP-reg 0xBA */
195 unsigned hdmi_free_run_mode; 211 unsigned hdmi_free_run_enable:1;
212 /* 0 = Mode 0: run when there is no TMDS clock
213 1 = Mode 1: run when there is no TMDS clock or the
214 video resolution does not match programmed one. */
215 unsigned hdmi_free_run_mode:1;
216
217 /* SDP free run, CP-reg 0xDD */
218 unsigned sdp_free_run_auto:1;
219 unsigned sdp_free_run_man_col_en:1;
220 unsigned sdp_free_run_cbar_en:1;
221 unsigned sdp_free_run_force:1;
196 222
197 struct adv7842_sdp_csc_coeff sdp_csc_coeff; 223 struct adv7842_sdp_csc_coeff sdp_csc_coeff;
198 224
199 struct adv7842_sdp_io_sync_adjustment sdp_io_sync; 225 struct adv7842_sdp_io_sync_adjustment sdp_io_sync_625;
226 struct adv7842_sdp_io_sync_adjustment sdp_io_sync_525;
200 227
201 /* i2c addresses */ 228 /* i2c addresses */
202 u8 i2c_sdp_io; 229 u8 i2c_sdp_io;
@@ -223,4 +250,8 @@ struct adv7842_platform_data {
223 * deinterlacer. */ 250 * deinterlacer. */
224#define ADV7842_CMD_RAM_TEST _IO('V', BASE_VIDIOC_PRIVATE) 251#define ADV7842_CMD_RAM_TEST _IO('V', BASE_VIDIOC_PRIVATE)
225 252
253#define ADV7842_EDID_PORT_A 0
254#define ADV7842_EDID_PORT_B 1
255#define ADV7842_EDID_PORT_VGA 2
256
226#endif 257#endif
diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h
index 656823075709..2b023471ac89 100644
--- a/include/media/atmel-isi.h
+++ b/include/media/atmel-isi.h
@@ -56,6 +56,7 @@
56#define ISI_CFG1_FRATE_DIV_6 (5 << 8) 56#define ISI_CFG1_FRATE_DIV_6 (5 << 8)
57#define ISI_CFG1_FRATE_DIV_7 (6 << 8) 57#define ISI_CFG1_FRATE_DIV_7 (6 << 8)
58#define ISI_CFG1_FRATE_DIV_8 (7 << 8) 58#define ISI_CFG1_FRATE_DIV_8 (7 << 8)
59#define ISI_CFG1_FRATE_DIV_MASK (7 << 8)
59#define ISI_CFG1_DISCR (1 << 11) 60#define ISI_CFG1_DISCR (1 << 11)
60#define ISI_CFG1_FULL_MODE (1 << 12) 61#define ISI_CFG1_FULL_MODE (1 << 12)
61 62
@@ -66,6 +67,7 @@
66#define ISI_CFG2_YCC_SWAP_MODE_1 (1 << 28) 67#define ISI_CFG2_YCC_SWAP_MODE_1 (1 << 28)
67#define ISI_CFG2_YCC_SWAP_MODE_2 (2 << 28) 68#define ISI_CFG2_YCC_SWAP_MODE_2 (2 << 28)
68#define ISI_CFG2_YCC_SWAP_MODE_3 (3 << 28) 69#define ISI_CFG2_YCC_SWAP_MODE_3 (3 << 28)
70#define ISI_CFG2_YCC_SWAP_MODE_MASK (3 << 28)
69#define ISI_CFG2_IM_VSIZE_OFFSET 0 71#define ISI_CFG2_IM_VSIZE_OFFSET 0
70#define ISI_CFG2_IM_HSIZE_OFFSET 16 72#define ISI_CFG2_IM_HSIZE_OFFSET 16
71#define ISI_CFG2_IM_VSIZE_MASK (0x7FF << ISI_CFG2_IM_VSIZE_OFFSET) 73#define ISI_CFG2_IM_VSIZE_MASK (0x7FF << ISI_CFG2_IM_VSIZE_OFFSET)
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 10df55187981..e00459185d20 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -24,6 +24,7 @@
24#define _MEDIA_ENTITY_H 24#define _MEDIA_ENTITY_H
25 25
26#include <linux/bitops.h> 26#include <linux/bitops.h>
27#include <linux/kernel.h>
27#include <linux/list.h> 28#include <linux/list.h>
28#include <linux/media.h> 29#include <linux/media.h>
29 30
diff --git a/include/media/omap4iss.h b/include/media/omap4iss.h
new file mode 100644
index 000000000000..0d7620db5e32
--- /dev/null
+++ b/include/media/omap4iss.h
@@ -0,0 +1,65 @@
1#ifndef ARCH_ARM_PLAT_OMAP4_ISS_H
2#define ARCH_ARM_PLAT_OMAP4_ISS_H
3
4#include <linux/i2c.h>
5
6struct iss_device;
7
8enum iss_interface_type {
9 ISS_INTERFACE_CSI2A_PHY1,
10 ISS_INTERFACE_CSI2B_PHY2,
11};
12
13/**
14 * struct iss_csiphy_lane: CSI2 lane position and polarity
15 * @pos: position of the lane
16 * @pol: polarity of the lane
17 */
18struct iss_csiphy_lane {
19 u8 pos;
20 u8 pol;
21};
22
23#define ISS_CSIPHY1_NUM_DATA_LANES 4
24#define ISS_CSIPHY2_NUM_DATA_LANES 1
25
26/**
27 * struct iss_csiphy_lanes_cfg - CSI2 lane configuration
28 * @data: Configuration of one or two data lanes
29 * @clk: Clock lane configuration
30 */
31struct iss_csiphy_lanes_cfg {
32 struct iss_csiphy_lane data[ISS_CSIPHY1_NUM_DATA_LANES];
33 struct iss_csiphy_lane clk;
34};
35
36/**
37 * struct iss_csi2_platform_data - CSI2 interface platform data
38 * @crc: Enable the cyclic redundancy check
39 * @vpclk_div: Video port output clock control
40 */
41struct iss_csi2_platform_data {
42 unsigned crc:1;
43 unsigned vpclk_div:2;
44 struct iss_csiphy_lanes_cfg lanecfg;
45};
46
47struct iss_subdev_i2c_board_info {
48 struct i2c_board_info *board_info;
49 int i2c_adapter_id;
50};
51
52struct iss_v4l2_subdevs_group {
53 struct iss_subdev_i2c_board_info *subdevs;
54 enum iss_interface_type interface;
55 union {
56 struct iss_csi2_platform_data csi2;
57 } bus; /* gcc < 4.6.0 chokes on anonymous union initializers */
58};
59
60struct iss_platform_data {
61 struct iss_v4l2_subdevs_group *subdevs;
62 void (*set_constraints)(struct iss_device *iss, bool enable);
63};
64
65#endif
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 6628f5d01f52..a20ed97d7d8a 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -193,6 +193,7 @@ void rc_map_init(void);
193#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr" 193#define RC_MAP_VIDEOMATE_TV_PVR "rc-videomate-tv-pvr"
194#define RC_MAP_WINFAST "rc-winfast" 194#define RC_MAP_WINFAST "rc-winfast"
195#define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe" 195#define RC_MAP_WINFAST_USBII_DELUXE "rc-winfast-usbii-deluxe"
196#define RC_MAP_SU3000 "rc-su3000"
196 197
197/* 198/*
198 * Please, do not just append newer Remote Controller names at the end. 199 * Please, do not just append newer Remote Controller names at the end.
diff --git a/include/media/saa6588.h b/include/media/saa6588.h
index 2c3c4420a4eb..b5ec1aa60ed5 100644
--- a/include/media/saa6588.h
+++ b/include/media/saa6588.h
@@ -27,6 +27,7 @@
27 27
28struct saa6588_command { 28struct saa6588_command {
29 unsigned int block_count; 29 unsigned int block_count;
30 bool nonblocking;
30 int result; 31 int result;
31 unsigned char __user *buffer; 32 unsigned char __user *buffer;
32 struct file *instance; 33 struct file *instance;
@@ -34,7 +35,6 @@ struct saa6588_command {
34}; 35};
35 36
36/* These ioctls are internal to the kernel */ 37/* These ioctls are internal to the kernel */
37#define SAA6588_CMD_OPEN _IOW('R', 1, int)
38#define SAA6588_CMD_CLOSE _IOW('R', 2, int) 38#define SAA6588_CMD_CLOSE _IOW('R', 2, int)
39#define SAA6588_CMD_READ _IOR('R', 3, int) 39#define SAA6588_CMD_READ _IOR('R', 3, int)
40#define SAA6588_CMD_POLL _IOR('R', 4, int) 40#define SAA6588_CMD_POLL _IOR('R', 4, int)
diff --git a/include/media/saa6752hs.h b/include/media/saa6752hs.h
deleted file mode 100644
index 3b8686ead80d..000000000000
--- a/include/media/saa6752hs.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 saa6752hs.h - definition for saa6752hs MPEG encoder
3
4 Copyright (C) 2003 Andrew de Quincey <adq@lidskialf.net>
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/
20
21
22/*
23 * Local variables:
24 * c-basic-offset: 8
25 * End:
26 */
diff --git a/include/media/si4713.h b/include/media/si4713.h
index ed7353e8a982..f98a0a7af61c 100644
--- a/include/media/si4713.h
+++ b/include/media/si4713.h
@@ -23,6 +23,8 @@
23 * Platform dependent definition 23 * Platform dependent definition
24 */ 24 */
25struct si4713_platform_data { 25struct si4713_platform_data {
26 const char * const *supply_names;
27 unsigned supplies;
26 int gpio_reset; /* < 0 if not used */ 28 int gpio_reset; /* < 0 if not used */
27}; 29};
28 30
diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h
index 528cdaf622e1..803516775162 100644
--- a/include/media/v4l2-fh.h
+++ b/include/media/v4l2-fh.h
@@ -45,6 +45,10 @@ struct v4l2_fh {
45 struct list_head available; /* Dequeueable event */ 45 struct list_head available; /* Dequeueable event */
46 unsigned int navailable; 46 unsigned int navailable;
47 u32 sequence; 47 u32 sequence;
48
49#if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV)
50 struct v4l2_m2m_ctx *m2m_ctx;
51#endif
48}; 52};
49 53
50/* 54/*
diff --git a/include/media/v4l2-int-device.h b/include/media/v4l2-int-device.h
deleted file mode 100644
index 0286c95814ff..000000000000
--- a/include/media/v4l2-int-device.h
+++ /dev/null
@@ -1,305 +0,0 @@
1/*
2 * include/media/v4l2-int-device.h
3 *
4 * V4L2 internal ioctl interface.
5 *
6 * Copyright (C) 2007 Nokia Corporation.
7 *
8 * Contact: Sakari Ailus <sakari.ailus@nokia.com>
9 *
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * version 2 as published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
22 * 02110-1301 USA
23 */
24
25#ifndef V4L2_INT_DEVICE_H
26#define V4L2_INT_DEVICE_H
27
28#include <media/v4l2-common.h>
29
30#define V4L2NAMESIZE 32
31
32/*
33 *
34 * The internal V4L2 device interface core.
35 *
36 */
37
38enum v4l2_int_type {
39 v4l2_int_type_master = 1,
40 v4l2_int_type_slave
41};
42
43struct module;
44
45struct v4l2_int_device;
46
47struct v4l2_int_master {
48 int (*attach)(struct v4l2_int_device *slave);
49 void (*detach)(struct v4l2_int_device *slave);
50};
51
52typedef int (v4l2_int_ioctl_func)(struct v4l2_int_device *);
53typedef int (v4l2_int_ioctl_func_0)(struct v4l2_int_device *);
54typedef int (v4l2_int_ioctl_func_1)(struct v4l2_int_device *, void *);
55
56struct v4l2_int_ioctl_desc {
57 int num;
58 v4l2_int_ioctl_func *func;
59};
60
61struct v4l2_int_slave {
62 /* Don't touch master. */
63 struct v4l2_int_device *master;
64
65 char attach_to[V4L2NAMESIZE];
66
67 int num_ioctls;
68 struct v4l2_int_ioctl_desc *ioctls;
69};
70
71struct v4l2_int_device {
72 /* Don't touch head. */
73 struct list_head head;
74
75 struct module *module;
76
77 char name[V4L2NAMESIZE];
78
79 enum v4l2_int_type type;
80 union {
81 struct v4l2_int_master *master;
82 struct v4l2_int_slave *slave;
83 } u;
84
85 void *priv;
86};
87
88void v4l2_int_device_try_attach_all(void);
89
90int v4l2_int_device_register(struct v4l2_int_device *d);
91void v4l2_int_device_unregister(struct v4l2_int_device *d);
92
93int v4l2_int_ioctl_0(struct v4l2_int_device *d, int cmd);
94int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg);
95
96/*
97 *
98 * Types and definitions for IOCTL commands.
99 *
100 */
101
102enum v4l2_power {
103 V4L2_POWER_OFF = 0,
104 V4L2_POWER_ON,
105 V4L2_POWER_STANDBY,
106};
107
108/* Slave interface type. */
109enum v4l2_if_type {
110 /*
111 * Parallel 8-, 10- or 12-bit interface, used by for example
112 * on certain image sensors.
113 */
114 V4L2_IF_TYPE_BT656,
115};
116
117enum v4l2_if_type_bt656_mode {
118 /*
119 * Modes without Bt synchronisation codes. Separate
120 * synchronisation signal lines are used.
121 */
122 V4L2_IF_TYPE_BT656_MODE_NOBT_8BIT,
123 V4L2_IF_TYPE_BT656_MODE_NOBT_10BIT,
124 V4L2_IF_TYPE_BT656_MODE_NOBT_12BIT,
125 /*
126 * Use Bt synchronisation codes. The vertical and horizontal
127 * synchronisation is done based on synchronisation codes.
128 */
129 V4L2_IF_TYPE_BT656_MODE_BT_8BIT,
130 V4L2_IF_TYPE_BT656_MODE_BT_10BIT,
131};
132
133struct v4l2_if_type_bt656 {
134 /*
135 * 0: Frame begins when vsync is high.
136 * 1: Frame begins when vsync changes from low to high.
137 */
138 unsigned frame_start_on_rising_vs:1;
139 /* Use Bt synchronisation codes for sync correction. */
140 unsigned bt_sync_correct:1;
141 /* Swap every two adjacent image data elements. */
142 unsigned swap:1;
143 /* Inverted latch clock polarity from slave. */
144 unsigned latch_clk_inv:1;
145 /* Hs polarity. 0 is active high, 1 active low. */
146 unsigned nobt_hs_inv:1;
147 /* Vs polarity. 0 is active high, 1 active low. */
148 unsigned nobt_vs_inv:1;
149 enum v4l2_if_type_bt656_mode mode;
150 /* Minimum accepted bus clock for slave (in Hz). */
151 u32 clock_min;
152 /* Maximum accepted bus clock for slave. */
153 u32 clock_max;
154 /*
155 * Current wish of the slave. May only change in response to
156 * ioctls that affect image capture.
157 */
158 u32 clock_curr;
159};
160
161struct v4l2_ifparm {
162 enum v4l2_if_type if_type;
163 union {
164 struct v4l2_if_type_bt656 bt656;
165 } u;
166};
167
168/* IOCTL command numbers. */
169enum v4l2_int_ioctl_num {
170 /*
171 *
172 * "Proper" V4L ioctls, as in struct video_device.
173 *
174 */
175 vidioc_int_enum_fmt_cap_num = 1,
176 vidioc_int_g_fmt_cap_num,
177 vidioc_int_s_fmt_cap_num,
178 vidioc_int_try_fmt_cap_num,
179 vidioc_int_queryctrl_num,
180 vidioc_int_g_ctrl_num,
181 vidioc_int_s_ctrl_num,
182 vidioc_int_cropcap_num,
183 vidioc_int_g_crop_num,
184 vidioc_int_s_crop_num,
185 vidioc_int_g_parm_num,
186 vidioc_int_s_parm_num,
187 vidioc_int_querystd_num,
188 vidioc_int_s_std_num,
189 vidioc_int_s_video_routing_num,
190
191 /*
192 *
193 * Strictly internal ioctls.
194 *
195 */
196 /* Initialise the device when slave attaches to the master. */
197 vidioc_int_dev_init_num = 1000,
198 /* Delinitialise the device at slave detach. */
199 vidioc_int_dev_exit_num,
200 /* Set device power state. */
201 vidioc_int_s_power_num,
202 /*
203 * Get slave private data, e.g. platform-specific slave
204 * configuration used by the master.
205 */
206 vidioc_int_g_priv_num,
207 /* Get slave interface parameters. */
208 vidioc_int_g_ifparm_num,
209 /* Does the slave need to be reset after VIDIOC_DQBUF? */
210 vidioc_int_g_needs_reset_num,
211 vidioc_int_enum_framesizes_num,
212 vidioc_int_enum_frameintervals_num,
213
214 /*
215 *
216 * VIDIOC_INT_* ioctls.
217 *
218 */
219 /* VIDIOC_INT_RESET */
220 vidioc_int_reset_num,
221 /* VIDIOC_INT_INIT */
222 vidioc_int_init_num,
223
224 /*
225 *
226 * Start of private ioctls.
227 *
228 */
229 vidioc_int_priv_start_num = 2000,
230};
231
232/*
233 *
234 * IOCTL wrapper functions for better type checking.
235 *
236 */
237
238#define V4L2_INT_WRAPPER_0(name) \
239 static inline int vidioc_int_##name(struct v4l2_int_device *d) \
240 { \
241 return v4l2_int_ioctl_0(d, vidioc_int_##name##_num); \
242 } \
243 \
244 static inline struct v4l2_int_ioctl_desc \
245 vidioc_int_##name##_cb(int (*func) \
246 (struct v4l2_int_device *)) \
247 { \
248 struct v4l2_int_ioctl_desc desc; \
249 \
250 desc.num = vidioc_int_##name##_num; \
251 desc.func = (v4l2_int_ioctl_func *)func; \
252 \
253 return desc; \
254 }
255
256#define V4L2_INT_WRAPPER_1(name, arg_type, asterisk) \
257 static inline int vidioc_int_##name(struct v4l2_int_device *d, \
258 arg_type asterisk arg) \
259 { \
260 return v4l2_int_ioctl_1(d, vidioc_int_##name##_num, \
261 (void *)(unsigned long)arg); \
262 } \
263 \
264 static inline struct v4l2_int_ioctl_desc \
265 vidioc_int_##name##_cb(int (*func) \
266 (struct v4l2_int_device *, \
267 arg_type asterisk)) \
268 { \
269 struct v4l2_int_ioctl_desc desc; \
270 \
271 desc.num = vidioc_int_##name##_num; \
272 desc.func = (v4l2_int_ioctl_func *)func; \
273 \
274 return desc; \
275 }
276
277V4L2_INT_WRAPPER_1(enum_fmt_cap, struct v4l2_fmtdesc, *);
278V4L2_INT_WRAPPER_1(g_fmt_cap, struct v4l2_format, *);
279V4L2_INT_WRAPPER_1(s_fmt_cap, struct v4l2_format, *);
280V4L2_INT_WRAPPER_1(try_fmt_cap, struct v4l2_format, *);
281V4L2_INT_WRAPPER_1(queryctrl, struct v4l2_queryctrl, *);
282V4L2_INT_WRAPPER_1(g_ctrl, struct v4l2_control, *);
283V4L2_INT_WRAPPER_1(s_ctrl, struct v4l2_control, *);
284V4L2_INT_WRAPPER_1(cropcap, struct v4l2_cropcap, *);
285V4L2_INT_WRAPPER_1(g_crop, struct v4l2_crop, *);
286V4L2_INT_WRAPPER_1(s_crop, struct v4l2_crop, *);
287V4L2_INT_WRAPPER_1(g_parm, struct v4l2_streamparm, *);
288V4L2_INT_WRAPPER_1(s_parm, struct v4l2_streamparm, *);
289V4L2_INT_WRAPPER_1(querystd, v4l2_std_id, *);
290V4L2_INT_WRAPPER_1(s_std, v4l2_std_id, *);
291V4L2_INT_WRAPPER_1(s_video_routing, struct v4l2_routing, *);
292
293V4L2_INT_WRAPPER_0(dev_init);
294V4L2_INT_WRAPPER_0(dev_exit);
295V4L2_INT_WRAPPER_1(s_power, enum v4l2_power, );
296V4L2_INT_WRAPPER_1(g_priv, void, *);
297V4L2_INT_WRAPPER_1(g_ifparm, struct v4l2_ifparm, *);
298V4L2_INT_WRAPPER_1(g_needs_reset, void, *);
299V4L2_INT_WRAPPER_1(enum_framesizes, struct v4l2_frmsizeenum, *);
300V4L2_INT_WRAPPER_1(enum_frameintervals, struct v4l2_frmivalenum, *);
301
302V4L2_INT_WRAPPER_0(reset);
303V4L2_INT_WRAPPER_0(init);
304
305#endif
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h
index 44542a20ab81..12ea5a6a4331 100644
--- a/include/media/v4l2-mem2mem.h
+++ b/include/media/v4l2-mem2mem.h
@@ -64,6 +64,9 @@ struct v4l2_m2m_queue_ctx {
64}; 64};
65 65
66struct v4l2_m2m_ctx { 66struct v4l2_m2m_ctx {
67 /* optional cap/out vb2 queues lock */
68 struct mutex *q_lock;
69
67/* private: internal use only */ 70/* private: internal use only */
68 struct v4l2_m2m_dev *m2m_dev; 71 struct v4l2_m2m_dev *m2m_dev;
69 72
@@ -229,5 +232,26 @@ static inline void *v4l2_m2m_dst_buf_remove(struct v4l2_m2m_ctx *m2m_ctx)
229 return v4l2_m2m_buf_remove(&m2m_ctx->cap_q_ctx); 232 return v4l2_m2m_buf_remove(&m2m_ctx->cap_q_ctx);
230} 233}
231 234
235/* v4l2 ioctl helpers */
236
237int v4l2_m2m_ioctl_reqbufs(struct file *file, void *priv,
238 struct v4l2_requestbuffers *rb);
239int v4l2_m2m_ioctl_create_bufs(struct file *file, void *fh,
240 struct v4l2_create_buffers *create);
241int v4l2_m2m_ioctl_querybuf(struct file *file, void *fh,
242 struct v4l2_buffer *buf);
243int v4l2_m2m_ioctl_expbuf(struct file *file, void *fh,
244 struct v4l2_exportbuffer *eb);
245int v4l2_m2m_ioctl_qbuf(struct file *file, void *fh,
246 struct v4l2_buffer *buf);
247int v4l2_m2m_ioctl_dqbuf(struct file *file, void *fh,
248 struct v4l2_buffer *buf);
249int v4l2_m2m_ioctl_streamon(struct file *file, void *fh,
250 enum v4l2_buf_type type);
251int v4l2_m2m_ioctl_streamoff(struct file *file, void *fh,
252 enum v4l2_buf_type type);
253int v4l2_m2m_fop_mmap(struct file *file, struct vm_area_struct *vma);
254unsigned int v4l2_m2m_fop_poll(struct file *file, poll_table *wait);
255
232#endif /* _MEDIA_V4L2_MEM2MEM_H */ 256#endif /* _MEDIA_V4L2_MEM2MEM_H */
233 257
diff --git a/include/media/v4l2-of.h b/include/media/v4l2-of.h
index 3a8a84124b44..541cea4122e9 100644
--- a/include/media/v4l2-of.h
+++ b/include/media/v4l2-of.h
@@ -53,7 +53,6 @@ struct v4l2_of_bus_parallel {
53 * @port: identifier (value of reg property) of a port this endpoint belongs to 53 * @port: identifier (value of reg property) of a port this endpoint belongs to
54 * @id: identifier (value of reg property) of this endpoint 54 * @id: identifier (value of reg property) of this endpoint
55 * @local_node: pointer to device_node of this endpoint 55 * @local_node: pointer to device_node of this endpoint
56 * @remote: phandle to remote endpoint node
57 * @bus_type: bus type 56 * @bus_type: bus type
58 * @bus: bus configuration data structure 57 * @bus: bus configuration data structure
59 * @head: list head for this structure 58 * @head: list head for this structure
@@ -62,7 +61,6 @@ struct v4l2_of_endpoint {
62 unsigned int port; 61 unsigned int port;
63 unsigned int id; 62 unsigned int id;
64 const struct device_node *local_node; 63 const struct device_node *local_node;
65 const __be32 *remote;
66 enum v4l2_mbus_type bus_type; 64 enum v4l2_mbus_type bus_type;
67 union { 65 union {
68 struct v4l2_of_bus_parallel parallel; 66 struct v4l2_of_bus_parallel parallel;
@@ -72,8 +70,8 @@ struct v4l2_of_endpoint {
72}; 70};
73 71
74#ifdef CONFIG_OF 72#ifdef CONFIG_OF
75void v4l2_of_parse_endpoint(const struct device_node *node, 73int v4l2_of_parse_endpoint(const struct device_node *node,
76 struct v4l2_of_endpoint *link); 74 struct v4l2_of_endpoint *endpoint);
77struct device_node *v4l2_of_get_next_endpoint(const struct device_node *parent, 75struct device_node *v4l2_of_get_next_endpoint(const struct device_node *parent,
78 struct device_node *previous); 76 struct device_node *previous);
79struct device_node *v4l2_of_get_remote_port_parent( 77struct device_node *v4l2_of_get_remote_port_parent(
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index 941055e9d125..bef53ce555d2 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -142,6 +142,7 @@ enum vb2_fileio_flags {
142/** 142/**
143 * enum vb2_buffer_state - current video buffer state 143 * enum vb2_buffer_state - current video buffer state
144 * @VB2_BUF_STATE_DEQUEUED: buffer under userspace control 144 * @VB2_BUF_STATE_DEQUEUED: buffer under userspace control
145 * @VB2_BUF_STATE_PREPARING: buffer is being prepared in videobuf
145 * @VB2_BUF_STATE_PREPARED: buffer prepared in videobuf and by the driver 146 * @VB2_BUF_STATE_PREPARED: buffer prepared in videobuf and by the driver
146 * @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver 147 * @VB2_BUF_STATE_QUEUED: buffer queued in videobuf, but not in driver
147 * @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used 148 * @VB2_BUF_STATE_ACTIVE: buffer queued in driver and possibly used
@@ -154,6 +155,7 @@ enum vb2_fileio_flags {
154 */ 155 */
155enum vb2_buffer_state { 156enum vb2_buffer_state {
156 VB2_BUF_STATE_DEQUEUED, 157 VB2_BUF_STATE_DEQUEUED,
158 VB2_BUF_STATE_PREPARING,
157 VB2_BUF_STATE_PREPARED, 159 VB2_BUF_STATE_PREPARED,
158 VB2_BUF_STATE_QUEUED, 160 VB2_BUF_STATE_QUEUED,
159 VB2_BUF_STATE_ACTIVE, 161 VB2_BUF_STATE_ACTIVE,
@@ -250,10 +252,13 @@ struct vb2_buffer {
250 * receive buffers with @buf_queue callback before 252 * receive buffers with @buf_queue callback before
251 * @start_streaming is called; the driver gets the number 253 * @start_streaming is called; the driver gets the number
252 * of already queued buffers in count parameter; driver 254 * of already queued buffers in count parameter; driver
253 * can return an error if hardware fails or not enough 255 * can return an error if hardware fails, in that case all
254 * buffers has been queued, in such case all buffers that 256 * buffers that have been already given by the @buf_queue
255 * have been already given by the @buf_queue callback are 257 * callback are invalidated.
256 * invalidated. 258 * If there were not enough queued buffers to start
259 * streaming, then this callback returns -ENOBUFS, and the
260 * vb2 core will retry calling @start_streaming when a new
261 * buffer is queued.
257 * @stop_streaming: called when 'streaming' state must be disabled; driver 262 * @stop_streaming: called when 'streaming' state must be disabled; driver
258 * should stop any DMA transactions or wait until they 263 * should stop any DMA transactions or wait until they
259 * finish and give back all buffers it got from buf_queue() 264 * finish and give back all buffers it got from buf_queue()
@@ -321,6 +326,9 @@ struct v4l2_fh;
321 * @done_wq: waitqueue for processes waiting for buffers ready to be dequeued 326 * @done_wq: waitqueue for processes waiting for buffers ready to be dequeued
322 * @alloc_ctx: memory type/allocator-specific contexts for each plane 327 * @alloc_ctx: memory type/allocator-specific contexts for each plane
323 * @streaming: current streaming state 328 * @streaming: current streaming state
329 * @retry_start_streaming: start_streaming() was called, but there were not enough
330 * buffers queued. If set, then retry calling start_streaming when
331 * queuing a new buffer.
324 * @fileio: file io emulator internal data, used only if emulator is active 332 * @fileio: file io emulator internal data, used only if emulator is active
325 */ 333 */
326struct vb2_queue { 334struct vb2_queue {
@@ -353,6 +361,7 @@ struct vb2_queue {
353 unsigned int plane_sizes[VIDEO_MAX_PLANES]; 361 unsigned int plane_sizes[VIDEO_MAX_PLANES];
354 362
355 unsigned int streaming:1; 363 unsigned int streaming:1;
364 unsigned int retry_start_streaming:1;
356 365
357 struct vb2_fileio_data *fileio; 366 struct vb2_fileio_data *fileio;
358}; 367};
@@ -491,6 +500,7 @@ int vb2_ioctl_expbuf(struct file *file, void *priv,
491 500
492int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma); 501int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma);
493int vb2_fop_release(struct file *file); 502int vb2_fop_release(struct file *file);
503int _vb2_fop_release(struct file *file, struct mutex *lock);
494ssize_t vb2_fop_write(struct file *file, const char __user *buf, 504ssize_t vb2_fop_write(struct file *file, const char __user *buf,
495 size_t count, loff_t *ppos); 505 size_t count, loff_t *ppos);
496ssize_t vb2_fop_read(struct file *file, char __user *buf, 506ssize_t vb2_fop_read(struct file *file, char __user *buf,
diff --git a/include/net/Space.h b/include/net/Space.h
new file mode 100644
index 000000000000..8a32771e4215
--- /dev/null
+++ b/include/net/Space.h
@@ -0,0 +1,31 @@
1/* A unified ethernet device probe. This is the easiest way to have every
2 * ethernet adaptor have the name "eth[0123...]".
3 */
4
5struct net_device *hp100_probe(int unit);
6struct net_device *ultra_probe(int unit);
7struct net_device *wd_probe(int unit);
8struct net_device *ne_probe(int unit);
9struct net_device *fmv18x_probe(int unit);
10struct net_device *i82596_probe(int unit);
11struct net_device *ni65_probe(int unit);
12struct net_device *sonic_probe(int unit);
13struct net_device *smc_init(int unit);
14struct net_device *atarilance_probe(int unit);
15struct net_device *sun3lance_probe(int unit);
16struct net_device *sun3_82586_probe(int unit);
17struct net_device *apne_probe(int unit);
18struct net_device *cs89x0_probe(int unit);
19struct net_device *mvme147lance_probe(int unit);
20struct net_device *tc515_probe(int unit);
21struct net_device *lance_probe(int unit);
22struct net_device *mac8390_probe(int unit);
23struct net_device *mac89x0_probe(int unit);
24struct net_device *cops_probe(int unit);
25struct net_device *ltpc_probe(void);
26
27/* Fibre Channel adapters */
28int iph5526_probe(struct net_device *dev);
29
30/* SBNI adapters */
31int sbni_probe(int unit);
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 9e90fdff470d..788d8378e587 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -9,7 +9,7 @@
9#include <net/pkt_sched.h> 9#include <net/pkt_sched.h>
10 10
11struct tcf_common { 11struct tcf_common {
12 struct tcf_common *tcfc_next; 12 struct hlist_node tcfc_head;
13 u32 tcfc_index; 13 u32 tcfc_index;
14 int tcfc_refcnt; 14 int tcfc_refcnt;
15 int tcfc_bindcnt; 15 int tcfc_bindcnt;
@@ -22,7 +22,7 @@ struct tcf_common {
22 spinlock_t tcfc_lock; 22 spinlock_t tcfc_lock;
23 struct rcu_head tcfc_rcu; 23 struct rcu_head tcfc_rcu;
24}; 24};
25#define tcf_next common.tcfc_next 25#define tcf_head common.tcfc_head
26#define tcf_index common.tcfc_index 26#define tcf_index common.tcfc_index
27#define tcf_refcnt common.tcfc_refcnt 27#define tcf_refcnt common.tcfc_refcnt
28#define tcf_bindcnt common.tcfc_bindcnt 28#define tcf_bindcnt common.tcfc_bindcnt
@@ -36,9 +36,10 @@ struct tcf_common {
36#define tcf_rcu common.tcfc_rcu 36#define tcf_rcu common.tcfc_rcu
37 37
38struct tcf_hashinfo { 38struct tcf_hashinfo {
39 struct tcf_common **htab; 39 struct hlist_head *htab;
40 unsigned int hmask; 40 unsigned int hmask;
41 rwlock_t *lock; 41 spinlock_t lock;
42 u32 index;
42}; 43};
43 44
44static inline unsigned int tcf_hash(u32 index, unsigned int hmask) 45static inline unsigned int tcf_hash(u32 index, unsigned int hmask)
@@ -46,33 +47,47 @@ static inline unsigned int tcf_hash(u32 index, unsigned int hmask)
46 return index & hmask; 47 return index & hmask;
47} 48}
48 49
50static inline int tcf_hashinfo_init(struct tcf_hashinfo *hf, unsigned int mask)
51{
52 int i;
53
54 spin_lock_init(&hf->lock);
55 hf->index = 0;
56 hf->hmask = mask;
57 hf->htab = kzalloc((mask + 1) * sizeof(struct hlist_head),
58 GFP_KERNEL);
59 if (!hf->htab)
60 return -ENOMEM;
61 for (i = 0; i < mask + 1; i++)
62 INIT_HLIST_HEAD(&hf->htab[i]);
63 return 0;
64}
65
66static inline void tcf_hashinfo_destroy(struct tcf_hashinfo *hf)
67{
68 kfree(hf->htab);
69}
70
49#ifdef CONFIG_NET_CLS_ACT 71#ifdef CONFIG_NET_CLS_ACT
50 72
51#define ACT_P_CREATED 1 73#define ACT_P_CREATED 1
52#define ACT_P_DELETED 1 74#define ACT_P_DELETED 1
53 75
54struct tcf_act_hdr {
55 struct tcf_common common;
56};
57
58struct tc_action { 76struct tc_action {
59 void *priv; 77 void *priv;
60 const struct tc_action_ops *ops; 78 const struct tc_action_ops *ops;
61 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ 79 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */
62 __u32 order; 80 __u32 order;
63 struct tc_action *next; 81 struct list_head list;
64}; 82};
65 83
66#define TCA_CAP_NONE 0
67struct tc_action_ops { 84struct tc_action_ops {
68 struct tc_action_ops *next; 85 struct list_head head;
69 struct tcf_hashinfo *hinfo; 86 struct tcf_hashinfo *hinfo;
70 char kind[IFNAMSIZ]; 87 char kind[IFNAMSIZ];
71 __u32 type; /* TBD to match kind */ 88 __u32 type; /* TBD to match kind */
72 __u32 capab; /* capabilities includes 4 bit version */
73 struct module *owner; 89 struct module *owner;
74 int (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *); 90 int (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *);
75 int (*get_stats)(struct sk_buff *, struct tc_action *);
76 int (*dump)(struct sk_buff *, struct tc_action *, int, int); 91 int (*dump)(struct sk_buff *, struct tc_action *, int, int);
77 int (*cleanup)(struct tc_action *, int bind); 92 int (*cleanup)(struct tc_action *, int bind);
78 int (*lookup)(struct tc_action *, u32); 93 int (*lookup)(struct tc_action *, u32);
@@ -82,34 +97,30 @@ struct tc_action_ops {
82 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *); 97 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *);
83}; 98};
84 99
85struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo); 100int tcf_hash_search(struct tc_action *a, u32 index);
86void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo); 101void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo);
87int tcf_hash_release(struct tcf_common *p, int bind, 102int tcf_hash_release(struct tcf_common *p, int bind,
88 struct tcf_hashinfo *hinfo); 103 struct tcf_hashinfo *hinfo);
89int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb, 104u32 tcf_hash_new_index(struct tcf_hashinfo *hinfo);
90 int type, struct tc_action *a);
91u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo);
92int tcf_hash_search(struct tc_action *a, u32 index);
93struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, 105struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a,
94 int bind, struct tcf_hashinfo *hinfo); 106 int bind);
95struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est, 107struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est,
96 struct tc_action *a, int size, 108 struct tc_action *a, int size,
97 int bind, u32 *idx_gen, 109 int bind);
98 struct tcf_hashinfo *hinfo);
99void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo); 110void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
100 111
101int tcf_register_action(struct tc_action_ops *a); 112int tcf_register_action(struct tc_action_ops *a);
102int tcf_unregister_action(struct tc_action_ops *a); 113int tcf_unregister_action(struct tc_action_ops *a);
103void tcf_action_destroy(struct tc_action *a, int bind); 114void tcf_action_destroy(struct list_head *actions, int bind);
104int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, 115int tcf_action_exec(struct sk_buff *skb, const struct list_head *actions,
105 struct tcf_result *res); 116 struct tcf_result *res);
106struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla, 117int tcf_action_init(struct net *net, struct nlattr *nla,
107 struct nlattr *est, char *n, int ovr, 118 struct nlattr *est, char *n, int ovr,
108 int bind); 119 int bind, struct list_head *);
109struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla, 120struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
110 struct nlattr *est, char *n, int ovr, 121 struct nlattr *est, char *n, int ovr,
111 int bind); 122 int bind);
112int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); 123int tcf_action_dump(struct sk_buff *skb, struct list_head *, int, int);
113int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); 124int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
114int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); 125int 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); 126int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int);
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 86505bfa5d2c..50e39a8822b4 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -81,9 +81,9 @@ int ipv6_dev_get_saddr(struct net *net, const struct net_device *dev,
81 const struct in6_addr *daddr, unsigned int srcprefs, 81 const struct in6_addr *daddr, unsigned int srcprefs,
82 struct in6_addr *saddr); 82 struct in6_addr *saddr);
83int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr, 83int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr,
84 unsigned char banned_flags); 84 u32 banned_flags);
85int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr, 85int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
86 unsigned char banned_flags); 86 u32 banned_flags);
87int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2); 87int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2);
88void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr); 88void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr);
89void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr); 89void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr);
@@ -205,8 +205,9 @@ void ipv6_sock_ac_close(struct sock *sk);
205int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); 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); 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, 207bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
208 const struct in6_addr *addr); 208 const struct in6_addr *addr);
209 209bool ipv6_chk_acast_addr_src(struct net *net, struct net_device *dev,
210 const struct in6_addr *addr);
210 211
211/* Device notifier */ 212/* Device notifier */
212int register_inet6addr_notifier(struct notifier_block *nb); 213int register_inet6addr_notifier(struct notifier_block *nb);
@@ -248,6 +249,13 @@ static inline struct inet6_dev *in6_dev_get(const struct net_device *dev)
248 return idev; 249 return idev;
249} 250}
250 251
252static inline struct neigh_parms *__in6_dev_nd_parms_get_rcu(const struct net_device *dev)
253{
254 struct inet6_dev *idev = __in6_dev_get(dev);
255
256 return idev ? idev->nd_parms : NULL;
257}
258
251void in6_dev_finish_destroy(struct inet6_dev *idev); 259void in6_dev_finish_destroy(struct inet6_dev *idev);
252 260
253static inline void in6_dev_put(struct inet6_dev *idev) 261static inline void in6_dev_put(struct inet6_dev *idev)
diff --git a/include/net/arp.h b/include/net/arp.h
index 7509d9da4e36..73c49864076b 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -62,6 +62,5 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
62 const unsigned char *src_hw, 62 const unsigned char *src_hw,
63 const unsigned char *target_hw); 63 const unsigned char *target_hw);
64void arp_xmit(struct sk_buff *skb); 64void arp_xmit(struct sk_buff *skb);
65int arp_invalidate(struct net_device *dev, __be32 ip);
66 65
67#endif /* _ARP_H */ 66#endif /* _ARP_H */
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 2a628b28249f..f4f9ee466791 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -115,6 +115,9 @@ struct bt_voice {
115#define BT_VOICE_TRANSPARENT 0x0003 115#define BT_VOICE_TRANSPARENT 0x0003
116#define BT_VOICE_CVSD_16BIT 0x0060 116#define BT_VOICE_CVSD_16BIT 0x0060
117 117
118#define BT_SNDMTU 12
119#define BT_RCVMTU 13
120
118__printf(1, 2) 121__printf(1, 2)
119int bt_info(const char *fmt, ...); 122int bt_info(const char *fmt, ...);
120__printf(1, 2) 123__printf(1, 2)
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 1784c48699f0..66c1cd87bfe7 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -83,7 +83,8 @@
83enum { 83enum {
84 HCI_QUIRK_RESET_ON_CLOSE, 84 HCI_QUIRK_RESET_ON_CLOSE,
85 HCI_QUIRK_RAW_DEVICE, 85 HCI_QUIRK_RAW_DEVICE,
86 HCI_QUIRK_FIXUP_BUFFER_SIZE 86 HCI_QUIRK_FIXUP_BUFFER_SIZE,
87 HCI_QUIRK_BROKEN_STORED_LINK_KEY,
87}; 88};
88 89
89/* HCI device flags */ 90/* HCI device flags */
@@ -131,6 +132,7 @@ enum {
131 HCI_PERIODIC_INQ, 132 HCI_PERIODIC_INQ,
132 HCI_FAST_CONNECTABLE, 133 HCI_FAST_CONNECTABLE,
133 HCI_BREDR_ENABLED, 134 HCI_BREDR_ENABLED,
135 HCI_6LOWPAN_ENABLED,
134}; 136};
135 137
136/* A mask for the flags that are supposed to remain when a reset happens 138/* A mask for the flags that are supposed to remain when a reset happens
@@ -275,6 +277,12 @@ enum {
275#define LMP_EXTFEATURES 0x80 277#define LMP_EXTFEATURES 0x80
276 278
277/* Extended LMP features */ 279/* Extended LMP features */
280#define LMP_CSB_MASTER 0x01
281#define LMP_CSB_SLAVE 0x02
282#define LMP_SYNC_TRAIN 0x04
283#define LMP_SYNC_SCAN 0x08
284
285/* Host features */
278#define LMP_HOST_SSP 0x01 286#define LMP_HOST_SSP 0x01
279#define LMP_HOST_LE 0x02 287#define LMP_HOST_LE 0x02
280#define LMP_HOST_LE_BREDR 0x04 288#define LMP_HOST_LE_BREDR 0x04
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index f8555ad7b104..f2f0cf5865c4 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -448,6 +448,7 @@ enum {
448 HCI_CONN_SSP_ENABLED, 448 HCI_CONN_SSP_ENABLED,
449 HCI_CONN_POWER_SAVE, 449 HCI_CONN_POWER_SAVE,
450 HCI_CONN_REMOTE_OOB, 450 HCI_CONN_REMOTE_OOB,
451 HCI_CONN_6LOWPAN,
451}; 452};
452 453
453static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) 454static inline bool hci_conn_ssp_enabled(struct hci_conn *conn)
@@ -798,6 +799,12 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
798#define lmp_transp_capable(dev) ((dev)->features[0][2] & LMP_TRANSPARENT) 799#define lmp_transp_capable(dev) ((dev)->features[0][2] & LMP_TRANSPARENT)
799 800
800/* ----- Extended LMP capabilities ----- */ 801/* ----- Extended LMP capabilities ----- */
802#define lmp_csb_master_capable(dev) ((dev)->features[2][0] & LMP_CSB_MASTER)
803#define lmp_csb_slave_capable(dev) ((dev)->features[2][0] & LMP_CSB_SLAVE)
804#define lmp_sync_train_capable(dev) ((dev)->features[2][0] & LMP_SYNC_TRAIN)
805#define lmp_sync_scan_capable(dev) ((dev)->features[2][0] & LMP_SYNC_SCAN)
806
807/* ----- Host capabilities ----- */
801#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP) 808#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP)
802#define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) 809#define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE))
803#define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) 810#define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR))
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index c853b16de4ef..dbc4a89984ca 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -112,6 +112,9 @@ struct l2cap_conninfo {
112#define L2CAP_MOVE_CHAN_CFM_RSP 0x11 112#define L2CAP_MOVE_CHAN_CFM_RSP 0x11
113#define L2CAP_CONN_PARAM_UPDATE_REQ 0x12 113#define L2CAP_CONN_PARAM_UPDATE_REQ 0x12
114#define L2CAP_CONN_PARAM_UPDATE_RSP 0x13 114#define L2CAP_CONN_PARAM_UPDATE_RSP 0x13
115#define L2CAP_LE_CONN_REQ 0x14
116#define L2CAP_LE_CONN_RSP 0x15
117#define L2CAP_LE_CREDITS 0x16
115 118
116/* L2CAP extended feature mask */ 119/* L2CAP extended feature mask */
117#define L2CAP_FEAT_FLOWCTL 0x00000001 120#define L2CAP_FEAT_FLOWCTL 0x00000001
@@ -133,6 +136,7 @@ struct l2cap_conninfo {
133#define L2CAP_FC_L2CAP 0x02 136#define L2CAP_FC_L2CAP 0x02
134#define L2CAP_FC_CONNLESS 0x04 137#define L2CAP_FC_CONNLESS 0x04
135#define L2CAP_FC_A2MP 0x08 138#define L2CAP_FC_A2MP 0x08
139#define L2CAP_FC_6LOWPAN 0x3e /* reserved and temporary value */
136 140
137/* L2CAP Control Field bit masks */ 141/* L2CAP Control Field bit masks */
138#define L2CAP_CTRL_SAR 0xC000 142#define L2CAP_CTRL_SAR 0xC000
@@ -249,6 +253,7 @@ struct l2cap_conn_rsp {
249#define L2CAP_CID_SMP 0x0006 253#define L2CAP_CID_SMP 0x0006
250#define L2CAP_CID_DYN_START 0x0040 254#define L2CAP_CID_DYN_START 0x0040
251#define L2CAP_CID_DYN_END 0xffff 255#define L2CAP_CID_DYN_END 0xffff
256#define L2CAP_CID_LE_DYN_END 0x007f
252 257
253/* connect/create channel results */ 258/* connect/create channel results */
254#define L2CAP_CR_SUCCESS 0x0000 259#define L2CAP_CR_SUCCESS 0x0000
@@ -257,6 +262,10 @@ struct l2cap_conn_rsp {
257#define L2CAP_CR_SEC_BLOCK 0x0003 262#define L2CAP_CR_SEC_BLOCK 0x0003
258#define L2CAP_CR_NO_MEM 0x0004 263#define L2CAP_CR_NO_MEM 0x0004
259#define L2CAP_CR_BAD_AMP 0x0005 264#define L2CAP_CR_BAD_AMP 0x0005
265#define L2CAP_CR_AUTHENTICATION 0x0005
266#define L2CAP_CR_AUTHORIZATION 0x0006
267#define L2CAP_CR_BAD_KEY_SIZE 0x0007
268#define L2CAP_CR_ENCRYPTION 0x0008
260 269
261/* connect/create channel status */ 270/* connect/create channel status */
262#define L2CAP_CS_NO_INFO 0x0000 271#define L2CAP_CS_NO_INFO 0x0000
@@ -321,6 +330,12 @@ struct l2cap_conf_rfc {
321#define L2CAP_MODE_ERTM 0x03 330#define L2CAP_MODE_ERTM 0x03
322#define L2CAP_MODE_STREAMING 0x04 331#define L2CAP_MODE_STREAMING 0x04
323 332
333/* Unlike the above this one doesn't actually map to anything that would
334 * ever be sent over the air. Therefore, use a value that's unlikely to
335 * ever be used in the BR/EDR configuration phase.
336 */
337#define L2CAP_MODE_LE_FLOWCTL 0x80
338
324struct l2cap_conf_efs { 339struct l2cap_conf_efs {
325 __u8 id; 340 __u8 id;
326 __u8 stype; 341 __u8 stype;
@@ -423,6 +438,30 @@ struct l2cap_conn_param_update_rsp {
423#define L2CAP_CONN_PARAM_ACCEPTED 0x0000 438#define L2CAP_CONN_PARAM_ACCEPTED 0x0000
424#define L2CAP_CONN_PARAM_REJECTED 0x0001 439#define L2CAP_CONN_PARAM_REJECTED 0x0001
425 440
441#define L2CAP_LE_MAX_CREDITS 10
442#define L2CAP_LE_DEFAULT_MPS 230
443
444struct l2cap_le_conn_req {
445 __le16 psm;
446 __le16 scid;
447 __le16 mtu;
448 __le16 mps;
449 __le16 credits;
450} __packed;
451
452struct l2cap_le_conn_rsp {
453 __le16 dcid;
454 __le16 mtu;
455 __le16 mps;
456 __le16 credits;
457 __le16 result;
458} __packed;
459
460struct l2cap_le_credits {
461 __le16 cid;
462 __le16 credits;
463} __packed;
464
426/* ----- L2CAP channels and connections ----- */ 465/* ----- L2CAP channels and connections ----- */
427struct l2cap_seq_list { 466struct l2cap_seq_list {
428 __u16 head; 467 __u16 head;
@@ -477,6 +516,9 @@ struct l2cap_chan {
477 __u16 monitor_timeout; 516 __u16 monitor_timeout;
478 __u16 mps; 517 __u16 mps;
479 518
519 __u16 tx_credits;
520 __u16 rx_credits;
521
480 __u8 tx_state; 522 __u8 tx_state;
481 __u8 rx_state; 523 __u8 rx_state;
482 524
@@ -553,6 +595,7 @@ struct l2cap_ops {
553 void (*ready) (struct l2cap_chan *chan); 595 void (*ready) (struct l2cap_chan *chan);
554 void (*defer) (struct l2cap_chan *chan); 596 void (*defer) (struct l2cap_chan *chan);
555 void (*resume) (struct l2cap_chan *chan); 597 void (*resume) (struct l2cap_chan *chan);
598 void (*suspend) (struct l2cap_chan *chan);
556 void (*set_shutdown) (struct l2cap_chan *chan); 599 void (*set_shutdown) (struct l2cap_chan *chan);
557 long (*get_sndtimeo) (struct l2cap_chan *chan); 600 long (*get_sndtimeo) (struct l2cap_chan *chan);
558 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, 601 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
@@ -654,6 +697,7 @@ enum {
654 FLAG_EXT_CTRL, 697 FLAG_EXT_CTRL,
655 FLAG_EFS_ENABLE, 698 FLAG_EFS_ENABLE,
656 FLAG_DEFER_SETUP, 699 FLAG_DEFER_SETUP,
700 FLAG_LE_CONN_REQ_SENT,
657}; 701};
658 702
659enum { 703enum {
@@ -809,11 +853,13 @@ static inline long l2cap_chan_no_get_sndtimeo(struct l2cap_chan *chan)
809} 853}
810 854
811extern bool disable_ertm; 855extern bool disable_ertm;
856extern bool enable_lecoc;
812 857
813int l2cap_init_sockets(void); 858int l2cap_init_sockets(void);
814void l2cap_cleanup_sockets(void); 859void l2cap_cleanup_sockets(void);
815bool l2cap_is_socket(struct socket *sock); 860bool l2cap_is_socket(struct socket *sock);
816 861
862void __l2cap_le_connect_rsp_defer(struct l2cap_chan *chan);
817void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); 863void __l2cap_connect_rsp_defer(struct l2cap_chan *chan);
818 864
819int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm); 865int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm);
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 3eae46cb1acf..b1f84b05c67e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -91,9 +91,8 @@ enum ieee80211_band {
91 * Channel flags set by the regulatory control code. 91 * Channel flags set by the regulatory control code.
92 * 92 *
93 * @IEEE80211_CHAN_DISABLED: This channel is disabled. 93 * @IEEE80211_CHAN_DISABLED: This channel is disabled.
94 * @IEEE80211_CHAN_PASSIVE_SCAN: Only passive scanning is permitted 94 * @IEEE80211_CHAN_NO_IR: do not initiate radiation, this includes
95 * on this channel. 95 * sending probe requests or beaconing.
96 * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel.
97 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel. 96 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
98 * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel 97 * @IEEE80211_CHAN_NO_HT40PLUS: extension channel above this channel
99 * is not permitted. 98 * is not permitted.
@@ -113,8 +112,8 @@ enum ieee80211_band {
113 */ 112 */
114enum ieee80211_channel_flags { 113enum ieee80211_channel_flags {
115 IEEE80211_CHAN_DISABLED = 1<<0, 114 IEEE80211_CHAN_DISABLED = 1<<0,
116 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1, 115 IEEE80211_CHAN_NO_IR = 1<<1,
117 IEEE80211_CHAN_NO_IBSS = 1<<2, 116 /* hole at 1<<2 */
118 IEEE80211_CHAN_RADAR = 1<<3, 117 IEEE80211_CHAN_RADAR = 1<<3,
119 IEEE80211_CHAN_NO_HT40PLUS = 1<<4, 118 IEEE80211_CHAN_NO_HT40PLUS = 1<<4,
120 IEEE80211_CHAN_NO_HT40MINUS = 1<<5, 119 IEEE80211_CHAN_NO_HT40MINUS = 1<<5,
@@ -748,6 +747,8 @@ enum station_parameters_apply_mask {
748 * @supported_channels_len: number of supported channels 747 * @supported_channels_len: number of supported channels
749 * @supported_oper_classes: supported oper classes in IEEE 802.11 format 748 * @supported_oper_classes: supported oper classes in IEEE 802.11 format
750 * @supported_oper_classes_len: number of supported operating classes 749 * @supported_oper_classes_len: number of supported operating classes
750 * @opmode_notif: operating mode field from Operating Mode Notification
751 * @opmode_notif_used: information if operating mode field is used
751 */ 752 */
752struct station_parameters { 753struct station_parameters {
753 const u8 *supported_rates; 754 const u8 *supported_rates;
@@ -771,6 +772,8 @@ struct station_parameters {
771 u8 supported_channels_len; 772 u8 supported_channels_len;
772 const u8 *supported_oper_classes; 773 const u8 *supported_oper_classes;
773 u8 supported_oper_classes_len; 774 u8 supported_oper_classes_len;
775 u8 opmode_notif;
776 bool opmode_notif_used;
774}; 777};
775 778
776/** 779/**
@@ -1763,7 +1766,8 @@ enum wiphy_params_flags {
1763struct cfg80211_bitrate_mask { 1766struct cfg80211_bitrate_mask {
1764 struct { 1767 struct {
1765 u32 legacy; 1768 u32 legacy;
1766 u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; 1769 u8 ht_mcs[IEEE80211_HT_MCS_MASK_LEN];
1770 u16 vht_mcs[NL80211_VHT_NSS_MAX];
1767 } control[IEEE80211_NUM_BANDS]; 1771 } control[IEEE80211_NUM_BANDS];
1768}; 1772};
1769/** 1773/**
@@ -1945,6 +1949,73 @@ struct cfg80211_update_ft_ies_params {
1945}; 1949};
1946 1950
1947/** 1951/**
1952 * struct cfg80211_mgmt_tx_params - mgmt tx parameters
1953 *
1954 * This structure provides information needed to transmit a mgmt frame
1955 *
1956 * @chan: channel to use
1957 * @offchan: indicates wether off channel operation is required
1958 * @wait: duration for ROC
1959 * @buf: buffer to transmit
1960 * @len: buffer length
1961 * @no_cck: don't use cck rates for this frame
1962 * @dont_wait_for_ack: tells the low level not to wait for an ack
1963 */
1964struct cfg80211_mgmt_tx_params {
1965 struct ieee80211_channel *chan;
1966 bool offchan;
1967 unsigned int wait;
1968 const u8 *buf;
1969 size_t len;
1970 bool no_cck;
1971 bool dont_wait_for_ack;
1972};
1973
1974/**
1975 * struct cfg80211_dscp_exception - DSCP exception
1976 *
1977 * @dscp: DSCP value that does not adhere to the user priority range definition
1978 * @up: user priority value to which the corresponding DSCP value belongs
1979 */
1980struct cfg80211_dscp_exception {
1981 u8 dscp;
1982 u8 up;
1983};
1984
1985/**
1986 * struct cfg80211_dscp_range - DSCP range definition for user priority
1987 *
1988 * @low: lowest DSCP value of this user priority range, inclusive
1989 * @high: highest DSCP value of this user priority range, inclusive
1990 */
1991struct cfg80211_dscp_range {
1992 u8 low;
1993 u8 high;
1994};
1995
1996/* QoS Map Set element length defined in IEEE Std 802.11-2012, 8.4.2.97 */
1997#define IEEE80211_QOS_MAP_MAX_EX 21
1998#define IEEE80211_QOS_MAP_LEN_MIN 16
1999#define IEEE80211_QOS_MAP_LEN_MAX \
2000 (IEEE80211_QOS_MAP_LEN_MIN + 2 * IEEE80211_QOS_MAP_MAX_EX)
2001
2002/**
2003 * struct cfg80211_qos_map - QoS Map Information
2004 *
2005 * This struct defines the Interworking QoS map setting for DSCP values
2006 *
2007 * @num_des: number of DSCP exceptions (0..21)
2008 * @dscp_exception: optionally up to maximum of 21 DSCP exceptions from
2009 * the user priority DSCP range definition
2010 * @up: DSCP range definition for a particular user priority
2011 */
2012struct cfg80211_qos_map {
2013 u8 num_des;
2014 struct cfg80211_dscp_exception dscp_exception[IEEE80211_QOS_MAP_MAX_EX];
2015 struct cfg80211_dscp_range up[8];
2016};
2017
2018/**
1948 * struct cfg80211_ops - backend description for wireless configuration 2019 * struct cfg80211_ops - backend description for wireless configuration
1949 * 2020 *
1950 * This struct is registered by fullmac card drivers and/or wireless stacks 2021 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -2186,6 +2257,8 @@ struct cfg80211_update_ft_ies_params {
2186 * @set_coalesce: Set coalesce parameters. 2257 * @set_coalesce: Set coalesce parameters.
2187 * 2258 *
2188 * @channel_switch: initiate channel-switch procedure (with CSA) 2259 * @channel_switch: initiate channel-switch procedure (with CSA)
2260 *
2261 * @set_qos_map: Set QoS mapping information to the driver
2189 */ 2262 */
2190struct cfg80211_ops { 2263struct cfg80211_ops {
2191 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 2264 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2342,9 +2415,8 @@ struct cfg80211_ops {
2342 u64 cookie); 2415 u64 cookie);
2343 2416
2344 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, 2417 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
2345 struct ieee80211_channel *chan, bool offchan, 2418 struct cfg80211_mgmt_tx_params *params,
2346 unsigned int wait, const u8 *buf, size_t len, 2419 u64 *cookie);
2347 bool no_cck, bool dont_wait_for_ack, u64 *cookie);
2348 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, 2420 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
2349 struct wireless_dev *wdev, 2421 struct wireless_dev *wdev,
2350 u64 cookie); 2422 u64 cookie);
@@ -2428,6 +2500,9 @@ struct cfg80211_ops {
2428 int (*channel_switch)(struct wiphy *wiphy, 2500 int (*channel_switch)(struct wiphy *wiphy,
2429 struct net_device *dev, 2501 struct net_device *dev,
2430 struct cfg80211_csa_settings *params); 2502 struct cfg80211_csa_settings *params);
2503 int (*set_qos_map)(struct wiphy *wiphy,
2504 struct net_device *dev,
2505 struct cfg80211_qos_map *qos_map);
2431}; 2506};
2432 2507
2433/* 2508/*
@@ -2438,27 +2513,6 @@ struct cfg80211_ops {
2438/** 2513/**
2439 * enum wiphy_flags - wiphy capability flags 2514 * enum wiphy_flags - wiphy capability flags
2440 * 2515 *
2441 * @WIPHY_FLAG_CUSTOM_REGULATORY: tells us the driver for this device
2442 * has its own custom regulatory domain and cannot identify the
2443 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
2444 * we will disregard the first regulatory hint (when the
2445 * initiator is %REGDOM_SET_BY_CORE).
2446 * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will
2447 * ignore regulatory domain settings until it gets its own regulatory
2448 * domain via its regulatory_hint() unless the regulatory hint is
2449 * from a country IE. After its gets its own regulatory domain it will
2450 * only allow further regulatory domain settings to further enhance
2451 * compliance. For example if channel 13 and 14 are disabled by this
2452 * regulatory domain no user regulatory domain can enable these channels
2453 * at a later time. This can be used for devices which do not have
2454 * calibration information guaranteed for frequencies or settings
2455 * outside of its regulatory domain. If used in combination with
2456 * WIPHY_FLAG_CUSTOM_REGULATORY the inspected country IE power settings
2457 * will be followed.
2458 * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure
2459 * that passive scan flags and beaconing flags may not be lifted by
2460 * cfg80211 due to regulatory beacon hints. For more information on beacon
2461 * hints read the documenation for regulatory_hint_found_beacon()
2462 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this 2516 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
2463 * wiphy at all 2517 * wiphy at all
2464 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled 2518 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
@@ -2497,9 +2551,9 @@ struct cfg80211_ops {
2497 * beaconing mode (AP, IBSS, Mesh, ...). 2551 * beaconing mode (AP, IBSS, Mesh, ...).
2498 */ 2552 */
2499enum wiphy_flags { 2553enum wiphy_flags {
2500 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 2554 /* use hole at 0 */
2501 WIPHY_FLAG_STRICT_REGULATORY = BIT(1), 2555 /* use hole at 1 */
2502 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), 2556 /* use hole at 2 */
2503 WIPHY_FLAG_NETNS_OK = BIT(3), 2557 WIPHY_FLAG_NETNS_OK = BIT(3),
2504 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), 2558 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
2505 WIPHY_FLAG_4ADDR_AP = BIT(5), 2559 WIPHY_FLAG_4ADDR_AP = BIT(5),
@@ -2676,6 +2730,34 @@ struct wiphy_coalesce_support {
2676}; 2730};
2677 2731
2678/** 2732/**
2733 * enum wiphy_vendor_command_flags - validation flags for vendor commands
2734 * @WIPHY_VENDOR_CMD_NEED_WDEV: vendor command requires wdev
2735 * @WIPHY_VENDOR_CMD_NEED_NETDEV: vendor command requires netdev
2736 * @WIPHY_VENDOR_CMD_NEED_RUNNING: interface/wdev must be up & running
2737 * (must be combined with %_WDEV or %_NETDEV)
2738 */
2739enum wiphy_vendor_command_flags {
2740 WIPHY_VENDOR_CMD_NEED_WDEV = BIT(0),
2741 WIPHY_VENDOR_CMD_NEED_NETDEV = BIT(1),
2742 WIPHY_VENDOR_CMD_NEED_RUNNING = BIT(2),
2743};
2744
2745/**
2746 * struct wiphy_vendor_command - vendor command definition
2747 * @info: vendor command identifying information, as used in nl80211
2748 * @flags: flags, see &enum wiphy_vendor_command_flags
2749 * @doit: callback for the operation, note that wdev is %NULL if the
2750 * flags didn't ask for a wdev and non-%NULL otherwise; the data
2751 * pointer may be %NULL if userspace provided no data at all
2752 */
2753struct wiphy_vendor_command {
2754 struct nl80211_vendor_cmd_info info;
2755 u32 flags;
2756 int (*doit)(struct wiphy *wiphy, struct wireless_dev *wdev,
2757 const void *data, int data_len);
2758};
2759
2760/**
2679 * struct wiphy - wireless hardware description 2761 * struct wiphy - wireless hardware description
2680 * @reg_notifier: the driver's regulatory notification callback, 2762 * @reg_notifier: the driver's regulatory notification callback,
2681 * note that if your driver uses wiphy_apply_custom_regulatory() 2763 * note that if your driver uses wiphy_apply_custom_regulatory()
@@ -2721,6 +2803,8 @@ struct wiphy_coalesce_support {
2721 * @software_iftypes: bitmask of software interface types, these are not 2803 * @software_iftypes: bitmask of software interface types, these are not
2722 * subject to any restrictions since they are purely managed in SW. 2804 * subject to any restrictions since they are purely managed in SW.
2723 * @flags: wiphy flags, see &enum wiphy_flags 2805 * @flags: wiphy flags, see &enum wiphy_flags
2806 * @regulatory_flags: wiphy regulatory flags, see
2807 * &enum ieee80211_regulatory_flags
2724 * @features: features advertised to nl80211, see &enum nl80211_feature_flags. 2808 * @features: features advertised to nl80211, see &enum nl80211_feature_flags.
2725 * @bss_priv_size: each BSS struct has private data allocated with it, 2809 * @bss_priv_size: each BSS struct has private data allocated with it,
2726 * this variable determines its size 2810 * this variable determines its size
@@ -2786,6 +2870,11 @@ struct wiphy_coalesce_support {
2786 * @extended_capabilities_mask: mask of the valid values 2870 * @extended_capabilities_mask: mask of the valid values
2787 * @extended_capabilities_len: length of the extended capabilities 2871 * @extended_capabilities_len: length of the extended capabilities
2788 * @coalesce: packet coalescing support information 2872 * @coalesce: packet coalescing support information
2873 *
2874 * @vendor_commands: array of vendor commands supported by the hardware
2875 * @n_vendor_commands: number of vendor commands
2876 * @vendor_events: array of vendor events supported by the hardware
2877 * @n_vendor_events: number of vendor events
2789 */ 2878 */
2790struct wiphy { 2879struct wiphy {
2791 /* assign these fields before you register the wiphy */ 2880 /* assign these fields before you register the wiphy */
@@ -2809,7 +2898,7 @@ struct wiphy {
2809 2898
2810 u16 max_acl_mac_addrs; 2899 u16 max_acl_mac_addrs;
2811 2900
2812 u32 flags, features; 2901 u32 flags, regulatory_flags, features;
2813 2902
2814 u32 ap_sme_capa; 2903 u32 ap_sme_capa;
2815 2904
@@ -2897,6 +2986,10 @@ struct wiphy {
2897 2986
2898 const struct wiphy_coalesce_support *coalesce; 2987 const struct wiphy_coalesce_support *coalesce;
2899 2988
2989 const struct wiphy_vendor_command *vendor_commands;
2990 const struct nl80211_vendor_cmd_info *vendor_events;
2991 int n_vendor_commands, n_vendor_events;
2992
2900 char priv[0] __aligned(NETDEV_ALIGN); 2993 char priv[0] __aligned(NETDEV_ALIGN);
2901}; 2994};
2902 2995
@@ -3388,9 +3481,11 @@ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
3388/** 3481/**
3389 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame 3482 * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame
3390 * @skb: the data frame 3483 * @skb: the data frame
3484 * @qos_map: Interworking QoS mapping or %NULL if not in use
3391 * Return: The 802.1p/1d tag. 3485 * Return: The 802.1p/1d tag.
3392 */ 3486 */
3393unsigned int cfg80211_classify8021d(struct sk_buff *skb); 3487unsigned int cfg80211_classify8021d(struct sk_buff *skb,
3488 struct cfg80211_qos_map *qos_map);
3394 3489
3395/** 3490/**
3396 * cfg80211_find_ie - find information element in data 3491 * cfg80211_find_ie - find information element in data
@@ -3472,6 +3567,9 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3472 * custom regulatory domain will be trusted completely and as such previous 3567 * custom regulatory domain will be trusted completely and as such previous
3473 * default channel settings will be disregarded. If no rule is found for a 3568 * default channel settings will be disregarded. If no rule is found for a
3474 * channel on the regulatory domain the channel will be disabled. 3569 * channel on the regulatory domain the channel will be disabled.
3570 * Drivers using this for a wiphy should also set the wiphy flag
3571 * WIPHY_FLAG_CUSTOM_REGULATORY or cfg80211 will set it for the wiphy
3572 * that called this helper.
3475 */ 3573 */
3476void wiphy_apply_custom_regulatory(struct wiphy *wiphy, 3574void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
3477 const struct ieee80211_regdomain *regd); 3575 const struct ieee80211_regdomain *regd);
@@ -3838,6 +3936,121 @@ void wiphy_rfkill_start_polling(struct wiphy *wiphy);
3838 */ 3936 */
3839void wiphy_rfkill_stop_polling(struct wiphy *wiphy); 3937void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
3840 3938
3939/**
3940 * DOC: Vendor commands
3941 *
3942 * Occasionally, there are special protocol or firmware features that
3943 * can't be implemented very openly. For this and similar cases, the
3944 * vendor command functionality allows implementing the features with
3945 * (typically closed-source) userspace and firmware, using nl80211 as
3946 * the configuration mechanism.
3947 *
3948 * A driver supporting vendor commands must register them as an array
3949 * in struct wiphy, with handlers for each one, each command has an
3950 * OUI and sub command ID to identify it.
3951 *
3952 * Note that this feature should not be (ab)used to implement protocol
3953 * features that could openly be shared across drivers. In particular,
3954 * it must never be required to use vendor commands to implement any
3955 * "normal" functionality that higher-level userspace like connection
3956 * managers etc. need.
3957 */
3958
3959struct sk_buff *__cfg80211_alloc_reply_skb(struct wiphy *wiphy,
3960 enum nl80211_commands cmd,
3961 enum nl80211_attrs attr,
3962 int approxlen);
3963
3964struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy,
3965 enum nl80211_commands cmd,
3966 enum nl80211_attrs attr,
3967 int vendor_event_idx,
3968 int approxlen, gfp_t gfp);
3969
3970void __cfg80211_send_event_skb(struct sk_buff *skb, gfp_t gfp);
3971
3972/**
3973 * cfg80211_vendor_cmd_alloc_reply_skb - allocate vendor command reply
3974 * @wiphy: the wiphy
3975 * @approxlen: an upper bound of the length of the data that will
3976 * be put into the skb
3977 *
3978 * This function allocates and pre-fills an skb for a reply to
3979 * a vendor command. Since it is intended for a reply, calling
3980 * it outside of a vendor command's doit() operation is invalid.
3981 *
3982 * The returned skb is pre-filled with some identifying data in
3983 * a way that any data that is put into the skb (with skb_put(),
3984 * nla_put() or similar) will end up being within the
3985 * %NL80211_ATTR_VENDOR_DATA attribute, so all that needs to be done
3986 * with the skb is adding data for the corresponding userspace tool
3987 * which can then read that data out of the vendor data attribute.
3988 * You must not modify the skb in any other way.
3989 *
3990 * When done, call cfg80211_vendor_cmd_reply() with the skb and return
3991 * its error code as the result of the doit() operation.
3992 *
3993 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3994 */
3995static inline struct sk_buff *
3996cfg80211_vendor_cmd_alloc_reply_skb(struct wiphy *wiphy, int approxlen)
3997{
3998 return __cfg80211_alloc_reply_skb(wiphy, NL80211_CMD_VENDOR,
3999 NL80211_ATTR_VENDOR_DATA, approxlen);
4000}
4001
4002/**
4003 * cfg80211_vendor_cmd_reply - send the reply skb
4004 * @skb: The skb, must have been allocated with
4005 * cfg80211_vendor_cmd_alloc_reply_skb()
4006 *
4007 * Since calling this function will usually be the last thing
4008 * before returning from the vendor command doit() you should
4009 * return the error code. Note that this function consumes the
4010 * skb regardless of the return value.
4011 *
4012 * Return: An error code or 0 on success.
4013 */
4014int cfg80211_vendor_cmd_reply(struct sk_buff *skb);
4015
4016/**
4017 * cfg80211_vendor_event_alloc - allocate vendor-specific event skb
4018 * @wiphy: the wiphy
4019 * @event_idx: index of the vendor event in the wiphy's vendor_events
4020 * @approxlen: an upper bound of the length of the data that will
4021 * be put into the skb
4022 * @gfp: allocation flags
4023 *
4024 * This function allocates and pre-fills an skb for an event on the
4025 * vendor-specific multicast group.
4026 *
4027 * When done filling the skb, call cfg80211_vendor_event() with the
4028 * skb to send the event.
4029 *
4030 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
4031 */
4032static inline struct sk_buff *
4033cfg80211_vendor_event_alloc(struct wiphy *wiphy, int approxlen,
4034 int event_idx, gfp_t gfp)
4035{
4036 return __cfg80211_alloc_event_skb(wiphy, NL80211_CMD_VENDOR,
4037 NL80211_ATTR_VENDOR_DATA,
4038 event_idx, approxlen, gfp);
4039}
4040
4041/**
4042 * cfg80211_vendor_event - send the event
4043 * @skb: The skb, must have been allocated with cfg80211_vendor_event_alloc()
4044 * @gfp: allocation flags
4045 *
4046 * This function sends the given @skb, which must have been allocated
4047 * by cfg80211_vendor_event_alloc(), as an event. It always consumes it.
4048 */
4049static inline void cfg80211_vendor_event(struct sk_buff *skb, gfp_t gfp)
4050{
4051 __cfg80211_send_event_skb(skb, gfp);
4052}
4053
3841#ifdef CONFIG_NL80211_TESTMODE 4054#ifdef CONFIG_NL80211_TESTMODE
3842/** 4055/**
3843 * DOC: Test mode 4056 * DOC: Test mode
@@ -3873,8 +4086,12 @@ void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
3873 * 4086 *
3874 * Return: An allocated and pre-filled skb. %NULL if any errors happen. 4087 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3875 */ 4088 */
3876struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, 4089static inline struct sk_buff *
3877 int approxlen); 4090cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, int approxlen)
4091{
4092 return __cfg80211_alloc_reply_skb(wiphy, NL80211_CMD_TESTMODE,
4093 NL80211_ATTR_TESTDATA, approxlen);
4094}
3878 4095
3879/** 4096/**
3880 * cfg80211_testmode_reply - send the reply skb 4097 * cfg80211_testmode_reply - send the reply skb
@@ -3888,7 +4105,10 @@ struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy,
3888 * 4105 *
3889 * Return: An error code or 0 on success. 4106 * Return: An error code or 0 on success.
3890 */ 4107 */
3891int cfg80211_testmode_reply(struct sk_buff *skb); 4108static inline int cfg80211_testmode_reply(struct sk_buff *skb)
4109{
4110 return cfg80211_vendor_cmd_reply(skb);
4111}
3892 4112
3893/** 4113/**
3894 * cfg80211_testmode_alloc_event_skb - allocate testmode event 4114 * cfg80211_testmode_alloc_event_skb - allocate testmode event
@@ -3911,8 +4131,13 @@ int cfg80211_testmode_reply(struct sk_buff *skb);
3911 * 4131 *
3912 * Return: An allocated and pre-filled skb. %NULL if any errors happen. 4132 * Return: An allocated and pre-filled skb. %NULL if any errors happen.
3913 */ 4133 */
3914struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, 4134static inline struct sk_buff *
3915 int approxlen, gfp_t gfp); 4135cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, int approxlen, gfp_t gfp)
4136{
4137 return __cfg80211_alloc_event_skb(wiphy, NL80211_CMD_TESTMODE,
4138 NL80211_ATTR_TESTDATA, -1,
4139 approxlen, gfp);
4140}
3916 4141
3917/** 4142/**
3918 * cfg80211_testmode_event - send the event 4143 * cfg80211_testmode_event - send the event
@@ -3924,7 +4149,10 @@ struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy,
3924 * by cfg80211_testmode_alloc_event_skb(), as an event. It always 4149 * by cfg80211_testmode_alloc_event_skb(), as an event. It always
3925 * consumes it. 4150 * consumes it.
3926 */ 4151 */
3927void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp); 4152static inline void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp)
4153{
4154 __cfg80211_send_event_skb(skb, gfp);
4155}
3928 4156
3929#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd), 4157#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd),
3930#define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd), 4158#define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd),
@@ -4146,6 +4374,7 @@ void cfg80211_radar_event(struct wiphy *wiphy,
4146/** 4374/**
4147 * cfg80211_cac_event - Channel availability check (CAC) event 4375 * cfg80211_cac_event - Channel availability check (CAC) event
4148 * @netdev: network device 4376 * @netdev: network device
4377 * @chandef: chandef for the current channel
4149 * @event: type of event 4378 * @event: type of event
4150 * @gfp: context flags 4379 * @gfp: context flags
4151 * 4380 *
@@ -4154,6 +4383,7 @@ void cfg80211_radar_event(struct wiphy *wiphy,
4154 * also by full-MAC drivers. 4383 * also by full-MAC drivers.
4155 */ 4384 */
4156void cfg80211_cac_event(struct net_device *netdev, 4385void cfg80211_cac_event(struct net_device *netdev,
4386 const struct cfg80211_chan_def *chandef,
4157 enum nl80211_radar_event event, gfp_t gfp); 4387 enum nl80211_radar_event event, gfp_t gfp);
4158 4388
4159 4389
@@ -4279,7 +4509,8 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
4279 * @dev: the device which switched channels 4509 * @dev: the device which switched channels
4280 * @chandef: the new channel definition 4510 * @chandef: the new channel definition
4281 * 4511 *
4282 * Acquires wdev_lock, so must only be called from sleepable driver context! 4512 * Caller must acquire wdev_lock, therefore must only be called from sleepable
4513 * driver context!
4283 */ 4514 */
4284void cfg80211_ch_switch_notify(struct net_device *dev, 4515void cfg80211_ch_switch_notify(struct net_device *dev,
4285 struct cfg80211_chan_def *chandef); 4516 struct cfg80211_chan_def *chandef);
@@ -4409,6 +4640,14 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
4409 */ 4640 */
4410void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp); 4641void cfg80211_crit_proto_stopped(struct wireless_dev *wdev, gfp_t gfp);
4411 4642
4643/**
4644 * ieee80211_get_num_supported_channels - get number of channels device has
4645 * @wiphy: the wiphy
4646 *
4647 * Return: the number of channels supported by the device.
4648 */
4649unsigned int ieee80211_get_num_supported_channels(struct wiphy *wiphy);
4650
4412/* Logging, debugging and troubleshooting/diagnostic helpers. */ 4651/* Logging, debugging and troubleshooting/diagnostic helpers. */
4413 4652
4414/* wiphy_printk helpers, similar to dev_printk */ 4653/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index a8c2ef6d3b93..a6fd939f202d 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -26,8 +26,7 @@
26 * the GNU General Public License for more details. 26 * the GNU General Public License for more details.
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with this program; if not, write to the Free Software 29 * along with this program; if not, see <http://www.gnu.org/licenses/>.
30 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 * 30 *
32 */ 31 */
33 32
@@ -304,7 +303,7 @@ static inline int cipso_v4_validate(const struct sk_buff *skb,
304 303
305 for (opt_iter = 6; opt_iter < opt_len;) { 304 for (opt_iter = 6; opt_iter < opt_len;) {
306 tag_len = opt[opt_iter + 1]; 305 tag_len = opt[opt_iter + 1];
307 if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) { 306 if ((tag_len == 0) || (tag_len > (opt_len - opt_iter))) {
308 err_offset = opt_iter + 1; 307 err_offset = opt_iter + 1;
309 goto out; 308 goto out;
310 } 309 }
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index 33d03b648646..9cf2d5ef38d9 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -16,17 +16,16 @@
16#include <linux/cgroup.h> 16#include <linux/cgroup.h>
17#include <linux/hardirq.h> 17#include <linux/hardirq.h>
18#include <linux/rcupdate.h> 18#include <linux/rcupdate.h>
19#include <net/sock.h>
19 20
20#if IS_ENABLED(CONFIG_NET_CLS_CGROUP) 21#ifdef CONFIG_CGROUP_NET_CLASSID
21struct cgroup_cls_state 22struct cgroup_cls_state {
22{
23 struct cgroup_subsys_state css; 23 struct cgroup_subsys_state css;
24 u32 classid; 24 u32 classid;
25}; 25};
26 26
27void sock_update_classid(struct sock *sk); 27struct cgroup_cls_state *task_cls_state(struct task_struct *p);
28 28
29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP)
30static inline u32 task_cls_classid(struct task_struct *p) 29static inline u32 task_cls_classid(struct task_struct *p)
31{ 30{
32 u32 classid; 31 u32 classid;
@@ -41,33 +40,18 @@ static inline u32 task_cls_classid(struct task_struct *p)
41 40
42 return classid; 41 return classid;
43} 42}
44#elif IS_MODULE(CONFIG_NET_CLS_CGROUP)
45static inline u32 task_cls_classid(struct task_struct *p)
46{
47 struct cgroup_subsys_state *css;
48 u32 classid = 0;
49
50 if (in_interrupt())
51 return 0;
52
53 rcu_read_lock();
54 css = task_css(p, net_cls_subsys_id);
55 if (css)
56 classid = container_of(css,
57 struct cgroup_cls_state, css)->classid;
58 rcu_read_unlock();
59 43
60 return classid;
61}
62#endif
63#else /* !CGROUP_NET_CLS_CGROUP */
64static inline void sock_update_classid(struct sock *sk) 44static inline void sock_update_classid(struct sock *sk)
65{ 45{
66} 46 u32 classid;
67 47
68static inline u32 task_cls_classid(struct task_struct *p) 48 classid = task_cls_classid(current);
49 if (classid != sk->sk_classid)
50 sk->sk_classid = classid;
51}
52#else /* !CONFIG_CGROUP_NET_CLASSID */
53static inline void sock_update_classid(struct sock *sk)
69{ 54{
70 return 0;
71} 55}
72#endif /* CGROUP_NET_CLS_CGROUP */ 56#endif /* CONFIG_CGROUP_NET_CLASSID */
73#endif /* _NET_CLS_CGROUP_H */ 57#endif /* _NET_CLS_CGROUP_H */
diff --git a/include/net/codel.h b/include/net/codel.h
index 3b04ff5f6f8d..fe0eab32ce76 100644
--- a/include/net/codel.h
+++ b/include/net/codel.h
@@ -46,7 +46,6 @@
46#include <linux/skbuff.h> 46#include <linux/skbuff.h>
47#include <net/pkt_sched.h> 47#include <net/pkt_sched.h>
48#include <net/inet_ecn.h> 48#include <net/inet_ecn.h>
49#include <linux/reciprocal_div.h>
50 49
51/* Controlling Queue Delay (CoDel) algorithm 50/* Controlling Queue Delay (CoDel) algorithm
52 * ========================================= 51 * =========================================
@@ -211,10 +210,9 @@ static codel_time_t codel_control_law(codel_time_t t,
211 codel_time_t interval, 210 codel_time_t interval,
212 u32 rec_inv_sqrt) 211 u32 rec_inv_sqrt)
213{ 212{
214 return t + reciprocal_divide(interval, rec_inv_sqrt << REC_INV_SQRT_SHIFT); 213 return t + reciprocal_scale(interval, rec_inv_sqrt << REC_INV_SQRT_SHIFT);
215} 214}
216 215
217
218static bool codel_should_drop(const struct sk_buff *skb, 216static bool codel_should_drop(const struct sk_buff *skb,
219 struct Qdisc *sch, 217 struct Qdisc *sch,
220 struct codel_vars *vars, 218 struct codel_vars *vars,
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h
index d2f3041c0dfa..aec07c8a660a 100644
--- a/include/net/dcbevent.h
+++ b/include/net/dcbevent.h
@@ -11,8 +11,7 @@
11 * more details. 11 * more details.
12 * 12 *
13 * You should have received a copy of the GNU General Public License along with 13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 14 * this program; if not, see <http://www.gnu.org/licenses/>.
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 15 *
17 * Author: John Fastabend <john.r.fastabend@intel.com> 16 * Author: John Fastabend <john.r.fastabend@intel.com>
18 */ 17 */
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index fc5d5dcebb00..a975edf21b22 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -11,8 +11,7 @@
11 * more details. 11 * more details.
12 * 12 *
13 * You should have received a copy of the GNU General Public License along with 13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 14 * this program; if not, see <http://www.gnu.org/licenses/>.
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 15 *
17 * Author: Lucy Liu <lucy.liu@intel.com> 16 * Author: Lucy Liu <lucy.liu@intel.com>
18 */ 17 */
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h
index 20b5ab06032d..197886cd7bdd 100644
--- a/include/net/dn_dev.h
+++ b/include/net/dn_dev.h
@@ -9,7 +9,7 @@ struct dn_ifaddr {
9 struct dn_dev *ifa_dev; 9 struct dn_dev *ifa_dev;
10 __le16 ifa_local; 10 __le16 ifa_local;
11 __le16 ifa_address; 11 __le16 ifa_address;
12 __u8 ifa_flags; 12 __u32 ifa_flags;
13 __u8 ifa_scope; 13 __u8 ifa_scope;
14 char ifa_label[IFNAMSIZ]; 14 char ifa_label[IFNAMSIZ];
15 struct rcu_head rcu; 15 struct rcu_head rcu;
diff --git a/include/net/dst.h b/include/net/dst.h
index 44995c13e941..77eb53fabfb0 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -322,12 +322,11 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
322 skb->dev = dev; 322 skb->dev = dev;
323 323
324 /* 324 /*
325 * Clear rxhash so that we can recalulate the hash for the 325 * Clear hash so that we can recalulate the hash for the
326 * encapsulated packet, unless we have already determine the hash 326 * encapsulated packet, unless we have already determine the hash
327 * over the L4 4-tuple. 327 * over the L4 4-tuple.
328 */ 328 */
329 if (!skb->l4_rxhash) 329 skb_clear_hash_if_not_l4(skb);
330 skb->rxhash = 0;
331 skb_set_queue_mapping(skb, 0); 330 skb_set_queue_mapping(skb, 0);
332 skb_scrub_packet(skb, !net_eq(net, dev_net(dev))); 331 skb_scrub_packet(skb, !net_eq(net, dev_net(dev)));
333} 332}
diff --git a/include/net/flow.h b/include/net/flow.h
index 65ce471d2ab5..d23e7fa2042e 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -20,8 +20,7 @@ struct flowi_common {
20 __u8 flowic_proto; 20 __u8 flowic_proto;
21 __u8 flowic_flags; 21 __u8 flowic_flags;
22#define FLOWI_FLAG_ANYSRC 0x01 22#define FLOWI_FLAG_ANYSRC 0x01
23#define FLOWI_FLAG_CAN_SLEEP 0x02 23#define FLOWI_FLAG_KNOWN_NH 0x02
24#define FLOWI_FLAG_KNOWN_NH 0x04
25 __u32 flowic_secid; 24 __u32 flowic_secid;
26}; 25};
27 26
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 1b177ed803b7..93695f0e22a5 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -73,6 +73,7 @@ struct genl_family {
73 * @attrs: netlink attributes 73 * @attrs: netlink attributes
74 * @_net: network namespace 74 * @_net: network namespace
75 * @user_ptr: user pointers 75 * @user_ptr: user pointers
76 * @dst_sk: destination socket
76 */ 77 */
77struct genl_info { 78struct genl_info {
78 u32 snd_seq; 79 u32 snd_seq;
@@ -85,6 +86,7 @@ struct genl_info {
85 struct net * _net; 86 struct net * _net;
86#endif 87#endif
87 void * user_ptr[2]; 88 void * user_ptr[2];
89 struct sock * dst_sk;
88}; 90};
89 91
90static inline struct net *genl_info_net(struct genl_info *info) 92static inline struct net *genl_info_net(struct genl_info *info)
@@ -177,6 +179,8 @@ void genl_notify(struct genl_family *family,
177 struct sk_buff *skb, struct net *net, u32 portid, 179 struct sk_buff *skb, struct net *net, u32 portid,
178 u32 group, struct nlmsghdr *nlh, gfp_t flags); 180 u32 group, struct nlmsghdr *nlh, gfp_t flags);
179 181
182struct sk_buff *genlmsg_new_unicast(size_t payload, struct genl_info *info,
183 gfp_t flags);
180void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq, 184void *genlmsg_put(struct sk_buff *skb, u32 portid, u32 seq,
181 struct genl_family *family, int flags, u8 cmd); 185 struct genl_family *family, int flags, u8 cmd);
182 186
diff --git a/include/net/gre.h b/include/net/gre.h
index dcd9ae3270d3..70046a0b0b89 100644
--- a/include/net/gre.h
+++ b/include/net/gre.h
@@ -33,9 +33,6 @@ struct gre_cisco_protocol {
33int gre_cisco_register(struct gre_cisco_protocol *proto); 33int gre_cisco_register(struct gre_cisco_protocol *proto);
34int gre_cisco_unregister(struct gre_cisco_protocol *proto); 34int gre_cisco_unregister(struct gre_cisco_protocol *proto);
35 35
36int gre_offload_init(void);
37void gre_offload_exit(void);
38
39void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi, 36void gre_build_header(struct sk_buff *skb, const struct tnl_ptk_info *tpi,
40 int hdr_len); 37 int hdr_len);
41 38
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 65bb13035598..9650a3ffd2d2 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -50,8 +50,8 @@ struct inet6_ifaddr {
50 50
51 int state; 51 int state;
52 52
53 __u32 flags;
53 __u8 dad_probes; 54 __u8 dad_probes;
54 __u8 flags;
55 55
56 __u16 scope; 56 __u16 scope;
57 57
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 71c6e264e5b5..61474ea02152 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -133,9 +133,9 @@ struct inet_timewait_sock {
133 /* And these are ours. */ 133 /* And these are ours. */
134 unsigned int tw_ipv6only : 1, 134 unsigned int tw_ipv6only : 1,
135 tw_transparent : 1, 135 tw_transparent : 1,
136 tw_pad : 6, /* 6 bits hole */ 136 tw_flowlabel : 20,
137 tw_tos : 8, 137 tw_pad : 2, /* 2 bits hole */
138 tw_pad2 : 16; /* 16 bits hole */ 138 tw_tos : 8;
139 kmemcheck_bitfield_end(flags); 139 kmemcheck_bitfield_end(flags);
140 u32 tw_ttd; 140 u32 tw_ttd;
141 struct inet_bind_bucket *tw_tb; 141 struct inet_bind_bucket *tw_tb;
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index f4e127af4e17..6efe73c79c52 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -163,7 +163,6 @@ void inet_putpeer(struct inet_peer *p);
163bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout); 163bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout);
164 164
165void inetpeer_invalidate_tree(struct inet_peer_base *); 165void inetpeer_invalidate_tree(struct inet_peer_base *);
166void inetpeer_invalidate_family(int family);
167 166
168/* 167/*
169 * temporary check to make sure we dont access rid, ip_id_count, tcp_ts, 168 * temporary check to make sure we dont access rid, ip_id_count, tcp_ts,
diff --git a/include/net/ip.h b/include/net/ip.h
index 5a25f36fe3a7..23be0fd37937 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -63,6 +63,7 @@ struct ipcm_cookie {
63}; 63};
64 64
65#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) 65#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb))
66#define PKTINFO_SKB_CB(skb) ((struct in_pktinfo *)((skb)->cb))
66 67
67struct ip_ra_chain { 68struct ip_ra_chain {
68 struct ip_ra_chain __rcu *next; 69 struct ip_ra_chain __rcu *next;
@@ -90,7 +91,7 @@ struct packet_type;
90struct rtable; 91struct rtable;
91struct sockaddr; 92struct sockaddr;
92 93
93int igmp_mc_proc_init(void); 94int igmp_mc_init(void);
94 95
95/* 96/*
96 * Functions provided by ip.c 97 * Functions provided by ip.c
@@ -177,12 +178,6 @@ void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
177 __be32 saddr, const struct ip_reply_arg *arg, 178 __be32 saddr, const struct ip_reply_arg *arg,
178 unsigned int len); 179 unsigned int len);
179 180
180struct ipv4_config {
181 int log_martians;
182 int no_pmtu_disc;
183};
184
185extern struct ipv4_config ipv4_config;
186#define IP_INC_STATS(net, field) SNMP_INC_STATS64((net)->mib.ip_statistics, field) 181#define IP_INC_STATS(net, field) SNMP_INC_STATS64((net)->mib.ip_statistics, field)
187#define IP_INC_STATS_BH(net, field) SNMP_INC_STATS64_BH((net)->mib.ip_statistics, field) 182#define IP_INC_STATS_BH(net, field) SNMP_INC_STATS64_BH((net)->mib.ip_statistics, field)
188#define IP_ADD_STATS(net, field, val) SNMP_ADD_STATS64((net)->mib.ip_statistics, field, val) 183#define IP_ADD_STATS(net, field, val) SNMP_ADD_STATS64((net)->mib.ip_statistics, field, val)
@@ -269,6 +264,39 @@ int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
269 !(dst_metric_locked(dst, RTAX_MTU))); 264 !(dst_metric_locked(dst, RTAX_MTU)));
270} 265}
271 266
267static inline bool ip_sk_accept_pmtu(const struct sock *sk)
268{
269 return inet_sk(sk)->pmtudisc != IP_PMTUDISC_INTERFACE;
270}
271
272static inline bool ip_sk_use_pmtu(const struct sock *sk)
273{
274 return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE;
275}
276
277static inline unsigned int ip_dst_mtu_maybe_forward(const struct dst_entry *dst,
278 bool forwarding)
279{
280 struct net *net = dev_net(dst->dev);
281
282 if (net->ipv4.sysctl_ip_fwd_use_pmtu ||
283 dst_metric_locked(dst, RTAX_MTU) ||
284 !forwarding)
285 return dst_mtu(dst);
286
287 return min(dst->dev->mtu, IP_MAX_MTU);
288}
289
290static inline unsigned int ip_skb_dst_mtu(const struct sk_buff *skb)
291{
292 if (!skb->sk || ip_sk_use_pmtu(skb->sk)) {
293 bool forwarding = IPCB(skb)->flags & IPSKB_FORWARDED;
294 return ip_dst_mtu_maybe_forward(skb_dst(skb), forwarding);
295 } else {
296 return min(skb_dst(skb)->dev->mtu, IP_MAX_MTU);
297 }
298}
299
272void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); 300void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more);
273 301
274static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk) 302static inline void ip_select_ident(struct sk_buff *skb, struct dst_entry *dst, struct sock *sk)
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 2182525e4d74..aca0c2709fd6 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -282,7 +282,7 @@ struct fib6_node *fib6_locate(struct fib6_node *root,
282 const struct in6_addr *saddr, int src_len); 282 const struct in6_addr *saddr, int src_len);
283 283
284void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg), 284void fib6_clean_all(struct net *net, int (*func)(struct rt6_info *, void *arg),
285 int prune, void *arg); 285 void *arg);
286 286
287int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info); 287int fib6_add(struct fib6_node *root, struct rt6_info *rt, struct nl_info *info);
288 288
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 733747ce163c..017badb1aec7 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -51,26 +51,6 @@ static inline unsigned int rt6_flags2srcprefs(int flags)
51 return (flags >> 3) & 7; 51 return (flags >> 3) & 7;
52} 52}
53 53
54void rt6_bind_peer(struct rt6_info *rt, int create);
55
56static inline struct inet_peer *__rt6_get_peer(struct rt6_info *rt, int create)
57{
58 if (rt6_has_peer(rt))
59 return rt6_peer_ptr(rt);
60
61 rt6_bind_peer(rt, create);
62 return (rt6_has_peer(rt) ? rt6_peer_ptr(rt) : NULL);
63}
64
65static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt)
66{
67 return __rt6_get_peer(rt, 0);
68}
69
70static inline struct inet_peer *rt6_get_peer_create(struct rt6_info *rt)
71{
72 return __rt6_get_peer(rt, 1);
73}
74 54
75void ip6_route_input(struct sk_buff *skb); 55void ip6_route_input(struct sk_buff *skb);
76 56
@@ -172,16 +152,28 @@ static inline bool ipv6_unicast_destination(const struct sk_buff *skb)
172 return rt->rt6i_flags & RTF_LOCAL; 152 return rt->rt6i_flags & RTF_LOCAL;
173} 153}
174 154
155static inline bool ipv6_anycast_destination(const struct sk_buff *skb)
156{
157 struct rt6_info *rt = (struct rt6_info *) skb_dst(skb);
158
159 return rt->rt6i_flags & RTF_ANYCAST;
160}
161
175int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *)); 162int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
176 163
177static inline int ip6_skb_dst_mtu(struct sk_buff *skb) 164static inline int ip6_skb_dst_mtu(struct sk_buff *skb)
178{ 165{
179 struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL; 166 struct ipv6_pinfo *np = skb->sk ? inet6_sk(skb->sk) : NULL;
180 167
181 return (np && np->pmtudisc == IPV6_PMTUDISC_PROBE) ? 168 return (np && np->pmtudisc >= IPV6_PMTUDISC_PROBE) ?
182 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); 169 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb));
183} 170}
184 171
172static inline bool ip6_sk_accept_pmtu(const struct sock *sk)
173{
174 return inet6_sk(sk)->pmtudisc != IPV6_PMTUDISC_INTERFACE;
175}
176
185static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt) 177static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt)
186{ 178{
187 return &rt->rt6i_gateway; 179 return &rt->rt6i_gateway;
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 6d1549c4893c..a5593dab6af7 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -79,7 +79,7 @@ static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
79 err = ip6_local_out(skb); 79 err = ip6_local_out(skb);
80 80
81 if (net_xmit_eval(err) == 0) { 81 if (net_xmit_eval(err) == 0) {
82 struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats); 82 struct pcpu_sw_netstats *tstats = this_cpu_ptr(dev->tstats);
83 u64_stats_update_begin(&tstats->syncp); 83 u64_stats_update_begin(&tstats->syncp);
84 tstats->tx_bytes += pkt_len; 84 tstats->tx_bytes += pkt_len;
85 tstats->tx_packets++; 85 tstats->tx_packets++;
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index 732f8c6ae975..48ed75c21260 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -38,6 +38,10 @@ struct ip_tunnel_prl_entry {
38 struct rcu_head rcu_head; 38 struct rcu_head rcu_head;
39}; 39};
40 40
41struct ip_tunnel_dst {
42 struct dst_entry __rcu *dst;
43};
44
41struct ip_tunnel { 45struct ip_tunnel {
42 struct ip_tunnel __rcu *next; 46 struct ip_tunnel __rcu *next;
43 struct hlist_node hash_node; 47 struct hlist_node hash_node;
@@ -54,6 +58,8 @@ struct ip_tunnel {
54 int hlen; /* Precalculated header length */ 58 int hlen; /* Precalculated header length */
55 int mlink; 59 int mlink;
56 60
61 struct ip_tunnel_dst __percpu *dst_cache;
62
57 struct ip_tunnel_parm parms; 63 struct ip_tunnel_parm parms;
58 64
59 /* for SIT */ 65 /* for SIT */
@@ -155,10 +161,10 @@ struct sk_buff *iptunnel_handle_offloads(struct sk_buff *skb, bool gre_csum,
155 161
156static inline void iptunnel_xmit_stats(int err, 162static inline void iptunnel_xmit_stats(int err,
157 struct net_device_stats *err_stats, 163 struct net_device_stats *err_stats,
158 struct pcpu_tstats __percpu *stats) 164 struct pcpu_sw_netstats __percpu *stats)
159{ 165{
160 if (err > 0) { 166 if (err > 0) {
161 struct pcpu_tstats *tstats = this_cpu_ptr(stats); 167 struct pcpu_sw_netstats *tstats = this_cpu_ptr(stats);
162 168
163 u64_stats_update_begin(&tstats->syncp); 169 u64_stats_update_begin(&tstats->syncp);
164 tstats->tx_bytes += err; 170 tstats->tx_bytes += err;
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 488316e339a1..4f541f11ce63 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -238,6 +238,8 @@ struct ip6_flowlabel {
238 238
239#define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) 239#define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF)
240#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) 240#define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF)
241#define IPV6_TCLASS_MASK (IPV6_FLOWINFO_MASK & ~IPV6_FLOWLABEL_MASK)
242#define IPV6_TCLASS_SHIFT 20
241 243
242struct ipv6_fl_socklist { 244struct ipv6_fl_socklist {
243 struct ipv6_fl_socklist __rcu *next; 245 struct ipv6_fl_socklist __rcu *next;
@@ -251,7 +253,8 @@ struct ipv6_txoptions *fl6_merge_options(struct ipv6_txoptions *opt_space,
251 struct ipv6_txoptions *fopt); 253 struct ipv6_txoptions *fopt);
252void fl6_free_socklist(struct sock *sk); 254void fl6_free_socklist(struct sock *sk);
253int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen); 255int ipv6_flowlabel_opt(struct sock *sk, char __user *optval, int optlen);
254int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq); 256int ipv6_flowlabel_opt_get(struct sock *sk, struct in6_flowlabel_req *freq,
257 int flags);
255int ip6_flowlabel_init(void); 258int ip6_flowlabel_init(void);
256void ip6_flowlabel_cleanup(void); 259void ip6_flowlabel_cleanup(void);
257 260
@@ -266,9 +269,6 @@ void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info);
266int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6, 269int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
267 struct icmp6hdr *thdr, int len); 270 struct icmp6hdr *thdr, int len);
268 271
269struct dst_entry *icmpv6_route_lookup(struct net *net, struct sk_buff *skb,
270 struct sock *sk, struct flowi6 *fl6);
271
272int ip6_ra_control(struct sock *sk, int sel); 272int ip6_ra_control(struct sock *sk, int sel);
273 273
274int ipv6_parse_hopopts(struct sk_buff *skb); 274int ipv6_parse_hopopts(struct sk_buff *skb);
@@ -678,6 +678,15 @@ static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr)
678 return *(__be32 *)hdr & IPV6_FLOWINFO_MASK; 678 return *(__be32 *)hdr & IPV6_FLOWINFO_MASK;
679} 679}
680 680
681static inline __be32 ip6_flowlabel(const struct ipv6hdr *hdr)
682{
683 return *(__be32 *)hdr & IPV6_FLOWLABEL_MASK;
684}
685
686static inline u8 ip6_tclass(__be32 flowinfo)
687{
688 return ntohl(flowinfo & IPV6_TCLASS_MASK) >> IPV6_TCLASS_SHIFT;
689}
681/* 690/*
682 * Prototypes exported by ipv6 691 * Prototypes exported by ipv6
683 */ 692 */
@@ -712,11 +721,9 @@ void ip6_flush_pending_frames(struct sock *sk);
712 721
713int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6); 722int ip6_dst_lookup(struct sock *sk, struct dst_entry **dst, struct flowi6 *fl6);
714struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, 723struct dst_entry *ip6_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
715 const struct in6_addr *final_dst, 724 const struct in6_addr *final_dst);
716 bool can_sleep);
717struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6, 725struct dst_entry *ip6_sk_dst_lookup_flow(struct sock *sk, struct flowi6 *fl6,
718 const struct in6_addr *final_dst, 726 const struct in6_addr *final_dst);
719 bool can_sleep);
720struct dst_entry *ip6_blackhole_route(struct net *net, 727struct dst_entry *ip6_blackhole_route(struct net *net,
721 struct dst_entry *orig_dst); 728 struct dst_entry *orig_dst);
722 729
@@ -776,6 +783,8 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
776 char __user *optval, int __user *optlen); 783 char __user *optval, int __user *optlen);
777 784
778int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len); 785int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len);
786int ip6_datagram_connect_v6_only(struct sock *sk, struct sockaddr *addr,
787 int addr_len);
779 788
780int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, 789int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len,
781 int *addr_len); 790 int *addr_len);
@@ -835,7 +844,6 @@ static inline int snmp6_unregister_dev(struct inet6_dev *idev) { return 0; }
835 844
836#ifdef CONFIG_SYSCTL 845#ifdef CONFIG_SYSCTL
837extern struct ctl_table ipv6_route_table_template[]; 846extern struct ctl_table ipv6_route_table_template[];
838extern struct ctl_table ipv6_icmp_table_template[];
839 847
840struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); 848struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
841struct ctl_table *ipv6_route_sysctl_init(struct net *net); 849struct ctl_table *ipv6_route_sysctl_init(struct net *net);
diff --git a/include/net/irda/discovery.h b/include/net/irda/discovery.h
index 0ce93398720d..63ae32530567 100644
--- a/include/net/irda/discovery.h
+++ b/include/net/irda/discovery.h
@@ -23,9 +23,7 @@
23 * GNU General Public License for more details. 23 * GNU General Public License for more details.
24 * 24 *
25 * You should have received a copy of the GNU General Public License 25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software 26 * along with this program; if not, see <http://www.gnu.org/licenses/>.
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
28 * MA 02111-1307 USA
29 * 27 *
30 ********************************************************************/ 28 ********************************************************************/
31 29
diff --git a/include/net/irda/ircomm_core.h b/include/net/irda/ircomm_core.h
index 69b610acd2df..2a580ce9edad 100644
--- a/include/net/irda/ircomm_core.h
+++ b/include/net/irda/ircomm_core.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_event.h b/include/net/irda/ircomm_event.h
index bc0c6f31f1c6..5bbc32998d57 100644
--- a/include/net/irda/ircomm_event.h
+++ b/include/net/irda/ircomm_event.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_lmp.h b/include/net/irda/ircomm_lmp.h
index ae02106be590..5042a5021a04 100644
--- a/include/net/irda/ircomm_lmp.h
+++ b/include/net/irda/ircomm_lmp.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_param.h b/include/net/irda/ircomm_param.h
index e6678800c41f..1f67432321c4 100644
--- a/include/net/irda/ircomm_param.h
+++ b/include/net/irda/ircomm_param.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_ttp.h b/include/net/irda/ircomm_ttp.h
index 403081ed725c..c5627288bca3 100644
--- a/include/net/irda/ircomm_ttp.h
+++ b/include/net/irda/ircomm_ttp.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_tty.h b/include/net/irda/ircomm_tty.h
index 0224402260a7..8d4f588974bc 100644
--- a/include/net/irda/ircomm_tty.h
+++ b/include/net/irda/ircomm_tty.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/ircomm_tty_attach.h b/include/net/irda/ircomm_tty_attach.h
index 0a63bbb972d7..20dcbdf258cf 100644
--- a/include/net/irda/ircomm_tty_attach.h
+++ b/include/net/irda/ircomm_tty_attach.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index 11417475a6c3..664bf8178412 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -24,9 +24,7 @@
24 * GNU General Public License for more details. 24 * GNU General Public License for more details.
25 * 25 *
26 * You should have received a copy of the GNU General Public License 26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software 27 * along with this program; if not, see <http://www.gnu.org/licenses/>.
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 * 28 *
31 ********************************************************************/ 29 ********************************************************************/
32 30
diff --git a/include/net/irda/irlap_event.h b/include/net/irda/irlap_event.h
index f9d88da97af2..e4325fee1267 100644
--- a/include/net/irda/irlap_event.h
+++ b/include/net/irda/irlap_event.h
@@ -25,9 +25,7 @@
25 * GNU General Public License for more details. 25 * GNU General Public License for more details.
26 * 26 *
27 * You should have received a copy of the GNU General Public License 27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software 28 * along with this program; if not, see <http://www.gnu.org/licenses/>.
29 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
30 * MA 02111-1307 USA
31 * 29 *
32 ********************************************************************/ 30 ********************************************************************/
33 31
diff --git a/include/net/irda/irlap_frame.h b/include/net/irda/irlap_frame.h
index 57173ae398ae..cbc12a926e5f 100644
--- a/include/net/irda/irlap_frame.h
+++ b/include/net/irda/irlap_frame.h
@@ -24,9 +24,7 @@
24 * GNU General Public License for more details. 24 * GNU General Public License for more details.
25 * 25 *
26 * You should have received a copy of the GNU General Public License 26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software 27 * along with this program; if not, see <http://www.gnu.org/licenses/>.
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
29 * MA 02111-1307 USA
30 * 28 *
31 ********************************************************************/ 29 ********************************************************************/
32 30
diff --git a/include/net/irda/parameters.h b/include/net/irda/parameters.h
index c0d938847bd3..42713c931d1f 100644
--- a/include/net/irda/parameters.h
+++ b/include/net/irda/parameters.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 * Michel Dänzer <daenzer@debian.org>, 10/2001 27 * Michel Dänzer <daenzer@debian.org>, 10/2001
30 * - simplify irda_pv_t to avoid endianness issues 28 * - simplify irda_pv_t to avoid endianness issues
diff --git a/include/net/irda/qos.h b/include/net/irda/qos.h
index cc577dc0a0ef..05a5a249956f 100644
--- a/include/net/irda/qos.h
+++ b/include/net/irda/qos.h
@@ -22,9 +22,7 @@
22 * GNU General Public License for more details. 22 * GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
27 * MA 02111-1307 USA
28 * 26 *
29 ********************************************************************/ 27 ********************************************************************/
30 28
diff --git a/include/net/llc.h b/include/net/llc.h
index 68490cbc8a65..e8e61d4fb458 100644
--- a/include/net/llc.h
+++ b/include/net/llc.h
@@ -93,7 +93,6 @@ struct hlist_nulls_head *llc_sk_laddr_hash(struct llc_sap *sap,
93#define LLC_DEST_CONN 2 /* Type 2 goes here */ 93#define LLC_DEST_CONN 2 /* Type 2 goes here */
94 94
95extern struct list_head llc_sap_list; 95extern struct list_head llc_sap_list;
96extern spinlock_t llc_sap_list_lock;
97 96
98int llc_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, 97int llc_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
99 struct net_device *orig_dev); 98 struct net_device *orig_dev);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7ceed99a05bc..f4ab2fb4d50c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -154,12 +154,14 @@ struct ieee80211_low_level_stats {
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, 155 * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel,
156 * this is used only with channel switching with CSA 156 * this is used only with channel switching with CSA
157 * @IEEE80211_CHANCTX_CHANGE_MIN_WIDTH: The min required channel width changed
157 */ 158 */
158enum ieee80211_chanctx_change { 159enum ieee80211_chanctx_change {
159 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), 160 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
160 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), 161 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
161 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), 162 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2),
162 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3), 163 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3),
164 IEEE80211_CHANCTX_CHANGE_MIN_WIDTH = BIT(4),
163}; 165};
164 166
165/** 167/**
@@ -169,6 +171,7 @@ enum ieee80211_chanctx_change {
169 * that contains it is visible in mac80211 only. 171 * that contains it is visible in mac80211 only.
170 * 172 *
171 * @def: the channel definition 173 * @def: the channel definition
174 * @min_def: the minimum channel definition currently required.
172 * @rx_chains_static: The number of RX chains that must always be 175 * @rx_chains_static: The number of RX chains that must always be
173 * active on the channel to receive MIMO transmissions 176 * active on the channel to receive MIMO transmissions
174 * @rx_chains_dynamic: The number of RX chains that must be enabled 177 * @rx_chains_dynamic: The number of RX chains that must be enabled
@@ -180,6 +183,7 @@ enum ieee80211_chanctx_change {
180 */ 183 */
181struct ieee80211_chanctx_conf { 184struct ieee80211_chanctx_conf {
182 struct cfg80211_chan_def def; 185 struct cfg80211_chan_def def;
186 struct cfg80211_chan_def min_def;
183 187
184 u8 rx_chains_static, rx_chains_dynamic; 188 u8 rx_chains_static, rx_chains_dynamic;
185 189
@@ -1159,6 +1163,19 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
1159} 1163}
1160 1164
1161/** 1165/**
1166 * wdev_to_ieee80211_vif - return a vif struct from a wdev
1167 * @wdev: the wdev to get the vif for
1168 *
1169 * This can be used by mac80211 drivers with direct cfg80211 APIs
1170 * (like the vendor commands) that get a wdev.
1171 *
1172 * Note that this function may return %NULL if the given wdev isn't
1173 * associated with a vif that the driver knows about (e.g. monitor
1174 * or AP_VLAN interfaces.)
1175 */
1176struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev);
1177
1178/**
1162 * enum ieee80211_key_flags - key flags 1179 * enum ieee80211_key_flags - key flags
1163 * 1180 *
1164 * These flags are used for communication about keys between the driver 1181 * These flags are used for communication about keys between the driver
@@ -1229,6 +1246,36 @@ struct ieee80211_key_conf {
1229}; 1246};
1230 1247
1231/** 1248/**
1249 * struct ieee80211_cipher_scheme - cipher scheme
1250 *
1251 * This structure contains a cipher scheme information defining
1252 * the secure packet crypto handling.
1253 *
1254 * @cipher: a cipher suite selector
1255 * @iftype: a cipher iftype bit mask indicating an allowed cipher usage
1256 * @hdr_len: a length of a security header used the cipher
1257 * @pn_len: a length of a packet number in the security header
1258 * @pn_off: an offset of pn from the beginning of the security header
1259 * @key_idx_off: an offset of key index byte in the security header
1260 * @key_idx_mask: a bit mask of key_idx bits
1261 * @key_idx_shift: a bit shift needed to get key_idx
1262 * key_idx value calculation:
1263 * (sec_header_base[key_idx_off] & key_idx_mask) >> key_idx_shift
1264 * @mic_len: a mic length in bytes
1265 */
1266struct ieee80211_cipher_scheme {
1267 u32 cipher;
1268 u16 iftype;
1269 u8 hdr_len;
1270 u8 pn_len;
1271 u8 pn_off;
1272 u8 key_idx_off;
1273 u8 key_idx_mask;
1274 u8 key_idx_shift;
1275 u8 mic_len;
1276};
1277
1278/**
1232 * enum set_key_cmd - key command 1279 * enum set_key_cmd - key command
1233 * 1280 *
1234 * Used with the set_key() callback in &struct ieee80211_ops, this 1281 * Used with the set_key() callback in &struct ieee80211_ops, this
@@ -1566,7 +1613,8 @@ enum ieee80211_hw_flags {
1566 * @extra_tx_headroom: headroom to reserve in each transmit skb 1613 * @extra_tx_headroom: headroom to reserve in each transmit skb
1567 * for use by the driver (e.g. for transmit headers.) 1614 * for use by the driver (e.g. for transmit headers.)
1568 * 1615 *
1569 * @channel_change_time: time (in microseconds) it takes to change channels. 1616 * @extra_beacon_tailroom: tailroom to reserve in each beacon tx skb.
1617 * Can be used by drivers to add extra IEs.
1570 * 1618 *
1571 * @max_signal: Maximum value for signal (rssi) in RX information, used 1619 * @max_signal: Maximum value for signal (rssi) in RX information, used
1572 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB 1620 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB
@@ -1636,6 +1684,10 @@ enum ieee80211_hw_flags {
1636 * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may 1684 * @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may
1637 * deliver to a WMM STA during any Service Period triggered by the WMM STA. 1685 * deliver to a WMM STA during any Service Period triggered by the WMM STA.
1638 * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values. 1686 * Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values.
1687 *
1688 * @n_cipher_schemes: a size of an array of cipher schemes definitions.
1689 * @cipher_schemes: a pointer to an array of cipher scheme definitions
1690 * supported by HW.
1639 */ 1691 */
1640struct ieee80211_hw { 1692struct ieee80211_hw {
1641 struct ieee80211_conf conf; 1693 struct ieee80211_conf conf;
@@ -1644,7 +1696,7 @@ struct ieee80211_hw {
1644 void *priv; 1696 void *priv;
1645 u32 flags; 1697 u32 flags;
1646 unsigned int extra_tx_headroom; 1698 unsigned int extra_tx_headroom;
1647 int channel_change_time; 1699 unsigned int extra_beacon_tailroom;
1648 int vif_data_size; 1700 int vif_data_size;
1649 int sta_data_size; 1701 int sta_data_size;
1650 int chanctx_data_size; 1702 int chanctx_data_size;
@@ -1663,6 +1715,8 @@ struct ieee80211_hw {
1663 netdev_features_t netdev_features; 1715 netdev_features_t netdev_features;
1664 u8 uapsd_queues; 1716 u8 uapsd_queues;
1665 u8 uapsd_max_sp_len; 1717 u8 uapsd_max_sp_len;
1718 u8 n_cipher_schemes;
1719 const struct ieee80211_cipher_scheme *cipher_schemes;
1666}; 1720};
1667 1721
1668/** 1722/**
@@ -2065,6 +2119,11 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
2065 * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP) 2119 * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP)
2066 * and also take care of the EOSP and MORE_DATA bits in the frame. 2120 * and also take care of the EOSP and MORE_DATA bits in the frame.
2067 * The driver may also use ieee80211_sta_eosp() in this case. 2121 * The driver may also use ieee80211_sta_eosp() in this case.
2122 *
2123 * Note that if the driver ever buffers frames other than QoS-data
2124 * frames, it must take care to never send a non-QoS-data frame as
2125 * the last frame in a service period, adding a QoS-nulldata frame
2126 * after a non-QoS-data frame if needed.
2068 */ 2127 */
2069 2128
2070/** 2129/**
@@ -2358,9 +2417,6 @@ enum ieee80211_roc_type {
2358 * See the section "Frame filtering" for more information. 2417 * See the section "Frame filtering" for more information.
2359 * This callback must be implemented and can sleep. 2418 * This callback must be implemented and can sleep.
2360 * 2419 *
2361 * @set_multicast_list: Configure the device's interface specific RX multicast
2362 * filter. This callback is optional. This callback must be atomic.
2363 *
2364 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit 2420 * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit
2365 * must be set or cleared for a given STA. Must be atomic. 2421 * must be set or cleared for a given STA. Must be atomic.
2366 * 2422 *
@@ -2445,7 +2501,11 @@ enum ieee80211_roc_type {
2445 * AP, IBSS/WDS/mesh peer etc. This callback can sleep. 2501 * AP, IBSS/WDS/mesh peer etc. This callback can sleep.
2446 * 2502 *
2447 * @sta_remove: Notifies low level driver about removal of an associated 2503 * @sta_remove: Notifies low level driver about removal of an associated
2448 * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. 2504 * station, AP, IBSS/WDS/mesh peer etc. Note that after the callback
2505 * returns it isn't safe to use the pointer, not even RCU protected;
2506 * no RCU grace period is guaranteed between returning here and freeing
2507 * the station. See @sta_pre_rcu_remove if needed.
2508 * This callback can sleep.
2449 * 2509 *
2450 * @sta_add_debugfs: Drivers can use this callback to add debugfs files 2510 * @sta_add_debugfs: Drivers can use this callback to add debugfs files
2451 * when a station is added to mac80211's station list. This callback 2511 * when a station is added to mac80211's station list. This callback
@@ -2464,7 +2524,17 @@ enum ieee80211_roc_type {
2464 * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.) 2524 * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.)
2465 * This callback is mutually exclusive with @sta_add/@sta_remove. 2525 * This callback is mutually exclusive with @sta_add/@sta_remove.
2466 * It must not fail for down transitions but may fail for transitions 2526 * It must not fail for down transitions but may fail for transitions
2467 * up the list of states. 2527 * up the list of states. Also note that after the callback returns it
2528 * isn't safe to use the pointer, not even RCU protected - no RCU grace
2529 * period is guaranteed between returning here and freeing the station.
2530 * See @sta_pre_rcu_remove if needed.
2531 * The callback can sleep.
2532 *
2533 * @sta_pre_rcu_remove: Notify driver about station removal before RCU
2534 * synchronisation. This is useful if a driver needs to have station
2535 * pointers protected using RCU, it can then use this call to clear
2536 * the pointers instead of waiting for an RCU grace period to elapse
2537 * in @sta_state.
2468 * The callback can sleep. 2538 * The callback can sleep.
2469 * 2539 *
2470 * @sta_rc_update: Notifies the driver of changes to the bitrates that can be 2540 * @sta_rc_update: Notifies the driver of changes to the bitrates that can be
@@ -2724,10 +2794,6 @@ struct ieee80211_ops {
2724 unsigned int changed_flags, 2794 unsigned int changed_flags,
2725 unsigned int *total_flags, 2795 unsigned int *total_flags,
2726 u64 multicast); 2796 u64 multicast);
2727 void (*set_multicast_list)(struct ieee80211_hw *hw,
2728 struct ieee80211_vif *vif, bool allmulti,
2729 struct netdev_hw_addr_list *mc_list);
2730
2731 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, 2797 int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
2732 bool set); 2798 bool set);
2733 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, 2799 int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd,
@@ -2781,6 +2847,9 @@ struct ieee80211_ops {
2781 struct ieee80211_sta *sta, 2847 struct ieee80211_sta *sta,
2782 enum ieee80211_sta_state old_state, 2848 enum ieee80211_sta_state old_state,
2783 enum ieee80211_sta_state new_state); 2849 enum ieee80211_sta_state new_state);
2850 void (*sta_pre_rcu_remove)(struct ieee80211_hw *hw,
2851 struct ieee80211_vif *vif,
2852 struct ieee80211_sta *sta);
2784 void (*sta_rc_update)(struct ieee80211_hw *hw, 2853 void (*sta_rc_update)(struct ieee80211_hw *hw,
2785 struct ieee80211_vif *vif, 2854 struct ieee80211_vif *vif,
2786 struct ieee80211_sta *sta, 2855 struct ieee80211_sta *sta,
@@ -4585,4 +4654,51 @@ bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw,
4585 struct ieee80211_vif *vif, struct sk_buff *skb, 4654 struct ieee80211_vif *vif, struct sk_buff *skb,
4586 int band, struct ieee80211_sta **sta); 4655 int band, struct ieee80211_sta **sta);
4587 4656
4657/**
4658 * struct ieee80211_noa_data - holds temporary data for tracking P2P NoA state
4659 *
4660 * @next_tsf: TSF timestamp of the next absent state change
4661 * @has_next_tsf: next absent state change event pending
4662 *
4663 * @absent: descriptor bitmask, set if GO is currently absent
4664 *
4665 * private:
4666 *
4667 * @count: count fields from the NoA descriptors
4668 * @desc: adjusted data from the NoA
4669 */
4670struct ieee80211_noa_data {
4671 u32 next_tsf;
4672 bool has_next_tsf;
4673
4674 u8 absent;
4675
4676 u8 count[IEEE80211_P2P_NOA_DESC_MAX];
4677 struct {
4678 u32 start;
4679 u32 duration;
4680 u32 interval;
4681 } desc[IEEE80211_P2P_NOA_DESC_MAX];
4682};
4683
4684/**
4685 * ieee80211_parse_p2p_noa - initialize NoA tracking data from P2P IE
4686 *
4687 * @attr: P2P NoA IE
4688 * @data: NoA tracking data
4689 * @tsf: current TSF timestamp
4690 *
4691 * Return: number of successfully parsed descriptors
4692 */
4693int ieee80211_parse_p2p_noa(const struct ieee80211_p2p_noa_attr *attr,
4694 struct ieee80211_noa_data *data, u32 tsf);
4695
4696/**
4697 * ieee80211_update_p2p_noa - get next pending P2P GO absent state change
4698 *
4699 * @data: NoA tracking data
4700 * @tsf: current TSF timestamp
4701 */
4702void ieee80211_update_p2p_noa(struct ieee80211_noa_data *data, u32 tsf);
4703
4588#endif /* MAC80211_H */ 4704#endif /* MAC80211_H */
diff --git a/include/net/mip6.h b/include/net/mip6.h
index 26ba99b5a4b1..0386b618908c 100644
--- a/include/net/mip6.h
+++ b/include/net/mip6.h
@@ -13,8 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 17 */
19/* 18/*
20 * Authors: 19 * Authors:
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 536501a3e58d..7277caf3743d 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -21,6 +21,7 @@
21#include <linux/skbuff.h> 21#include <linux/skbuff.h>
22#include <linux/rcupdate.h> 22#include <linux/rcupdate.h>
23#include <linux/seq_file.h> 23#include <linux/seq_file.h>
24#include <linux/bitmap.h>
24 25
25#include <linux/err.h> 26#include <linux/err.h>
26#include <linux/sysctl.h> 27#include <linux/sysctl.h>
@@ -37,6 +38,32 @@
37 38
38struct neighbour; 39struct neighbour;
39 40
41enum {
42 NEIGH_VAR_MCAST_PROBES,
43 NEIGH_VAR_UCAST_PROBES,
44 NEIGH_VAR_APP_PROBES,
45 NEIGH_VAR_RETRANS_TIME,
46 NEIGH_VAR_BASE_REACHABLE_TIME,
47 NEIGH_VAR_DELAY_PROBE_TIME,
48 NEIGH_VAR_GC_STALETIME,
49 NEIGH_VAR_QUEUE_LEN_BYTES,
50 NEIGH_VAR_PROXY_QLEN,
51 NEIGH_VAR_ANYCAST_DELAY,
52 NEIGH_VAR_PROXY_DELAY,
53 NEIGH_VAR_LOCKTIME,
54#define NEIGH_VAR_DATA_MAX (NEIGH_VAR_LOCKTIME + 1)
55 /* Following are used as a second way to access one of the above */
56 NEIGH_VAR_QUEUE_LEN, /* same data as NEIGH_VAR_QUEUE_LEN_BYTES */
57 NEIGH_VAR_RETRANS_TIME_MS, /* same data as NEIGH_VAR_RETRANS_TIME */
58 NEIGH_VAR_BASE_REACHABLE_TIME_MS, /* same data as NEIGH_VAR_BASE_REACHABLE_TIME */
59 /* Following are used by "default" only */
60 NEIGH_VAR_GC_INTERVAL,
61 NEIGH_VAR_GC_THRESH1,
62 NEIGH_VAR_GC_THRESH2,
63 NEIGH_VAR_GC_THRESH3,
64 NEIGH_VAR_MAX
65};
66
40struct neigh_parms { 67struct neigh_parms {
41#ifdef CONFIG_NET_NS 68#ifdef CONFIG_NET_NS
42 struct net *net; 69 struct net *net;
@@ -53,22 +80,35 @@ struct neigh_parms {
53 atomic_t refcnt; 80 atomic_t refcnt;
54 struct rcu_head rcu_head; 81 struct rcu_head rcu_head;
55 82
56 int base_reachable_time;
57 int retrans_time;
58 int gc_staletime;
59 int reachable_time; 83 int reachable_time;
60 int delay_probe_time; 84 int data[NEIGH_VAR_DATA_MAX];
61 85 DECLARE_BITMAP(data_state, NEIGH_VAR_DATA_MAX);
62 int queue_len_bytes;
63 int ucast_probes;
64 int app_probes;
65 int mcast_probes;
66 int anycast_delay;
67 int proxy_delay;
68 int proxy_qlen;
69 int locktime;
70}; 86};
71 87
88static inline void neigh_var_set(struct neigh_parms *p, int index, int val)
89{
90 set_bit(index, p->data_state);
91 p->data[index] = val;
92}
93
94#define NEIGH_VAR(p, attr) ((p)->data[NEIGH_VAR_ ## attr])
95
96/* In ndo_neigh_setup, NEIGH_VAR_INIT should be used.
97 * In other cases, NEIGH_VAR_SET should be used.
98 */
99#define NEIGH_VAR_INIT(p, attr, val) (NEIGH_VAR(p, attr) = val)
100#define NEIGH_VAR_SET(p, attr, val) neigh_var_set(p, NEIGH_VAR_ ## attr, val)
101
102static inline void neigh_parms_data_state_setall(struct neigh_parms *p)
103{
104 bitmap_fill(p->data_state, NEIGH_VAR_DATA_MAX);
105}
106
107static inline void neigh_parms_data_state_cleanall(struct neigh_parms *p)
108{
109 bitmap_zero(p->data_state, NEIGH_VAR_DATA_MAX);
110}
111
72struct neigh_statistics { 112struct neigh_statistics {
73 unsigned long allocs; /* number of allocated neighs */ 113 unsigned long allocs; /* number of allocated neighs */
74 unsigned long destroys; /* number of destroyed neighs */ 114 unsigned long destroys; /* number of destroyed neighs */
@@ -180,6 +220,11 @@ struct neigh_table {
180 struct pneigh_entry **phash_buckets; 220 struct pneigh_entry **phash_buckets;
181}; 221};
182 222
223static inline int neigh_parms_family(struct neigh_parms *p)
224{
225 return p->tbl->family;
226}
227
183#define NEIGH_PRIV_ALIGN sizeof(long long) 228#define NEIGH_PRIV_ALIGN sizeof(long long)
184#define NEIGH_ENTRY_SIZE(size) ALIGN((size), NEIGH_PRIV_ALIGN) 229#define NEIGH_ENTRY_SIZE(size) ALIGN((size), NEIGH_PRIV_ALIGN)
185 230
@@ -212,6 +257,7 @@ static inline struct neighbour *neigh_create(struct neigh_table *tbl,
212void neigh_destroy(struct neighbour *neigh); 257void neigh_destroy(struct neighbour *neigh);
213int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb); 258int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb);
214int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags); 259int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags);
260void __neigh_set_probe_once(struct neighbour *neigh);
215void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); 261void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
216int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); 262int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
217int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb); 263int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb);
@@ -274,8 +320,17 @@ void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *,
274void *neigh_seq_next(struct seq_file *, void *, loff_t *); 320void *neigh_seq_next(struct seq_file *, void *, loff_t *);
275void neigh_seq_stop(struct seq_file *, void *); 321void neigh_seq_stop(struct seq_file *, void *);
276 322
323int neigh_proc_dointvec(struct ctl_table *ctl, int write,
324 void __user *buffer, size_t *lenp, loff_t *ppos);
325int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write,
326 void __user *buffer,
327 size_t *lenp, loff_t *ppos);
328int neigh_proc_dointvec_ms_jiffies(struct ctl_table *ctl, int write,
329 void __user *buffer,
330 size_t *lenp, loff_t *ppos);
331
277int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, 332int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
278 char *p_name, proc_handler *proc_handler); 333 proc_handler *proc_handler);
279void neigh_sysctl_unregister(struct neigh_parms *p); 334void neigh_sysctl_unregister(struct neigh_parms *p);
280 335
281static inline void __neigh_parms_put(struct neigh_parms *parms) 336static inline void __neigh_parms_put(struct neigh_parms *parms)
diff --git a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
index 6c3d12e2949f..981c327374da 100644
--- a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
+++ b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
@@ -19,6 +19,4 @@ extern struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp;
19int nf_conntrack_ipv4_compat_init(void); 19int nf_conntrack_ipv4_compat_init(void);
20void nf_conntrack_ipv4_compat_fini(void); 20void nf_conntrack_ipv4_compat_fini(void);
21 21
22void need_ipv4_conntrack(void);
23
24#endif /*_NF_CONNTRACK_IPV4_H*/ 22#endif /*_NF_CONNTRACK_IPV4_H*/
diff --git a/include/net/netfilter/ipv4/nf_reject.h b/include/net/netfilter/ipv4/nf_reject.h
new file mode 100644
index 000000000000..931fbf812171
--- /dev/null
+++ b/include/net/netfilter/ipv4/nf_reject.h
@@ -0,0 +1,128 @@
1#ifndef _IPV4_NF_REJECT_H
2#define _IPV4_NF_REJECT_H
3
4#include <net/ip.h>
5#include <net/tcp.h>
6#include <net/route.h>
7#include <net/dst.h>
8
9static inline void nf_send_unreach(struct sk_buff *skb_in, int code)
10{
11 icmp_send(skb_in, ICMP_DEST_UNREACH, code, 0);
12}
13
14/* Send RST reply */
15static void nf_send_reset(struct sk_buff *oldskb, int hook)
16{
17 struct sk_buff *nskb;
18 const struct iphdr *oiph;
19 struct iphdr *niph;
20 const struct tcphdr *oth;
21 struct tcphdr _otcph, *tcph;
22
23 /* IP header checks: fragment. */
24 if (ip_hdr(oldskb)->frag_off & htons(IP_OFFSET))
25 return;
26
27 oth = skb_header_pointer(oldskb, ip_hdrlen(oldskb),
28 sizeof(_otcph), &_otcph);
29 if (oth == NULL)
30 return;
31
32 /* No RST for RST. */
33 if (oth->rst)
34 return;
35
36 if (skb_rtable(oldskb)->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST))
37 return;
38
39 /* Check checksum */
40 if (nf_ip_checksum(oldskb, hook, ip_hdrlen(oldskb), IPPROTO_TCP))
41 return;
42 oiph = ip_hdr(oldskb);
43
44 nskb = alloc_skb(sizeof(struct iphdr) + sizeof(struct tcphdr) +
45 LL_MAX_HEADER, GFP_ATOMIC);
46 if (!nskb)
47 return;
48
49 skb_reserve(nskb, LL_MAX_HEADER);
50
51 skb_reset_network_header(nskb);
52 niph = (struct iphdr *)skb_put(nskb, sizeof(struct iphdr));
53 niph->version = 4;
54 niph->ihl = sizeof(struct iphdr) / 4;
55 niph->tos = 0;
56 niph->id = 0;
57 niph->frag_off = htons(IP_DF);
58 niph->protocol = IPPROTO_TCP;
59 niph->check = 0;
60 niph->saddr = oiph->daddr;
61 niph->daddr = oiph->saddr;
62
63 skb_reset_transport_header(nskb);
64 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr));
65 memset(tcph, 0, sizeof(*tcph));
66 tcph->source = oth->dest;
67 tcph->dest = oth->source;
68 tcph->doff = sizeof(struct tcphdr) / 4;
69
70 if (oth->ack)
71 tcph->seq = oth->ack_seq;
72 else {
73 tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin +
74 oldskb->len - ip_hdrlen(oldskb) -
75 (oth->doff << 2));
76 tcph->ack = 1;
77 }
78
79 tcph->rst = 1;
80 tcph->check = ~tcp_v4_check(sizeof(struct tcphdr), niph->saddr,
81 niph->daddr, 0);
82 nskb->ip_summed = CHECKSUM_PARTIAL;
83 nskb->csum_start = (unsigned char *)tcph - nskb->head;
84 nskb->csum_offset = offsetof(struct tcphdr, check);
85
86 /* ip_route_me_harder expects skb->dst to be set */
87 skb_dst_set_noref(nskb, skb_dst(oldskb));
88
89 nskb->protocol = htons(ETH_P_IP);
90 if (ip_route_me_harder(nskb, RTN_UNSPEC))
91 goto free_nskb;
92
93 niph->ttl = ip4_dst_hoplimit(skb_dst(nskb));
94
95 /* "Never happens" */
96 if (nskb->len > dst_mtu(skb_dst(nskb)))
97 goto free_nskb;
98
99 nf_ct_attach(nskb, oldskb);
100
101#ifdef CONFIG_BRIDGE_NETFILTER
102 /* If we use ip_local_out for bridged traffic, the MAC source on
103 * the RST will be ours, instead of the destination's. This confuses
104 * some routers/firewalls, and they drop the packet. So we need to
105 * build the eth header using the original destination's MAC as the
106 * source, and send the RST packet directly.
107 */
108 if (oldskb->nf_bridge) {
109 struct ethhdr *oeth = eth_hdr(oldskb);
110 nskb->dev = oldskb->nf_bridge->physindev;
111 niph->tot_len = htons(nskb->len);
112 ip_send_check(niph);
113 if (dev_hard_header(nskb, nskb->dev, ntohs(nskb->protocol),
114 oeth->h_source, oeth->h_dest, nskb->len) < 0)
115 goto free_nskb;
116 dev_queue_xmit(nskb);
117 } else
118#endif
119 ip_local_out(nskb);
120
121 return;
122
123 free_nskb:
124 kfree_skb(nskb);
125}
126
127
128#endif /* _IPV4_NF_REJECT_H */
diff --git a/include/net/netfilter/ipv6/nf_reject.h b/include/net/netfilter/ipv6/nf_reject.h
new file mode 100644
index 000000000000..710d17ed70b4
--- /dev/null
+++ b/include/net/netfilter/ipv6/nf_reject.h
@@ -0,0 +1,171 @@
1#ifndef _IPV6_NF_REJECT_H
2#define _IPV6_NF_REJECT_H
3
4#include <net/ipv6.h>
5#include <net/ip6_route.h>
6#include <net/ip6_fib.h>
7#include <net/ip6_checksum.h>
8#include <linux/netfilter_ipv6.h>
9
10static inline void
11nf_send_unreach6(struct net *net, struct sk_buff *skb_in, unsigned char code,
12 unsigned int hooknum)
13{
14 if (hooknum == NF_INET_LOCAL_OUT && skb_in->dev == NULL)
15 skb_in->dev = net->loopback_dev;
16
17 icmpv6_send(skb_in, ICMPV6_DEST_UNREACH, code, 0);
18}
19
20/* Send RST reply */
21static void nf_send_reset6(struct net *net, struct sk_buff *oldskb, int hook)
22{
23 struct sk_buff *nskb;
24 struct tcphdr otcph, *tcph;
25 unsigned int otcplen, hh_len;
26 int tcphoff, needs_ack;
27 const struct ipv6hdr *oip6h = ipv6_hdr(oldskb);
28 struct ipv6hdr *ip6h;
29#define DEFAULT_TOS_VALUE 0x0U
30 const __u8 tclass = DEFAULT_TOS_VALUE;
31 struct dst_entry *dst = NULL;
32 u8 proto;
33 __be16 frag_off;
34 struct flowi6 fl6;
35
36 if ((!(ipv6_addr_type(&oip6h->saddr) & IPV6_ADDR_UNICAST)) ||
37 (!(ipv6_addr_type(&oip6h->daddr) & IPV6_ADDR_UNICAST))) {
38 pr_debug("addr is not unicast.\n");
39 return;
40 }
41
42 proto = oip6h->nexthdr;
43 tcphoff = ipv6_skip_exthdr(oldskb, ((u8*)(oip6h+1) - oldskb->data), &proto, &frag_off);
44
45 if ((tcphoff < 0) || (tcphoff > oldskb->len)) {
46 pr_debug("Cannot get TCP header.\n");
47 return;
48 }
49
50 otcplen = oldskb->len - tcphoff;
51
52 /* IP header checks: fragment, too short. */
53 if (proto != IPPROTO_TCP || otcplen < sizeof(struct tcphdr)) {
54 pr_debug("proto(%d) != IPPROTO_TCP, "
55 "or too short. otcplen = %d\n",
56 proto, otcplen);
57 return;
58 }
59
60 if (skb_copy_bits(oldskb, tcphoff, &otcph, sizeof(struct tcphdr)))
61 BUG();
62
63 /* No RST for RST. */
64 if (otcph.rst) {
65 pr_debug("RST is set\n");
66 return;
67 }
68
69 /* Check checksum. */
70 if (nf_ip6_checksum(oldskb, hook, tcphoff, IPPROTO_TCP)) {
71 pr_debug("TCP checksum is invalid\n");
72 return;
73 }
74
75 memset(&fl6, 0, sizeof(fl6));
76 fl6.flowi6_proto = IPPROTO_TCP;
77 fl6.saddr = oip6h->daddr;
78 fl6.daddr = oip6h->saddr;
79 fl6.fl6_sport = otcph.dest;
80 fl6.fl6_dport = otcph.source;
81 security_skb_classify_flow(oldskb, flowi6_to_flowi(&fl6));
82 dst = ip6_route_output(net, NULL, &fl6);
83 if (dst == NULL || dst->error) {
84 dst_release(dst);
85 return;
86 }
87 dst = xfrm_lookup(net, dst, flowi6_to_flowi(&fl6), NULL, 0);
88 if (IS_ERR(dst))
89 return;
90
91 hh_len = (dst->dev->hard_header_len + 15)&~15;
92 nskb = alloc_skb(hh_len + 15 + dst->header_len + sizeof(struct ipv6hdr)
93 + sizeof(struct tcphdr) + dst->trailer_len,
94 GFP_ATOMIC);
95
96 if (!nskb) {
97 net_dbg_ratelimited("cannot alloc skb\n");
98 dst_release(dst);
99 return;
100 }
101
102 skb_dst_set(nskb, dst);
103
104 skb_reserve(nskb, hh_len + dst->header_len);
105
106 skb_put(nskb, sizeof(struct ipv6hdr));
107 skb_reset_network_header(nskb);
108 ip6h = ipv6_hdr(nskb);
109 ip6_flow_hdr(ip6h, tclass, 0);
110 ip6h->hop_limit = ip6_dst_hoplimit(dst);
111 ip6h->nexthdr = IPPROTO_TCP;
112 ip6h->saddr = oip6h->daddr;
113 ip6h->daddr = oip6h->saddr;
114
115 skb_reset_transport_header(nskb);
116 tcph = (struct tcphdr *)skb_put(nskb, sizeof(struct tcphdr));
117 /* Truncate to length (no data) */
118 tcph->doff = sizeof(struct tcphdr)/4;
119 tcph->source = otcph.dest;
120 tcph->dest = otcph.source;
121
122 if (otcph.ack) {
123 needs_ack = 0;
124 tcph->seq = otcph.ack_seq;
125 tcph->ack_seq = 0;
126 } else {
127 needs_ack = 1;
128 tcph->ack_seq = htonl(ntohl(otcph.seq) + otcph.syn + otcph.fin
129 + otcplen - (otcph.doff<<2));
130 tcph->seq = 0;
131 }
132
133 /* Reset flags */
134 ((u_int8_t *)tcph)[13] = 0;
135 tcph->rst = 1;
136 tcph->ack = needs_ack;
137 tcph->window = 0;
138 tcph->urg_ptr = 0;
139 tcph->check = 0;
140
141 /* Adjust TCP checksum */
142 tcph->check = csum_ipv6_magic(&ipv6_hdr(nskb)->saddr,
143 &ipv6_hdr(nskb)->daddr,
144 sizeof(struct tcphdr), IPPROTO_TCP,
145 csum_partial(tcph,
146 sizeof(struct tcphdr), 0));
147
148 nf_ct_attach(nskb, oldskb);
149
150#ifdef CONFIG_BRIDGE_NETFILTER
151 /* If we use ip6_local_out for bridged traffic, the MAC source on
152 * the RST will be ours, instead of the destination's. This confuses
153 * some routers/firewalls, and they drop the packet. So we need to
154 * build the eth header using the original destination's MAC as the
155 * source, and send the RST packet directly.
156 */
157 if (oldskb->nf_bridge) {
158 struct ethhdr *oeth = eth_hdr(oldskb);
159 nskb->dev = oldskb->nf_bridge->physindev;
160 nskb->protocol = htons(ETH_P_IPV6);
161 ip6h->payload_len = htons(sizeof(struct tcphdr));
162 if (dev_hard_header(nskb, nskb->dev, ntohs(nskb->protocol),
163 oeth->h_source, oeth->h_dest, nskb->len) < 0)
164 return;
165 dev_queue_xmit(nskb);
166 } else
167#endif
168 ip6_local_out(nskb);
169}
170
171#endif /* _IPV6_NF_REJECT_H */
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h
index 3efab704b7eb..adc1fa3dd7ab 100644
--- a/include/net/netfilter/nf_conntrack_l3proto.h
+++ b/include/net/netfilter/nf_conntrack_l3proto.h
@@ -87,7 +87,6 @@ int nf_ct_l3proto_register(struct nf_conntrack_l3proto *proto);
87void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto); 87void nf_ct_l3proto_unregister(struct nf_conntrack_l3proto *proto);
88 88
89struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto); 89struct nf_conntrack_l3proto *nf_ct_l3proto_find_get(u_int16_t l3proto);
90void nf_ct_l3proto_put(struct nf_conntrack_l3proto *p);
91 90
92/* Existing built-in protocols */ 91/* Existing built-in protocols */
93extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic; 92extern struct nf_conntrack_l3proto nf_conntrack_l3proto_generic;
diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h
index c1d5b3e34a21..84a53d780306 100644
--- a/include/net/netfilter/nf_queue.h
+++ b/include/net/netfilter/nf_queue.h
@@ -1,6 +1,10 @@
1#ifndef _NF_QUEUE_H 1#ifndef _NF_QUEUE_H
2#define _NF_QUEUE_H 2#define _NF_QUEUE_H
3 3
4#include <linux/ip.h>
5#include <linux/ipv6.h>
6#include <linux/jhash.h>
7
4/* Each queued (to userspace) skbuff has one of these. */ 8/* Each queued (to userspace) skbuff has one of these. */
5struct nf_queue_entry { 9struct nf_queue_entry {
6 struct list_head list; 10 struct list_head list;
@@ -33,4 +37,62 @@ void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
33bool nf_queue_entry_get_refs(struct nf_queue_entry *entry); 37bool nf_queue_entry_get_refs(struct nf_queue_entry *entry);
34void nf_queue_entry_release_refs(struct nf_queue_entry *entry); 38void nf_queue_entry_release_refs(struct nf_queue_entry *entry);
35 39
40static inline void init_hashrandom(u32 *jhash_initval)
41{
42 while (*jhash_initval == 0)
43 *jhash_initval = prandom_u32();
44}
45
46static inline u32 hash_v4(const struct sk_buff *skb, u32 jhash_initval)
47{
48 const struct iphdr *iph = ip_hdr(skb);
49
50 /* packets in either direction go into same queue */
51 if ((__force u32)iph->saddr < (__force u32)iph->daddr)
52 return jhash_3words((__force u32)iph->saddr,
53 (__force u32)iph->daddr, iph->protocol, jhash_initval);
54
55 return jhash_3words((__force u32)iph->daddr,
56 (__force u32)iph->saddr, iph->protocol, jhash_initval);
57}
58
59#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
60static inline u32 hash_v6(const struct sk_buff *skb, u32 jhash_initval)
61{
62 const struct ipv6hdr *ip6h = ipv6_hdr(skb);
63 u32 a, b, c;
64
65 if ((__force u32)ip6h->saddr.s6_addr32[3] <
66 (__force u32)ip6h->daddr.s6_addr32[3]) {
67 a = (__force u32) ip6h->saddr.s6_addr32[3];
68 b = (__force u32) ip6h->daddr.s6_addr32[3];
69 } else {
70 b = (__force u32) ip6h->saddr.s6_addr32[3];
71 a = (__force u32) ip6h->daddr.s6_addr32[3];
72 }
73
74 if ((__force u32)ip6h->saddr.s6_addr32[1] <
75 (__force u32)ip6h->daddr.s6_addr32[1])
76 c = (__force u32) ip6h->saddr.s6_addr32[1];
77 else
78 c = (__force u32) ip6h->daddr.s6_addr32[1];
79
80 return jhash_3words(a, b, c, jhash_initval);
81}
82#endif
83
84static inline u32
85nfqueue_hash(const struct sk_buff *skb, u16 queue, u16 queues_total, u8 family,
86 u32 jhash_initval)
87{
88 if (family == NFPROTO_IPV4)
89 queue += ((u64) hash_v4(skb, jhash_initval) * queues_total) >> 32;
90#if IS_ENABLED(CONFIG_IP6_NF_IPTABLES)
91 else if (family == NFPROTO_IPV6)
92 queue += ((u64) hash_v6(skb, jhash_initval) * queues_total) >> 32;
93#endif
94
95 return queue;
96}
97
36#endif /* _NF_QUEUE_H */ 98#endif /* _NF_QUEUE_H */
diff --git a/include/net/netfilter/nf_tables.h b/include/net/netfilter/nf_tables.h
index 5a91abfc0c30..57c8ff7955df 100644
--- a/include/net/netfilter/nf_tables.h
+++ b/include/net/netfilter/nf_tables.h
@@ -13,9 +13,10 @@ struct nft_pktinfo {
13 struct sk_buff *skb; 13 struct sk_buff *skb;
14 const struct net_device *in; 14 const struct net_device *in;
15 const struct net_device *out; 15 const struct net_device *out;
16 u8 hooknum; 16 const struct nf_hook_ops *ops;
17 u8 nhoff; 17 u8 nhoff;
18 u8 thoff; 18 u8 thoff;
19 u8 tprot;
19 /* for x_tables compatibility */ 20 /* for x_tables compatibility */
20 struct xt_action_param xt; 21 struct xt_action_param xt;
21}; 22};
@@ -29,7 +30,8 @@ static inline void nft_set_pktinfo(struct nft_pktinfo *pkt,
29 pkt->skb = skb; 30 pkt->skb = skb;
30 pkt->in = pkt->xt.in = in; 31 pkt->in = pkt->xt.in = in;
31 pkt->out = pkt->xt.out = out; 32 pkt->out = pkt->xt.out = out;
32 pkt->hooknum = pkt->xt.hooknum = ops->hooknum; 33 pkt->ops = ops;
34 pkt->xt.hooknum = ops->hooknum;
33 pkt->xt.family = ops->pf; 35 pkt->xt.family = ops->pf;
34} 36}
35 37
@@ -421,6 +423,8 @@ struct nft_stats {
421 u64 pkts; 423 u64 pkts;
422}; 424};
423 425
426#define NFT_HOOK_OPS_MAX 2
427
424/** 428/**
425 * struct nft_base_chain - nf_tables base chain 429 * struct nft_base_chain - nf_tables base chain
426 * 430 *
@@ -431,8 +435,8 @@ struct nft_stats {
431 * @chain: the chain 435 * @chain: the chain
432 */ 436 */
433struct nft_base_chain { 437struct nft_base_chain {
434 struct nf_hook_ops ops; 438 struct nf_hook_ops ops[NFT_HOOK_OPS_MAX];
435 enum nft_chain_type type; 439 const struct nf_chain_type *type;
436 u8 policy; 440 u8 policy;
437 struct nft_stats __percpu *stats; 441 struct nft_stats __percpu *stats;
438 struct nft_chain chain; 442 struct nft_chain chain;
@@ -443,8 +447,8 @@ static inline struct nft_base_chain *nft_base_chain(const struct nft_chain *chai
443 return container_of(chain, struct nft_base_chain, chain); 447 return container_of(chain, struct nft_base_chain, chain);
444} 448}
445 449
446unsigned int nft_do_chain_pktinfo(struct nft_pktinfo *pkt, 450unsigned int nft_do_chain(struct nft_pktinfo *pkt,
447 const struct nf_hook_ops *ops); 451 const struct nf_hook_ops *ops);
448 452
449/** 453/**
450 * struct nft_table - nf_tables table 454 * struct nft_table - nf_tables table
@@ -475,6 +479,8 @@ struct nft_table {
475 * @nhooks: number of hooks in this family 479 * @nhooks: number of hooks in this family
476 * @owner: module owner 480 * @owner: module owner
477 * @tables: used internally 481 * @tables: used internally
482 * @nops: number of hook ops in this family
483 * @hook_ops_init: initialization function for chain hook ops
478 * @hooks: hookfn overrides for packet validation 484 * @hooks: hookfn overrides for packet validation
479 */ 485 */
480struct nft_af_info { 486struct nft_af_info {
@@ -483,23 +489,36 @@ struct nft_af_info {
483 unsigned int nhooks; 489 unsigned int nhooks;
484 struct module *owner; 490 struct module *owner;
485 struct list_head tables; 491 struct list_head tables;
492 unsigned int nops;
493 void (*hook_ops_init)(struct nf_hook_ops *,
494 unsigned int);
486 nf_hookfn *hooks[NF_MAX_HOOKS]; 495 nf_hookfn *hooks[NF_MAX_HOOKS];
487}; 496};
488 497
489int nft_register_afinfo(struct net *, struct nft_af_info *); 498int nft_register_afinfo(struct net *, struct nft_af_info *);
490void nft_unregister_afinfo(struct nft_af_info *); 499void nft_unregister_afinfo(struct nft_af_info *);
491 500
501/**
502 * struct nf_chain_type - nf_tables chain type info
503 *
504 * @name: name of the type
505 * @type: numeric identifier
506 * @family: address family
507 * @owner: module owner
508 * @hook_mask: mask of valid hooks
509 * @hooks: hookfn overrides
510 */
492struct nf_chain_type { 511struct nf_chain_type {
493 unsigned int hook_mask; 512 const char *name;
494 const char *name; 513 enum nft_chain_type type;
495 enum nft_chain_type type; 514 int family;
496 nf_hookfn *fn[NF_MAX_HOOKS]; 515 struct module *owner;
497 struct module *me; 516 unsigned int hook_mask;
498 int family; 517 nf_hookfn *hooks[NF_MAX_HOOKS];
499}; 518};
500 519
501int nft_register_chain_type(struct nf_chain_type *); 520int nft_register_chain_type(const struct nf_chain_type *);
502void nft_unregister_chain_type(struct nf_chain_type *); 521void nft_unregister_chain_type(const struct nf_chain_type *);
503 522
504int nft_register_expr(struct nft_expr_type *); 523int nft_register_expr(struct nft_expr_type *);
505void nft_unregister_expr(struct nft_expr_type *); 524void nft_unregister_expr(struct nft_expr_type *);
diff --git a/include/net/netfilter/nf_tables_ipv4.h b/include/net/netfilter/nf_tables_ipv4.h
index 1be1c2c197ee..cba143fbd2e4 100644
--- a/include/net/netfilter/nf_tables_ipv4.h
+++ b/include/net/netfilter/nf_tables_ipv4.h
@@ -15,9 +15,12 @@ nft_set_pktinfo_ipv4(struct nft_pktinfo *pkt,
15 15
16 nft_set_pktinfo(pkt, ops, skb, in, out); 16 nft_set_pktinfo(pkt, ops, skb, in, out);
17 17
18 pkt->xt.thoff = ip_hdrlen(pkt->skb);
19 ip = ip_hdr(pkt->skb); 18 ip = ip_hdr(pkt->skb);
19 pkt->tprot = ip->protocol;
20 pkt->xt.thoff = ip_hdrlen(pkt->skb);
20 pkt->xt.fragoff = ntohs(ip->frag_off) & IP_OFFSET; 21 pkt->xt.fragoff = ntohs(ip->frag_off) & IP_OFFSET;
21} 22}
22 23
24extern struct nft_af_info nft_af_ipv4;
25
23#endif 26#endif
diff --git a/include/net/netfilter/nf_tables_ipv6.h b/include/net/netfilter/nf_tables_ipv6.h
index 4a9b88a65963..74d976137658 100644
--- a/include/net/netfilter/nf_tables_ipv6.h
+++ b/include/net/netfilter/nf_tables_ipv6.h
@@ -21,10 +21,13 @@ nft_set_pktinfo_ipv6(struct nft_pktinfo *pkt,
21 if (protohdr < 0) 21 if (protohdr < 0)
22 return -1; 22 return -1;
23 23
24 pkt->tprot = protohdr;
24 pkt->xt.thoff = thoff; 25 pkt->xt.thoff = thoff;
25 pkt->xt.fragoff = frag_off; 26 pkt->xt.fragoff = frag_off;
26 27
27 return 0; 28 return 0;
28} 29}
29 30
31extern struct nft_af_info nft_af_ipv6;
32
30#endif 33#endif
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 2c95d55f7914..4fe018c48ed9 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -22,8 +22,7 @@
22 * the GNU General Public License for more details. 22 * the GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software 25 * along with this program; if not, see <http://www.gnu.org/licenses/>.
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 * 26 *
28 */ 27 */
29 28
@@ -111,7 +110,7 @@ struct cipso_v4_doi;
111struct netlbl_audit { 110struct netlbl_audit {
112 u32 secid; 111 u32 secid;
113 kuid_t loginuid; 112 kuid_t loginuid;
114 u32 sessionid; 113 unsigned int sessionid;
115}; 114};
116 115
117/* 116/*
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index c9c0c538b68b..fbcc7fa536dc 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -65,6 +65,23 @@ struct nf_ip_net {
65struct netns_ct { 65struct netns_ct {
66 atomic_t count; 66 atomic_t count;
67 unsigned int expect_count; 67 unsigned int expect_count;
68#ifdef CONFIG_SYSCTL
69 struct ctl_table_header *sysctl_header;
70 struct ctl_table_header *acct_sysctl_header;
71 struct ctl_table_header *tstamp_sysctl_header;
72 struct ctl_table_header *event_sysctl_header;
73 struct ctl_table_header *helper_sysctl_header;
74#endif
75 char *slabname;
76 unsigned int sysctl_log_invalid; /* Log invalid packets */
77 unsigned int sysctl_events_retry_timeout;
78 int sysctl_events;
79 int sysctl_acct;
80 int sysctl_auto_assign_helper;
81 bool auto_assign_helper_warned;
82 int sysctl_tstamp;
83 int sysctl_checksum;
84
68 unsigned int htable_size; 85 unsigned int htable_size;
69 struct kmem_cache *nf_conntrack_cachep; 86 struct kmem_cache *nf_conntrack_cachep;
70 struct hlist_nulls_head *hash; 87 struct hlist_nulls_head *hash;
@@ -75,14 +92,6 @@ struct netns_ct {
75 struct ip_conntrack_stat __percpu *stat; 92 struct ip_conntrack_stat __percpu *stat;
76 struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb; 93 struct nf_ct_event_notifier __rcu *nf_conntrack_event_cb;
77 struct nf_exp_event_notifier __rcu *nf_expect_event_cb; 94 struct nf_exp_event_notifier __rcu *nf_expect_event_cb;
78 int sysctl_events;
79 unsigned int sysctl_events_retry_timeout;
80 int sysctl_acct;
81 int sysctl_tstamp;
82 int sysctl_checksum;
83 unsigned int sysctl_log_invalid; /* Log invalid packets */
84 int sysctl_auto_assign_helper;
85 bool auto_assign_helper_warned;
86 struct nf_ip_net nf_ct_proto; 95 struct nf_ip_net nf_ct_proto;
87#if defined(CONFIG_NF_CONNTRACK_LABELS) 96#if defined(CONFIG_NF_CONNTRACK_LABELS)
88 unsigned int labels_used; 97 unsigned int labels_used;
@@ -92,13 +101,5 @@ struct netns_ct {
92 struct hlist_head *nat_bysource; 101 struct hlist_head *nat_bysource;
93 unsigned int nat_htable_size; 102 unsigned int nat_htable_size;
94#endif 103#endif
95#ifdef CONFIG_SYSCTL
96 struct ctl_table_header *sysctl_header;
97 struct ctl_table_header *acct_sysctl_header;
98 struct ctl_table_header *tstamp_sysctl_header;
99 struct ctl_table_header *event_sysctl_header;
100 struct ctl_table_header *helper_sysctl_header;
101#endif
102 char *slabname;
103}; 104};
104#endif 105#endif
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index ee520cba2ec2..80f500a29498 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -69,6 +69,8 @@ struct netns_ipv4 {
69 struct local_ports sysctl_local_ports; 69 struct local_ports sysctl_local_ports;
70 70
71 int sysctl_tcp_ecn; 71 int sysctl_tcp_ecn;
72 int sysctl_ip_no_pmtu_disc;
73 int sysctl_ip_fwd_use_pmtu;
72 74
73 kgid_t sysctl_ping_group_range[2]; 75 kgid_t sysctl_ping_group_range[2];
74 76
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 0fb2401197c5..21edaf1f7916 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -27,7 +27,9 @@ struct netns_sysctl_ipv6 {
27 int ip6_rt_gc_elasticity; 27 int ip6_rt_gc_elasticity;
28 int ip6_rt_mtu_expires; 28 int ip6_rt_mtu_expires;
29 int ip6_rt_min_advmss; 29 int ip6_rt_min_advmss;
30 int flowlabel_consistency;
30 int icmpv6_time; 31 int icmpv6_time;
32 int anycast_src_echo_reply;
31}; 33};
32 34
33struct netns_ipv6 { 35struct netns_ipv6 {
diff --git a/include/net/netns/nftables.h b/include/net/netns/nftables.h
index 15d056d534e3..26a394cb91a8 100644
--- a/include/net/netns/nftables.h
+++ b/include/net/netns/nftables.h
@@ -10,6 +10,7 @@ struct netns_nftables {
10 struct list_head commit_list; 10 struct list_head commit_list;
11 struct nft_af_info *ipv4; 11 struct nft_af_info *ipv4;
12 struct nft_af_info *ipv6; 12 struct nft_af_info *ipv6;
13 struct nft_af_info *inet;
13 struct nft_af_info *arp; 14 struct nft_af_info *arp;
14 struct nft_af_info *bridge; 15 struct nft_af_info *bridge;
15 u8 gencursor; 16 u8 gencursor;
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h
index 5299e69a32af..1006a265beb3 100644
--- a/include/net/netns/xfrm.h
+++ b/include/net/netns/xfrm.h
@@ -33,8 +33,6 @@ struct netns_xfrm {
33 struct hlist_head state_gc_list; 33 struct hlist_head state_gc_list;
34 struct work_struct state_gc_work; 34 struct work_struct state_gc_work;
35 35
36 wait_queue_head_t km_waitq;
37
38 struct list_head policy_all; 36 struct list_head policy_all;
39 struct hlist_head *policy_byidx; 37 struct hlist_head *policy_byidx;
40 unsigned int policy_idx_hmask; 38 unsigned int policy_idx_hmask;
@@ -59,6 +57,10 @@ struct netns_xfrm {
59#if IS_ENABLED(CONFIG_IPV6) 57#if IS_ENABLED(CONFIG_IPV6)
60 struct dst_ops xfrm6_dst_ops; 58 struct dst_ops xfrm6_dst_ops;
61#endif 59#endif
60 spinlock_t xfrm_state_lock;
61 spinlock_t xfrm_policy_sk_bundle_lock;
62 rwlock_t xfrm_policy_lock;
63 struct mutex xfrm_cfg_mutex;
62}; 64};
63 65
64#endif 66#endif
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index 099d02782e22..dafc09f0fdbc 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -13,12 +13,12 @@
13 13
14#ifndef _NETPRIO_CGROUP_H 14#ifndef _NETPRIO_CGROUP_H
15#define _NETPRIO_CGROUP_H 15#define _NETPRIO_CGROUP_H
16
16#include <linux/cgroup.h> 17#include <linux/cgroup.h>
17#include <linux/hardirq.h> 18#include <linux/hardirq.h>
18#include <linux/rcupdate.h> 19#include <linux/rcupdate.h>
19 20
20 21#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
21#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
22struct netprio_map { 22struct netprio_map {
23 struct rcu_head rcu; 23 struct rcu_head rcu;
24 u32 priomap_len; 24 u32 priomap_len;
@@ -27,8 +27,7 @@ struct netprio_map {
27 27
28void sock_update_netprioidx(struct sock *sk); 28void sock_update_netprioidx(struct sock *sk);
29 29
30#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) 30#if IS_BUILTIN(CONFIG_CGROUP_NET_PRIO)
31
32static inline u32 task_netprioidx(struct task_struct *p) 31static inline u32 task_netprioidx(struct task_struct *p)
33{ 32{
34 struct cgroup_subsys_state *css; 33 struct cgroup_subsys_state *css;
@@ -40,9 +39,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
40 rcu_read_unlock(); 39 rcu_read_unlock();
41 return idx; 40 return idx;
42} 41}
43 42#elif IS_MODULE(CONFIG_CGROUP_NET_PRIO)
44#elif IS_MODULE(CONFIG_NETPRIO_CGROUP)
45
46static inline u32 task_netprioidx(struct task_struct *p) 43static inline u32 task_netprioidx(struct task_struct *p)
47{ 44{
48 struct cgroup_subsys_state *css; 45 struct cgroup_subsys_state *css;
@@ -56,9 +53,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
56 return idx; 53 return idx;
57} 54}
58#endif 55#endif
59 56#else /* !CONFIG_CGROUP_NET_PRIO */
60#else /* !CONFIG_NETPRIO_CGROUP */
61
62static inline u32 task_netprioidx(struct task_struct *p) 57static inline u32 task_netprioidx(struct task_struct *p)
63{ 58{
64 return 0; 59 return 0;
@@ -66,6 +61,5 @@ static inline u32 task_netprioidx(struct task_struct *p)
66 61
67#define sock_update_netprioidx(sk) 62#define sock_update_netprioidx(sk)
68 63
69#endif /* CONFIG_NETPRIO_CGROUP */ 64#endif /* CONFIG_CGROUP_NET_PRIO */
70
71#endif /* _NET_CLS_CGROUP_H */ 65#endif /* _NET_CLS_CGROUP_H */
diff --git a/include/net/nfc/digital.h b/include/net/nfc/digital.h
index 36acecd5f06c..81af21e9bcd4 100644
--- a/include/net/nfc/digital.h
+++ b/include/net/nfc/digital.h
@@ -122,6 +122,16 @@ typedef void (*nfc_digital_cmd_complete_t)(struct nfc_digital_dev *ddev,
122 * switch_rf to turn the radio on. A call to in|tg_configure_hw must turn 122 * switch_rf to turn the radio on. A call to in|tg_configure_hw must turn
123 * the device radio on. 123 * the device radio on.
124 * @abort_cmd: Discard the last sent command. 124 * @abort_cmd: Discard the last sent command.
125 *
126 * Notes: Asynchronous functions have a timeout parameter. It is the driver
127 * responsibility to call the digital stack back through the
128 * nfc_digital_cmd_complete_t callback when no RF respsonse has been
129 * received within the specified time (in milliseconds). In that case the
130 * driver must set the resp sk_buff to ERR_PTR(-ETIMEDOUT).
131 * Since the digital stack serializes commands to be sent, it's mandatory
132 * for the driver to handle the timeout correctly. Otherwise the stack
133 * would not be able to send new commands, waiting for the reply of the
134 * current one.
125 */ 135 */
126struct nfc_digital_ops { 136struct nfc_digital_ops {
127 int (*in_configure_hw)(struct nfc_digital_dev *ddev, int type, 137 int (*in_configure_hw)(struct nfc_digital_dev *ddev, int type,
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index 2eca2960ca9c..03c4650b548c 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -12,9 +12,7 @@
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the 15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 * Free Software Foundation, Inc.,
17 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 */ 16 */
19 17
20#ifndef __NET_HCI_H 18#ifndef __NET_HCI_H
diff --git a/include/net/nfc/llc.h b/include/net/nfc/llc.h
index 400ab7ae749d..c25fbdee0d61 100644
--- a/include/net/nfc/llc.h
+++ b/include/net/nfc/llc.h
@@ -13,9 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */ 17 */
20 18
21#ifndef __NFC_LLC_H_ 19#ifndef __NFC_LLC_H_
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h
index e5aa5acafea0..fbfa4e471abb 100644
--- a/include/net/nfc/nci.h
+++ b/include/net/nfc/nci.h
@@ -20,8 +20,7 @@
20 * GNU General Public License for more details. 20 * GNU General Public License for more details.
21 * 21 *
22 * You should have received a copy of the GNU General Public License 22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software 23 * along with this program; if not, see <http://www.gnu.org/licenses/>.
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * 24 *
26 */ 25 */
27 26
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index 6126f1f992b4..1f9a0f5272fe 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -21,8 +21,7 @@
21 * GNU General Public License for more details. 21 * GNU General Public License for more details.
22 * 22 *
23 * You should have received a copy of the GNU General Public License 23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software 24 * along with this program; if not, see <http://www.gnu.org/licenses/>.
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 * 25 *
27 */ 26 */
28 27
@@ -68,6 +67,7 @@ struct nci_ops {
68 int (*open)(struct nci_dev *ndev); 67 int (*open)(struct nci_dev *ndev);
69 int (*close)(struct nci_dev *ndev); 68 int (*close)(struct nci_dev *ndev);
70 int (*send)(struct nci_dev *ndev, struct sk_buff *skb); 69 int (*send)(struct nci_dev *ndev, struct sk_buff *skb);
70 int (*setup)(struct nci_dev *ndev);
71}; 71};
72 72
73#define NCI_MAX_SUPPORTED_RF_INTERFACES 4 73#define NCI_MAX_SUPPORTED_RF_INTERFACES 4
@@ -154,6 +154,7 @@ void nci_free_device(struct nci_dev *ndev);
154int nci_register_device(struct nci_dev *ndev); 154int nci_register_device(struct nci_dev *ndev);
155void nci_unregister_device(struct nci_dev *ndev); 155void nci_unregister_device(struct nci_dev *ndev);
156int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb); 156int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb);
157int nci_set_config(struct nci_dev *ndev, __u8 id, size_t len, __u8 *val);
157 158
158static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, 159static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev,
159 unsigned int len, 160 unsigned int len,
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 82fc4e43fc6e..e80894bca1d0 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -16,9 +16,7 @@
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the 19 * along with this program; if not, see <http://www.gnu.org/licenses/>.
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */ 20 */
23 21
24#ifndef __NET_NFC_H 22#ifndef __NET_NFC_H
diff --git a/include/net/ping.h b/include/net/ping.h
index 90f48417b03d..026479b61a2d 100644
--- a/include/net/ping.h
+++ b/include/net/ping.h
@@ -33,8 +33,12 @@
33struct pingv6_ops { 33struct pingv6_ops {
34 int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len, 34 int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len,
35 int *addr_len); 35 int *addr_len);
36 int (*ip6_datagram_recv_ctl)(struct sock *sk, struct msghdr *msg, 36 void (*ip6_datagram_recv_common_ctl)(struct sock *sk,
37 struct sk_buff *skb); 37 struct msghdr *msg,
38 struct sk_buff *skb);
39 void (*ip6_datagram_recv_specific_ctl)(struct sock *sk,
40 struct msghdr *msg,
41 struct sk_buff *skb);
38 int (*icmpv6_err_convert)(u8 type, u8 code, int *err); 42 int (*icmpv6_err_convert)(u8 type, u8 code, int *err);
39 void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err, 43 void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err,
40 __be16 port, u32 info, u8 *payload); 44 __be16 port, u32 info, u8 *payload);
@@ -42,11 +46,6 @@ struct pingv6_ops {
42 const struct net_device *dev, int strict); 46 const struct net_device *dev, int strict);
43}; 47};
44 48
45struct ping_table {
46 struct hlist_nulls_head hash[PING_HTABLE_SIZE];
47 rwlock_t lock;
48};
49
50struct ping_iter_state { 49struct ping_iter_state {
51 struct seq_net_private p; 50 struct seq_net_private p;
52 int bucket; 51 int bucket;
@@ -54,7 +53,6 @@ struct ping_iter_state {
54}; 53};
55 54
56extern struct proto ping_prot; 55extern struct proto ping_prot;
57extern struct ping_table ping_table;
58#if IS_ENABLED(CONFIG_IPV6) 56#if IS_ENABLED(CONFIG_IPV6)
59extern struct pingv6_ops pingv6_ops; 57extern struct pingv6_ops pingv6_ops;
60#endif 58#endif
@@ -81,8 +79,6 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
81 size_t len, int noblock, int flags, int *addr_len); 79 size_t len, int noblock, int flags, int *addr_len);
82int ping_common_sendmsg(int family, struct msghdr *msg, size_t len, 80int ping_common_sendmsg(int family, struct msghdr *msg, size_t len,
83 void *user_icmph, size_t icmph_len); 81 void *user_icmph, size_t icmph_len);
84int ping_v4_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
85 size_t len);
86int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 82int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
87 size_t len); 83 size_t len);
88int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb); 84int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 2ebef77a2f9a..a2441fb1428f 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -62,18 +62,26 @@ tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r)
62 62
63struct tcf_exts { 63struct tcf_exts {
64#ifdef CONFIG_NET_CLS_ACT 64#ifdef CONFIG_NET_CLS_ACT
65 struct tc_action *action; 65 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */
66 struct list_head actions;
66#endif 67#endif
67}; 68 /* Map to export classifier specific extension TLV types to the
68 69 * generic extensions API. Unsupported extensions must be set to 0.
69/* Map to export classifier specific extension TLV types to the 70 */
70 * generic extensions API. Unsupported extensions must be set to 0.
71 */
72struct tcf_ext_map {
73 int action; 71 int action;
74 int police; 72 int police;
75}; 73};
76 74
75static inline void tcf_exts_init(struct tcf_exts *exts, int action, int police)
76{
77#ifdef CONFIG_NET_CLS_ACT
78 exts->type = 0;
79 INIT_LIST_HEAD(&exts->actions);
80#endif
81 exts->action = action;
82 exts->police = police;
83}
84
77/** 85/**
78 * tcf_exts_is_predicative - check if a predicative extension is present 86 * tcf_exts_is_predicative - check if a predicative extension is present
79 * @exts: tc filter extensions handle 87 * @exts: tc filter extensions handle
@@ -85,7 +93,7 @@ static inline int
85tcf_exts_is_predicative(struct tcf_exts *exts) 93tcf_exts_is_predicative(struct tcf_exts *exts)
86{ 94{
87#ifdef CONFIG_NET_CLS_ACT 95#ifdef CONFIG_NET_CLS_ACT
88 return !!exts->action; 96 return !list_empty(&exts->actions);
89#else 97#else
90 return 0; 98 return 0;
91#endif 99#endif
@@ -120,23 +128,20 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
120 struct tcf_result *res) 128 struct tcf_result *res)
121{ 129{
122#ifdef CONFIG_NET_CLS_ACT 130#ifdef CONFIG_NET_CLS_ACT
123 if (exts->action) 131 if (!list_empty(&exts->actions))
124 return tcf_action_exec(skb, exts->action, res); 132 return tcf_action_exec(skb, &exts->actions, res);
125#endif 133#endif
126 return 0; 134 return 0;
127} 135}
128 136
129int tcf_exts_validate(struct net *net, struct tcf_proto *tp, 137int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
130 struct nlattr **tb, struct nlattr *rate_tlv, 138 struct nlattr **tb, struct nlattr *rate_tlv,
131 struct tcf_exts *exts, 139 struct tcf_exts *exts);
132 const struct tcf_ext_map *map);
133void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); 140void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts);
134void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, 141void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
135 struct tcf_exts *src); 142 struct tcf_exts *src);
136int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts, 143int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts);
137 const struct tcf_ext_map *map); 144int 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);
140 145
141/** 146/**
142 * struct tcf_pkt_info - packet information 147 * struct tcf_pkt_info - packet information
@@ -333,27 +338,27 @@ static inline int tcf_valid_offset(const struct sk_buff *skb,
333#include <net/net_namespace.h> 338#include <net/net_namespace.h>
334 339
335static inline int 340static inline int
336tcf_change_indev(struct tcf_proto *tp, char *indev, struct nlattr *indev_tlv) 341tcf_change_indev(struct net *net, struct nlattr *indev_tlv)
337{ 342{
343 char indev[IFNAMSIZ];
344 struct net_device *dev;
345
338 if (nla_strlcpy(indev, indev_tlv, IFNAMSIZ) >= IFNAMSIZ) 346 if (nla_strlcpy(indev, indev_tlv, IFNAMSIZ) >= IFNAMSIZ)
339 return -EINVAL; 347 return -EINVAL;
340 return 0; 348 dev = __dev_get_by_name(net, indev);
349 if (!dev)
350 return -ENODEV;
351 return dev->ifindex;
341} 352}
342 353
343static inline int 354static inline bool
344tcf_match_indev(struct sk_buff *skb, char *indev) 355tcf_match_indev(struct sk_buff *skb, int ifindex)
345{ 356{
346 struct net_device *dev; 357 if (!ifindex)
347 358 return true;
348 if (indev[0]) { 359 if (!skb->skb_iif)
349 if (!skb->skb_iif) 360 return false;
350 return 0; 361 return ifindex == skb->skb_iif;
351 dev = __dev_get_by_index(dev_net(skb->dev), skb->skb_iif);
352 if (!dev || strcmp(indev, dev->name))
353 return 0;
354 }
355
356 return 1;
357} 362}
358#endif /* CONFIG_NET_CLS_IND */ 363#endif /* CONFIG_NET_CLS_IND */
359 364
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 59ec3cd15d68..891d80d2c4d2 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -88,6 +88,7 @@ int unregister_qdisc(struct Qdisc_ops *qops);
88void qdisc_get_default(char *id, size_t len); 88void qdisc_get_default(char *id, size_t len);
89int qdisc_set_default(const char *id); 89int qdisc_set_default(const char *id);
90 90
91void qdisc_list_add(struct Qdisc *q);
91void qdisc_list_del(struct Qdisc *q); 92void qdisc_list_del(struct Qdisc *q);
92struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); 93struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle);
93struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); 94struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle);
diff --git a/include/net/protocol.h b/include/net/protocol.h
index fbf7676c9a02..a7e986b08147 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -43,7 +43,12 @@ struct net_protocol {
43 int (*handler)(struct sk_buff *skb); 43 int (*handler)(struct sk_buff *skb);
44 void (*err_handler)(struct sk_buff *skb, u32 info); 44 void (*err_handler)(struct sk_buff *skb, u32 info);
45 unsigned int no_policy:1, 45 unsigned int no_policy:1,
46 netns_ok:1; 46 netns_ok:1,
47 /* does the protocol do more stringent
48 * icmp tag validation than simple
49 * socket lookup?
50 */
51 icmp_strict_tag_validation:1;
47}; 52};
48 53
49#if IS_ENABLED(CONFIG_IPV6) 54#if IS_ENABLED(CONFIG_IPV6)
@@ -103,6 +108,9 @@ int inet_del_offload(const struct net_offload *prot, unsigned char num);
103void inet_register_protosw(struct inet_protosw *p); 108void inet_register_protosw(struct inet_protosw *p);
104void inet_unregister_protosw(struct inet_protosw *p); 109void inet_unregister_protosw(struct inet_protosw *p);
105 110
111int udp_add_offload(struct udp_offload *prot);
112void udp_del_offload(struct udp_offload *prot);
113
106#if IS_ENABLED(CONFIG_IPV6) 114#if IS_ENABLED(CONFIG_IPV6)
107int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num); 115int inet6_add_protocol(const struct inet6_protocol *prot, unsigned char num);
108int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num); 116int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char num);
diff --git a/include/net/red.h b/include/net/red.h
index ef46058d35bf..76e0b5f922c6 100644
--- a/include/net/red.h
+++ b/include/net/red.h
@@ -130,7 +130,8 @@ struct red_parms {
130 u32 qth_max; /* Max avg length threshold: Wlog scaled */ 130 u32 qth_max; /* Max avg length threshold: Wlog scaled */
131 u32 Scell_max; 131 u32 Scell_max;
132 u32 max_P; /* probability, [0 .. 1.0] 32 scaled */ 132 u32 max_P; /* probability, [0 .. 1.0] 32 scaled */
133 u32 max_P_reciprocal; /* reciprocal_value(max_P / qth_delta) */ 133 /* reciprocal_value(max_P / qth_delta) */
134 struct reciprocal_value max_P_reciprocal;
134 u32 qth_delta; /* max_th - min_th */ 135 u32 qth_delta; /* max_th - min_th */
135 u32 target_min; /* min_th + 0.4*(max_th - min_th) */ 136 u32 target_min; /* min_th + 0.4*(max_th - min_th) */
136 u32 target_max; /* min_th + 0.6*(max_th - min_th) */ 137 u32 target_max; /* min_th + 0.6*(max_th - min_th) */
@@ -303,7 +304,7 @@ static inline unsigned long red_calc_qavg(const struct red_parms *p,
303 304
304static inline u32 red_random(const struct red_parms *p) 305static inline u32 red_random(const struct red_parms *p)
305{ 306{
306 return reciprocal_divide(net_random(), p->max_P_reciprocal); 307 return reciprocal_divide(prandom_u32(), p->max_P_reciprocal);
307} 308}
308 309
309static inline int red_mark_probability(const struct red_parms *p, 310static inline int red_mark_probability(const struct red_parms *p,
diff --git a/include/net/regulatory.h b/include/net/regulatory.h
index f17ed590d64a..b07cdc9fa454 100644
--- a/include/net/regulatory.h
+++ b/include/net/regulatory.h
@@ -38,17 +38,17 @@ enum environment_cap {
38 * 38 *
39 * @rcu_head: RCU head struct used to free the request 39 * @rcu_head: RCU head struct used to free the request
40 * @wiphy_idx: this is set if this request's initiator is 40 * @wiphy_idx: this is set if this request's initiator is
41 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This 41 * %REGDOM_SET_BY_COUNTRY_IE or %REGDOM_SET_BY_DRIVER. This
42 * can be used by the wireless core to deal with conflicts 42 * can be used by the wireless core to deal with conflicts
43 * and potentially inform users of which devices specifically 43 * and potentially inform users of which devices specifically
44 * cased the conflicts. 44 * cased the conflicts.
45 * @initiator: indicates who sent this request, could be any of 45 * @initiator: indicates who sent this request, could be any of
46 * of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*) 46 * of those set in nl80211_reg_initiator (%NL80211_REGDOM_SET_BY_*)
47 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested 47 * @alpha2: the ISO / IEC 3166 alpha2 country code of the requested
48 * regulatory domain. We have a few special codes: 48 * regulatory domain. We have a few special codes:
49 * 00 - World regulatory domain 49 * 00 - World regulatory domain
50 * 99 - built by driver but a specific alpha2 cannot be determined 50 * 99 - built by driver but a specific alpha2 cannot be determined
51 * 98 - result of an intersection between two regulatory domains 51 * 98 - result of an intersection between two regulatory domains
52 * 97 - regulatory domain has not yet been configured 52 * 97 - regulatory domain has not yet been configured
53 * @dfs_region: If CRDA responded with a regulatory domain that requires 53 * @dfs_region: If CRDA responded with a regulatory domain that requires
54 * DFS master operation on a known DFS region (NL80211_DFS_*), 54 * DFS master operation on a known DFS region (NL80211_DFS_*),
@@ -59,8 +59,8 @@ enum environment_cap {
59 * of hint passed. This could be any of the %NL80211_USER_REG_HINT_* 59 * of hint passed. This could be any of the %NL80211_USER_REG_HINT_*
60 * types. 60 * types.
61 * @intersect: indicates whether the wireless core should intersect 61 * @intersect: indicates whether the wireless core should intersect
62 * the requested regulatory domain with the presently set regulatory 62 * the requested regulatory domain with the presently set regulatory
63 * domain. 63 * domain.
64 * @processed: indicates whether or not this requests has already been 64 * @processed: indicates whether or not this requests has already been
65 * processed. When the last request is processed it means that the 65 * processed. When the last request is processed it means that the
66 * currently regulatory domain set on cfg80211 is updated from 66 * currently regulatory domain set on cfg80211 is updated from
@@ -68,9 +68,9 @@ enum environment_cap {
68 * the last request is not yet processed we must yield until it 68 * the last request is not yet processed we must yield until it
69 * is processed before processing any new requests. 69 * is processed before processing any new requests.
70 * @country_ie_checksum: checksum of the last processed and accepted 70 * @country_ie_checksum: checksum of the last processed and accepted
71 * country IE 71 * country IE
72 * @country_ie_env: lets us know if the AP is telling us we are outdoor, 72 * @country_ie_env: lets us know if the AP is telling us we are outdoor,
73 * indoor, or if it doesn't matter 73 * indoor, or if it doesn't matter
74 * @list: used to insert into the reg_requests_list linked list 74 * @list: used to insert into the reg_requests_list linked list
75 */ 75 */
76struct regulatory_request { 76struct regulatory_request {
@@ -79,13 +79,67 @@ struct regulatory_request {
79 enum nl80211_reg_initiator initiator; 79 enum nl80211_reg_initiator initiator;
80 enum nl80211_user_reg_hint_type user_reg_hint_type; 80 enum nl80211_user_reg_hint_type user_reg_hint_type;
81 char alpha2[2]; 81 char alpha2[2];
82 u8 dfs_region; 82 enum nl80211_dfs_regions dfs_region;
83 bool intersect; 83 bool intersect;
84 bool processed; 84 bool processed;
85 enum environment_cap country_ie_env; 85 enum environment_cap country_ie_env;
86 struct list_head list; 86 struct list_head list;
87}; 87};
88 88
89/**
90 * enum ieee80211_regulatory_flags - device regulatory flags
91 *
92 * @REGULATORY_CUSTOM_REG: tells us the driver for this device
93 * has its own custom regulatory domain and cannot identify the
94 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
95 * we will disregard the first regulatory hint (when the
96 * initiator is %REGDOM_SET_BY_CORE). Drivers that use
97 * wiphy_apply_custom_regulatory() should have this flag set
98 * or the regulatory core will set it for the wiphy.
99 * If you use regulatory_hint() *after* using
100 * wiphy_apply_custom_regulatory() the wireless core will
101 * clear the REGULATORY_CUSTOM_REG for your wiphy as it would be
102 * implied that the device somehow gained knowledge of its region.
103 * @REGULATORY_STRICT_REG: tells us that the wiphy for this device
104 * has regulatory domain that it wishes to be considered as the
105 * superset for regulatory rules. After this device gets its regulatory
106 * domain programmed further regulatory hints shall only be considered
107 * for this device to enhance regulatory compliance, forcing the
108 * device to only possibly use subsets of the original regulatory
109 * rules. For example if channel 13 and 14 are disabled by this
110 * device's regulatory domain no user specified regulatory hint which
111 * has these channels enabled would enable them for this wiphy,
112 * the device's original regulatory domain will be trusted as the
113 * base. You can program the superset of regulatory rules for this
114 * wiphy with regulatory_hint() for cards programmed with an
115 * ISO3166-alpha2 country code. wiphys that use regulatory_hint()
116 * will have their wiphy->regd programmed once the regulatory
117 * domain is set, and all other regulatory hints will be ignored
118 * until their own regulatory domain gets programmed.
119 * @REGULATORY_DISABLE_BEACON_HINTS: enable this if your driver needs to
120 * ensure that passive scan flags and beaconing flags may not be lifted by
121 * cfg80211 due to regulatory beacon hints. For more information on beacon
122 * hints read the documenation for regulatory_hint_found_beacon()
123 * @REGULATORY_COUNTRY_IE_FOLLOW_POWER: for devices that have a preference
124 * that even though they may have programmed their own custom power
125 * setting prior to wiphy registration, they want to ensure their channel
126 * power settings are updated for this connection with the power settings
127 * derived from the regulatory domain. The regulatory domain used will be
128 * based on the ISO3166-alpha2 from country IE provided through
129 * regulatory_hint_country_ie()
130 * @REGULATORY_COUNTRY_IE_IGNORE: for devices that have a preference to ignore
131 * all country IE information processed by the regulatory core. This will
132 * override %REGULATORY_COUNTRY_IE_FOLLOW_POWER as all country IEs will
133 * be ignored.
134 */
135enum ieee80211_regulatory_flags {
136 REGULATORY_CUSTOM_REG = BIT(0),
137 REGULATORY_STRICT_REG = BIT(1),
138 REGULATORY_DISABLE_BEACON_HINTS = BIT(2),
139 REGULATORY_COUNTRY_IE_FOLLOW_POWER = BIT(3),
140 REGULATORY_COUNTRY_IE_IGNORE = BIT(4),
141};
142
89struct ieee80211_freq_range { 143struct ieee80211_freq_range {
90 u32 start_freq_khz; 144 u32 start_freq_khz;
91 u32 end_freq_khz; 145 u32 end_freq_khz;
@@ -107,7 +161,7 @@ struct ieee80211_regdomain {
107 struct rcu_head rcu_head; 161 struct rcu_head rcu_head;
108 u32 n_reg_rules; 162 u32 n_reg_rules;
109 char alpha2[2]; 163 char alpha2[2];
110 u8 dfs_region; 164 enum nl80211_dfs_regions dfs_region;
111 struct ieee80211_reg_rule reg_rules[]; 165 struct ieee80211_reg_rule reg_rules[];
112}; 166};
113 167
diff --git a/include/net/route.h b/include/net/route.h
index f68c167280a7..9d1f423d5944 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -36,6 +36,9 @@
36#include <linux/cache.h> 36#include <linux/cache.h>
37#include <linux/security.h> 37#include <linux/security.h>
38 38
39/* IPv4 datagram length is stored into 16bit field (tot_len) */
40#define IP_MAX_MTU 0xFFFFU
41
39#define RTO_ONLINK 0x01 42#define RTO_ONLINK 0x01
40 43
41#define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE)) 44#define RT_CONN_FLAGS(sk) (RT_TOS(inet_sk(sk)->tos) | sock_flag(sk, SOCK_LOCALROUTE))
@@ -239,14 +242,12 @@ static inline char rt_tos2priority(u8 tos)
239static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 src, 242static inline void ip_route_connect_init(struct flowi4 *fl4, __be32 dst, __be32 src,
240 u32 tos, int oif, u8 protocol, 243 u32 tos, int oif, u8 protocol,
241 __be16 sport, __be16 dport, 244 __be16 sport, __be16 dport,
242 struct sock *sk, bool can_sleep) 245 struct sock *sk)
243{ 246{
244 __u8 flow_flags = 0; 247 __u8 flow_flags = 0;
245 248
246 if (inet_sk(sk)->transparent) 249 if (inet_sk(sk)->transparent)
247 flow_flags |= FLOWI_FLAG_ANYSRC; 250 flow_flags |= FLOWI_FLAG_ANYSRC;
248 if (can_sleep)
249 flow_flags |= FLOWI_FLAG_CAN_SLEEP;
250 251
251 flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE, 252 flowi4_init_output(fl4, oif, sk->sk_mark, tos, RT_SCOPE_UNIVERSE,
252 protocol, flow_flags, dst, src, dport, sport); 253 protocol, flow_flags, dst, src, dport, sport);
@@ -256,13 +257,13 @@ static inline struct rtable *ip_route_connect(struct flowi4 *fl4,
256 __be32 dst, __be32 src, u32 tos, 257 __be32 dst, __be32 src, u32 tos,
257 int oif, u8 protocol, 258 int oif, u8 protocol,
258 __be16 sport, __be16 dport, 259 __be16 sport, __be16 dport,
259 struct sock *sk, bool can_sleep) 260 struct sock *sk)
260{ 261{
261 struct net *net = sock_net(sk); 262 struct net *net = sock_net(sk);
262 struct rtable *rt; 263 struct rtable *rt;
263 264
264 ip_route_connect_init(fl4, dst, src, tos, oif, protocol, 265 ip_route_connect_init(fl4, dst, src, tos, oif, protocol,
265 sport, dport, sk, can_sleep); 266 sport, dport, sk);
266 267
267 if (!dst || !src) { 268 if (!dst || !src) {
268 rt = __ip_route_output_key(net, fl4); 269 rt = __ip_route_output_key(net, fl4);
@@ -313,20 +314,4 @@ static inline int ip4_dst_hoplimit(const struct dst_entry *dst)
313 return hoplimit; 314 return hoplimit;
314} 315}
315 316
316static inline bool ip_sk_accept_pmtu(const struct sock *sk)
317{
318 return inet_sk(sk)->pmtudisc != IP_PMTUDISC_INTERFACE;
319}
320
321static inline bool ip_sk_use_pmtu(const struct sock *sk)
322{
323 return inet_sk(sk)->pmtudisc < IP_PMTUDISC_PROBE;
324}
325
326static inline int ip_skb_dst_mtu(const struct sk_buff *skb)
327{
328 return (!skb->sk || ip_sk_use_pmtu(skb->sk)) ?
329 dst_mtu(skb_dst(skb)) : skb_dst(skb)->dev->mtu;
330}
331
332#endif /* _ROUTE_H */ 317#endif /* _ROUTE_H */
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index bb13a182fba6..661e45d38051 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -79,6 +79,20 @@ struct rtnl_link_ops {
79 const struct net_device *dev); 79 const struct net_device *dev);
80 unsigned int (*get_num_tx_queues)(void); 80 unsigned int (*get_num_tx_queues)(void);
81 unsigned int (*get_num_rx_queues)(void); 81 unsigned int (*get_num_rx_queues)(void);
82
83 int slave_maxtype;
84 const struct nla_policy *slave_policy;
85 int (*slave_validate)(struct nlattr *tb[],
86 struct nlattr *data[]);
87 int (*slave_changelink)(struct net_device *dev,
88 struct net_device *slave_dev,
89 struct nlattr *tb[],
90 struct nlattr *data[]);
91 size_t (*get_slave_size)(const struct net_device *dev,
92 const struct net_device *slave_dev);
93 int (*fill_slave_info)(struct sk_buff *skb,
94 const struct net_device *dev,
95 const struct net_device *slave_dev);
82}; 96};
83 97
84int __rtnl_link_register(struct rtnl_link_ops *ops); 98int __rtnl_link_register(struct rtnl_link_ops *ops);
@@ -115,10 +129,9 @@ struct rtnl_af_ops {
115 const struct nlattr *attr); 129 const struct nlattr *attr);
116}; 130};
117 131
118int __rtnl_af_register(struct rtnl_af_ops *ops);
119void __rtnl_af_unregister(struct rtnl_af_ops *ops); 132void __rtnl_af_unregister(struct rtnl_af_ops *ops);
120 133
121int rtnl_af_register(struct rtnl_af_ops *ops); 134void rtnl_af_register(struct rtnl_af_ops *ops);
122void rtnl_af_unregister(struct rtnl_af_ops *ops); 135void rtnl_af_unregister(struct rtnl_af_ops *ops);
123 136
124struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); 137struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index d0a6321c302e..d062f81c692f 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -185,7 +185,7 @@ struct tcf_result {
185}; 185};
186 186
187struct tcf_proto_ops { 187struct tcf_proto_ops {
188 struct tcf_proto_ops *next; 188 struct list_head head;
189 char kind[IFNAMSIZ]; 189 char kind[IFNAMSIZ];
190 190
191 int (*classify)(struct sk_buff *, 191 int (*classify)(struct sk_buff *,
@@ -204,7 +204,7 @@ struct tcf_proto_ops {
204 void (*walk)(struct tcf_proto*, struct tcf_walker *arg); 204 void (*walk)(struct tcf_proto*, struct tcf_walker *arg);
205 205
206 /* rtnetlink specific */ 206 /* rtnetlink specific */
207 int (*dump)(struct tcf_proto*, unsigned long, 207 int (*dump)(struct net*, struct tcf_proto*, unsigned long,
208 struct sk_buff *skb, struct tcmsg*); 208 struct sk_buff *skb, struct tcmsg*);
209 209
210 struct module *owner; 210 struct module *owner;
diff --git a/include/net/sctp/auth.h b/include/net/sctp/auth.h
index aa80bef3c9d5..f2d58aa37a6f 100644
--- a/include/net/sctp/auth.h
+++ b/include/net/sctp/auth.h
@@ -16,9 +16,8 @@
16 * See the GNU General Public License for more details. 16 * See the GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with GNU CC; see the file COPYING. If not, write to 19 * along with GNU CC; see the file COPYING. If not, see
20 * the Free Software Foundation, 59 Temple Place - Suite 330, 20 * <http://www.gnu.org/licenses/>.
21 * Boston, MA 02111-1307, USA.
22 * 21 *
23 * Please send any bug reports or fixes you make to the 22 * Please send any bug reports or fixes you make to the
24 * email address(es): 23 * email address(es):
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index 6bd44fe94c26..4a5b9a306c69 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -19,9 +19,8 @@
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, see
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * <http://www.gnu.org/licenses/>.
24 * Boston, MA 02111-1307, USA.
25 * 24 *
26 * Please send any bug reports or fixes you make to the 25 * Please send any bug reports or fixes you make to the
27 * email address(es): 26 * email address(es):
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 832f2191489c..4b7cd695e431 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -19,9 +19,8 @@
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, see
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * <http://www.gnu.org/licenses/>.
24 * Boston, MA 02111-1307, USA.
25 * 24 *
26 * Please send any bug reports or fixes you make to the 25 * Please send any bug reports or fixes you make to the
27 * email address(es): 26 * email address(es):
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index 2f0a565a0fd5..307728f622ef 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -19,9 +19,8 @@
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, see
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * <http://www.gnu.org/licenses/>.
24 * Boston, MA 02111-1307, USA.
25 * 24 *
26 * Please send any bug reports or fixes you make to the 25 * Please send any bug reports or fixes you make to the
27 * email address(es): 26 * email address(es):
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index c5fe80697f8d..a3353f45ef94 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -21,9 +21,8 @@
21 * See the GNU General Public License for more details. 21 * See the GNU General Public License for more details.
22 * 22 *
23 * You should have received a copy of the GNU General Public License 23 * You should have received a copy of the GNU General Public License
24 * along with GNU CC; see the file COPYING. If not, write to 24 * along with GNU CC; see the file COPYING. If not, see
25 * the Free Software Foundation, 59 Temple Place - Suite 330, 25 * <http://www.gnu.org/licenses/>.
26 * Boston, MA 02111-1307, USA.
27 * 26 *
28 * Please send any bug reports or fixes you make to the 27 * Please send any bug reports or fixes you make to the
29 * email address(es): 28 * email address(es):
@@ -171,25 +170,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
171 * Section: Macros, externs, and inlines 170 * Section: Macros, externs, and inlines
172 */ 171 */
173 172
174/* spin lock wrappers. */
175#define sctp_spin_lock_irqsave(lock, flags) spin_lock_irqsave(lock, flags)
176#define sctp_spin_unlock_irqrestore(lock, flags) \
177 spin_unlock_irqrestore(lock, flags)
178#define sctp_local_bh_disable() local_bh_disable()
179#define sctp_local_bh_enable() local_bh_enable()
180#define sctp_spin_lock(lock) spin_lock(lock)
181#define sctp_spin_unlock(lock) spin_unlock(lock)
182#define sctp_write_lock(lock) write_lock(lock)
183#define sctp_write_unlock(lock) write_unlock(lock)
184#define sctp_read_lock(lock) read_lock(lock)
185#define sctp_read_unlock(lock) read_unlock(lock)
186
187/* sock lock wrappers. */
188#define sctp_lock_sock(sk) lock_sock(sk)
189#define sctp_release_sock(sk) release_sock(sk)
190#define sctp_bh_lock_sock(sk) bh_lock_sock(sk)
191#define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk)
192
193/* SCTP SNMP MIB stats handlers */ 173/* SCTP SNMP MIB stats handlers */
194#define SCTP_INC_STATS(net, field) SNMP_INC_STATS((net)->sctp.sctp_statistics, field) 174#define SCTP_INC_STATS(net, field) SNMP_INC_STATS((net)->sctp.sctp_statistics, field)
195#define SCTP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->sctp.sctp_statistics, field) 175#define SCTP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH((net)->sctp.sctp_statistics, field)
@@ -354,13 +334,13 @@ static inline void sctp_skb_list_tail(struct sk_buff_head *list,
354{ 334{
355 unsigned long flags; 335 unsigned long flags;
356 336
357 sctp_spin_lock_irqsave(&head->lock, flags); 337 spin_lock_irqsave(&head->lock, flags);
358 sctp_spin_lock(&list->lock); 338 spin_lock(&list->lock);
359 339
360 skb_queue_splice_tail_init(list, head); 340 skb_queue_splice_tail_init(list, head);
361 341
362 sctp_spin_unlock(&list->lock); 342 spin_unlock(&list->lock);
363 sctp_spin_unlock_irqrestore(&head->lock, flags); 343 spin_unlock_irqrestore(&head->lock, flags);
364} 344}
365 345
366/** 346/**
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 4ef75af340b6..7f4eeb340a54 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -21,9 +21,8 @@
21 * See the GNU General Public License for more details. 21 * See the GNU General Public License for more details.
22 * 22 *
23 * You should have received a copy of the GNU General Public License 23 * You should have received a copy of the GNU General Public License
24 * along with GNU CC; see the file COPYING. If not, write to 24 * along with GNU CC; see the file COPYING. If not, see
25 * the Free Software Foundation, 59 Temple Place - Suite 330, 25 * <http://www.gnu.org/licenses/>.
26 * Boston, MA 02111-1307, USA.
27 * 26 *
28 * Please send any bug reports or fixes you make to the 27 * Please send any bug reports or fixes you make to the
29 * email addresses: 28 * email addresses:
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 0a248b323d87..d992ca3145fe 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -19,9 +19,8 @@
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, see
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * <http://www.gnu.org/licenses/>.
24 * Boston, MA 02111-1307, USA.
25 * 24 *
26 * Please send any bug reports or fixes you make to the 25 * Please send any bug reports or fixes you make to the
27 * email addresses: 26 * email addresses:
@@ -650,7 +649,6 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len,
650 struct iovec *data); 649 struct iovec *data);
651void sctp_chunk_free(struct sctp_chunk *); 650void sctp_chunk_free(struct sctp_chunk *);
652void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); 651void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data);
653void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data);
654struct sctp_chunk *sctp_chunkify(struct sk_buff *, 652struct sctp_chunk *sctp_chunkify(struct sk_buff *,
655 const struct sctp_association *, 653 const struct sctp_association *,
656 struct sock *); 654 struct sock *);
@@ -1358,12 +1356,6 @@ struct sctp_association {
1358 1356
1359 /* This is all information about our peer. */ 1357 /* This is all information about our peer. */
1360 struct { 1358 struct {
1361 /* rwnd
1362 *
1363 * Peer Rwnd : Current calculated value of the peer's rwnd.
1364 */
1365 __u32 rwnd;
1366
1367 /* transport_addr_list 1359 /* transport_addr_list
1368 * 1360 *
1369 * Peer : A list of SCTP transport addresses that the 1361 * Peer : A list of SCTP transport addresses that the
@@ -1381,6 +1373,12 @@ struct sctp_association {
1381 */ 1373 */
1382 struct list_head transport_addr_list; 1374 struct list_head transport_addr_list;
1383 1375
1376 /* rwnd
1377 *
1378 * Peer Rwnd : Current calculated value of the peer's rwnd.
1379 */
1380 __u32 rwnd;
1381
1384 /* transport_count 1382 /* transport_count
1385 * 1383 *
1386 * Peer : A count of the number of peer addresses 1384 * Peer : A count of the number of peer addresses
@@ -1463,6 +1461,20 @@ struct sctp_association {
1463 */ 1461 */
1464 struct sctp_tsnmap tsn_map; 1462 struct sctp_tsnmap tsn_map;
1465 1463
1464 /* This mask is used to disable sending the ASCONF chunk
1465 * with specified parameter to peer.
1466 */
1467 __be16 addip_disabled_mask;
1468
1469 /* These are capabilities which our peer advertised. */
1470 __u8 ecn_capable:1, /* Can peer do ECN? */
1471 ipv4_address:1, /* Peer understands IPv4 addresses? */
1472 ipv6_address:1, /* Peer understands IPv6 addresses? */
1473 hostname_address:1, /* Peer understands DNS addresses? */
1474 asconf_capable:1, /* Does peer support ADDIP? */
1475 prsctp_capable:1, /* Can peer do PR-SCTP? */
1476 auth_capable:1; /* Is peer doing SCTP-AUTH? */
1477
1466 /* Ack State : This flag indicates if the next received 1478 /* Ack State : This flag indicates if the next received
1467 * : packet is to be responded to with a 1479 * : packet is to be responded to with a
1468 * : SACK. This is initializedto 0. When a packet 1480 * : SACK. This is initializedto 0. When a packet
@@ -1477,25 +1489,11 @@ struct sctp_association {
1477 __u32 sack_cnt; 1489 __u32 sack_cnt;
1478 __u32 sack_generation; 1490 __u32 sack_generation;
1479 1491
1480 /* These are capabilities which our peer advertised. */
1481 __u8 ecn_capable:1, /* Can peer do ECN? */
1482 ipv4_address:1, /* Peer understands IPv4 addresses? */
1483 ipv6_address:1, /* Peer understands IPv6 addresses? */
1484 hostname_address:1, /* Peer understands DNS addresses? */
1485 asconf_capable:1, /* Does peer support ADDIP? */
1486 prsctp_capable:1, /* Can peer do PR-SCTP? */
1487 auth_capable:1; /* Is peer doing SCTP-AUTH? */
1488
1489 __u32 adaptation_ind; /* Adaptation Code point. */ 1492 __u32 adaptation_ind; /* Adaptation Code point. */
1490 1493
1491 /* This mask is used to disable sending the ASCONF chunk
1492 * with specified parameter to peer.
1493 */
1494 __be16 addip_disabled_mask;
1495
1496 struct sctp_inithdr_host i; 1494 struct sctp_inithdr_host i;
1497 int cookie_len;
1498 void *cookie; 1495 void *cookie;
1496 int cookie_len;
1499 1497
1500 /* ADDIP Section 4.2 Upon reception of an ASCONF Chunk. 1498 /* ADDIP Section 4.2 Upon reception of an ASCONF Chunk.
1501 * C1) ... "Peer-Serial-Number'. This value MUST be initialized to the 1499 * C1) ... "Peer-Serial-Number'. This value MUST be initialized to the
@@ -1527,14 +1525,14 @@ struct sctp_association {
1527 */ 1525 */
1528 sctp_state_t state; 1526 sctp_state_t state;
1529 1527
1530 /* The cookie life I award for any cookie. */
1531 ktime_t cookie_life;
1532
1533 /* Overall : The overall association error count. 1528 /* Overall : The overall association error count.
1534 * Error Count : [Clear this any time I get something.] 1529 * Error Count : [Clear this any time I get something.]
1535 */ 1530 */
1536 int overall_error_count; 1531 int overall_error_count;
1537 1532
1533 /* The cookie life I award for any cookie. */
1534 ktime_t cookie_life;
1535
1538 /* These are the association's initial, max, and min RTO values. 1536 /* These are the association's initial, max, and min RTO values.
1539 * These values will be initialized by system defaults, but can 1537 * These values will be initialized by system defaults, but can
1540 * be modified via the SCTP_RTOINFO socket option. 1538 * be modified via the SCTP_RTOINFO socket option.
@@ -1589,10 +1587,9 @@ struct sctp_association {
1589 /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ 1587 /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */
1590 __u32 param_flags; 1588 __u32 param_flags;
1591 1589
1590 __u32 sackfreq;
1592 /* SACK delay timeout */ 1591 /* SACK delay timeout */
1593 unsigned long sackdelay; 1592 unsigned long sackdelay;
1594 __u32 sackfreq;
1595
1596 1593
1597 unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES]; 1594 unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES];
1598 struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES]; 1595 struct timer_list timers[SCTP_NUM_TIMEOUT_TYPES];
@@ -1600,12 +1597,12 @@ struct sctp_association {
1600 /* Transport to which SHUTDOWN chunk was last sent. */ 1597 /* Transport to which SHUTDOWN chunk was last sent. */
1601 struct sctp_transport *shutdown_last_sent_to; 1598 struct sctp_transport *shutdown_last_sent_to;
1602 1599
1603 /* How many times have we resent a SHUTDOWN */
1604 int shutdown_retries;
1605
1606 /* Transport to which INIT chunk was last sent. */ 1600 /* Transport to which INIT chunk was last sent. */
1607 struct sctp_transport *init_last_sent_to; 1601 struct sctp_transport *init_last_sent_to;
1608 1602
1603 /* How many times have we resent a SHUTDOWN */
1604 int shutdown_retries;
1605
1609 /* Next TSN : The next TSN number to be assigned to a new 1606 /* Next TSN : The next TSN number to be assigned to a new
1610 * : DATA chunk. This is sent in the INIT or INIT 1607 * : DATA chunk. This is sent in the INIT or INIT
1611 * : ACK chunk to the peer and incremented each 1608 * : ACK chunk to the peer and incremented each
@@ -1810,8 +1807,8 @@ struct sctp_association {
1810 * after reaching 4294967295. 1807 * after reaching 4294967295.
1811 */ 1808 */
1812 __u32 addip_serial; 1809 __u32 addip_serial;
1813 union sctp_addr *asconf_addr_del_pending;
1814 int src_out_of_asoc_ok; 1810 int src_out_of_asoc_ok;
1811 union sctp_addr *asconf_addr_del_pending;
1815 struct sctp_transport *new_transport; 1812 struct sctp_transport *new_transport;
1816 1813
1817 /* SCTP AUTH: list of the endpoint shared keys. These 1814 /* SCTP AUTH: list of the endpoint shared keys. These
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h
index 54bbbe547303..31b8dbaad45a 100644
--- a/include/net/sctp/tsnmap.h
+++ b/include/net/sctp/tsnmap.h
@@ -22,9 +22,8 @@
22 * See the GNU General Public License for more details. 22 * See the GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with GNU CC; see the file COPYING. If not, write to 25 * along with GNU CC; see the file COPYING. If not, see
26 * the Free Software Foundation, 59 Temple Place - Suite 330, 26 * <http://www.gnu.org/licenses/>.
27 * Boston, MA 02111-1307, USA.
28 * 27 *
29 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
30 * email address(es): 29 * email address(es):
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index 27b9f5c90153..daacb32b55b5 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -25,9 +25,8 @@
25 * See the GNU General Public License for more details. 25 * See the GNU General Public License for more details.
26 * 26 *
27 * You should have received a copy of the GNU General Public License 27 * You should have received a copy of the GNU General Public License
28 * along with GNU CC; see the file COPYING. If not, write to 28 * along with GNU CC; see the file COPYING. If not, see
29 * the Free Software Foundation, 59 Temple Place - Suite 330, 29 * <http://www.gnu.org/licenses/>.
30 * Boston, MA 02111-1307, USA.
31 * 30 *
32 * Please send any bug reports or fixes you make to the 31 * Please send any bug reports or fixes you make to the
33 * email address(es): 32 * email address(es):
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index b0cf5d54d717..e0dce07b8794 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -24,9 +24,8 @@
24 * See the GNU General Public License for more details. 24 * See the GNU General Public License for more details.
25 * 25 *
26 * You should have received a copy of the GNU General Public License 26 * You should have received a copy of the GNU General Public License
27 * along with GNU CC; see the file COPYING. If not, write to 27 * along with GNU CC; see the file COPYING. If not, see
28 * the Free Software Foundation, 59 Temple Place - Suite 330, 28 * <http://www.gnu.org/licenses/>.
29 * Boston, MA 02111-1307, USA.
30 * 29 *
31 * Please send any bug reports or fixes you make to the 30 * Please send any bug reports or fixes you make to the
32 * email addresses: 31 * email addresses:
diff --git a/include/net/sock.h b/include/net/sock.h
index 2ef3c3eca47a..5c3f7c3624aa 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -395,7 +395,7 @@ struct sock {
395 unsigned short sk_ack_backlog; 395 unsigned short sk_ack_backlog;
396 unsigned short sk_max_ack_backlog; 396 unsigned short sk_max_ack_backlog;
397 __u32 sk_priority; 397 __u32 sk_priority;
398#if IS_ENABLED(CONFIG_NETPRIO_CGROUP) 398#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
399 __u32 sk_cgrp_prioidx; 399 __u32 sk_cgrp_prioidx;
400#endif 400#endif
401 struct pid *sk_peer_pid; 401 struct pid *sk_peer_pid;
@@ -820,30 +820,44 @@ static inline int sk_backlog_rcv(struct sock *sk, struct sk_buff *skb)
820 return sk->sk_backlog_rcv(sk, skb); 820 return sk->sk_backlog_rcv(sk, skb);
821} 821}
822 822
823static inline void sock_rps_record_flow(const struct sock *sk) 823static inline void sock_rps_record_flow_hash(__u32 hash)
824{ 824{
825#ifdef CONFIG_RPS 825#ifdef CONFIG_RPS
826 struct rps_sock_flow_table *sock_flow_table; 826 struct rps_sock_flow_table *sock_flow_table;
827 827
828 rcu_read_lock(); 828 rcu_read_lock();
829 sock_flow_table = rcu_dereference(rps_sock_flow_table); 829 sock_flow_table = rcu_dereference(rps_sock_flow_table);
830 rps_record_sock_flow(sock_flow_table, sk->sk_rxhash); 830 rps_record_sock_flow(sock_flow_table, hash);
831 rcu_read_unlock(); 831 rcu_read_unlock();
832#endif 832#endif
833} 833}
834 834
835static inline void sock_rps_reset_flow(const struct sock *sk) 835static inline void sock_rps_reset_flow_hash(__u32 hash)
836{ 836{
837#ifdef CONFIG_RPS 837#ifdef CONFIG_RPS
838 struct rps_sock_flow_table *sock_flow_table; 838 struct rps_sock_flow_table *sock_flow_table;
839 839
840 rcu_read_lock(); 840 rcu_read_lock();
841 sock_flow_table = rcu_dereference(rps_sock_flow_table); 841 sock_flow_table = rcu_dereference(rps_sock_flow_table);
842 rps_reset_sock_flow(sock_flow_table, sk->sk_rxhash); 842 rps_reset_sock_flow(sock_flow_table, hash);
843 rcu_read_unlock(); 843 rcu_read_unlock();
844#endif 844#endif
845} 845}
846 846
847static inline void sock_rps_record_flow(const struct sock *sk)
848{
849#ifdef CONFIG_RPS
850 sock_rps_record_flow_hash(sk->sk_rxhash);
851#endif
852}
853
854static inline void sock_rps_reset_flow(const struct sock *sk)
855{
856#ifdef CONFIG_RPS
857 sock_rps_reset_flow_hash(sk->sk_rxhash);
858#endif
859}
860
847static inline void sock_rps_save_rxhash(struct sock *sk, 861static inline void sock_rps_save_rxhash(struct sock *sk,
848 const struct sk_buff *skb) 862 const struct sk_buff *skb)
849{ 863{
@@ -1535,8 +1549,6 @@ struct sock *sk_clone_lock(const struct sock *sk, const gfp_t priority);
1535 1549
1536struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force, 1550struct sk_buff *sock_wmalloc(struct sock *sk, unsigned long size, int force,
1537 gfp_t priority); 1551 gfp_t priority);
1538struct sk_buff *sock_rmalloc(struct sock *sk, unsigned long size, int force,
1539 gfp_t priority);
1540void sock_wfree(struct sk_buff *skb); 1552void sock_wfree(struct sk_buff *skb);
1541void skb_orphan_partial(struct sk_buff *skb); 1553void skb_orphan_partial(struct sk_buff *skb);
1542void sock_rfree(struct sk_buff *skb); 1554void sock_rfree(struct sk_buff *skb);
diff --git a/include/net/tc_act/tc_skbedit.h b/include/net/tc_act/tc_skbedit.h
index e103fe02f375..dd5d86fab030 100644
--- a/include/net/tc_act/tc_skbedit.h
+++ b/include/net/tc_act/tc_skbedit.h
@@ -11,8 +11,7 @@
11 * more details. 11 * more details.
12 * 12 *
13 * You should have received a copy of the GNU General Public License along with 13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple 14 * this program; if not, see <http://www.gnu.org/licenses/>.
15 * Place - Suite 330, Boston, MA 02111-1307 USA.
16 * 15 *
17 * Author: Alexander Duyck <alexander.h.duyck@intel.com> 16 * Author: Alexander Duyck <alexander.h.duyck@intel.com>
18 */ 17 */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 70e55d200610..56fc366da6d5 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -282,6 +282,7 @@ extern int sysctl_tcp_limit_output_bytes;
282extern int sysctl_tcp_challenge_ack_limit; 282extern int sysctl_tcp_challenge_ack_limit;
283extern unsigned int sysctl_tcp_notsent_lowat; 283extern unsigned int sysctl_tcp_notsent_lowat;
284extern int sysctl_tcp_min_tso_segs; 284extern int sysctl_tcp_min_tso_segs;
285extern int sysctl_tcp_autocorking;
285 286
286extern atomic_long_t tcp_memory_allocated; 287extern atomic_long_t tcp_memory_allocated;
287extern struct percpu_counter tcp_sockets_allocated; 288extern struct percpu_counter tcp_sockets_allocated;
@@ -467,7 +468,6 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst,
467 struct tcp_fastopen_cookie *foc); 468 struct tcp_fastopen_cookie *foc);
468int tcp_disconnect(struct sock *sk, int flags); 469int tcp_disconnect(struct sock *sk, int flags);
469 470
470void tcp_connect_init(struct sock *sk);
471void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); 471void tcp_finish_connect(struct sock *sk, struct sk_buff *skb);
472int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size); 472int tcp_send_rcvq(struct sock *sk, struct msghdr *msg, size_t size);
473void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb); 473void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb);
@@ -622,8 +622,6 @@ static inline u32 __tcp_set_rto(const struct tcp_sock *tp)
622 return (tp->srtt >> 3) + tp->rttvar; 622 return (tp->srtt >> 3) + tp->rttvar;
623} 623}
624 624
625void tcp_set_rto(struct sock *sk);
626
627static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) 625static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd)
628{ 626{
629 tp->pred_flags = htonl((tp->tcp_header_len << 26) | 627 tp->pred_flags = htonl((tp->tcp_header_len << 26) |
@@ -977,13 +975,6 @@ static inline u32 tcp_wnd_end(const struct tcp_sock *tp)
977} 975}
978bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight); 976bool tcp_is_cwnd_limited(const struct sock *sk, u32 in_flight);
979 977
980static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss,
981 const struct sk_buff *skb)
982{
983 if (skb->len < mss)
984 tp->snd_sml = TCP_SKB_CB(skb)->end_seq;
985}
986
987static inline void tcp_check_probe_timer(struct sock *sk) 978static inline void tcp_check_probe_timer(struct sock *sk)
988{ 979{
989 const struct tcp_sock *tp = tcp_sk(sk); 980 const struct tcp_sock *tp = tcp_sk(sk);
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 48660e50ae90..b927413dde86 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -32,8 +32,13 @@ void tcpv6_exit(void);
32 32
33int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); 33int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
34 34
35int ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg, 35/* this does all the common and the specific ctl work */
36 struct sk_buff *skb); 36void ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
37 struct sk_buff *skb);
38void ip6_datagram_recv_common_ctl(struct sock *sk, struct msghdr *msg,
39 struct sk_buff *skb);
40void ip6_datagram_recv_specific_ctl(struct sock *sk, struct msghdr *msg,
41 struct sk_buff *skb);
37 42
38int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg, 43int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg,
39 struct flowi6 *fl6, struct ipv6_txoptions *opt, 44 struct flowi6 *fl6, struct ipv6_txoptions *opt,
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
index 6b6d180fb91a..5deef1ae78c9 100644
--- a/include/net/vxlan.h
+++ b/include/net/vxlan.h
@@ -21,6 +21,7 @@ struct vxlan_sock {
21 struct rcu_head rcu; 21 struct rcu_head rcu;
22 struct hlist_head vni_list[VNI_HASH_SIZE]; 22 struct hlist_head vni_list[VNI_HASH_SIZE];
23 atomic_t refcnt; 23 atomic_t refcnt;
24 struct udp_offload udp_offloads;
24}; 25};
25 26
26struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port, 27struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 6b82fdf4ba71..afa5730fb3bd 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -53,7 +53,6 @@
53#define XFRM_INC_STATS_USER(net, field) ((void)(net)) 53#define XFRM_INC_STATS_USER(net, field) ((void)(net))
54#endif 54#endif
55 55
56extern struct mutex xfrm_cfg_mutex;
57 56
58/* Organization of SPD aka "XFRM rules" 57/* Organization of SPD aka "XFRM rules"
59 ------------------------------------ 58 ------------------------------------
@@ -681,7 +680,7 @@ struct xfrm_spi_skb_cb {
681struct xfrm_audit { 680struct xfrm_audit {
682 u32 secid; 681 u32 secid;
683 kuid_t loginuid; 682 kuid_t loginuid;
684 u32 sessionid; 683 unsigned int sessionid;
685}; 684};
686 685
687#ifdef CONFIG_AUDITSYSCALL 686#ifdef CONFIG_AUDITSYSCALL
@@ -699,7 +698,7 @@ static inline struct audit_buffer *xfrm_audit_start(const char *op)
699 return audit_buf; 698 return audit_buf;
700} 699}
701 700
702static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid, 701static inline void xfrm_audit_helper_usrinfo(kuid_t auid, unsigned int ses, u32 secid,
703 struct audit_buffer *audit_buf) 702 struct audit_buffer *audit_buf)
704{ 703{
705 char *secctx; 704 char *secctx;
@@ -716,13 +715,13 @@ static inline void xfrm_audit_helper_usrinfo(kuid_t auid, u32 ses, u32 secid,
716} 715}
717 716
718void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid, 717void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, kuid_t auid,
719 u32 ses, u32 secid); 718 unsigned int ses, u32 secid);
720void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid, 719void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, kuid_t auid,
721 u32 ses, u32 secid); 720 unsigned int ses, u32 secid);
722void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid, 721void xfrm_audit_state_add(struct xfrm_state *x, int result, kuid_t auid,
723 u32 ses, u32 secid); 722 unsigned int ses, u32 secid);
724void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid, 723void xfrm_audit_state_delete(struct xfrm_state *x, int result, kuid_t auid,
725 u32 ses, u32 secid); 724 unsigned int ses, u32 secid);
726void xfrm_audit_state_replay_overflow(struct xfrm_state *x, 725void xfrm_audit_state_replay_overflow(struct xfrm_state *x,
727 struct sk_buff *skb); 726 struct sk_buff *skb);
728void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb, 727void xfrm_audit_state_replay(struct xfrm_state *x, struct sk_buff *skb,
@@ -735,22 +734,22 @@ void xfrm_audit_state_icvfail(struct xfrm_state *x, struct sk_buff *skb,
735#else 734#else
736 735
737static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result, 736static inline void xfrm_audit_policy_add(struct xfrm_policy *xp, int result,
738 kuid_t auid, u32 ses, u32 secid) 737 kuid_t auid, unsigned int ses, u32 secid)
739{ 738{
740} 739}
741 740
742static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, 741static inline void xfrm_audit_policy_delete(struct xfrm_policy *xp, int result,
743 kuid_t auid, u32 ses, u32 secid) 742 kuid_t auid, unsigned int ses, u32 secid)
744{ 743{
745} 744}
746 745
747static inline void xfrm_audit_state_add(struct xfrm_state *x, int result, 746static inline void xfrm_audit_state_add(struct xfrm_state *x, int result,
748 kuid_t auid, u32 ses, u32 secid) 747 kuid_t auid, unsigned int ses, u32 secid)
749{ 748{
750} 749}
751 750
752static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result, 751static inline void xfrm_audit_state_delete(struct xfrm_state *x, int result,
753 kuid_t auid, u32 ses, u32 secid) 752 kuid_t auid, unsigned int ses, u32 secid)
754{ 753{
755} 754}
756 755
@@ -1409,7 +1408,7 @@ static inline void xfrm_sysctl_fini(struct net *net)
1409void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto); 1408void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto);
1410int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk, 1409int xfrm_state_walk(struct net *net, struct xfrm_state_walk *walk,
1411 int (*func)(struct xfrm_state *, int, void*), void *); 1410 int (*func)(struct xfrm_state *, int, void*), void *);
1412void xfrm_state_walk_done(struct xfrm_state_walk *walk); 1411void xfrm_state_walk_done(struct xfrm_state_walk *walk, struct net *net);
1413struct xfrm_state *xfrm_state_alloc(struct net *net); 1412struct xfrm_state *xfrm_state_alloc(struct net *net);
1414struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr, 1413struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr,
1415 const xfrm_address_t *saddr, 1414 const xfrm_address_t *saddr,
@@ -1422,6 +1421,8 @@ struct xfrm_state *xfrm_stateonly_find(struct net *net, u32 mark,
1422 xfrm_address_t *saddr, 1421 xfrm_address_t *saddr,
1423 unsigned short family, 1422 unsigned short family,
1424 u8 mode, u8 proto, u32 reqid); 1423 u8 mode, u8 proto, u32 reqid);
1424struct xfrm_state *xfrm_state_lookup_byspi(struct net *net, __be32 spi,
1425 unsigned short family);
1425int xfrm_state_check_expire(struct xfrm_state *x); 1426int xfrm_state_check_expire(struct xfrm_state *x);
1426void xfrm_state_insert(struct xfrm_state *x); 1427void xfrm_state_insert(struct xfrm_state *x);
1427int xfrm_state_add(struct xfrm_state *x); 1428int xfrm_state_add(struct xfrm_state *x);
@@ -1436,12 +1437,12 @@ struct xfrm_state *xfrm_state_lookup_byaddr(struct net *net, u32 mark,
1436 unsigned short family); 1437 unsigned short family);
1437#ifdef CONFIG_XFRM_SUB_POLICY 1438#ifdef CONFIG_XFRM_SUB_POLICY
1438int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n, 1439int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, int n,
1439 unsigned short family); 1440 unsigned short family, struct net *net);
1440int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n, 1441int xfrm_state_sort(struct xfrm_state **dst, struct xfrm_state **src, int n,
1441 unsigned short family); 1442 unsigned short family);
1442#else 1443#else
1443static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src, 1444static inline int xfrm_tmpl_sort(struct xfrm_tmpl **dst, struct xfrm_tmpl **src,
1444 int n, unsigned short family) 1445 int n, unsigned short family, struct net *net)
1445{ 1446{
1446 return -ENOSYS; 1447 return -ENOSYS;
1447} 1448}
@@ -1553,7 +1554,7 @@ void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type);
1553int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk, 1554int xfrm_policy_walk(struct net *net, struct xfrm_policy_walk *walk,
1554 int (*func)(struct xfrm_policy *, int, int, void*), 1555 int (*func)(struct xfrm_policy *, int, int, void*),
1555 void *); 1556 void *);
1556void xfrm_policy_walk_done(struct xfrm_policy_walk *walk); 1557void xfrm_policy_walk_done(struct xfrm_policy_walk *walk, struct net *net);
1557int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); 1558int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
1558struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark, 1559struct xfrm_policy *xfrm_policy_bysel_ctx(struct net *net, u32 mark,
1559 u8 type, int dir, 1560 u8 type, int dir,
@@ -1564,6 +1565,7 @@ struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir,
1564 u32 id, int delete, int *err); 1565 u32 id, int delete, int *err);
1565int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); 1566int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info);
1566u32 xfrm_get_acqseq(void); 1567u32 xfrm_get_acqseq(void);
1568int verify_spi_info(u8 proto, u32 min, u32 max);
1567int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 1569int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
1568struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark, 1570struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark,
1569 u8 mode, u32 reqid, u8 proto, 1571 u8 mode, u32 reqid, u8 proto,
@@ -1576,12 +1578,12 @@ int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol);
1576int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, 1578int km_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
1577 const struct xfrm_migrate *m, int num_bundles, 1579 const struct xfrm_migrate *m, int num_bundles,
1578 const struct xfrm_kmaddress *k); 1580 const struct xfrm_kmaddress *k);
1579struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m); 1581struct xfrm_state *xfrm_migrate_state_find(struct xfrm_migrate *m, struct net *net);
1580struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x, 1582struct xfrm_state *xfrm_state_migrate(struct xfrm_state *x,
1581 struct xfrm_migrate *m); 1583 struct xfrm_migrate *m);
1582int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type, 1584int xfrm_migrate(const struct xfrm_selector *sel, u8 dir, u8 type,
1583 struct xfrm_migrate *m, int num_bundles, 1585 struct xfrm_migrate *m, int num_bundles,
1584 struct xfrm_kmaddress *k); 1586 struct xfrm_kmaddress *k, struct net *net);
1585#endif 1587#endif
1586 1588
1587int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport); 1589int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index f3ac0f2c4c66..ce55906b54a0 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -38,10 +38,15 @@
38#include <linux/in6.h> 38#include <linux/in6.h>
39#include <linux/if_arp.h> 39#include <linux/if_arp.h>
40#include <linux/netdevice.h> 40#include <linux/netdevice.h>
41#include <linux/inetdevice.h>
41#include <linux/socket.h> 42#include <linux/socket.h>
42#include <linux/if_vlan.h> 43#include <linux/if_vlan.h>
44#include <net/ipv6.h>
45#include <net/if_inet6.h>
46#include <net/ip.h>
43#include <rdma/ib_verbs.h> 47#include <rdma/ib_verbs.h>
44#include <rdma/ib_pack.h> 48#include <rdma/ib_pack.h>
49#include <net/ipv6.h>
45 50
46struct rdma_addr_client { 51struct rdma_addr_client {
47 atomic_t refcount; 52 atomic_t refcount;
@@ -72,7 +77,8 @@ struct rdma_dev_addr {
72 * rdma_translate_ip - Translate a local IP address to an RDMA hardware 77 * rdma_translate_ip - Translate a local IP address to an RDMA hardware
73 * address. 78 * address.
74 */ 79 */
75int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr); 80int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr,
81 u16 *vlan_id);
76 82
77/** 83/**
78 * rdma_resolve_ip - Resolve source and destination IP addresses to 84 * rdma_resolve_ip - Resolve source and destination IP addresses to
@@ -104,6 +110,10 @@ int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
104 110
105int rdma_addr_size(struct sockaddr *addr); 111int rdma_addr_size(struct sockaddr *addr);
106 112
113int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id);
114int rdma_addr_find_dmac_by_grh(union ib_gid *sgid, union ib_gid *dgid, u8 *smac,
115 u16 *vlan_id);
116
107static inline u16 ib_addr_get_pkey(struct rdma_dev_addr *dev_addr) 117static inline u16 ib_addr_get_pkey(struct rdma_dev_addr *dev_addr)
108{ 118{
109 return ((u16)dev_addr->broadcast[8] << 8) | (u16)dev_addr->broadcast[9]; 119 return ((u16)dev_addr->broadcast[8] << 8) | (u16)dev_addr->broadcast[9];
@@ -126,41 +136,60 @@ static inline int rdma_addr_gid_offset(struct rdma_dev_addr *dev_addr)
126 return dev_addr->dev_type == ARPHRD_INFINIBAND ? 4 : 0; 136 return dev_addr->dev_type == ARPHRD_INFINIBAND ? 4 : 0;
127} 137}
128 138
129static inline void iboe_mac_vlan_to_ll(union ib_gid *gid, u8 *mac, u16 vid) 139static inline u16 rdma_vlan_dev_vlan_id(const struct net_device *dev)
130{ 140{
131 memset(gid->raw, 0, 16); 141 return dev->priv_flags & IFF_802_1Q_VLAN ?
132 *((__be32 *) gid->raw) = cpu_to_be32(0xfe800000); 142 vlan_dev_vlan_id(dev) : 0xffff;
133 if (vid < 0x1000) { 143}
134 gid->raw[12] = vid & 0xff; 144
135 gid->raw[11] = vid >> 8; 145static inline int rdma_ip2gid(struct sockaddr *addr, union ib_gid *gid)
136 } else { 146{
137 gid->raw[12] = 0xfe; 147 switch (addr->sa_family) {
138 gid->raw[11] = 0xff; 148 case AF_INET:
149 ipv6_addr_set_v4mapped(((struct sockaddr_in *)
150 addr)->sin_addr.s_addr,
151 (struct in6_addr *)gid);
152 break;
153 case AF_INET6:
154 memcpy(gid->raw, &((struct sockaddr_in6 *)addr)->sin6_addr, 16);
155 break;
156 default:
157 return -EINVAL;
139 } 158 }
140 memcpy(gid->raw + 13, mac + 3, 3); 159 return 0;
141 memcpy(gid->raw + 8, mac, 3);
142 gid->raw[8] ^= 2;
143} 160}
144 161
145static inline u16 rdma_vlan_dev_vlan_id(const struct net_device *dev) 162/* Important - sockaddr should be a union of sockaddr_in and sockaddr_in6 */
163static inline int rdma_gid2ip(struct sockaddr *out, union ib_gid *gid)
146{ 164{
147 return dev->priv_flags & IFF_802_1Q_VLAN ? 165 if (ipv6_addr_v4mapped((struct in6_addr *)gid)) {
148 vlan_dev_vlan_id(dev) : 0xffff; 166 struct sockaddr_in *out_in = (struct sockaddr_in *)out;
167 memset(out_in, 0, sizeof(*out_in));
168 out_in->sin_family = AF_INET;
169 memcpy(&out_in->sin_addr.s_addr, gid->raw + 12, 4);
170 } else {
171 struct sockaddr_in6 *out_in = (struct sockaddr_in6 *)out;
172 memset(out_in, 0, sizeof(*out_in));
173 out_in->sin6_family = AF_INET6;
174 memcpy(&out_in->sin6_addr.s6_addr, gid->raw, 16);
175 }
176 return 0;
149} 177}
150 178
151static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr, 179static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr,
152 union ib_gid *gid) 180 union ib_gid *gid)
153{ 181{
154 struct net_device *dev; 182 struct net_device *dev;
155 u16 vid = 0xffff; 183 struct in_device *ip4;
156 184
157 dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if); 185 dev = dev_get_by_index(&init_net, dev_addr->bound_dev_if);
158 if (dev) { 186 if (dev) {
159 vid = rdma_vlan_dev_vlan_id(dev); 187 ip4 = (struct in_device *)dev->ip_ptr;
188 if (ip4 && ip4->ifa_list && ip4->ifa_list->ifa_address)
189 ipv6_addr_set_v4mapped(ip4->ifa_list->ifa_address,
190 (struct in6_addr *)gid);
160 dev_put(dev); 191 dev_put(dev);
161 } 192 }
162
163 iboe_mac_vlan_to_ll(gid, dev_addr->src_dev_addr, vid);
164} 193}
165 194
166static inline void rdma_addr_get_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid) 195static inline void rdma_addr_get_sgid(struct rdma_dev_addr *dev_addr, union ib_gid *gid)
diff --git a/include/rdma/ib_cm.h b/include/rdma/ib_cm.h
index 0e3ff30647d5..f29e3a27c2cc 100644
--- a/include/rdma/ib_cm.h
+++ b/include/rdma/ib_cm.h
@@ -601,4 +601,5 @@ struct ib_cm_sidr_rep_param {
601int ib_send_cm_sidr_rep(struct ib_cm_id *cm_id, 601int ib_send_cm_sidr_rep(struct ib_cm_id *cm_id,
602 struct ib_cm_sidr_rep_param *param); 602 struct ib_cm_sidr_rep_param *param);
603 603
604int ib_update_cm_av(struct ib_cm_id *id, const u8 *smac, const u8 *alt_smac);
604#endif /* IB_CM_H */ 605#endif /* IB_CM_H */
diff --git a/include/rdma/ib_pack.h b/include/rdma/ib_pack.h
index b37fe3b10a9d..b1f7592e02e4 100644
--- a/include/rdma/ib_pack.h
+++ b/include/rdma/ib_pack.h
@@ -34,6 +34,7 @@
34#define IB_PACK_H 34#define IB_PACK_H
35 35
36#include <rdma/ib_verbs.h> 36#include <rdma/ib_verbs.h>
37#include <uapi/linux/if_ether.h>
37 38
38enum { 39enum {
39 IB_LRH_BYTES = 8, 40 IB_LRH_BYTES = 8,
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h
index 125f8714301d..7e071a6abb34 100644
--- a/include/rdma/ib_sa.h
+++ b/include/rdma/ib_sa.h
@@ -154,6 +154,9 @@ struct ib_sa_path_rec {
154 u8 packet_life_time_selector; 154 u8 packet_life_time_selector;
155 u8 packet_life_time; 155 u8 packet_life_time;
156 u8 preference; 156 u8 preference;
157 u8 smac[ETH_ALEN];
158 u8 dmac[ETH_ALEN];
159 u16 vlan_id;
157}; 160};
158 161
159#define IB_SA_MCMEMBER_REC_MGID IB_SA_COMP_MASK( 0) 162#define IB_SA_MCMEMBER_REC_MGID IB_SA_COMP_MASK( 0)
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 61e1935c91b1..8d4a1c06f7e4 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -48,6 +48,7 @@
48#include <linux/rwsem.h> 48#include <linux/rwsem.h>
49#include <linux/scatterlist.h> 49#include <linux/scatterlist.h>
50#include <linux/workqueue.h> 50#include <linux/workqueue.h>
51#include <uapi/linux/if_ether.h>
51 52
52#include <linux/atomic.h> 53#include <linux/atomic.h>
53#include <asm/uaccess.h> 54#include <asm/uaccess.h>
@@ -69,12 +70,14 @@ enum rdma_node_type {
69 RDMA_NODE_IB_ROUTER, 70 RDMA_NODE_IB_ROUTER,
70 RDMA_NODE_RNIC, 71 RDMA_NODE_RNIC,
71 RDMA_NODE_USNIC, 72 RDMA_NODE_USNIC,
73 RDMA_NODE_USNIC_UDP,
72}; 74};
73 75
74enum rdma_transport_type { 76enum rdma_transport_type {
75 RDMA_TRANSPORT_IB, 77 RDMA_TRANSPORT_IB,
76 RDMA_TRANSPORT_IWARP, 78 RDMA_TRANSPORT_IWARP,
77 RDMA_TRANSPORT_USNIC 79 RDMA_TRANSPORT_USNIC,
80 RDMA_TRANSPORT_USNIC_UDP
78}; 81};
79 82
80enum rdma_transport_type 83enum rdma_transport_type
@@ -472,6 +475,8 @@ struct ib_ah_attr {
472 u8 static_rate; 475 u8 static_rate;
473 u8 ah_flags; 476 u8 ah_flags;
474 u8 port_num; 477 u8 port_num;
478 u8 dmac[ETH_ALEN];
479 u16 vlan_id;
475}; 480};
476 481
477enum ib_wc_status { 482enum ib_wc_status {
@@ -524,6 +529,8 @@ enum ib_wc_flags {
524 IB_WC_WITH_IMM = (1<<1), 529 IB_WC_WITH_IMM = (1<<1),
525 IB_WC_WITH_INVALIDATE = (1<<2), 530 IB_WC_WITH_INVALIDATE = (1<<2),
526 IB_WC_IP_CSUM_OK = (1<<3), 531 IB_WC_IP_CSUM_OK = (1<<3),
532 IB_WC_WITH_SMAC = (1<<4),
533 IB_WC_WITH_VLAN = (1<<5),
527}; 534};
528 535
529struct ib_wc { 536struct ib_wc {
@@ -544,6 +551,8 @@ struct ib_wc {
544 u8 sl; 551 u8 sl;
545 u8 dlid_path_bits; 552 u8 dlid_path_bits;
546 u8 port_num; /* valid only for DR SMPs on switches */ 553 u8 port_num; /* valid only for DR SMPs on switches */
554 u8 smac[ETH_ALEN];
555 u16 vlan_id;
547}; 556};
548 557
549enum ib_cq_notify_flags { 558enum ib_cq_notify_flags {
@@ -633,6 +642,7 @@ enum ib_qp_type {
633enum ib_qp_create_flags { 642enum ib_qp_create_flags {
634 IB_QP_CREATE_IPOIB_UD_LSO = 1 << 0, 643 IB_QP_CREATE_IPOIB_UD_LSO = 1 << 0,
635 IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK = 1 << 1, 644 IB_QP_CREATE_BLOCK_MULTICAST_LOOPBACK = 1 << 1,
645 IB_QP_CREATE_NETIF_QP = 1 << 5,
636 /* reserve bits 26-31 for low level drivers' internal use */ 646 /* reserve bits 26-31 for low level drivers' internal use */
637 IB_QP_CREATE_RESERVED_START = 1 << 26, 647 IB_QP_CREATE_RESERVED_START = 1 << 26,
638 IB_QP_CREATE_RESERVED_END = 1 << 31, 648 IB_QP_CREATE_RESERVED_END = 1 << 31,
@@ -721,7 +731,11 @@ enum ib_qp_attr_mask {
721 IB_QP_MAX_DEST_RD_ATOMIC = (1<<17), 731 IB_QP_MAX_DEST_RD_ATOMIC = (1<<17),
722 IB_QP_PATH_MIG_STATE = (1<<18), 732 IB_QP_PATH_MIG_STATE = (1<<18),
723 IB_QP_CAP = (1<<19), 733 IB_QP_CAP = (1<<19),
724 IB_QP_DEST_QPN = (1<<20) 734 IB_QP_DEST_QPN = (1<<20),
735 IB_QP_SMAC = (1<<21),
736 IB_QP_ALT_SMAC = (1<<22),
737 IB_QP_VID = (1<<23),
738 IB_QP_ALT_VID = (1<<24),
725}; 739};
726 740
727enum ib_qp_state { 741enum ib_qp_state {
@@ -771,6 +785,10 @@ struct ib_qp_attr {
771 u8 rnr_retry; 785 u8 rnr_retry;
772 u8 alt_port_num; 786 u8 alt_port_num;
773 u8 alt_timeout; 787 u8 alt_timeout;
788 u8 smac[ETH_ALEN];
789 u8 alt_smac[ETH_ALEN];
790 u16 vlan_id;
791 u16 alt_vlan_id;
774}; 792};
775 793
776enum ib_wr_opcode { 794enum ib_wr_opcode {
@@ -1099,13 +1117,14 @@ enum ib_flow_attr_type {
1099enum ib_flow_spec_type { 1117enum ib_flow_spec_type {
1100 /* L2 headers*/ 1118 /* L2 headers*/
1101 IB_FLOW_SPEC_ETH = 0x20, 1119 IB_FLOW_SPEC_ETH = 0x20,
1120 IB_FLOW_SPEC_IB = 0x22,
1102 /* L3 header*/ 1121 /* L3 header*/
1103 IB_FLOW_SPEC_IPV4 = 0x30, 1122 IB_FLOW_SPEC_IPV4 = 0x30,
1104 /* L4 headers*/ 1123 /* L4 headers*/
1105 IB_FLOW_SPEC_TCP = 0x40, 1124 IB_FLOW_SPEC_TCP = 0x40,
1106 IB_FLOW_SPEC_UDP = 0x41 1125 IB_FLOW_SPEC_UDP = 0x41
1107}; 1126};
1108 1127#define IB_FLOW_SPEC_LAYER_MASK 0xF0
1109#define IB_FLOW_SPEC_SUPPORT_LAYERS 4 1128#define IB_FLOW_SPEC_SUPPORT_LAYERS 4
1110 1129
1111/* Flow steering rule priority is set according to it's domain. 1130/* Flow steering rule priority is set according to it's domain.
@@ -1133,6 +1152,18 @@ struct ib_flow_spec_eth {
1133 struct ib_flow_eth_filter mask; 1152 struct ib_flow_eth_filter mask;
1134}; 1153};
1135 1154
1155struct ib_flow_ib_filter {
1156 __be16 dlid;
1157 __u8 sl;
1158};
1159
1160struct ib_flow_spec_ib {
1161 enum ib_flow_spec_type type;
1162 u16 size;
1163 struct ib_flow_ib_filter val;
1164 struct ib_flow_ib_filter mask;
1165};
1166
1136struct ib_flow_ipv4_filter { 1167struct ib_flow_ipv4_filter {
1137 __be32 src_ip; 1168 __be32 src_ip;
1138 __be32 dst_ip; 1169 __be32 dst_ip;
@@ -1163,6 +1194,7 @@ union ib_flow_spec {
1163 u16 size; 1194 u16 size;
1164 }; 1195 };
1165 struct ib_flow_spec_eth eth; 1196 struct ib_flow_spec_eth eth;
1197 struct ib_flow_spec_ib ib;
1166 struct ib_flow_spec_ipv4 ipv4; 1198 struct ib_flow_spec_ipv4 ipv4;
1167 struct ib_flow_spec_tcp_udp tcp_udp; 1199 struct ib_flow_spec_tcp_udp tcp_udp;
1168}; 1200};
@@ -1488,6 +1520,7 @@ static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len
1488 * @next_state: Next QP state 1520 * @next_state: Next QP state
1489 * @type: QP type 1521 * @type: QP type
1490 * @mask: Mask of supplied QP attributes 1522 * @mask: Mask of supplied QP attributes
1523 * @ll : link layer of port
1491 * 1524 *
1492 * This function is a helper function that a low-level driver's 1525 * This function is a helper function that a low-level driver's
1493 * modify_qp method can use to validate the consumer's input. It 1526 * modify_qp method can use to validate the consumer's input. It
@@ -1496,7 +1529,8 @@ static inline int ib_copy_to_udata(struct ib_udata *udata, void *src, size_t len
1496 * and that the attribute mask supplied is allowed for the transition. 1529 * and that the attribute mask supplied is allowed for the transition.
1497 */ 1530 */
1498int ib_modify_qp_is_ok(enum ib_qp_state cur_state, enum ib_qp_state next_state, 1531int ib_modify_qp_is_ok(enum ib_qp_state cur_state, enum ib_qp_state next_state,
1499 enum ib_qp_type type, enum ib_qp_attr_mask mask); 1532 enum ib_qp_type type, enum ib_qp_attr_mask mask,
1533 enum rdma_link_layer ll);
1500 1534
1501int ib_register_event_handler (struct ib_event_handler *event_handler); 1535int ib_register_event_handler (struct ib_event_handler *event_handler);
1502int ib_unregister_event_handler(struct ib_event_handler *event_handler); 1536int ib_unregister_event_handler(struct ib_event_handler *event_handler);
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 5d6ed6cf12cc..fd0421c6d40a 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -70,6 +70,7 @@ enum iscsi_uevent_e {
70 ISCSI_UEVENT_LOGOUT_FLASHNODE = UEVENT_BASE + 29, 70 ISCSI_UEVENT_LOGOUT_FLASHNODE = UEVENT_BASE + 29,
71 ISCSI_UEVENT_LOGOUT_FLASHNODE_SID = UEVENT_BASE + 30, 71 ISCSI_UEVENT_LOGOUT_FLASHNODE_SID = UEVENT_BASE + 30,
72 ISCSI_UEVENT_SET_CHAP = UEVENT_BASE + 31, 72 ISCSI_UEVENT_SET_CHAP = UEVENT_BASE + 31,
73 ISCSI_UEVENT_GET_HOST_STATS = UEVENT_BASE + 32,
73 74
74 /* up events */ 75 /* up events */
75 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1, 76 ISCSI_KEVENT_RECV_PDU = KEVENT_BASE + 1,
@@ -242,6 +243,9 @@ struct iscsi_uevent {
242 uint32_t host_no; 243 uint32_t host_no;
243 uint32_t sid; 244 uint32_t sid;
244 } logout_flashnode_sid; 245 } logout_flashnode_sid;
246 struct msg_get_host_stats {
247 uint32_t host_no;
248 } get_host_stats;
245 } u; 249 } u;
246 union { 250 union {
247 /* messages k -> u */ 251 /* messages k -> u */
@@ -311,6 +315,7 @@ enum iscsi_param_type {
311 ISCSI_NET_PARAM, /* iscsi_net_param */ 315 ISCSI_NET_PARAM, /* iscsi_net_param */
312 ISCSI_FLASHNODE_PARAM, /* iscsi_flashnode_param */ 316 ISCSI_FLASHNODE_PARAM, /* iscsi_flashnode_param */
313 ISCSI_CHAP_PARAM, /* iscsi_chap_param */ 317 ISCSI_CHAP_PARAM, /* iscsi_chap_param */
318 ISCSI_IFACE_PARAM, /* iscsi_iface_param */
314}; 319};
315 320
316/* structure for minimalist usecase */ 321/* structure for minimalist usecase */
@@ -383,28 +388,106 @@ struct iscsi_path {
383#define ISCSI_VLAN_DISABLE 0x01 388#define ISCSI_VLAN_DISABLE 0x01
384#define ISCSI_VLAN_ENABLE 0x02 389#define ISCSI_VLAN_ENABLE 0x02
385 390
391/* iscsi generic enable/disabled setting for various features */
392#define ISCSI_NET_PARAM_DISABLE 0x01
393#define ISCSI_NET_PARAM_ENABLE 0x02
394
386/* iSCSI network params */ 395/* iSCSI network params */
387enum iscsi_net_param { 396enum iscsi_net_param {
388 ISCSI_NET_PARAM_IPV4_ADDR = 1, 397 ISCSI_NET_PARAM_IPV4_ADDR = 1,
389 ISCSI_NET_PARAM_IPV4_SUBNET = 2, 398 ISCSI_NET_PARAM_IPV4_SUBNET,
390 ISCSI_NET_PARAM_IPV4_GW = 3, 399 ISCSI_NET_PARAM_IPV4_GW,
391 ISCSI_NET_PARAM_IPV4_BOOTPROTO = 4, 400 ISCSI_NET_PARAM_IPV4_BOOTPROTO,
392 ISCSI_NET_PARAM_MAC = 5, 401 ISCSI_NET_PARAM_MAC,
393 ISCSI_NET_PARAM_IPV6_LINKLOCAL = 6, 402 ISCSI_NET_PARAM_IPV6_LINKLOCAL,
394 ISCSI_NET_PARAM_IPV6_ADDR = 7, 403 ISCSI_NET_PARAM_IPV6_ADDR,
395 ISCSI_NET_PARAM_IPV6_ROUTER = 8, 404 ISCSI_NET_PARAM_IPV6_ROUTER,
396 ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG = 9, 405 ISCSI_NET_PARAM_IPV6_ADDR_AUTOCFG,
397 ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG = 10, 406 ISCSI_NET_PARAM_IPV6_LINKLOCAL_AUTOCFG,
398 ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG = 11, 407 ISCSI_NET_PARAM_IPV6_ROUTER_AUTOCFG,
399 ISCSI_NET_PARAM_IFACE_ENABLE = 12, 408 ISCSI_NET_PARAM_IFACE_ENABLE,
400 ISCSI_NET_PARAM_VLAN_ID = 13, 409 ISCSI_NET_PARAM_VLAN_ID,
401 ISCSI_NET_PARAM_VLAN_PRIORITY = 14, 410 ISCSI_NET_PARAM_VLAN_PRIORITY,
402 ISCSI_NET_PARAM_VLAN_ENABLED = 15, 411 ISCSI_NET_PARAM_VLAN_ENABLED,
403 ISCSI_NET_PARAM_VLAN_TAG = 16, 412 ISCSI_NET_PARAM_VLAN_TAG,
404 ISCSI_NET_PARAM_IFACE_TYPE = 17, 413 ISCSI_NET_PARAM_IFACE_TYPE,
405 ISCSI_NET_PARAM_IFACE_NAME = 18, 414 ISCSI_NET_PARAM_IFACE_NAME,
406 ISCSI_NET_PARAM_MTU = 19, 415 ISCSI_NET_PARAM_MTU,
407 ISCSI_NET_PARAM_PORT = 20, 416 ISCSI_NET_PARAM_PORT,
417 ISCSI_NET_PARAM_IPADDR_STATE,
418 ISCSI_NET_PARAM_IPV6_LINKLOCAL_STATE,
419 ISCSI_NET_PARAM_IPV6_ROUTER_STATE,
420 ISCSI_NET_PARAM_DELAYED_ACK_EN,
421 ISCSI_NET_PARAM_TCP_NAGLE_DISABLE,
422 ISCSI_NET_PARAM_TCP_WSF_DISABLE,
423 ISCSI_NET_PARAM_TCP_WSF,
424 ISCSI_NET_PARAM_TCP_TIMER_SCALE,
425 ISCSI_NET_PARAM_TCP_TIMESTAMP_EN,
426 ISCSI_NET_PARAM_CACHE_ID,
427 ISCSI_NET_PARAM_IPV4_DHCP_DNS_ADDR_EN,
428 ISCSI_NET_PARAM_IPV4_DHCP_SLP_DA_EN,
429 ISCSI_NET_PARAM_IPV4_TOS_EN,
430 ISCSI_NET_PARAM_IPV4_TOS,
431 ISCSI_NET_PARAM_IPV4_GRAT_ARP_EN,
432 ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID_EN,
433 ISCSI_NET_PARAM_IPV4_DHCP_ALT_CLIENT_ID,
434 ISCSI_NET_PARAM_IPV4_DHCP_REQ_VENDOR_ID_EN,
435 ISCSI_NET_PARAM_IPV4_DHCP_USE_VENDOR_ID_EN,
436 ISCSI_NET_PARAM_IPV4_DHCP_VENDOR_ID,
437 ISCSI_NET_PARAM_IPV4_DHCP_LEARN_IQN_EN,
438 ISCSI_NET_PARAM_IPV4_FRAGMENT_DISABLE,
439 ISCSI_NET_PARAM_IPV4_IN_FORWARD_EN,
440 ISCSI_NET_PARAM_IPV4_TTL,
441 ISCSI_NET_PARAM_IPV6_GRAT_NEIGHBOR_ADV_EN,
442 ISCSI_NET_PARAM_IPV6_MLD_EN,
443 ISCSI_NET_PARAM_IPV6_FLOW_LABEL,
444 ISCSI_NET_PARAM_IPV6_TRAFFIC_CLASS,
445 ISCSI_NET_PARAM_IPV6_HOP_LIMIT,
446 ISCSI_NET_PARAM_IPV6_ND_REACHABLE_TMO,
447 ISCSI_NET_PARAM_IPV6_ND_REXMIT_TIME,
448 ISCSI_NET_PARAM_IPV6_ND_STALE_TMO,
449 ISCSI_NET_PARAM_IPV6_DUP_ADDR_DETECT_CNT,
450 ISCSI_NET_PARAM_IPV6_RTR_ADV_LINK_MTU,
451 ISCSI_NET_PARAM_REDIRECT_EN,
452};
453
454enum iscsi_ipaddress_state {
455 ISCSI_IPDDRESS_STATE_UNCONFIGURED,
456 ISCSI_IPDDRESS_STATE_ACQUIRING,
457 ISCSI_IPDDRESS_STATE_TENTATIVE,
458 ISCSI_IPDDRESS_STATE_VALID,
459 ISCSI_IPDDRESS_STATE_DISABLING,
460 ISCSI_IPDDRESS_STATE_INVALID,
461 ISCSI_IPDDRESS_STATE_DEPRECATED,
462};
463
464enum iscsi_router_state {
465 ISCSI_ROUTER_STATE_UNKNOWN,
466 ISCSI_ROUTER_STATE_ADVERTISED,
467 ISCSI_ROUTER_STATE_MANUAL,
468 ISCSI_ROUTER_STATE_STALE,
469};
470
471/* iSCSI specific settings params for iface */
472enum iscsi_iface_param {
473 ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO,
474 ISCSI_IFACE_PARAM_HDRDGST_EN,
475 ISCSI_IFACE_PARAM_DATADGST_EN,
476 ISCSI_IFACE_PARAM_IMM_DATA_EN,
477 ISCSI_IFACE_PARAM_INITIAL_R2T_EN,
478 ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN,
479 ISCSI_IFACE_PARAM_PDU_INORDER_EN,
480 ISCSI_IFACE_PARAM_ERL,
481 ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH,
482 ISCSI_IFACE_PARAM_FIRST_BURST,
483 ISCSI_IFACE_PARAM_MAX_R2T,
484 ISCSI_IFACE_PARAM_MAX_BURST,
485 ISCSI_IFACE_PARAM_CHAP_AUTH_EN,
486 ISCSI_IFACE_PARAM_BIDI_CHAP_EN,
487 ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL,
488 ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN,
489 ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN,
490 ISCSI_IFACE_PARAM_INITIATOR_NAME,
408}; 491};
409 492
410enum iscsi_conn_state { 493enum iscsi_conn_state {
@@ -535,6 +618,7 @@ enum iscsi_param {
535 618
536 ISCSI_PARAM_DISCOVERY_PARENT_IDX, 619 ISCSI_PARAM_DISCOVERY_PARENT_IDX,
537 ISCSI_PARAM_DISCOVERY_PARENT_TYPE, 620 ISCSI_PARAM_DISCOVERY_PARENT_TYPE,
621 ISCSI_PARAM_LOCAL_IPADDR,
538 /* must always be last */ 622 /* must always be last */
539 ISCSI_PARAM_MAX, 623 ISCSI_PARAM_MAX,
540}; 624};
@@ -766,4 +850,112 @@ struct iscsi_chap_rec {
766 uint8_t password_length; 850 uint8_t password_length;
767}; 851};
768 852
853#define ISCSI_HOST_STATS_CUSTOM_MAX 32
854#define ISCSI_HOST_STATS_CUSTOM_DESC_MAX 64
855struct iscsi_host_stats_custom {
856 char desc[ISCSI_HOST_STATS_CUSTOM_DESC_MAX];
857 uint64_t value;
858};
859
860/* struct iscsi_offload_host_stats: Host statistics,
861 * Include statistics for MAC, IP, TCP & iSCSI.
862 */
863struct iscsi_offload_host_stats {
864 /* MAC */
865 uint64_t mactx_frames;
866 uint64_t mactx_bytes;
867 uint64_t mactx_multicast_frames;
868 uint64_t mactx_broadcast_frames;
869 uint64_t mactx_pause_frames;
870 uint64_t mactx_control_frames;
871 uint64_t mactx_deferral;
872 uint64_t mactx_excess_deferral;
873 uint64_t mactx_late_collision;
874 uint64_t mactx_abort;
875 uint64_t mactx_single_collision;
876 uint64_t mactx_multiple_collision;
877 uint64_t mactx_collision;
878 uint64_t mactx_frames_dropped;
879 uint64_t mactx_jumbo_frames;
880 uint64_t macrx_frames;
881 uint64_t macrx_bytes;
882 uint64_t macrx_unknown_control_frames;
883 uint64_t macrx_pause_frames;
884 uint64_t macrx_control_frames;
885 uint64_t macrx_dribble;
886 uint64_t macrx_frame_length_error;
887 uint64_t macrx_jabber;
888 uint64_t macrx_carrier_sense_error;
889 uint64_t macrx_frame_discarded;
890 uint64_t macrx_frames_dropped;
891 uint64_t mac_crc_error;
892 uint64_t mac_encoding_error;
893 uint64_t macrx_length_error_large;
894 uint64_t macrx_length_error_small;
895 uint64_t macrx_multicast_frames;
896 uint64_t macrx_broadcast_frames;
897 /* IP */
898 uint64_t iptx_packets;
899 uint64_t iptx_bytes;
900 uint64_t iptx_fragments;
901 uint64_t iprx_packets;
902 uint64_t iprx_bytes;
903 uint64_t iprx_fragments;
904 uint64_t ip_datagram_reassembly;
905 uint64_t ip_invalid_address_error;
906 uint64_t ip_error_packets;
907 uint64_t ip_fragrx_overlap;
908 uint64_t ip_fragrx_outoforder;
909 uint64_t ip_datagram_reassembly_timeout;
910 uint64_t ipv6tx_packets;
911 uint64_t ipv6tx_bytes;
912 uint64_t ipv6tx_fragments;
913 uint64_t ipv6rx_packets;
914 uint64_t ipv6rx_bytes;
915 uint64_t ipv6rx_fragments;
916 uint64_t ipv6_datagram_reassembly;
917 uint64_t ipv6_invalid_address_error;
918 uint64_t ipv6_error_packets;
919 uint64_t ipv6_fragrx_overlap;
920 uint64_t ipv6_fragrx_outoforder;
921 uint64_t ipv6_datagram_reassembly_timeout;
922 /* TCP */
923 uint64_t tcptx_segments;
924 uint64_t tcptx_bytes;
925 uint64_t tcprx_segments;
926 uint64_t tcprx_byte;
927 uint64_t tcp_duplicate_ack_retx;
928 uint64_t tcp_retx_timer_expired;
929 uint64_t tcprx_duplicate_ack;
930 uint64_t tcprx_pure_ackr;
931 uint64_t tcptx_delayed_ack;
932 uint64_t tcptx_pure_ack;
933 uint64_t tcprx_segment_error;
934 uint64_t tcprx_segment_outoforder;
935 uint64_t tcprx_window_probe;
936 uint64_t tcprx_window_update;
937 uint64_t tcptx_window_probe_persist;
938 /* ECC */
939 uint64_t ecc_error_correction;
940 /* iSCSI */
941 uint64_t iscsi_pdu_tx;
942 uint64_t iscsi_data_bytes_tx;
943 uint64_t iscsi_pdu_rx;
944 uint64_t iscsi_data_bytes_rx;
945 uint64_t iscsi_io_completed;
946 uint64_t iscsi_unexpected_io_rx;
947 uint64_t iscsi_format_error;
948 uint64_t iscsi_hdr_digest_error;
949 uint64_t iscsi_data_digest_error;
950 uint64_t iscsi_sequence_error;
951 /*
952 * iSCSI Custom Host Statistics support, i.e. Transport could
953 * extend existing host statistics with its own specific statistics
954 * up to ISCSI_HOST_STATS_CUSTOM_MAX
955 */
956 uint32_t custom_length;
957 struct iscsi_host_stats_custom custom[0]
958 __aligned(sizeof(uint64_t));
959};
960
769#endif 961#endif
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 6ac9e17acdc4..309f51336fb9 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -231,6 +231,7 @@ struct iscsi_conn {
231 uint8_t ipv6_traffic_class; 231 uint8_t ipv6_traffic_class;
232 uint8_t ipv6_flow_label; 232 uint8_t ipv6_flow_label;
233 uint8_t is_fw_assigned_ipv6; 233 uint8_t is_fw_assigned_ipv6;
234 char *local_ipaddr;
234 235
235 /* MIB-statistics */ 236 /* MIB-statistics */
236 uint64_t txdata_octets; 237 uint64_t txdata_octets;
diff --git a/include/scsi/osd_ore.h b/include/scsi/osd_ore.h
index a5f9b960dfc8..6ca3265a4dca 100644
--- a/include/scsi/osd_ore.h
+++ b/include/scsi/osd_ore.h
@@ -102,6 +102,7 @@ struct ore_striping_info {
102 unsigned unit_off; 102 unsigned unit_off;
103 unsigned cur_pg; 103 unsigned cur_pg;
104 unsigned cur_comp; 104 unsigned cur_comp;
105 unsigned maxdevUnits;
105}; 106};
106 107
107struct ore_io_state; 108struct ore_io_state;
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 66d42edfb3fc..0a4edfe8af51 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -155,6 +155,7 @@ enum scsi_timeouts {
155/* values for service action in */ 155/* values for service action in */
156#define SAI_READ_CAPACITY_16 0x10 156#define SAI_READ_CAPACITY_16 0x10
157#define SAI_GET_LBA_STATUS 0x12 157#define SAI_GET_LBA_STATUS 0x12
158#define SAI_REPORT_REFERRALS 0x13
158/* values for VARIABLE_LENGTH_CMD service action codes 159/* values for VARIABLE_LENGTH_CMD service action codes
159 * see spc4r17 Section D.3.5, table D.7 and D.8 */ 160 * see spc4r17 Section D.3.5, table D.7 and D.8 */
160#define VLC_SA_RECEIVE_CREDENTIAL 0x1800 161#define VLC_SA_RECEIVE_CREDENTIAL 0x1800
diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
index de5f5d8f1f8a..91558a1f97f4 100644
--- a/include/scsi/scsi_cmnd.h
+++ b/include/scsi/scsi_cmnd.h
@@ -55,6 +55,7 @@ struct scsi_cmnd {
55 struct scsi_device *device; 55 struct scsi_device *device;
56 struct list_head list; /* scsi_cmnd participates in queue lists */ 56 struct list_head list; /* scsi_cmnd participates in queue lists */
57 struct list_head eh_entry; /* entry for the host eh_cmd_q */ 57 struct list_head eh_entry; /* entry for the host eh_cmd_q */
58 struct delayed_work abort_work;
58 int eh_eflags; /* Used by error handlr */ 59 int eh_eflags; /* Used by error handlr */
59 60
60 /* 61 /*
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h
index d443aa06a722..20fdfc2526ad 100644
--- a/include/scsi/scsi_driver.h
+++ b/include/scsi/scsi_driver.h
@@ -16,7 +16,7 @@ struct scsi_driver {
16 16
17 void (*rescan)(struct device *); 17 void (*rescan)(struct device *);
18 int (*done)(struct scsi_cmnd *); 18 int (*done)(struct scsi_cmnd *);
19 int (*eh_action)(struct scsi_cmnd *, unsigned char *, int, int); 19 int (*eh_action)(struct scsi_cmnd *, int);
20}; 20};
21#define to_scsi_driver(drv) \ 21#define to_scsi_driver(drv) \
22 container_of((drv), struct scsi_driver, gendrv) 22 container_of((drv), struct scsi_driver, gendrv)
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index fe3b58e836c8..53075e5039e6 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -479,6 +479,11 @@ struct scsi_host_template {
479 unsigned no_write_same:1; 479 unsigned no_write_same:1;
480 480
481 /* 481 /*
482 * True if asynchronous aborts are not supported
483 */
484 unsigned no_async_abort:1;
485
486 /*
482 * Countdown for host blocking with no commands outstanding. 487 * Countdown for host blocking with no commands outstanding.
483 */ 488 */
484 unsigned int max_host_blocked; 489 unsigned int max_host_blocked;
@@ -690,6 +695,11 @@ struct Scsi_Host {
690 struct workqueue_struct *work_q; 695 struct workqueue_struct *work_q;
691 696
692 /* 697 /*
698 * Task management function work queue
699 */
700 struct workqueue_struct *tmf_work_q;
701
702 /*
693 * Host has rejected a command because it was busy. 703 * Host has rejected a command because it was busy.
694 */ 704 */
695 unsigned int host_blocked; 705 unsigned int host_blocked;
diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h
index fe7c8f3e93f8..88640a47216c 100644
--- a/include/scsi/scsi_transport_iscsi.h
+++ b/include/scsi/scsi_transport_iscsi.h
@@ -166,6 +166,7 @@ struct iscsi_transport {
166 int (*logout_flashnode) (struct iscsi_bus_flash_session *fnode_sess, 166 int (*logout_flashnode) (struct iscsi_bus_flash_session *fnode_sess,
167 struct iscsi_bus_flash_conn *fnode_conn); 167 struct iscsi_bus_flash_conn *fnode_conn);
168 int (*logout_flashnode_sid) (struct iscsi_cls_session *cls_sess); 168 int (*logout_flashnode_sid) (struct iscsi_cls_session *cls_sess);
169 int (*get_host_stats) (struct Scsi_Host *shost, char *buf, int len);
169}; 170};
170 171
171/* 172/*
@@ -478,4 +479,7 @@ iscsi_find_flashnode_sess(struct Scsi_Host *shost, void *data,
478extern struct device * 479extern struct device *
479iscsi_find_flashnode_conn(struct iscsi_bus_flash_session *fnode_sess); 480iscsi_find_flashnode_conn(struct iscsi_bus_flash_session *fnode_sess);
480 481
482extern char *
483iscsi_get_ipaddress_state_name(enum iscsi_ipaddress_state port_state);
484extern char *iscsi_get_router_state_name(enum iscsi_router_state router_state);
481#endif 485#endif
diff --git a/include/scsi/scsi_transport_srp.h b/include/scsi/scsi_transport_srp.h
index 4ebf6913b7b2..b11da5c1331e 100644
--- a/include/scsi/scsi_transport_srp.h
+++ b/include/scsi/scsi_transport_srp.h
@@ -19,7 +19,7 @@ struct srp_rport_identifiers {
19 * @SRP_RPORT_BLOCKED: Transport layer not operational; fast I/O fail timer 19 * @SRP_RPORT_BLOCKED: Transport layer not operational; fast I/O fail timer
20 * is running and I/O has been blocked. 20 * is running and I/O has been blocked.
21 * @SRP_RPORT_FAIL_FAST: Fast I/O fail timer has expired; fail I/O fast. 21 * @SRP_RPORT_FAIL_FAST: Fast I/O fail timer has expired; fail I/O fast.
22 * @SRP_RPORT_LOST: Device loss timer has expired; port is being removed. 22 * @SRP_RPORT_LOST: Port is being removed.
23 */ 23 */
24enum srp_rport_state { 24enum srp_rport_state {
25 SRP_RPORT_RUNNING, 25 SRP_RPORT_RUNNING,
@@ -29,10 +29,26 @@ enum srp_rport_state {
29}; 29};
30 30
31/** 31/**
32 * struct srp_rport 32 * struct srp_rport - SRP initiator or target port
33 * @lld_data: LLD private data. 33 *
34 * @mutex: Protects against concurrent rport reconnect / fast_io_fail / 34 * Fields that are relevant for SRP initiator and SRP target drivers:
35 * dev_loss_tmo activity. 35 * @dev: Device associated with this rport.
36 * @port_id: 16-byte port identifier.
37 * @roles: Role of this port - initiator or target.
38 *
39 * Fields that are only relevant for SRP initiator drivers:
40 * @lld_data: LLD private data.
41 * @mutex: Protects against concurrent rport reconnect /
42 * fast_io_fail / dev_loss_tmo activity.
43 * @state: rport state.
44 * @deleted: Whether or not srp_rport_del() has already been invoked.
45 * @reconnect_delay: Reconnect delay in seconds.
46 * @failed_reconnects: Number of failed reconnect attempts.
47 * @reconnect_work: Work structure used for scheduling reconnect attempts.
48 * @fast_io_fail_tmo: Fast I/O fail timeout in seconds.
49 * @dev_loss_tmo: Device loss timeout in seconds.
50 * @fast_io_fail_work: Work structure used for scheduling fast I/O fail work.
51 * @dev_loss_work: Work structure used for scheduling device loss work.
36 */ 52 */
37struct srp_rport { 53struct srp_rport {
38 /* for initiator and target drivers */ 54 /* for initiator and target drivers */
@@ -48,7 +64,6 @@ struct srp_rport {
48 64
49 struct mutex mutex; 65 struct mutex mutex;
50 enum srp_rport_state state; 66 enum srp_rport_state state;
51 bool deleted;
52 int reconnect_delay; 67 int reconnect_delay;
53 int failed_reconnects; 68 int failed_reconnects;
54 struct delayed_work reconnect_work; 69 struct delayed_work reconnect_work;
@@ -60,6 +75,8 @@ struct srp_rport {
60 75
61/** 76/**
62 * struct srp_function_template 77 * struct srp_function_template
78 *
79 * Fields that are only relevant for SRP initiator drivers:
63 * @has_rport_state: Whether or not to create the state, fast_io_fail_tmo and 80 * @has_rport_state: Whether or not to create the state, fast_io_fail_tmo and
64 * dev_loss_tmo sysfs attribute for an rport. 81 * dev_loss_tmo sysfs attribute for an rport.
65 * @reset_timer_if_blocked: Whether or srp_timed_out() should reset the command 82 * @reset_timer_if_blocked: Whether or srp_timed_out() should reset the command
@@ -71,6 +88,11 @@ struct srp_rport {
71 * srp_reconnect_rport(). 88 * srp_reconnect_rport().
72 * @terminate_rport_io: Callback function for terminating all outstanding I/O 89 * @terminate_rport_io: Callback function for terminating all outstanding I/O
73 * requests for an rport. 90 * requests for an rport.
91 * @rport_delete: Callback function that deletes an rport.
92 *
93 * Fields that are only relevant for SRP target drivers:
94 * @tsk_mgmt_response: Callback function for sending a task management response.
95 * @it_nexus_response: Callback function for processing an IT nexus response.
74 */ 96 */
75struct srp_function_template { 97struct srp_function_template {
76 /* for initiator drivers */ 98 /* for initiator drivers */
@@ -101,9 +123,11 @@ extern int srp_tmo_valid(int reconnect_delay, int fast_io_fail_tmo,
101extern int srp_reconnect_rport(struct srp_rport *rport); 123extern int srp_reconnect_rport(struct srp_rport *rport);
102extern void srp_start_tl_fail_timers(struct srp_rport *rport); 124extern void srp_start_tl_fail_timers(struct srp_rport *rport);
103extern void srp_remove_host(struct Scsi_Host *); 125extern void srp_remove_host(struct Scsi_Host *);
126extern void srp_stop_rport_timers(struct srp_rport *rport);
104 127
105/** 128/**
106 * srp_chkready() - evaluate the transport layer state before I/O 129 * srp_chkready() - evaluate the transport layer state before I/O
130 * @rport: SRP target port pointer.
107 * 131 *
108 * Returns a SCSI result code that can be returned by the LLD queuecommand() 132 * Returns a SCSI result code that can be returned by the LLD queuecommand()
109 * implementation. The role of this function is similar to that of 133 * implementation. The role of this function is similar to that of
diff --git a/include/sound/cs42l52.h b/include/sound/cs42l52.h
index 7c2be4a51894..bbabf84bdb44 100644
--- a/include/sound/cs42l52.h
+++ b/include/sound/cs42l52.h
@@ -16,17 +16,11 @@ struct cs42l52_platform_data {
16 /* MICBIAS Level. Check datasheet Pg48 */ 16 /* MICBIAS Level. Check datasheet Pg48 */
17 unsigned int micbias_lvl; 17 unsigned int micbias_lvl;
18 18
19 /* MICA mode selection 0=Single 1=Differential */ 19 /* MICA mode selection Differential or Single-ended */
20 unsigned int mica_cfg; 20 bool mica_diff_cfg;
21 21
22 /* MICB mode selection 0=Single 1=Differential */ 22 /* MICB mode selection Differential or Single-ended */
23 unsigned int micb_cfg; 23 bool micb_diff_cfg;
24
25 /* MICA Select 0=MIC1A 1=MIC2A */
26 unsigned int mica_sel;
27
28 /* MICB Select 0=MIC2A 1=MIC2B */
29 unsigned int micb_sel;
30 24
31 /* Charge Pump Freq. Check datasheet Pg73 */ 25 /* Charge Pump Freq. Check datasheet Pg73 */
32 unsigned int chgfreq; 26 unsigned int chgfreq;
diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h
index 15017311f2e9..eb73a3a39ec2 100644
--- a/include/sound/dmaengine_pcm.h
+++ b/include/sound/dmaengine_pcm.h
@@ -114,6 +114,10 @@ void snd_dmaengine_pcm_set_config_from_dai_data(
114 * @compat_filter_fn: Will be used as the filter function when requesting a 114 * @compat_filter_fn: Will be used as the filter function when requesting a
115 * channel for platforms which do not use devicetree. The filter parameter 115 * channel for platforms which do not use devicetree. The filter parameter
116 * will be the DAI's DMA data. 116 * will be the DAI's DMA data.
117 * @dma_dev: If set, request DMA channel on this device rather than the DAI
118 * device.
119 * @chan_names: If set, these custom DMA channel names will be requested at
120 * registration time.
117 * @pcm_hardware: snd_pcm_hardware struct to be used for the PCM. 121 * @pcm_hardware: snd_pcm_hardware struct to be used for the PCM.
118 * @prealloc_buffer_size: Size of the preallocated audio buffer. 122 * @prealloc_buffer_size: Size of the preallocated audio buffer.
119 * 123 *
@@ -130,6 +134,8 @@ struct snd_dmaengine_pcm_config {
130 struct snd_soc_pcm_runtime *rtd, 134 struct snd_soc_pcm_runtime *rtd,
131 struct snd_pcm_substream *substream); 135 struct snd_pcm_substream *substream);
132 dma_filter_fn compat_filter_fn; 136 dma_filter_fn compat_filter_fn;
137 struct device *dma_dev;
138 const char *chan_names[SNDRV_PCM_STREAM_LAST + 1];
133 139
134 const struct snd_pcm_hardware *pcm_hardware; 140 const struct snd_pcm_hardware *pcm_hardware;
135 unsigned int prealloc_buffer_size; 141 unsigned int prealloc_buffer_size;
@@ -140,6 +146,10 @@ int snd_dmaengine_pcm_register(struct device *dev,
140 unsigned int flags); 146 unsigned int flags);
141void snd_dmaengine_pcm_unregister(struct device *dev); 147void snd_dmaengine_pcm_unregister(struct device *dev);
142 148
149int devm_snd_dmaengine_pcm_register(struct device *dev,
150 const struct snd_dmaengine_pcm_config *config,
151 unsigned int flags);
152
143int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream, 153int snd_dmaengine_pcm_prepare_slave_config(struct snd_pcm_substream *substream,
144 struct snd_pcm_hw_params *params, 154 struct snd_pcm_hw_params *params,
145 struct dma_slave_config *slave_config); 155 struct dma_slave_config *slave_config);
diff --git a/include/sound/hda_verbs.h b/include/sound/hda_verbs.h
new file mode 100644
index 000000000000..d0509db6d0ec
--- /dev/null
+++ b/include/sound/hda_verbs.h
@@ -0,0 +1,554 @@
1/*
2 * HD-audio codec verbs
3 */
4
5#ifndef __SOUND_HDA_VERBS_H
6#define __SOUND_HDA_VERBS_H
7
8/*
9 * nodes
10 */
11#define AC_NODE_ROOT 0x00
12
13/*
14 * function group types
15 */
16enum {
17 AC_GRP_AUDIO_FUNCTION = 0x01,
18 AC_GRP_MODEM_FUNCTION = 0x02,
19};
20
21/*
22 * widget types
23 */
24enum {
25 AC_WID_AUD_OUT, /* Audio Out */
26 AC_WID_AUD_IN, /* Audio In */
27 AC_WID_AUD_MIX, /* Audio Mixer */
28 AC_WID_AUD_SEL, /* Audio Selector */
29 AC_WID_PIN, /* Pin Complex */
30 AC_WID_POWER, /* Power */
31 AC_WID_VOL_KNB, /* Volume Knob */
32 AC_WID_BEEP, /* Beep Generator */
33 AC_WID_VENDOR = 0x0f /* Vendor specific */
34};
35
36/*
37 * GET verbs
38 */
39#define AC_VERB_GET_STREAM_FORMAT 0x0a00
40#define AC_VERB_GET_AMP_GAIN_MUTE 0x0b00
41#define AC_VERB_GET_PROC_COEF 0x0c00
42#define AC_VERB_GET_COEF_INDEX 0x0d00
43#define AC_VERB_PARAMETERS 0x0f00
44#define AC_VERB_GET_CONNECT_SEL 0x0f01
45#define AC_VERB_GET_CONNECT_LIST 0x0f02
46#define AC_VERB_GET_PROC_STATE 0x0f03
47#define AC_VERB_GET_SDI_SELECT 0x0f04
48#define AC_VERB_GET_POWER_STATE 0x0f05
49#define AC_VERB_GET_CONV 0x0f06
50#define AC_VERB_GET_PIN_WIDGET_CONTROL 0x0f07
51#define AC_VERB_GET_UNSOLICITED_RESPONSE 0x0f08
52#define AC_VERB_GET_PIN_SENSE 0x0f09
53#define AC_VERB_GET_BEEP_CONTROL 0x0f0a
54#define AC_VERB_GET_EAPD_BTLENABLE 0x0f0c
55#define AC_VERB_GET_DIGI_CONVERT_1 0x0f0d
56#define AC_VERB_GET_DIGI_CONVERT_2 0x0f0e /* unused */
57#define AC_VERB_GET_VOLUME_KNOB_CONTROL 0x0f0f
58/* f10-f1a: GPIO */
59#define AC_VERB_GET_GPIO_DATA 0x0f15
60#define AC_VERB_GET_GPIO_MASK 0x0f16
61#define AC_VERB_GET_GPIO_DIRECTION 0x0f17
62#define AC_VERB_GET_GPIO_WAKE_MASK 0x0f18
63#define AC_VERB_GET_GPIO_UNSOLICITED_RSP_MASK 0x0f19
64#define AC_VERB_GET_GPIO_STICKY_MASK 0x0f1a
65#define AC_VERB_GET_CONFIG_DEFAULT 0x0f1c
66/* f20: AFG/MFG */
67#define AC_VERB_GET_SUBSYSTEM_ID 0x0f20
68#define AC_VERB_GET_CVT_CHAN_COUNT 0x0f2d
69#define AC_VERB_GET_HDMI_DIP_SIZE 0x0f2e
70#define AC_VERB_GET_HDMI_ELDD 0x0f2f
71#define AC_VERB_GET_HDMI_DIP_INDEX 0x0f30
72#define AC_VERB_GET_HDMI_DIP_DATA 0x0f31
73#define AC_VERB_GET_HDMI_DIP_XMIT 0x0f32
74#define AC_VERB_GET_HDMI_CP_CTRL 0x0f33
75#define AC_VERB_GET_HDMI_CHAN_SLOT 0x0f34
76#define AC_VERB_GET_DEVICE_SEL 0xf35
77#define AC_VERB_GET_DEVICE_LIST 0xf36
78
79/*
80 * SET verbs
81 */
82#define AC_VERB_SET_STREAM_FORMAT 0x200
83#define AC_VERB_SET_AMP_GAIN_MUTE 0x300
84#define AC_VERB_SET_PROC_COEF 0x400
85#define AC_VERB_SET_COEF_INDEX 0x500
86#define AC_VERB_SET_CONNECT_SEL 0x701
87#define AC_VERB_SET_PROC_STATE 0x703
88#define AC_VERB_SET_SDI_SELECT 0x704
89#define AC_VERB_SET_POWER_STATE 0x705
90#define AC_VERB_SET_CHANNEL_STREAMID 0x706
91#define AC_VERB_SET_PIN_WIDGET_CONTROL 0x707
92#define AC_VERB_SET_UNSOLICITED_ENABLE 0x708
93#define AC_VERB_SET_PIN_SENSE 0x709
94#define AC_VERB_SET_BEEP_CONTROL 0x70a
95#define AC_VERB_SET_EAPD_BTLENABLE 0x70c
96#define AC_VERB_SET_DIGI_CONVERT_1 0x70d
97#define AC_VERB_SET_DIGI_CONVERT_2 0x70e
98#define AC_VERB_SET_VOLUME_KNOB_CONTROL 0x70f
99#define AC_VERB_SET_GPIO_DATA 0x715
100#define AC_VERB_SET_GPIO_MASK 0x716
101#define AC_VERB_SET_GPIO_DIRECTION 0x717
102#define AC_VERB_SET_GPIO_WAKE_MASK 0x718
103#define AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK 0x719
104#define AC_VERB_SET_GPIO_STICKY_MASK 0x71a
105#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_0 0x71c
106#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_1 0x71d
107#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_2 0x71e
108#define AC_VERB_SET_CONFIG_DEFAULT_BYTES_3 0x71f
109#define AC_VERB_SET_EAPD 0x788
110#define AC_VERB_SET_CODEC_RESET 0x7ff
111#define AC_VERB_SET_CVT_CHAN_COUNT 0x72d
112#define AC_VERB_SET_HDMI_DIP_INDEX 0x730
113#define AC_VERB_SET_HDMI_DIP_DATA 0x731
114#define AC_VERB_SET_HDMI_DIP_XMIT 0x732
115#define AC_VERB_SET_HDMI_CP_CTRL 0x733
116#define AC_VERB_SET_HDMI_CHAN_SLOT 0x734
117#define AC_VERB_SET_DEVICE_SEL 0x735
118
119/*
120 * Parameter IDs
121 */
122#define AC_PAR_VENDOR_ID 0x00
123#define AC_PAR_SUBSYSTEM_ID 0x01
124#define AC_PAR_REV_ID 0x02
125#define AC_PAR_NODE_COUNT 0x04
126#define AC_PAR_FUNCTION_TYPE 0x05
127#define AC_PAR_AUDIO_FG_CAP 0x08
128#define AC_PAR_AUDIO_WIDGET_CAP 0x09
129#define AC_PAR_PCM 0x0a
130#define AC_PAR_STREAM 0x0b
131#define AC_PAR_PIN_CAP 0x0c
132#define AC_PAR_AMP_IN_CAP 0x0d
133#define AC_PAR_CONNLIST_LEN 0x0e
134#define AC_PAR_POWER_STATE 0x0f
135#define AC_PAR_PROC_CAP 0x10
136#define AC_PAR_GPIO_CAP 0x11
137#define AC_PAR_AMP_OUT_CAP 0x12
138#define AC_PAR_VOL_KNB_CAP 0x13
139#define AC_PAR_DEVLIST_LEN 0x15
140#define AC_PAR_HDMI_LPCM_CAP 0x20
141
142/*
143 * AC_VERB_PARAMETERS results (32bit)
144 */
145
146/* Function Group Type */
147#define AC_FGT_TYPE (0xff<<0)
148#define AC_FGT_TYPE_SHIFT 0
149#define AC_FGT_UNSOL_CAP (1<<8)
150
151/* Audio Function Group Capabilities */
152#define AC_AFG_OUT_DELAY (0xf<<0)
153#define AC_AFG_IN_DELAY (0xf<<8)
154#define AC_AFG_BEEP_GEN (1<<16)
155
156/* Audio Widget Capabilities */
157#define AC_WCAP_STEREO (1<<0) /* stereo I/O */
158#define AC_WCAP_IN_AMP (1<<1) /* AMP-in present */
159#define AC_WCAP_OUT_AMP (1<<2) /* AMP-out present */
160#define AC_WCAP_AMP_OVRD (1<<3) /* AMP-parameter override */
161#define AC_WCAP_FORMAT_OVRD (1<<4) /* format override */
162#define AC_WCAP_STRIPE (1<<5) /* stripe */
163#define AC_WCAP_PROC_WID (1<<6) /* Proc Widget */
164#define AC_WCAP_UNSOL_CAP (1<<7) /* Unsol capable */
165#define AC_WCAP_CONN_LIST (1<<8) /* connection list */
166#define AC_WCAP_DIGITAL (1<<9) /* digital I/O */
167#define AC_WCAP_POWER (1<<10) /* power control */
168#define AC_WCAP_LR_SWAP (1<<11) /* L/R swap */
169#define AC_WCAP_CP_CAPS (1<<12) /* content protection */
170#define AC_WCAP_CHAN_CNT_EXT (7<<13) /* channel count ext */
171#define AC_WCAP_DELAY (0xf<<16)
172#define AC_WCAP_DELAY_SHIFT 16
173#define AC_WCAP_TYPE (0xf<<20)
174#define AC_WCAP_TYPE_SHIFT 20
175
176/* supported PCM rates and bits */
177#define AC_SUPPCM_RATES (0xfff << 0)
178#define AC_SUPPCM_BITS_8 (1<<16)
179#define AC_SUPPCM_BITS_16 (1<<17)
180#define AC_SUPPCM_BITS_20 (1<<18)
181#define AC_SUPPCM_BITS_24 (1<<19)
182#define AC_SUPPCM_BITS_32 (1<<20)
183
184/* supported PCM stream format */
185#define AC_SUPFMT_PCM (1<<0)
186#define AC_SUPFMT_FLOAT32 (1<<1)
187#define AC_SUPFMT_AC3 (1<<2)
188
189/* GP I/O count */
190#define AC_GPIO_IO_COUNT (0xff<<0)
191#define AC_GPIO_O_COUNT (0xff<<8)
192#define AC_GPIO_O_COUNT_SHIFT 8
193#define AC_GPIO_I_COUNT (0xff<<16)
194#define AC_GPIO_I_COUNT_SHIFT 16
195#define AC_GPIO_UNSOLICITED (1<<30)
196#define AC_GPIO_WAKE (1<<31)
197
198/* Converter stream, channel */
199#define AC_CONV_CHANNEL (0xf<<0)
200#define AC_CONV_STREAM (0xf<<4)
201#define AC_CONV_STREAM_SHIFT 4
202
203/* Input converter SDI select */
204#define AC_SDI_SELECT (0xf<<0)
205
206/* stream format id */
207#define AC_FMT_CHAN_SHIFT 0
208#define AC_FMT_CHAN_MASK (0x0f << 0)
209#define AC_FMT_BITS_SHIFT 4
210#define AC_FMT_BITS_MASK (7 << 4)
211#define AC_FMT_BITS_8 (0 << 4)
212#define AC_FMT_BITS_16 (1 << 4)
213#define AC_FMT_BITS_20 (2 << 4)
214#define AC_FMT_BITS_24 (3 << 4)
215#define AC_FMT_BITS_32 (4 << 4)
216#define AC_FMT_DIV_SHIFT 8
217#define AC_FMT_DIV_MASK (7 << 8)
218#define AC_FMT_MULT_SHIFT 11
219#define AC_FMT_MULT_MASK (7 << 11)
220#define AC_FMT_BASE_SHIFT 14
221#define AC_FMT_BASE_48K (0 << 14)
222#define AC_FMT_BASE_44K (1 << 14)
223#define AC_FMT_TYPE_SHIFT 15
224#define AC_FMT_TYPE_PCM (0 << 15)
225#define AC_FMT_TYPE_NON_PCM (1 << 15)
226
227/* Unsolicited response control */
228#define AC_UNSOL_TAG (0x3f<<0)
229#define AC_UNSOL_ENABLED (1<<7)
230#define AC_USRSP_EN AC_UNSOL_ENABLED
231
232/* Unsolicited responses */
233#define AC_UNSOL_RES_TAG (0x3f<<26)
234#define AC_UNSOL_RES_TAG_SHIFT 26
235#define AC_UNSOL_RES_SUBTAG (0x1f<<21)
236#define AC_UNSOL_RES_SUBTAG_SHIFT 21
237#define AC_UNSOL_RES_DE (0x3f<<15) /* Device Entry
238 * (for DP1.2 MST)
239 */
240#define AC_UNSOL_RES_DE_SHIFT 15
241#define AC_UNSOL_RES_IA (1<<2) /* Inactive (for DP1.2 MST) */
242#define AC_UNSOL_RES_ELDV (1<<1) /* ELD Data valid (for HDMI) */
243#define AC_UNSOL_RES_PD (1<<0) /* pinsense detect */
244#define AC_UNSOL_RES_CP_STATE (1<<1) /* content protection */
245#define AC_UNSOL_RES_CP_READY (1<<0) /* content protection */
246
247/* Pin widget capabilies */
248#define AC_PINCAP_IMP_SENSE (1<<0) /* impedance sense capable */
249#define AC_PINCAP_TRIG_REQ (1<<1) /* trigger required */
250#define AC_PINCAP_PRES_DETECT (1<<2) /* presence detect capable */
251#define AC_PINCAP_HP_DRV (1<<3) /* headphone drive capable */
252#define AC_PINCAP_OUT (1<<4) /* output capable */
253#define AC_PINCAP_IN (1<<5) /* input capable */
254#define AC_PINCAP_BALANCE (1<<6) /* balanced I/O capable */
255/* Note: This LR_SWAP pincap is defined in the Realtek ALC883 specification,
256 * but is marked reserved in the Intel HDA specification.
257 */
258#define AC_PINCAP_LR_SWAP (1<<7) /* L/R swap */
259/* Note: The same bit as LR_SWAP is newly defined as HDMI capability
260 * in HD-audio specification
261 */
262#define AC_PINCAP_HDMI (1<<7) /* HDMI pin */
263#define AC_PINCAP_DP (1<<24) /* DisplayPort pin, can
264 * coexist with AC_PINCAP_HDMI
265 */
266#define AC_PINCAP_VREF (0x37<<8)
267#define AC_PINCAP_VREF_SHIFT 8
268#define AC_PINCAP_EAPD (1<<16) /* EAPD capable */
269#define AC_PINCAP_HBR (1<<27) /* High Bit Rate */
270/* Vref status (used in pin cap) */
271#define AC_PINCAP_VREF_HIZ (1<<0) /* Hi-Z */
272#define AC_PINCAP_VREF_50 (1<<1) /* 50% */
273#define AC_PINCAP_VREF_GRD (1<<2) /* ground */
274#define AC_PINCAP_VREF_80 (1<<4) /* 80% */
275#define AC_PINCAP_VREF_100 (1<<5) /* 100% */
276
277/* Amplifier capabilities */
278#define AC_AMPCAP_OFFSET (0x7f<<0) /* 0dB offset */
279#define AC_AMPCAP_OFFSET_SHIFT 0
280#define AC_AMPCAP_NUM_STEPS (0x7f<<8) /* number of steps */
281#define AC_AMPCAP_NUM_STEPS_SHIFT 8
282#define AC_AMPCAP_STEP_SIZE (0x7f<<16) /* step size 0-32dB
283 * in 0.25dB
284 */
285#define AC_AMPCAP_STEP_SIZE_SHIFT 16
286#define AC_AMPCAP_MUTE (1<<31) /* mute capable */
287#define AC_AMPCAP_MUTE_SHIFT 31
288
289/* driver-specific amp-caps: using bits 24-30 */
290#define AC_AMPCAP_MIN_MUTE (1 << 30) /* min-volume = mute */
291
292/* Connection list */
293#define AC_CLIST_LENGTH (0x7f<<0)
294#define AC_CLIST_LONG (1<<7)
295
296/* Supported power status */
297#define AC_PWRST_D0SUP (1<<0)
298#define AC_PWRST_D1SUP (1<<1)
299#define AC_PWRST_D2SUP (1<<2)
300#define AC_PWRST_D3SUP (1<<3)
301#define AC_PWRST_D3COLDSUP (1<<4)
302#define AC_PWRST_S3D3COLDSUP (1<<29)
303#define AC_PWRST_CLKSTOP (1<<30)
304#define AC_PWRST_EPSS (1U<<31)
305
306/* Power state values */
307#define AC_PWRST_SETTING (0xf<<0)
308#define AC_PWRST_ACTUAL (0xf<<4)
309#define AC_PWRST_ACTUAL_SHIFT 4
310#define AC_PWRST_D0 0x00
311#define AC_PWRST_D1 0x01
312#define AC_PWRST_D2 0x02
313#define AC_PWRST_D3 0x03
314#define AC_PWRST_ERROR (1<<8)
315#define AC_PWRST_CLK_STOP_OK (1<<9)
316#define AC_PWRST_SETTING_RESET (1<<10)
317
318/* Processing capabilies */
319#define AC_PCAP_BENIGN (1<<0)
320#define AC_PCAP_NUM_COEF (0xff<<8)
321#define AC_PCAP_NUM_COEF_SHIFT 8
322
323/* Volume knobs capabilities */
324#define AC_KNBCAP_NUM_STEPS (0x7f<<0)
325#define AC_KNBCAP_DELTA (1<<7)
326
327/* HDMI LPCM capabilities */
328#define AC_LPCMCAP_48K_CP_CHNS (0x0f<<0) /* max channels w/ CP-on */
329#define AC_LPCMCAP_48K_NO_CHNS (0x0f<<4) /* max channels w/o CP-on */
330#define AC_LPCMCAP_48K_20BIT (1<<8) /* 20b bitrate supported */
331#define AC_LPCMCAP_48K_24BIT (1<<9) /* 24b bitrate supported */
332#define AC_LPCMCAP_96K_CP_CHNS (0x0f<<10) /* max channels w/ CP-on */
333#define AC_LPCMCAP_96K_NO_CHNS (0x0f<<14) /* max channels w/o CP-on */
334#define AC_LPCMCAP_96K_20BIT (1<<18) /* 20b bitrate supported */
335#define AC_LPCMCAP_96K_24BIT (1<<19) /* 24b bitrate supported */
336#define AC_LPCMCAP_192K_CP_CHNS (0x0f<<20) /* max channels w/ CP-on */
337#define AC_LPCMCAP_192K_NO_CHNS (0x0f<<24) /* max channels w/o CP-on */
338#define AC_LPCMCAP_192K_20BIT (1<<28) /* 20b bitrate supported */
339#define AC_LPCMCAP_192K_24BIT (1<<29) /* 24b bitrate supported */
340#define AC_LPCMCAP_44K (1<<30) /* 44.1kHz support */
341#define AC_LPCMCAP_44K_MS (1<<31) /* 44.1kHz-multiplies support */
342
343/* Display pin's device list length */
344#define AC_DEV_LIST_LEN_MASK 0x3f
345#define AC_MAX_DEV_LIST_LEN 64
346
347/*
348 * Control Parameters
349 */
350
351/* Amp gain/mute */
352#define AC_AMP_MUTE (1<<7)
353#define AC_AMP_GAIN (0x7f)
354#define AC_AMP_GET_INDEX (0xf<<0)
355
356#define AC_AMP_GET_LEFT (1<<13)
357#define AC_AMP_GET_RIGHT (0<<13)
358#define AC_AMP_GET_OUTPUT (1<<15)
359#define AC_AMP_GET_INPUT (0<<15)
360
361#define AC_AMP_SET_INDEX (0xf<<8)
362#define AC_AMP_SET_INDEX_SHIFT 8
363#define AC_AMP_SET_RIGHT (1<<12)
364#define AC_AMP_SET_LEFT (1<<13)
365#define AC_AMP_SET_INPUT (1<<14)
366#define AC_AMP_SET_OUTPUT (1<<15)
367
368/* DIGITAL1 bits */
369#define AC_DIG1_ENABLE (1<<0)
370#define AC_DIG1_V (1<<1)
371#define AC_DIG1_VCFG (1<<2)
372#define AC_DIG1_EMPHASIS (1<<3)
373#define AC_DIG1_COPYRIGHT (1<<4)
374#define AC_DIG1_NONAUDIO (1<<5)
375#define AC_DIG1_PROFESSIONAL (1<<6)
376#define AC_DIG1_LEVEL (1<<7)
377
378/* DIGITAL2 bits */
379#define AC_DIG2_CC (0x7f<<0)
380
381/* DIGITAL3 bits */
382#define AC_DIG3_ICT (0xf<<0)
383#define AC_DIG3_KAE (1<<7)
384
385/* Pin widget control - 8bit */
386#define AC_PINCTL_EPT (0x3<<0)
387#define AC_PINCTL_EPT_NATIVE 0
388#define AC_PINCTL_EPT_HBR 3
389#define AC_PINCTL_VREFEN (0x7<<0)
390#define AC_PINCTL_VREF_HIZ 0 /* Hi-Z */
391#define AC_PINCTL_VREF_50 1 /* 50% */
392#define AC_PINCTL_VREF_GRD 2 /* ground */
393#define AC_PINCTL_VREF_80 4 /* 80% */
394#define AC_PINCTL_VREF_100 5 /* 100% */
395#define AC_PINCTL_IN_EN (1<<5)
396#define AC_PINCTL_OUT_EN (1<<6)
397#define AC_PINCTL_HP_EN (1<<7)
398
399/* Pin sense - 32bit */
400#define AC_PINSENSE_IMPEDANCE_MASK (0x7fffffff)
401#define AC_PINSENSE_PRESENCE (1<<31)
402#define AC_PINSENSE_ELDV (1<<30) /* ELD valid (HDMI) */
403
404/* EAPD/BTL enable - 32bit */
405#define AC_EAPDBTL_BALANCED (1<<0)
406#define AC_EAPDBTL_EAPD (1<<1)
407#define AC_EAPDBTL_LR_SWAP (1<<2)
408
409/* HDMI ELD data */
410#define AC_ELDD_ELD_VALID (1<<31)
411#define AC_ELDD_ELD_DATA 0xff
412
413/* HDMI DIP size */
414#define AC_DIPSIZE_ELD_BUF (1<<3) /* ELD buf size of packet size */
415#define AC_DIPSIZE_PACK_IDX (0x07<<0) /* packet index */
416
417/* HDMI DIP index */
418#define AC_DIPIDX_PACK_IDX (0x07<<5) /* packet idnex */
419#define AC_DIPIDX_BYTE_IDX (0x1f<<0) /* byte index */
420
421/* HDMI DIP xmit (transmit) control */
422#define AC_DIPXMIT_MASK (0x3<<6)
423#define AC_DIPXMIT_DISABLE (0x0<<6) /* disable xmit */
424#define AC_DIPXMIT_ONCE (0x2<<6) /* xmit once then disable */
425#define AC_DIPXMIT_BEST (0x3<<6) /* best effort */
426
427/* HDMI content protection (CP) control */
428#define AC_CPCTRL_CES (1<<9) /* current encryption state */
429#define AC_CPCTRL_READY (1<<8) /* ready bit */
430#define AC_CPCTRL_SUBTAG (0x1f<<3) /* subtag for unsol-resp */
431#define AC_CPCTRL_STATE (3<<0) /* current CP request state */
432
433/* Converter channel <-> HDMI slot mapping */
434#define AC_CVTMAP_HDMI_SLOT (0xf<<0) /* HDMI slot number */
435#define AC_CVTMAP_CHAN (0xf<<4) /* converter channel number */
436
437/* configuration default - 32bit */
438#define AC_DEFCFG_SEQUENCE (0xf<<0)
439#define AC_DEFCFG_DEF_ASSOC (0xf<<4)
440#define AC_DEFCFG_ASSOC_SHIFT 4
441#define AC_DEFCFG_MISC (0xf<<8)
442#define AC_DEFCFG_MISC_SHIFT 8
443#define AC_DEFCFG_MISC_NO_PRESENCE (1<<0)
444#define AC_DEFCFG_COLOR (0xf<<12)
445#define AC_DEFCFG_COLOR_SHIFT 12
446#define AC_DEFCFG_CONN_TYPE (0xf<<16)
447#define AC_DEFCFG_CONN_TYPE_SHIFT 16
448#define AC_DEFCFG_DEVICE (0xf<<20)
449#define AC_DEFCFG_DEVICE_SHIFT 20
450#define AC_DEFCFG_LOCATION (0x3f<<24)
451#define AC_DEFCFG_LOCATION_SHIFT 24
452#define AC_DEFCFG_PORT_CONN (0x3<<30)
453#define AC_DEFCFG_PORT_CONN_SHIFT 30
454
455/* Display pin's device list entry */
456#define AC_DE_PD (1<<0)
457#define AC_DE_ELDV (1<<1)
458#define AC_DE_IA (1<<2)
459
460/* device device types (0x0-0xf) */
461enum {
462 AC_JACK_LINE_OUT,
463 AC_JACK_SPEAKER,
464 AC_JACK_HP_OUT,
465 AC_JACK_CD,
466 AC_JACK_SPDIF_OUT,
467 AC_JACK_DIG_OTHER_OUT,
468 AC_JACK_MODEM_LINE_SIDE,
469 AC_JACK_MODEM_HAND_SIDE,
470 AC_JACK_LINE_IN,
471 AC_JACK_AUX,
472 AC_JACK_MIC_IN,
473 AC_JACK_TELEPHONY,
474 AC_JACK_SPDIF_IN,
475 AC_JACK_DIG_OTHER_IN,
476 AC_JACK_OTHER = 0xf,
477};
478
479/* jack connection types (0x0-0xf) */
480enum {
481 AC_JACK_CONN_UNKNOWN,
482 AC_JACK_CONN_1_8,
483 AC_JACK_CONN_1_4,
484 AC_JACK_CONN_ATAPI,
485 AC_JACK_CONN_RCA,
486 AC_JACK_CONN_OPTICAL,
487 AC_JACK_CONN_OTHER_DIGITAL,
488 AC_JACK_CONN_OTHER_ANALOG,
489 AC_JACK_CONN_DIN,
490 AC_JACK_CONN_XLR,
491 AC_JACK_CONN_RJ11,
492 AC_JACK_CONN_COMB,
493 AC_JACK_CONN_OTHER = 0xf,
494};
495
496/* jack colors (0x0-0xf) */
497enum {
498 AC_JACK_COLOR_UNKNOWN,
499 AC_JACK_COLOR_BLACK,
500 AC_JACK_COLOR_GREY,
501 AC_JACK_COLOR_BLUE,
502 AC_JACK_COLOR_GREEN,
503 AC_JACK_COLOR_RED,
504 AC_JACK_COLOR_ORANGE,
505 AC_JACK_COLOR_YELLOW,
506 AC_JACK_COLOR_PURPLE,
507 AC_JACK_COLOR_PINK,
508 AC_JACK_COLOR_WHITE = 0xe,
509 AC_JACK_COLOR_OTHER,
510};
511
512/* Jack location (0x0-0x3f) */
513/* common case */
514enum {
515 AC_JACK_LOC_NONE,
516 AC_JACK_LOC_REAR,
517 AC_JACK_LOC_FRONT,
518 AC_JACK_LOC_LEFT,
519 AC_JACK_LOC_RIGHT,
520 AC_JACK_LOC_TOP,
521 AC_JACK_LOC_BOTTOM,
522};
523/* bits 4-5 */
524enum {
525 AC_JACK_LOC_EXTERNAL = 0x00,
526 AC_JACK_LOC_INTERNAL = 0x10,
527 AC_JACK_LOC_SEPARATE = 0x20,
528 AC_JACK_LOC_OTHER = 0x30,
529};
530enum {
531 /* external on primary chasis */
532 AC_JACK_LOC_REAR_PANEL = 0x07,
533 AC_JACK_LOC_DRIVE_BAY,
534 /* internal */
535 AC_JACK_LOC_RISER = 0x17,
536 AC_JACK_LOC_HDMI,
537 AC_JACK_LOC_ATAPI,
538 /* others */
539 AC_JACK_LOC_MOBILE_IN = 0x37,
540 AC_JACK_LOC_MOBILE_OUT,
541};
542
543/* Port connectivity (0-3) */
544enum {
545 AC_JACK_PORT_COMPLEX,
546 AC_JACK_PORT_NONE,
547 AC_JACK_PORT_FIXED,
548 AC_JACK_PORT_BOTH,
549};
550
551/* max. codec address */
552#define HDA_MAX_CODEC_ADDRESS 0x0f
553
554#endif /* __SOUND_HDA_VERBS_H */
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h
index 5f73785f5977..782d1df34208 100644
--- a/include/sound/memalloc.h
+++ b/include/sound/memalloc.h
@@ -149,13 +149,6 @@ int snd_dma_alloc_pages_fallback(int type, struct device *dev, size_t size,
149 struct snd_dma_buffer *dmab); 149 struct snd_dma_buffer *dmab);
150void snd_dma_free_pages(struct snd_dma_buffer *dmab); 150void snd_dma_free_pages(struct snd_dma_buffer *dmab);
151 151
152/* buffer-preservation managements */
153
154#define snd_dma_pci_buf_id(pci) (((unsigned int)(pci)->vendor << 16) | (pci)->device)
155
156size_t snd_dma_get_reserved_buf(struct snd_dma_buffer *dmab, unsigned int id);
157int snd_dma_reserve_buf(struct snd_dma_buffer *dmab, unsigned int id);
158
159/* basic memory allocation functions */ 152/* basic memory allocation functions */
160void *snd_malloc_pages(size_t size, gfp_t gfp_flags); 153void *snd_malloc_pages(size_t size, gfp_t gfp_flags);
161void snd_free_pages(void *ptr, size_t size); 154void snd_free_pages(void *ptr, size_t size);
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 84b10f9a2832..4883499ab38b 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -381,7 +381,6 @@ struct snd_pcm_substream {
381 struct pm_qos_request latency_pm_qos_req; /* pm_qos request */ 381 struct pm_qos_request latency_pm_qos_req; /* pm_qos request */
382 size_t buffer_bytes_max; /* limit ring buffer size */ 382 size_t buffer_bytes_max; /* limit ring buffer size */
383 struct snd_dma_buffer dma_buffer; 383 struct snd_dma_buffer dma_buffer;
384 unsigned int dma_buf_id;
385 size_t dma_max; 384 size_t dma_max;
386 /* -- hardware operations -- */ 385 /* -- hardware operations -- */
387 const struct snd_pcm_ops *ops; 386 const struct snd_pcm_ops *ops;
@@ -901,6 +900,8 @@ extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates;
901int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime); 900int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime);
902unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate); 901unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate);
903unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit); 902unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit);
903unsigned int snd_pcm_rate_mask_intersect(unsigned int rates_a,
904 unsigned int rates_b);
904 905
905static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream, 906static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream,
906 struct snd_dma_buffer *bufp) 907 struct snd_dma_buffer *bufp)
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h
index 37ae12e0ab06..6b1c78f05fab 100644
--- a/include/sound/pcm_params.h
+++ b/include/sound/pcm_params.h
@@ -354,4 +354,16 @@ params_period_bytes(const struct snd_pcm_hw_params *p)
354 params_channels(p)) / 8; 354 params_channels(p)) / 8;
355} 355}
356 356
357static inline int
358params_width(const struct snd_pcm_hw_params *p)
359{
360 return snd_pcm_format_width(params_format(p));
361}
362
363static inline int
364params_physical_width(const struct snd_pcm_hw_params *p)
365{
366 return snd_pcm_format_physical_width(params_format(p));
367}
368
357#endif /* __SOUND_PCM_PARAMS_H */ 369#endif /* __SOUND_PCM_PARAMS_H */
diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
index 12afab18945d..6add6ccc811e 100644
--- a/include/sound/rcar_snd.h
+++ b/include/sound/rcar_snd.h
@@ -18,7 +18,7 @@
18#define RSND_GEN1_ADG 1 18#define RSND_GEN1_ADG 1
19#define RSND_GEN1_SSI 2 19#define RSND_GEN1_SSI 2
20 20
21#define RSND_GEN2_SRU 0 21#define RSND_GEN2_SCU 0
22#define RSND_GEN2_ADG 1 22#define RSND_GEN2_ADG 1
23#define RSND_GEN2_SSIU 2 23#define RSND_GEN2_SSIU 2
24#define RSND_GEN2_SSI 3 24#define RSND_GEN2_SSI 3
@@ -34,7 +34,6 @@
34 * B : SSI direction 34 * B : SSI direction
35 */ 35 */
36#define RSND_SSI_CLK_PIN_SHARE (1 << 31) 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 */ 37#define RSND_SSI_SYNC (1 << 29) /* SSI34_sync etc */
39 38
40#define RSND_SSI_PLAY (1 << 24) 39#define RSND_SSI_PLAY (1 << 24)
@@ -58,6 +57,7 @@ struct rsnd_ssi_platform_info {
58 57
59struct rsnd_scu_platform_info { 58struct rsnd_scu_platform_info {
60 u32 flags; 59 u32 flags;
60 u32 convert_rate; /* sampling rate convert */
61}; 61};
62 62
63/* 63/*
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 800c101bb096..71f27c403194 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -123,6 +123,8 @@ int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);
123int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute, 123int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute,
124 int direction); 124 int direction);
125 125
126int snd_soc_dai_is_dummy(struct snd_soc_dai *dai);
127
126struct snd_soc_dai_ops { 128struct snd_soc_dai_ops {
127 /* 129 /*
128 * DAI clocking configuration, all optional. 130 * DAI clocking configuration, all optional.
@@ -220,6 +222,8 @@ struct snd_soc_dai_driver {
220 struct snd_soc_pcm_stream capture; 222 struct snd_soc_pcm_stream capture;
221 struct snd_soc_pcm_stream playback; 223 struct snd_soc_pcm_stream playback;
222 unsigned int symmetric_rates:1; 224 unsigned int symmetric_rates:1;
225 unsigned int symmetric_channels:1;
226 unsigned int symmetric_samplebits:1;
223 227
224 /* probe ordering - for components with runtime dependencies */ 228 /* probe ordering - for components with runtime dependencies */
225 int probe_order; 229 int probe_order;
@@ -244,6 +248,8 @@ struct snd_soc_dai {
244 unsigned int capture_active:1; /* stream is in use */ 248 unsigned int capture_active:1; /* stream is in use */
245 unsigned int playback_active:1; /* stream is in use */ 249 unsigned int playback_active:1; /* stream is in use */
246 unsigned int symmetric_rates:1; 250 unsigned int symmetric_rates:1;
251 unsigned int symmetric_channels:1;
252 unsigned int symmetric_samplebits:1;
247 struct snd_pcm_runtime *runtime; 253 struct snd_pcm_runtime *runtime;
248 unsigned int active; 254 unsigned int active;
249 unsigned char probed:1; 255 unsigned char probed:1;
@@ -258,6 +264,8 @@ struct snd_soc_dai {
258 264
259 /* Symmetry data - only valid if symmetry is being enforced */ 265 /* Symmetry data - only valid if symmetry is being enforced */
260 unsigned int rate; 266 unsigned int rate;
267 unsigned int channels;
268 unsigned int sample_bits;
261 269
262 /* parent platform/codec */ 270 /* parent platform/codec */
263 struct snd_soc_platform *platform; 271 struct snd_soc_platform *platform;
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 56ebdfca6273..68d92e36facd 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -412,6 +412,7 @@ int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm,
412int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, 412int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
413 struct snd_soc_dai *dai); 413 struct snd_soc_dai *dai);
414int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card); 414int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card);
415void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card);
415int snd_soc_dapm_new_pcm(struct snd_soc_card *card, 416int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
416 const struct snd_soc_pcm_stream *params, 417 const struct snd_soc_pcm_stream *params,
417 struct snd_soc_dapm_widget *source, 418 struct snd_soc_dapm_widget *source,
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h
index 047d657c331c..2883a7a6f9f3 100644
--- a/include/sound/soc-dpcm.h
+++ b/include/sound/soc-dpcm.h
@@ -11,6 +11,7 @@
11#ifndef __LINUX_SND_SOC_DPCM_H 11#ifndef __LINUX_SND_SOC_DPCM_H
12#define __LINUX_SND_SOC_DPCM_H 12#define __LINUX_SND_SOC_DPCM_H
13 13
14#include <linux/slab.h>
14#include <linux/list.h> 15#include <linux/list.h>
15#include <sound/pcm.h> 16#include <sound/pcm.h>
16 17
@@ -135,4 +136,25 @@ int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute);
135int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); 136int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd);
136int soc_dpcm_runtime_update(struct snd_soc_card *); 137int soc_dpcm_runtime_update(struct snd_soc_card *);
137 138
139int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
140 int stream, struct snd_soc_dapm_widget_list **list_);
141int dpcm_process_paths(struct snd_soc_pcm_runtime *fe,
142 int stream, struct snd_soc_dapm_widget_list **list, int new);
143int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream);
144int dpcm_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream);
145void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream);
146void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream);
147int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream);
148int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int tream);
149int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, int cmd);
150int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream);
151int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir,
152 int event);
153
154static inline void dpcm_path_put(struct snd_soc_dapm_widget_list **list)
155{
156 kfree(*list);
157}
158
159
138#endif 160#endif
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 1f741cb24f33..9a001472b96a 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -334,9 +334,7 @@ struct snd_soc_jack_pin;
334#include <sound/soc-dapm.h> 334#include <sound/soc-dapm.h>
335#include <sound/soc-dpcm.h> 335#include <sound/soc-dpcm.h>
336 336
337#ifdef CONFIG_GPIOLIB
338struct snd_soc_jack_gpio; 337struct snd_soc_jack_gpio;
339#endif
340 338
341typedef int (*hw_write_t)(void *,const char* ,int); 339typedef int (*hw_write_t)(void *,const char* ,int);
342 340
@@ -446,6 +444,17 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
446 struct snd_soc_jack_gpio *gpios); 444 struct snd_soc_jack_gpio *gpios);
447void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, 445void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
448 struct snd_soc_jack_gpio *gpios); 446 struct snd_soc_jack_gpio *gpios);
447#else
448static inline int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
449 struct snd_soc_jack_gpio *gpios)
450{
451 return 0;
452}
453
454static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count,
455 struct snd_soc_jack_gpio *gpios)
456{
457}
449#endif 458#endif
450 459
451/* codec register bit access */ 460/* codec register bit access */
@@ -580,7 +589,6 @@ struct snd_soc_jack_zone {
580 * to provide more complex checks (eg, reading an 589 * to provide more complex checks (eg, reading an
581 * ADC). 590 * ADC).
582 */ 591 */
583#ifdef CONFIG_GPIOLIB
584struct snd_soc_jack_gpio { 592struct snd_soc_jack_gpio {
585 unsigned int gpio; 593 unsigned int gpio;
586 const char *name; 594 const char *name;
@@ -594,7 +602,6 @@ struct snd_soc_jack_gpio {
594 602
595 int (*jack_status_check)(void); 603 int (*jack_status_check)(void);
596}; 604};
597#endif
598 605
599struct snd_soc_jack { 606struct snd_soc_jack {
600 struct mutex mutex; 607 struct mutex mutex;
@@ -879,6 +886,8 @@ struct snd_soc_dai_link {
879 886
880 /* Symmetry requirements */ 887 /* Symmetry requirements */
881 unsigned int symmetric_rates:1; 888 unsigned int symmetric_rates:1;
889 unsigned int symmetric_channels:1;
890 unsigned int symmetric_samplebits:1;
882 891
883 /* Do not create a PCM for this DAI link (Backend link) */ 892 /* Do not create a PCM for this DAI link (Backend link) */
884 unsigned int no_pcm:1; 893 unsigned int no_pcm:1;
@@ -886,6 +895,10 @@ struct snd_soc_dai_link {
886 /* This DAI link can route to other DAI links at runtime (Frontend)*/ 895 /* This DAI link can route to other DAI links at runtime (Frontend)*/
887 unsigned int dynamic:1; 896 unsigned int dynamic:1;
888 897
898 /* DPCM capture and Playback support */
899 unsigned int dpcm_capture:1;
900 unsigned int dpcm_playback:1;
901
889 /* pmdown_time is ignored at stop */ 902 /* pmdown_time is ignored at stop */
890 unsigned int ignore_pmdown_time:1; 903 unsigned int ignore_pmdown_time:1;
891 904
@@ -1029,6 +1042,7 @@ struct snd_soc_pcm_runtime {
1029 1042
1030 /* Dynamic PCM BE runtime data */ 1043 /* Dynamic PCM BE runtime data */
1031 struct snd_soc_dpcm_runtime dpcm[2]; 1044 struct snd_soc_dpcm_runtime dpcm[2];
1045 int fe_compr;
1032 1046
1033 long pmdown_time; 1047 long pmdown_time;
1034 unsigned char pop_wait:1; 1048 unsigned char pop_wait:1;
diff --git a/include/sound/spear_dma.h b/include/sound/spear_dma.h
index 1b365bfdfb37..65aca51fe255 100644
--- a/include/sound/spear_dma.h
+++ b/include/sound/spear_dma.h
@@ -29,7 +29,6 @@ struct spear_dma_data {
29 dma_addr_t addr; 29 dma_addr_t addr;
30 u32 max_burst; 30 u32 max_burst;
31 enum dma_slave_buswidth addr_width; 31 enum dma_slave_buswidth addr_width;
32 bool (*filter)(struct dma_chan *chan, void *slave);
33}; 32};
34 33
35#endif /* SPEAR_DMA_H */ 34#endif /* SPEAR_DMA_H */
diff --git a/include/target/iscsi/iscsi_transport.h b/include/target/iscsi/iscsi_transport.h
index a12589c4ee92..ae5a17111968 100644
--- a/include/target/iscsi/iscsi_transport.h
+++ b/include/target/iscsi/iscsi_transport.h
@@ -94,7 +94,7 @@ extern int iscsit_tmr_post_handler(struct iscsi_cmd *, struct iscsi_conn *);
94/* 94/*
95 * From iscsi_target_util.c 95 * From iscsi_target_util.c
96 */ 96 */
97extern struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *, gfp_t); 97extern struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *, int);
98extern int iscsit_sequence_cmd(struct iscsi_conn *, struct iscsi_cmd *, 98extern int iscsit_sequence_cmd(struct iscsi_conn *, struct iscsi_cmd *,
99 unsigned char *, __be32); 99 unsigned char *, __be32);
100extern void iscsit_release_cmd(struct iscsi_cmd *); 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 39e0114d70c5..7020e33e742e 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -41,6 +41,9 @@ struct se_subsystem_api {
41 unsigned int (*get_io_opt)(struct se_device *); 41 unsigned int (*get_io_opt)(struct se_device *);
42 unsigned char *(*get_sense_buffer)(struct se_cmd *); 42 unsigned char *(*get_sense_buffer)(struct se_cmd *);
43 bool (*get_write_cache)(struct se_device *); 43 bool (*get_write_cache)(struct se_device *);
44 int (*init_prot)(struct se_device *);
45 int (*format_prot)(struct se_device *);
46 void (*free_prot)(struct se_device *);
44}; 47};
45 48
46struct sbc_ops { 49struct sbc_ops {
@@ -70,6 +73,10 @@ sense_reason_t sbc_execute_unmap(struct se_cmd *cmd,
70 sense_reason_t (*do_unmap_fn)(struct se_cmd *cmd, void *priv, 73 sense_reason_t (*do_unmap_fn)(struct se_cmd *cmd, void *priv,
71 sector_t lba, sector_t nolb), 74 sector_t lba, sector_t nolb),
72 void *priv); 75 void *priv);
76sense_reason_t sbc_dif_verify_write(struct se_cmd *, sector_t, unsigned int,
77 unsigned int, struct scatterlist *, int);
78sense_reason_t sbc_dif_verify_read(struct se_cmd *, sector_t, unsigned int,
79 unsigned int, struct scatterlist *, int);
73 80
74void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); 81void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *);
75int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); 82int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *);
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 321301c0a643..c9c791209cd1 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -37,6 +37,9 @@
37/* Used by transport_send_check_condition_and_sense() */ 37/* Used by transport_send_check_condition_and_sense() */
38#define SPC_SENSE_KEY_OFFSET 2 38#define SPC_SENSE_KEY_OFFSET 2
39#define SPC_ADD_SENSE_LEN_OFFSET 7 39#define SPC_ADD_SENSE_LEN_OFFSET 7
40#define SPC_DESC_TYPE_OFFSET 8
41#define SPC_ADDITIONAL_DESC_LEN_OFFSET 9
42#define SPC_VALIDITY_OFFSET 10
40#define SPC_ASC_KEY_OFFSET 12 43#define SPC_ASC_KEY_OFFSET 12
41#define SPC_ASCQ_KEY_OFFSET 13 44#define SPC_ASCQ_KEY_OFFSET 13
42#define TRANSPORT_IQN_LEN 224 45#define TRANSPORT_IQN_LEN 224
@@ -112,7 +115,7 @@
112/* Queue Algorithm Modifier default for restricted reordering in control mode page */ 115/* Queue Algorithm Modifier default for restricted reordering in control mode page */
113#define DA_EMULATE_REST_REORD 0 116#define DA_EMULATE_REST_REORD 0
114 117
115#define SE_INQUIRY_BUF 512 118#define SE_INQUIRY_BUF 1024
116#define SE_MODE_PAGE_BUF 512 119#define SE_MODE_PAGE_BUF 512
117#define SE_SENSE_BUF 96 120#define SE_SENSE_BUF 96
118 121
@@ -205,6 +208,9 @@ enum tcm_sense_reason_table {
205 TCM_OUT_OF_RESOURCES = R(0x12), 208 TCM_OUT_OF_RESOURCES = R(0x12),
206 TCM_PARAMETER_LIST_LENGTH_ERROR = R(0x13), 209 TCM_PARAMETER_LIST_LENGTH_ERROR = R(0x13),
207 TCM_MISCOMPARE_VERIFY = R(0x14), 210 TCM_MISCOMPARE_VERIFY = R(0x14),
211 TCM_LOGICAL_BLOCK_GUARD_CHECK_FAILED = R(0x15),
212 TCM_LOGICAL_BLOCK_APP_TAG_CHECK_FAILED = R(0x16),
213 TCM_LOGICAL_BLOCK_REF_TAG_CHECK_FAILED = R(0x17),
208#undef R 214#undef R
209}; 215};
210 216
@@ -247,10 +253,28 @@ typedef enum {
247 253
248struct se_cmd; 254struct se_cmd;
249 255
256struct t10_alua_lba_map_member {
257 struct list_head lba_map_mem_list;
258 int lba_map_mem_alua_state;
259 int lba_map_mem_alua_pg_id;
260};
261
262struct t10_alua_lba_map {
263 u64 lba_map_first_lba;
264 u64 lba_map_last_lba;
265 struct list_head lba_map_list;
266 struct list_head lba_map_mem_list;
267};
268
250struct t10_alua { 269struct t10_alua {
251 /* ALUA Target Port Group ID */ 270 /* ALUA Target Port Group ID */
252 u16 alua_tg_pt_gps_counter; 271 u16 alua_tg_pt_gps_counter;
253 u32 alua_tg_pt_gps_count; 272 u32 alua_tg_pt_gps_count;
273 /* Referrals support */
274 spinlock_t lba_map_lock;
275 u32 lba_map_segment_size;
276 u32 lba_map_segment_multiplier;
277 struct list_head lba_map_list;
254 spinlock_t tg_pt_gps_lock; 278 spinlock_t tg_pt_gps_lock;
255 struct se_device *t10_dev; 279 struct se_device *t10_dev;
256 /* Used for default ALUA Target Port Group */ 280 /* Used for default ALUA Target Port Group */
@@ -284,6 +308,8 @@ struct t10_alua_tg_pt_gp {
284 u16 tg_pt_gp_id; 308 u16 tg_pt_gp_id;
285 int tg_pt_gp_valid_id; 309 int tg_pt_gp_valid_id;
286 int tg_pt_gp_alua_supported_states; 310 int tg_pt_gp_alua_supported_states;
311 int tg_pt_gp_alua_pending_state;
312 int tg_pt_gp_alua_previous_state;
287 int tg_pt_gp_alua_access_status; 313 int tg_pt_gp_alua_access_status;
288 int tg_pt_gp_alua_access_type; 314 int tg_pt_gp_alua_access_type;
289 int tg_pt_gp_nonop_delay_msecs; 315 int tg_pt_gp_nonop_delay_msecs;
@@ -291,9 +317,6 @@ struct t10_alua_tg_pt_gp {
291 int tg_pt_gp_implicit_trans_secs; 317 int tg_pt_gp_implicit_trans_secs;
292 int tg_pt_gp_pref; 318 int tg_pt_gp_pref;
293 int tg_pt_gp_write_metadata; 319 int tg_pt_gp_write_metadata;
294 /* Used by struct t10_alua_tg_pt_gp->tg_pt_gp_md_buf_len */
295#define ALUA_MD_BUF_LEN 1024
296 u32 tg_pt_gp_md_buf_len;
297 u32 tg_pt_gp_members; 320 u32 tg_pt_gp_members;
298 atomic_t tg_pt_gp_alua_access_state; 321 atomic_t tg_pt_gp_alua_access_state;
299 atomic_t tg_pt_gp_ref_cnt; 322 atomic_t tg_pt_gp_ref_cnt;
@@ -303,6 +326,10 @@ struct t10_alua_tg_pt_gp {
303 struct config_group tg_pt_gp_group; 326 struct config_group tg_pt_gp_group;
304 struct list_head tg_pt_gp_list; 327 struct list_head tg_pt_gp_list;
305 struct list_head tg_pt_gp_mem_list; 328 struct list_head tg_pt_gp_mem_list;
329 struct se_port *tg_pt_gp_alua_port;
330 struct se_node_acl *tg_pt_gp_alua_nacl;
331 struct delayed_work tg_pt_gp_transition_work;
332 struct completion *tg_pt_gp_transition_complete;
306}; 333};
307 334
308struct t10_alua_tg_pt_gp_member { 335struct t10_alua_tg_pt_gp_member {
@@ -414,6 +441,34 @@ struct se_tmr_req {
414 struct list_head tmr_list; 441 struct list_head tmr_list;
415}; 442};
416 443
444enum target_prot_op {
445 TARGET_PROT_NORMAL = 0,
446 TARGET_PROT_DIN_INSERT,
447 TARGET_PROT_DOUT_INSERT,
448 TARGET_PROT_DIN_STRIP,
449 TARGET_PROT_DOUT_STRIP,
450 TARGET_PROT_DIN_PASS,
451 TARGET_PROT_DOUT_PASS,
452};
453
454enum target_prot_ho {
455 PROT_SEPERATED,
456 PROT_INTERLEAVED,
457};
458
459enum target_prot_type {
460 TARGET_DIF_TYPE0_PROT,
461 TARGET_DIF_TYPE1_PROT,
462 TARGET_DIF_TYPE2_PROT,
463 TARGET_DIF_TYPE3_PROT,
464};
465
466struct se_dif_v1_tuple {
467 __be16 guard_tag;
468 __be16 app_tag;
469 __be32 ref_tag;
470};
471
417struct se_cmd { 472struct se_cmd {
418 /* SAM response code being sent to initiator */ 473 /* SAM response code being sent to initiator */
419 u8 scsi_status; 474 u8 scsi_status;
@@ -497,14 +552,24 @@ struct se_cmd {
497 void *priv; 552 void *priv;
498 553
499 /* Used for lun->lun_ref counting */ 554 /* Used for lun->lun_ref counting */
500 bool lun_ref_active; 555 int lun_ref_active;
556
557 /* DIF related members */
558 enum target_prot_op prot_op;
559 enum target_prot_type prot_type;
560 u32 prot_length;
561 u32 reftag_seed;
562 struct scatterlist *t_prot_sg;
563 unsigned int t_prot_nents;
564 enum target_prot_ho prot_handover;
565 sense_reason_t pi_err;
566 sector_t bad_sector;
501}; 567};
502 568
503struct se_ua { 569struct se_ua {
504 u8 ua_asc; 570 u8 ua_asc;
505 u8 ua_ascq; 571 u8 ua_ascq;
506 struct se_node_acl *ua_nacl; 572 struct se_node_acl *ua_nacl;
507 struct list_head ua_dev_list;
508 struct list_head ua_nacl_list; 573 struct list_head ua_nacl_list;
509}; 574};
510 575
@@ -605,6 +670,9 @@ struct se_dev_attrib {
605 int emulate_tpws; 670 int emulate_tpws;
606 int emulate_caw; 671 int emulate_caw;
607 int emulate_3pc; 672 int emulate_3pc;
673 int pi_prot_format;
674 enum target_prot_type pi_prot_type;
675 enum target_prot_type hw_pi_prot_type;
608 int enforce_pr_isids; 676 int enforce_pr_isids;
609 int is_nonrot; 677 int is_nonrot;
610 int emulate_rest_reord; 678 int emulate_rest_reord;
@@ -736,6 +804,8 @@ struct se_device {
736 /* Linked list for struct se_hba struct se_device list */ 804 /* Linked list for struct se_hba struct se_device list */
737 struct list_head dev_list; 805 struct list_head dev_list;
738 struct se_lun xcopy_lun; 806 struct se_lun xcopy_lun;
807 /* Protection Information */
808 int prot_length;
739}; 809};
740 810
741struct se_hba { 811struct se_hba {
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index 4cf4fda404a3..0218d689b3d7 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -105,7 +105,8 @@ sense_reason_t transport_lookup_cmd_lun(struct se_cmd *, u32);
105sense_reason_t target_setup_cmd_from_cdb(struct se_cmd *, unsigned char *); 105sense_reason_t target_setup_cmd_from_cdb(struct se_cmd *, unsigned char *);
106int target_submit_cmd_map_sgls(struct se_cmd *, struct se_session *, 106int target_submit_cmd_map_sgls(struct se_cmd *, struct se_session *,
107 unsigned char *, unsigned char *, u32, u32, int, int, int, 107 unsigned char *, unsigned char *, u32, u32, int, int, int,
108 struct scatterlist *, u32, struct scatterlist *, u32); 108 struct scatterlist *, u32, struct scatterlist *, u32,
109 struct scatterlist *, u32);
109int target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *, 110int target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *,
110 unsigned char *, u32, u32, int, int, int); 111 unsigned char *, u32, u32, int, int, int);
111int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, 112int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
diff --git a/include/trace/events/bcache.h b/include/trace/events/bcache.h
index e2b9576d00e2..7110897c3dfa 100644
--- a/include/trace/events/bcache.h
+++ b/include/trace/events/bcache.h
@@ -24,10 +24,10 @@ DECLARE_EVENT_CLASS(bcache_request,
24 __entry->dev = bio->bi_bdev->bd_dev; 24 __entry->dev = bio->bi_bdev->bd_dev;
25 __entry->orig_major = d->disk->major; 25 __entry->orig_major = d->disk->major;
26 __entry->orig_minor = d->disk->first_minor; 26 __entry->orig_minor = d->disk->first_minor;
27 __entry->sector = bio->bi_sector; 27 __entry->sector = bio->bi_iter.bi_sector;
28 __entry->orig_sector = bio->bi_sector - 16; 28 __entry->orig_sector = bio->bi_iter.bi_sector - 16;
29 __entry->nr_sector = bio->bi_size >> 9; 29 __entry->nr_sector = bio->bi_iter.bi_size >> 9;
30 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 30 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size);
31 ), 31 ),
32 32
33 TP_printk("%d,%d %s %llu + %u (from %d,%d @ %llu)", 33 TP_printk("%d,%d %s %llu + %u (from %d,%d @ %llu)",
@@ -99,9 +99,9 @@ DECLARE_EVENT_CLASS(bcache_bio,
99 99
100 TP_fast_assign( 100 TP_fast_assign(
101 __entry->dev = bio->bi_bdev->bd_dev; 101 __entry->dev = bio->bi_bdev->bd_dev;
102 __entry->sector = bio->bi_sector; 102 __entry->sector = bio->bi_iter.bi_sector;
103 __entry->nr_sector = bio->bi_size >> 9; 103 __entry->nr_sector = bio->bi_iter.bi_size >> 9;
104 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 104 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size);
105 ), 105 ),
106 106
107 TP_printk("%d,%d %s %llu + %u", 107 TP_printk("%d,%d %s %llu + %u",
@@ -134,9 +134,9 @@ TRACE_EVENT(bcache_read,
134 134
135 TP_fast_assign( 135 TP_fast_assign(
136 __entry->dev = bio->bi_bdev->bd_dev; 136 __entry->dev = bio->bi_bdev->bd_dev;
137 __entry->sector = bio->bi_sector; 137 __entry->sector = bio->bi_iter.bi_sector;
138 __entry->nr_sector = bio->bi_size >> 9; 138 __entry->nr_sector = bio->bi_iter.bi_size >> 9;
139 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 139 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size);
140 __entry->cache_hit = hit; 140 __entry->cache_hit = hit;
141 __entry->bypass = bypass; 141 __entry->bypass = bypass;
142 ), 142 ),
@@ -162,9 +162,9 @@ TRACE_EVENT(bcache_write,
162 162
163 TP_fast_assign( 163 TP_fast_assign(
164 __entry->dev = bio->bi_bdev->bd_dev; 164 __entry->dev = bio->bi_bdev->bd_dev;
165 __entry->sector = bio->bi_sector; 165 __entry->sector = bio->bi_iter.bi_sector;
166 __entry->nr_sector = bio->bi_size >> 9; 166 __entry->nr_sector = bio->bi_iter.bi_size >> 9;
167 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 167 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size);
168 __entry->writeback = writeback; 168 __entry->writeback = writeback;
169 __entry->bypass = bypass; 169 __entry->bypass = bypass;
170 ), 170 ),
@@ -247,7 +247,7 @@ TRACE_EVENT(bcache_btree_write,
247 TP_fast_assign( 247 TP_fast_assign(
248 __entry->bucket = PTR_BUCKET_NR(b->c, &b->key, 0); 248 __entry->bucket = PTR_BUCKET_NR(b->c, &b->key, 0);
249 __entry->block = b->written; 249 __entry->block = b->written;
250 __entry->keys = b->sets[b->nsets].data->keys; 250 __entry->keys = b->keys.set[b->keys.nsets].data->keys;
251 ), 251 ),
252 252
253 TP_printk("bucket %zu", __entry->bucket) 253 TP_printk("bucket %zu", __entry->bucket)
@@ -411,7 +411,7 @@ TRACE_EVENT(bcache_alloc_invalidate,
411 ), 411 ),
412 412
413 TP_fast_assign( 413 TP_fast_assign(
414 __entry->free = fifo_used(&ca->free); 414 __entry->free = fifo_used(&ca->free[RESERVE_NONE]);
415 __entry->free_inc = fifo_used(&ca->free_inc); 415 __entry->free_inc = fifo_used(&ca->free_inc);
416 __entry->free_inc_size = ca->free_inc.size; 416 __entry->free_inc_size = ca->free_inc.size;
417 __entry->unused = fifo_used(&ca->unused); 417 __entry->unused = fifo_used(&ca->unused);
@@ -422,8 +422,8 @@ TRACE_EVENT(bcache_alloc_invalidate,
422); 422);
423 423
424TRACE_EVENT(bcache_alloc_fail, 424TRACE_EVENT(bcache_alloc_fail,
425 TP_PROTO(struct cache *ca), 425 TP_PROTO(struct cache *ca, unsigned reserve),
426 TP_ARGS(ca), 426 TP_ARGS(ca, reserve),
427 427
428 TP_STRUCT__entry( 428 TP_STRUCT__entry(
429 __field(unsigned, free ) 429 __field(unsigned, free )
@@ -433,7 +433,7 @@ TRACE_EVENT(bcache_alloc_fail,
433 ), 433 ),
434 434
435 TP_fast_assign( 435 TP_fast_assign(
436 __entry->free = fifo_used(&ca->free); 436 __entry->free = fifo_used(&ca->free[reserve]);
437 __entry->free_inc = fifo_used(&ca->free_inc); 437 __entry->free_inc = fifo_used(&ca->free_inc);
438 __entry->unused = fifo_used(&ca->unused); 438 __entry->unused = fifo_used(&ca->unused);
439 __entry->blocked = atomic_read(&ca->set->prio_blocked); 439 __entry->blocked = atomic_read(&ca->set->prio_blocked);
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index 4c2301d2ef1a..e76ae19a8d6f 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -243,9 +243,9 @@ TRACE_EVENT(block_bio_bounce,
243 TP_fast_assign( 243 TP_fast_assign(
244 __entry->dev = bio->bi_bdev ? 244 __entry->dev = bio->bi_bdev ?
245 bio->bi_bdev->bd_dev : 0; 245 bio->bi_bdev->bd_dev : 0;
246 __entry->sector = bio->bi_sector; 246 __entry->sector = bio->bi_iter.bi_sector;
247 __entry->nr_sector = bio_sectors(bio); 247 __entry->nr_sector = bio_sectors(bio);
248 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 248 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size);
249 memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 249 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
250 ), 250 ),
251 251
@@ -280,10 +280,10 @@ TRACE_EVENT(block_bio_complete,
280 280
281 TP_fast_assign( 281 TP_fast_assign(
282 __entry->dev = bio->bi_bdev->bd_dev; 282 __entry->dev = bio->bi_bdev->bd_dev;
283 __entry->sector = bio->bi_sector; 283 __entry->sector = bio->bi_iter.bi_sector;
284 __entry->nr_sector = bio_sectors(bio); 284 __entry->nr_sector = bio_sectors(bio);
285 __entry->error = error; 285 __entry->error = error;
286 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 286 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size);
287 ), 287 ),
288 288
289 TP_printk("%d,%d %s %llu + %u [%d]", 289 TP_printk("%d,%d %s %llu + %u [%d]",
@@ -308,9 +308,9 @@ DECLARE_EVENT_CLASS(block_bio_merge,
308 308
309 TP_fast_assign( 309 TP_fast_assign(
310 __entry->dev = bio->bi_bdev->bd_dev; 310 __entry->dev = bio->bi_bdev->bd_dev;
311 __entry->sector = bio->bi_sector; 311 __entry->sector = bio->bi_iter.bi_sector;
312 __entry->nr_sector = bio_sectors(bio); 312 __entry->nr_sector = bio_sectors(bio);
313 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 313 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size);
314 memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 314 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
315 ), 315 ),
316 316
@@ -375,9 +375,9 @@ TRACE_EVENT(block_bio_queue,
375 375
376 TP_fast_assign( 376 TP_fast_assign(
377 __entry->dev = bio->bi_bdev->bd_dev; 377 __entry->dev = bio->bi_bdev->bd_dev;
378 __entry->sector = bio->bi_sector; 378 __entry->sector = bio->bi_iter.bi_sector;
379 __entry->nr_sector = bio_sectors(bio); 379 __entry->nr_sector = bio_sectors(bio);
380 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 380 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size);
381 memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 381 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
382 ), 382 ),
383 383
@@ -403,7 +403,7 @@ DECLARE_EVENT_CLASS(block_get_rq,
403 403
404 TP_fast_assign( 404 TP_fast_assign(
405 __entry->dev = bio ? bio->bi_bdev->bd_dev : 0; 405 __entry->dev = bio ? bio->bi_bdev->bd_dev : 0;
406 __entry->sector = bio ? bio->bi_sector : 0; 406 __entry->sector = bio ? bio->bi_iter.bi_sector : 0;
407 __entry->nr_sector = bio ? bio_sectors(bio) : 0; 407 __entry->nr_sector = bio ? bio_sectors(bio) : 0;
408 blk_fill_rwbs(__entry->rwbs, 408 blk_fill_rwbs(__entry->rwbs,
409 bio ? bio->bi_rw : 0, __entry->nr_sector); 409 bio ? bio->bi_rw : 0, __entry->nr_sector);
@@ -538,9 +538,9 @@ TRACE_EVENT(block_split,
538 538
539 TP_fast_assign( 539 TP_fast_assign(
540 __entry->dev = bio->bi_bdev->bd_dev; 540 __entry->dev = bio->bi_bdev->bd_dev;
541 __entry->sector = bio->bi_sector; 541 __entry->sector = bio->bi_iter.bi_sector;
542 __entry->new_sector = new_sector; 542 __entry->new_sector = new_sector;
543 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 543 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size);
544 memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 544 memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
545 ), 545 ),
546 546
@@ -579,11 +579,11 @@ TRACE_EVENT(block_bio_remap,
579 579
580 TP_fast_assign( 580 TP_fast_assign(
581 __entry->dev = bio->bi_bdev->bd_dev; 581 __entry->dev = bio->bi_bdev->bd_dev;
582 __entry->sector = bio->bi_sector; 582 __entry->sector = bio->bi_iter.bi_sector;
583 __entry->nr_sector = bio_sectors(bio); 583 __entry->nr_sector = bio_sectors(bio);
584 __entry->old_dev = dev; 584 __entry->old_dev = dev;
585 __entry->old_sector = from; 585 __entry->old_sector = from;
586 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 586 blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_iter.bi_size);
587 ), 587 ),
588 588
589 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu", 589 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 4832d75dcbae..3176cdc32937 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -208,17 +208,18 @@ TRACE_EVENT_CONDITION(btrfs_get_extent,
208 __entry->refs, __entry->compress_type) 208 __entry->refs, __entry->compress_type)
209); 209);
210 210
211#define show_ordered_flags(flags) \ 211#define show_ordered_flags(flags) \
212 __print_symbolic(flags, \ 212 __print_flags(flags, "|", \
213 { BTRFS_ORDERED_IO_DONE, "IO_DONE" }, \ 213 { (1 << BTRFS_ORDERED_IO_DONE), "IO_DONE" }, \
214 { BTRFS_ORDERED_COMPLETE, "COMPLETE" }, \ 214 { (1 << BTRFS_ORDERED_COMPLETE), "COMPLETE" }, \
215 { BTRFS_ORDERED_NOCOW, "NOCOW" }, \ 215 { (1 << BTRFS_ORDERED_NOCOW), "NOCOW" }, \
216 { BTRFS_ORDERED_COMPRESSED, "COMPRESSED" }, \ 216 { (1 << BTRFS_ORDERED_COMPRESSED), "COMPRESSED" }, \
217 { BTRFS_ORDERED_PREALLOC, "PREALLOC" }, \ 217 { (1 << BTRFS_ORDERED_PREALLOC), "PREALLOC" }, \
218 { BTRFS_ORDERED_DIRECT, "DIRECT" }, \ 218 { (1 << BTRFS_ORDERED_DIRECT), "DIRECT" }, \
219 { BTRFS_ORDERED_IOERR, "IOERR" }, \ 219 { (1 << BTRFS_ORDERED_IOERR), "IOERR" }, \
220 { BTRFS_ORDERED_UPDATED_ISIZE, "UPDATED_ISIZE" }, \ 220 { (1 << BTRFS_ORDERED_UPDATED_ISIZE), "UPDATED_ISIZE" }, \
221 { BTRFS_ORDERED_LOGGED_CSUM, "LOGGED_CSUM" }) 221 { (1 << BTRFS_ORDERED_LOGGED_CSUM), "LOGGED_CSUM" }, \
222 { (1 << BTRFS_ORDERED_TRUNCATED), "TRUNCATED" })
222 223
223 224
224DECLARE_EVENT_CLASS(btrfs__ordered_extent, 225DECLARE_EVENT_CLASS(btrfs__ordered_extent,
diff --git a/include/trace/events/compaction.h b/include/trace/events/compaction.h
index fde1b3e94c7d..06f544ef2f6f 100644
--- a/include/trace/events/compaction.h
+++ b/include/trace/events/compaction.h
@@ -67,6 +67,48 @@ TRACE_EVENT(mm_compaction_migratepages,
67 __entry->nr_failed) 67 __entry->nr_failed)
68); 68);
69 69
70TRACE_EVENT(mm_compaction_begin,
71 TP_PROTO(unsigned long zone_start, unsigned long migrate_start,
72 unsigned long free_start, unsigned long zone_end),
73
74 TP_ARGS(zone_start, migrate_start, free_start, zone_end),
75
76 TP_STRUCT__entry(
77 __field(unsigned long, zone_start)
78 __field(unsigned long, migrate_start)
79 __field(unsigned long, free_start)
80 __field(unsigned long, zone_end)
81 ),
82
83 TP_fast_assign(
84 __entry->zone_start = zone_start;
85 __entry->migrate_start = migrate_start;
86 __entry->free_start = free_start;
87 __entry->zone_end = zone_end;
88 ),
89
90 TP_printk("zone_start=%lu migrate_start=%lu free_start=%lu zone_end=%lu",
91 __entry->zone_start,
92 __entry->migrate_start,
93 __entry->free_start,
94 __entry->zone_end)
95);
96
97TRACE_EVENT(mm_compaction_end,
98 TP_PROTO(int status),
99
100 TP_ARGS(status),
101
102 TP_STRUCT__entry(
103 __field(int, status)
104 ),
105
106 TP_fast_assign(
107 __entry->status = status;
108 ),
109
110 TP_printk("status=%d", __entry->status)
111);
70 112
71#endif /* _TRACE_COMPACTION_H */ 113#endif /* _TRACE_COMPACTION_H */
72 114
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index e0dc355fa317..67f38faac589 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -16,15 +16,28 @@
16 { META, "META" }, \ 16 { META, "META" }, \
17 { META_FLUSH, "META_FLUSH" }) 17 { META_FLUSH, "META_FLUSH" })
18 18
19#define show_bio_type(type) \ 19#define F2FS_BIO_MASK(t) (t & (READA | WRITE_FLUSH_FUA))
20 __print_symbolic(type, \ 20#define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO))
21 { READ, "READ" }, \ 21
22 { READA, "READAHEAD" }, \ 22#define show_bio_type(type) show_bio_base(type), show_bio_extra(type)
23 { READ_SYNC, "READ_SYNC" }, \ 23
24 { WRITE, "WRITE" }, \ 24#define show_bio_base(type) \
25 { WRITE_SYNC, "WRITE_SYNC" }, \ 25 __print_symbolic(F2FS_BIO_MASK(type), \
26 { WRITE_FLUSH, "WRITE_FLUSH" }, \ 26 { READ, "READ" }, \
27 { WRITE_FUA, "WRITE_FUA" }) 27 { READA, "READAHEAD" }, \
28 { READ_SYNC, "READ_SYNC" }, \
29 { WRITE, "WRITE" }, \
30 { WRITE_SYNC, "WRITE_SYNC" }, \
31 { WRITE_FLUSH, "WRITE_FLUSH" }, \
32 { WRITE_FUA, "WRITE_FUA" }, \
33 { WRITE_FLUSH_FUA, "WRITE_FLUSH_FUA" })
34
35#define show_bio_extra(type) \
36 __print_symbolic(F2FS_BIO_EXTRA_MASK(type), \
37 { REQ_META, "(M)" }, \
38 { REQ_PRIO, "(P)" }, \
39 { REQ_META | REQ_PRIO, "(MP)" }, \
40 { 0, " \b" })
28 41
29#define show_data_type(type) \ 42#define show_data_type(type) \
30 __print_symbolic(type, \ 43 __print_symbolic(type, \
@@ -421,7 +434,7 @@ TRACE_EVENT(f2fs_truncate_partial_nodes,
421 __entry->err) 434 __entry->err)
422); 435);
423 436
424TRACE_EVENT_CONDITION(f2fs_readpage, 437TRACE_EVENT_CONDITION(f2fs_submit_page_bio,
425 438
426 TP_PROTO(struct page *page, sector_t blkaddr, int type), 439 TP_PROTO(struct page *page, sector_t blkaddr, int type),
427 440
@@ -446,7 +459,7 @@ TRACE_EVENT_CONDITION(f2fs_readpage,
446 ), 459 ),
447 460
448 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, " 461 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
449 "blkaddr = 0x%llx, bio_type = %s", 462 "blkaddr = 0x%llx, bio_type = %s%s",
450 show_dev_ino(__entry), 463 show_dev_ino(__entry),
451 (unsigned long)__entry->index, 464 (unsigned long)__entry->index,
452 (unsigned long long)__entry->blkaddr, 465 (unsigned long long)__entry->blkaddr,
@@ -598,36 +611,54 @@ TRACE_EVENT(f2fs_reserve_new_block,
598 __entry->ofs_in_node) 611 __entry->ofs_in_node)
599); 612);
600 613
601TRACE_EVENT(f2fs_do_submit_bio, 614DECLARE_EVENT_CLASS(f2fs__submit_bio,
602 615
603 TP_PROTO(struct super_block *sb, int btype, bool sync, struct bio *bio), 616 TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio),
604 617
605 TP_ARGS(sb, btype, sync, bio), 618 TP_ARGS(sb, rw, type, bio),
606 619
607 TP_STRUCT__entry( 620 TP_STRUCT__entry(
608 __field(dev_t, dev) 621 __field(dev_t, dev)
609 __field(int, btype) 622 __field(int, rw)
610 __field(bool, sync) 623 __field(int, type)
611 __field(sector_t, sector) 624 __field(sector_t, sector)
612 __field(unsigned int, size) 625 __field(unsigned int, size)
613 ), 626 ),
614 627
615 TP_fast_assign( 628 TP_fast_assign(
616 __entry->dev = sb->s_dev; 629 __entry->dev = sb->s_dev;
617 __entry->btype = btype; 630 __entry->rw = rw;
618 __entry->sync = sync; 631 __entry->type = type;
619 __entry->sector = bio->bi_sector; 632 __entry->sector = bio->bi_iter.bi_sector;
620 __entry->size = bio->bi_size; 633 __entry->size = bio->bi_iter.bi_size;
621 ), 634 ),
622 635
623 TP_printk("dev = (%d,%d), type = %s, io = %s, sector = %lld, size = %u", 636 TP_printk("dev = (%d,%d), %s%s, %s, sector = %lld, size = %u",
624 show_dev(__entry), 637 show_dev(__entry),
625 show_block_type(__entry->btype), 638 show_bio_type(__entry->rw),
626 __entry->sync ? "sync" : "no sync", 639 show_block_type(__entry->type),
627 (unsigned long long)__entry->sector, 640 (unsigned long long)__entry->sector,
628 __entry->size) 641 __entry->size)
629); 642);
630 643
644DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_write_bio,
645
646 TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio),
647
648 TP_ARGS(sb, rw, type, bio),
649
650 TP_CONDITION(bio)
651);
652
653DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio,
654
655 TP_PROTO(struct super_block *sb, int rw, int type, struct bio *bio),
656
657 TP_ARGS(sb, rw, type, bio),
658
659 TP_CONDITION(bio)
660);
661
631DECLARE_EVENT_CLASS(f2fs__page, 662DECLARE_EVENT_CLASS(f2fs__page,
632 663
633 TP_PROTO(struct page *page, int type), 664 TP_PROTO(struct page *page, int type),
@@ -674,15 +705,16 @@ DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
674 TP_ARGS(page, type) 705 TP_ARGS(page, type)
675); 706);
676 707
677TRACE_EVENT(f2fs_submit_write_page, 708TRACE_EVENT(f2fs_submit_page_mbio,
678 709
679 TP_PROTO(struct page *page, block_t blk_addr, int type), 710 TP_PROTO(struct page *page, int rw, int type, block_t blk_addr),
680 711
681 TP_ARGS(page, blk_addr, type), 712 TP_ARGS(page, rw, type, blk_addr),
682 713
683 TP_STRUCT__entry( 714 TP_STRUCT__entry(
684 __field(dev_t, dev) 715 __field(dev_t, dev)
685 __field(ino_t, ino) 716 __field(ino_t, ino)
717 __field(int, rw)
686 __field(int, type) 718 __field(int, type)
687 __field(pgoff_t, index) 719 __field(pgoff_t, index)
688 __field(block_t, block) 720 __field(block_t, block)
@@ -691,13 +723,15 @@ TRACE_EVENT(f2fs_submit_write_page,
691 TP_fast_assign( 723 TP_fast_assign(
692 __entry->dev = page->mapping->host->i_sb->s_dev; 724 __entry->dev = page->mapping->host->i_sb->s_dev;
693 __entry->ino = page->mapping->host->i_ino; 725 __entry->ino = page->mapping->host->i_ino;
726 __entry->rw = rw;
694 __entry->type = type; 727 __entry->type = type;
695 __entry->index = page->index; 728 __entry->index = page->index;
696 __entry->block = blk_addr; 729 __entry->block = blk_addr;
697 ), 730 ),
698 731
699 TP_printk("dev = (%d,%d), ino = %lu, %s, index = %lu, blkaddr = 0x%llx", 732 TP_printk("dev = (%d,%d), ino = %lu, %s%s, %s, index = %lu, blkaddr = 0x%llx",
700 show_dev_ino(__entry), 733 show_dev_ino(__entry),
734 show_bio_type(__entry->rw),
701 show_block_type(__entry->type), 735 show_block_type(__entry->type),
702 (unsigned long)__entry->index, 736 (unsigned long)__entry->index,
703 (unsigned long long)__entry->block) 737 (unsigned long long)__entry->block)
@@ -727,6 +761,29 @@ TRACE_EVENT(f2fs_write_checkpoint,
727 __entry->msg) 761 __entry->msg)
728); 762);
729 763
764TRACE_EVENT(f2fs_issue_discard,
765
766 TP_PROTO(struct super_block *sb, block_t blkstart, block_t blklen),
767
768 TP_ARGS(sb, blkstart, blklen),
769
770 TP_STRUCT__entry(
771 __field(dev_t, dev)
772 __field(block_t, blkstart)
773 __field(block_t, blklen)
774 ),
775
776 TP_fast_assign(
777 __entry->dev = sb->s_dev;
778 __entry->blkstart = blkstart;
779 __entry->blklen = blklen;
780 ),
781
782 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
783 show_dev(__entry),
784 (unsigned long long)__entry->blkstart,
785 (unsigned long long)__entry->blklen)
786);
730#endif /* _TRACE_F2FS_H */ 787#endif /* _TRACE_F2FS_H */
731 788
732 /* This part must be outside protection */ 789 /* This part must be outside protection */
diff --git a/include/trace/events/migrate.h b/include/trace/events/migrate.h
index ec2a6ccfd7e5..3075ffbb9a83 100644
--- a/include/trace/events/migrate.h
+++ b/include/trace/events/migrate.h
@@ -45,6 +45,32 @@ TRACE_EVENT(mm_migrate_pages,
45 __print_symbolic(__entry->reason, MIGRATE_REASON)) 45 __print_symbolic(__entry->reason, MIGRATE_REASON))
46); 46);
47 47
48TRACE_EVENT(mm_numa_migrate_ratelimit,
49
50 TP_PROTO(struct task_struct *p, int dst_nid, unsigned long nr_pages),
51
52 TP_ARGS(p, dst_nid, nr_pages),
53
54 TP_STRUCT__entry(
55 __array( char, comm, TASK_COMM_LEN)
56 __field( pid_t, pid)
57 __field( int, dst_nid)
58 __field( unsigned long, nr_pages)
59 ),
60
61 TP_fast_assign(
62 memcpy(__entry->comm, p->comm, TASK_COMM_LEN);
63 __entry->pid = p->pid;
64 __entry->dst_nid = dst_nid;
65 __entry->nr_pages = nr_pages;
66 ),
67
68 TP_printk("comm=%s pid=%d dst_nid=%d nr_pages=%lu",
69 __entry->comm,
70 __entry->pid,
71 __entry->dst_nid,
72 __entry->nr_pages)
73);
48#endif /* _TRACE_MIGRATE_H */ 74#endif /* _TRACE_MIGRATE_H */
49 75
50/* This part must be outside protection */ 76/* This part must be outside protection */
diff --git a/include/trace/events/net.h b/include/trace/events/net.h
index f99645d05a8f..a34f27b2e394 100644
--- a/include/trace/events/net.h
+++ b/include/trace/events/net.h
@@ -6,9 +6,67 @@
6 6
7#include <linux/skbuff.h> 7#include <linux/skbuff.h>
8#include <linux/netdevice.h> 8#include <linux/netdevice.h>
9#include <linux/if_vlan.h>
9#include <linux/ip.h> 10#include <linux/ip.h>
10#include <linux/tracepoint.h> 11#include <linux/tracepoint.h>
11 12
13TRACE_EVENT(net_dev_start_xmit,
14
15 TP_PROTO(const struct sk_buff *skb, const struct net_device *dev),
16
17 TP_ARGS(skb, dev),
18
19 TP_STRUCT__entry(
20 __string( name, dev->name )
21 __field( u16, queue_mapping )
22 __field( const void *, skbaddr )
23 __field( bool, vlan_tagged )
24 __field( u16, vlan_proto )
25 __field( u16, vlan_tci )
26 __field( u16, protocol )
27 __field( u8, ip_summed )
28 __field( unsigned int, len )
29 __field( unsigned int, data_len )
30 __field( int, network_offset )
31 __field( bool, transport_offset_valid)
32 __field( int, transport_offset)
33 __field( u8, tx_flags )
34 __field( u16, gso_size )
35 __field( u16, gso_segs )
36 __field( u16, gso_type )
37 ),
38
39 TP_fast_assign(
40 __assign_str(name, dev->name);
41 __entry->queue_mapping = skb->queue_mapping;
42 __entry->skbaddr = skb;
43 __entry->vlan_tagged = vlan_tx_tag_present(skb);
44 __entry->vlan_proto = ntohs(skb->vlan_proto);
45 __entry->vlan_tci = vlan_tx_tag_get(skb);
46 __entry->protocol = ntohs(skb->protocol);
47 __entry->ip_summed = skb->ip_summed;
48 __entry->len = skb->len;
49 __entry->data_len = skb->data_len;
50 __entry->network_offset = skb_network_offset(skb);
51 __entry->transport_offset_valid =
52 skb_transport_header_was_set(skb);
53 __entry->transport_offset = skb_transport_offset(skb);
54 __entry->tx_flags = skb_shinfo(skb)->tx_flags;
55 __entry->gso_size = skb_shinfo(skb)->gso_size;
56 __entry->gso_segs = skb_shinfo(skb)->gso_segs;
57 __entry->gso_type = skb_shinfo(skb)->gso_type;
58 ),
59
60 TP_printk("dev=%s queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x vlan_tci=0x%04x protocol=0x%04x ip_summed=%d len=%u data_len=%u network_offset=%d transport_offset_valid=%d transport_offset=%d tx_flags=%d gso_size=%d gso_segs=%d gso_type=%#x",
61 __get_str(name), __entry->queue_mapping, __entry->skbaddr,
62 __entry->vlan_tagged, __entry->vlan_proto, __entry->vlan_tci,
63 __entry->protocol, __entry->ip_summed, __entry->len,
64 __entry->data_len,
65 __entry->network_offset, __entry->transport_offset_valid,
66 __entry->transport_offset, __entry->tx_flags,
67 __entry->gso_size, __entry->gso_segs, __entry->gso_type)
68);
69
12TRACE_EVENT(net_dev_xmit, 70TRACE_EVENT(net_dev_xmit,
13 71
14 TP_PROTO(struct sk_buff *skb, 72 TP_PROTO(struct sk_buff *skb,
@@ -78,6 +136,106 @@ DEFINE_EVENT(net_dev_template, netif_rx,
78 136
79 TP_ARGS(skb) 137 TP_ARGS(skb)
80); 138);
139
140DECLARE_EVENT_CLASS(net_dev_rx_verbose_template,
141
142 TP_PROTO(const struct sk_buff *skb),
143
144 TP_ARGS(skb),
145
146 TP_STRUCT__entry(
147 __string( name, skb->dev->name )
148 __field( unsigned int, napi_id )
149 __field( u16, queue_mapping )
150 __field( const void *, skbaddr )
151 __field( bool, vlan_tagged )
152 __field( u16, vlan_proto )
153 __field( u16, vlan_tci )
154 __field( u16, protocol )
155 __field( u8, ip_summed )
156 __field( u32, rxhash )
157 __field( bool, l4_rxhash )
158 __field( unsigned int, len )
159 __field( unsigned int, data_len )
160 __field( unsigned int, truesize )
161 __field( bool, mac_header_valid)
162 __field( int, mac_header )
163 __field( unsigned char, nr_frags )
164 __field( u16, gso_size )
165 __field( u16, gso_type )
166 ),
167
168 TP_fast_assign(
169 __assign_str(name, skb->dev->name);
170#ifdef CONFIG_NET_RX_BUSY_POLL
171 __entry->napi_id = skb->napi_id;
172#else
173 __entry->napi_id = 0;
174#endif
175 __entry->queue_mapping = skb->queue_mapping;
176 __entry->skbaddr = skb;
177 __entry->vlan_tagged = vlan_tx_tag_present(skb);
178 __entry->vlan_proto = ntohs(skb->vlan_proto);
179 __entry->vlan_tci = vlan_tx_tag_get(skb);
180 __entry->protocol = ntohs(skb->protocol);
181 __entry->ip_summed = skb->ip_summed;
182 __entry->rxhash = skb->rxhash;
183 __entry->l4_rxhash = skb->l4_rxhash;
184 __entry->len = skb->len;
185 __entry->data_len = skb->data_len;
186 __entry->truesize = skb->truesize;
187 __entry->mac_header_valid = skb_mac_header_was_set(skb);
188 __entry->mac_header = skb_mac_header(skb) - skb->data;
189 __entry->nr_frags = skb_shinfo(skb)->nr_frags;
190 __entry->gso_size = skb_shinfo(skb)->gso_size;
191 __entry->gso_type = skb_shinfo(skb)->gso_type;
192 ),
193
194 TP_printk("dev=%s napi_id=%#x queue_mapping=%u skbaddr=%p vlan_tagged=%d vlan_proto=0x%04x vlan_tci=0x%04x protocol=0x%04x ip_summed=%d rxhash=0x%08x l4_rxhash=%d len=%u data_len=%u truesize=%u mac_header_valid=%d mac_header=%d nr_frags=%d gso_size=%d gso_type=%#x",
195 __get_str(name), __entry->napi_id, __entry->queue_mapping,
196 __entry->skbaddr, __entry->vlan_tagged, __entry->vlan_proto,
197 __entry->vlan_tci, __entry->protocol, __entry->ip_summed,
198 __entry->rxhash, __entry->l4_rxhash, __entry->len,
199 __entry->data_len, __entry->truesize,
200 __entry->mac_header_valid, __entry->mac_header,
201 __entry->nr_frags, __entry->gso_size, __entry->gso_type)
202);
203
204DEFINE_EVENT(net_dev_rx_verbose_template, napi_gro_frags_entry,
205
206 TP_PROTO(const struct sk_buff *skb),
207
208 TP_ARGS(skb)
209);
210
211DEFINE_EVENT(net_dev_rx_verbose_template, napi_gro_receive_entry,
212
213 TP_PROTO(const struct sk_buff *skb),
214
215 TP_ARGS(skb)
216);
217
218DEFINE_EVENT(net_dev_rx_verbose_template, netif_receive_skb_entry,
219
220 TP_PROTO(const struct sk_buff *skb),
221
222 TP_ARGS(skb)
223);
224
225DEFINE_EVENT(net_dev_rx_verbose_template, netif_rx_entry,
226
227 TP_PROTO(const struct sk_buff *skb),
228
229 TP_ARGS(skb)
230);
231
232DEFINE_EVENT(net_dev_rx_verbose_template, netif_rx_ni_entry,
233
234 TP_PROTO(const struct sk_buff *skb),
235
236 TP_ARGS(skb)
237);
238
81#endif /* _TRACE_NET_H */ 239#endif /* _TRACE_NET_H */
82 240
83/* This part must be outside protection */ 241/* This part must be outside protection */
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index cda100d6762d..9e9475c85de5 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -35,6 +35,59 @@ DEFINE_EVENT(cpu, cpu_idle,
35 TP_ARGS(state, cpu_id) 35 TP_ARGS(state, cpu_id)
36); 36);
37 37
38TRACE_EVENT(pstate_sample,
39
40 TP_PROTO(u32 core_busy,
41 u32 scaled_busy,
42 u32 state,
43 u64 mperf,
44 u64 aperf,
45 u32 energy,
46 u32 freq
47 ),
48
49 TP_ARGS(core_busy,
50 scaled_busy,
51 state,
52 mperf,
53 aperf,
54 energy,
55 freq
56 ),
57
58 TP_STRUCT__entry(
59 __field(u32, core_busy)
60 __field(u32, scaled_busy)
61 __field(u32, state)
62 __field(u64, mperf)
63 __field(u64, aperf)
64 __field(u32, energy)
65 __field(u32, freq)
66
67 ),
68
69 TP_fast_assign(
70 __entry->core_busy = core_busy;
71 __entry->scaled_busy = scaled_busy;
72 __entry->state = state;
73 __entry->mperf = mperf;
74 __entry->aperf = aperf;
75 __entry->energy = energy;
76 __entry->freq = freq;
77 ),
78
79 TP_printk("core_busy=%lu scaled=%lu state=%lu mperf=%llu aperf=%llu energy=%lu freq=%lu ",
80 (unsigned long)__entry->core_busy,
81 (unsigned long)__entry->scaled_busy,
82 (unsigned long)__entry->state,
83 (unsigned long long)__entry->mperf,
84 (unsigned long long)__entry->aperf,
85 (unsigned long)__entry->energy,
86 (unsigned long)__entry->freq
87 )
88
89);
90
38/* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */ 91/* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */
39#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING 92#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING
40#define _PWR_EVENT_AVOID_DOUBLE_DEFINING 93#define _PWR_EVENT_AVOID_DOUBLE_DEFINING
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index 04c308413a5d..67e1bbf83695 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -443,6 +443,93 @@ TRACE_EVENT(sched_process_hang,
443); 443);
444#endif /* CONFIG_DETECT_HUNG_TASK */ 444#endif /* CONFIG_DETECT_HUNG_TASK */
445 445
446DECLARE_EVENT_CLASS(sched_move_task_template,
447
448 TP_PROTO(struct task_struct *tsk, int src_cpu, int dst_cpu),
449
450 TP_ARGS(tsk, src_cpu, dst_cpu),
451
452 TP_STRUCT__entry(
453 __field( pid_t, pid )
454 __field( pid_t, tgid )
455 __field( pid_t, ngid )
456 __field( int, src_cpu )
457 __field( int, src_nid )
458 __field( int, dst_cpu )
459 __field( int, dst_nid )
460 ),
461
462 TP_fast_assign(
463 __entry->pid = task_pid_nr(tsk);
464 __entry->tgid = task_tgid_nr(tsk);
465 __entry->ngid = task_numa_group_id(tsk);
466 __entry->src_cpu = src_cpu;
467 __entry->src_nid = cpu_to_node(src_cpu);
468 __entry->dst_cpu = dst_cpu;
469 __entry->dst_nid = cpu_to_node(dst_cpu);
470 ),
471
472 TP_printk("pid=%d tgid=%d ngid=%d src_cpu=%d src_nid=%d dst_cpu=%d dst_nid=%d",
473 __entry->pid, __entry->tgid, __entry->ngid,
474 __entry->src_cpu, __entry->src_nid,
475 __entry->dst_cpu, __entry->dst_nid)
476);
477
478/*
479 * Tracks migration of tasks from one runqueue to another. Can be used to
480 * detect if automatic NUMA balancing is bouncing between nodes
481 */
482DEFINE_EVENT(sched_move_task_template, sched_move_numa,
483 TP_PROTO(struct task_struct *tsk, int src_cpu, int dst_cpu),
484
485 TP_ARGS(tsk, src_cpu, dst_cpu)
486);
487
488DEFINE_EVENT(sched_move_task_template, sched_stick_numa,
489 TP_PROTO(struct task_struct *tsk, int src_cpu, int dst_cpu),
490
491 TP_ARGS(tsk, src_cpu, dst_cpu)
492);
493
494TRACE_EVENT(sched_swap_numa,
495
496 TP_PROTO(struct task_struct *src_tsk, int src_cpu,
497 struct task_struct *dst_tsk, int dst_cpu),
498
499 TP_ARGS(src_tsk, src_cpu, dst_tsk, dst_cpu),
500
501 TP_STRUCT__entry(
502 __field( pid_t, src_pid )
503 __field( pid_t, src_tgid )
504 __field( pid_t, src_ngid )
505 __field( int, src_cpu )
506 __field( int, src_nid )
507 __field( pid_t, dst_pid )
508 __field( pid_t, dst_tgid )
509 __field( pid_t, dst_ngid )
510 __field( int, dst_cpu )
511 __field( int, dst_nid )
512 ),
513
514 TP_fast_assign(
515 __entry->src_pid = task_pid_nr(src_tsk);
516 __entry->src_tgid = task_tgid_nr(src_tsk);
517 __entry->src_ngid = task_numa_group_id(src_tsk);
518 __entry->src_cpu = src_cpu;
519 __entry->src_nid = cpu_to_node(src_cpu);
520 __entry->dst_pid = task_pid_nr(dst_tsk);
521 __entry->dst_tgid = task_tgid_nr(dst_tsk);
522 __entry->dst_ngid = task_numa_group_id(dst_tsk);
523 __entry->dst_cpu = dst_cpu;
524 __entry->dst_nid = cpu_to_node(dst_cpu);
525 ),
526
527 TP_printk("src_pid=%d src_tgid=%d src_ngid=%d src_cpu=%d src_nid=%d dst_pid=%d dst_tgid=%d dst_ngid=%d dst_cpu=%d dst_nid=%d",
528 __entry->src_pid, __entry->src_tgid, __entry->src_ngid,
529 __entry->src_cpu, __entry->src_nid,
530 __entry->dst_pid, __entry->dst_tgid, __entry->dst_ngid,
531 __entry->dst_cpu, __entry->dst_nid)
532);
446#endif /* _TRACE_SCHED_H */ 533#endif /* _TRACE_SCHED_H */
447 534
448/* This part must be outside protection */ 535/* This part must be outside protection */
diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index d51d16c7afd8..ddc179b7a105 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -301,6 +301,7 @@ DECLARE_EVENT_CLASS(xs_socket_event_done,
301 301
302DEFINE_RPC_SOCKET_EVENT(rpc_socket_state_change); 302DEFINE_RPC_SOCKET_EVENT(rpc_socket_state_change);
303DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_connect); 303DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_connect);
304DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_error);
304DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_reset_connection); 305DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_reset_connection);
305DEFINE_RPC_SOCKET_EVENT(rpc_socket_close); 306DEFINE_RPC_SOCKET_EVENT(rpc_socket_close);
306DEFINE_RPC_SOCKET_EVENT(rpc_socket_shutdown); 307DEFINE_RPC_SOCKET_EVENT(rpc_socket_shutdown);
diff --git a/include/trace/events/v4l2.h b/include/trace/events/v4l2.h
new file mode 100644
index 000000000000..ef94ecad1c94
--- /dev/null
+++ b/include/trace/events/v4l2.h
@@ -0,0 +1,157 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM v4l2
3
4#if !defined(_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_V4L2_H
6
7#include <linux/tracepoint.h>
8
9#define show_type(type) \
10 __print_symbolic(type, \
11 { V4L2_BUF_TYPE_VIDEO_CAPTURE, "VIDEO_CAPTURE" }, \
12 { V4L2_BUF_TYPE_VIDEO_OUTPUT, "VIDEO_OUTPUT" }, \
13 { V4L2_BUF_TYPE_VIDEO_OVERLAY, "VIDEO_OVERLAY" }, \
14 { V4L2_BUF_TYPE_VBI_CAPTURE, "VBI_CAPTURE" }, \
15 { V4L2_BUF_TYPE_VBI_OUTPUT, "VBI_OUTPUT" }, \
16 { V4L2_BUF_TYPE_SLICED_VBI_CAPTURE, "SLICED_VBI_CAPTURE" }, \
17 { V4L2_BUF_TYPE_SLICED_VBI_OUTPUT, "SLICED_VBI_OUTPUT" }, \
18 { V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY, "VIDEO_OUTPUT_OVERLAY" },\
19 { V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, "VIDEO_CAPTURE_MPLANE" },\
20 { V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, "VIDEO_OUTPUT_MPLANE" }, \
21 { V4L2_BUF_TYPE_PRIVATE, "PRIVATE" })
22
23#define show_field(field) \
24 __print_symbolic(field, \
25 { V4L2_FIELD_ANY, "ANY" }, \
26 { V4L2_FIELD_NONE, "NONE" }, \
27 { V4L2_FIELD_TOP, "TOP" }, \
28 { V4L2_FIELD_BOTTOM, "BOTTOM" }, \
29 { V4L2_FIELD_INTERLACED, "INTERLACED" }, \
30 { V4L2_FIELD_SEQ_TB, "SEQ_TB" }, \
31 { V4L2_FIELD_SEQ_BT, "SEQ_BT" }, \
32 { V4L2_FIELD_ALTERNATE, "ALTERNATE" }, \
33 { V4L2_FIELD_INTERLACED_TB, "INTERLACED_TB" }, \
34 { V4L2_FIELD_INTERLACED_BT, "INTERLACED_BT" })
35
36#define show_timecode_type(type) \
37 __print_symbolic(type, \
38 { V4L2_TC_TYPE_24FPS, "24FPS" }, \
39 { V4L2_TC_TYPE_25FPS, "25FPS" }, \
40 { V4L2_TC_TYPE_30FPS, "30FPS" }, \
41 { V4L2_TC_TYPE_50FPS, "50FPS" }, \
42 { V4L2_TC_TYPE_60FPS, "60FPS" })
43
44#define show_flags(flags) \
45 __print_flags(flags, "|", \
46 { V4L2_BUF_FLAG_MAPPED, "MAPPED" }, \
47 { V4L2_BUF_FLAG_QUEUED, "QUEUED" }, \
48 { V4L2_BUF_FLAG_DONE, "DONE" }, \
49 { V4L2_BUF_FLAG_KEYFRAME, "KEYFRAME" }, \
50 { V4L2_BUF_FLAG_PFRAME, "PFRAME" }, \
51 { V4L2_BUF_FLAG_BFRAME, "BFRAME" }, \
52 { V4L2_BUF_FLAG_ERROR, "ERROR" }, \
53 { V4L2_BUF_FLAG_TIMECODE, "TIMECODE" }, \
54 { V4L2_BUF_FLAG_PREPARED, "PREPARED" }, \
55 { V4L2_BUF_FLAG_NO_CACHE_INVALIDATE, "NO_CACHE_INVALIDATE" }, \
56 { V4L2_BUF_FLAG_NO_CACHE_CLEAN, "NO_CACHE_CLEAN" }, \
57 { V4L2_BUF_FLAG_TIMESTAMP_MASK, "TIMESTAMP_MASK" }, \
58 { V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN, "TIMESTAMP_UNKNOWN" }, \
59 { V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC, "TIMESTAMP_MONOTONIC" }, \
60 { V4L2_BUF_FLAG_TIMESTAMP_COPY, "TIMESTAMP_COPY" })
61
62#define show_timecode_flags(flags) \
63 __print_flags(flags, "|", \
64 { V4L2_TC_FLAG_DROPFRAME, "DROPFRAME" }, \
65 { V4L2_TC_FLAG_COLORFRAME, "COLORFRAME" }, \
66 { V4L2_TC_USERBITS_USERDEFINED, "USERBITS_USERDEFINED" }, \
67 { V4L2_TC_USERBITS_8BITCHARS, "USERBITS_8BITCHARS" })
68
69#define V4L2_TRACE_EVENT(event_name) \
70 TRACE_EVENT(event_name, \
71 TP_PROTO(int minor, struct v4l2_buffer *buf), \
72 \
73 TP_ARGS(minor, buf), \
74 \
75 TP_STRUCT__entry( \
76 __field(int, minor) \
77 __field(u32, index) \
78 __field(u32, type) \
79 __field(u32, bytesused) \
80 __field(u32, flags) \
81 __field(u32, field) \
82 __field(s64, timestamp) \
83 __field(u32, timecode_type) \
84 __field(u32, timecode_flags) \
85 __field(u8, timecode_frames) \
86 __field(u8, timecode_seconds) \
87 __field(u8, timecode_minutes) \
88 __field(u8, timecode_hours) \
89 __field(u8, timecode_userbits0) \
90 __field(u8, timecode_userbits1) \
91 __field(u8, timecode_userbits2) \
92 __field(u8, timecode_userbits3) \
93 __field(u32, sequence) \
94 ), \
95 \
96 TP_fast_assign( \
97 __entry->minor = minor; \
98 __entry->index = buf->index; \
99 __entry->type = buf->type; \
100 __entry->bytesused = buf->bytesused; \
101 __entry->flags = buf->flags; \
102 __entry->field = buf->field; \
103 __entry->timestamp = \
104 timeval_to_ns(&buf->timestamp); \
105 __entry->timecode_type = buf->timecode.type; \
106 __entry->timecode_flags = buf->timecode.flags; \
107 __entry->timecode_frames = \
108 buf->timecode.frames; \
109 __entry->timecode_seconds = \
110 buf->timecode.seconds; \
111 __entry->timecode_minutes = \
112 buf->timecode.minutes; \
113 __entry->timecode_hours = buf->timecode.hours; \
114 __entry->timecode_userbits0 = \
115 buf->timecode.userbits[0]; \
116 __entry->timecode_userbits1 = \
117 buf->timecode.userbits[1]; \
118 __entry->timecode_userbits2 = \
119 buf->timecode.userbits[2]; \
120 __entry->timecode_userbits3 = \
121 buf->timecode.userbits[3]; \
122 __entry->sequence = buf->sequence; \
123 ), \
124 \
125 TP_printk("minor = %d, index = %u, type = %s, " \
126 "bytesused = %u, flags = %s, " \
127 "field = %s, timestamp = %llu, timecode = { " \
128 "type = %s, flags = %s, frames = %u, " \
129 "seconds = %u, minutes = %u, hours = %u, " \
130 "userbits = { %u %u %u %u } }, " \
131 "sequence = %u", __entry->minor, \
132 __entry->index, show_type(__entry->type), \
133 __entry->bytesused, \
134 show_flags(__entry->flags), \
135 show_field(__entry->field), \
136 __entry->timestamp, \
137 show_timecode_type(__entry->timecode_type), \
138 show_timecode_flags(__entry->timecode_flags), \
139 __entry->timecode_frames, \
140 __entry->timecode_seconds, \
141 __entry->timecode_minutes, \
142 __entry->timecode_hours, \
143 __entry->timecode_userbits0, \
144 __entry->timecode_userbits1, \
145 __entry->timecode_userbits2, \
146 __entry->timecode_userbits3, \
147 __entry->sequence \
148 ) \
149 )
150
151V4L2_TRACE_EVENT(v4l2_dqbuf);
152V4L2_TRACE_EVENT(v4l2_qbuf);
153
154#endif /* if !defined(_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) */
155
156/* This part must be outside protection */
157#include <trace/define_trace.h>
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 5c38606613d8..1a8b28db3775 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -418,6 +418,8 @@ static inline notrace int ftrace_get_offsets_##call( \
418 * struct ftrace_event_file *ftrace_file = __data; 418 * struct ftrace_event_file *ftrace_file = __data;
419 * struct ftrace_event_call *event_call = ftrace_file->event_call; 419 * struct ftrace_event_call *event_call = ftrace_file->event_call;
420 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; 420 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets;
421 * unsigned long eflags = ftrace_file->flags;
422 * enum event_trigger_type __tt = ETT_NONE;
421 * struct ring_buffer_event *event; 423 * struct ring_buffer_event *event;
422 * struct ftrace_raw_<call> *entry; <-- defined in stage 1 424 * struct ftrace_raw_<call> *entry; <-- defined in stage 1
423 * struct ring_buffer *buffer; 425 * struct ring_buffer *buffer;
@@ -425,9 +427,12 @@ static inline notrace int ftrace_get_offsets_##call( \
425 * int __data_size; 427 * int __data_size;
426 * int pc; 428 * int pc;
427 * 429 *
428 * if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, 430 * if (!(eflags & FTRACE_EVENT_FL_TRIGGER_COND)) {
429 * &ftrace_file->flags)) 431 * if (eflags & FTRACE_EVENT_FL_TRIGGER_MODE)
430 * return; 432 * event_triggers_call(ftrace_file, NULL);
433 * if (eflags & FTRACE_EVENT_FL_SOFT_DISABLED)
434 * return;
435 * }
431 * 436 *
432 * local_save_flags(irq_flags); 437 * local_save_flags(irq_flags);
433 * pc = preempt_count(); 438 * pc = preempt_count();
@@ -445,8 +450,17 @@ static inline notrace int ftrace_get_offsets_##call( \
445 * { <assign>; } <-- Here we assign the entries by the __field and 450 * { <assign>; } <-- Here we assign the entries by the __field and
446 * __array macros. 451 * __array macros.
447 * 452 *
448 * if (!filter_check_discard(ftrace_file, entry, buffer, event)) 453 * if (eflags & FTRACE_EVENT_FL_TRIGGER_COND)
454 * __tt = event_triggers_call(ftrace_file, entry);
455 *
456 * if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT,
457 * &ftrace_file->flags))
458 * ring_buffer_discard_commit(buffer, event);
459 * else if (!filter_check_discard(ftrace_file, entry, buffer, event))
449 * trace_buffer_unlock_commit(buffer, event, irq_flags, pc); 460 * trace_buffer_unlock_commit(buffer, event, irq_flags, pc);
461 *
462 * if (__tt)
463 * event_triggers_post_call(ftrace_file, __tt);
450 * } 464 * }
451 * 465 *
452 * static struct trace_event ftrace_event_type_<call> = { 466 * static struct trace_event ftrace_event_type_<call> = {
@@ -539,8 +553,7 @@ ftrace_raw_event_##call(void *__data, proto) \
539 int __data_size; \ 553 int __data_size; \
540 int pc; \ 554 int pc; \
541 \ 555 \
542 if (test_bit(FTRACE_EVENT_FL_SOFT_DISABLED_BIT, \ 556 if (ftrace_trigger_soft_disabled(ftrace_file)) \
543 &ftrace_file->flags)) \
544 return; \ 557 return; \
545 \ 558 \
546 local_save_flags(irq_flags); \ 559 local_save_flags(irq_flags); \
@@ -560,8 +573,8 @@ ftrace_raw_event_##call(void *__data, proto) \
560 \ 573 \
561 { assign; } \ 574 { assign; } \
562 \ 575 \
563 if (!filter_check_discard(ftrace_file, entry, buffer, event)) \ 576 event_trigger_unlock_commit(ftrace_file, buffer, event, entry, \
564 trace_buffer_unlock_commit(buffer, event, irq_flags, pc); \ 577 irq_flags, pc); \
565} 578}
566/* 579/*
567 * The ftrace_test_probe is compiled out, it is only here as a build time check 580 * The ftrace_test_probe is compiled out, it is only here as a build time check
diff --git a/include/uapi/asm-generic/ipcbuf.h b/include/uapi/asm-generic/ipcbuf.h
index 76982b2a1b58..3dbcc1e771c0 100644
--- a/include/uapi/asm-generic/ipcbuf.h
+++ b/include/uapi/asm-generic/ipcbuf.h
@@ -27,8 +27,8 @@ struct ipc64_perm {
27 unsigned char __pad1[4 - sizeof(__kernel_mode_t)]; 27 unsigned char __pad1[4 - sizeof(__kernel_mode_t)];
28 unsigned short seq; 28 unsigned short seq;
29 unsigned short __pad2; 29 unsigned short __pad2;
30 unsigned long __unused1; 30 __kernel_ulong_t __unused1;
31 unsigned long __unused2; 31 __kernel_ulong_t __unused2;
32}; 32};
33 33
34#endif /* __ASM_GENERIC_IPCBUF_H */ 34#endif /* __ASM_GENERIC_IPCBUF_H */
diff --git a/include/uapi/asm-generic/msgbuf.h b/include/uapi/asm-generic/msgbuf.h
index aec850d9159e..f55ecc43c60f 100644
--- a/include/uapi/asm-generic/msgbuf.h
+++ b/include/uapi/asm-generic/msgbuf.h
@@ -35,13 +35,13 @@ struct msqid64_ds {
35#if __BITS_PER_LONG != 64 35#if __BITS_PER_LONG != 64
36 unsigned long __unused3; 36 unsigned long __unused3;
37#endif 37#endif
38 unsigned long msg_cbytes; /* current number of bytes on queue */ 38 __kernel_ulong_t msg_cbytes; /* current number of bytes on queue */
39 unsigned long msg_qnum; /* number of messages in queue */ 39 __kernel_ulong_t msg_qnum; /* number of messages in queue */
40 unsigned long msg_qbytes; /* max number of bytes on queue */ 40 __kernel_ulong_t msg_qbytes; /* max number of bytes on queue */
41 __kernel_pid_t msg_lspid; /* pid of last msgsnd */ 41 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
42 __kernel_pid_t msg_lrpid; /* last receive pid */ 42 __kernel_pid_t msg_lrpid; /* last receive pid */
43 unsigned long __unused4; 43 __kernel_ulong_t __unused4;
44 unsigned long __unused5; 44 __kernel_ulong_t __unused5;
45}; 45};
46 46
47#endif /* __ASM_GENERIC_MSGBUF_H */ 47#endif /* __ASM_GENERIC_MSGBUF_H */
diff --git a/include/uapi/asm-generic/shmbuf.h b/include/uapi/asm-generic/shmbuf.h
index 5768fa60ac82..7e9fb2f0853b 100644
--- a/include/uapi/asm-generic/shmbuf.h
+++ b/include/uapi/asm-generic/shmbuf.h
@@ -39,21 +39,21 @@ struct shmid64_ds {
39#endif 39#endif
40 __kernel_pid_t shm_cpid; /* pid of creator */ 40 __kernel_pid_t shm_cpid; /* pid of creator */
41 __kernel_pid_t shm_lpid; /* pid of last operator */ 41 __kernel_pid_t shm_lpid; /* pid of last operator */
42 unsigned long shm_nattch; /* no. of current attaches */ 42 __kernel_ulong_t shm_nattch; /* no. of current attaches */
43 unsigned long __unused4; 43 __kernel_ulong_t __unused4;
44 unsigned long __unused5; 44 __kernel_ulong_t __unused5;
45}; 45};
46 46
47struct shminfo64 { 47struct shminfo64 {
48 unsigned long shmmax; 48 __kernel_ulong_t shmmax;
49 unsigned long shmmin; 49 __kernel_ulong_t shmmin;
50 unsigned long shmmni; 50 __kernel_ulong_t shmmni;
51 unsigned long shmseg; 51 __kernel_ulong_t shmseg;
52 unsigned long shmall; 52 __kernel_ulong_t shmall;
53 unsigned long __unused1; 53 __kernel_ulong_t __unused1;
54 unsigned long __unused2; 54 __kernel_ulong_t __unused2;
55 unsigned long __unused3; 55 __kernel_ulong_t __unused3;
56 unsigned long __unused4; 56 __kernel_ulong_t __unused4;
57}; 57};
58 58
59#endif /* __ASM_GENERIC_SHMBUF_H */ 59#endif /* __ASM_GENERIC_SHMBUF_H */
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index 38f14d0264c3..ea0796bdcf88 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -80,4 +80,6 @@
80 80
81#define SO_MAX_PACING_RATE 47 81#define SO_MAX_PACING_RATE 47
82 82
83#define SO_BPF_EXTENSIONS 48
84
83#endif /* __ASM_GENERIC_SOCKET_H */ 85#endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/include/uapi/asm-generic/types.h b/include/uapi/asm-generic/types.h
index bd39806013b5..a3877926b0d4 100644
--- a/include/uapi/asm-generic/types.h
+++ b/include/uapi/asm-generic/types.h
@@ -1,8 +1,7 @@
1#ifndef _ASM_GENERIC_TYPES_H 1#ifndef _ASM_GENERIC_TYPES_H
2#define _ASM_GENERIC_TYPES_H 2#define _ASM_GENERIC_TYPES_H
3/* 3/*
4 * int-ll64 is used practically everywhere now, 4 * int-ll64 is used everywhere now.
5 * so use it as a reasonable default.
6 */ 5 */
7#include <asm-generic/int-ll64.h> 6#include <asm-generic/int-ll64.h>
8 7
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 9b24d65fed72..3c9a833992e8 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -181,7 +181,6 @@ 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 (obsolete) */
185}; 184};
186 185
187/** 186/**
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 3a4e97bd8607..126bfaa8bb6b 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -222,6 +222,7 @@ typedef struct _drm_i915_sarea {
222#define DRM_I915_GEM_SET_CACHING 0x2f 222#define DRM_I915_GEM_SET_CACHING 0x2f
223#define DRM_I915_GEM_GET_CACHING 0x30 223#define DRM_I915_GEM_GET_CACHING 0x30
224#define DRM_I915_REG_READ 0x31 224#define DRM_I915_REG_READ 0x31
225#define DRM_I915_GET_RESET_STATS 0x32
225 226
226#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) 227#define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t)
227#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) 228#define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH)
@@ -271,6 +272,7 @@ typedef struct _drm_i915_sarea {
271#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create) 272#define DRM_IOCTL_I915_GEM_CONTEXT_CREATE DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_CREATE, struct drm_i915_gem_context_create)
272#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy) 273#define DRM_IOCTL_I915_GEM_CONTEXT_DESTROY DRM_IOW (DRM_COMMAND_BASE + DRM_I915_GEM_CONTEXT_DESTROY, struct drm_i915_gem_context_destroy)
273#define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read) 274#define DRM_IOCTL_I915_REG_READ DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_REG_READ, struct drm_i915_reg_read)
275#define DRM_IOCTL_I915_GET_RESET_STATS DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GET_RESET_STATS, struct drm_i915_reset_stats)
274 276
275/* Allow drivers to submit batchbuffers directly to hardware, relying 277/* Allow drivers to submit batchbuffers directly to hardware, relying
276 * on the security mechanisms provided by hardware. 278 * on the security mechanisms provided by hardware.
@@ -719,7 +721,7 @@ struct drm_i915_gem_execbuffer2 {
719 */ 721 */
720#define I915_EXEC_IS_PINNED (1<<10) 722#define I915_EXEC_IS_PINNED (1<<10)
721 723
722/** Provide a hint to the kernel that the command stream and auxilliary 724/** Provide a hint to the kernel that the command stream and auxiliary
723 * state buffers already holds the correct presumed addresses and so the 725 * state buffers already holds the correct presumed addresses and so the
724 * relocation process may be skipped if no buffers need to be moved in 726 * relocation process may be skipped if no buffers need to be moved in
725 * preparation for the execbuffer. 727 * preparation for the execbuffer.
@@ -1030,4 +1032,21 @@ struct drm_i915_reg_read {
1030 __u64 offset; 1032 __u64 offset;
1031 __u64 val; /* Return value */ 1033 __u64 val; /* Return value */
1032}; 1034};
1035
1036struct drm_i915_reset_stats {
1037 __u32 ctx_id;
1038 __u32 flags;
1039
1040 /* All resets since boot/module reload, for all contexts */
1041 __u32 reset_count;
1042
1043 /* Number of batches lost when active in GPU, for this context */
1044 __u32 batch_active;
1045
1046 /* Number of batches lost pending for execution, for this context */
1047 __u32 batch_pending;
1048
1049 __u32 pad;
1050};
1051
1033#endif /* _UAPI_I915_DRM_H_ */ 1052#endif /* _UAPI_I915_DRM_H_ */
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
index fe421e8a431b..d9ea3a73afe2 100644
--- a/include/uapi/drm/radeon_drm.h
+++ b/include/uapi/drm/radeon_drm.h
@@ -985,6 +985,8 @@ struct drm_radeon_cs {
985#define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY 0x18 985#define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY 0x18
986/* query the number of render backends */ 986/* query the number of render backends */
987#define RADEON_INFO_SI_BACKEND_ENABLED_MASK 0x19 987#define RADEON_INFO_SI_BACKEND_ENABLED_MASK 0x19
988/* max engine clock - needed for OpenCL */
989#define RADEON_INFO_MAX_SCLK 0x1a
988 990
989 991
990struct drm_radeon_info { 992struct drm_radeon_info {
diff --git a/include/uapi/drm/vmwgfx_drm.h b/include/uapi/drm/vmwgfx_drm.h
index f854ca4a1372..9971c560ed9a 100644
--- a/include/uapi/drm/vmwgfx_drm.h
+++ b/include/uapi/drm/vmwgfx_drm.h
@@ -28,6 +28,10 @@
28#ifndef __VMWGFX_DRM_H__ 28#ifndef __VMWGFX_DRM_H__
29#define __VMWGFX_DRM_H__ 29#define __VMWGFX_DRM_H__
30 30
31#ifndef __KERNEL__
32#include <drm.h>
33#endif
34
31#define DRM_VMW_MAX_SURFACE_FACES 6 35#define DRM_VMW_MAX_SURFACE_FACES 6
32#define DRM_VMW_MAX_MIP_LEVELS 24 36#define DRM_VMW_MAX_MIP_LEVELS 24
33 37
@@ -55,6 +59,11 @@
55#define DRM_VMW_PRESENT 18 59#define DRM_VMW_PRESENT 18
56#define DRM_VMW_PRESENT_READBACK 19 60#define DRM_VMW_PRESENT_READBACK 19
57#define DRM_VMW_UPDATE_LAYOUT 20 61#define DRM_VMW_UPDATE_LAYOUT 20
62#define DRM_VMW_CREATE_SHADER 21
63#define DRM_VMW_UNREF_SHADER 22
64#define DRM_VMW_GB_SURFACE_CREATE 23
65#define DRM_VMW_GB_SURFACE_REF 24
66#define DRM_VMW_SYNCCPU 25
58 67
59/*************************************************************************/ 68/*************************************************************************/
60/** 69/**
@@ -76,6 +85,8 @@
76#define DRM_VMW_PARAM_MAX_FB_SIZE 5 85#define DRM_VMW_PARAM_MAX_FB_SIZE 5
77#define DRM_VMW_PARAM_FIFO_HW_VERSION 6 86#define DRM_VMW_PARAM_FIFO_HW_VERSION 6
78#define DRM_VMW_PARAM_MAX_SURF_MEMORY 7 87#define DRM_VMW_PARAM_MAX_SURF_MEMORY 7
88#define DRM_VMW_PARAM_3D_CAPS_SIZE 8
89#define DRM_VMW_PARAM_MAX_MOB_MEMORY 9
79 90
80/** 91/**
81 * struct drm_vmw_getparam_arg 92 * struct drm_vmw_getparam_arg
@@ -788,4 +799,253 @@ struct drm_vmw_update_layout_arg {
788 uint64_t rects; 799 uint64_t rects;
789}; 800};
790 801
802
803/*************************************************************************/
804/**
805 * DRM_VMW_CREATE_SHADER - Create shader
806 *
807 * Creates a shader and optionally binds it to a dma buffer containing
808 * the shader byte-code.
809 */
810
811/**
812 * enum drm_vmw_shader_type - Shader types
813 */
814enum drm_vmw_shader_type {
815 drm_vmw_shader_type_vs = 0,
816 drm_vmw_shader_type_ps,
817 drm_vmw_shader_type_gs
818};
819
820
821/**
822 * struct drm_vmw_shader_create_arg
823 *
824 * @shader_type: Shader type of the shader to create.
825 * @size: Size of the byte-code in bytes.
826 * where the shader byte-code starts
827 * @buffer_handle: Buffer handle identifying the buffer containing the
828 * shader byte-code
829 * @shader_handle: On successful completion contains a handle that
830 * can be used to subsequently identify the shader.
831 * @offset: Offset in bytes into the buffer given by @buffer_handle,
832 *
833 * Input / Output argument to the DRM_VMW_CREATE_SHADER Ioctl.
834 */
835struct drm_vmw_shader_create_arg {
836 enum drm_vmw_shader_type shader_type;
837 uint32_t size;
838 uint32_t buffer_handle;
839 uint32_t shader_handle;
840 uint64_t offset;
841};
842
843/*************************************************************************/
844/**
845 * DRM_VMW_UNREF_SHADER - Unreferences a shader
846 *
847 * Destroys a user-space reference to a shader, optionally destroying
848 * it.
849 */
850
851/**
852 * struct drm_vmw_shader_arg
853 *
854 * @handle: Handle identifying the shader to destroy.
855 *
856 * Input argument to the DRM_VMW_UNREF_SHADER ioctl.
857 */
858struct drm_vmw_shader_arg {
859 uint32_t handle;
860 uint32_t pad64;
861};
862
863/*************************************************************************/
864/**
865 * DRM_VMW_GB_SURFACE_CREATE - Create a host guest-backed surface.
866 *
867 * Allocates a surface handle and queues a create surface command
868 * for the host on the first use of the surface. The surface ID can
869 * be used as the surface ID in commands referencing the surface.
870 */
871
872/**
873 * enum drm_vmw_surface_flags
874 *
875 * @drm_vmw_surface_flag_shareable: Whether the surface is shareable
876 * @drm_vmw_surface_flag_scanout: Whether the surface is a scanout
877 * surface.
878 * @drm_vmw_surface_flag_create_buffer: Create a backup buffer if none is
879 * given.
880 */
881enum drm_vmw_surface_flags {
882 drm_vmw_surface_flag_shareable = (1 << 0),
883 drm_vmw_surface_flag_scanout = (1 << 1),
884 drm_vmw_surface_flag_create_buffer = (1 << 2)
885};
886
887/**
888 * struct drm_vmw_gb_surface_create_req
889 *
890 * @svga3d_flags: SVGA3d surface flags for the device.
891 * @format: SVGA3d format.
892 * @mip_level: Number of mip levels for all faces.
893 * @drm_surface_flags Flags as described above.
894 * @multisample_count Future use. Set to 0.
895 * @autogen_filter Future use. Set to 0.
896 * @buffer_handle Buffer handle of backup buffer. SVGA3D_INVALID_ID
897 * if none.
898 * @base_size Size of the base mip level for all faces.
899 *
900 * Input argument to the DRM_VMW_GB_SURFACE_CREATE Ioctl.
901 * Part of output argument for the DRM_VMW_GB_SURFACE_REF Ioctl.
902 */
903struct drm_vmw_gb_surface_create_req {
904 uint32_t svga3d_flags;
905 uint32_t format;
906 uint32_t mip_levels;
907 enum drm_vmw_surface_flags drm_surface_flags;
908 uint32_t multisample_count;
909 uint32_t autogen_filter;
910 uint32_t buffer_handle;
911 uint32_t pad64;
912 struct drm_vmw_size base_size;
913};
914
915/**
916 * struct drm_vmw_gb_surface_create_rep
917 *
918 * @handle: Surface handle.
919 * @backup_size: Size of backup buffers for this surface.
920 * @buffer_handle: Handle of backup buffer. SVGA3D_INVALID_ID if none.
921 * @buffer_size: Actual size of the buffer identified by
922 * @buffer_handle
923 * @buffer_map_handle: Offset into device address space for the buffer
924 * identified by @buffer_handle.
925 *
926 * Part of output argument for the DRM_VMW_GB_SURFACE_REF ioctl.
927 * Output argument for the DRM_VMW_GB_SURFACE_CREATE ioctl.
928 */
929struct drm_vmw_gb_surface_create_rep {
930 uint32_t handle;
931 uint32_t backup_size;
932 uint32_t buffer_handle;
933 uint32_t buffer_size;
934 uint64_t buffer_map_handle;
935};
936
937/**
938 * union drm_vmw_gb_surface_create_arg
939 *
940 * @req: Input argument as described above.
941 * @rep: Output argument as described above.
942 *
943 * Argument to the DRM_VMW_GB_SURFACE_CREATE ioctl.
944 */
945union drm_vmw_gb_surface_create_arg {
946 struct drm_vmw_gb_surface_create_rep rep;
947 struct drm_vmw_gb_surface_create_req req;
948};
949
950/*************************************************************************/
951/**
952 * DRM_VMW_GB_SURFACE_REF - Reference a host surface.
953 *
954 * Puts a reference on a host surface with a given handle, as previously
955 * returned by the DRM_VMW_GB_SURFACE_CREATE ioctl.
956 * A reference will make sure the surface isn't destroyed while we hold
957 * it and will allow the calling client to use the surface handle in
958 * the command stream.
959 *
960 * On successful return, the Ioctl returns the surface information given
961 * to and returned from the DRM_VMW_GB_SURFACE_CREATE ioctl.
962 */
963
964/**
965 * struct drm_vmw_gb_surface_reference_arg
966 *
967 * @creq: The data used as input when the surface was created, as described
968 * above at "struct drm_vmw_gb_surface_create_req"
969 * @crep: Additional data output when the surface was created, as described
970 * above at "struct drm_vmw_gb_surface_create_rep"
971 *
972 * Output Argument to the DRM_VMW_GB_SURFACE_REF ioctl.
973 */
974struct drm_vmw_gb_surface_ref_rep {
975 struct drm_vmw_gb_surface_create_req creq;
976 struct drm_vmw_gb_surface_create_rep crep;
977};
978
979/**
980 * union drm_vmw_gb_surface_reference_arg
981 *
982 * @req: Input data as described above at "struct drm_vmw_surface_arg"
983 * @rep: Output data as described above at "struct drm_vmw_gb_surface_ref_rep"
984 *
985 * Argument to the DRM_VMW_GB_SURFACE_REF Ioctl.
986 */
987union drm_vmw_gb_surface_reference_arg {
988 struct drm_vmw_gb_surface_ref_rep rep;
989 struct drm_vmw_surface_arg req;
990};
991
992
993/*************************************************************************/
994/**
995 * DRM_VMW_SYNCCPU - Sync a DMA buffer / MOB for CPU access.
996 *
997 * Idles any previously submitted GPU operations on the buffer and
998 * by default blocks command submissions that reference the buffer.
999 * If the file descriptor used to grab a blocking CPU sync is closed, the
1000 * cpu sync is released.
1001 * The flags argument indicates how the grab / release operation should be
1002 * performed:
1003 */
1004
1005/**
1006 * enum drm_vmw_synccpu_flags - Synccpu flags:
1007 *
1008 * @drm_vmw_synccpu_read: Sync for read. If sync is done for read only, it's a
1009 * hint to the kernel to allow command submissions that references the buffer
1010 * for read-only.
1011 * @drm_vmw_synccpu_write: Sync for write. Block all command submissions
1012 * referencing this buffer.
1013 * @drm_vmw_synccpu_dontblock: Dont wait for GPU idle, but rather return
1014 * -EBUSY should the buffer be busy.
1015 * @drm_vmw_synccpu_allow_cs: Allow command submission that touches the buffer
1016 * while the buffer is synced for CPU. This is similar to the GEM bo idle
1017 * behavior.
1018 */
1019enum drm_vmw_synccpu_flags {
1020 drm_vmw_synccpu_read = (1 << 0),
1021 drm_vmw_synccpu_write = (1 << 1),
1022 drm_vmw_synccpu_dontblock = (1 << 2),
1023 drm_vmw_synccpu_allow_cs = (1 << 3)
1024};
1025
1026/**
1027 * enum drm_vmw_synccpu_op - Synccpu operations:
1028 *
1029 * @drm_vmw_synccpu_grab: Grab the buffer for CPU operations
1030 * @drm_vmw_synccpu_release: Release a previous grab.
1031 */
1032enum drm_vmw_synccpu_op {
1033 drm_vmw_synccpu_grab,
1034 drm_vmw_synccpu_release
1035};
1036
1037/**
1038 * struct drm_vmw_synccpu_arg
1039 *
1040 * @op: The synccpu operation as described above.
1041 * @handle: Handle identifying the buffer object.
1042 * @flags: Flags as described above.
1043 */
1044struct drm_vmw_synccpu_arg {
1045 enum drm_vmw_synccpu_op op;
1046 enum drm_vmw_synccpu_flags flags;
1047 uint32_t handle;
1048 uint32_t pad64;
1049};
1050
791#endif 1051#endif
diff --git a/include/uapi/linux/apm_bios.h b/include/uapi/linux/apm_bios.h
index 724f409adae0..df79bca1b898 100644
--- a/include/uapi/linux/apm_bios.h
+++ b/include/uapi/linux/apm_bios.h
@@ -67,6 +67,8 @@ struct apm_bios_info {
67#define APM_USER_SUSPEND 0x000a 67#define APM_USER_SUSPEND 0x000a
68#define APM_STANDBY_RESUME 0x000b 68#define APM_STANDBY_RESUME 0x000b
69#define APM_CAPABILITY_CHANGE 0x000c 69#define APM_CAPABILITY_CHANGE 0x000c
70#define APM_USER_HIBERNATION 0x000d
71#define APM_HIBERNATION_RESUME 0x000e
70 72
71/* 73/*
72 * Error codes 74 * Error codes
diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h
index 44b05a09f193..2d48fe1274ca 100644
--- a/include/uapi/linux/audit.h
+++ b/include/uapi/linux/audit.h
@@ -319,6 +319,12 @@ enum {
319#define AUDIT_STATUS_PID 0x0004 319#define AUDIT_STATUS_PID 0x0004
320#define AUDIT_STATUS_RATE_LIMIT 0x0008 320#define AUDIT_STATUS_RATE_LIMIT 0x0008
321#define AUDIT_STATUS_BACKLOG_LIMIT 0x0010 321#define AUDIT_STATUS_BACKLOG_LIMIT 0x0010
322#define AUDIT_STATUS_BACKLOG_WAIT_TIME 0x0020
323
324#define AUDIT_VERSION_BACKLOG_LIMIT 1
325#define AUDIT_VERSION_BACKLOG_WAIT_TIME 2
326#define AUDIT_VERSION_LATEST AUDIT_VERSION_BACKLOG_WAIT_TIME
327
322 /* Failure-to-log actions */ 328 /* Failure-to-log actions */
323#define AUDIT_FAIL_SILENT 0 329#define AUDIT_FAIL_SILENT 0
324#define AUDIT_FAIL_PRINTK 1 330#define AUDIT_FAIL_PRINTK 1
@@ -375,6 +381,8 @@ struct audit_status {
375 __u32 backlog_limit; /* waiting messages limit */ 381 __u32 backlog_limit; /* waiting messages limit */
376 __u32 lost; /* messages lost */ 382 __u32 lost; /* messages lost */
377 __u32 backlog; /* messages waiting in queue */ 383 __u32 backlog; /* messages waiting in queue */
384 __u32 version; /* audit api version number */
385 __u32 backlog_wait_time;/* message queue wait timeout */
378}; 386};
379 387
380struct audit_features { 388struct audit_features {
diff --git a/include/uapi/linux/bcache.h b/include/uapi/linux/bcache.h
index 164a7e263988..22b6ad31c706 100644
--- a/include/uapi/linux/bcache.h
+++ b/include/uapi/linux/bcache.h
@@ -39,6 +39,7 @@ static inline void SET_##name(struct bkey *k, unsigned i, __u64 v) \
39} 39}
40 40
41#define KEY_SIZE_BITS 16 41#define KEY_SIZE_BITS 16
42#define KEY_MAX_U64S 8
42 43
43KEY_FIELD(KEY_PTRS, high, 60, 3) 44KEY_FIELD(KEY_PTRS, high, 60, 3)
44KEY_FIELD(HEADER_SIZE, high, 58, 2) 45KEY_FIELD(HEADER_SIZE, high, 58, 2)
@@ -118,7 +119,7 @@ static inline struct bkey *bkey_next(const struct bkey *k)
118 return (struct bkey *) (d + bkey_u64s(k)); 119 return (struct bkey *) (d + bkey_u64s(k));
119} 120}
120 121
121static inline struct bkey *bkey_last(const struct bkey *k, unsigned nr_keys) 122static inline struct bkey *bkey_idx(const struct bkey *k, unsigned nr_keys)
122{ 123{
123 __u64 *d = (void *) k; 124 __u64 *d = (void *) k;
124 return (struct bkey *) (d + nr_keys); 125 return (struct bkey *) (d + nr_keys);
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index 45e618921c61..1b8a0f4c9590 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -184,6 +184,12 @@ struct btrfs_ioctl_fs_info_args {
184 __u64 reserved[124]; /* pad to 1k */ 184 __u64 reserved[124]; /* pad to 1k */
185}; 185};
186 186
187struct btrfs_ioctl_feature_flags {
188 __u64 compat_flags;
189 __u64 compat_ro_flags;
190 __u64 incompat_flags;
191};
192
187/* balance control ioctl modes */ 193/* balance control ioctl modes */
188#define BTRFS_BALANCE_CTL_PAUSE 1 194#define BTRFS_BALANCE_CTL_PAUSE 1
189#define BTRFS_BALANCE_CTL_CANCEL 2 195#define BTRFS_BALANCE_CTL_CANCEL 2
@@ -552,6 +558,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
552#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64) 558#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, __u64)
553#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \ 559#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \
554 struct btrfs_ioctl_space_args) 560 struct btrfs_ioctl_space_args)
561#define BTRFS_IOC_GLOBAL_RSV _IOR(BTRFS_IOCTL_MAGIC, 20, __u64)
555#define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64) 562#define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64)
556#define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64) 563#define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64)
557#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \ 564#define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \
@@ -606,5 +613,11 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
606 struct btrfs_ioctl_dev_replace_args) 613 struct btrfs_ioctl_dev_replace_args)
607#define BTRFS_IOC_FILE_EXTENT_SAME _IOWR(BTRFS_IOCTL_MAGIC, 54, \ 614#define BTRFS_IOC_FILE_EXTENT_SAME _IOWR(BTRFS_IOCTL_MAGIC, 54, \
608 struct btrfs_ioctl_same_args) 615 struct btrfs_ioctl_same_args)
616#define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
617 struct btrfs_ioctl_feature_flags)
618#define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \
619 struct btrfs_ioctl_feature_flags[2])
620#define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
621 struct btrfs_ioctl_feature_flags[3])
609 622
610#endif /* _UAPI_LINUX_BTRFS_H */ 623#endif /* _UAPI_LINUX_BTRFS_H */
diff --git a/include/uapi/linux/dm-log-userspace.h b/include/uapi/linux/dm-log-userspace.h
index 0678c2adc421..0fa0d9ef06a5 100644
--- a/include/uapi/linux/dm-log-userspace.h
+++ b/include/uapi/linux/dm-log-userspace.h
@@ -201,11 +201,18 @@
201 * int (*flush)(struct dm_dirty_log *log); 201 * int (*flush)(struct dm_dirty_log *log);
202 * 202 *
203 * Payload-to-userspace: 203 * Payload-to-userspace:
204 * None. 204 * If the 'integrated_flush' directive is present in the constructor
205 * table, the payload is as same as DM_ULOG_MARK_REGION:
206 * uint64_t [] - region(s) to mark
207 * else
208 * None
205 * Payload-to-kernel: 209 * Payload-to-kernel:
206 * None. 210 * None.
207 * 211 *
208 * No incoming or outgoing payload. Simply flush log state to disk. 212 * If the 'integrated_flush' option was used during the creation of the
213 * log, mark region requests are carried as payload in the flush request.
214 * Piggybacking the mark requests in this way allows for fewer communications
215 * between kernel and userspace.
209 * 216 *
210 * When the request has been processed, user-space must return the 217 * When the request has been processed, user-space must return the
211 * dm_ulog_request to the kernel - setting the 'error' field and clearing 218 * dm_ulog_request to the kernel - setting the 'error' field and clearing
@@ -385,8 +392,15 @@
385 * version 2: DM_ULOG_CTR allowed to return a string containing a 392 * version 2: DM_ULOG_CTR allowed to return a string containing a
386 * device name that is to be registered with DM via 393 * device name that is to be registered with DM via
387 * 'dm_get_device'. 394 * 'dm_get_device'.
395 * version 3: DM_ULOG_FLUSH is capable of carrying payload for marking
396 * regions. This "integrated flush" reduces the number of
397 * requests between the kernel and userspace by effectively
398 * merging 'mark' and 'flush' requests. A constructor table
399 * argument ('integrated_flush') is required to turn this
400 * feature on, so it is backwards compatible with older
401 * userspace versions.
388 */ 402 */
389#define DM_ULOG_REQUEST_VERSION 2 403#define DM_ULOG_REQUEST_VERSION 3
390 404
391struct dm_ulog_request { 405struct dm_ulog_request {
392 /* 406 /*
diff --git a/include/uapi/linux/dn.h b/include/uapi/linux/dn.h
index 5fbdd3d49eba..4295c745f342 100644
--- a/include/uapi/linux/dn.h
+++ b/include/uapi/linux/dn.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_DN_H 1#ifndef _LINUX_DN_H
2#define _LINUX_DN_H 2#define _LINUX_DN_H
3 3
4#include <linux/ioctl.h>
4#include <linux/types.h> 5#include <linux/types.h>
5#include <linux/if_ether.h> 6#include <linux/if_ether.h>
6 7
diff --git a/include/uapi/linux/fd.h b/include/uapi/linux/fd.h
index f1f3dd5981b2..84c517cbce90 100644
--- a/include/uapi/linux/fd.h
+++ b/include/uapi/linux/fd.h
@@ -185,7 +185,8 @@ enum {
185 * to clear media change status */ 185 * to clear media change status */
186 FD_UNUSED_BIT, 186 FD_UNUSED_BIT,
187 FD_DISK_CHANGED_BIT, /* disk has been changed since last i/o */ 187 FD_DISK_CHANGED_BIT, /* disk has been changed since last i/o */
188 FD_DISK_WRITABLE_BIT /* disk is writable */ 188 FD_DISK_WRITABLE_BIT, /* disk is writable */
189 FD_OPEN_SHOULD_FAIL_BIT
189}; 190};
190 191
191#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params) 192#define FDSETDRVPRM _IOW(2, 0x90, struct floppy_drive_params)
diff --git a/include/uapi/linux/genwqe/genwqe_card.h b/include/uapi/linux/genwqe/genwqe_card.h
new file mode 100644
index 000000000000..795e957bb840
--- /dev/null
+++ b/include/uapi/linux/genwqe/genwqe_card.h
@@ -0,0 +1,500 @@
1#ifndef __GENWQE_CARD_H__
2#define __GENWQE_CARD_H__
3
4/**
5 * IBM Accelerator Family 'GenWQE'
6 *
7 * (C) Copyright IBM Corp. 2013
8 *
9 * Author: Frank Haverkamp <haver@linux.vnet.ibm.com>
10 * Author: Joerg-Stephan Vogt <jsvogt@de.ibm.com>
11 * Author: Michael Jung <mijung@de.ibm.com>
12 * Author: Michael Ruettger <michael@ibmra.de>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License (version 2 only)
16 * as published by the Free Software Foundation.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 */
23
24/*
25 * User-space API for the GenWQE card. For debugging and test purposes
26 * the register addresses are included here too.
27 */
28
29#include <linux/types.h>
30#include <linux/ioctl.h>
31
32/* Basename of sysfs, debugfs and /dev interfaces */
33#define GENWQE_DEVNAME "genwqe"
34
35#define GENWQE_TYPE_ALTERA_230 0x00 /* GenWQE4 Stratix-IV-230 */
36#define GENWQE_TYPE_ALTERA_530 0x01 /* GenWQE4 Stratix-IV-530 */
37#define GENWQE_TYPE_ALTERA_A4 0x02 /* GenWQE5 A4 Stratix-V-A4 */
38#define GENWQE_TYPE_ALTERA_A7 0x03 /* GenWQE5 A7 Stratix-V-A7 */
39
40/* MMIO Unit offsets: Each UnitID occupies a defined address range */
41#define GENWQE_UID_OFFS(uid) ((uid) << 24)
42#define GENWQE_SLU_OFFS GENWQE_UID_OFFS(0)
43#define GENWQE_HSU_OFFS GENWQE_UID_OFFS(1)
44#define GENWQE_APP_OFFS GENWQE_UID_OFFS(2)
45#define GENWQE_MAX_UNITS 3
46
47/* Common offsets per UnitID */
48#define IO_EXTENDED_ERROR_POINTER 0x00000048
49#define IO_ERROR_INJECT_SELECTOR 0x00000060
50#define IO_EXTENDED_DIAG_SELECTOR 0x00000070
51#define IO_EXTENDED_DIAG_READ_MBX 0x00000078
52#define IO_EXTENDED_DIAG_MAP(ring) (0x00000500 | ((ring) << 3))
53
54#define GENWQE_EXTENDED_DIAG_SELECTOR(ring, trace) (((ring) << 8) | (trace))
55
56/* UnitID 0: Service Layer Unit (SLU) */
57
58/* SLU: Unit Configuration Register */
59#define IO_SLU_UNITCFG 0x00000000
60#define IO_SLU_UNITCFG_TYPE_MASK 0x000000000ff00000 /* 27:20 */
61
62/* SLU: Fault Isolation Register (FIR) (ac_slu_fir) */
63#define IO_SLU_FIR 0x00000008 /* read only, wr direct */
64#define IO_SLU_FIR_CLR 0x00000010 /* read and clear */
65
66/* SLU: First Error Capture Register (FEC/WOF) */
67#define IO_SLU_FEC 0x00000018
68
69#define IO_SLU_ERR_ACT_MASK 0x00000020
70#define IO_SLU_ERR_ATTN_MASK 0x00000028
71#define IO_SLU_FIRX1_ACT_MASK 0x00000030
72#define IO_SLU_FIRX0_ACT_MASK 0x00000038
73#define IO_SLU_SEC_LEM_DEBUG_OVR 0x00000040
74#define IO_SLU_EXTENDED_ERR_PTR 0x00000048
75#define IO_SLU_COMMON_CONFIG 0x00000060
76
77#define IO_SLU_FLASH_FIR 0x00000108
78#define IO_SLU_SLC_FIR 0x00000110
79#define IO_SLU_RIU_TRAP 0x00000280
80#define IO_SLU_FLASH_FEC 0x00000308
81#define IO_SLU_SLC_FEC 0x00000310
82
83/*
84 * The Virtual Function's Access is from offset 0x00010000
85 * The Physical Function's Access is from offset 0x00050000
86 * Single Shared Registers exists only at offset 0x00060000
87 *
88 * SLC: Queue Virtual Window Window for accessing into a specific VF
89 * queue. When accessing the 0x10000 space using the 0x50000 address
90 * segment, the value indicated here is used to specify which VF
91 * register is decoded. This register, and the 0x50000 register space
92 * can only be accessed by the PF. Example, if this register is set to
93 * 0x2, then a read from 0x50000 is the same as a read from 0x10000
94 * from VF=2.
95 */
96
97/* SLC: Queue Segment */
98#define IO_SLC_QUEUE_SEGMENT 0x00010000
99#define IO_SLC_VF_QUEUE_SEGMENT 0x00050000
100
101/* SLC: Queue Offset */
102#define IO_SLC_QUEUE_OFFSET 0x00010008
103#define IO_SLC_VF_QUEUE_OFFSET 0x00050008
104
105/* SLC: Queue Configuration */
106#define IO_SLC_QUEUE_CONFIG 0x00010010
107#define IO_SLC_VF_QUEUE_CONFIG 0x00050010
108
109/* SLC: Job Timout/Only accessible for the PF */
110#define IO_SLC_APPJOB_TIMEOUT 0x00010018
111#define IO_SLC_VF_APPJOB_TIMEOUT 0x00050018
112#define TIMEOUT_250MS 0x0000000f
113#define HEARTBEAT_DISABLE 0x0000ff00
114
115/* SLC: Queue InitSequence Register */
116#define IO_SLC_QUEUE_INITSQN 0x00010020
117#define IO_SLC_VF_QUEUE_INITSQN 0x00050020
118
119/* SLC: Queue Wrap */
120#define IO_SLC_QUEUE_WRAP 0x00010028
121#define IO_SLC_VF_QUEUE_WRAP 0x00050028
122
123/* SLC: Queue Status */
124#define IO_SLC_QUEUE_STATUS 0x00010100
125#define IO_SLC_VF_QUEUE_STATUS 0x00050100
126
127/* SLC: Queue Working Time */
128#define IO_SLC_QUEUE_WTIME 0x00010030
129#define IO_SLC_VF_QUEUE_WTIME 0x00050030
130
131/* SLC: Queue Error Counts */
132#define IO_SLC_QUEUE_ERRCNTS 0x00010038
133#define IO_SLC_VF_QUEUE_ERRCNTS 0x00050038
134
135/* SLC: Queue Loast Response Word */
136#define IO_SLC_QUEUE_LRW 0x00010040
137#define IO_SLC_VF_QUEUE_LRW 0x00050040
138
139/* SLC: Freerunning Timer */
140#define IO_SLC_FREE_RUNNING_TIMER 0x00010108
141#define IO_SLC_VF_FREE_RUNNING_TIMER 0x00050108
142
143/* SLC: Queue Virtual Access Region */
144#define IO_PF_SLC_VIRTUAL_REGION 0x00050000
145
146/* SLC: Queue Virtual Window */
147#define IO_PF_SLC_VIRTUAL_WINDOW 0x00060000
148
149/* SLC: DDCB Application Job Pending [n] (n=0:63) */
150#define IO_PF_SLC_JOBPEND(n) (0x00061000 + 8*(n))
151#define IO_SLC_JOBPEND(n) IO_PF_SLC_JOBPEND(n)
152
153/* SLC: Parser Trap RAM [n] (n=0:31) */
154#define IO_SLU_SLC_PARSE_TRAP(n) (0x00011000 + 8*(n))
155
156/* SLC: Dispatcher Trap RAM [n] (n=0:31) */
157#define IO_SLU_SLC_DISP_TRAP(n) (0x00011200 + 8*(n))
158
159/* Global Fault Isolation Register (GFIR) */
160#define IO_SLC_CFGREG_GFIR 0x00020000
161#define GFIR_ERR_TRIGGER 0x0000ffff
162
163/* SLU: Soft Reset Register */
164#define IO_SLC_CFGREG_SOFTRESET 0x00020018
165
166/* SLU: Misc Debug Register */
167#define IO_SLC_MISC_DEBUG 0x00020060
168#define IO_SLC_MISC_DEBUG_CLR 0x00020068
169#define IO_SLC_MISC_DEBUG_SET 0x00020070
170
171/* Temperature Sensor Reading */
172#define IO_SLU_TEMPERATURE_SENSOR 0x00030000
173#define IO_SLU_TEMPERATURE_CONFIG 0x00030008
174
175/* Voltage Margining Control */
176#define IO_SLU_VOLTAGE_CONTROL 0x00030080
177#define IO_SLU_VOLTAGE_NOMINAL 0x00000000
178#define IO_SLU_VOLTAGE_DOWN5 0x00000006
179#define IO_SLU_VOLTAGE_UP5 0x00000007
180
181/* Direct LED Control Register */
182#define IO_SLU_LEDCONTROL 0x00030100
183
184/* SLU: Flashbus Direct Access -A5 */
185#define IO_SLU_FLASH_DIRECTACCESS 0x00040010
186
187/* SLU: Flashbus Direct Access2 -A5 */
188#define IO_SLU_FLASH_DIRECTACCESS2 0x00040020
189
190/* SLU: Flashbus Command Interface -A5 */
191#define IO_SLU_FLASH_CMDINTF 0x00040030
192
193/* SLU: BitStream Loaded */
194#define IO_SLU_BITSTREAM 0x00040040
195
196/* This Register has a switch which will change the CAs to UR */
197#define IO_HSU_ERR_BEHAVIOR 0x01001010
198
199#define IO_SLC2_SQB_TRAP 0x00062000
200#define IO_SLC2_QUEUE_MANAGER_TRAP 0x00062008
201#define IO_SLC2_FLS_MASTER_TRAP 0x00062010
202
203/* UnitID 1: HSU Registers */
204#define IO_HSU_UNITCFG 0x01000000
205#define IO_HSU_FIR 0x01000008
206#define IO_HSU_FIR_CLR 0x01000010
207#define IO_HSU_FEC 0x01000018
208#define IO_HSU_ERR_ACT_MASK 0x01000020
209#define IO_HSU_ERR_ATTN_MASK 0x01000028
210#define IO_HSU_FIRX1_ACT_MASK 0x01000030
211#define IO_HSU_FIRX0_ACT_MASK 0x01000038
212#define IO_HSU_SEC_LEM_DEBUG_OVR 0x01000040
213#define IO_HSU_EXTENDED_ERR_PTR 0x01000048
214#define IO_HSU_COMMON_CONFIG 0x01000060
215
216/* UnitID 2: Application Unit (APP) */
217#define IO_APP_UNITCFG 0x02000000
218#define IO_APP_FIR 0x02000008
219#define IO_APP_FIR_CLR 0x02000010
220#define IO_APP_FEC 0x02000018
221#define IO_APP_ERR_ACT_MASK 0x02000020
222#define IO_APP_ERR_ATTN_MASK 0x02000028
223#define IO_APP_FIRX1_ACT_MASK 0x02000030
224#define IO_APP_FIRX0_ACT_MASK 0x02000038
225#define IO_APP_SEC_LEM_DEBUG_OVR 0x02000040
226#define IO_APP_EXTENDED_ERR_PTR 0x02000048
227#define IO_APP_COMMON_CONFIG 0x02000060
228
229#define IO_APP_DEBUG_REG_01 0x02010000
230#define IO_APP_DEBUG_REG_02 0x02010008
231#define IO_APP_DEBUG_REG_03 0x02010010
232#define IO_APP_DEBUG_REG_04 0x02010018
233#define IO_APP_DEBUG_REG_05 0x02010020
234#define IO_APP_DEBUG_REG_06 0x02010028
235#define IO_APP_DEBUG_REG_07 0x02010030
236#define IO_APP_DEBUG_REG_08 0x02010038
237#define IO_APP_DEBUG_REG_09 0x02010040
238#define IO_APP_DEBUG_REG_10 0x02010048
239#define IO_APP_DEBUG_REG_11 0x02010050
240#define IO_APP_DEBUG_REG_12 0x02010058
241#define IO_APP_DEBUG_REG_13 0x02010060
242#define IO_APP_DEBUG_REG_14 0x02010068
243#define IO_APP_DEBUG_REG_15 0x02010070
244#define IO_APP_DEBUG_REG_16 0x02010078
245#define IO_APP_DEBUG_REG_17 0x02010080
246#define IO_APP_DEBUG_REG_18 0x02010088
247
248/* Read/write from/to registers */
249struct genwqe_reg_io {
250 __u64 num; /* register offset/address */
251 __u64 val64;
252};
253
254/*
255 * All registers of our card will return values not equal this values.
256 * If we see IO_ILLEGAL_VALUE on any of our MMIO register reads, the
257 * card can be considered as unusable. It will need recovery.
258 */
259#define IO_ILLEGAL_VALUE 0xffffffffffffffffull
260
261/*
262 * Generic DDCB execution interface.
263 *
264 * This interface is a first prototype resulting from discussions we
265 * had with other teams which wanted to use the Genwqe card. It allows
266 * to issue a DDCB request in a generic way. The request will block
267 * until it finishes or time out with error.
268 *
269 * Some DDCBs require DMA addresses to be specified in the ASIV
270 * block. The interface provies the capability to let the kernel
271 * driver know where those addresses are by specifying the ATS field,
272 * such that it can replace the user-space addresses with appropriate
273 * DMA addresses or DMA addresses of a scatter gather list which is
274 * dynamically created.
275 *
276 * Our hardware will refuse DDCB execution if the ATS field is not as
277 * expected. That means the DDCB execution engine in the chip knows
278 * where it expects DMA addresses within the ASIV part of the DDCB and
279 * will check that against the ATS field definition. Any invalid or
280 * unknown ATS content will lead to DDCB refusal.
281 */
282
283/* Genwqe chip Units */
284#define DDCB_ACFUNC_SLU 0x00 /* chip service layer unit */
285#define DDCB_ACFUNC_APP 0x01 /* chip application */
286
287/* DDCB return codes (RETC) */
288#define DDCB_RETC_IDLE 0x0000 /* Unexecuted/DDCB created */
289#define DDCB_RETC_PENDING 0x0101 /* Pending Execution */
290#define DDCB_RETC_COMPLETE 0x0102 /* Cmd complete. No error */
291#define DDCB_RETC_FAULT 0x0104 /* App Err, recoverable */
292#define DDCB_RETC_ERROR 0x0108 /* App Err, non-recoverable */
293#define DDCB_RETC_FORCED_ERROR 0x01ff /* overwritten by driver */
294
295#define DDCB_RETC_UNEXEC 0x0110 /* Unexe/Removed from queue */
296#define DDCB_RETC_TERM 0x0120 /* Terminated */
297#define DDCB_RETC_RES0 0x0140 /* Reserved */
298#define DDCB_RETC_RES1 0x0180 /* Reserved */
299
300/* DDCB Command Options (CMDOPT) */
301#define DDCB_OPT_ECHO_FORCE_NO 0x0000 /* ECHO DDCB */
302#define DDCB_OPT_ECHO_FORCE_102 0x0001 /* force return code */
303#define DDCB_OPT_ECHO_FORCE_104 0x0002
304#define DDCB_OPT_ECHO_FORCE_108 0x0003
305
306#define DDCB_OPT_ECHO_FORCE_110 0x0004 /* only on PF ! */
307#define DDCB_OPT_ECHO_FORCE_120 0x0005
308#define DDCB_OPT_ECHO_FORCE_140 0x0006
309#define DDCB_OPT_ECHO_FORCE_180 0x0007
310
311#define DDCB_OPT_ECHO_COPY_NONE (0 << 5)
312#define DDCB_OPT_ECHO_COPY_ALL (1 << 5)
313
314/* Definitions of Service Layer Commands */
315#define SLCMD_ECHO_SYNC 0x00 /* PF/VF */
316#define SLCMD_MOVE_FLASH 0x06 /* PF only */
317#define SLCMD_MOVE_FLASH_FLAGS_MODE 0x03 /* bit 0 and 1 used for mode */
318#define SLCMD_MOVE_FLASH_FLAGS_DLOAD 0 /* mode: download */
319#define SLCMD_MOVE_FLASH_FLAGS_EMUL 1 /* mode: emulation */
320#define SLCMD_MOVE_FLASH_FLAGS_UPLOAD 2 /* mode: upload */
321#define SLCMD_MOVE_FLASH_FLAGS_VERIFY 3 /* mode: verify */
322#define SLCMD_MOVE_FLASH_FLAG_NOTAP (1 << 2)/* just dump DDCB and exit */
323#define SLCMD_MOVE_FLASH_FLAG_POLL (1 << 3)/* wait for RETC >= 0102 */
324#define SLCMD_MOVE_FLASH_FLAG_PARTITION (1 << 4)
325#define SLCMD_MOVE_FLASH_FLAG_ERASE (1 << 5)
326
327enum genwqe_card_state {
328 GENWQE_CARD_UNUSED = 0,
329 GENWQE_CARD_USED = 1,
330 GENWQE_CARD_FATAL_ERROR = 2,
331 GENWQE_CARD_STATE_MAX,
332};
333
334/* common struct for chip image exchange */
335struct genwqe_bitstream {
336 __u64 data_addr; /* pointer to image data */
337 __u32 size; /* size of image file */
338 __u32 crc; /* crc of this image */
339 __u64 target_addr; /* starting address in Flash */
340 __u32 partition; /* '0', '1', or 'v' */
341 __u32 uid; /* 1=host/x=dram */
342
343 __u64 slu_id; /* informational/sim: SluID */
344 __u64 app_id; /* informational/sim: AppID */
345
346 __u16 retc; /* returned from processing */
347 __u16 attn; /* attention code from processing */
348 __u32 progress; /* progress code from processing */
349};
350
351/* Issuing a specific DDCB command */
352#define DDCB_LENGTH 256 /* for debug data */
353#define DDCB_ASIV_LENGTH 104 /* len of the DDCB ASIV array */
354#define DDCB_ASIV_LENGTH_ATS 96 /* ASIV in ATS architecture */
355#define DDCB_ASV_LENGTH 64 /* len of the DDCB ASV array */
356#define DDCB_FIXUPS 12 /* maximum number of fixups */
357
358struct genwqe_debug_data {
359 char driver_version[64];
360 __u64 slu_unitcfg;
361 __u64 app_unitcfg;
362
363 __u8 ddcb_before[DDCB_LENGTH];
364 __u8 ddcb_prev[DDCB_LENGTH];
365 __u8 ddcb_finished[DDCB_LENGTH];
366};
367
368/*
369 * Address Translation Specification (ATS) definitions
370 *
371 * Each 4 bit within the ATS 64-bit word specify the required address
372 * translation at the defined offset.
373 *
374 * 63 LSB
375 * 6666.5555.5555.5544.4444.4443.3333.3333 ... 11
376 * 3210.9876.5432.1098.7654.3210.9876.5432 ... 1098.7654.3210
377 *
378 * offset: 0x00 0x08 0x10 0x18 0x20 0x28 0x30 0x38 ... 0x68 0x70 0x78
379 * res res res res ASIV ...
380 * The first 4 entries in the ATS word are reserved. The following nibbles
381 * each describe at an 8 byte offset the format of the required data.
382 */
383#define ATS_TYPE_DATA 0x0ull /* data */
384#define ATS_TYPE_FLAT_RD 0x4ull /* flat buffer read only */
385#define ATS_TYPE_FLAT_RDWR 0x5ull /* flat buffer read/write */
386#define ATS_TYPE_SGL_RD 0x6ull /* sgl read only */
387#define ATS_TYPE_SGL_RDWR 0x7ull /* sgl read/write */
388
389#define ATS_SET_FLAGS(_struct, _field, _flags) \
390 (((_flags) & 0xf) << (44 - (4 * (offsetof(_struct, _field) / 8))))
391
392#define ATS_GET_FLAGS(_ats, _byte_offs) \
393 (((_ats) >> (44 - (4 * ((_byte_offs) / 8)))) & 0xf)
394
395/**
396 * struct genwqe_ddcb_cmd - User parameter for generic DDCB commands
397 *
398 * On the way into the kernel the driver will read the whole data
399 * structure. On the way out the driver will not copy the ASIV data
400 * back to user-space.
401 */
402struct genwqe_ddcb_cmd {
403 /* START of data copied to/from driver */
404 __u64 next_addr; /* chaining genwqe_ddcb_cmd */
405 __u64 flags; /* reserved */
406
407 __u8 acfunc; /* accelerators functional unit */
408 __u8 cmd; /* command to execute */
409 __u8 asiv_length; /* used parameter length */
410 __u8 asv_length; /* length of valid return values */
411 __u16 cmdopts; /* command options */
412 __u16 retc; /* return code from processing */
413
414 __u16 attn; /* attention code from processing */
415 __u16 vcrc; /* variant crc16 */
416 __u32 progress; /* progress code from processing */
417
418 __u64 deque_ts; /* dequeue time stamp */
419 __u64 cmplt_ts; /* completion time stamp */
420 __u64 disp_ts; /* SW processing start */
421
422 /* move to end and avoid copy-back */
423 __u64 ddata_addr; /* collect debug data */
424
425 /* command specific values */
426 __u8 asv[DDCB_ASV_LENGTH];
427
428 /* END of data copied from driver */
429 union {
430 struct {
431 __u64 ats;
432 __u8 asiv[DDCB_ASIV_LENGTH_ATS];
433 };
434 /* used for flash update to keep it backward compatible */
435 __u8 __asiv[DDCB_ASIV_LENGTH];
436 };
437 /* END of data copied to driver */
438};
439
440#define GENWQE_IOC_CODE 0xa5
441
442/* Access functions */
443#define GENWQE_READ_REG64 _IOR(GENWQE_IOC_CODE, 30, struct genwqe_reg_io)
444#define GENWQE_WRITE_REG64 _IOW(GENWQE_IOC_CODE, 31, struct genwqe_reg_io)
445#define GENWQE_READ_REG32 _IOR(GENWQE_IOC_CODE, 32, struct genwqe_reg_io)
446#define GENWQE_WRITE_REG32 _IOW(GENWQE_IOC_CODE, 33, struct genwqe_reg_io)
447#define GENWQE_READ_REG16 _IOR(GENWQE_IOC_CODE, 34, struct genwqe_reg_io)
448#define GENWQE_WRITE_REG16 _IOW(GENWQE_IOC_CODE, 35, struct genwqe_reg_io)
449
450#define GENWQE_GET_CARD_STATE _IOR(GENWQE_IOC_CODE, 36, enum genwqe_card_state)
451
452/**
453 * struct genwqe_mem - Memory pinning/unpinning information
454 * @addr: virtual user space address
455 * @size: size of the area pin/dma-map/unmap
456 * direction: 0: read/1: read and write
457 *
458 * Avoid pinning and unpinning of memory pages dynamically. Instead
459 * the idea is to pin the whole buffer space required for DDCB
460 * opertionas in advance. The driver will reuse this pinning and the
461 * memory associated with it to setup the sglists for the DDCB
462 * requests without the need to allocate and free memory or map and
463 * unmap to get the DMA addresses.
464 *
465 * The inverse operation needs to be called after the pinning is not
466 * needed anymore. The pinnings else the pinnings will get removed
467 * after the device is closed. Note that pinnings will required
468 * memory.
469 */
470struct genwqe_mem {
471 __u64 addr;
472 __u64 size;
473 __u64 direction;
474 __u64 flags;
475};
476
477#define GENWQE_PIN_MEM _IOWR(GENWQE_IOC_CODE, 40, struct genwqe_mem)
478#define GENWQE_UNPIN_MEM _IOWR(GENWQE_IOC_CODE, 41, struct genwqe_mem)
479
480/*
481 * Generic synchronous DDCB execution interface.
482 * Synchronously execute a DDCB.
483 *
484 * Return: 0 on success or negative error code.
485 * -EINVAL: Invalid parameters (ASIV_LEN, ASV_LEN, illegal fixups
486 * no mappings found/could not create mappings
487 * -EFAULT: illegal addresses in fixups, purging failed
488 * -EBADMSG: enqueing failed, retc != DDCB_RETC_COMPLETE
489 */
490#define GENWQE_EXECUTE_DDCB \
491 _IOWR(GENWQE_IOC_CODE, 50, struct genwqe_ddcb_cmd)
492
493#define GENWQE_EXECUTE_RAW_DDCB \
494 _IOWR(GENWQE_IOC_CODE, 51, struct genwqe_ddcb_cmd)
495
496/* Service Layer functions (PF only) */
497#define GENWQE_SLU_UPDATE _IOWR(GENWQE_IOC_CODE, 80, struct genwqe_bitstream)
498#define GENWQE_SLU_READ _IOWR(GENWQE_IOC_CODE, 81, struct genwqe_bitstream)
499
500#endif /* __GENWQE_CARD_H__ */
diff --git a/include/uapi/linux/gfs2_ondisk.h b/include/uapi/linux/gfs2_ondisk.h
index b2de1f9a88d6..0f24c07aed51 100644
--- a/include/uapi/linux/gfs2_ondisk.h
+++ b/include/uapi/linux/gfs2_ondisk.h
@@ -319,7 +319,16 @@ struct gfs2_leaf {
319 __be32 lf_dirent_format; /* Format of the dirents */ 319 __be32 lf_dirent_format; /* Format of the dirents */
320 __be64 lf_next; /* Next leaf, if overflow */ 320 __be64 lf_next; /* Next leaf, if overflow */
321 321
322 __u8 lf_reserved[64]; 322 union {
323 __u8 lf_reserved[64];
324 struct {
325 __be64 lf_inode; /* Dir inode number */
326 __be32 lf_dist; /* Dist from inode on chain */
327 __be32 lf_nsec; /* Last ins/del usecs */
328 __be64 lf_sec; /* Last ins/del in secs */
329 __u8 lf_reserved2[40];
330 };
331 };
323}; 332};
324 333
325/* 334/*
diff --git a/include/uapi/linux/if_addr.h b/include/uapi/linux/if_addr.h
index 23357ab81a77..dea10a87dfd1 100644
--- a/include/uapi/linux/if_addr.h
+++ b/include/uapi/linux/if_addr.h
@@ -18,6 +18,9 @@ struct ifaddrmsg {
18 * It makes no difference for normally configured broadcast interfaces, 18 * It makes no difference for normally configured broadcast interfaces,
19 * but for point-to-point IFA_ADDRESS is DESTINATION address, 19 * but for point-to-point IFA_ADDRESS is DESTINATION address,
20 * local address is supplied in IFA_LOCAL attribute. 20 * local address is supplied in IFA_LOCAL attribute.
21 *
22 * IFA_FLAGS is a u32 attribute that extends the u8 field ifa_flags.
23 * If present, the value from struct ifaddrmsg will be ignored.
21 */ 24 */
22enum { 25enum {
23 IFA_UNSPEC, 26 IFA_UNSPEC,
@@ -28,6 +31,7 @@ enum {
28 IFA_ANYCAST, 31 IFA_ANYCAST,
29 IFA_CACHEINFO, 32 IFA_CACHEINFO,
30 IFA_MULTICAST, 33 IFA_MULTICAST,
34 IFA_FLAGS,
31 __IFA_MAX, 35 __IFA_MAX,
32}; 36};
33 37
@@ -44,6 +48,8 @@ enum {
44#define IFA_F_DEPRECATED 0x20 48#define IFA_F_DEPRECATED 0x20
45#define IFA_F_TENTATIVE 0x40 49#define IFA_F_TENTATIVE 0x40
46#define IFA_F_PERMANENT 0x80 50#define IFA_F_PERMANENT 0x80
51#define IFA_F_MANAGETEMPADDR 0x100
52#define IFA_F_NOPREFIXROUTE 0x200
47 53
48struct ifa_cacheinfo { 54struct ifa_cacheinfo {
49 __u32 ifa_prefered; 55 __u32 ifa_prefered;
diff --git a/include/uapi/linux/if_arp.h b/include/uapi/linux/if_arp.h
index d7fea3496f32..4d024d75d64b 100644
--- a/include/uapi/linux/if_arp.h
+++ b/include/uapi/linux/if_arp.h
@@ -94,6 +94,7 @@
94#define ARPHRD_CAIF 822 /* CAIF media type */ 94#define ARPHRD_CAIF 822 /* CAIF media type */
95#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */ 95#define ARPHRD_IP6GRE 823 /* GRE over IPv6 */
96#define ARPHRD_NETLINK 824 /* Netlink header */ 96#define ARPHRD_NETLINK 824 /* Netlink header */
97#define ARPHRD_6LOWPAN 825 /* IPv6 over LoWPAN */
97 98
98#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ 99#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
99#define ARPHRD_NONE 0xFFFE /* zero header length */ 100#define ARPHRD_NONE 0xFFFE /* zero header length */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 6db460121f84..16410b6e7819 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -240,6 +240,8 @@ enum {
240 IFLA_INFO_KIND, 240 IFLA_INFO_KIND,
241 IFLA_INFO_DATA, 241 IFLA_INFO_DATA,
242 IFLA_INFO_XSTATS, 242 IFLA_INFO_XSTATS,
243 IFLA_INFO_SLAVE_KIND,
244 IFLA_INFO_SLAVE_DATA,
243 __IFLA_INFO_MAX, 245 __IFLA_INFO_MAX,
244}; 246};
245 247
@@ -331,11 +333,57 @@ enum {
331 IFLA_BOND_UNSPEC, 333 IFLA_BOND_UNSPEC,
332 IFLA_BOND_MODE, 334 IFLA_BOND_MODE,
333 IFLA_BOND_ACTIVE_SLAVE, 335 IFLA_BOND_ACTIVE_SLAVE,
336 IFLA_BOND_MIIMON,
337 IFLA_BOND_UPDELAY,
338 IFLA_BOND_DOWNDELAY,
339 IFLA_BOND_USE_CARRIER,
340 IFLA_BOND_ARP_INTERVAL,
341 IFLA_BOND_ARP_IP_TARGET,
342 IFLA_BOND_ARP_VALIDATE,
343 IFLA_BOND_ARP_ALL_TARGETS,
344 IFLA_BOND_PRIMARY,
345 IFLA_BOND_PRIMARY_RESELECT,
346 IFLA_BOND_FAIL_OVER_MAC,
347 IFLA_BOND_XMIT_HASH_POLICY,
348 IFLA_BOND_RESEND_IGMP,
349 IFLA_BOND_NUM_PEER_NOTIF,
350 IFLA_BOND_ALL_SLAVES_ACTIVE,
351 IFLA_BOND_MIN_LINKS,
352 IFLA_BOND_LP_INTERVAL,
353 IFLA_BOND_PACKETS_PER_SLAVE,
354 IFLA_BOND_AD_LACP_RATE,
355 IFLA_BOND_AD_SELECT,
356 IFLA_BOND_AD_INFO,
334 __IFLA_BOND_MAX, 357 __IFLA_BOND_MAX,
335}; 358};
336 359
337#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1) 360#define IFLA_BOND_MAX (__IFLA_BOND_MAX - 1)
338 361
362enum {
363 IFLA_BOND_AD_INFO_UNSPEC,
364 IFLA_BOND_AD_INFO_AGGREGATOR,
365 IFLA_BOND_AD_INFO_NUM_PORTS,
366 IFLA_BOND_AD_INFO_ACTOR_KEY,
367 IFLA_BOND_AD_INFO_PARTNER_KEY,
368 IFLA_BOND_AD_INFO_PARTNER_MAC,
369 __IFLA_BOND_AD_INFO_MAX,
370};
371
372#define IFLA_BOND_AD_INFO_MAX (__IFLA_BOND_AD_INFO_MAX - 1)
373
374enum {
375 IFLA_BOND_SLAVE_UNSPEC,
376 IFLA_BOND_SLAVE_STATE,
377 IFLA_BOND_SLAVE_MII_STATUS,
378 IFLA_BOND_SLAVE_LINK_FAILURE_COUNT,
379 IFLA_BOND_SLAVE_PERM_HWADDR,
380 IFLA_BOND_SLAVE_QUEUE_ID,
381 IFLA_BOND_SLAVE_AD_AGGREGATOR_ID,
382 __IFLA_BOND_SLAVE_MAX,
383};
384
385#define IFLA_BOND_SLAVE_MAX (__IFLA_BOND_SLAVE_MAX - 1)
386
339/* SR-IOV virtual function management section */ 387/* SR-IOV virtual function management section */
340 388
341enum { 389enum {
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
index dbf06667394b..bac27fa05f5b 100644
--- a/include/uapi/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
@@ -26,8 +26,10 @@ struct sockaddr_ll {
26#define PACKET_MULTICAST 2 /* To group */ 26#define PACKET_MULTICAST 2 /* To group */
27#define PACKET_OTHERHOST 3 /* To someone else */ 27#define PACKET_OTHERHOST 3 /* To someone else */
28#define PACKET_OUTGOING 4 /* Outgoing of any type */ 28#define PACKET_OUTGOING 4 /* Outgoing of any type */
29/* These ones are invisible by user level */
30#define PACKET_LOOPBACK 5 /* MC/BRD frame looped back */ 29#define PACKET_LOOPBACK 5 /* MC/BRD frame looped back */
30#define PACKET_USER 6 /* To user space */
31#define PACKET_KERNEL 7 /* To kernel space */
32/* Unused, PACKET_FASTROUTE and PACKET_LOOPBACK are invisible to user space */
31#define PACKET_FASTROUTE 6 /* Fastrouted frame */ 33#define PACKET_FASTROUTE 6 /* Fastrouted frame */
32 34
33/* Packet socket options */ 35/* Packet socket options */
@@ -51,12 +53,14 @@ struct sockaddr_ll {
51#define PACKET_TIMESTAMP 17 53#define PACKET_TIMESTAMP 17
52#define PACKET_FANOUT 18 54#define PACKET_FANOUT 18
53#define PACKET_TX_HAS_OFF 19 55#define PACKET_TX_HAS_OFF 19
56#define PACKET_QDISC_BYPASS 20
54 57
55#define PACKET_FANOUT_HASH 0 58#define PACKET_FANOUT_HASH 0
56#define PACKET_FANOUT_LB 1 59#define PACKET_FANOUT_LB 1
57#define PACKET_FANOUT_CPU 2 60#define PACKET_FANOUT_CPU 2
58#define PACKET_FANOUT_ROLLOVER 3 61#define PACKET_FANOUT_ROLLOVER 3
59#define PACKET_FANOUT_RND 4 62#define PACKET_FANOUT_RND 4
63#define PACKET_FANOUT_QM 5
60#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000 64#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000
61#define PACKET_FANOUT_FLAG_DEFRAG 0x8000 65#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
62 66
@@ -83,17 +87,18 @@ struct tpacket_auxdata {
83 __u16 tp_mac; 87 __u16 tp_mac;
84 __u16 tp_net; 88 __u16 tp_net;
85 __u16 tp_vlan_tci; 89 __u16 tp_vlan_tci;
86 __u16 tp_padding; 90 __u16 tp_vlan_tpid;
87}; 91};
88 92
89/* Rx ring - header status */ 93/* Rx ring - header status */
90#define TP_STATUS_KERNEL 0 94#define TP_STATUS_KERNEL 0
91#define TP_STATUS_USER (1 << 0) 95#define TP_STATUS_USER (1 << 0)
92#define TP_STATUS_COPY (1 << 1) 96#define TP_STATUS_COPY (1 << 1)
93#define TP_STATUS_LOSING (1 << 2) 97#define TP_STATUS_LOSING (1 << 2)
94#define TP_STATUS_CSUMNOTREADY (1 << 3) 98#define TP_STATUS_CSUMNOTREADY (1 << 3)
95#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */ 99#define TP_STATUS_VLAN_VALID (1 << 4) /* auxdata has valid tp_vlan_tci */
96#define TP_STATUS_BLK_TMO (1 << 5) 100#define TP_STATUS_BLK_TMO (1 << 5)
101#define TP_STATUS_VLAN_TPID_VALID (1 << 6) /* auxdata has valid tp_vlan_tpid */
97 102
98/* Tx ring - header status */ 103/* Tx ring - header status */
99#define TP_STATUS_AVAILABLE 0 104#define TP_STATUS_AVAILABLE 0
@@ -132,12 +137,15 @@ struct tpacket2_hdr {
132 __u32 tp_sec; 137 __u32 tp_sec;
133 __u32 tp_nsec; 138 __u32 tp_nsec;
134 __u16 tp_vlan_tci; 139 __u16 tp_vlan_tci;
135 __u16 tp_padding; 140 __u16 tp_vlan_tpid;
141 __u8 tp_padding[4];
136}; 142};
137 143
138struct tpacket_hdr_variant1 { 144struct tpacket_hdr_variant1 {
139 __u32 tp_rxhash; 145 __u32 tp_rxhash;
140 __u32 tp_vlan_tci; 146 __u32 tp_vlan_tci;
147 __u16 tp_vlan_tpid;
148 __u16 tp_padding;
141}; 149};
142 150
143struct tpacket3_hdr { 151struct tpacket3_hdr {
@@ -153,6 +161,7 @@ struct tpacket3_hdr {
153 union { 161 union {
154 struct tpacket_hdr_variant1 hv1; 162 struct tpacket_hdr_variant1 hv1;
155 }; 163 };
164 __u8 tp_padding[8];
156}; 165};
157 166
158struct tpacket_bd_ts { 167struct tpacket_bd_ts {
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
index 440d5c479145..633b93cac1ed 100644
--- a/include/uapi/linux/in6.h
+++ b/include/uapi/linux/in6.h
@@ -85,6 +85,8 @@ struct in6_flowlabel_req {
85 85
86#define IPV6_FL_F_CREATE 1 86#define IPV6_FL_F_CREATE 1
87#define IPV6_FL_F_EXCL 2 87#define IPV6_FL_F_EXCL 2
88#define IPV6_FL_F_REFLECT 4
89#define IPV6_FL_F_REMOTE 8
88 90
89#define IPV6_FL_S_NONE 0 91#define IPV6_FL_S_NONE 0
90#define IPV6_FL_S_EXCL 1 92#define IPV6_FL_S_EXCL 1
@@ -188,6 +190,10 @@ enum {
188#define IPV6_PMTUDISC_WANT 1 190#define IPV6_PMTUDISC_WANT 1
189#define IPV6_PMTUDISC_DO 2 191#define IPV6_PMTUDISC_DO 2
190#define IPV6_PMTUDISC_PROBE 3 192#define IPV6_PMTUDISC_PROBE 3
193/* same as IPV6_PMTUDISC_PROBE, provided for symetry with IPv4
194 * also see comments on IP_PMTUDISC_INTERFACE
195 */
196#define IPV6_PMTUDISC_INTERFACE 4
191 197
192/* Flowlabel */ 198/* Flowlabel */
193#define IPV6_FLOWLABEL_MGR 32 199#define IPV6_FLOWLABEL_MGR 32
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 902f12461873..932d7f2637d6 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -674,6 +674,7 @@ struct kvm_ppc_smmu_info {
674#define KVM_CAP_ARM_EL1_32BIT 93 674#define KVM_CAP_ARM_EL1_32BIT 93
675#define KVM_CAP_SPAPR_MULTITCE 94 675#define KVM_CAP_SPAPR_MULTITCE 94
676#define KVM_CAP_EXT_EMUL_CPUID 95 676#define KVM_CAP_EXT_EMUL_CPUID 95
677#define KVM_CAP_HYPERV_TIME 96
677 678
678#ifdef KVM_CAP_IRQ_ROUTING 679#ifdef KVM_CAP_IRQ_ROUTING
679 680
@@ -853,6 +854,7 @@ struct kvm_device_attr {
853#define KVM_DEV_VFIO_GROUP 1 854#define KVM_DEV_VFIO_GROUP 1
854#define KVM_DEV_VFIO_GROUP_ADD 1 855#define KVM_DEV_VFIO_GROUP_ADD 1
855#define KVM_DEV_VFIO_GROUP_DEL 2 856#define KVM_DEV_VFIO_GROUP_DEL 2
857#define KVM_DEV_TYPE_ARM_VGIC_V2 5
856 858
857/* 859/*
858 * ioctls for VM fds 860 * ioctls for VM fds
diff --git a/include/uapi/linux/media.h b/include/uapi/linux/media.h
index ed49574ad757..d847c760e8f0 100644
--- a/include/uapi/linux/media.h
+++ b/include/uapi/linux/media.h
@@ -98,6 +98,7 @@ struct media_entity_desc {
98 98
99#define MEDIA_PAD_FL_SINK (1 << 0) 99#define MEDIA_PAD_FL_SINK (1 << 0)
100#define MEDIA_PAD_FL_SOURCE (1 << 1) 100#define MEDIA_PAD_FL_SOURCE (1 << 1)
101#define MEDIA_PAD_FL_MUST_CONNECT (1 << 2)
101 102
102struct media_pad_desc { 103struct media_pad_desc {
103 __u32 entity; /* entity ID */ 104 __u32 entity; /* entity ID */
diff --git a/include/uapi/linux/mqueue.h b/include/uapi/linux/mqueue.h
index 8b5a79615fbf..d0a2b8e89813 100644
--- a/include/uapi/linux/mqueue.h
+++ b/include/uapi/linux/mqueue.h
@@ -23,11 +23,11 @@
23#define MQ_BYTES_MAX 819200 23#define MQ_BYTES_MAX 819200
24 24
25struct mq_attr { 25struct mq_attr {
26 long mq_flags; /* message queue flags */ 26 __kernel_long_t mq_flags; /* message queue flags */
27 long mq_maxmsg; /* maximum number of messages */ 27 __kernel_long_t mq_maxmsg; /* maximum number of messages */
28 long mq_msgsize; /* maximum message size */ 28 __kernel_long_t mq_msgsize; /* maximum message size */
29 long mq_curmsgs; /* number of messages currently queued */ 29 __kernel_long_t mq_curmsgs; /* number of messages currently queued */
30 long __reserved[4]; /* ignored for input, zeroed for output */ 30 __kernel_long_t __reserved[4]; /* ignored for input, zeroed for output */
31}; 31};
32 32
33/* 33/*
diff --git a/include/uapi/linux/msg.h b/include/uapi/linux/msg.h
index 22d95c6854e0..a70375526578 100644
--- a/include/uapi/linux/msg.h
+++ b/include/uapi/linux/msg.h
@@ -34,8 +34,8 @@ struct msqid_ds {
34 34
35/* message buffer for msgsnd and msgrcv calls */ 35/* message buffer for msgsnd and msgrcv calls */
36struct msgbuf { 36struct msgbuf {
37 long mtype; /* type of message */ 37 __kernel_long_t mtype; /* type of message */
38 char mtext[1]; /* message text */ 38 char mtext[1]; /* message text */
39}; 39};
40 40
41/* buffer for msgctl calls IPC_INFO, MSG_INFO */ 41/* buffer for msgctl calls IPC_INFO, MSG_INFO */
diff --git a/include/uapi/linux/neighbour.h b/include/uapi/linux/neighbour.h
index f175212420ab..d3ef583104e0 100644
--- a/include/uapi/linux/neighbour.h
+++ b/include/uapi/linux/neighbour.h
@@ -58,7 +58,7 @@ enum {
58 58
59/* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change 59/* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change
60 and make no address resolution or NUD. 60 and make no address resolution or NUD.
61 NUD_PERMANENT is also cannot be deleted by garbage collectors. 61 NUD_PERMANENT also cannot be deleted by garbage collectors.
62 */ 62 */
63 63
64struct nda_cacheinfo { 64struct nda_cacheinfo {
diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h
index ae5df122e42f..f53879c0f590 100644
--- a/include/uapi/linux/net_tstamp.h
+++ b/include/uapi/linux/net_tstamp.h
@@ -26,17 +26,17 @@ enum {
26}; 26};
27 27
28/** 28/**
29 * struct hwtstamp_config - %SIOCSHWTSTAMP parameter 29 * struct hwtstamp_config - %SIOCGHWTSTAMP and %SIOCSHWTSTAMP parameter
30 * 30 *
31 * @flags: no flags defined right now, must be zero 31 * @flags: no flags defined right now, must be zero for %SIOCSHWTSTAMP
32 * @tx_type: one of HWTSTAMP_TX_* 32 * @tx_type: one of HWTSTAMP_TX_*
33 * @rx_type: one of one of HWTSTAMP_FILTER_* 33 * @rx_filter: one of HWTSTAMP_FILTER_*
34 * 34 *
35 * %SIOCSHWTSTAMP expects a &struct ifreq with a ifr_data pointer to 35 * %SIOCGHWTSTAMP and %SIOCSHWTSTAMP expect a &struct ifreq with a
36 * this structure. dev_ifsioc() in the kernel takes care of the 36 * ifr_data pointer to this structure. For %SIOCSHWTSTAMP, if the
37 * translation between 32 bit userspace and 64 bit kernel. The 37 * driver or hardware does not support the requested @rx_filter value,
38 * structure is intentionally chosen so that it has the same layout on 38 * the driver may use a more general filter mode. In this case
39 * 32 and 64 bit systems, don't break this! 39 * @rx_filter will indicate the actual mode on return.
40 */ 40 */
41struct hwtstamp_config { 41struct hwtstamp_config {
42 int flags; 42 int flags;
diff --git a/include/uapi/linux/netconf.h b/include/uapi/linux/netconf.h
index 64804a798b0c..669a1f0b1d97 100644
--- a/include/uapi/linux/netconf.h
+++ b/include/uapi/linux/netconf.h
@@ -14,6 +14,7 @@ enum {
14 NETCONFA_FORWARDING, 14 NETCONFA_FORWARDING,
15 NETCONFA_RP_FILTER, 15 NETCONFA_RP_FILTER,
16 NETCONFA_MC_FORWARDING, 16 NETCONFA_MC_FORWARDING,
17 NETCONFA_PROXY_NEIGH,
17 __NETCONFA_MAX 18 __NETCONFA_MAX
18}; 19};
19#define NETCONFA_MAX (__NETCONFA_MAX - 1) 20#define NETCONFA_MAX (__NETCONFA_MAX - 1)
diff --git a/include/uapi/linux/netfilter.h b/include/uapi/linux/netfilter.h
index f7dc0ebeeba5..ef1b1f88ca18 100644
--- a/include/uapi/linux/netfilter.h
+++ b/include/uapi/linux/netfilter.h
@@ -53,6 +53,7 @@ enum nf_inet_hooks {
53 53
54enum { 54enum {
55 NFPROTO_UNSPEC = 0, 55 NFPROTO_UNSPEC = 0,
56 NFPROTO_INET = 1,
56 NFPROTO_IPV4 = 2, 57 NFPROTO_IPV4 = 2,
57 NFPROTO_ARP = 3, 58 NFPROTO_ARP = 3,
58 NFPROTO_BRIDGE = 7, 59 NFPROTO_BRIDGE = 7,
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild
index 17c3af2c4bb9..1d973d2ba417 100644
--- a/include/uapi/linux/netfilter/Kbuild
+++ b/include/uapi/linux/netfilter/Kbuild
@@ -39,6 +39,7 @@ header-y += xt_TEE.h
39header-y += xt_TPROXY.h 39header-y += xt_TPROXY.h
40header-y += xt_addrtype.h 40header-y += xt_addrtype.h
41header-y += xt_bpf.h 41header-y += xt_bpf.h
42header-y += xt_cgroup.h
42header-y += xt_cluster.h 43header-y += xt_cluster.h
43header-y += xt_comment.h 44header-y += xt_comment.h
44header-y += xt_connbytes.h 45header-y += xt_connbytes.h
@@ -54,8 +55,10 @@ header-y += xt_ecn.h
54header-y += xt_esp.h 55header-y += xt_esp.h
55header-y += xt_hashlimit.h 56header-y += xt_hashlimit.h
56header-y += xt_helper.h 57header-y += xt_helper.h
58header-y += xt_ipcomp.h
57header-y += xt_iprange.h 59header-y += xt_iprange.h
58header-y += xt_ipvs.h 60header-y += xt_ipvs.h
61header-y += xt_l2tp.h
59header-y += xt_length.h 62header-y += xt_length.h
60header-y += xt_limit.h 63header-y += xt_limit.h
61header-y += xt_mac.h 64header-y += xt_mac.h
diff --git a/include/uapi/linux/netfilter/nf_nat.h b/include/uapi/linux/netfilter/nf_nat.h
index bf0cc373ffb6..1ad3659102b6 100644
--- a/include/uapi/linux/netfilter/nf_nat.h
+++ b/include/uapi/linux/netfilter/nf_nat.h
@@ -4,10 +4,14 @@
4#include <linux/netfilter.h> 4#include <linux/netfilter.h>
5#include <linux/netfilter/nf_conntrack_tuple_common.h> 5#include <linux/netfilter/nf_conntrack_tuple_common.h>
6 6
7#define NF_NAT_RANGE_MAP_IPS 1 7#define NF_NAT_RANGE_MAP_IPS (1 << 0)
8#define NF_NAT_RANGE_PROTO_SPECIFIED 2 8#define NF_NAT_RANGE_PROTO_SPECIFIED (1 << 1)
9#define NF_NAT_RANGE_PROTO_RANDOM 4 9#define NF_NAT_RANGE_PROTO_RANDOM (1 << 2)
10#define NF_NAT_RANGE_PERSISTENT 8 10#define NF_NAT_RANGE_PERSISTENT (1 << 3)
11#define NF_NAT_RANGE_PROTO_RANDOM_FULLY (1 << 4)
12
13#define NF_NAT_RANGE_PROTO_RANDOM_ALL \
14 (NF_NAT_RANGE_PROTO_RANDOM | NF_NAT_RANGE_PROTO_RANDOM_FULLY)
11 15
12struct nf_nat_ipv4_range { 16struct nf_nat_ipv4_range {
13 unsigned int flags; 17 unsigned int flags;
diff --git a/include/uapi/linux/netfilter/nf_tables.h b/include/uapi/linux/netfilter/nf_tables.h
index fbfd229a8e99..83c985a6170b 100644
--- a/include/uapi/linux/netfilter/nf_tables.h
+++ b/include/uapi/linux/netfilter/nf_tables.h
@@ -110,11 +110,13 @@ enum nft_table_flags {
110 * 110 *
111 * @NFTA_TABLE_NAME: name of the table (NLA_STRING) 111 * @NFTA_TABLE_NAME: name of the table (NLA_STRING)
112 * @NFTA_TABLE_FLAGS: bitmask of enum nft_table_flags (NLA_U32) 112 * @NFTA_TABLE_FLAGS: bitmask of enum nft_table_flags (NLA_U32)
113 * @NFTA_TABLE_USE: number of chains in this table (NLA_U32)
113 */ 114 */
114enum nft_table_attributes { 115enum nft_table_attributes {
115 NFTA_TABLE_UNSPEC, 116 NFTA_TABLE_UNSPEC,
116 NFTA_TABLE_NAME, 117 NFTA_TABLE_NAME,
117 NFTA_TABLE_FLAGS, 118 NFTA_TABLE_FLAGS,
119 NFTA_TABLE_USE,
118 __NFTA_TABLE_MAX 120 __NFTA_TABLE_MAX
119}; 121};
120#define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1) 122#define NFTA_TABLE_MAX (__NFTA_TABLE_MAX - 1)
@@ -529,6 +531,8 @@ enum nft_exthdr_attributes {
529 * @NFT_META_NFTRACE: packet nftrace bit 531 * @NFT_META_NFTRACE: packet nftrace bit
530 * @NFT_META_RTCLASSID: realm value of packet's route (skb->dst->tclassid) 532 * @NFT_META_RTCLASSID: realm value of packet's route (skb->dst->tclassid)
531 * @NFT_META_SECMARK: packet secmark (skb->secmark) 533 * @NFT_META_SECMARK: packet secmark (skb->secmark)
534 * @NFT_META_NFPROTO: netfilter protocol
535 * @NFT_META_L4PROTO: layer 4 protocol number
532 */ 536 */
533enum nft_meta_keys { 537enum nft_meta_keys {
534 NFT_META_LEN, 538 NFT_META_LEN,
@@ -546,6 +550,8 @@ enum nft_meta_keys {
546 NFT_META_NFTRACE, 550 NFT_META_NFTRACE,
547 NFT_META_RTCLASSID, 551 NFT_META_RTCLASSID,
548 NFT_META_SECMARK, 552 NFT_META_SECMARK,
553 NFT_META_NFPROTO,
554 NFT_META_L4PROTO,
549}; 555};
550 556
551/** 557/**
@@ -553,11 +559,13 @@ enum nft_meta_keys {
553 * 559 *
554 * @NFTA_META_DREG: destination register (NLA_U32) 560 * @NFTA_META_DREG: destination register (NLA_U32)
555 * @NFTA_META_KEY: meta data item to load (NLA_U32: nft_meta_keys) 561 * @NFTA_META_KEY: meta data item to load (NLA_U32: nft_meta_keys)
562 * @NFTA_META_SREG: source register (NLA_U32)
556 */ 563 */
557enum nft_meta_attributes { 564enum nft_meta_attributes {
558 NFTA_META_UNSPEC, 565 NFTA_META_UNSPEC,
559 NFTA_META_DREG, 566 NFTA_META_DREG,
560 NFTA_META_KEY, 567 NFTA_META_KEY,
568 NFTA_META_SREG,
561 __NFTA_META_MAX 569 __NFTA_META_MAX
562}; 570};
563#define NFTA_META_MAX (__NFTA_META_MAX - 1) 571#define NFTA_META_MAX (__NFTA_META_MAX - 1)
@@ -601,12 +609,14 @@ enum nft_ct_keys {
601 * @NFTA_CT_DREG: destination register (NLA_U32) 609 * @NFTA_CT_DREG: destination register (NLA_U32)
602 * @NFTA_CT_KEY: conntrack data item to load (NLA_U32: nft_ct_keys) 610 * @NFTA_CT_KEY: conntrack data item to load (NLA_U32: nft_ct_keys)
603 * @NFTA_CT_DIRECTION: direction in case of directional keys (NLA_U8) 611 * @NFTA_CT_DIRECTION: direction in case of directional keys (NLA_U8)
612 * @NFTA_CT_SREG: source register (NLA_U32)
604 */ 613 */
605enum nft_ct_attributes { 614enum nft_ct_attributes {
606 NFTA_CT_UNSPEC, 615 NFTA_CT_UNSPEC,
607 NFTA_CT_DREG, 616 NFTA_CT_DREG,
608 NFTA_CT_KEY, 617 NFTA_CT_KEY,
609 NFTA_CT_DIRECTION, 618 NFTA_CT_DIRECTION,
619 NFTA_CT_SREG,
610 __NFTA_CT_MAX 620 __NFTA_CT_MAX
611}; 621};
612#define NFTA_CT_MAX (__NFTA_CT_MAX - 1) 622#define NFTA_CT_MAX (__NFTA_CT_MAX - 1)
@@ -658,6 +668,26 @@ enum nft_log_attributes {
658#define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1) 668#define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1)
659 669
660/** 670/**
671 * enum nft_queue_attributes - nf_tables queue expression netlink attributes
672 *
673 * @NFTA_QUEUE_NUM: netlink queue to send messages to (NLA_U16)
674 * @NFTA_QUEUE_TOTAL: number of queues to load balance packets on (NLA_U16)
675 * @NFTA_QUEUE_FLAGS: various flags (NLA_U16)
676 */
677enum nft_queue_attributes {
678 NFTA_QUEUE_UNSPEC,
679 NFTA_QUEUE_NUM,
680 NFTA_QUEUE_TOTAL,
681 NFTA_QUEUE_FLAGS,
682 __NFTA_QUEUE_MAX
683};
684#define NFTA_QUEUE_MAX (__NFTA_QUEUE_MAX - 1)
685
686#define NFT_QUEUE_FLAG_BYPASS 0x01 /* for compatibility with v2 */
687#define NFT_QUEUE_FLAG_CPU_FANOUT 0x02 /* use current CPU (no hashing) */
688#define NFT_QUEUE_FLAG_MASK 0x03
689
690/**
661 * enum nft_reject_types - nf_tables reject expression reject types 691 * enum nft_reject_types - nf_tables reject expression reject types
662 * 692 *
663 * @NFT_REJECT_ICMP_UNREACH: reject using ICMP unreachable 693 * @NFT_REJECT_ICMP_UNREACH: reject using ICMP unreachable
diff --git a/include/uapi/linux/netfilter/nfnetlink_queue.h b/include/uapi/linux/netfilter/nfnetlink_queue.h
index 0132bad79de7..8dd819e2b5fe 100644
--- a/include/uapi/linux/netfilter/nfnetlink_queue.h
+++ b/include/uapi/linux/netfilter/nfnetlink_queue.h
@@ -47,6 +47,8 @@ enum nfqnl_attr_type {
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 NFQA_EXP, /* nf_conntrack_netlink.h */
50 NFQA_UID, /* __u32 sk uid */
51 NFQA_GID, /* __u32 sk gid */
50 52
51 __NFQA_MAX 53 __NFQA_MAX
52}; 54};
@@ -99,7 +101,8 @@ enum nfqnl_attr_config {
99#define NFQA_CFG_F_FAIL_OPEN (1 << 0) 101#define NFQA_CFG_F_FAIL_OPEN (1 << 0)
100#define NFQA_CFG_F_CONNTRACK (1 << 1) 102#define NFQA_CFG_F_CONNTRACK (1 << 1)
101#define NFQA_CFG_F_GSO (1 << 2) 103#define NFQA_CFG_F_GSO (1 << 2)
102#define NFQA_CFG_F_MAX (1 << 3) 104#define NFQA_CFG_F_UID_GID (1 << 3)
105#define NFQA_CFG_F_MAX (1 << 4)
103 106
104/* flags for NFQA_SKB_INFO */ 107/* flags for NFQA_SKB_INFO */
105/* packet appears to have wrong checksums, but they are ok */ 108/* packet appears to have wrong checksums, but they are ok */
diff --git a/include/uapi/linux/netfilter/xt_cgroup.h b/include/uapi/linux/netfilter/xt_cgroup.h
new file mode 100644
index 000000000000..43acb7e175f6
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_cgroup.h
@@ -0,0 +1,11 @@
1#ifndef _UAPI_XT_CGROUP_H
2#define _UAPI_XT_CGROUP_H
3
4#include <linux/types.h>
5
6struct xt_cgroup_info {
7 __u32 id;
8 __u32 invert;
9};
10
11#endif /* _UAPI_XT_CGROUP_H */
diff --git a/include/uapi/linux/netfilter/xt_ipcomp.h b/include/uapi/linux/netfilter/xt_ipcomp.h
new file mode 100644
index 000000000000..45c7e40eb8e1
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_ipcomp.h
@@ -0,0 +1,16 @@
1#ifndef _XT_IPCOMP_H
2#define _XT_IPCOMP_H
3
4#include <linux/types.h>
5
6struct xt_ipcomp {
7 __u32 spis[2]; /* Security Parameter Index */
8 __u8 invflags; /* Inverse flags */
9 __u8 hdrres; /* Test of the Reserved Filed */
10};
11
12/* Values for "invflags" field in struct xt_ipcomp. */
13#define XT_IPCOMP_INV_SPI 0x01 /* Invert the sense of spi. */
14#define XT_IPCOMP_INV_MASK 0x01 /* All possible flags. */
15
16#endif /*_XT_IPCOMP_H*/
diff --git a/include/uapi/linux/netfilter/xt_l2tp.h b/include/uapi/linux/netfilter/xt_l2tp.h
new file mode 100644
index 000000000000..7dccfa0acbfa
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_l2tp.h
@@ -0,0 +1,27 @@
1#ifndef _LINUX_NETFILTER_XT_L2TP_H
2#define _LINUX_NETFILTER_XT_L2TP_H
3
4#include <linux/types.h>
5
6enum xt_l2tp_type {
7 XT_L2TP_TYPE_CONTROL,
8 XT_L2TP_TYPE_DATA,
9};
10
11/* L2TP matching stuff */
12struct xt_l2tp_info {
13 __u32 tid; /* tunnel id */
14 __u32 sid; /* session id */
15 __u8 version; /* L2TP protocol version */
16 __u8 type; /* L2TP packet type */
17 __u8 flags; /* which fields to match */
18};
19
20enum {
21 XT_L2TP_TID = (1 << 0), /* match L2TP tunnel id */
22 XT_L2TP_SID = (1 << 1), /* match L2TP session id */
23 XT_L2TP_VERSION = (1 << 2), /* match L2TP protocol version */
24 XT_L2TP_TYPE = (1 << 3), /* match L2TP packet type */
25};
26
27#endif /* _LINUX_NETFILTER_XT_L2TP_H */
diff --git a/include/uapi/linux/netfilter/xt_osf.h b/include/uapi/linux/netfilter/xt_osf.h
index 18afa495f973..5d66caeba3ee 100644
--- a/include/uapi/linux/netfilter/xt_osf.h
+++ b/include/uapi/linux/netfilter/xt_osf.h
@@ -13,8 +13,7 @@
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU General Public License 15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software 16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */ 17 */
19 18
20#ifndef _XT_OSF_H 19#ifndef _XT_OSF_H
diff --git a/include/uapi/linux/nfs4.h b/include/uapi/linux/nfs4.h
index 788128ebac45..35f5f4c6c260 100644
--- a/include/uapi/linux/nfs4.h
+++ b/include/uapi/linux/nfs4.h
@@ -150,7 +150,7 @@
150#define NFS4_SECINFO_STYLE4_CURRENT_FH 0 150#define NFS4_SECINFO_STYLE4_CURRENT_FH 0
151#define NFS4_SECINFO_STYLE4_PARENT 1 151#define NFS4_SECINFO_STYLE4_PARENT 1
152 152
153#define NFS4_MAX_UINT64 (~(u64)0) 153#define NFS4_MAX_UINT64 (~(__u64)0)
154 154
155/* An NFS4 sessions server must support at least NFS4_MAX_OPS operations. 155/* An NFS4 sessions server must support at least NFS4_MAX_OPS operations.
156 * If a compound requires more operations, adjust NFS4_MAX_OPS accordingly. 156 * If a compound requires more operations, adjust NFS4_MAX_OPS accordingly.
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index f752e9821e71..91054fd660e0 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -581,7 +581,14 @@
581 * operation, %NL80211_ATTR_MAC contains the peer MAC address, and 581 * operation, %NL80211_ATTR_MAC contains the peer MAC address, and
582 * %NL80211_ATTR_REASON_CODE the reason code to be used (only with 582 * %NL80211_ATTR_REASON_CODE the reason code to be used (only with
583 * %NL80211_TDLS_TEARDOWN). 583 * %NL80211_TDLS_TEARDOWN).
584 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. 584 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. The
585 * %NL80211_ATTR_TDLS_ACTION attribute determines the type of frame to be
586 * sent. Public Action codes (802.11-2012 8.1.5.1) will be sent as
587 * 802.11 management frames, while TDLS action codes (802.11-2012
588 * 8.5.13.1) will be encapsulated and sent as data frames. The currently
589 * supported Public Action code is %WLAN_PUB_ACTION_TDLS_DISCOVER_RES
590 * and the currently supported TDLS actions codes are given in
591 * &enum ieee80211_tdls_actioncode.
585 * 592 *
586 * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP 593 * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
587 * (or GO) interface (i.e. hostapd) to ask for unexpected frames to 594 * (or GO) interface (i.e. hostapd) to ask for unexpected frames to
@@ -686,6 +693,21 @@
686 * other station that transmission must be blocked until the channel 693 * other station that transmission must be blocked until the channel
687 * switch is complete. 694 * switch is complete.
688 * 695 *
696 * @NL80211_CMD_VENDOR: Vendor-specified command/event. The command is specified
697 * by the %NL80211_ATTR_VENDOR_ID attribute and a sub-command in
698 * %NL80211_ATTR_VENDOR_SUBCMD. Parameter(s) can be transported in
699 * %NL80211_ATTR_VENDOR_DATA.
700 * For feature advertisement, the %NL80211_ATTR_VENDOR_DATA attribute is
701 * used in the wiphy data as a nested attribute containing descriptions
702 * (&struct nl80211_vendor_cmd_info) of the supported vendor commands.
703 * This may also be sent as an event with the same attributes.
704 *
705 * @NL80211_CMD_SET_QOS_MAP: Set Interworking QoS mapping for IP DSCP values.
706 * The QoS mapping information is included in %NL80211_ATTR_QOS_MAP. If
707 * that attribute is not included, QoS mapping is disabled. Since this
708 * QoS mapping is relevant for IP packets, it is only valid during an
709 * association. This is cleared on disassociation and AP restart.
710 *
689 * @NL80211_CMD_MAX: highest used command number 711 * @NL80211_CMD_MAX: highest used command number
690 * @__NL80211_CMD_AFTER_LAST: internal use 712 * @__NL80211_CMD_AFTER_LAST: internal use
691 */ 713 */
@@ -853,6 +875,10 @@ enum nl80211_commands {
853 875
854 NL80211_CMD_CHANNEL_SWITCH, 876 NL80211_CMD_CHANNEL_SWITCH,
855 877
878 NL80211_CMD_VENDOR,
879
880 NL80211_CMD_SET_QOS_MAP,
881
856 /* add new commands above here */ 882 /* add new commands above here */
857 883
858 /* used to define NL80211_CMD_MAX below */ 884 /* used to define NL80211_CMD_MAX below */
@@ -1508,6 +1534,27 @@ enum nl80211_commands {
1508 * to react to radar events, e.g. initiate a channel switch or leave the 1534 * to react to radar events, e.g. initiate a channel switch or leave the
1509 * IBSS network. 1535 * IBSS network.
1510 * 1536 *
1537 * @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports
1538 * 5 MHz channel bandwidth.
1539 * @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports
1540 * 10 MHz channel bandwidth.
1541 *
1542 * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode
1543 * Notification Element based on association request when used with
1544 * %NL80211_CMD_NEW_STATION; u8 attribute.
1545 *
1546 * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if
1547 * %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet)
1548 * @NL80211_ATTR_VENDOR_SUBCMD: vendor sub-command
1549 * @NL80211_ATTR_VENDOR_DATA: data for the vendor command, if any; this
1550 * attribute is also used for vendor command feature advertisement
1551 * @NL80211_ATTR_VENDOR_EVENTS: used for event list advertising in the wiphy
1552 * info, containing a nested array of possible events
1553 *
1554 * @NL80211_ATTR_QOS_MAP: IP DSCP mapping for Interworking QoS mapping. This
1555 * data is in the format defined for the payload of the QoS Map Set element
1556 * in IEEE Std 802.11-2012, 8.4.2.97.
1557 *
1511 * @NL80211_ATTR_MAX: highest attribute number currently defined 1558 * @NL80211_ATTR_MAX: highest attribute number currently defined
1512 * @__NL80211_ATTR_AFTER_LAST: internal use 1559 * @__NL80211_ATTR_AFTER_LAST: internal use
1513 */ 1560 */
@@ -1824,6 +1871,18 @@ enum nl80211_attrs {
1824 1871
1825 NL80211_ATTR_HANDLE_DFS, 1872 NL80211_ATTR_HANDLE_DFS,
1826 1873
1874 NL80211_ATTR_SUPPORT_5_MHZ,
1875 NL80211_ATTR_SUPPORT_10_MHZ,
1876
1877 NL80211_ATTR_OPMODE_NOTIF,
1878
1879 NL80211_ATTR_VENDOR_ID,
1880 NL80211_ATTR_VENDOR_SUBCMD,
1881 NL80211_ATTR_VENDOR_DATA,
1882 NL80211_ATTR_VENDOR_EVENTS,
1883
1884 NL80211_ATTR_QOS_MAP,
1885
1827 /* add attributes here, update the policy in nl80211.c */ 1886 /* add attributes here, update the policy in nl80211.c */
1828 1887
1829 __NL80211_ATTR_AFTER_LAST, 1888 __NL80211_ATTR_AFTER_LAST,
@@ -2224,10 +2283,9 @@ enum nl80211_band_attr {
2224 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz 2283 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
2225 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current 2284 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
2226 * regulatory domain. 2285 * regulatory domain.
2227 * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is 2286 * @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation
2228 * permitted on this channel in current regulatory domain. 2287 * are permitted on this channel, this includes sending probe
2229 * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted 2288 * requests, or modes of operation that require beaconing.
2230 * on this channel in current regulatory domain.
2231 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory 2289 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
2232 * on this channel in current regulatory domain. 2290 * on this channel in current regulatory domain.
2233 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm 2291 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
@@ -2254,8 +2312,8 @@ enum nl80211_frequency_attr {
2254 __NL80211_FREQUENCY_ATTR_INVALID, 2312 __NL80211_FREQUENCY_ATTR_INVALID,
2255 NL80211_FREQUENCY_ATTR_FREQ, 2313 NL80211_FREQUENCY_ATTR_FREQ,
2256 NL80211_FREQUENCY_ATTR_DISABLED, 2314 NL80211_FREQUENCY_ATTR_DISABLED,
2257 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN, 2315 NL80211_FREQUENCY_ATTR_NO_IR,
2258 NL80211_FREQUENCY_ATTR_NO_IBSS, 2316 __NL80211_FREQUENCY_ATTR_NO_IBSS,
2259 NL80211_FREQUENCY_ATTR_RADAR, 2317 NL80211_FREQUENCY_ATTR_RADAR,
2260 NL80211_FREQUENCY_ATTR_MAX_TX_POWER, 2318 NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
2261 NL80211_FREQUENCY_ATTR_DFS_STATE, 2319 NL80211_FREQUENCY_ATTR_DFS_STATE,
@@ -2271,6 +2329,9 @@ enum nl80211_frequency_attr {
2271}; 2329};
2272 2330
2273#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER 2331#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
2332#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR
2333#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR
2334#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
2274 2335
2275/** 2336/**
2276 * enum nl80211_bitrate_attr - bitrate attributes 2337 * enum nl80211_bitrate_attr - bitrate attributes
@@ -2413,8 +2474,9 @@ enum nl80211_sched_scan_match_attr {
2413 * @NL80211_RRF_DFS: DFS support is required to be used 2474 * @NL80211_RRF_DFS: DFS support is required to be used
2414 * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links 2475 * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
2415 * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links 2476 * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
2416 * @NL80211_RRF_PASSIVE_SCAN: passive scan is required 2477 * @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
2417 * @NL80211_RRF_NO_IBSS: no IBSS is allowed 2478 * this includes probe requests or modes of operation that require
2479 * beaconing.
2418 */ 2480 */
2419enum nl80211_reg_rule_flags { 2481enum nl80211_reg_rule_flags {
2420 NL80211_RRF_NO_OFDM = 1<<0, 2482 NL80211_RRF_NO_OFDM = 1<<0,
@@ -2424,10 +2486,17 @@ enum nl80211_reg_rule_flags {
2424 NL80211_RRF_DFS = 1<<4, 2486 NL80211_RRF_DFS = 1<<4,
2425 NL80211_RRF_PTP_ONLY = 1<<5, 2487 NL80211_RRF_PTP_ONLY = 1<<5,
2426 NL80211_RRF_PTMP_ONLY = 1<<6, 2488 NL80211_RRF_PTMP_ONLY = 1<<6,
2427 NL80211_RRF_PASSIVE_SCAN = 1<<7, 2489 NL80211_RRF_NO_IR = 1<<7,
2428 NL80211_RRF_NO_IBSS = 1<<8, 2490 __NL80211_RRF_NO_IBSS = 1<<8,
2429}; 2491};
2430 2492
2493#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
2494#define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR
2495#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
2496
2497/* For backport compatibility with older userspace */
2498#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
2499
2431/** 2500/**
2432 * enum nl80211_dfs_regions - regulatory DFS regions 2501 * enum nl80211_dfs_regions - regulatory DFS regions
2433 * 2502 *
@@ -3058,21 +3127,35 @@ enum nl80211_key_attributes {
3058 * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with 3127 * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
3059 * 1 = 500 kbps) but without the IE length restriction (at most 3128 * 1 = 500 kbps) but without the IE length restriction (at most
3060 * %NL80211_MAX_SUPP_RATES in a single array). 3129 * %NL80211_MAX_SUPP_RATES in a single array).
3061 * @NL80211_TXRATE_MCS: HT (MCS) rates allowed for TX rate selection 3130 * @NL80211_TXRATE_HT: HT (MCS) rates allowed for TX rate selection
3062 * in an array of MCS numbers. 3131 * in an array of MCS numbers.
3132 * @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection,
3133 * see &struct nl80211_txrate_vht
3063 * @__NL80211_TXRATE_AFTER_LAST: internal 3134 * @__NL80211_TXRATE_AFTER_LAST: internal
3064 * @NL80211_TXRATE_MAX: highest TX rate attribute 3135 * @NL80211_TXRATE_MAX: highest TX rate attribute
3065 */ 3136 */
3066enum nl80211_tx_rate_attributes { 3137enum nl80211_tx_rate_attributes {
3067 __NL80211_TXRATE_INVALID, 3138 __NL80211_TXRATE_INVALID,
3068 NL80211_TXRATE_LEGACY, 3139 NL80211_TXRATE_LEGACY,
3069 NL80211_TXRATE_MCS, 3140 NL80211_TXRATE_HT,
3141 NL80211_TXRATE_VHT,
3070 3142
3071 /* keep last */ 3143 /* keep last */
3072 __NL80211_TXRATE_AFTER_LAST, 3144 __NL80211_TXRATE_AFTER_LAST,
3073 NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1 3145 NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1
3074}; 3146};
3075 3147
3148#define NL80211_TXRATE_MCS NL80211_TXRATE_HT
3149#define NL80211_VHT_NSS_MAX 8
3150
3151/**
3152 * struct nl80211_txrate_vht - VHT MCS/NSS txrate bitmap
3153 * @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.)
3154 */
3155struct nl80211_txrate_vht {
3156 __u16 mcs[NL80211_VHT_NSS_MAX];
3157};
3158
3076/** 3159/**
3077 * enum nl80211_band - Frequency band 3160 * enum nl80211_band - Frequency band
3078 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band 3161 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
@@ -3934,4 +4017,24 @@ enum nl80211_rxmgmt_flags {
3934 NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0, 4017 NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
3935}; 4018};
3936 4019
4020/*
4021 * If this flag is unset, the lower 24 bits are an OUI, if set
4022 * a Linux nl80211 vendor ID is used (no such IDs are allocated
4023 * yet, so that's not valid so far)
4024 */
4025#define NL80211_VENDOR_ID_IS_LINUX 0x80000000
4026
4027/**
4028 * struct nl80211_vendor_cmd_info - vendor command data
4029 * @vendor_id: If the %NL80211_VENDOR_ID_IS_LINUX flag is clear, then the
4030 * value is a 24-bit OUI; if it is set then a separately allocated ID
4031 * may be used, but no such IDs are allocated yet. New IDs should be
4032 * added to this file when needed.
4033 * @subcmd: sub-command ID for the command
4034 */
4035struct nl80211_vendor_cmd_info {
4036 __u32 vendor_id;
4037 __u32 subcmd;
4038};
4039
3937#endif /* __LINUX_NL80211_H */ 4040#endif /* __LINUX_NL80211_H */
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index d120f9fe0017..970553cbbc8e 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -40,7 +40,15 @@ struct ovs_header {
40 40
41#define OVS_DATAPATH_FAMILY "ovs_datapath" 41#define OVS_DATAPATH_FAMILY "ovs_datapath"
42#define OVS_DATAPATH_MCGROUP "ovs_datapath" 42#define OVS_DATAPATH_MCGROUP "ovs_datapath"
43#define OVS_DATAPATH_VERSION 0x1 43
44/* V2:
45 * - API users are expected to provide OVS_DP_ATTR_USER_FEATURES
46 * when creating the datapath.
47 */
48#define OVS_DATAPATH_VERSION 2
49
50/* First OVS datapath version to support features */
51#define OVS_DP_VER_FEATURES 2
44 52
45enum ovs_datapath_cmd { 53enum ovs_datapath_cmd {
46 OVS_DP_CMD_UNSPEC, 54 OVS_DP_CMD_UNSPEC,
@@ -75,6 +83,7 @@ enum ovs_datapath_attr {
75 OVS_DP_ATTR_UPCALL_PID, /* Netlink PID to receive upcalls */ 83 OVS_DP_ATTR_UPCALL_PID, /* Netlink PID to receive upcalls */
76 OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */ 84 OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */
77 OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */ 85 OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */
86 OVS_DP_ATTR_USER_FEATURES, /* OVS_DP_F_* */
78 __OVS_DP_ATTR_MAX 87 __OVS_DP_ATTR_MAX
79}; 88};
80 89
@@ -106,6 +115,9 @@ struct ovs_vport_stats {
106 __u64 tx_dropped; /* no space available in linux */ 115 __u64 tx_dropped; /* no space available in linux */
107}; 116};
108 117
118/* Allow last Netlink attribute to be unaligned */
119#define OVS_DP_F_UNALIGNED (1 << 0)
120
109/* Fixed logical ports. */ 121/* Fixed logical ports. */
110#define OVSP_LOCAL ((__u32)0) 122#define OVSP_LOCAL ((__u32)0)
111 123
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index 4a98e85438a7..30db069bce62 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -489,7 +489,12 @@
489#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */ 489#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */
490#define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */ 490#define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */
491#define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */ 491#define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */
492#define PCI_EXP_LNKSTA_CLS_8_0GB 0x0003 /* Current Link Speed 8.0GT/s */
492#define PCI_EXP_LNKSTA_NLW 0x03f0 /* Negotiated Link Width */ 493#define PCI_EXP_LNKSTA_NLW 0x03f0 /* Negotiated Link Width */
494#define PCI_EXP_LNKSTA_NLW_X1 0x0010 /* Current Link Width x1 */
495#define PCI_EXP_LNKSTA_NLW_X2 0x0020 /* Current Link Width x2 */
496#define PCI_EXP_LNKSTA_NLW_X4 0x0040 /* Current Link Width x4 */
497#define PCI_EXP_LNKSTA_NLW_X8 0x0080 /* Current Link Width x8 */
493#define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */ 498#define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */
494#define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */ 499#define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */
495#define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */ 500#define PCI_EXP_LNKSTA_SLC 0x1000 /* Slot Clock Configuration */
@@ -518,8 +523,16 @@
518#define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */ 523#define PCI_EXP_SLTCTL_CCIE 0x0010 /* Command Completed Interrupt Enable */
519#define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */ 524#define PCI_EXP_SLTCTL_HPIE 0x0020 /* Hot-Plug Interrupt Enable */
520#define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */ 525#define PCI_EXP_SLTCTL_AIC 0x00c0 /* Attention Indicator Control */
526#define PCI_EXP_SLTCTL_ATTN_IND_ON 0x0040 /* Attention Indicator on */
527#define PCI_EXP_SLTCTL_ATTN_IND_BLINK 0x0080 /* Attention Indicator blinking */
528#define PCI_EXP_SLTCTL_ATTN_IND_OFF 0x00c0 /* Attention Indicator off */
521#define PCI_EXP_SLTCTL_PIC 0x0300 /* Power Indicator Control */ 529#define PCI_EXP_SLTCTL_PIC 0x0300 /* Power Indicator Control */
530#define PCI_EXP_SLTCTL_PWR_IND_ON 0x0100 /* Power Indicator on */
531#define PCI_EXP_SLTCTL_PWR_IND_BLINK 0x0200 /* Power Indicator blinking */
532#define PCI_EXP_SLTCTL_PWR_IND_OFF 0x0300 /* Power Indicator off */
522#define PCI_EXP_SLTCTL_PCC 0x0400 /* Power Controller Control */ 533#define PCI_EXP_SLTCTL_PCC 0x0400 /* Power Controller Control */
534#define PCI_EXP_SLTCTL_PWR_ON 0x0000 /* Power On */
535#define PCI_EXP_SLTCTL_PWR_OFF 0x0400 /* Power Off */
523#define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */ 536#define PCI_EXP_SLTCTL_EIC 0x0800 /* Electromechanical Interlock Control */
524#define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */ 537#define PCI_EXP_SLTCTL_DLLSCE 0x1000 /* Data Link Layer State Changed Enable */
525#define PCI_EXP_SLTSTA 26 /* Slot Status */ 538#define PCI_EXP_SLTSTA 26 /* Slot Status */
@@ -677,17 +690,34 @@
677#define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */ 690#define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */
678 691
679/* Virtual Channel */ 692/* Virtual Channel */
680#define PCI_VC_PORT_REG1 4 693#define PCI_VC_PORT_CAP1 4
681#define PCI_VC_REG1_EVCC 0x7 /* extended VC count */ 694#define PCI_VC_CAP1_EVCC 0x00000007 /* extended VC count */
682#define PCI_VC_PORT_REG2 8 695#define PCI_VC_CAP1_LPEVCC 0x00000070 /* low prio extended VC count */
683#define PCI_VC_REG2_32_PHASE 0x2 696#define PCI_VC_CAP1_ARB_SIZE 0x00000c00
684#define PCI_VC_REG2_64_PHASE 0x4 697#define PCI_VC_PORT_CAP2 8
685#define PCI_VC_REG2_128_PHASE 0x8 698#define PCI_VC_CAP2_32_PHASE 0x00000002
699#define PCI_VC_CAP2_64_PHASE 0x00000004
700#define PCI_VC_CAP2_128_PHASE 0x00000008
701#define PCI_VC_CAP2_ARB_OFF 0xff000000
686#define PCI_VC_PORT_CTRL 12 702#define PCI_VC_PORT_CTRL 12
703#define PCI_VC_PORT_CTRL_LOAD_TABLE 0x00000001
687#define PCI_VC_PORT_STATUS 14 704#define PCI_VC_PORT_STATUS 14
705#define PCI_VC_PORT_STATUS_TABLE 0x00000001
688#define PCI_VC_RES_CAP 16 706#define PCI_VC_RES_CAP 16
707#define PCI_VC_RES_CAP_32_PHASE 0x00000002
708#define PCI_VC_RES_CAP_64_PHASE 0x00000004
709#define PCI_VC_RES_CAP_128_PHASE 0x00000008
710#define PCI_VC_RES_CAP_128_PHASE_TB 0x00000010
711#define PCI_VC_RES_CAP_256_PHASE 0x00000020
712#define PCI_VC_RES_CAP_ARB_OFF 0xff000000
689#define PCI_VC_RES_CTRL 20 713#define PCI_VC_RES_CTRL 20
714#define PCI_VC_RES_CTRL_LOAD_TABLE 0x00010000
715#define PCI_VC_RES_CTRL_ARB_SELECT 0x000e0000
716#define PCI_VC_RES_CTRL_ID 0x07000000
717#define PCI_VC_RES_CTRL_ENABLE 0x80000000
690#define PCI_VC_RES_STATUS 26 718#define PCI_VC_RES_STATUS 26
719#define PCI_VC_RES_STATUS_TABLE 0x00000001
720#define PCI_VC_RES_STATUS_NEGO 0x00000002
691#define PCI_CAP_VC_BASE_SIZEOF 0x10 721#define PCI_CAP_VC_BASE_SIZEOF 0x10
692#define PCI_CAP_VC_PER_VC_SIZEOF 0x0C 722#define PCI_CAP_VC_PER_VC_SIZEOF 0x0C
693 723
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index e244ed412745..853bc1ccb395 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -788,7 +788,7 @@ union perf_mem_data_src {
788#define PERF_MEM_TLB_SHIFT 26 788#define PERF_MEM_TLB_SHIFT 26
789 789
790#define PERF_MEM_S(a, s) \ 790#define PERF_MEM_S(a, s) \
791 (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) 791 (((__u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
792 792
793/* 793/*
794 * single taken branch record layout: 794 * single taken branch record layout:
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index a806687ad98f..d62316baae94 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -173,6 +173,8 @@ enum {
173 TCA_TBF_PTAB, 173 TCA_TBF_PTAB,
174 TCA_TBF_RATE64, 174 TCA_TBF_RATE64,
175 TCA_TBF_PRATE64, 175 TCA_TBF_PRATE64,
176 TCA_TBF_BURST,
177 TCA_TBF_PBURST,
176 __TCA_TBF_MAX, 178 __TCA_TBF_MAX,
177}; 179};
178 180
@@ -523,6 +525,7 @@ enum {
523 TCA_NETEM_LOSS, 525 TCA_NETEM_LOSS,
524 TCA_NETEM_RATE, 526 TCA_NETEM_RATE,
525 TCA_NETEM_ECN, 527 TCA_NETEM_ECN,
528 TCA_NETEM_RATE64,
526 __TCA_NETEM_MAX, 529 __TCA_NETEM_MAX,
527}; 530};
528 531
@@ -790,4 +793,54 @@ struct tc_fq_qd_stats {
790 __u32 throttled_flows; 793 __u32 throttled_flows;
791 __u32 pad; 794 __u32 pad;
792}; 795};
796
797/* Heavy-Hitter Filter */
798
799enum {
800 TCA_HHF_UNSPEC,
801 TCA_HHF_BACKLOG_LIMIT,
802 TCA_HHF_QUANTUM,
803 TCA_HHF_HH_FLOWS_LIMIT,
804 TCA_HHF_RESET_TIMEOUT,
805 TCA_HHF_ADMIT_BYTES,
806 TCA_HHF_EVICT_TIMEOUT,
807 TCA_HHF_NON_HH_WEIGHT,
808 __TCA_HHF_MAX
809};
810
811#define TCA_HHF_MAX (__TCA_HHF_MAX - 1)
812
813struct tc_hhf_xstats {
814 __u32 drop_overlimit; /* number of times max qdisc packet limit
815 * was hit
816 */
817 __u32 hh_overlimit; /* number of times max heavy-hitters was hit */
818 __u32 hh_tot_count; /* number of captured heavy-hitters so far */
819 __u32 hh_cur_count; /* number of current heavy-hitters */
820};
821
822/* PIE */
823enum {
824 TCA_PIE_UNSPEC,
825 TCA_PIE_TARGET,
826 TCA_PIE_LIMIT,
827 TCA_PIE_TUPDATE,
828 TCA_PIE_ALPHA,
829 TCA_PIE_BETA,
830 TCA_PIE_ECN,
831 TCA_PIE_BYTEMODE,
832 __TCA_PIE_MAX
833};
834#define TCA_PIE_MAX (__TCA_PIE_MAX - 1)
835
836struct tc_pie_xstats {
837 __u32 prob; /* current probability */
838 __u32 delay; /* current delay in ms */
839 __u32 avg_dq_rate; /* current average dq_rate in bits/pie_time */
840 __u32 packets_in; /* total number of packets enqueued */
841 __u32 dropped; /* packets dropped due to pie_action */
842 __u32 overlimit; /* dropped due to lack of space in queue */
843 __u32 maxq; /* maximum queue size */
844 __u32 ecn_mark; /* packets marked with ecn*/
845};
793#endif 846#endif
diff --git a/include/uapi/linux/ppp-ioctl.h b/include/uapi/linux/ppp-ioctl.h
index 2d9a8859550a..63a23a3b8bb7 100644
--- a/include/uapi/linux/ppp-ioctl.h
+++ b/include/uapi/linux/ppp-ioctl.h
@@ -12,6 +12,7 @@
12 12
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/compiler.h> 14#include <linux/compiler.h>
15#include <linux/ppp_defs.h>
15 16
16/* 17/*
17 * Bit definitions for flags argument to PPPIOCGFLAGS/PPPIOCSFLAGS. 18 * Bit definitions for flags argument to PPPIOCGFLAGS/PPPIOCSFLAGS.
diff --git a/include/uapi/linux/raid/md_p.h b/include/uapi/linux/raid/md_p.h
index f7cf7f351144..49f4210d4394 100644
--- a/include/uapi/linux/raid/md_p.h
+++ b/include/uapi/linux/raid/md_p.h
@@ -292,6 +292,9 @@ struct mdp_superblock_1 {
292 * backwards anyway. 292 * backwards anyway.
293 */ 293 */
294#define MD_FEATURE_NEW_OFFSET 64 /* new_offset must be honoured */ 294#define MD_FEATURE_NEW_OFFSET 64 /* new_offset must be honoured */
295#define MD_FEATURE_RECOVERY_BITMAP 128 /* recovery that is happening
296 * is guided by bitmap.
297 */
295#define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \ 298#define MD_FEATURE_ALL (MD_FEATURE_BITMAP_OFFSET \
296 |MD_FEATURE_RECOVERY_OFFSET \ 299 |MD_FEATURE_RECOVERY_OFFSET \
297 |MD_FEATURE_RESHAPE_ACTIVE \ 300 |MD_FEATURE_RESHAPE_ACTIVE \
@@ -299,6 +302,7 @@ struct mdp_superblock_1 {
299 |MD_FEATURE_REPLACEMENT \ 302 |MD_FEATURE_REPLACEMENT \
300 |MD_FEATURE_RESHAPE_BACKWARDS \ 303 |MD_FEATURE_RESHAPE_BACKWARDS \
301 |MD_FEATURE_NEW_OFFSET \ 304 |MD_FEATURE_NEW_OFFSET \
305 |MD_FEATURE_RECOVERY_BITMAP \
302 ) 306 )
303 307
304#endif 308#endif
diff --git a/include/uapi/linux/resource.h b/include/uapi/linux/resource.h
index e0ed28477f48..36fb3b5fb181 100644
--- a/include/uapi/linux/resource.h
+++ b/include/uapi/linux/resource.h
@@ -23,25 +23,25 @@
23struct rusage { 23struct rusage {
24 struct timeval ru_utime; /* user time used */ 24 struct timeval ru_utime; /* user time used */
25 struct timeval ru_stime; /* system time used */ 25 struct timeval ru_stime; /* system time used */
26 long ru_maxrss; /* maximum resident set size */ 26 __kernel_long_t ru_maxrss; /* maximum resident set size */
27 long ru_ixrss; /* integral shared memory size */ 27 __kernel_long_t ru_ixrss; /* integral shared memory size */
28 long ru_idrss; /* integral unshared data size */ 28 __kernel_long_t ru_idrss; /* integral unshared data size */
29 long ru_isrss; /* integral unshared stack size */ 29 __kernel_long_t ru_isrss; /* integral unshared stack size */
30 long ru_minflt; /* page reclaims */ 30 __kernel_long_t ru_minflt; /* page reclaims */
31 long ru_majflt; /* page faults */ 31 __kernel_long_t ru_majflt; /* page faults */
32 long ru_nswap; /* swaps */ 32 __kernel_long_t ru_nswap; /* swaps */
33 long ru_inblock; /* block input operations */ 33 __kernel_long_t ru_inblock; /* block input operations */
34 long ru_oublock; /* block output operations */ 34 __kernel_long_t ru_oublock; /* block output operations */
35 long ru_msgsnd; /* messages sent */ 35 __kernel_long_t ru_msgsnd; /* messages sent */
36 long ru_msgrcv; /* messages received */ 36 __kernel_long_t ru_msgrcv; /* messages received */
37 long ru_nsignals; /* signals received */ 37 __kernel_long_t ru_nsignals; /* signals received */
38 long ru_nvcsw; /* voluntary context switches */ 38 __kernel_long_t ru_nvcsw; /* voluntary context switches */
39 long ru_nivcsw; /* involuntary " */ 39 __kernel_long_t ru_nivcsw; /* involuntary " */
40}; 40};
41 41
42struct rlimit { 42struct rlimit {
43 unsigned long rlim_cur; 43 __kernel_ulong_t rlim_cur;
44 unsigned long rlim_max; 44 __kernel_ulong_t rlim_max;
45}; 45};
46 46
47#define RLIM64_INFINITY (~0ULL) 47#define RLIM64_INFINITY (~0ULL)
diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
index ca451e99b28b..266022a2be4a 100644
--- a/include/uapi/linux/sctp.h
+++ b/include/uapi/linux/sctp.h
@@ -22,9 +22,8 @@
22 * See the GNU General Public License for more details. 22 * See the GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with GNU CC; see the file COPYING. If not, write to 25 * along with GNU CC; see the file COPYING. If not, see
26 * the Free Software Foundation, 59 Temple Place - Suite 330, 26 * <http://www.gnu.org/licenses/>.
27 * Boston, MA 02111-1307, USA.
28 * 27 *
29 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
30 * email address(es): 29 * email address(es):
diff --git a/include/uapi/linux/shm.h b/include/uapi/linux/shm.h
index ec36fa1a83a4..78b69413f582 100644
--- a/include/uapi/linux/shm.h
+++ b/include/uapi/linux/shm.h
@@ -68,11 +68,11 @@ struct shminfo {
68 68
69struct shm_info { 69struct shm_info {
70 int used_ids; 70 int used_ids;
71 unsigned long shm_tot; /* total allocated shm */ 71 __kernel_ulong_t shm_tot; /* total allocated shm */
72 unsigned long shm_rss; /* total resident shm */ 72 __kernel_ulong_t shm_rss; /* total resident shm */
73 unsigned long shm_swp; /* total swapped shm */ 73 __kernel_ulong_t shm_swp; /* total swapped shm */
74 unsigned long swap_attempts; 74 __kernel_ulong_t swap_attempts;
75 unsigned long swap_successes; 75 __kernel_ulong_t swap_successes;
76}; 76};
77 77
78 78
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h
index 1bdb4a39d1e1..bbaba22f2d1b 100644
--- a/include/uapi/linux/snmp.h
+++ b/include/uapi/linux/snmp.h
@@ -258,6 +258,7 @@ enum
258 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */ 258 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */
259 LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */ 259 LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */
260 LINUX_MIB_BUSYPOLLRXPACKETS, /* BusyPollRxPackets */ 260 LINUX_MIB_BUSYPOLLRXPACKETS, /* BusyPollRxPackets */
261 LINUX_MIB_TCPAUTOCORKING, /* TCPAutoCorking */
261 __LINUX_MIB_MAX 262 __LINUX_MIB_MAX
262}; 263};
263 264
diff --git a/include/uapi/linux/sockios.h b/include/uapi/linux/sockios.h
index 7997a506ad41..e888b1aed69f 100644
--- a/include/uapi/linux/sockios.h
+++ b/include/uapi/linux/sockios.h
@@ -125,7 +125,8 @@
125#define SIOCBRDELIF 0x89a3 /* remove interface from bridge */ 125#define SIOCBRDELIF 0x89a3 /* remove interface from bridge */
126 126
127/* hardware time stamping: parameters in linux/net_tstamp.h */ 127/* hardware time stamping: parameters in linux/net_tstamp.h */
128#define SIOCSHWTSTAMP 0x89b0 128#define SIOCSHWTSTAMP 0x89b0 /* set and get config */
129#define SIOCGHWTSTAMP 0x89b1 /* get config */
129 130
130/* Device private ioctl calls */ 131/* Device private ioctl calls */
131 132
diff --git a/include/uapi/linux/tc_act/tc_ipt.h b/include/uapi/linux/tc_act/tc_ipt.h
index a2335563d21f..130aaadf6fac 100644
--- a/include/uapi/linux/tc_act/tc_ipt.h
+++ b/include/uapi/linux/tc_act/tc_ipt.h
@@ -4,6 +4,7 @@
4#include <linux/pkt_cls.h> 4#include <linux/pkt_cls.h>
5 5
6#define TCA_ACT_IPT 6 6#define TCA_ACT_IPT 6
7#define TCA_ACT_XT 10
7 8
8enum { 9enum {
9 TCA_IPT_UNSPEC, 10 TCA_IPT_UNSPEC,
diff --git a/include/uapi/linux/tcp_metrics.h b/include/uapi/linux/tcp_metrics.h
index cb5157b55f32..54a37b13f2c4 100644
--- a/include/uapi/linux/tcp_metrics.h
+++ b/include/uapi/linux/tcp_metrics.h
@@ -35,6 +35,8 @@ enum {
35 TCP_METRICS_ATTR_FOPEN_SYN_DROPS, /* u16, count of drops */ 35 TCP_METRICS_ATTR_FOPEN_SYN_DROPS, /* u16, count of drops */
36 TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS, /* msecs age */ 36 TCP_METRICS_ATTR_FOPEN_SYN_DROP_TS, /* msecs age */
37 TCP_METRICS_ATTR_FOPEN_COOKIE, /* binary */ 37 TCP_METRICS_ATTR_FOPEN_COOKIE, /* binary */
38 TCP_METRICS_ATTR_SADDR_IPV4, /* u32 */
39 TCP_METRICS_ATTR_SADDR_IPV6, /* binary */
38 40
39 __TCP_METRICS_ATTR_MAX, 41 __TCP_METRICS_ATTR_MAX,
40}; 42};
diff --git a/include/uapi/linux/timex.h b/include/uapi/linux/timex.h
index a7ea81f13711..92685d826444 100644
--- a/include/uapi/linux/timex.h
+++ b/include/uapi/linux/timex.h
@@ -63,27 +63,27 @@
63 */ 63 */
64struct timex { 64struct timex {
65 unsigned int modes; /* mode selector */ 65 unsigned int modes; /* mode selector */
66 long offset; /* time offset (usec) */ 66 __kernel_long_t offset; /* time offset (usec) */
67 long freq; /* frequency offset (scaled ppm) */ 67 __kernel_long_t freq; /* frequency offset (scaled ppm) */
68 long maxerror; /* maximum error (usec) */ 68 __kernel_long_t maxerror;/* maximum error (usec) */
69 long esterror; /* estimated error (usec) */ 69 __kernel_long_t esterror;/* estimated error (usec) */
70 int status; /* clock command/status */ 70 int status; /* clock command/status */
71 long constant; /* pll time constant */ 71 __kernel_long_t constant;/* pll time constant */
72 long precision; /* clock precision (usec) (read only) */ 72 __kernel_long_t precision;/* clock precision (usec) (read only) */
73 long tolerance; /* clock frequency tolerance (ppm) 73 __kernel_long_t tolerance;/* clock frequency tolerance (ppm)
74 * (read only) 74 * (read only)
75 */ 75 */
76 struct timeval time; /* (read only, except for ADJ_SETOFFSET) */ 76 struct timeval time; /* (read only, except for ADJ_SETOFFSET) */
77 long tick; /* (modified) usecs between clock ticks */ 77 __kernel_long_t tick; /* (modified) usecs between clock ticks */
78 78
79 long ppsfreq; /* pps frequency (scaled ppm) (ro) */ 79 __kernel_long_t ppsfreq;/* pps frequency (scaled ppm) (ro) */
80 long jitter; /* pps jitter (us) (ro) */ 80 __kernel_long_t jitter; /* pps jitter (us) (ro) */
81 int shift; /* interval duration (s) (shift) (ro) */ 81 int shift; /* interval duration (s) (shift) (ro) */
82 long stabil; /* pps stability (scaled ppm) (ro) */ 82 __kernel_long_t stabil; /* pps stability (scaled ppm) (ro) */
83 long jitcnt; /* jitter limit exceeded (ro) */ 83 __kernel_long_t jitcnt; /* jitter limit exceeded (ro) */
84 long calcnt; /* calibration intervals (ro) */ 84 __kernel_long_t calcnt; /* calibration intervals (ro) */
85 long errcnt; /* calibration errors (ro) */ 85 __kernel_long_t errcnt; /* calibration errors (ro) */
86 long stbcnt; /* stability limit exceeded (ro) */ 86 __kernel_long_t stbcnt; /* stability limit exceeded (ro) */
87 87
88 int tai; /* TAI offset (ro) */ 88 int tai; /* TAI offset (ro) */
89 89
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index 1666aabbbb86..2cbe605bbe04 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -164,6 +164,10 @@ enum v4l2_colorfx {
164 * this driver */ 164 * this driver */
165#define V4L2_CID_USER_TI_VPE_BASE (V4L2_CID_USER_BASE + 0x1050) 165#define V4L2_CID_USER_TI_VPE_BASE (V4L2_CID_USER_BASE + 0x1050)
166 166
167/* The base for the saa7134 driver controls.
168 * We reserve 16 controls for this driver. */
169#define V4L2_CID_USER_SAA7134_BASE (V4L2_CID_USER_BASE + 0x1060)
170
167/* MPEG-class control IDs */ 171/* MPEG-class control IDs */
168/* The MPEG controls are applicable to all codec controls 172/* The MPEG controls are applicable to all codec controls
169 * and the 'MPEG' part of the define is historical */ 173 * and the 'MPEG' part of the define is historical */
@@ -554,6 +558,11 @@ enum v4l2_vp8_golden_frame_sel {
554 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV = 0, 558 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV = 0,
555 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD = 1, 559 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD = 1,
556}; 560};
561#define V4L2_CID_MPEG_VIDEO_VPX_MIN_QP (V4L2_CID_MPEG_BASE+507)
562#define V4L2_CID_MPEG_VIDEO_VPX_MAX_QP (V4L2_CID_MPEG_BASE+508)
563#define V4L2_CID_MPEG_VIDEO_VPX_I_FRAME_QP (V4L2_CID_MPEG_BASE+509)
564#define V4L2_CID_MPEG_VIDEO_VPX_P_FRAME_QP (V4L2_CID_MPEG_BASE+510)
565#define V4L2_CID_MPEG_VIDEO_VPX_PROFILE (V4L2_CID_MPEG_BASE+511)
557 566
558/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ 567/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
559#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) 568#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h
index a9601257bb43..b5c3aab6e82c 100644
--- a/include/uapi/linux/v4l2-mediabus.h
+++ b/include/uapi/linux/v4l2-mediabus.h
@@ -110,6 +110,9 @@ enum v4l2_mbus_pixelcode {
110 110
111 /* S5C73M3 sensor specific interleaved UYVY and JPEG */ 111 /* S5C73M3 sensor specific interleaved UYVY and JPEG */
112 V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8 = 0x5001, 112 V4L2_MBUS_FMT_S5C_UYVY_JPEG_1X8 = 0x5001,
113
114 /* HSV - next is 0x6002 */
115 V4L2_MBUS_FMT_AHSV8888_1X32 = 0x6001,
113}; 116};
114 117
115/** 118/**
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 437f1b0f8937..6ae7bbe988cc 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -207,8 +207,8 @@ enum v4l2_priority {
207struct v4l2_rect { 207struct v4l2_rect {
208 __s32 left; 208 __s32 left;
209 __s32 top; 209 __s32 top;
210 __s32 width; 210 __u32 width;
211 __s32 height; 211 __u32 height;
212}; 212};
213 213
214struct v4l2_fract { 214struct v4l2_fract {
diff --git a/include/uapi/linux/vsp1.h b/include/uapi/linux/vsp1.h
new file mode 100644
index 000000000000..e18858f6e865
--- /dev/null
+++ b/include/uapi/linux/vsp1.h
@@ -0,0 +1,34 @@
1/*
2 * vsp1.h
3 *
4 * Renesas R-Car VSP1 - User-space API
5 *
6 * Copyright (C) 2013 Renesas Corporation
7 *
8 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.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 version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#ifndef __VSP1_USER_H__
16#define __VSP1_USER_H__
17
18#include <linux/types.h>
19#include <linux/videodev2.h>
20
21/*
22 * Private IOCTLs
23 *
24 * VIDIOC_VSP1_LUT_CONFIG - Configure the lookup table
25 */
26
27#define VIDIOC_VSP1_LUT_CONFIG \
28 _IOWR('V', BASE_VIDIOC_PRIVATE + 1, struct vsp1_lut_config)
29
30struct vsp1_lut_config {
31 u32 lut[256];
32};
33
34#endif /* __VSP1_USER_H__ */
diff --git a/include/uapi/linux/xattr.h b/include/uapi/linux/xattr.h
index e4629b93bdd6..40bbc04b6f81 100644
--- a/include/uapi/linux/xattr.h
+++ b/include/uapi/linux/xattr.h
@@ -20,6 +20,9 @@
20#define XATTR_MAC_OSX_PREFIX "osx." 20#define XATTR_MAC_OSX_PREFIX "osx."
21#define XATTR_MAC_OSX_PREFIX_LEN (sizeof(XATTR_MAC_OSX_PREFIX) - 1) 21#define XATTR_MAC_OSX_PREFIX_LEN (sizeof(XATTR_MAC_OSX_PREFIX) - 1)
22 22
23#define XATTR_BTRFS_PREFIX "btrfs."
24#define XATTR_BTRFS_PREFIX_LEN (sizeof(XATTR_BTRFS_PREFIX) - 1)
25
23#define XATTR_SECURITY_PREFIX "security." 26#define XATTR_SECURITY_PREFIX "security."
24#define XATTR_SECURITY_PREFIX_LEN (sizeof(XATTR_SECURITY_PREFIX) - 1) 27#define XATTR_SECURITY_PREFIX_LEN (sizeof(XATTR_SECURITY_PREFIX) - 1)
25 28
diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h
index 602dc6c45d1a..165e7059de75 100644
--- a/include/uapi/sound/compress_params.h
+++ b/include/uapi/sound/compress_params.h
@@ -57,6 +57,7 @@
57#define MAX_NUM_CODECS 32 57#define MAX_NUM_CODECS 32
58#define MAX_NUM_CODEC_DESCRIPTORS 32 58#define MAX_NUM_CODEC_DESCRIPTORS 32
59#define MAX_NUM_BITRATES 32 59#define MAX_NUM_BITRATES 32
60#define MAX_NUM_SAMPLE_RATES 32
60 61
61/* Codecs are listed linearly to allow for extensibility */ 62/* Codecs are listed linearly to allow for extensibility */
62#define SND_AUDIOCODEC_PCM ((__u32) 0x00000001) 63#define SND_AUDIOCODEC_PCM ((__u32) 0x00000001)
@@ -324,7 +325,8 @@ union snd_codec_options {
324 325
325/** struct snd_codec_desc - description of codec capabilities 326/** struct snd_codec_desc - description of codec capabilities
326 * @max_ch: Maximum number of audio channels 327 * @max_ch: Maximum number of audio channels
327 * @sample_rates: Sampling rates in Hz, use SNDRV_PCM_RATE_xxx for this 328 * @sample_rates: Sampling rates in Hz, use values like 48000 for this
329 * @num_sample_rates: Number of valid values in sample_rates array
328 * @bit_rate: Indexed array containing supported bit rates 330 * @bit_rate: Indexed array containing supported bit rates
329 * @num_bitrates: Number of valid values in bit_rate array 331 * @num_bitrates: Number of valid values in bit_rate array
330 * @rate_control: value is specified by SND_RATECONTROLMODE defines. 332 * @rate_control: value is specified by SND_RATECONTROLMODE defines.
@@ -346,7 +348,8 @@ union snd_codec_options {
346 348
347struct snd_codec_desc { 349struct snd_codec_desc {
348 __u32 max_ch; 350 __u32 max_ch;
349 __u32 sample_rates; 351 __u32 sample_rates[MAX_NUM_SAMPLE_RATES];
352 __u32 num_sample_rates;
350 __u32 bit_rate[MAX_NUM_BITRATES]; 353 __u32 bit_rate[MAX_NUM_BITRATES];
351 __u32 num_bitrates; 354 __u32 num_bitrates;
352 __u32 rate_control; 355 __u32 rate_control;
@@ -364,7 +367,8 @@ struct snd_codec_desc {
364 * @ch_out: Number of output channels. In case of contradiction between 367 * @ch_out: Number of output channels. In case of contradiction between
365 * this field and the channelMode field, the channelMode field 368 * this field and the channelMode field, the channelMode field
366 * overrides. 369 * overrides.
367 * @sample_rate: Audio sample rate of input data 370 * @sample_rate: Audio sample rate of input data in Hz, use values like 48000
371 * for this.
368 * @bit_rate: Bitrate of encoded data. May be ignored by decoders 372 * @bit_rate: Bitrate of encoded data. May be ignored by decoders
369 * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines. 373 * @rate_control: Encoding rate control. See SND_RATECONTROLMODE defines.
370 * Encoders may rely on profiles for quality levels. 374 * Encoders may rely on profiles for quality levels.
diff --git a/include/video/pxa168fb.h b/include/video/pxa168fb.h
index 8c2f385a90ea..84cbb1f69ea6 100644
--- a/include/video/pxa168fb.h
+++ b/include/video/pxa168fb.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * linux/arch/arm/mach-mmp/include/mach/pxa168fb.h
3 *
4 * Copyright (C) 2009 Marvell International Ltd. 2 * Copyright (C) 2009 Marvell International Ltd.
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
diff --git a/include/xen/events.h b/include/xen/events.h
index c9ea10ee2273..c9c85cf84895 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -7,6 +7,8 @@
7#include <asm/xen/hypercall.h> 7#include <asm/xen/hypercall.h>
8#include <asm/xen/events.h> 8#include <asm/xen/events.h>
9 9
10unsigned xen_evtchn_nr_channels(void);
11
10int bind_evtchn_to_irq(unsigned int evtchn); 12int bind_evtchn_to_irq(unsigned int evtchn);
11int bind_evtchn_to_irqhandler(unsigned int evtchn, 13int bind_evtchn_to_irqhandler(unsigned int evtchn,
12 irq_handler_t handler, 14 irq_handler_t handler,
@@ -37,6 +39,11 @@ int bind_interdomain_evtchn_to_irqhandler(unsigned int remote_domain,
37 */ 39 */
38void unbind_from_irqhandler(unsigned int irq, void *dev_id); 40void unbind_from_irqhandler(unsigned int irq, void *dev_id);
39 41
42#define XEN_IRQ_PRIORITY_MAX EVTCHN_FIFO_PRIORITY_MAX
43#define XEN_IRQ_PRIORITY_DEFAULT EVTCHN_FIFO_PRIORITY_DEFAULT
44#define XEN_IRQ_PRIORITY_MIN EVTCHN_FIFO_PRIORITY_MIN
45int xen_set_irq_priority(unsigned irq, unsigned priority);
46
40/* 47/*
41 * Allow extra references to event channels exposed to userspace by evtchn 48 * Allow extra references to event channels exposed to userspace by evtchn
42 */ 49 */
@@ -73,6 +80,8 @@ void xen_poll_irq_timeout(int irq, u64 timeout);
73 80
74/* Determine the IRQ which is bound to an event channel */ 81/* Determine the IRQ which is bound to an event channel */
75unsigned irq_from_evtchn(unsigned int evtchn); 82unsigned irq_from_evtchn(unsigned int evtchn);
83int irq_from_virq(unsigned int cpu, unsigned int virq);
84unsigned int evtchn_from_irq(unsigned irq);
76 85
77/* Xen HVM evtchn vector callback */ 86/* Xen HVM evtchn vector callback */
78void xen_hvm_callback_vector(void); 87void xen_hvm_callback_vector(void);
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
index 694dcaf266e6..7ad033dbc845 100644
--- a/include/xen/grant_table.h
+++ b/include/xen/grant_table.h
@@ -178,17 +178,28 @@ int arch_gnttab_map_status(uint64_t *frames, unsigned long nr_gframes,
178 grant_status_t **__shared); 178 grant_status_t **__shared);
179void arch_gnttab_unmap(void *shared, unsigned long nr_gframes); 179void arch_gnttab_unmap(void *shared, unsigned long nr_gframes);
180 180
181extern unsigned long xen_hvm_resume_frames; 181struct grant_frames {
182 xen_pfn_t *pfn;
183 unsigned int count;
184 void *vaddr;
185};
186extern struct grant_frames xen_auto_xlat_grant_frames;
182unsigned int gnttab_max_grant_frames(void); 187unsigned int gnttab_max_grant_frames(void);
188int gnttab_setup_auto_xlat_frames(phys_addr_t addr);
189void gnttab_free_auto_xlat_frames(void);
183 190
184#define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) 191#define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr))
185 192
186int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, 193int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
187 struct gnttab_map_grant_ref *kmap_ops,
188 struct page **pages, unsigned int count); 194 struct page **pages, unsigned int count);
195int gnttab_map_refs_userspace(struct gnttab_map_grant_ref *map_ops,
196 struct gnttab_map_grant_ref *kmap_ops,
197 struct page **pages, unsigned int count);
189int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, 198int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
190 struct gnttab_map_grant_ref *kunmap_ops,
191 struct page **pages, unsigned int count); 199 struct page **pages, unsigned int count);
200int gnttab_unmap_refs_userspace(struct gnttab_unmap_grant_ref *unmap_ops,
201 struct gnttab_map_grant_ref *kunmap_ops,
202 struct page **pages, unsigned int count);
192 203
193/* Perform a batch of grant map/copy operations. Retry every batch slot 204/* Perform a batch of grant map/copy operations. Retry every batch slot
194 * for which the hypervisor returns GNTST_eagain. This is typically due 205 * for which the hypervisor returns GNTST_eagain. This is typically due
diff --git a/include/xen/interface/elfnote.h b/include/xen/interface/elfnote.h
index 0360b15f4883..6f4eae328ca7 100644
--- a/include/xen/interface/elfnote.h
+++ b/include/xen/interface/elfnote.h
@@ -140,6 +140,19 @@
140 */ 140 */
141#define XEN_ELFNOTE_SUSPEND_CANCEL 14 141#define XEN_ELFNOTE_SUSPEND_CANCEL 14
142 142
143/*
144 * The features supported by this kernel (numeric).
145 *
146 * Other than XEN_ELFNOTE_FEATURES on pre-4.2 Xen, this note allows a
147 * kernel to specify support for features that older hypervisors don't
148 * know about. The set of features 4.2 and newer hypervisors will
149 * consider supported by the kernel is the combination of the sets
150 * specified through this and the string note.
151 *
152 * LEGACY: FEATURES
153 */
154#define XEN_ELFNOTE_SUPPORTED_FEATURES 17
155
143#endif /* __XEN_PUBLIC_ELFNOTE_H__ */ 156#endif /* __XEN_PUBLIC_ELFNOTE_H__ */
144 157
145/* 158/*
diff --git a/include/xen/interface/event_channel.h b/include/xen/interface/event_channel.h
index f4942921e202..7e6acef5415b 100644
--- a/include/xen/interface/event_channel.h
+++ b/include/xen/interface/event_channel.h
@@ -190,6 +190,39 @@ struct evtchn_reset {
190}; 190};
191typedef struct evtchn_reset evtchn_reset_t; 191typedef struct evtchn_reset evtchn_reset_t;
192 192
193/*
194 * EVTCHNOP_init_control: initialize the control block for the FIFO ABI.
195 */
196#define EVTCHNOP_init_control 11
197struct evtchn_init_control {
198 /* IN parameters. */
199 uint64_t control_gfn;
200 uint32_t offset;
201 uint32_t vcpu;
202 /* OUT parameters. */
203 uint8_t link_bits;
204 uint8_t _pad[7];
205};
206
207/*
208 * EVTCHNOP_expand_array: add an additional page to the event array.
209 */
210#define EVTCHNOP_expand_array 12
211struct evtchn_expand_array {
212 /* IN parameters. */
213 uint64_t array_gfn;
214};
215
216/*
217 * EVTCHNOP_set_priority: set the priority for an event channel.
218 */
219#define EVTCHNOP_set_priority 13
220struct evtchn_set_priority {
221 /* IN parameters. */
222 uint32_t port;
223 uint32_t priority;
224};
225
193struct evtchn_op { 226struct evtchn_op {
194 uint32_t cmd; /* EVTCHNOP_* */ 227 uint32_t cmd; /* EVTCHNOP_* */
195 union { 228 union {
@@ -207,4 +240,39 @@ struct evtchn_op {
207}; 240};
208DEFINE_GUEST_HANDLE_STRUCT(evtchn_op); 241DEFINE_GUEST_HANDLE_STRUCT(evtchn_op);
209 242
243/*
244 * 2-level ABI
245 */
246
247#define EVTCHN_2L_NR_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
248
249/*
250 * FIFO ABI
251 */
252
253/* Events may have priorities from 0 (highest) to 15 (lowest). */
254#define EVTCHN_FIFO_PRIORITY_MAX 0
255#define EVTCHN_FIFO_PRIORITY_DEFAULT 7
256#define EVTCHN_FIFO_PRIORITY_MIN 15
257
258#define EVTCHN_FIFO_MAX_QUEUES (EVTCHN_FIFO_PRIORITY_MIN + 1)
259
260typedef uint32_t event_word_t;
261
262#define EVTCHN_FIFO_PENDING 31
263#define EVTCHN_FIFO_MASKED 30
264#define EVTCHN_FIFO_LINKED 29
265#define EVTCHN_FIFO_BUSY 28
266
267#define EVTCHN_FIFO_LINK_BITS 17
268#define EVTCHN_FIFO_LINK_MASK ((1 << EVTCHN_FIFO_LINK_BITS) - 1)
269
270#define EVTCHN_FIFO_NR_CHANNELS (1 << EVTCHN_FIFO_LINK_BITS)
271
272struct evtchn_fifo_control_block {
273 uint32_t ready;
274 uint32_t _rsvd;
275 event_word_t head[EVTCHN_FIFO_MAX_QUEUES];
276};
277
210#endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */ 278#endif /* __XEN_PUBLIC_EVENT_CHANNEL_H__ */
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
index 53ec4167bd0b..0cd5ca333fac 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -281,12 +281,6 @@ struct multicall_entry {
281}; 281};
282DEFINE_GUEST_HANDLE_STRUCT(multicall_entry); 282DEFINE_GUEST_HANDLE_STRUCT(multicall_entry);
283 283
284/*
285 * Event channel endpoints per domain:
286 * 1024 if a long is 32 bits; 4096 if a long is 64 bits.
287 */
288#define NR_EVENT_CHANNELS (sizeof(xen_ulong_t) * sizeof(xen_ulong_t) * 64)
289
290struct vcpu_time_info { 284struct vcpu_time_info {
291 /* 285 /*
292 * Updates to the following values are preceded and followed 286 * Updates to the following values are preceded and followed
diff --git a/include/xen/platform_pci.h b/include/xen/platform_pci.h
index 438c256c274b..5c52b5583917 100644
--- a/include/xen/platform_pci.h
+++ b/include/xen/platform_pci.h
@@ -46,6 +46,27 @@ static inline int xen_must_unplug_disks(void) {
46#endif 46#endif
47} 47}
48 48
49extern int xen_platform_pci_unplug; 49#if defined(CONFIG_XEN_PVHVM)
50 50extern bool xen_has_pv_devices(void);
51extern bool xen_has_pv_disk_devices(void);
52extern bool xen_has_pv_nic_devices(void);
53extern bool xen_has_pv_and_legacy_disk_devices(void);
54#else
55static inline bool xen_has_pv_devices(void)
56{
57 return IS_ENABLED(CONFIG_XEN);
58}
59static inline bool xen_has_pv_disk_devices(void)
60{
61 return IS_ENABLED(CONFIG_XEN);
62}
63static inline bool xen_has_pv_nic_devices(void)
64{
65 return IS_ENABLED(CONFIG_XEN);
66}
67static inline bool xen_has_pv_and_legacy_disk_devices(void)
68{
69 return false;
70}
71#endif
51#endif /* _XEN_PLATFORM_PCI_H */ 72#endif /* _XEN_PLATFORM_PCI_H */
diff --git a/include/xen/xen.h b/include/xen/xen.h
index a74d4362c4f8..0c0e3ef4c45d 100644
--- a/include/xen/xen.h
+++ b/include/xen/xen.h
@@ -29,4 +29,18 @@ extern enum xen_domain_type xen_domain_type;
29#define xen_initial_domain() (0) 29#define xen_initial_domain() (0)
30#endif /* CONFIG_XEN_DOM0 */ 30#endif /* CONFIG_XEN_DOM0 */
31 31
32#ifdef CONFIG_XEN_PVH
33/* This functionality exists only for x86. The XEN_PVHVM support exists
34 * only in x86 world - hence on ARM it will be always disabled.
35 * N.B. ARM guests are neither PV nor HVM nor PVHVM.
36 * It's a bit like PVH but is different also (it's further towards the H
37 * end of the spectrum than even PVH).
38 */
39#include <xen/features.h>
40#define xen_pvh_domain() (xen_pv_domain() && \
41 xen_feature(XENFEAT_auto_translated_physmap) && \
42 xen_have_vector_callback)
43#else
44#define xen_pvh_domain() (0)
45#endif
32#endif /* _XEN_XEN_H */ 46#endif /* _XEN_XEN_H */