aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2013-07-12 06:34:42 -0400
committerThomas Gleixner <tglx@linutronix.de>2013-07-12 06:34:42 -0400
commitf2006e27396f55276f24434f56e208d86e7f9908 (patch)
tree71896db916d33888b4286f80117d3cac0da40e6d /include
parente399eb56a6110e13f97e644658648602e2b08de7 (diff)
parent9903883f1dd6e86f286b7bfa6e4b423f98c1cd9e (diff)
Merge branch 'linus' into timers/urgent
Get upstream changes so we can apply fixes against them Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h4
-rw-r--r--include/acpi/acoutput.h8
-rw-r--r--include/acpi/acpi_bus.h30
-rw-r--r--include/acpi/acpixf.h3
-rw-r--r--include/acpi/processor.h5
-rw-r--r--include/asm-generic/pgtable.h27
-rw-r--r--include/asm-generic/sections.h21
-rw-r--r--include/asm-generic/vmlinux.lds.h19
-rw-r--r--include/clocksource/arm_arch_timer.h2
-rw-r--r--include/drm/drmP.h40
-rw-r--r--include/drm/drm_crtc.h37
-rw-r--r--include/drm/drm_fixed.h94
-rw-r--r--include/drm/drm_gem_cma_helper.h12
-rw-r--r--include/drm/drm_mm.h38
-rw-r--r--include/drm/drm_os_linux.h16
-rw-r--r--include/drm/drm_pciids.h24
-rw-r--r--include/drm/drm_rect.h167
-rw-r--r--include/drm/i915_powerwell.h36
-rw-r--r--include/drm/ttm/ttm_bo_api.h37
-rw-r--r--include/drm/ttm/ttm_bo_driver.h169
-rw-r--r--include/drm/ttm/ttm_execbuf_util.h12
-rw-r--r--include/dt-bindings/pinctrl/rockchip.h32
-rw-r--r--include/kvm/arm_arch_timer.h89
-rw-r--r--include/kvm/arm_vgic.h220
-rw-r--r--include/linux/acpi.h3
-rw-r--r--include/linux/aer.h22
-rw-r--r--include/linux/alarmtimer.h4
-rw-r--r--include/linux/amba/pl08x.h8
-rw-r--r--include/linux/async_tx.h4
-rw-r--r--include/linux/audit.h26
-rw-r--r--include/linux/backlight.h6
-rw-r--r--include/linux/bcma/bcma.h1
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h55
-rw-r--r--include/linux/bio.h4
-rw-r--r--include/linux/bootmem.h2
-rw-r--r--include/linux/buffer_head.h3
-rw-r--r--include/linux/can/platform/flexcan.h20
-rw-r--r--include/linux/ceph/decode.h5
-rw-r--r--include/linux/ceph/osd_client.h1
-rw-r--r--include/linux/cgroup.h229
-rw-r--r--include/linux/clk-provider.h62
-rw-r--r--include/linux/clk/tegra.h6
-rw-r--r--include/linux/clockchips.h5
-rw-r--r--include/linux/clocksource.h8
-rw-r--r--include/linux/cpu.h3
-rw-r--r--include/linux/cpu_cooling.h4
-rw-r--r--include/linux/cpufreq.h54
-rw-r--r--include/linux/cpuidle.h6
-rw-r--r--include/linux/crc-t10dif.h4
-rw-r--r--include/linux/dcache.h16
-rw-r--r--include/linux/debug_locks.h4
-rw-r--r--include/linux/decompress/unlz4.h10
-rw-r--r--include/linux/devfreq.h2
-rw-r--r--include/linux/device-mapper.h6
-rw-r--r--include/linux/device.h22
-rw-r--r--include/linux/dmaengine.h5
-rw-r--r--include/linux/dw_apb_timer.h1
-rw-r--r--include/linux/efi.h4
-rw-r--r--include/linux/elevator.h6
-rw-r--r--include/linux/err.h10
-rw-r--r--include/linux/fb.h2
-rw-r--r--include/linux/filter.h4
-rw-r--r--include/linux/firewire.h2
-rw-r--r--include/linux/freezer.h171
-rw-r--r--include/linux/fs.h55
-rw-r--r--include/linux/fsnotify.h8
-rw-r--r--include/linux/ftrace.h9
-rw-r--r--include/linux/gfp.h2
-rw-r--r--include/linux/huge_mm.h8
-rw-r--r--include/linux/hugetlb.h6
-rw-r--r--include/linux/i2c/twl.h31
-rw-r--r--include/linux/ieee80211.h10
-rw-r--r--include/linux/if_link.h1
-rw-r--r--include/linux/if_macvlan.h12
-rw-r--r--include/linux/if_team.h11
-rw-r--r--include/linux/if_vlan.h2
-rw-r--r--include/linux/igmp.h1
-rw-r--r--include/linux/inetdevice.h5
-rw-r--r--include/linux/init.h19
-rw-r--r--include/linux/input/ti_am335x_tsc.h23
-rw-r--r--include/linux/input/tps6507x-ts.h1
-rw-r--r--include/linux/io.h25
-rw-r--r--include/linux/irqdomain.h142
-rw-r--r--include/linux/jiffies.h4
-rw-r--r--include/linux/kernel.h5
-rw-r--r--include/linux/ktime.h23
-rw-r--r--include/linux/kvm_host.h4
-rw-r--r--include/linux/lcd.h5
-rw-r--r--include/linux/libata.h5
-rw-r--r--include/linux/lz4.h87
-rw-r--r--include/linux/marvell_phy.h2
-rw-r--r--include/linux/memcontrol.h9
-rw-r--r--include/linux/memory_hotplug.h14
-rw-r--r--include/linux/mfd/88pm80x.h17
-rw-r--r--include/linux/mfd/abx500/ab8500-sysctrl.h4
-rw-r--r--include/linux/mfd/abx500/ab8500.h2
-rw-r--r--include/linux/mfd/arizona/core.h4
-rw-r--r--include/linux/mfd/arizona/pdata.h2
-rw-r--r--include/linux/mfd/arizona/registers.h47
-rw-r--r--include/linux/mfd/davinci_voicecodec.h4
-rw-r--r--include/linux/mfd/dbx500-prcmu.h12
-rw-r--r--include/linux/mfd/kempld.h125
-rw-r--r--include/linux/mfd/max77693-private.h13
-rw-r--r--include/linux/mfd/max77693.h18
-rw-r--r--include/linux/mfd/max8998-private.h7
-rw-r--r--include/linux/mfd/max8998.h20
-rw-r--r--include/linux/mfd/mc13xxx.h100
-rw-r--r--include/linux/mfd/palmas.h14
-rw-r--r--include/linux/mfd/rtsx_pci.h1
-rw-r--r--include/linux/mfd/samsung/core.h6
-rw-r--r--include/linux/mfd/samsung/s2mps11.h1
-rw-r--r--include/linux/mfd/ti_am335x_tscadc.h35
-rw-r--r--include/linux/mfd/tmio.h5
-rw-r--r--include/linux/mfd/tps6507x.h1
-rw-r--r--include/linux/mfd/twl6040.h7
-rw-r--r--include/linux/mfd/wm8994/core.h2
-rw-r--r--include/linux/mfd/wm8994/pdata.h10
-rw-r--r--include/linux/mfd/wm8994/registers.h8
-rw-r--r--include/linux/mlx4/cmd.h3
-rw-r--r--include/linux/mlx4/device.h3
-rw-r--r--include/linux/mlx4/qp.h36
-rw-r--r--include/linux/mm.h49
-rw-r--r--include/linux/mm_types.h3
-rw-r--r--include/linux/mman.h8
-rw-r--r--include/linux/mmc/card.h11
-rw-r--r--include/linux/mmc/core.h5
-rw-r--r--include/linux/mmc/host.h12
-rw-r--r--include/linux/mmc/sdhci.h6
-rw-r--r--include/linux/mmzone.h68
-rw-r--r--include/linux/mod_devicetable.h25
-rw-r--r--include/linux/moduleparam.h2
-rw-r--r--include/linux/msi.h1
-rw-r--r--include/linux/mv643xx_eth.h2
-rw-r--r--include/linux/nbd.h1
-rw-r--r--include/linux/net.h6
-rw-r--r--include/linux/netdev_features.h4
-rw-r--r--include/linux/netdevice.h85
-rw-r--r--include/linux/netfilter.h2
-rw-r--r--include/linux/netlink.h27
-rw-r--r--include/linux/netpoll.h4
-rw-r--r--include/linux/nfs4.h22
-rw-r--r--include/linux/nfs_fs.h28
-rw-r--r--include/linux/nfs_fs_sb.h8
-rw-r--r--include/linux/nfs_xdr.h20
-rw-r--r--include/linux/of_device.h6
-rw-r--r--include/linux/of_dma.h1
-rw-r--r--include/linux/of_platform.h35
-rw-r--r--include/linux/pageblock-flags.h6
-rw-r--r--include/linux/pagevec.h34
-rw-r--r--include/linux/pci.h6
-rw-r--r--include/linux/pci_ids.h7
-rw-r--r--include/linux/percpu-refcount.h174
-rw-r--r--include/linux/phy.h27
-rw-r--r--include/linux/pid.h6
-rw-r--r--include/linux/pinctrl/consumer.h77
-rw-r--r--include/linux/pinctrl/devinfo.h4
-rw-r--r--include/linux/pinctrl/pinconf-generic.h25
-rw-r--r--include/linux/pinctrl/pinconf.h2
-rw-r--r--include/linux/pinctrl/pinctrl.h4
-rw-r--r--include/linux/platform_data/brcmfmac-sdio.h5
-rw-r--r--include/linux/platform_data/clk-ux500.h6
-rw-r--r--include/linux/platform_data/cyttsp4.h76
-rw-r--r--include/linux/platform_data/dma-atmel.h4
-rw-r--r--include/linux/platform_data/dma-imx.h6
-rw-r--r--include/linux/platform_data/g762.h37
-rw-r--r--include/linux/platform_data/keypad-pxa27x.h3
-rw-r--r--include/linux/platform_data/mmc-esdhc-imx.h1
-rw-r--r--include/linux/platform_data/net-cw1200.h81
-rw-r--r--include/linux/platform_data/pwm-renesas-tpu.h16
-rw-r--r--include/linux/platform_data/rcar-du.h54
-rw-r--r--include/linux/platform_data/remoteproc-omap.h2
-rw-r--r--include/linux/platform_data/si5351.h18
-rw-r--r--include/linux/platform_data/ssm2518.h22
-rw-r--r--include/linux/platform_data/ti_am335x_adc.h14
-rw-r--r--include/linux/platform_device.h3
-rw-r--r--include/linux/pm_runtime.h2
-rw-r--r--include/linux/posix-timers.h16
-rw-r--r--include/linux/power/smartreflex.h10
-rw-r--r--include/linux/power_supply.h4
-rw-r--r--include/linux/pstore.h12
-rw-r--r--include/linux/ptrace.h10
-rw-r--r--include/linux/pvclock_gtod.h7
-rw-r--r--include/linux/pwm.h29
-rw-r--r--include/linux/reboot.h27
-rw-r--r--include/linux/regmap.h43
-rw-r--r--include/linux/regulator/ab8500.h4
-rw-r--r--include/linux/regulator/consumer.h1
-rw-r--r--include/linux/reservation.h62
-rw-r--r--include/linux/rio.h82
-rw-r--r--include/linux/rio_ids.h2
-rw-r--r--include/linux/scatterlist.h5
-rw-r--r--include/linux/sched.h16
-rw-r--r--include/linux/sched_clock.h21
-rw-r--r--include/linux/security.h60
-rw-r--r--include/linux/sem.h6
-rw-r--r--include/linux/seq_file.h6
-rw-r--r--include/linux/sh_dma.h2
-rw-r--r--include/linux/shdma-base.h3
-rw-r--r--include/linux/skbuff.h137
-rw-r--r--include/linux/smp.h20
-rw-r--r--include/linux/spi/spi.h3
-rw-r--r--include/linux/spi/xilinx_spi.h1
-rw-r--r--include/linux/spinlock_api_smp.h2
-rw-r--r--include/linux/ssb/ssb_driver_mips.h15
-rw-r--r--include/linux/ssb/ssb_regs.h1
-rw-r--r--include/linux/stmmac.h4
-rw-r--r--include/linux/sunrpc/cache.h49
-rw-r--r--include/linux/sunrpc/gss_api.h2
-rw-r--r--include/linux/sunrpc/sched.h20
-rw-r--r--include/linux/sunrpc/svcauth.h11
-rw-r--r--include/linux/suspend.h1
-rw-r--r--include/linux/swap.h24
-rw-r--r--include/linux/tcp.h1
-rw-r--r--include/linux/tpm.h2
-rw-r--r--include/linux/vexpress.h1
-rw-r--r--include/linux/virtio.h11
-rw-r--r--include/linux/virtio_ring.h1
-rw-r--r--include/linux/vmalloc.h16
-rw-r--r--include/linux/workqueue.h42
-rw-r--r--include/linux/writeback.h8
-rw-r--r--include/linux/zbud.h22
-rw-r--r--include/net/9p/transport.h6
-rw-r--r--include/net/act_api.h2
-rw-r--r--include/net/addrconf.h4
-rw-r--r--include/net/bluetooth/hci.h1
-rw-r--r--include/net/bluetooth/hci_core.h29
-rw-r--r--include/net/bluetooth/l2cap.h2
-rw-r--r--include/net/cfg80211.h236
-rw-r--r--include/net/gen_stats.h10
-rw-r--r--include/net/gre.h31
-rw-r--r--include/net/ieee80211_radiotap.h7
-rw-r--r--include/net/if_inet6.h13
-rw-r--r--include/net/inet_ecn.h6
-rw-r--r--include/net/inet_sock.h1
-rw-r--r--include/net/ip_fib.h5
-rw-r--r--include/net/ip_tunnels.h36
-rw-r--r--include/net/ip_vs.h92
-rw-r--r--include/net/ipv6.h10
-rw-r--r--include/net/ll_poll.h183
-rw-r--r--include/net/mac80211.h27
-rw-r--r--include/net/ndisc.h2
-rw-r--r--include/net/net_namespace.h13
-rw-r--r--include/net/netfilter/xt_rateest.h2
-rw-r--r--include/net/netns/x_tables.h6
-rw-r--r--include/net/nfc/hci.h7
-rw-r--r--include/net/nfc/nci_core.h58
-rw-r--r--include/net/nfc/nfc.h35
-rw-r--r--include/net/ping.h65
-rw-r--r--include/net/sch_generic.h17
-rw-r--r--include/net/sctp/checksum.h5
-rw-r--r--include/net/sctp/sctp.h111
-rw-r--r--include/net/sctp/structs.h6
-rw-r--r--include/net/sock.h21
-rw-r--r--include/net/tcp.h29
-rw-r--r--include/net/transp_v6.h79
-rw-r--r--include/net/udp.h8
-rw-r--r--include/scsi/iscsi_if.h5
-rw-r--r--include/scsi/libiscsi.h4
-rw-r--r--include/scsi/libsas.h2
-rw-r--r--include/scsi/scsi.h5
-rw-r--r--include/scsi/scsi_device.h1
-rw-r--r--include/scsi/scsi_devinfo.h1
-rw-r--r--include/sound/control.h3
-rw-r--r--include/sound/core.h2
-rw-r--r--include/sound/pcm.h5
-rw-r--r--include/sound/rt5640.h22
-rw-r--r--include/sound/soc-dapm.h3
-rw-r--r--include/sound/soc.h4
-rw-r--r--include/target/iscsi/iscsi_transport.h21
-rw-r--r--include/target/target_core_base.h23
-rw-r--r--include/target/target_core_configfs.h1
-rw-r--r--include/target/target_core_fabric.h2
-rw-r--r--include/target/target_core_fabric_configfs.h11
-rw-r--r--include/trace/events/9p.h28
-rw-r--r--include/trace/events/btrfs.h35
-rw-r--r--include/trace/events/pagemap.h89
-rw-r--r--include/trace/events/power.h173
-rw-r--r--include/trace/events/regmap.h23
-rw-r--r--include/trace/events/target.h214
-rw-r--r--include/trace/syscall.h1
-rw-r--r--include/uapi/asm-generic/fcntl.h4
-rw-r--r--include/uapi/asm-generic/poll.h2
-rw-r--r--include/uapi/asm-generic/socket.h2
-rw-r--r--include/uapi/drm/drm.h1
-rw-r--r--include/uapi/drm/drm_mode.h13
-rw-r--r--include/uapi/drm/i915_drm.h3
-rw-r--r--include/uapi/drm/tegra_drm.h2
-rw-r--r--include/uapi/linux/btrfs.h42
-rw-r--r--include/uapi/linux/dm-ioctl.h4
-rw-r--r--include/uapi/linux/ethtool.h4
-rw-r--r--include/uapi/linux/gen_stats.h11
-rw-r--r--include/uapi/linux/if_arp.h1
-rw-r--r--include/uapi/linux/if_link.h15
-rw-r--r--include/uapi/linux/if_pppox.h4
-rw-r--r--include/uapi/linux/if_tun.h2
-rw-r--r--include/uapi/linux/input.h17
-rw-r--r--include/uapi/linux/ip_vs.h6
-rw-r--r--include/uapi/linux/kvm.h2
-rw-r--r--include/uapi/linux/msdos_fs.h10
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_queue.h2
-rw-r--r--include/uapi/linux/netfilter/xt_socket.h7
-rw-r--r--include/uapi/linux/nfc.h18
-rw-r--r--include/uapi/linux/nl80211.h37
-rw-r--r--include/uapi/linux/openvswitch.h20
-rw-r--r--include/uapi/linux/pci_regs.h2
-rw-r--r--include/uapi/linux/ptrace.h3
-rw-r--r--include/uapi/linux/rtnetlink.h2
-rw-r--r--include/uapi/linux/snmp.h2
-rw-r--r--include/uapi/linux/tipc.h2
-rw-r--r--include/uapi/linux/tipc_config.h2
-rw-r--r--include/uapi/linux/vfio.h42
-rw-r--r--include/uapi/linux/virtio_config.h3
-rw-r--r--include/uapi/linux/virtio_console.h3
-rw-r--r--include/uapi/linux/virtio_pci.h4
-rw-r--r--include/uapi/mtd/ubi-user.h5
-rw-r--r--include/uapi/sound/asound.h2
-rw-r--r--include/video/display_timing.h1
-rw-r--r--include/video/of_display_timing.h3
-rw-r--r--include/video/omap-panel-data.h209
-rw-r--r--include/video/omapdss.h293
-rw-r--r--include/video/uvesafb.h1
-rw-r--r--include/xen/acpi.h16
-rw-r--r--include/xen/hvm.h4
-rw-r--r--include/xen/interface/io/netif.h12
-rw-r--r--include/xen/interface/io/protocols.h2
325 files changed, 5824 insertions, 1834 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 14ceff788c40..1c16f821434f 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -219,8 +219,8 @@
219 * 219 *
220 *****************************************************************************/ 220 *****************************************************************************/
221 221
222#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ 222#define ACPI_DEBUGGER_MAX_ARGS ACPI_METHOD_NUM_ARGS + 4 /* Max command line arguments */
223#define ACPI_DB_LINE_BUFFER_SIZE 512 223#define ACPI_DB_LINE_BUFFER_SIZE 512
224 224
225#define ACPI_DEBUGGER_COMMAND_PROMPT '-' 225#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
226#define ACPI_DEBUGGER_EXECUTE_PROMPT '%' 226#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 4f52ea795c7a..4607b027a657 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -428,27 +428,21 @@
428 * This is the non-debug case -- make everything go away, 428 * This is the non-debug case -- make everything go away,
429 * leaving no executable debug code! 429 * leaving no executable debug code!
430 */ 430 */
431#define ACPI_FUNCTION_NAME(a)
432#define ACPI_DEBUG_PRINT(pl) 431#define ACPI_DEBUG_PRINT(pl)
433#define ACPI_DEBUG_PRINT_RAW(pl) 432#define ACPI_DEBUG_PRINT_RAW(pl)
434#define ACPI_DEBUG_EXEC(a) 433#define ACPI_DEBUG_EXEC(a)
435#define ACPI_DEBUG_ONLY_MEMBERS(a) 434#define ACPI_DEBUG_ONLY_MEMBERS(a)
435#define ACPI_FUNCTION_NAME(a)
436#define ACPI_FUNCTION_TRACE(a) 436#define ACPI_FUNCTION_TRACE(a)
437#define ACPI_FUNCTION_TRACE_PTR(a, b) 437#define ACPI_FUNCTION_TRACE_PTR(a, b)
438#define ACPI_FUNCTION_TRACE_U32(a, b) 438#define ACPI_FUNCTION_TRACE_U32(a, b)
439#define ACPI_FUNCTION_TRACE_STR(a, b) 439#define ACPI_FUNCTION_TRACE_STR(a, b)
440#define ACPI_FUNCTION_EXIT
441#define ACPI_FUNCTION_STATUS_EXIT(s)
442#define ACPI_FUNCTION_VALUE_EXIT(s)
443#define ACPI_FUNCTION_ENTRY() 440#define ACPI_FUNCTION_ENTRY()
444#define ACPI_DUMP_STACK_ENTRY(a) 441#define ACPI_DUMP_STACK_ENTRY(a)
445#define ACPI_DUMP_OPERANDS(a, b, c) 442#define ACPI_DUMP_OPERANDS(a, b, c)
446#define ACPI_DUMP_ENTRY(a, b) 443#define ACPI_DUMP_ENTRY(a, b)
447#define ACPI_DUMP_TABLES(a, b)
448#define ACPI_DUMP_PATHNAME(a, b, c, d) 444#define ACPI_DUMP_PATHNAME(a, b, c, d)
449#define ACPI_DUMP_BUFFER(a, b) 445#define ACPI_DUMP_BUFFER(a, b)
450#define ACPI_DEBUG_PRINT(pl)
451#define ACPI_DEBUG_PRINT_RAW(pl)
452#define ACPI_IS_DEBUG_ENABLED(level, component) 0 446#define ACPI_IS_DEBUG_ENABLED(level, component) 0
453 447
454/* Return macros must have a return statement at the minimum */ 448/* Return macros must have a return statement at the minimum */
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index c13c919ab99e..56e6b68c8d2f 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -63,13 +63,6 @@ acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld
63#define ACPI_BUS_FILE_ROOT "acpi" 63#define ACPI_BUS_FILE_ROOT "acpi"
64extern struct proc_dir_entry *acpi_root_dir; 64extern struct proc_dir_entry *acpi_root_dir;
65 65
66enum acpi_bus_removal_type {
67 ACPI_BUS_REMOVAL_NORMAL = 0,
68 ACPI_BUS_REMOVAL_EJECT,
69 ACPI_BUS_REMOVAL_SUPRISE,
70 ACPI_BUS_REMOVAL_TYPE_COUNT
71};
72
73enum acpi_bus_device_type { 66enum acpi_bus_device_type {
74 ACPI_BUS_TYPE_DEVICE = 0, 67 ACPI_BUS_TYPE_DEVICE = 0,
75 ACPI_BUS_TYPE_POWER, 68 ACPI_BUS_TYPE_POWER,
@@ -163,12 +156,10 @@ struct acpi_device_flags {
163 u32 dynamic_status:1; 156 u32 dynamic_status:1;
164 u32 removable:1; 157 u32 removable:1;
165 u32 ejectable:1; 158 u32 ejectable:1;
166 u32 suprise_removal_ok:1;
167 u32 power_manageable:1; 159 u32 power_manageable:1;
168 u32 performance_manageable:1;
169 u32 eject_pending:1; 160 u32 eject_pending:1;
170 u32 match_driver:1; 161 u32 match_driver:1;
171 u32 reserved:24; 162 u32 reserved:26;
172}; 163};
173 164
174/* File System */ 165/* File System */
@@ -286,6 +277,7 @@ struct acpi_device_physical_node {
286 u8 node_id; 277 u8 node_id;
287 struct list_head node; 278 struct list_head node;
288 struct device *dev; 279 struct device *dev;
280 bool put_online:1;
289}; 281};
290 282
291/* set maximum of physical nodes to 32 for expansibility */ 283/* set maximum of physical nodes to 32 for expansibility */
@@ -310,7 +302,6 @@ struct acpi_device {
310 struct acpi_driver *driver; 302 struct acpi_driver *driver;
311 void *driver_data; 303 void *driver_data;
312 struct device dev; 304 struct device dev;
313 enum acpi_bus_removal_type removal_type; /* indicate for different removal type */
314 u8 physical_node_count; 305 u8 physical_node_count;
315 struct list_head physical_node_list; 306 struct list_head physical_node_list;
316 struct mutex physical_node_lock; 307 struct mutex physical_node_lock;
@@ -443,7 +434,6 @@ int register_acpi_bus_type(struct acpi_bus_type *);
443int unregister_acpi_bus_type(struct acpi_bus_type *); 434int unregister_acpi_bus_type(struct acpi_bus_type *);
444 435
445struct acpi_pci_root { 436struct acpi_pci_root {
446 struct list_head node;
447 struct acpi_device * device; 437 struct acpi_device * device;
448 struct pci_bus *bus; 438 struct pci_bus *bus;
449 u16 segment; 439 u16 segment;
@@ -468,8 +458,6 @@ acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
468 acpi_notify_handler handler, void *context); 458 acpi_notify_handler handler, void *context);
469acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, 459acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
470 acpi_notify_handler handler); 460 acpi_notify_handler handler);
471int acpi_device_power_state(struct device *dev, struct acpi_device *adev,
472 u32 target_state, int d_max_in, int *d_min_p);
473int acpi_pm_device_sleep_state(struct device *, int *, int); 461int acpi_pm_device_sleep_state(struct device *, int *, int);
474void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev); 462void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev);
475void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev); 463void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev);
@@ -485,23 +473,13 @@ static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
485{ 473{
486 return AE_SUPPORT; 474 return AE_SUPPORT;
487} 475}
488static inline int __acpi_device_power_state(int m, int *p) 476static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
489{ 477{
490 if (p) 478 if (p)
491 *p = ACPI_STATE_D0; 479 *p = ACPI_STATE_D0;
480
492 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0; 481 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0;
493} 482}
494static inline int acpi_device_power_state(struct device *dev,
495 struct acpi_device *adev,
496 u32 target_state, int d_max_in,
497 int *d_min_p)
498{
499 return __acpi_device_power_state(d_max_in, d_min_p);
500}
501static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
502{
503 return __acpi_device_power_state(m, p);
504}
505static inline void acpi_dev_pm_add_dependent(acpi_handle handle, 483static inline void acpi_dev_pm_add_dependent(acpi_handle handle,
506 struct device *depdev) {} 484 struct device *depdev) {}
507static inline void acpi_dev_pm_remove_dependent(acpi_handle handle, 485static inline void acpi_dev_pm_remove_dependent(acpi_handle handle,
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 454881e6450a..1b09300810e6 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 0x20130328 49#define ACPI_CA_VERSION 0x20130517
50 50
51#include <acpi/acconfig.h> 51#include <acpi/acconfig.h>
52#include <acpi/actypes.h> 52#include <acpi/actypes.h>
@@ -80,6 +80,7 @@ extern bool acpi_gbl_enable_aml_debug_object;
80extern u8 acpi_gbl_copy_dsdt_locally; 80extern u8 acpi_gbl_copy_dsdt_locally;
81extern u8 acpi_gbl_truncate_io_addresses; 81extern u8 acpi_gbl_truncate_io_addresses;
82extern u8 acpi_gbl_disable_auto_repair; 82extern u8 acpi_gbl_disable_auto_repair;
83extern u8 acpi_gbl_disable_ssdt_table_load;
83 84
84/* 85/*
85 * Hardware-reduced prototypes. All interfaces that use these macros will 86 * Hardware-reduced prototypes. All interfaces that use these macros will
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index ea69367fdd3b..66096d06925e 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -6,6 +6,10 @@
6#include <linux/thermal.h> 6#include <linux/thermal.h>
7#include <asm/acpi.h> 7#include <asm/acpi.h>
8 8
9#define ACPI_PROCESSOR_CLASS "processor"
10#define ACPI_PROCESSOR_DEVICE_NAME "Processor"
11#define ACPI_PROCESSOR_DEVICE_HID "ACPI0007"
12
9#define ACPI_PROCESSOR_BUSY_METRIC 10 13#define ACPI_PROCESSOR_BUSY_METRIC 10
10 14
11#define ACPI_PROCESSOR_MAX_POWER 8 15#define ACPI_PROCESSOR_MAX_POWER 8
@@ -207,6 +211,7 @@ struct acpi_processor {
207 struct acpi_processor_throttling throttling; 211 struct acpi_processor_throttling throttling;
208 struct acpi_processor_limit limit; 212 struct acpi_processor_limit limit;
209 struct thermal_cooling_device *cdev; 213 struct thermal_cooling_device *cdev;
214 struct device *dev; /* Processor device. */
210}; 215};
211 216
212struct acpi_processor_errata { 217struct acpi_processor_errata {
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index b1836987d506..2f47ade1b567 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -173,11 +173,12 @@ extern void pmdp_splitting_flush(struct vm_area_struct *vma,
173#endif 173#endif
174 174
175#ifndef __HAVE_ARCH_PGTABLE_DEPOSIT 175#ifndef __HAVE_ARCH_PGTABLE_DEPOSIT
176extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pgtable_t pgtable); 176extern void pgtable_trans_huge_deposit(struct mm_struct *mm, pmd_t *pmdp,
177 pgtable_t pgtable);
177#endif 178#endif
178 179
179#ifndef __HAVE_ARCH_PGTABLE_WITHDRAW 180#ifndef __HAVE_ARCH_PGTABLE_WITHDRAW
180extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm); 181extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp);
181#endif 182#endif
182 183
183#ifndef __HAVE_ARCH_PMDP_INVALIDATE 184#ifndef __HAVE_ARCH_PMDP_INVALIDATE
@@ -396,6 +397,28 @@ static inline void ptep_modify_prot_commit(struct mm_struct *mm,
396#define arch_start_context_switch(prev) do {} while (0) 397#define arch_start_context_switch(prev) do {} while (0)
397#endif 398#endif
398 399
400#ifndef CONFIG_HAVE_ARCH_SOFT_DIRTY
401static inline int pte_soft_dirty(pte_t pte)
402{
403 return 0;
404}
405
406static inline int pmd_soft_dirty(pmd_t pmd)
407{
408 return 0;
409}
410
411static inline pte_t pte_mksoft_dirty(pte_t pte)
412{
413 return pte;
414}
415
416static inline pmd_t pmd_mksoft_dirty(pmd_t pmd)
417{
418 return pmd;
419}
420#endif
421
399#ifndef __HAVE_PFNMAP_TRACKING 422#ifndef __HAVE_PFNMAP_TRACKING
400/* 423/*
401 * Interfaces that can be used by architecture code to keep track of 424 * Interfaces that can be used by architecture code to keep track of
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index c1a1216e29ce..f1a24b5c3b90 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -3,6 +3,26 @@
3 3
4/* References to section boundaries */ 4/* References to section boundaries */
5 5
6/*
7 * Usage guidelines:
8 * _text, _data: architecture specific, don't use them in arch-independent code
9 * [_stext, _etext]: contains .text.* sections, may also contain .rodata.*
10 * and/or .init.* sections
11 * [_sdata, _edata]: contains .data.* sections, may also contain .rodata.*
12 * and/or .init.* sections.
13 * [__start_rodata, __end_rodata]: contains .rodata.* sections
14 * [__init_begin, __init_end]: contains .init.* sections, but .init.text.*
15 * may be out of this range on some architectures.
16 * [_sinittext, _einittext]: contains .init.text.* sections
17 * [__bss_start, __bss_stop]: contains BSS sections
18 *
19 * Following global variables are optional and may be unavailable on some
20 * architectures and/or kernel configurations.
21 * _text, _data
22 * __kprobes_text_start, __kprobes_text_end
23 * __entry_text_start, __entry_text_end
24 * __ctors_start, __ctors_end
25 */
6extern char _text[], _stext[], _etext[]; 26extern char _text[], _stext[], _etext[];
7extern char _data[], _sdata[], _edata[]; 27extern char _data[], _sdata[], _edata[];
8extern char __bss_start[], __bss_stop[]; 28extern char __bss_start[], __bss_stop[];
@@ -12,7 +32,6 @@ extern char _end[];
12extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; 32extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
13extern char __kprobes_text_start[], __kprobes_text_end[]; 33extern char __kprobes_text_start[], __kprobes_text_end[];
14extern char __entry_text_start[], __entry_text_end[]; 34extern char __entry_text_start[], __entry_text_end[];
15extern char __initdata_begin[], __initdata_end[];
16extern char __start_rodata[], __end_rodata[]; 35extern char __start_rodata[], __end_rodata[];
17 36
18/* Start and end of .ctors section - used for constructor calls. */ 37/* Start and end of .ctors section - used for constructor calls. */
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 4f2737208c42..69732d279e8b 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -174,8 +174,6 @@
174 *(.data) \ 174 *(.data) \
175 *(.ref.data) \ 175 *(.ref.data) \
176 *(.data..shared_aligned) /* percpu related */ \ 176 *(.data..shared_aligned) /* percpu related */ \
177 CPU_KEEP(init.data) \
178 CPU_KEEP(exit.data) \
179 MEM_KEEP(init.data) \ 177 MEM_KEEP(init.data) \
180 MEM_KEEP(exit.data) \ 178 MEM_KEEP(exit.data) \
181 *(.data.unlikely) \ 179 *(.data.unlikely) \
@@ -275,13 +273,6 @@
275 VMLINUX_SYMBOL(__end_builtin_fw) = .; \ 273 VMLINUX_SYMBOL(__end_builtin_fw) = .; \
276 } \ 274 } \
277 \ 275 \
278 /* RapidIO route ops */ \
279 .rio_ops : AT(ADDR(.rio_ops) - LOAD_OFFSET) { \
280 VMLINUX_SYMBOL(__start_rio_switch_ops) = .; \
281 *(.rio_switch_ops) \
282 VMLINUX_SYMBOL(__end_rio_switch_ops) = .; \
283 } \
284 \
285 TRACEDATA \ 276 TRACEDATA \
286 \ 277 \
287 /* Kernel symbol table: Normal symbols */ \ 278 /* Kernel symbol table: Normal symbols */ \
@@ -362,8 +353,6 @@
362 /* __*init sections */ \ 353 /* __*init sections */ \
363 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ 354 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \
364 *(.ref.rodata) \ 355 *(.ref.rodata) \
365 CPU_KEEP(init.rodata) \
366 CPU_KEEP(exit.rodata) \
367 MEM_KEEP(init.rodata) \ 356 MEM_KEEP(init.rodata) \
368 MEM_KEEP(exit.rodata) \ 357 MEM_KEEP(exit.rodata) \
369 } \ 358 } \
@@ -404,8 +393,6 @@
404 *(.text.hot) \ 393 *(.text.hot) \
405 *(.text) \ 394 *(.text) \
406 *(.ref.text) \ 395 *(.ref.text) \
407 CPU_KEEP(init.text) \
408 CPU_KEEP(exit.text) \
409 MEM_KEEP(init.text) \ 396 MEM_KEEP(init.text) \
410 MEM_KEEP(exit.text) \ 397 MEM_KEEP(exit.text) \
411 *(.text.unlikely) 398 *(.text.unlikely)
@@ -489,14 +476,12 @@
489/* init and exit section handling */ 476/* init and exit section handling */
490#define INIT_DATA \ 477#define INIT_DATA \
491 *(.init.data) \ 478 *(.init.data) \
492 CPU_DISCARD(init.data) \
493 MEM_DISCARD(init.data) \ 479 MEM_DISCARD(init.data) \
494 KERNEL_CTORS() \ 480 KERNEL_CTORS() \
495 MCOUNT_REC() \ 481 MCOUNT_REC() \
496 *(.init.rodata) \ 482 *(.init.rodata) \
497 FTRACE_EVENTS() \ 483 FTRACE_EVENTS() \
498 TRACE_SYSCALLS() \ 484 TRACE_SYSCALLS() \
499 CPU_DISCARD(init.rodata) \
500 MEM_DISCARD(init.rodata) \ 485 MEM_DISCARD(init.rodata) \
501 CLK_OF_TABLES() \ 486 CLK_OF_TABLES() \
502 CLKSRC_OF_TABLES() \ 487 CLKSRC_OF_TABLES() \
@@ -505,19 +490,15 @@
505 490
506#define INIT_TEXT \ 491#define INIT_TEXT \
507 *(.init.text) \ 492 *(.init.text) \
508 CPU_DISCARD(init.text) \
509 MEM_DISCARD(init.text) 493 MEM_DISCARD(init.text)
510 494
511#define EXIT_DATA \ 495#define EXIT_DATA \
512 *(.exit.data) \ 496 *(.exit.data) \
513 CPU_DISCARD(exit.data) \
514 CPU_DISCARD(exit.rodata) \
515 MEM_DISCARD(exit.data) \ 497 MEM_DISCARD(exit.data) \
516 MEM_DISCARD(exit.rodata) 498 MEM_DISCARD(exit.rodata)
517 499
518#define EXIT_TEXT \ 500#define EXIT_TEXT \
519 *(.exit.text) \ 501 *(.exit.text) \
520 CPU_DISCARD(exit.text) \
521 MEM_DISCARD(exit.text) 502 MEM_DISCARD(exit.text)
522 503
523#define EXIT_CALL \ 504#define EXIT_CALL \
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h
index e6c9c4cc9b23..c463ce990c48 100644
--- a/include/clocksource/arm_arch_timer.h
+++ b/include/clocksource/arm_arch_timer.h
@@ -32,7 +32,7 @@
32#ifdef CONFIG_ARM_ARCH_TIMER 32#ifdef CONFIG_ARM_ARCH_TIMER
33 33
34extern u32 arch_timer_get_rate(void); 34extern u32 arch_timer_get_rate(void);
35extern u64 (*arch_timer_read_counter)(void); 35extern u64 arch_timer_read_counter(void);
36extern struct timecounter *arch_timer_get_timecounter(void); 36extern struct timecounter *arch_timer_get_timecounter(void);
37 37
38#else 38#else
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 63d17ee9eb48..12083dc862a9 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -55,16 +55,13 @@
55#include <linux/mm.h> 55#include <linux/mm.h>
56#include <linux/cdev.h> 56#include <linux/cdev.h>
57#include <linux/mutex.h> 57#include <linux/mutex.h>
58#include <linux/io.h>
58#include <linux/slab.h> 59#include <linux/slab.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
62#include <asm/io.h>
63#include <asm/mman.h> 63#include <asm/mman.h>
64#include <asm/uaccess.h> 64#include <asm/uaccess.h>
65#ifdef CONFIG_MTRR
66#include <asm/mtrr.h>
67#endif
68#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE) 65#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
69#include <linux/types.h> 66#include <linux/types.h>
70#include <linux/agp_backend.h> 67#include <linux/agp_backend.h>
@@ -933,12 +930,15 @@ struct drm_driver {
933 struct dma_buf *dma_buf); 930 struct dma_buf *dma_buf);
934 /* low-level interface used by drm_gem_prime_{import,export} */ 931 /* low-level interface used by drm_gem_prime_{import,export} */
935 int (*gem_prime_pin)(struct drm_gem_object *obj); 932 int (*gem_prime_pin)(struct drm_gem_object *obj);
933 void (*gem_prime_unpin)(struct drm_gem_object *obj);
936 struct sg_table *(*gem_prime_get_sg_table)(struct drm_gem_object *obj); 934 struct sg_table *(*gem_prime_get_sg_table)(struct drm_gem_object *obj);
937 struct drm_gem_object *(*gem_prime_import_sg_table)( 935 struct drm_gem_object *(*gem_prime_import_sg_table)(
938 struct drm_device *dev, size_t size, 936 struct drm_device *dev, size_t size,
939 struct sg_table *sgt); 937 struct sg_table *sgt);
940 void *(*gem_prime_vmap)(struct drm_gem_object *obj); 938 void *(*gem_prime_vmap)(struct drm_gem_object *obj);
941 void (*gem_prime_vunmap)(struct drm_gem_object *obj, void *vaddr); 939 void (*gem_prime_vunmap)(struct drm_gem_object *obj, void *vaddr);
940 int (*gem_prime_mmap)(struct drm_gem_object *obj,
941 struct vm_area_struct *vma);
942 942
943 /* vga arb irq handler */ 943 /* vga arb irq handler */
944 void (*vgaarb_irq)(struct drm_device *dev, bool state); 944 void (*vgaarb_irq)(struct drm_device *dev, bool state);
@@ -1250,37 +1250,8 @@ static inline int drm_core_has_MTRR(struct drm_device *dev)
1250{ 1250{
1251 return drm_core_check_feature(dev, DRIVER_USE_MTRR); 1251 return drm_core_check_feature(dev, DRIVER_USE_MTRR);
1252} 1252}
1253
1254#define DRM_MTRR_WC MTRR_TYPE_WRCOMB
1255
1256static inline int drm_mtrr_add(unsigned long offset, unsigned long size,
1257 unsigned int flags)
1258{
1259 return mtrr_add(offset, size, flags, 1);
1260}
1261
1262static inline int drm_mtrr_del(int handle, unsigned long offset,
1263 unsigned long size, unsigned int flags)
1264{
1265 return mtrr_del(handle, offset, size);
1266}
1267
1268#else 1253#else
1269#define drm_core_has_MTRR(dev) (0) 1254#define drm_core_has_MTRR(dev) (0)
1270
1271#define DRM_MTRR_WC 0
1272
1273static inline int drm_mtrr_add(unsigned long offset, unsigned long size,
1274 unsigned int flags)
1275{
1276 return 0;
1277}
1278
1279static inline int drm_mtrr_del(int handle, unsigned long offset,
1280 unsigned long size, unsigned int flags)
1281{
1282 return 0;
1283}
1284#endif 1255#endif
1285 1256
1286static inline void drm_device_set_unplugged(struct drm_device *dev) 1257static inline void drm_device_set_unplugged(struct drm_device *dev)
@@ -1630,7 +1601,6 @@ extern void drm_sysfs_destroy(void);
1630extern int drm_sysfs_device_add(struct drm_minor *minor); 1601extern int drm_sysfs_device_add(struct drm_minor *minor);
1631extern void drm_sysfs_hotplug_event(struct drm_device *dev); 1602extern void drm_sysfs_hotplug_event(struct drm_device *dev);
1632extern void drm_sysfs_device_remove(struct drm_minor *minor); 1603extern void drm_sysfs_device_remove(struct drm_minor *minor);
1633extern char *drm_get_connector_status_name(enum drm_connector_status status);
1634extern int drm_sysfs_connector_add(struct drm_connector *connector); 1604extern int drm_sysfs_connector_add(struct drm_connector *connector);
1635extern void drm_sysfs_connector_remove(struct drm_connector *connector); 1605extern void drm_sysfs_connector_remove(struct drm_connector *connector);
1636 1606
@@ -1648,6 +1618,8 @@ int drm_gem_private_object_init(struct drm_device *dev,
1648void drm_gem_object_handle_free(struct drm_gem_object *obj); 1618void drm_gem_object_handle_free(struct drm_gem_object *obj);
1649void drm_gem_vm_open(struct vm_area_struct *vma); 1619void drm_gem_vm_open(struct vm_area_struct *vma);
1650void drm_gem_vm_close(struct vm_area_struct *vma); 1620void drm_gem_vm_close(struct vm_area_struct *vma);
1621int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size,
1622 struct vm_area_struct *vma);
1651int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma); 1623int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
1652 1624
1653#include <drm/drm_global.h> 1625#include <drm/drm_global.h>
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index adb3f9b625f6..fa12a2fa4293 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -339,6 +339,9 @@ struct drm_crtc_funcs {
339 /* cursor controls */ 339 /* cursor controls */
340 int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv, 340 int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv,
341 uint32_t handle, uint32_t width, uint32_t height); 341 uint32_t handle, uint32_t width, uint32_t height);
342 int (*cursor_set2)(struct drm_crtc *crtc, struct drm_file *file_priv,
343 uint32_t handle, uint32_t width, uint32_t height,
344 int32_t hot_x, int32_t hot_y);
342 int (*cursor_move)(struct drm_crtc *crtc, int x, int y); 345 int (*cursor_move)(struct drm_crtc *crtc, int x, int y);
343 346
344 /* Set gamma on the CRTC */ 347 /* Set gamma on the CRTC */
@@ -409,6 +412,10 @@ struct drm_crtc {
409 /* framebuffer the connector is currently bound to */ 412 /* framebuffer the connector is currently bound to */
410 struct drm_framebuffer *fb; 413 struct drm_framebuffer *fb;
411 414
415 /* Temporary tracking of the old fb while a modeset is ongoing. Used
416 * by drm_mode_set_config_internal to implement correct refcounting. */
417 struct drm_framebuffer *old_fb;
418
412 bool enabled; 419 bool enabled;
413 420
414 /* Requested mode from modesetting. */ 421 /* Requested mode from modesetting. */
@@ -654,11 +661,7 @@ struct drm_plane_funcs {
654 * @format_count: number of formats supported 661 * @format_count: number of formats supported
655 * @crtc: currently bound CRTC 662 * @crtc: currently bound CRTC
656 * @fb: currently bound fb 663 * @fb: currently bound fb
657 * @gamma_size: size of gamma table
658 * @gamma_store: gamma correction table
659 * @enabled: enabled flag
660 * @funcs: helper functions 664 * @funcs: helper functions
661 * @helper_private: storage for drver layer
662 * @properties: property tracking for this plane 665 * @properties: property tracking for this plane
663 */ 666 */
664struct drm_plane { 667struct drm_plane {
@@ -674,14 +677,7 @@ struct drm_plane {
674 struct drm_crtc *crtc; 677 struct drm_crtc *crtc;
675 struct drm_framebuffer *fb; 678 struct drm_framebuffer *fb;
676 679
677 /* CRTC gamma size for reporting to userspace */
678 uint32_t gamma_size;
679 uint16_t *gamma_store;
680
681 bool enabled;
682
683 const struct drm_plane_funcs *funcs; 680 const struct drm_plane_funcs *funcs;
684 void *helper_private;
685 681
686 struct drm_object_properties properties; 682 struct drm_object_properties properties;
687}; 683};
@@ -894,15 +890,17 @@ extern int drm_plane_init(struct drm_device *dev,
894 const uint32_t *formats, uint32_t format_count, 890 const uint32_t *formats, uint32_t format_count,
895 bool priv); 891 bool priv);
896extern void drm_plane_cleanup(struct drm_plane *plane); 892extern void drm_plane_cleanup(struct drm_plane *plane);
893extern void drm_plane_force_disable(struct drm_plane *plane);
897 894
898extern void drm_encoder_cleanup(struct drm_encoder *encoder); 895extern void drm_encoder_cleanup(struct drm_encoder *encoder);
899 896
900extern char *drm_get_connector_name(struct drm_connector *connector); 897extern const char *drm_get_connector_name(const struct drm_connector *connector);
901extern char *drm_get_dpms_name(int val); 898extern const char *drm_get_connector_status_name(enum drm_connector_status status);
902extern char *drm_get_dvi_i_subconnector_name(int val); 899extern const char *drm_get_dpms_name(int val);
903extern char *drm_get_dvi_i_select_name(int val); 900extern const char *drm_get_dvi_i_subconnector_name(int val);
904extern char *drm_get_tv_subconnector_name(int val); 901extern const char *drm_get_dvi_i_select_name(int val);
905extern char *drm_get_tv_select_name(int val); 902extern const char *drm_get_tv_subconnector_name(int val);
903extern const char *drm_get_tv_select_name(int val);
906extern void drm_fb_release(struct drm_file *file_priv); 904extern void drm_fb_release(struct drm_file *file_priv);
907extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group); 905extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group);
908extern bool drm_probe_ddc(struct i2c_adapter *adapter); 906extern bool drm_probe_ddc(struct i2c_adapter *adapter);
@@ -994,7 +992,7 @@ extern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats
994extern int drm_mode_create_scaling_mode_property(struct drm_device *dev); 992extern int drm_mode_create_scaling_mode_property(struct drm_device *dev);
995extern int drm_mode_create_dithering_property(struct drm_device *dev); 993extern int drm_mode_create_dithering_property(struct drm_device *dev);
996extern int drm_mode_create_dirty_info_property(struct drm_device *dev); 994extern int drm_mode_create_dirty_info_property(struct drm_device *dev);
997extern char *drm_get_encoder_name(struct drm_encoder *encoder); 995extern const char *drm_get_encoder_name(const struct drm_encoder *encoder);
998 996
999extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, 997extern int drm_mode_connector_attach_encoder(struct drm_connector *connector,
1000 struct drm_encoder *encoder); 998 struct drm_encoder *encoder);
@@ -1022,6 +1020,8 @@ extern int drm_mode_setplane(struct drm_device *dev,
1022 void *data, struct drm_file *file_priv); 1020 void *data, struct drm_file *file_priv);
1023extern int drm_mode_cursor_ioctl(struct drm_device *dev, 1021extern int drm_mode_cursor_ioctl(struct drm_device *dev,
1024 void *data, struct drm_file *file_priv); 1022 void *data, struct drm_file *file_priv);
1023extern int drm_mode_cursor2_ioctl(struct drm_device *dev,
1024 void *data, struct drm_file *file_priv);
1025extern int drm_mode_addfb(struct drm_device *dev, 1025extern int drm_mode_addfb(struct drm_device *dev,
1026 void *data, struct drm_file *file_priv); 1026 void *data, struct drm_file *file_priv);
1027extern int drm_mode_addfb2(struct drm_device *dev, 1027extern int drm_mode_addfb2(struct drm_device *dev,
@@ -1094,5 +1094,6 @@ extern int drm_format_num_planes(uint32_t format);
1094extern int drm_format_plane_cpp(uint32_t format, int plane); 1094extern int drm_format_plane_cpp(uint32_t format, int plane);
1095extern int drm_format_horz_chroma_subsampling(uint32_t format); 1095extern int drm_format_horz_chroma_subsampling(uint32_t format);
1096extern int drm_format_vert_chroma_subsampling(uint32_t format); 1096extern int drm_format_vert_chroma_subsampling(uint32_t format);
1097extern const char *drm_get_format_name(uint32_t format);
1097 1098
1098#endif /* __DRM_CRTC_H__ */ 1099#endif /* __DRM_CRTC_H__ */
diff --git a/include/drm/drm_fixed.h b/include/drm/drm_fixed.h
index 0ead502e17d2..f5e1168c7647 100644
--- a/include/drm/drm_fixed.h
+++ b/include/drm/drm_fixed.h
@@ -20,10 +20,13 @@
20 * OTHER DEALINGS IN THE SOFTWARE. 20 * OTHER DEALINGS IN THE SOFTWARE.
21 * 21 *
22 * Authors: Dave Airlie 22 * Authors: Dave Airlie
23 * Christian König
23 */ 24 */
24#ifndef DRM_FIXED_H 25#ifndef DRM_FIXED_H
25#define DRM_FIXED_H 26#define DRM_FIXED_H
26 27
28#include <linux/math64.h>
29
27typedef union dfixed { 30typedef union dfixed {
28 u32 full; 31 u32 full;
29} fixed20_12; 32} fixed20_12;
@@ -65,4 +68,95 @@ static inline u32 dfixed_div(fixed20_12 A, fixed20_12 B)
65 tmp /= 2; 68 tmp /= 2;
66 return lower_32_bits(tmp); 69 return lower_32_bits(tmp);
67} 70}
71
72#define DRM_FIXED_POINT 32
73#define DRM_FIXED_ONE (1ULL << DRM_FIXED_POINT)
74#define DRM_FIXED_DECIMAL_MASK (DRM_FIXED_ONE - 1)
75#define DRM_FIXED_DIGITS_MASK (~DRM_FIXED_DECIMAL_MASK)
76
77static inline s64 drm_int2fixp(int a)
78{
79 return ((s64)a) << DRM_FIXED_POINT;
80}
81
82static inline int drm_fixp2int(int64_t a)
83{
84 return ((s64)a) >> DRM_FIXED_POINT;
85}
86
87static inline s64 drm_fixp_msbset(int64_t a)
88{
89 unsigned shift, sign = (a >> 63) & 1;
90
91 for (shift = 62; shift > 0; --shift)
92 if ((a >> shift) != sign)
93 return shift;
94
95 return 0;
96}
97
98static inline s64 drm_fixp_mul(s64 a, s64 b)
99{
100 unsigned shift = drm_fixp_msbset(a) + drm_fixp_msbset(b);
101 s64 result;
102
103 if (shift > 63) {
104 shift = shift - 63;
105 a >>= shift >> 1;
106 b >>= shift >> 1;
107 } else
108 shift = 0;
109
110 result = a * b;
111
112 if (shift > DRM_FIXED_POINT)
113 return result << (shift - DRM_FIXED_POINT);
114
115 if (shift < DRM_FIXED_POINT)
116 return result >> (DRM_FIXED_POINT - shift);
117
118 return result;
119}
120
121static inline s64 drm_fixp_div(s64 a, s64 b)
122{
123 unsigned shift = 63 - drm_fixp_msbset(a);
124 s64 result;
125
126 a <<= shift;
127
128 if (shift < DRM_FIXED_POINT)
129 b >>= (DRM_FIXED_POINT - shift);
130
131 result = div64_s64(a, b);
132
133 if (shift > DRM_FIXED_POINT)
134 return result >> (shift - DRM_FIXED_POINT);
135
136 return result;
137}
138
139static inline s64 drm_fixp_exp(s64 x)
140{
141 s64 tolerance = div64_s64(DRM_FIXED_ONE, 1000000);
142 s64 sum = DRM_FIXED_ONE, term, y = x;
143 u64 count = 1;
144
145 if (x < 0)
146 y = -1 * x;
147
148 term = y;
149
150 while (term >= tolerance) {
151 sum = sum + term;
152 count = count + 1;
153 term = drm_fixp_mul(term, div64_s64(y, count));
154 }
155
156 if (x < 0)
157 sum = drm_fixp_div(1, sum);
158
159 return sum;
160}
161
68#endif 162#endif
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h
index 63397ced9254..c34f27f80bcc 100644
--- a/include/drm/drm_gem_cma_helper.h
+++ b/include/drm/drm_gem_cma_helper.h
@@ -4,6 +4,9 @@
4struct drm_gem_cma_object { 4struct drm_gem_cma_object {
5 struct drm_gem_object base; 5 struct drm_gem_object base;
6 dma_addr_t paddr; 6 dma_addr_t paddr;
7 struct sg_table *sgt;
8
9 /* For objects with DMA memory allocated by GEM CMA */
7 void *vaddr; 10 void *vaddr;
8}; 11};
9 12
@@ -45,4 +48,13 @@ extern const struct vm_operations_struct drm_gem_cma_vm_ops;
45void drm_gem_cma_describe(struct drm_gem_cma_object *obj, struct seq_file *m); 48void drm_gem_cma_describe(struct drm_gem_cma_object *obj, struct seq_file *m);
46#endif 49#endif
47 50
51struct sg_table *drm_gem_cma_prime_get_sg_table(struct drm_gem_object *obj);
52struct drm_gem_object *
53drm_gem_cma_prime_import_sg_table(struct drm_device *dev, size_t size,
54 struct sg_table *sgt);
55int drm_gem_cma_prime_mmap(struct drm_gem_object *obj,
56 struct vm_area_struct *vma);
57void *drm_gem_cma_prime_vmap(struct drm_gem_object *obj);
58void drm_gem_cma_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
59
48#endif /* __DRM_GEM_CMA_HELPER_H__ */ 60#endif /* __DRM_GEM_CMA_HELPER_H__ */
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index 88591ef8fa24..4d06edb56d5f 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -177,17 +177,6 @@ static inline struct drm_mm_node *drm_mm_get_block_range(
177 return drm_mm_get_block_range_generic(parent, size, alignment, 0, 177 return drm_mm_get_block_range_generic(parent, size, alignment, 0,
178 start, end, 0); 178 start, end, 0);
179} 179}
180static inline struct drm_mm_node *drm_mm_get_color_block_range(
181 struct drm_mm_node *parent,
182 unsigned long size,
183 unsigned alignment,
184 unsigned long color,
185 unsigned long start,
186 unsigned long end)
187{
188 return drm_mm_get_block_range_generic(parent, size, alignment, color,
189 start, end, 0);
190}
191static inline struct drm_mm_node *drm_mm_get_block_atomic_range( 180static inline struct drm_mm_node *drm_mm_get_block_atomic_range(
192 struct drm_mm_node *parent, 181 struct drm_mm_node *parent,
193 unsigned long size, 182 unsigned long size,
@@ -255,29 +244,10 @@ static inline struct drm_mm_node *drm_mm_search_free_in_range(
255 return drm_mm_search_free_in_range_generic(mm, size, alignment, 0, 244 return drm_mm_search_free_in_range_generic(mm, size, alignment, 0,
256 start, end, best_match); 245 start, end, best_match);
257} 246}
258static inline struct drm_mm_node *drm_mm_search_free_color(const struct drm_mm *mm, 247
259 unsigned long size, 248extern void drm_mm_init(struct drm_mm *mm,
260 unsigned alignment, 249 unsigned long start,
261 unsigned long color, 250 unsigned long size);
262 bool best_match)
263{
264 return drm_mm_search_free_generic(mm,size, alignment, color, best_match);
265}
266static inline struct drm_mm_node *drm_mm_search_free_in_range_color(
267 const struct drm_mm *mm,
268 unsigned long size,
269 unsigned alignment,
270 unsigned long color,
271 unsigned long start,
272 unsigned long end,
273 bool best_match)
274{
275 return drm_mm_search_free_in_range_generic(mm, size, alignment, color,
276 start, end, best_match);
277}
278extern int drm_mm_init(struct drm_mm *mm,
279 unsigned long start,
280 unsigned long size);
281extern void drm_mm_takedown(struct drm_mm *mm); 251extern void drm_mm_takedown(struct drm_mm *mm);
282extern int drm_mm_clean(struct drm_mm *mm); 252extern int drm_mm_clean(struct drm_mm *mm);
283extern int drm_mm_pre_get(struct drm_mm *mm); 253extern int drm_mm_pre_get(struct drm_mm *mm);
diff --git a/include/drm/drm_os_linux.h b/include/drm/drm_os_linux.h
index 675ddf4b441f..815fafc6b4ad 100644
--- a/include/drm/drm_os_linux.h
+++ b/include/drm/drm_os_linux.h
@@ -65,22 +65,6 @@ struct no_agp_kern {
65#define DRM_AGP_KERN struct no_agp_kern 65#define DRM_AGP_KERN struct no_agp_kern
66#endif 66#endif
67 67
68#if !(__OS_HAS_MTRR)
69static __inline__ int mtrr_add(unsigned long base, unsigned long size,
70 unsigned int type, char increment)
71{
72 return -ENODEV;
73}
74
75static __inline__ int mtrr_del(int reg, unsigned long base, unsigned long size)
76{
77 return -ENODEV;
78}
79
80#define MTRR_TYPE_WRCOMB 1
81
82#endif
83
84/** Other copying of data to kernel space */ 68/** Other copying of data to kernel space */
85#define DRM_COPY_FROM_USER(arg1, arg2, arg3) \ 69#define DRM_COPY_FROM_USER(arg1, arg2, arg3) \
86 copy_from_user(arg1, arg2, arg3) 70 copy_from_user(arg1, arg2, arg3)
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index bb1bc485390b..34efaf64cc87 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -152,6 +152,14 @@
152 {0x1002, 0x6621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 152 {0x1002, 0x6621, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
153 {0x1002, 0x6623, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 153 {0x1002, 0x6623, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
154 {0x1002, 0x6631, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \ 154 {0x1002, 0x6631, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_OLAND|RADEON_NEW_MEMMAP}, \
155 {0x1002, 0x6640, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
156 {0x1002, 0x6641, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
157 {0x1002, 0x6649, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
158 {0x1002, 0x6650, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
159 {0x1002, 0x6651, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
160 {0x1002, 0x6658, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
161 {0x1002, 0x665c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
162 {0x1002, 0x665d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_BONAIRE|RADEON_NEW_MEMMAP}, \
155 {0x1002, 0x6660, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 163 {0x1002, 0x6660, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
156 {0x1002, 0x6663, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 164 {0x1002, 0x6663, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
157 {0x1002, 0x6664, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 165 {0x1002, 0x6664, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_HAINAN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
@@ -580,6 +588,22 @@
580 {0x1002, 0x9808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 588 {0x1002, 0x9808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
581 {0x1002, 0x9809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 589 {0x1002, 0x9809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
582 {0x1002, 0x980A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 590 {0x1002, 0x980A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PALM|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
591 {0x1002, 0x9830, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
592 {0x1002, 0x9831, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
593 {0x1002, 0x9832, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
594 {0x1002, 0x9833, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
595 {0x1002, 0x9834, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
596 {0x1002, 0x9835, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
597 {0x1002, 0x9836, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
598 {0x1002, 0x9837, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
599 {0x1002, 0x9838, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
600 {0x1002, 0x9839, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
601 {0x1002, 0x983a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
602 {0x1002, 0x983b, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
603 {0x1002, 0x983c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
604 {0x1002, 0x983d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
605 {0x1002, 0x983e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
606 {0x1002, 0x983f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KABINI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
583 {0x1002, 0x9900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 607 {0x1002, 0x9900, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
584 {0x1002, 0x9901, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 608 {0x1002, 0x9901, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
585 {0x1002, 0x9903, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 609 {0x1002, 0x9903, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_ARUBA|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
new file mode 100644
index 000000000000..d1286297567b
--- /dev/null
+++ b/include/drm/drm_rect.h
@@ -0,0 +1,167 @@
1/*
2 * Copyright (C) 2011-2013 Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 */
23
24#ifndef DRM_RECT_H
25#define DRM_RECT_H
26
27/**
28 * DOC: rect utils
29 *
30 * Utility functions to help manage rectangular areas for
31 * clipping, scaling, etc. calculations.
32 */
33
34/**
35 * struct drm_rect - two dimensional rectangle
36 * @x1: horizontal starting coordinate (inclusive)
37 * @x2: horizontal ending coordinate (exclusive)
38 * @y1: vertical starting coordinate (inclusive)
39 * @y2: vertical ending coordinate (exclusive)
40 */
41struct drm_rect {
42 int x1, y1, x2, y2;
43};
44
45/**
46 * drm_rect_adjust_size - adjust the size of the rectangle
47 * @r: rectangle to be adjusted
48 * @dw: horizontal adjustment
49 * @dh: vertical adjustment
50 *
51 * Change the size of rectangle @r by @dw in the horizontal direction,
52 * and by @dh in the vertical direction, while keeping the center
53 * of @r stationary.
54 *
55 * Positive @dw and @dh increase the size, negative values decrease it.
56 */
57static inline void drm_rect_adjust_size(struct drm_rect *r, int dw, int dh)
58{
59 r->x1 -= dw >> 1;
60 r->y1 -= dh >> 1;
61 r->x2 += (dw + 1) >> 1;
62 r->y2 += (dh + 1) >> 1;
63}
64
65/**
66 * drm_rect_translate - translate the rectangle
67 * @r: rectangle to be tranlated
68 * @dx: horizontal translation
69 * @dy: vertical translation
70 *
71 * Move rectangle @r by @dx in the horizontal direction,
72 * and by @dy in the vertical direction.
73 */
74static inline void drm_rect_translate(struct drm_rect *r, int dx, int dy)
75{
76 r->x1 += dx;
77 r->y1 += dy;
78 r->x2 += dx;
79 r->y2 += dy;
80}
81
82/**
83 * drm_rect_downscale - downscale a rectangle
84 * @r: rectangle to be downscaled
85 * @horz: horizontal downscale factor
86 * @vert: vertical downscale factor
87 *
88 * Divide the coordinates of rectangle @r by @horz and @vert.
89 */
90static inline void drm_rect_downscale(struct drm_rect *r, int horz, int vert)
91{
92 r->x1 /= horz;
93 r->y1 /= vert;
94 r->x2 /= horz;
95 r->y2 /= vert;
96}
97
98/**
99 * drm_rect_width - determine the rectangle width
100 * @r: rectangle whose width is returned
101 *
102 * RETURNS:
103 * The width of the rectangle.
104 */
105static inline int drm_rect_width(const struct drm_rect *r)
106{
107 return r->x2 - r->x1;
108}
109
110/**
111 * drm_rect_height - determine the rectangle height
112 * @r: rectangle whose height is returned
113 *
114 * RETURNS:
115 * The height of the rectangle.
116 */
117static inline int drm_rect_height(const struct drm_rect *r)
118{
119 return r->y2 - r->y1;
120}
121
122/**
123 * drm_rect_visible - determine if the the rectangle is visible
124 * @r: rectangle whose visibility is returned
125 *
126 * RETURNS:
127 * %true if the rectangle is visible, %false otherwise.
128 */
129static inline bool drm_rect_visible(const struct drm_rect *r)
130{
131 return drm_rect_width(r) > 0 && drm_rect_height(r) > 0;
132}
133
134/**
135 * drm_rect_equals - determine if two rectangles are equal
136 * @r1: first rectangle
137 * @r2: second rectangle
138 *
139 * RETURNS:
140 * %true if the rectangles are equal, %false otherwise.
141 */
142static inline bool drm_rect_equals(const struct drm_rect *r1,
143 const struct drm_rect *r2)
144{
145 return r1->x1 == r2->x1 && r1->x2 == r2->x2 &&
146 r1->y1 == r2->y1 && r1->y2 == r2->y2;
147}
148
149bool drm_rect_intersect(struct drm_rect *r, const struct drm_rect *clip);
150bool drm_rect_clip_scaled(struct drm_rect *src, struct drm_rect *dst,
151 const struct drm_rect *clip,
152 int hscale, int vscale);
153int drm_rect_calc_hscale(const struct drm_rect *src,
154 const struct drm_rect *dst,
155 int min_hscale, int max_hscale);
156int drm_rect_calc_vscale(const struct drm_rect *src,
157 const struct drm_rect *dst,
158 int min_vscale, int max_vscale);
159int drm_rect_calc_hscale_relaxed(struct drm_rect *src,
160 struct drm_rect *dst,
161 int min_hscale, int max_hscale);
162int drm_rect_calc_vscale_relaxed(struct drm_rect *src,
163 struct drm_rect *dst,
164 int min_vscale, int max_vscale);
165void drm_rect_debug_print(const struct drm_rect *r, bool fixed_point);
166
167#endif
diff --git a/include/drm/i915_powerwell.h b/include/drm/i915_powerwell.h
new file mode 100644
index 000000000000..cfdc884405b7
--- /dev/null
+++ b/include/drm/i915_powerwell.h
@@ -0,0 +1,36 @@
1/**************************************************************************
2 *
3 * Copyright 2013 Intel Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24 * USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 *
27 **************************************************************************/
28
29#ifndef _I915_POWERWELL_H_
30#define _I915_POWERWELL_H_
31
32/* For use by hda_i915 driver */
33extern void i915_request_power_well(void);
34extern void i915_release_power_well(void);
35
36#endif /* _I915_POWERWELL_H_ */
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 3cb5d848fb66..8a6aa56ece52 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -39,6 +39,7 @@
39#include <linux/mm.h> 39#include <linux/mm.h>
40#include <linux/rbtree.h> 40#include <linux/rbtree.h>
41#include <linux/bitmap.h> 41#include <linux/bitmap.h>
42#include <linux/reservation.h>
42 43
43struct ttm_bo_device; 44struct ttm_bo_device;
44 45
@@ -153,7 +154,6 @@ struct ttm_tt;
153 * Lru lists may keep one refcount, the delayed delete list, and kref != 0 154 * Lru lists may keep one refcount, the delayed delete list, and kref != 0
154 * keeps one refcount. When this refcount reaches zero, 155 * keeps one refcount. When this refcount reaches zero,
155 * the object is destroyed. 156 * the object is destroyed.
156 * @event_queue: Queue for processes waiting on buffer object status change.
157 * @mem: structure describing current placement. 157 * @mem: structure describing current placement.
158 * @persistent_swap_storage: Usually the swap storage is deleted for buffers 158 * @persistent_swap_storage: Usually the swap storage is deleted for buffers
159 * pinned in physical memory. If this behaviour is not desired, this member 159 * pinned in physical memory. If this behaviour is not desired, this member
@@ -164,12 +164,6 @@ struct ttm_tt;
164 * @lru: List head for the lru list. 164 * @lru: List head for the lru list.
165 * @ddestroy: List head for the delayed destroy list. 165 * @ddestroy: List head for the delayed destroy list.
166 * @swap: List head for swap LRU list. 166 * @swap: List head for swap LRU list.
167 * @val_seq: Sequence of the validation holding the @reserved lock.
168 * Used to avoid starvation when many processes compete to validate the
169 * buffer. This member is protected by the bo_device::lru_lock.
170 * @seq_valid: The value of @val_seq is valid. This value is protected by
171 * the bo_device::lru_lock.
172 * @reserved: Deadlock-free lock used for synchronization state transitions.
173 * @sync_obj: Pointer to a synchronization object. 167 * @sync_obj: Pointer to a synchronization object.
174 * @priv_flags: Flags describing buffer object internal state. 168 * @priv_flags: Flags describing buffer object internal state.
175 * @vm_rb: Rb node for the vm rb tree. 169 * @vm_rb: Rb node for the vm rb tree.
@@ -209,10 +203,9 @@ struct ttm_buffer_object {
209 203
210 struct kref kref; 204 struct kref kref;
211 struct kref list_kref; 205 struct kref list_kref;
212 wait_queue_head_t event_queue;
213 206
214 /** 207 /**
215 * Members protected by the bo::reserved lock. 208 * Members protected by the bo::resv::reserved lock.
216 */ 209 */
217 210
218 struct ttm_mem_reg mem; 211 struct ttm_mem_reg mem;
@@ -234,15 +227,6 @@ struct ttm_buffer_object {
234 struct list_head ddestroy; 227 struct list_head ddestroy;
235 struct list_head swap; 228 struct list_head swap;
236 struct list_head io_reserve_lru; 229 struct list_head io_reserve_lru;
237 uint32_t val_seq;
238 bool seq_valid;
239
240 /**
241 * Members protected by the bdev::lru_lock
242 * only when written to.
243 */
244
245 atomic_t reserved;
246 230
247 /** 231 /**
248 * Members protected by struct buffer_object_device::fence_lock 232 * Members protected by struct buffer_object_device::fence_lock
@@ -272,6 +256,9 @@ struct ttm_buffer_object {
272 uint32_t cur_placement; 256 uint32_t cur_placement;
273 257
274 struct sg_table *sg; 258 struct sg_table *sg;
259
260 struct reservation_object *resv;
261 struct reservation_object ttm_resv;
275}; 262};
276 263
277/** 264/**
@@ -725,18 +712,4 @@ extern ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp,
725 712
726extern void ttm_bo_swapout_all(struct ttm_bo_device *bdev); 713extern void ttm_bo_swapout_all(struct ttm_bo_device *bdev);
727 714
728/**
729 * ttm_bo_is_reserved - return an indication if a ttm buffer object is reserved
730 *
731 * @bo: The buffer object to check.
732 *
733 * This function returns an indication if a bo is reserved or not, and should
734 * only be used to print an error when it is not from incorrect api usage, since
735 * there's no guarantee that it is the caller that is holding the reservation.
736 */
737static inline bool ttm_bo_is_reserved(struct ttm_buffer_object *bo)
738{
739 return atomic_read(&bo->reserved);
740}
741
742#endif 715#endif
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 9c8dca79808e..984fc2d571a1 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -33,11 +33,13 @@
33#include <ttm/ttm_bo_api.h> 33#include <ttm/ttm_bo_api.h>
34#include <ttm/ttm_memory.h> 34#include <ttm/ttm_memory.h>
35#include <ttm/ttm_module.h> 35#include <ttm/ttm_module.h>
36#include <ttm/ttm_placement.h>
36#include <drm/drm_mm.h> 37#include <drm/drm_mm.h>
37#include <drm/drm_global.h> 38#include <drm/drm_global.h>
38#include <linux/workqueue.h> 39#include <linux/workqueue.h>
39#include <linux/fs.h> 40#include <linux/fs.h>
40#include <linux/spinlock.h> 41#include <linux/spinlock.h>
42#include <linux/reservation.h>
41 43
42struct ttm_backend_func { 44struct ttm_backend_func {
43 /** 45 /**
@@ -771,6 +773,55 @@ extern int ttm_mem_io_lock(struct ttm_mem_type_manager *man,
771 bool interruptible); 773 bool interruptible);
772extern void ttm_mem_io_unlock(struct ttm_mem_type_manager *man); 774extern void ttm_mem_io_unlock(struct ttm_mem_type_manager *man);
773 775
776extern void ttm_bo_del_sub_from_lru(struct ttm_buffer_object *bo);
777extern void ttm_bo_add_to_lru(struct ttm_buffer_object *bo);
778
779/**
780 * ttm_bo_reserve_nolru:
781 *
782 * @bo: A pointer to a struct ttm_buffer_object.
783 * @interruptible: Sleep interruptible if waiting.
784 * @no_wait: Don't sleep while trying to reserve, rather return -EBUSY.
785 * @use_ticket: If @bo is already reserved, Only sleep waiting for
786 * it to become unreserved if @ticket->stamp is older.
787 *
788 * Will not remove reserved buffers from the lru lists.
789 * Otherwise identical to ttm_bo_reserve.
790 *
791 * Returns:
792 * -EDEADLK: The reservation may cause a deadlock.
793 * Release all buffer reservations, wait for @bo to become unreserved and
794 * try again. (only if use_sequence == 1).
795 * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by
796 * a signal. Release all buffer reservations and return to user-space.
797 * -EBUSY: The function needed to sleep, but @no_wait was true
798 * -EALREADY: Bo already reserved using @ticket. This error code will only
799 * be returned if @use_ticket is set to true.
800 */
801static inline int ttm_bo_reserve_nolru(struct ttm_buffer_object *bo,
802 bool interruptible,
803 bool no_wait, bool use_ticket,
804 struct ww_acquire_ctx *ticket)
805{
806 int ret = 0;
807
808 if (no_wait) {
809 bool success;
810 if (WARN_ON(ticket))
811 return -EBUSY;
812
813 success = ww_mutex_trylock(&bo->resv->lock);
814 return success ? 0 : -EBUSY;
815 }
816
817 if (interruptible)
818 ret = ww_mutex_lock_interruptible(&bo->resv->lock, ticket);
819 else
820 ret = ww_mutex_lock(&bo->resv->lock, ticket);
821 if (ret == -EINTR)
822 return -ERESTARTSYS;
823 return ret;
824}
774 825
775/** 826/**
776 * ttm_bo_reserve: 827 * ttm_bo_reserve:
@@ -778,8 +829,8 @@ extern void ttm_mem_io_unlock(struct ttm_mem_type_manager *man);
778 * @bo: A pointer to a struct ttm_buffer_object. 829 * @bo: A pointer to a struct ttm_buffer_object.
779 * @interruptible: Sleep interruptible if waiting. 830 * @interruptible: Sleep interruptible if waiting.
780 * @no_wait: Don't sleep while trying to reserve, rather return -EBUSY. 831 * @no_wait: Don't sleep while trying to reserve, rather return -EBUSY.
781 * @use_sequence: If @bo is already reserved, Only sleep waiting for 832 * @use_ticket: If @bo is already reserved, Only sleep waiting for
782 * it to become unreserved if @sequence < (@bo)->sequence. 833 * it to become unreserved if @ticket->stamp is older.
783 * 834 *
784 * Locks a buffer object for validation. (Or prevents other processes from 835 * Locks a buffer object for validation. (Or prevents other processes from
785 * locking it for validation) and removes it from lru lists, while taking 836 * locking it for validation) and removes it from lru lists, while taking
@@ -793,7 +844,7 @@ extern void ttm_mem_io_unlock(struct ttm_mem_type_manager *man);
793 * Processes attempting to reserve multiple buffers other than for eviction, 844 * Processes attempting to reserve multiple buffers other than for eviction,
794 * (typically execbuf), should first obtain a unique 32-bit 845 * (typically execbuf), should first obtain a unique 32-bit
795 * validation sequence number, 846 * validation sequence number,
796 * and call this function with @use_sequence == 1 and @sequence == the unique 847 * and call this function with @use_ticket == 1 and @ticket->stamp == the unique
797 * sequence number. If upon call of this function, the buffer object is already 848 * sequence number. If upon call of this function, the buffer object is already
798 * reserved, the validation sequence is checked against the validation 849 * reserved, the validation sequence is checked against the validation
799 * sequence of the process currently reserving the buffer, 850 * sequence of the process currently reserving the buffer,
@@ -808,36 +859,31 @@ extern void ttm_mem_io_unlock(struct ttm_mem_type_manager *man);
808 * will eventually succeed, preventing both deadlocks and starvation. 859 * will eventually succeed, preventing both deadlocks and starvation.
809 * 860 *
810 * Returns: 861 * Returns:
811 * -EAGAIN: The reservation may cause a deadlock. 862 * -EDEADLK: The reservation may cause a deadlock.
812 * Release all buffer reservations, wait for @bo to become unreserved and 863 * Release all buffer reservations, wait for @bo to become unreserved and
813 * try again. (only if use_sequence == 1). 864 * try again. (only if use_sequence == 1).
814 * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by 865 * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by
815 * a signal. Release all buffer reservations and return to user-space. 866 * a signal. Release all buffer reservations and return to user-space.
816 * -EBUSY: The function needed to sleep, but @no_wait was true 867 * -EBUSY: The function needed to sleep, but @no_wait was true
817 * -EDEADLK: Bo already reserved using @sequence. This error code will only 868 * -EALREADY: Bo already reserved using @ticket. This error code will only
818 * be returned if @use_sequence is set to true. 869 * be returned if @use_ticket is set to true.
819 */ 870 */
820extern int ttm_bo_reserve(struct ttm_buffer_object *bo, 871static inline int ttm_bo_reserve(struct ttm_buffer_object *bo,
821 bool interruptible, 872 bool interruptible,
822 bool no_wait, bool use_sequence, uint32_t sequence); 873 bool no_wait, bool use_ticket,
874 struct ww_acquire_ctx *ticket)
875{
876 int ret;
823 877
824/** 878 WARN_ON(!atomic_read(&bo->kref.refcount));
825 * ttm_bo_reserve_slowpath_nolru:
826 * @bo: A pointer to a struct ttm_buffer_object.
827 * @interruptible: Sleep interruptible if waiting.
828 * @sequence: Set (@bo)->sequence to this value after lock
829 *
830 * This is called after ttm_bo_reserve returns -EAGAIN and we backed off
831 * from all our other reservations. Because there are no other reservations
832 * held by us, this function cannot deadlock any more.
833 *
834 * Will not remove reserved buffers from the lru lists.
835 * Otherwise identical to ttm_bo_reserve_slowpath.
836 */
837extern int ttm_bo_reserve_slowpath_nolru(struct ttm_buffer_object *bo,
838 bool interruptible,
839 uint32_t sequence);
840 879
880 ret = ttm_bo_reserve_nolru(bo, interruptible, no_wait, use_ticket,
881 ticket);
882 if (likely(ret == 0))
883 ttm_bo_del_sub_from_lru(bo);
884
885 return ret;
886}
841 887
842/** 888/**
843 * ttm_bo_reserve_slowpath: 889 * ttm_bo_reserve_slowpath:
@@ -849,54 +895,57 @@ extern int ttm_bo_reserve_slowpath_nolru(struct ttm_buffer_object *bo,
849 * from all our other reservations. Because there are no other reservations 895 * from all our other reservations. Because there are no other reservations
850 * held by us, this function cannot deadlock any more. 896 * held by us, this function cannot deadlock any more.
851 */ 897 */
852extern int ttm_bo_reserve_slowpath(struct ttm_buffer_object *bo, 898static inline int ttm_bo_reserve_slowpath(struct ttm_buffer_object *bo,
853 bool interruptible, uint32_t sequence); 899 bool interruptible,
900 struct ww_acquire_ctx *ticket)
901{
902 int ret = 0;
854 903
855/** 904 WARN_ON(!atomic_read(&bo->kref.refcount));
856 * ttm_bo_reserve_nolru: 905
857 * 906 if (interruptible)
858 * @bo: A pointer to a struct ttm_buffer_object. 907 ret = ww_mutex_lock_slow_interruptible(&bo->resv->lock,
859 * @interruptible: Sleep interruptible if waiting. 908 ticket);
860 * @no_wait: Don't sleep while trying to reserve, rather return -EBUSY. 909 else
861 * @use_sequence: If @bo is already reserved, Only sleep waiting for 910 ww_mutex_lock_slow(&bo->resv->lock, ticket);
862 * it to become unreserved if @sequence < (@bo)->sequence. 911
863 * 912 if (likely(ret == 0))
864 * Will not remove reserved buffers from the lru lists. 913 ttm_bo_del_sub_from_lru(bo);
865 * Otherwise identical to ttm_bo_reserve. 914 else if (ret == -EINTR)
866 * 915 ret = -ERESTARTSYS;
867 * Returns: 916
868 * -EAGAIN: The reservation may cause a deadlock. 917 return ret;
869 * Release all buffer reservations, wait for @bo to become unreserved and 918}
870 * try again. (only if use_sequence == 1).
871 * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by
872 * a signal. Release all buffer reservations and return to user-space.
873 * -EBUSY: The function needed to sleep, but @no_wait was true
874 * -EDEADLK: Bo already reserved using @sequence. This error code will only
875 * be returned if @use_sequence is set to true.
876 */
877extern int ttm_bo_reserve_nolru(struct ttm_buffer_object *bo,
878 bool interruptible,
879 bool no_wait, bool use_sequence,
880 uint32_t sequence);
881 919
882/** 920/**
883 * ttm_bo_unreserve 921 * ttm_bo_unreserve_ticket
884 *
885 * @bo: A pointer to a struct ttm_buffer_object. 922 * @bo: A pointer to a struct ttm_buffer_object.
923 * @ticket: ww_acquire_ctx used for reserving
886 * 924 *
887 * Unreserve a previous reservation of @bo. 925 * Unreserve a previous reservation of @bo made with @ticket.
888 */ 926 */
889extern void ttm_bo_unreserve(struct ttm_buffer_object *bo); 927static inline void ttm_bo_unreserve_ticket(struct ttm_buffer_object *bo,
928 struct ww_acquire_ctx *t)
929{
930 if (!(bo->mem.placement & TTM_PL_FLAG_NO_EVICT)) {
931 spin_lock(&bo->glob->lru_lock);
932 ttm_bo_add_to_lru(bo);
933 spin_unlock(&bo->glob->lru_lock);
934 }
935 ww_mutex_unlock(&bo->resv->lock);
936}
890 937
891/** 938/**
892 * ttm_bo_unreserve_locked 939 * ttm_bo_unreserve
893 * 940 *
894 * @bo: A pointer to a struct ttm_buffer_object. 941 * @bo: A pointer to a struct ttm_buffer_object.
895 * 942 *
896 * Unreserve a previous reservation of @bo. 943 * Unreserve a previous reservation of @bo.
897 * Needs to be called with struct ttm_bo_global::lru_lock held.
898 */ 944 */
899extern void ttm_bo_unreserve_locked(struct ttm_buffer_object *bo); 945static inline void ttm_bo_unreserve(struct ttm_buffer_object *bo)
946{
947 ttm_bo_unreserve_ticket(bo, NULL);
948}
900 949
901/* 950/*
902 * ttm_bo_util.c 951 * ttm_bo_util.c
diff --git a/include/drm/ttm/ttm_execbuf_util.h b/include/drm/ttm/ttm_execbuf_util.h
index 547e19f06e57..ec8a1d306510 100644
--- a/include/drm/ttm/ttm_execbuf_util.h
+++ b/include/drm/ttm/ttm_execbuf_util.h
@@ -57,17 +57,20 @@ struct ttm_validate_buffer {
57/** 57/**
58 * function ttm_eu_backoff_reservation 58 * function ttm_eu_backoff_reservation
59 * 59 *
60 * @ticket: ww_acquire_ctx from reserve call
60 * @list: thread private list of ttm_validate_buffer structs. 61 * @list: thread private list of ttm_validate_buffer structs.
61 * 62 *
62 * Undoes all buffer validation reservations for bos pointed to by 63 * Undoes all buffer validation reservations for bos pointed to by
63 * the list entries. 64 * the list entries.
64 */ 65 */
65 66
66extern void ttm_eu_backoff_reservation(struct list_head *list); 67extern void ttm_eu_backoff_reservation(struct ww_acquire_ctx *ticket,
68 struct list_head *list);
67 69
68/** 70/**
69 * function ttm_eu_reserve_buffers 71 * function ttm_eu_reserve_buffers
70 * 72 *
73 * @ticket: [out] ww_acquire_ctx returned by call.
71 * @list: thread private list of ttm_validate_buffer structs. 74 * @list: thread private list of ttm_validate_buffer structs.
72 * 75 *
73 * Tries to reserve bos pointed to by the list entries for validation. 76 * Tries to reserve bos pointed to by the list entries for validation.
@@ -90,11 +93,13 @@ extern void ttm_eu_backoff_reservation(struct list_head *list);
90 * has failed. 93 * has failed.
91 */ 94 */
92 95
93extern int ttm_eu_reserve_buffers(struct list_head *list); 96extern int ttm_eu_reserve_buffers(struct ww_acquire_ctx *ticket,
97 struct list_head *list);
94 98
95/** 99/**
96 * function ttm_eu_fence_buffer_objects. 100 * function ttm_eu_fence_buffer_objects.
97 * 101 *
102 * @ticket: ww_acquire_ctx from reserve call
98 * @list: thread private list of ttm_validate_buffer structs. 103 * @list: thread private list of ttm_validate_buffer structs.
99 * @sync_obj: The new sync object for the buffers. 104 * @sync_obj: The new sync object for the buffers.
100 * 105 *
@@ -104,6 +109,7 @@ extern int ttm_eu_reserve_buffers(struct list_head *list);
104 * 109 *
105 */ 110 */
106 111
107extern void ttm_eu_fence_buffer_objects(struct list_head *list, void *sync_obj); 112extern void ttm_eu_fence_buffer_objects(struct ww_acquire_ctx *ticket,
113 struct list_head *list, void *sync_obj);
108 114
109#endif 115#endif
diff --git a/include/dt-bindings/pinctrl/rockchip.h b/include/dt-bindings/pinctrl/rockchip.h
new file mode 100644
index 000000000000..cd5788be82ce
--- /dev/null
+++ b/include/dt-bindings/pinctrl/rockchip.h
@@ -0,0 +1,32 @@
1/*
2 * Header providing constants for Rockchip pinctrl bindings.
3 *
4 * Copyright (c) 2013 MundoReader S.L.
5 * Author: Heiko Stuebner <heiko@sntech.de>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17
18#ifndef __DT_BINDINGS_ROCKCHIP_PINCTRL_H__
19#define __DT_BINDINGS_ROCKCHIP_PINCTRL_H__
20
21#define RK_GPIO0 0
22#define RK_GPIO1 1
23#define RK_GPIO2 2
24#define RK_GPIO3 3
25#define RK_GPIO4 4
26#define RK_GPIO6 6
27
28#define RK_FUNC_GPIO 0
29#define RK_FUNC_1 1
30#define RK_FUNC_2 2
31
32#endif
diff --git a/include/kvm/arm_arch_timer.h b/include/kvm/arm_arch_timer.h
new file mode 100644
index 000000000000..6d9aeddc09bf
--- /dev/null
+++ b/include/kvm/arm_arch_timer.h
@@ -0,0 +1,89 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Author: Marc Zyngier <marc.zyngier@arm.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 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __ASM_ARM_KVM_ARCH_TIMER_H
20#define __ASM_ARM_KVM_ARCH_TIMER_H
21
22#include <linux/clocksource.h>
23#include <linux/hrtimer.h>
24#include <linux/workqueue.h>
25
26struct arch_timer_kvm {
27#ifdef CONFIG_KVM_ARM_TIMER
28 /* Is the timer enabled */
29 bool enabled;
30
31 /* Virtual offset */
32 cycle_t cntvoff;
33#endif
34};
35
36struct arch_timer_cpu {
37#ifdef CONFIG_KVM_ARM_TIMER
38 /* Registers: control register, timer value */
39 u32 cntv_ctl; /* Saved/restored */
40 cycle_t cntv_cval; /* Saved/restored */
41
42 /*
43 * Anything that is not used directly from assembly code goes
44 * here.
45 */
46
47 /* Background timer used when the guest is not running */
48 struct hrtimer timer;
49
50 /* Work queued with the above timer expires */
51 struct work_struct expired;
52
53 /* Background timer active */
54 bool armed;
55
56 /* Timer IRQ */
57 const struct kvm_irq_level *irq;
58#endif
59};
60
61#ifdef CONFIG_KVM_ARM_TIMER
62int kvm_timer_hyp_init(void);
63int kvm_timer_init(struct kvm *kvm);
64void kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu,
65 const struct kvm_irq_level *irq);
66void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu);
67void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu);
68void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu);
69void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu);
70#else
71static inline int kvm_timer_hyp_init(void)
72{
73 return 0;
74};
75
76static inline int kvm_timer_init(struct kvm *kvm)
77{
78 return 0;
79}
80
81static inline void kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu,
82 const struct kvm_irq_level *irq) {}
83static inline void kvm_timer_vcpu_init(struct kvm_vcpu *vcpu) {}
84static inline void kvm_timer_flush_hwstate(struct kvm_vcpu *vcpu) {}
85static inline void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu) {}
86static inline void kvm_timer_vcpu_terminate(struct kvm_vcpu *vcpu) {}
87#endif
88
89#endif
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
new file mode 100644
index 000000000000..343744e4809c
--- /dev/null
+++ b/include/kvm/arm_vgic.h
@@ -0,0 +1,220 @@
1/*
2 * Copyright (C) 2012 ARM Ltd.
3 * Author: Marc Zyngier <marc.zyngier@arm.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 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __ASM_ARM_KVM_VGIC_H
20#define __ASM_ARM_KVM_VGIC_H
21
22#include <linux/kernel.h>
23#include <linux/kvm.h>
24#include <linux/irqreturn.h>
25#include <linux/spinlock.h>
26#include <linux/types.h>
27#include <linux/irqchip/arm-gic.h>
28
29#define VGIC_NR_IRQS 128
30#define VGIC_NR_SGIS 16
31#define VGIC_NR_PPIS 16
32#define VGIC_NR_PRIVATE_IRQS (VGIC_NR_SGIS + VGIC_NR_PPIS)
33#define VGIC_NR_SHARED_IRQS (VGIC_NR_IRQS - VGIC_NR_PRIVATE_IRQS)
34#define VGIC_MAX_CPUS KVM_MAX_VCPUS
35#define VGIC_MAX_LRS (1 << 6)
36
37/* Sanity checks... */
38#if (VGIC_MAX_CPUS > 8)
39#error Invalid number of CPU interfaces
40#endif
41
42#if (VGIC_NR_IRQS & 31)
43#error "VGIC_NR_IRQS must be a multiple of 32"
44#endif
45
46#if (VGIC_NR_IRQS > 1024)
47#error "VGIC_NR_IRQS must be <= 1024"
48#endif
49
50/*
51 * The GIC distributor registers describing interrupts have two parts:
52 * - 32 per-CPU interrupts (SGI + PPI)
53 * - a bunch of shared interrupts (SPI)
54 */
55struct vgic_bitmap {
56 union {
57 u32 reg[VGIC_NR_PRIVATE_IRQS / 32];
58 DECLARE_BITMAP(reg_ul, VGIC_NR_PRIVATE_IRQS);
59 } percpu[VGIC_MAX_CPUS];
60 union {
61 u32 reg[VGIC_NR_SHARED_IRQS / 32];
62 DECLARE_BITMAP(reg_ul, VGIC_NR_SHARED_IRQS);
63 } shared;
64};
65
66struct vgic_bytemap {
67 u32 percpu[VGIC_MAX_CPUS][VGIC_NR_PRIVATE_IRQS / 4];
68 u32 shared[VGIC_NR_SHARED_IRQS / 4];
69};
70
71struct vgic_dist {
72#ifdef CONFIG_KVM_ARM_VGIC
73 spinlock_t lock;
74 bool ready;
75
76 /* Virtual control interface mapping */
77 void __iomem *vctrl_base;
78
79 /* Distributor and vcpu interface mapping in the guest */
80 phys_addr_t vgic_dist_base;
81 phys_addr_t vgic_cpu_base;
82
83 /* Distributor enabled */
84 u32 enabled;
85
86 /* Interrupt enabled (one bit per IRQ) */
87 struct vgic_bitmap irq_enabled;
88
89 /* Interrupt 'pin' level */
90 struct vgic_bitmap irq_state;
91
92 /* Level-triggered interrupt in progress */
93 struct vgic_bitmap irq_active;
94
95 /* Interrupt priority. Not used yet. */
96 struct vgic_bytemap irq_priority;
97
98 /* Level/edge triggered */
99 struct vgic_bitmap irq_cfg;
100
101 /* Source CPU per SGI and target CPU */
102 u8 irq_sgi_sources[VGIC_MAX_CPUS][VGIC_NR_SGIS];
103
104 /* Target CPU for each IRQ */
105 u8 irq_spi_cpu[VGIC_NR_SHARED_IRQS];
106 struct vgic_bitmap irq_spi_target[VGIC_MAX_CPUS];
107
108 /* Bitmap indicating which CPU has something pending */
109 unsigned long irq_pending_on_cpu;
110#endif
111};
112
113struct vgic_cpu {
114#ifdef CONFIG_KVM_ARM_VGIC
115 /* per IRQ to LR mapping */
116 u8 vgic_irq_lr_map[VGIC_NR_IRQS];
117
118 /* Pending interrupts on this VCPU */
119 DECLARE_BITMAP( pending_percpu, VGIC_NR_PRIVATE_IRQS);
120 DECLARE_BITMAP( pending_shared, VGIC_NR_SHARED_IRQS);
121
122 /* Bitmap of used/free list registers */
123 DECLARE_BITMAP( lr_used, VGIC_MAX_LRS);
124
125 /* Number of list registers on this CPU */
126 int nr_lr;
127
128 /* CPU vif control registers for world switch */
129 u32 vgic_hcr;
130 u32 vgic_vmcr;
131 u32 vgic_misr; /* Saved only */
132 u32 vgic_eisr[2]; /* Saved only */
133 u32 vgic_elrsr[2]; /* Saved only */
134 u32 vgic_apr;
135 u32 vgic_lr[VGIC_MAX_LRS];
136#endif
137};
138
139#define LR_EMPTY 0xff
140
141struct kvm;
142struct kvm_vcpu;
143struct kvm_run;
144struct kvm_exit_mmio;
145
146#ifdef CONFIG_KVM_ARM_VGIC
147int kvm_vgic_set_addr(struct kvm *kvm, unsigned long type, u64 addr);
148int kvm_vgic_hyp_init(void);
149int kvm_vgic_init(struct kvm *kvm);
150int kvm_vgic_create(struct kvm *kvm);
151int kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu);
152void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu);
153void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu);
154int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid, unsigned int irq_num,
155 bool level);
156int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu);
157bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run,
158 struct kvm_exit_mmio *mmio);
159
160#define irqchip_in_kernel(k) (!!((k)->arch.vgic.vctrl_base))
161#define vgic_initialized(k) ((k)->arch.vgic.ready)
162
163#else
164static inline int kvm_vgic_hyp_init(void)
165{
166 return 0;
167}
168
169static inline int kvm_vgic_set_addr(struct kvm *kvm, unsigned long type, u64 addr)
170{
171 return 0;
172}
173
174static inline int kvm_vgic_init(struct kvm *kvm)
175{
176 return 0;
177}
178
179static inline int kvm_vgic_create(struct kvm *kvm)
180{
181 return 0;
182}
183
184static inline int kvm_vgic_vcpu_init(struct kvm_vcpu *vcpu)
185{
186 return 0;
187}
188
189static inline void kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu) {}
190static inline void kvm_vgic_sync_hwstate(struct kvm_vcpu *vcpu) {}
191
192static inline int kvm_vgic_inject_irq(struct kvm *kvm, int cpuid,
193 unsigned int irq_num, bool level)
194{
195 return 0;
196}
197
198static inline int kvm_vgic_vcpu_pending_irq(struct kvm_vcpu *vcpu)
199{
200 return 0;
201}
202
203static inline bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run,
204 struct kvm_exit_mmio *mmio)
205{
206 return false;
207}
208
209static inline int irqchip_in_kernel(struct kvm *kvm)
210{
211 return 0;
212}
213
214static inline bool vgic_initialized(struct kvm *kvm)
215{
216 return true;
217}
218#endif
219
220#endif
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 17b5b5967641..353ba256f368 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -352,8 +352,7 @@ extern acpi_status acpi_pci_osc_control_set(acpi_handle handle,
352 352
353/* Enable _OST when all relevant hotplug operations are enabled */ 353/* Enable _OST when all relevant hotplug operations are enabled */
354#if defined(CONFIG_ACPI_HOTPLUG_CPU) && \ 354#if defined(CONFIG_ACPI_HOTPLUG_CPU) && \
355 (defined(CONFIG_ACPI_HOTPLUG_MEMORY) || \ 355 defined(CONFIG_ACPI_HOTPLUG_MEMORY) && \
356 defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE)) && \
357 defined(CONFIG_ACPI_CONTAINER) 356 defined(CONFIG_ACPI_CONTAINER)
358#define ACPI_HOTPLUG_OST 357#define ACPI_HOTPLUG_OST
359#endif 358#endif
diff --git a/include/linux/aer.h b/include/linux/aer.h
index 737f90ab4b62..4dbaa7081530 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -7,6 +7,10 @@
7#ifndef _AER_H_ 7#ifndef _AER_H_
8#define _AER_H_ 8#define _AER_H_
9 9
10#define AER_NONFATAL 0
11#define AER_FATAL 1
12#define AER_CORRECTABLE 2
13
10struct aer_header_log_regs { 14struct aer_header_log_regs {
11 unsigned int dw0; 15 unsigned int dw0;
12 unsigned int dw1; 16 unsigned int dw1;
@@ -31,9 +35,9 @@ struct aer_capability_regs {
31 35
32#if defined(CONFIG_PCIEAER) 36#if defined(CONFIG_PCIEAER)
33/* pci-e port driver needs this function to enable aer */ 37/* pci-e port driver needs this function to enable aer */
34extern int pci_enable_pcie_error_reporting(struct pci_dev *dev); 38int pci_enable_pcie_error_reporting(struct pci_dev *dev);
35extern int pci_disable_pcie_error_reporting(struct pci_dev *dev); 39int pci_disable_pcie_error_reporting(struct pci_dev *dev);
36extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); 40int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
37#else 41#else
38static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev) 42static inline int pci_enable_pcie_error_reporting(struct pci_dev *dev)
39{ 43{
@@ -49,11 +53,11 @@ static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
49} 53}
50#endif 54#endif
51 55
52extern void cper_print_aer(struct pci_dev *dev, 56void cper_print_aer(struct pci_dev *dev, int cper_severity,
53 int cper_severity, struct aer_capability_regs *aer); 57 struct aer_capability_regs *aer);
54extern int cper_severity_to_aer(int cper_severity); 58int cper_severity_to_aer(int cper_severity);
55extern void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn, 59void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
56 int severity, 60 int severity,
57 struct aer_capability_regs *aer_regs); 61 struct aer_capability_regs *aer_regs);
58#endif //_AER_H_ 62#endif //_AER_H_
59 63
diff --git a/include/linux/alarmtimer.h b/include/linux/alarmtimer.h
index 9069694e70eb..a899402a5a0e 100644
--- a/include/linux/alarmtimer.h
+++ b/include/linux/alarmtimer.h
@@ -44,10 +44,14 @@ struct alarm {
44void alarm_init(struct alarm *alarm, enum alarmtimer_type type, 44void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
45 enum alarmtimer_restart (*function)(struct alarm *, ktime_t)); 45 enum alarmtimer_restart (*function)(struct alarm *, ktime_t));
46int alarm_start(struct alarm *alarm, ktime_t start); 46int alarm_start(struct alarm *alarm, ktime_t start);
47int alarm_start_relative(struct alarm *alarm, ktime_t start);
48void alarm_restart(struct alarm *alarm);
47int alarm_try_to_cancel(struct alarm *alarm); 49int alarm_try_to_cancel(struct alarm *alarm);
48int alarm_cancel(struct alarm *alarm); 50int alarm_cancel(struct alarm *alarm);
49 51
50u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval); 52u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval);
53u64 alarm_forward_now(struct alarm *alarm, ktime_t interval);
54ktime_t alarm_expires_remaining(const struct alarm *alarm);
51 55
52/* Provide way to access the rtc device being used by alarmtimers */ 56/* Provide way to access the rtc device being used by alarmtimers */
53struct rtc_device *alarmtimer_get_rtcdev(void); 57struct rtc_device *alarmtimer_get_rtcdev(void);
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h
index 2a5f64a11b77..10fe2a211c2e 100644
--- a/include/linux/amba/pl08x.h
+++ b/include/linux/amba/pl08x.h
@@ -76,11 +76,11 @@ struct pl08x_channel_data {
76 * platform, all inclusive, including multiplexed channels. The available 76 * platform, all inclusive, including multiplexed channels. The available
77 * physical channels will be multiplexed around these signals as they are 77 * physical channels will be multiplexed around these signals as they are
78 * requested, just enumerate all possible channels. 78 * requested, just enumerate all possible channels.
79 * @get_signal: request a physical signal to be used for a DMA transfer 79 * @get_xfer_signal: request a physical signal to be used for a DMA transfer
80 * immediately: if there is some multiplexing or similar blocking the use 80 * immediately: if there is some multiplexing or similar blocking the use
81 * of the channel the transfer can be denied by returning less than zero, 81 * of the channel the transfer can be denied by returning less than zero,
82 * else it returns the allocated signal number 82 * else it returns the allocated signal number
83 * @put_signal: indicate to the platform that this physical signal is not 83 * @put_xfer_signal: indicate to the platform that this physical signal is not
84 * running any DMA transfer and multiplexing can be recycled 84 * running any DMA transfer and multiplexing can be recycled
85 * @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2 85 * @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2
86 * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2 86 * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2
@@ -89,8 +89,8 @@ struct pl08x_platform_data {
89 const struct pl08x_channel_data *slave_channels; 89 const struct pl08x_channel_data *slave_channels;
90 unsigned int num_slave_channels; 90 unsigned int num_slave_channels;
91 struct pl08x_channel_data memcpy_channel; 91 struct pl08x_channel_data memcpy_channel;
92 int (*get_signal)(const struct pl08x_channel_data *); 92 int (*get_xfer_signal)(const struct pl08x_channel_data *);
93 void (*put_signal)(const struct pl08x_channel_data *, int); 93 void (*put_xfer_signal)(const struct pl08x_channel_data *, int);
94 u8 lli_buses; 94 u8 lli_buses;
95 u8 mem_buses; 95 u8 mem_buses;
96}; 96};
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h
index a1c486a88e88..179b38ffd351 100644
--- a/include/linux/async_tx.h
+++ b/include/linux/async_tx.h
@@ -182,10 +182,6 @@ async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
182 unsigned int src_offset, size_t len, 182 unsigned int src_offset, size_t len,
183 struct async_submit_ctl *submit); 183 struct async_submit_ctl *submit);
184 184
185struct dma_async_tx_descriptor *
186async_memset(struct page *dest, int val, unsigned int offset,
187 size_t len, struct async_submit_ctl *submit);
188
189struct dma_async_tx_descriptor *async_trigger_callback(struct async_submit_ctl *submit); 185struct dma_async_tx_descriptor *async_trigger_callback(struct async_submit_ctl *submit);
190 186
191struct dma_async_tx_descriptor * 187struct dma_async_tx_descriptor *
diff --git a/include/linux/audit.h b/include/linux/audit.h
index b20b03852f21..729a4d165bcc 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -103,8 +103,11 @@ extern void __audit_syscall_exit(int ret_success, long ret_value);
103extern struct filename *__audit_reusename(const __user char *uptr); 103extern struct filename *__audit_reusename(const __user char *uptr);
104extern void __audit_getname(struct filename *name); 104extern void __audit_getname(struct filename *name);
105extern void audit_putname(struct filename *name); 105extern void audit_putname(struct filename *name);
106
107#define AUDIT_INODE_PARENT 1 /* dentry represents the parent */
108#define AUDIT_INODE_HIDDEN 2 /* audit record should be hidden */
106extern void __audit_inode(struct filename *name, const struct dentry *dentry, 109extern void __audit_inode(struct filename *name, const struct dentry *dentry,
107 unsigned int parent); 110 unsigned int flags);
108extern void __audit_inode_child(const struct inode *parent, 111extern void __audit_inode_child(const struct inode *parent,
109 const struct dentry *dentry, 112 const struct dentry *dentry,
110 const unsigned char type); 113 const unsigned char type);
@@ -148,10 +151,22 @@ static inline void audit_getname(struct filename *name)
148 if (unlikely(!audit_dummy_context())) 151 if (unlikely(!audit_dummy_context()))
149 __audit_getname(name); 152 __audit_getname(name);
150} 153}
151static inline void audit_inode(struct filename *name, const struct dentry *dentry, 154static inline void audit_inode(struct filename *name,
155 const struct dentry *dentry,
152 unsigned int parent) { 156 unsigned int parent) {
157 if (unlikely(!audit_dummy_context())) {
158 unsigned int flags = 0;
159 if (parent)
160 flags |= AUDIT_INODE_PARENT;
161 __audit_inode(name, dentry, flags);
162 }
163}
164static inline void audit_inode_parent_hidden(struct filename *name,
165 const struct dentry *dentry)
166{
153 if (unlikely(!audit_dummy_context())) 167 if (unlikely(!audit_dummy_context()))
154 __audit_inode(name, dentry, parent); 168 __audit_inode(name, dentry,
169 AUDIT_INODE_PARENT | AUDIT_INODE_HIDDEN);
155} 170}
156static inline void audit_inode_child(const struct inode *parent, 171static inline void audit_inode_child(const struct inode *parent,
157 const struct dentry *dentry, 172 const struct dentry *dentry,
@@ -311,7 +326,7 @@ static inline void audit_putname(struct filename *name)
311{ } 326{ }
312static inline void __audit_inode(struct filename *name, 327static inline void __audit_inode(struct filename *name,
313 const struct dentry *dentry, 328 const struct dentry *dentry,
314 unsigned int parent) 329 unsigned int flags)
315{ } 330{ }
316static inline void __audit_inode_child(const struct inode *parent, 331static inline void __audit_inode_child(const struct inode *parent,
317 const struct dentry *dentry, 332 const struct dentry *dentry,
@@ -321,6 +336,9 @@ static inline void audit_inode(struct filename *name,
321 const struct dentry *dentry, 336 const struct dentry *dentry,
322 unsigned int parent) 337 unsigned int parent)
323{ } 338{ }
339static inline void audit_inode_parent_hidden(struct filename *name,
340 const struct dentry *dentry)
341{ }
324static inline void audit_inode_child(const struct inode *parent, 342static inline void audit_inode_child(const struct inode *parent,
325 const struct dentry *dentry, 343 const struct dentry *dentry,
326 const unsigned char type) 344 const unsigned char type)
diff --git a/include/linux/backlight.h b/include/linux/backlight.h
index da9a0825e007..53b77949c79d 100644
--- a/include/linux/backlight.h
+++ b/include/linux/backlight.h
@@ -114,7 +114,13 @@ static inline void backlight_update_status(struct backlight_device *bd)
114extern struct backlight_device *backlight_device_register(const char *name, 114extern struct backlight_device *backlight_device_register(const char *name,
115 struct device *dev, void *devdata, const struct backlight_ops *ops, 115 struct device *dev, void *devdata, const struct backlight_ops *ops,
116 const struct backlight_properties *props); 116 const struct backlight_properties *props);
117extern struct backlight_device *devm_backlight_device_register(
118 struct device *dev, const char *name, struct device *parent,
119 void *devdata, const struct backlight_ops *ops,
120 const struct backlight_properties *props);
117extern void backlight_device_unregister(struct backlight_device *bd); 121extern void backlight_device_unregister(struct backlight_device *bd);
122extern void devm_backlight_device_unregister(struct device *dev,
123 struct backlight_device *bd);
118extern void backlight_force_update(struct backlight_device *bd, 124extern void backlight_force_update(struct backlight_device *bd,
119 enum backlight_update_reason reason); 125 enum backlight_update_reason reason);
120 126
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 2e34db82a643..622fc505d3e1 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -144,6 +144,7 @@ struct bcma_host_ops {
144 144
145/* Chip IDs of PCIe devices */ 145/* Chip IDs of PCIe devices */
146#define BCMA_CHIP_ID_BCM4313 0x4313 146#define BCMA_CHIP_ID_BCM4313 0x4313
147#define BCMA_CHIP_ID_BCM43142 43142
147#define BCMA_CHIP_ID_BCM43224 43224 148#define BCMA_CHIP_ID_BCM43224 43224
148#define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8 149#define BCMA_PKG_ID_BCM43224_FAB_CSM 0x8
149#define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa 150#define BCMA_PKG_ID_BCM43224_FAB_SMIC 0xa
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index b8b09eac60a4..c49e1a159e6e 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -330,6 +330,8 @@
330#define BCMA_CC_PMU_CAP 0x0604 /* PMU capabilities */ 330#define BCMA_CC_PMU_CAP 0x0604 /* PMU capabilities */
331#define BCMA_CC_PMU_CAP_REVISION 0x000000FF /* Revision mask */ 331#define BCMA_CC_PMU_CAP_REVISION 0x000000FF /* Revision mask */
332#define BCMA_CC_PMU_STAT 0x0608 /* PMU status */ 332#define BCMA_CC_PMU_STAT 0x0608 /* PMU status */
333#define BCMA_CC_PMU_STAT_EXT_LPO_AVAIL 0x00000100
334#define BCMA_CC_PMU_STAT_WDRESET 0x00000080
333#define BCMA_CC_PMU_STAT_INTPEND 0x00000040 /* Interrupt pending */ 335#define BCMA_CC_PMU_STAT_INTPEND 0x00000040 /* Interrupt pending */
334#define BCMA_CC_PMU_STAT_SBCLKST 0x00000030 /* Backplane clock status? */ 336#define BCMA_CC_PMU_STAT_SBCLKST 0x00000030 /* Backplane clock status? */
335#define BCMA_CC_PMU_STAT_HAVEALP 0x00000008 /* ALP available */ 337#define BCMA_CC_PMU_STAT_HAVEALP 0x00000008 /* ALP available */
@@ -355,6 +357,11 @@
355#define BCMA_CC_REGCTL_DATA 0x065C 357#define BCMA_CC_REGCTL_DATA 0x065C
356#define BCMA_CC_PLLCTL_ADDR 0x0660 358#define BCMA_CC_PLLCTL_ADDR 0x0660
357#define BCMA_CC_PLLCTL_DATA 0x0664 359#define BCMA_CC_PLLCTL_DATA 0x0664
360#define BCMA_CC_PMU_STRAPOPT 0x0668 /* (corerev >= 28) */
361#define BCMA_CC_PMU_XTAL_FREQ 0x066C /* (pmurev >= 10) */
362#define BCMA_CC_PMU_XTAL_FREQ_ILPCTL_MASK 0x00001FFF
363#define BCMA_CC_PMU_XTAL_FREQ_MEASURE_MASK 0x80000000
364#define BCMA_CC_PMU_XTAL_FREQ_MEASURE_SHIFT 31
358#define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ 365#define BCMA_CC_SPROM 0x0800 /* SPROM beginning */
359/* NAND flash MLC controller registers (corerev >= 38) */ 366/* NAND flash MLC controller registers (corerev >= 38) */
360#define BCMA_CC_NAND_REVISION 0x0C00 367#define BCMA_CC_NAND_REVISION 0x0C00
@@ -435,6 +442,23 @@
435#define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_MASK 0x00000007 442#define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_MASK 0x00000007
436#define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_SHIFT 0 443#define BCMA_CC_PMU6_4706_PROC_NDIV_MODE_SHIFT 0
437 444
445/* PMU rev 15 */
446#define BCMA_CC_PMU15_PLL_PLLCTL0 0
447#define BCMA_CC_PMU15_PLL_PC0_CLKSEL_MASK 0x00000003
448#define BCMA_CC_PMU15_PLL_PC0_CLKSEL_SHIFT 0
449#define BCMA_CC_PMU15_PLL_PC0_FREQTGT_MASK 0x003FFFFC
450#define BCMA_CC_PMU15_PLL_PC0_FREQTGT_SHIFT 2
451#define BCMA_CC_PMU15_PLL_PC0_PRESCALE_MASK 0x00C00000
452#define BCMA_CC_PMU15_PLL_PC0_PRESCALE_SHIFT 22
453#define BCMA_CC_PMU15_PLL_PC0_KPCTRL_MASK 0x07000000
454#define BCMA_CC_PMU15_PLL_PC0_KPCTRL_SHIFT 24
455#define BCMA_CC_PMU15_PLL_PC0_FCNTCTRL_MASK 0x38000000
456#define BCMA_CC_PMU15_PLL_PC0_FCNTCTRL_SHIFT 27
457#define BCMA_CC_PMU15_PLL_PC0_FDCMODE_MASK 0x40000000
458#define BCMA_CC_PMU15_PLL_PC0_FDCMODE_SHIFT 30
459#define BCMA_CC_PMU15_PLL_PC0_CTRLBIAS_MASK 0x80000000
460#define BCMA_CC_PMU15_PLL_PC0_CTRLBIAS_SHIFT 31
461
438/* ALP clock on pre-PMU chips */ 462/* ALP clock on pre-PMU chips */
439#define BCMA_CC_PMU_ALP_CLOCK 20000000 463#define BCMA_CC_PMU_ALP_CLOCK 20000000
440/* HT clock for systems with PMU-enabled chipcommon */ 464/* HT clock for systems with PMU-enabled chipcommon */
@@ -507,6 +531,37 @@
507#define BCMA_CHIPCTL_5357_I2S_PINS_ENABLE BIT(18) 531#define BCMA_CHIPCTL_5357_I2S_PINS_ENABLE BIT(18)
508#define BCMA_CHIPCTL_5357_I2CSPI_PINS_ENABLE BIT(19) 532#define BCMA_CHIPCTL_5357_I2CSPI_PINS_ENABLE BIT(19)
509 533
534#define BCMA_RES_4314_LPLDO_PU BIT(0)
535#define BCMA_RES_4314_PMU_SLEEP_DIS BIT(1)
536#define BCMA_RES_4314_PMU_BG_PU BIT(2)
537#define BCMA_RES_4314_CBUCK_LPOM_PU BIT(3)
538#define BCMA_RES_4314_CBUCK_PFM_PU BIT(4)
539#define BCMA_RES_4314_CLDO_PU BIT(5)
540#define BCMA_RES_4314_LPLDO2_LVM BIT(6)
541#define BCMA_RES_4314_WL_PMU_PU BIT(7)
542#define BCMA_RES_4314_LNLDO_PU BIT(8)
543#define BCMA_RES_4314_LDO3P3_PU BIT(9)
544#define BCMA_RES_4314_OTP_PU BIT(10)
545#define BCMA_RES_4314_XTAL_PU BIT(11)
546#define BCMA_RES_4314_WL_PWRSW_PU BIT(12)
547#define BCMA_RES_4314_LQ_AVAIL BIT(13)
548#define BCMA_RES_4314_LOGIC_RET BIT(14)
549#define BCMA_RES_4314_MEM_SLEEP BIT(15)
550#define BCMA_RES_4314_MACPHY_RET BIT(16)
551#define BCMA_RES_4314_WL_CORE_READY BIT(17)
552#define BCMA_RES_4314_ILP_REQ BIT(18)
553#define BCMA_RES_4314_ALP_AVAIL BIT(19)
554#define BCMA_RES_4314_MISC_PWRSW_PU BIT(20)
555#define BCMA_RES_4314_SYNTH_PWRSW_PU BIT(21)
556#define BCMA_RES_4314_RX_PWRSW_PU BIT(22)
557#define BCMA_RES_4314_RADIO_PU BIT(23)
558#define BCMA_RES_4314_VCO_LDO_PU BIT(24)
559#define BCMA_RES_4314_AFE_LDO_PU BIT(25)
560#define BCMA_RES_4314_RX_LDO_PU BIT(26)
561#define BCMA_RES_4314_TX_LDO_PU BIT(27)
562#define BCMA_RES_4314_HT_AVAIL BIT(28)
563#define BCMA_RES_4314_MACPHY_CLK_AVAIL BIT(29)
564
510/* Data for the PMU, if available. 565/* Data for the PMU, if available.
511 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) 566 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
512 */ 567 */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index ef24466d8f82..ec48bac5b039 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -97,11 +97,11 @@ static inline void *bio_data(struct bio *bio)
97 * permanent PIO fall back, user is probably better off disabling highmem 97 * permanent PIO fall back, user is probably better off disabling highmem
98 * I/O completely on that queue (see ide-dma for example) 98 * I/O completely on that queue (see ide-dma for example)
99 */ 99 */
100#define __bio_kmap_atomic(bio, idx, kmtype) \ 100#define __bio_kmap_atomic(bio, idx) \
101 (kmap_atomic(bio_iovec_idx((bio), (idx))->bv_page) + \ 101 (kmap_atomic(bio_iovec_idx((bio), (idx))->bv_page) + \
102 bio_iovec_idx((bio), (idx))->bv_offset) 102 bio_iovec_idx((bio), (idx))->bv_offset)
103 103
104#define __bio_kunmap_atomic(addr, kmtype) kunmap_atomic(addr) 104#define __bio_kunmap_atomic(addr) kunmap_atomic(addr)
105 105
106/* 106/*
107 * merge helpers etc 107 * merge helpers etc
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 5f0b0e1f7c08..f1f07d31a3af 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -44,8 +44,8 @@ extern unsigned long init_bootmem_node(pg_data_t *pgdat,
44 unsigned long endpfn); 44 unsigned long endpfn);
45extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); 45extern unsigned long init_bootmem(unsigned long addr, unsigned long memend);
46 46
47extern unsigned long free_all_bootmem_node(pg_data_t *pgdat);
48extern unsigned long free_all_bootmem(void); 47extern unsigned long free_all_bootmem(void);
48extern void reset_all_zones_managed_pages(void);
49 49
50extern void free_bootmem_node(pg_data_t *pgdat, 50extern void free_bootmem_node(pg_data_t *pgdat,
51 unsigned long addr, 51 unsigned long addr,
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index f5a3b838ddb0..91fa9a94ae92 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -139,6 +139,9 @@ BUFFER_FNS(Prio, prio)
139 }) 139 })
140#define page_has_buffers(page) PagePrivate(page) 140#define page_has_buffers(page) PagePrivate(page)
141 141
142void buffer_check_dirty_writeback(struct page *page,
143 bool *dirty, bool *writeback);
144
142/* 145/*
143 * Declarations 146 * Declarations
144 */ 147 */
diff --git a/include/linux/can/platform/flexcan.h b/include/linux/can/platform/flexcan.h
deleted file mode 100644
index 72b713ab57e9..000000000000
--- a/include/linux/can/platform/flexcan.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * Copyright (C) 2010 Marc Kleine-Budde <kernel@pengutronix.de>
3 *
4 * This file is released under the GPLv2
5 *
6 */
7
8#ifndef __CAN_PLATFORM_FLEXCAN_H
9#define __CAN_PLATFORM_FLEXCAN_H
10
11/**
12 * struct flexcan_platform_data - flex CAN controller platform data
13 * @transceiver_enable: - called to power on/off the transceiver
14 *
15 */
16struct flexcan_platform_data {
17 void (*transceiver_switch)(int enable);
18};
19
20#endif /* __CAN_PLATFORM_FLEXCAN_H */
diff --git a/include/linux/ceph/decode.h b/include/linux/ceph/decode.h
index 379f71508995..0442c3d800f0 100644
--- a/include/linux/ceph/decode.h
+++ b/include/linux/ceph/decode.h
@@ -160,11 +160,6 @@ static inline void ceph_decode_timespec(struct timespec *ts,
160static inline void ceph_encode_timespec(struct ceph_timespec *tv, 160static inline void ceph_encode_timespec(struct ceph_timespec *tv,
161 const struct timespec *ts) 161 const struct timespec *ts)
162{ 162{
163 BUG_ON(ts->tv_sec < 0);
164 BUG_ON(ts->tv_sec > (__kernel_time_t)U32_MAX);
165 BUG_ON(ts->tv_nsec < 0);
166 BUG_ON(ts->tv_nsec > (long)U32_MAX);
167
168 tv->tv_sec = cpu_to_le32((u32)ts->tv_sec); 163 tv->tv_sec = cpu_to_le32((u32)ts->tv_sec);
169 tv->tv_nsec = cpu_to_le32((u32)ts->tv_nsec); 164 tv->tv_nsec = cpu_to_le32((u32)ts->tv_nsec);
170} 165}
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 186db0bf4951..ce6df39f60ff 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -145,7 +145,6 @@ struct ceph_osd_request {
145 s32 r_reply_op_result[CEPH_OSD_MAX_OP]; 145 s32 r_reply_op_result[CEPH_OSD_MAX_OP];
146 int r_got_reply; 146 int r_got_reply;
147 int r_linger; 147 int r_linger;
148 int r_completed;
149 148
150 struct ceph_osd_client *r_osdc; 149 struct ceph_osd_client *r_osdc;
151 struct kref r_kref; 150 struct kref r_kref;
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 8bda1294c035..297462b9f41a 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -20,6 +20,7 @@
20#include <linux/workqueue.h> 20#include <linux/workqueue.h>
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 24
24#ifdef CONFIG_CGROUPS 25#ifdef CONFIG_CGROUPS
25 26
@@ -72,13 +73,8 @@ struct cgroup_subsys_state {
72 */ 73 */
73 struct cgroup *cgroup; 74 struct cgroup *cgroup;
74 75
75 /* 76 /* reference count - access via css_[try]get() and css_put() */
76 * State maintained by the cgroup system to allow subsystems 77 struct percpu_ref refcnt;
77 * to be "busy". Should be accessed via css_get(),
78 * css_tryget() and css_put().
79 */
80
81 atomic_t refcnt;
82 78
83 unsigned long flags; 79 unsigned long flags;
84 /* ID for this css, if possible */ 80 /* ID for this css, if possible */
@@ -94,56 +90,52 @@ enum {
94 CSS_ONLINE = (1 << 1), /* between ->css_online() and ->css_offline() */ 90 CSS_ONLINE = (1 << 1), /* between ->css_online() and ->css_offline() */
95}; 91};
96 92
97/* Caller must verify that the css is not for root cgroup */ 93/**
98static inline void __css_get(struct cgroup_subsys_state *css, int count) 94 * css_get - obtain a reference on the specified css
99{ 95 * @css: target css
100 atomic_add(count, &css->refcnt); 96 *
101} 97 * The caller must already have a reference.
102
103/*
104 * Call css_get() to hold a reference on the css; it can be used
105 * for a reference obtained via:
106 * - an existing ref-counted reference to the css
107 * - task->cgroups for a locked task
108 */ 98 */
109
110static inline void css_get(struct cgroup_subsys_state *css) 99static inline void css_get(struct cgroup_subsys_state *css)
111{ 100{
112 /* We don't need to reference count the root state */ 101 /* We don't need to reference count the root state */
113 if (!(css->flags & CSS_ROOT)) 102 if (!(css->flags & CSS_ROOT))
114 __css_get(css, 1); 103 percpu_ref_get(&css->refcnt);
115} 104}
116 105
117/* 106/**
118 * Call css_tryget() to take a reference on a css if your existing 107 * css_tryget - try to obtain a reference on the specified css
119 * (known-valid) reference isn't already ref-counted. Returns false if 108 * @css: target css
120 * the css has been destroyed. 109 *
110 * Obtain a reference on @css if it's alive. The caller naturally needs to
111 * ensure that @css is accessible but doesn't have to be holding a
112 * reference on it - IOW, RCU protected access is good enough for this
113 * function. Returns %true if a reference count was successfully obtained;
114 * %false otherwise.
121 */ 115 */
122
123extern bool __css_tryget(struct cgroup_subsys_state *css);
124static inline bool css_tryget(struct cgroup_subsys_state *css) 116static inline bool css_tryget(struct cgroup_subsys_state *css)
125{ 117{
126 if (css->flags & CSS_ROOT) 118 if (css->flags & CSS_ROOT)
127 return true; 119 return true;
128 return __css_tryget(css); 120 return percpu_ref_tryget(&css->refcnt);
129} 121}
130 122
131/* 123/**
132 * css_put() should be called to release a reference taken by 124 * css_put - put a css reference
133 * css_get() or css_tryget() 125 * @css: target css
126 *
127 * Put a reference obtained via css_get() and css_tryget().
134 */ 128 */
135
136extern void __css_put(struct cgroup_subsys_state *css);
137static inline void css_put(struct cgroup_subsys_state *css) 129static inline void css_put(struct cgroup_subsys_state *css)
138{ 130{
139 if (!(css->flags & CSS_ROOT)) 131 if (!(css->flags & CSS_ROOT))
140 __css_put(css); 132 percpu_ref_put(&css->refcnt);
141} 133}
142 134
143/* bits in struct cgroup flags field */ 135/* bits in struct cgroup flags field */
144enum { 136enum {
145 /* Control Group is dead */ 137 /* Control Group is dead */
146 CGRP_REMOVED, 138 CGRP_DEAD,
147 /* 139 /*
148 * Control Group has previously had a child cgroup or a task, 140 * Control Group has previously had a child cgroup or a task,
149 * but no longer (only if CGRP_NOTIFY_ON_RELEASE is set) 141 * but no longer (only if CGRP_NOTIFY_ON_RELEASE is set)
@@ -169,12 +161,6 @@ struct cgroup_name {
169struct cgroup { 161struct cgroup {
170 unsigned long flags; /* "unsigned long" so bitops work */ 162 unsigned long flags; /* "unsigned long" so bitops work */
171 163
172 /*
173 * count users of this cgroup. >0 means busy, but doesn't
174 * necessarily indicate the number of tasks in the cgroup
175 */
176 atomic_t count;
177
178 int id; /* ida allocated in-hierarchy ID */ 164 int id; /* ida allocated in-hierarchy ID */
179 165
180 /* 166 /*
@@ -189,6 +175,14 @@ struct cgroup {
189 struct dentry *dentry; /* cgroup fs entry, RCU protected */ 175 struct dentry *dentry; /* cgroup fs entry, RCU protected */
190 176
191 /* 177 /*
178 * Monotonically increasing unique serial number which defines a
179 * uniform order among all cgroups. It's guaranteed that all
180 * ->children lists are in the ascending order of ->serial_nr.
181 * It's used to allow interrupting and resuming iterations.
182 */
183 u64 serial_nr;
184
185 /*
192 * This is a copy of dentry->d_name, and it's needed because 186 * This is a copy of dentry->d_name, and it's needed because
193 * we can't use dentry->d_name in cgroup_path(). 187 * we can't use dentry->d_name in cgroup_path().
194 * 188 *
@@ -207,13 +201,10 @@ struct cgroup {
207 struct cgroupfs_root *root; 201 struct cgroupfs_root *root;
208 202
209 /* 203 /*
210 * List of cg_cgroup_links pointing at css_sets with 204 * List of cgrp_cset_links pointing at css_sets with tasks in this
211 * tasks in this cgroup. Protected by css_set_lock 205 * cgroup. Protected by css_set_lock.
212 */ 206 */
213 struct list_head css_sets; 207 struct list_head cset_links;
214
215 struct list_head allcg_node; /* cgroupfs_root->allcg_list */
216 struct list_head cft_q_node; /* used during cftype add/rm */
217 208
218 /* 209 /*
219 * Linked list running through all cgroups that can 210 * Linked list running through all cgroups that can
@@ -229,9 +220,10 @@ struct cgroup {
229 struct list_head pidlists; 220 struct list_head pidlists;
230 struct mutex pidlist_mutex; 221 struct mutex pidlist_mutex;
231 222
232 /* For RCU-protected deletion */ 223 /* For css percpu_ref killing and RCU-protected deletion */
233 struct rcu_head rcu_head; 224 struct rcu_head rcu_head;
234 struct work_struct free_work; 225 struct work_struct destroy_work;
226 atomic_t css_kill_cnt;
235 227
236 /* List of events which userspace want to receive */ 228 /* List of events which userspace want to receive */
237 struct list_head event_list; 229 struct list_head event_list;
@@ -269,18 +261,35 @@ enum {
269 * 261 *
270 * - Remount is disallowed. 262 * - Remount is disallowed.
271 * 263 *
264 * - rename(2) is disallowed.
265 *
266 * - "tasks" is removed. Everything should be at process
267 * granularity. Use "cgroup.procs" instead.
268 *
269 * - "release_agent" and "notify_on_release" are removed.
270 * Replacement notification mechanism will be implemented.
271 *
272 * - cpuset: tasks will be kept in empty cpusets when hotplug happens
273 * and take masks of ancestors with non-empty cpus/mems, instead of
274 * being moved to an ancestor.
275 *
276 * - cpuset: a task can be moved into an empty cpuset, and again it
277 * takes masks of ancestors.
278 *
272 * - memcg: use_hierarchy is on by default and the cgroup file for 279 * - memcg: use_hierarchy is on by default and the cgroup file for
273 * the flag is not created. 280 * the flag is not created.
274 * 281 *
275 * The followings are planned changes. 282 * - blkcg: blk-throttle becomes properly hierarchical.
276 *
277 * - release_agent will be disallowed once replacement notification
278 * mechanism is implemented.
279 */ 283 */
280 CGRP_ROOT_SANE_BEHAVIOR = (1 << 0), 284 CGRP_ROOT_SANE_BEHAVIOR = (1 << 0),
281 285
282 CGRP_ROOT_NOPREFIX = (1 << 1), /* mounted subsystems have no named prefix */ 286 CGRP_ROOT_NOPREFIX = (1 << 1), /* mounted subsystems have no named prefix */
283 CGRP_ROOT_XATTR = (1 << 2), /* supports extended attributes */ 287 CGRP_ROOT_XATTR = (1 << 2), /* supports extended attributes */
288
289 /* mount options live below bit 16 */
290 CGRP_ROOT_OPTION_MASK = (1 << 16) - 1,
291
292 CGRP_ROOT_SUBSYS_BOUND = (1 << 16), /* subsystems finished binding */
284}; 293};
285 294
286/* 295/*
@@ -291,18 +300,12 @@ enum {
291struct cgroupfs_root { 300struct cgroupfs_root {
292 struct super_block *sb; 301 struct super_block *sb;
293 302
294 /* 303 /* The bitmask of subsystems attached to this hierarchy */
295 * The bitmask of subsystems intended to be attached to this
296 * hierarchy
297 */
298 unsigned long subsys_mask; 304 unsigned long subsys_mask;
299 305
300 /* Unique id for this hierarchy. */ 306 /* Unique id for this hierarchy. */
301 int hierarchy_id; 307 int hierarchy_id;
302 308
303 /* The bitmask of subsystems currently attached to this hierarchy */
304 unsigned long actual_subsys_mask;
305
306 /* A list running through the attached subsystems */ 309 /* A list running through the attached subsystems */
307 struct list_head subsys_list; 310 struct list_head subsys_list;
308 311
@@ -315,9 +318,6 @@ struct cgroupfs_root {
315 /* A list running through the active hierarchies */ 318 /* A list running through the active hierarchies */
316 struct list_head root_list; 319 struct list_head root_list;
317 320
318 /* All cgroups on this root, cgroup_mutex protected */
319 struct list_head allcg_list;
320
321 /* Hierarchy-specific flags */ 321 /* Hierarchy-specific flags */
322 unsigned long flags; 322 unsigned long flags;
323 323
@@ -357,11 +357,10 @@ struct css_set {
357 struct list_head tasks; 357 struct list_head tasks;
358 358
359 /* 359 /*
360 * List of cg_cgroup_link objects on link chains from 360 * List of cgrp_cset_links pointing at cgroups referenced from this
361 * cgroups referenced from this css_set. Protected by 361 * css_set. Protected by css_set_lock.
362 * css_set_lock
363 */ 362 */
364 struct list_head cg_links; 363 struct list_head cgrp_links;
365 364
366 /* 365 /*
367 * Set of subsystem states, one for each subsystem. This array 366 * Set of subsystem states, one for each subsystem. This array
@@ -394,9 +393,11 @@ struct cgroup_map_cb {
394 */ 393 */
395 394
396/* cftype->flags */ 395/* cftype->flags */
397#define CFTYPE_ONLY_ON_ROOT (1U << 0) /* only create on root cg */ 396enum {
398#define CFTYPE_NOT_ON_ROOT (1U << 1) /* don't create on root cg */ 397 CFTYPE_ONLY_ON_ROOT = (1 << 0), /* only create on root cg */
399#define CFTYPE_INSANE (1U << 2) /* don't create if sane_behavior */ 398 CFTYPE_NOT_ON_ROOT = (1 << 1), /* don't create on root cg */
399 CFTYPE_INSANE = (1 << 2), /* don't create if sane_behavior */
400};
400 401
401#define MAX_CFTYPE_NAME 64 402#define MAX_CFTYPE_NAME 64
402 403
@@ -442,13 +443,13 @@ struct cftype {
442 * entry. The key/value pairs (and their ordering) should not 443 * entry. The key/value pairs (and their ordering) should not
443 * change between reboots. 444 * change between reboots.
444 */ 445 */
445 int (*read_map)(struct cgroup *cont, struct cftype *cft, 446 int (*read_map)(struct cgroup *cgrp, struct cftype *cft,
446 struct cgroup_map_cb *cb); 447 struct cgroup_map_cb *cb);
447 /* 448 /*
448 * read_seq_string() is used for outputting a simple sequence 449 * read_seq_string() is used for outputting a simple sequence
449 * using seqfile. 450 * using seqfile.
450 */ 451 */
451 int (*read_seq_string)(struct cgroup *cont, struct cftype *cft, 452 int (*read_seq_string)(struct cgroup *cgrp, struct cftype *cft,
452 struct seq_file *m); 453 struct seq_file *m);
453 454
454 ssize_t (*write)(struct cgroup *cgrp, struct cftype *cft, 455 ssize_t (*write)(struct cgroup *cgrp, struct cftype *cft,
@@ -538,10 +539,11 @@ static inline const char *cgroup_name(const struct cgroup *cgrp)
538int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); 539int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
539int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); 540int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
540 541
541int cgroup_is_removed(const struct cgroup *cgrp);
542bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor); 542bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor);
543 543
544int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen); 544int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen);
545int task_cgroup_path_from_hierarchy(struct task_struct *task, int hierarchy_id,
546 char *buf, size_t buflen);
545 547
546int cgroup_task_count(const struct cgroup *cgrp); 548int cgroup_task_count(const struct cgroup *cgrp);
547 549
@@ -646,22 +648,60 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state(
646 return cgrp->subsys[subsys_id]; 648 return cgrp->subsys[subsys_id];
647} 649}
648 650
649/* 651/**
650 * function to get the cgroup_subsys_state which allows for extra 652 * task_css_set_check - obtain a task's css_set with extra access conditions
651 * rcu_dereference_check() conditions, such as locks used during the 653 * @task: the task to obtain css_set for
652 * cgroup_subsys::attach() methods. 654 * @__c: extra condition expression to be passed to rcu_dereference_check()
655 *
656 * A task's css_set is RCU protected, initialized and exited while holding
657 * task_lock(), and can only be modified while holding both cgroup_mutex
658 * and task_lock() while the task is alive. This macro verifies that the
659 * caller is inside proper critical section and returns @task's css_set.
660 *
661 * The caller can also specify additional allowed conditions via @__c, such
662 * as locks used during the cgroup_subsys::attach() methods.
653 */ 663 */
654#ifdef CONFIG_PROVE_RCU 664#ifdef CONFIG_PROVE_RCU
655extern struct mutex cgroup_mutex; 665extern struct mutex cgroup_mutex;
656#define task_subsys_state_check(task, subsys_id, __c) \ 666#define task_css_set_check(task, __c) \
657 rcu_dereference_check((task)->cgroups->subsys[(subsys_id)], \ 667 rcu_dereference_check((task)->cgroups, \
658 lockdep_is_held(&(task)->alloc_lock) || \ 668 lockdep_is_held(&(task)->alloc_lock) || \
659 lockdep_is_held(&cgroup_mutex) || (__c)) 669 lockdep_is_held(&cgroup_mutex) || (__c))
660#else 670#else
661#define task_subsys_state_check(task, subsys_id, __c) \ 671#define task_css_set_check(task, __c) \
662 rcu_dereference((task)->cgroups->subsys[(subsys_id)]) 672 rcu_dereference((task)->cgroups)
663#endif 673#endif
664 674
675/**
676 * task_subsys_state_check - obtain css for (task, subsys) w/ extra access conds
677 * @task: the target task
678 * @subsys_id: the target subsystem ID
679 * @__c: extra condition expression to be passed to rcu_dereference_check()
680 *
681 * Return the cgroup_subsys_state for the (@task, @subsys_id) pair. The
682 * synchronization rules are the same as task_css_set_check().
683 */
684#define task_subsys_state_check(task, subsys_id, __c) \
685 task_css_set_check((task), (__c))->subsys[(subsys_id)]
686
687/**
688 * task_css_set - obtain a task's css_set
689 * @task: the task to obtain css_set for
690 *
691 * See task_css_set_check().
692 */
693static inline struct css_set *task_css_set(struct task_struct *task)
694{
695 return task_css_set_check(task, false);
696}
697
698/**
699 * task_subsys_state - obtain css for (task, subsys)
700 * @task: the target task
701 * @subsys_id: the target subsystem ID
702 *
703 * See task_subsys_state_check().
704 */
665static inline struct cgroup_subsys_state * 705static inline struct cgroup_subsys_state *
666task_subsys_state(struct task_struct *task, int subsys_id) 706task_subsys_state(struct task_struct *task, int subsys_id)
667{ 707{
@@ -674,12 +714,14 @@ static inline struct cgroup* task_cgroup(struct task_struct *task,
674 return task_subsys_state(task, subsys_id)->cgroup; 714 return task_subsys_state(task, subsys_id)->cgroup;
675} 715}
676 716
717struct cgroup *cgroup_next_sibling(struct cgroup *pos);
718
677/** 719/**
678 * cgroup_for_each_child - iterate through children of a cgroup 720 * cgroup_for_each_child - iterate through children of a cgroup
679 * @pos: the cgroup * to use as the loop cursor 721 * @pos: the cgroup * to use as the loop cursor
680 * @cgroup: cgroup whose children to walk 722 * @cgrp: cgroup whose children to walk
681 * 723 *
682 * Walk @cgroup's children. Must be called under rcu_read_lock(). A child 724 * Walk @cgrp's children. Must be called under rcu_read_lock(). A child
683 * cgroup which hasn't finished ->css_online() or already has finished 725 * cgroup which hasn't finished ->css_online() or already has finished
684 * ->css_offline() may show up during traversal and it's each subsystem's 726 * ->css_offline() may show up during traversal and it's each subsystem's
685 * responsibility to verify that each @pos is alive. 727 * responsibility to verify that each @pos is alive.
@@ -687,9 +729,15 @@ static inline struct cgroup* task_cgroup(struct task_struct *task,
687 * If a subsystem synchronizes against the parent in its ->css_online() and 729 * If a subsystem synchronizes against the parent in its ->css_online() and
688 * before starting iterating, a cgroup which finished ->css_online() is 730 * before starting iterating, a cgroup which finished ->css_online() is
689 * guaranteed to be visible in the future iterations. 731 * guaranteed to be visible in the future iterations.
732 *
733 * It is allowed to temporarily drop RCU read lock during iteration. The
734 * caller is responsible for ensuring that @pos remains accessible until
735 * the start of the next iteration by, for example, bumping the css refcnt.
690 */ 736 */
691#define cgroup_for_each_child(pos, cgroup) \ 737#define cgroup_for_each_child(pos, cgrp) \
692 list_for_each_entry_rcu(pos, &(cgroup)->children, sibling) 738 for ((pos) = list_first_or_null_rcu(&(cgrp)->children, \
739 struct cgroup, sibling); \
740 (pos); (pos) = cgroup_next_sibling((pos)))
693 741
694struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos, 742struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos,
695 struct cgroup *cgroup); 743 struct cgroup *cgroup);
@@ -748,6 +796,10 @@ struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos);
748 * Alternatively, a subsystem may choose to use a single global lock to 796 * Alternatively, a subsystem may choose to use a single global lock to
749 * synchronize ->css_online() and ->css_offline() against tree-walking 797 * synchronize ->css_online() and ->css_offline() against tree-walking
750 * operations. 798 * operations.
799 *
800 * It is allowed to temporarily drop RCU read lock during iteration. The
801 * caller is responsible for ensuring that @pos remains accessible until
802 * the start of the next iteration by, for example, bumping the css refcnt.
751 */ 803 */
752#define cgroup_for_each_descendant_pre(pos, cgroup) \ 804#define cgroup_for_each_descendant_pre(pos, cgroup) \
753 for (pos = cgroup_next_descendant_pre(NULL, (cgroup)); (pos); \ 805 for (pos = cgroup_next_descendant_pre(NULL, (cgroup)); (pos); \
@@ -771,7 +823,7 @@ struct cgroup *cgroup_next_descendant_post(struct cgroup *pos,
771 823
772/* A cgroup_iter should be treated as an opaque object */ 824/* A cgroup_iter should be treated as an opaque object */
773struct cgroup_iter { 825struct cgroup_iter {
774 struct list_head *cg_link; 826 struct list_head *cset_link;
775 struct list_head *task; 827 struct list_head *task;
776}; 828};
777 829
@@ -827,7 +879,6 @@ bool css_is_ancestor(struct cgroup_subsys_state *cg,
827 879
828/* Get id and depth of css */ 880/* Get id and depth of css */
829unsigned short css_id(struct cgroup_subsys_state *css); 881unsigned short css_id(struct cgroup_subsys_state *css);
830unsigned short css_depth(struct cgroup_subsys_state *css);
831struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id); 882struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id);
832 883
833#else /* !CONFIG_CGROUPS */ 884#else /* !CONFIG_CGROUPS */
@@ -838,8 +889,6 @@ static inline void cgroup_fork(struct task_struct *p) {}
838static inline void cgroup_post_fork(struct task_struct *p) {} 889static inline void cgroup_post_fork(struct task_struct *p) {}
839static inline void cgroup_exit(struct task_struct *p, int callbacks) {} 890static inline void cgroup_exit(struct task_struct *p, int callbacks) {}
840 891
841static inline void cgroup_lock(void) {}
842static inline void cgroup_unlock(void) {}
843static inline int cgroupstats_build(struct cgroupstats *stats, 892static inline int cgroupstats_build(struct cgroupstats *stats,
844 struct dentry *dentry) 893 struct dentry *dentry)
845{ 894{
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 11860985fecb..1ec14a732176 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -210,6 +210,10 @@ void of_fixed_clk_setup(struct device_node *np);
210 * CLK_GATE_SET_TO_DISABLE - by default this clock sets the bit at bit_idx to 210 * CLK_GATE_SET_TO_DISABLE - by default this clock sets the bit at bit_idx to
211 * enable the clock. Setting this flag does the opposite: setting the bit 211 * enable the clock. Setting this flag does the opposite: setting the bit
212 * disable the clock and clearing it enables the clock 212 * disable the clock and clearing it enables the clock
213 * CLK_GATE_HIWORD_MASK - The gate settings are only in lower 16-bit
214 * of this register, and mask of gate bits are in higher 16-bit of this
215 * register. While setting the gate bits, higher 16-bit should also be
216 * updated to indicate changing gate bits.
213 */ 217 */
214struct clk_gate { 218struct clk_gate {
215 struct clk_hw hw; 219 struct clk_hw hw;
@@ -220,6 +224,7 @@ struct clk_gate {
220}; 224};
221 225
222#define CLK_GATE_SET_TO_DISABLE BIT(0) 226#define CLK_GATE_SET_TO_DISABLE BIT(0)
227#define CLK_GATE_HIWORD_MASK BIT(1)
223 228
224extern const struct clk_ops clk_gate_ops; 229extern const struct clk_ops clk_gate_ops;
225struct clk *clk_register_gate(struct device *dev, const char *name, 230struct clk *clk_register_gate(struct device *dev, const char *name,
@@ -257,6 +262,10 @@ struct clk_div_table {
257 * Some hardware implementations gracefully handle this case and allow a 262 * Some hardware implementations gracefully handle this case and allow a
258 * zero divisor by not modifying their input clock 263 * zero divisor by not modifying their input clock
259 * (divide by one / bypass). 264 * (divide by one / bypass).
265 * CLK_DIVIDER_HIWORD_MASK - The divider settings are only in lower 16-bit
266 * of this register, and mask of divider bits are in higher 16-bit of this
267 * register. While setting the divider bits, higher 16-bit should also be
268 * updated to indicate changing divider bits.
260 */ 269 */
261struct clk_divider { 270struct clk_divider {
262 struct clk_hw hw; 271 struct clk_hw hw;
@@ -271,6 +280,7 @@ struct clk_divider {
271#define CLK_DIVIDER_ONE_BASED BIT(0) 280#define CLK_DIVIDER_ONE_BASED BIT(0)
272#define CLK_DIVIDER_POWER_OF_TWO BIT(1) 281#define CLK_DIVIDER_POWER_OF_TWO BIT(1)
273#define CLK_DIVIDER_ALLOW_ZERO BIT(2) 282#define CLK_DIVIDER_ALLOW_ZERO BIT(2)
283#define CLK_DIVIDER_HIWORD_MASK BIT(3)
274 284
275extern const struct clk_ops clk_divider_ops; 285extern const struct clk_ops clk_divider_ops;
276struct clk *clk_register_divider(struct device *dev, const char *name, 286struct clk *clk_register_divider(struct device *dev, const char *name,
@@ -299,6 +309,10 @@ struct clk *clk_register_divider_table(struct device *dev, const char *name,
299 * Flags: 309 * Flags:
300 * CLK_MUX_INDEX_ONE - register index starts at 1, not 0 310 * CLK_MUX_INDEX_ONE - register index starts at 1, not 0
301 * CLK_MUX_INDEX_BIT - register index is a single bit (power of two) 311 * CLK_MUX_INDEX_BIT - register index is a single bit (power of two)
312 * CLK_MUX_HIWORD_MASK - The mux settings are only in lower 16-bit of this
313 * register, and mask of mux bits are in higher 16-bit of this register.
314 * While setting the mux bits, higher 16-bit should also be updated to
315 * indicate changing mux bits.
302 */ 316 */
303struct clk_mux { 317struct clk_mux {
304 struct clk_hw hw; 318 struct clk_hw hw;
@@ -312,6 +326,7 @@ struct clk_mux {
312 326
313#define CLK_MUX_INDEX_ONE BIT(0) 327#define CLK_MUX_INDEX_ONE BIT(0)
314#define CLK_MUX_INDEX_BIT BIT(1) 328#define CLK_MUX_INDEX_BIT BIT(1)
329#define CLK_MUX_HIWORD_MASK BIT(2)
315 330
316extern const struct clk_ops clk_mux_ops; 331extern const struct clk_ops clk_mux_ops;
317 332
@@ -423,6 +438,17 @@ struct of_device_id;
423 438
424typedef void (*of_clk_init_cb_t)(struct device_node *); 439typedef void (*of_clk_init_cb_t)(struct device_node *);
425 440
441struct clk_onecell_data {
442 struct clk **clks;
443 unsigned int clk_num;
444};
445
446#define CLK_OF_DECLARE(name, compat, fn) \
447 static const struct of_device_id __clk_of_table_##name \
448 __used __section(__clk_of_table) \
449 = { .compatible = compat, .data = fn };
450
451#ifdef CONFIG_OF
426int of_clk_add_provider(struct device_node *np, 452int of_clk_add_provider(struct device_node *np,
427 struct clk *(*clk_src_get)(struct of_phandle_args *args, 453 struct clk *(*clk_src_get)(struct of_phandle_args *args,
428 void *data), 454 void *data),
@@ -430,19 +456,39 @@ int of_clk_add_provider(struct device_node *np,
430void of_clk_del_provider(struct device_node *np); 456void of_clk_del_provider(struct device_node *np);
431struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec, 457struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
432 void *data); 458 void *data);
433struct clk_onecell_data {
434 struct clk **clks;
435 unsigned int clk_num;
436};
437struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data); 459struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data);
438const char *of_clk_get_parent_name(struct device_node *np, int index); 460const char *of_clk_get_parent_name(struct device_node *np, int index);
439 461
440void of_clk_init(const struct of_device_id *matches); 462void of_clk_init(const struct of_device_id *matches);
441 463
442#define CLK_OF_DECLARE(name, compat, fn) \ 464#else /* !CONFIG_OF */
443 static const struct of_device_id __clk_of_table_##name \
444 __used __section(__clk_of_table) \
445 = { .compatible = compat, .data = fn };
446 465
466static inline int of_clk_add_provider(struct device_node *np,
467 struct clk *(*clk_src_get)(struct of_phandle_args *args,
468 void *data),
469 void *data)
470{
471 return 0;
472}
473#define of_clk_del_provider(np) \
474 { while (0); }
475static inline struct clk *of_clk_src_simple_get(
476 struct of_phandle_args *clkspec, void *data)
477{
478 return ERR_PTR(-ENOENT);
479}
480static inline struct clk *of_clk_src_onecell_get(
481 struct of_phandle_args *clkspec, void *data)
482{
483 return ERR_PTR(-ENOENT);
484}
485static inline const char *of_clk_get_parent_name(struct device_node *np,
486 int index)
487{
488 return NULL;
489}
490#define of_clk_init(matches) \
491 { while (0); }
492#endif /* CONFIG_OF */
447#endif /* CONFIG_COMMON_CLK */ 493#endif /* CONFIG_COMMON_CLK */
448#endif /* CLK_PROVIDER_H */ 494#endif /* CLK_PROVIDER_H */
diff --git a/include/linux/clk/tegra.h b/include/linux/clk/tegra.h
index 642789baec74..23a0ceee831f 100644
--- a/include/linux/clk/tegra.h
+++ b/include/linux/clk/tegra.h
@@ -120,9 +120,13 @@ static inline void tegra_cpu_clock_resume(void)
120} 120}
121#endif 121#endif
122 122
123#ifdef CONFIG_ARCH_TEGRA
123void tegra_periph_reset_deassert(struct clk *c); 124void tegra_periph_reset_deassert(struct clk *c);
124void tegra_periph_reset_assert(struct clk *c); 125void tegra_periph_reset_assert(struct clk *c);
125void tegra_clocks_init(void); 126#else
127static inline void tegra_periph_reset_deassert(struct clk *c) {}
128static inline void tegra_periph_reset_assert(struct clk *c) {}
129#endif
126void tegra_clocks_apply_init_table(void); 130void tegra_clocks_apply_init_table(void);
127 131
128#endif /* __LINUX_CLK_TEGRA_H_ */ 132#endif /* __LINUX_CLK_TEGRA_H_ */
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 963d71431388..0857922e8ad0 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -30,6 +30,7 @@ enum clock_event_nofitiers {
30#include <linux/notifier.h> 30#include <linux/notifier.h>
31 31
32struct clock_event_device; 32struct clock_event_device;
33struct module;
33 34
34/* Clock event mode commands */ 35/* Clock event mode commands */
35enum clock_event_mode { 36enum clock_event_mode {
@@ -83,6 +84,7 @@ enum clock_event_mode {
83 * @irq: IRQ number (only for non CPU local devices) 84 * @irq: IRQ number (only for non CPU local devices)
84 * @cpumask: cpumask to indicate for which CPUs this device works 85 * @cpumask: cpumask to indicate for which CPUs this device works
85 * @list: list head for the management code 86 * @list: list head for the management code
87 * @owner: module reference
86 */ 88 */
87struct clock_event_device { 89struct clock_event_device {
88 void (*event_handler)(struct clock_event_device *); 90 void (*event_handler)(struct clock_event_device *);
@@ -112,6 +114,7 @@ struct clock_event_device {
112 int irq; 114 int irq;
113 const struct cpumask *cpumask; 115 const struct cpumask *cpumask;
114 struct list_head list; 116 struct list_head list;
117 struct module *owner;
115} ____cacheline_aligned; 118} ____cacheline_aligned;
116 119
117/* 120/*
@@ -138,6 +141,7 @@ static inline unsigned long div_sc(unsigned long ticks, unsigned long nsec,
138extern u64 clockevent_delta2ns(unsigned long latch, 141extern u64 clockevent_delta2ns(unsigned long latch,
139 struct clock_event_device *evt); 142 struct clock_event_device *evt);
140extern void clockevents_register_device(struct clock_event_device *dev); 143extern void clockevents_register_device(struct clock_event_device *dev);
144extern int clockevents_unbind_device(struct clock_event_device *ced, int cpu);
141 145
142extern void clockevents_config(struct clock_event_device *dev, u32 freq); 146extern void clockevents_config(struct clock_event_device *dev, u32 freq);
143extern void clockevents_config_and_register(struct clock_event_device *dev, 147extern void clockevents_config_and_register(struct clock_event_device *dev,
@@ -150,7 +154,6 @@ extern void clockevents_exchange_device(struct clock_event_device *old,
150 struct clock_event_device *new); 154 struct clock_event_device *new);
151extern void clockevents_set_mode(struct clock_event_device *dev, 155extern void clockevents_set_mode(struct clock_event_device *dev,
152 enum clock_event_mode mode); 156 enum clock_event_mode mode);
153extern int clockevents_register_notifier(struct notifier_block *nb);
154extern int clockevents_program_event(struct clock_event_device *dev, 157extern int clockevents_program_event(struct clock_event_device *dev,
155 ktime_t expires, bool force); 158 ktime_t expires, bool force);
156 159
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 7279b94c01da..dbbf8aa7731b 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -21,6 +21,7 @@
21/* clocksource cycle base type */ 21/* clocksource cycle base type */
22typedef u64 cycle_t; 22typedef u64 cycle_t;
23struct clocksource; 23struct clocksource;
24struct module;
24 25
25#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA 26#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA
26#include <asm/clocksource.h> 27#include <asm/clocksource.h>
@@ -162,6 +163,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
162 * @suspend: suspend function for the clocksource, if necessary 163 * @suspend: suspend function for the clocksource, if necessary
163 * @resume: resume function for the clocksource, if necessary 164 * @resume: resume function for the clocksource, if necessary
164 * @cycle_last: most recent cycle counter value seen by ::read() 165 * @cycle_last: most recent cycle counter value seen by ::read()
166 * @owner: module reference, must be set by clocksource in modules
165 */ 167 */
166struct clocksource { 168struct clocksource {
167 /* 169 /*
@@ -195,6 +197,7 @@ struct clocksource {
195 cycle_t cs_last; 197 cycle_t cs_last;
196 cycle_t wd_last; 198 cycle_t wd_last;
197#endif 199#endif
200 struct module *owner;
198} ____cacheline_aligned; 201} ____cacheline_aligned;
199 202
200/* 203/*
@@ -207,6 +210,7 @@ struct clocksource {
207#define CLOCK_SOURCE_VALID_FOR_HRES 0x20 210#define CLOCK_SOURCE_VALID_FOR_HRES 0x20
208#define CLOCK_SOURCE_UNSTABLE 0x40 211#define CLOCK_SOURCE_UNSTABLE 0x40
209#define CLOCK_SOURCE_SUSPEND_NONSTOP 0x80 212#define CLOCK_SOURCE_SUSPEND_NONSTOP 0x80
213#define CLOCK_SOURCE_RESELECT 0x100
210 214
211/* simplify initialization of mask field */ 215/* simplify initialization of mask field */
212#define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1) 216#define CLOCKSOURCE_MASK(bits) (cycle_t)((bits) < 64 ? ((1ULL<<(bits))-1) : -1)
@@ -279,7 +283,7 @@ static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift)
279 283
280 284
281extern int clocksource_register(struct clocksource*); 285extern int clocksource_register(struct clocksource*);
282extern void clocksource_unregister(struct clocksource*); 286extern int clocksource_unregister(struct clocksource*);
283extern void clocksource_touch_watchdog(void); 287extern void clocksource_touch_watchdog(void);
284extern struct clocksource* clocksource_get_next(void); 288extern struct clocksource* clocksource_get_next(void);
285extern void clocksource_change_rating(struct clocksource *cs, int rating); 289extern void clocksource_change_rating(struct clocksource *cs, int rating);
@@ -321,7 +325,7 @@ static inline void __clocksource_updatefreq_khz(struct clocksource *cs, u32 khz)
321} 325}
322 326
323 327
324extern void timekeeping_notify(struct clocksource *clock); 328extern int timekeeping_notify(struct clocksource *clock);
325 329
326extern cycle_t clocksource_mmio_readl_up(struct clocksource *); 330extern cycle_t clocksource_mmio_readl_up(struct clocksource *);
327extern cycle_t clocksource_mmio_readl_down(struct clocksource *); 331extern cycle_t clocksource_mmio_readl_down(struct clocksource *);
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 9f3c7e81270a..944f283f01c4 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -6,9 +6,8 @@
6 * definitions of processors. 6 * definitions of processors.
7 * 7 *
8 * Basic handling of the devices is done in drivers/base/cpu.c 8 * Basic handling of the devices is done in drivers/base/cpu.c
9 * and system devices are handled in drivers/base/sys.c.
10 * 9 *
11 * CPUs are exported via sysfs in the class/cpu/devices/ 10 * CPUs are exported via sysfs in the devices/system/cpu
12 * directory. 11 * directory.
13 */ 12 */
14#ifndef _LINUX_CPU_H_ 13#ifndef _LINUX_CPU_H_
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h
index 282e27028418..a5d52eea8232 100644
--- a/include/linux/cpu_cooling.h
+++ b/include/linux/cpu_cooling.h
@@ -41,7 +41,7 @@ cpufreq_cooling_register(const struct cpumask *clip_cpus);
41 */ 41 */
42void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); 42void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
43 43
44unsigned long cpufreq_cooling_get_level(unsigned int, unsigned int); 44unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq);
45#else /* !CONFIG_CPU_THERMAL */ 45#else /* !CONFIG_CPU_THERMAL */
46static inline struct thermal_cooling_device * 46static inline struct thermal_cooling_device *
47cpufreq_cooling_register(const struct cpumask *clip_cpus) 47cpufreq_cooling_register(const struct cpumask *clip_cpus)
@@ -54,7 +54,7 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
54 return; 54 return;
55} 55}
56static inline 56static inline
57unsigned long cpufreq_cooling_get_level(unsigned int, unsigned int) 57unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq)
58{ 58{
59 return THERMAL_CSTATE_INVALID; 59 return THERMAL_CSTATE_INVALID;
60} 60}
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 037d36ae63e5..90d5a15120d5 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -1,8 +1,8 @@
1/* 1/*
2 * linux/include/linux/cpufreq.h 2 * linux/include/linux/cpufreq.h
3 * 3 *
4 * Copyright (C) 2001 Russell King 4 * Copyright (C) 2001 Russell King
5 * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de> 5 * (C) 2002 - 2003 Dominik Brodowski <linux@brodo.de>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as 8 * it under the terms of the GNU General Public License version 2 as
@@ -26,7 +26,6 @@
26/* Print length for names. Extra 1 space for accomodating '\n' in prints */ 26/* Print length for names. Extra 1 space for accomodating '\n' in prints */
27#define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1) 27#define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1)
28 28
29
30/********************************************************************* 29/*********************************************************************
31 * CPUFREQ NOTIFIER INTERFACE * 30 * CPUFREQ NOTIFIER INTERFACE *
32 *********************************************************************/ 31 *********************************************************************/
@@ -71,6 +70,10 @@ struct cpufreq_governor;
71 70
72/* /sys/devices/system/cpu/cpufreq: entry point for global variables */ 71/* /sys/devices/system/cpu/cpufreq: entry point for global variables */
73extern struct kobject *cpufreq_global_kobject; 72extern struct kobject *cpufreq_global_kobject;
73int cpufreq_get_global_kobject(void);
74void cpufreq_put_global_kobject(void);
75int cpufreq_sysfs_create_file(const struct attribute *attr);
76void cpufreq_sysfs_remove_file(const struct attribute *attr);
74 77
75#define CPUFREQ_ETERNAL (-1) 78#define CPUFREQ_ETERNAL (-1)
76struct cpufreq_cpuinfo { 79struct cpufreq_cpuinfo {
@@ -107,6 +110,7 @@ struct cpufreq_policy {
107 unsigned int policy; /* see above */ 110 unsigned int policy; /* see above */
108 struct cpufreq_governor *governor; /* see below */ 111 struct cpufreq_governor *governor; /* see below */
109 void *governor_data; 112 void *governor_data;
113 bool governor_enabled; /* governor start/stop flag */
110 114
111 struct work_struct update; /* if update_policy() needs to be 115 struct work_struct update; /* if update_policy() needs to be
112 * called, but you're in IRQ context */ 116 * called, but you're in IRQ context */
@@ -115,6 +119,7 @@ struct cpufreq_policy {
115 119
116 struct kobject kobj; 120 struct kobject kobj;
117 struct completion kobj_unregister; 121 struct completion kobj_unregister;
122 int transition_ongoing; /* Tracks transition status */
118}; 123};
119 124
120#define CPUFREQ_ADJUST (0) 125#define CPUFREQ_ADJUST (0)
@@ -148,17 +153,18 @@ struct cpufreq_freqs {
148 u8 flags; /* flags of cpufreq_driver, see below. */ 153 u8 flags; /* flags of cpufreq_driver, see below. */
149}; 154};
150 155
151
152/** 156/**
153 * cpufreq_scale - "old * mult / div" calculation for large values (32-bit-arch safe) 157 * cpufreq_scale - "old * mult / div" calculation for large values (32-bit-arch
158 * safe)
154 * @old: old value 159 * @old: old value
155 * @div: divisor 160 * @div: divisor
156 * @mult: multiplier 161 * @mult: multiplier
157 * 162 *
158 * 163 *
159 * new = old * mult / div 164 * new = old * mult / div
160 */ 165 */
161static inline unsigned long cpufreq_scale(unsigned long old, u_int div, u_int mult) 166static inline unsigned long cpufreq_scale(unsigned long old, u_int div,
167 u_int mult)
162{ 168{
163#if BITS_PER_LONG == 32 169#if BITS_PER_LONG == 32
164 170
@@ -211,14 +217,12 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
211 unsigned int target_freq, 217 unsigned int target_freq,
212 unsigned int relation); 218 unsigned int relation);
213 219
214
215extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy, 220extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy,
216 unsigned int cpu); 221 unsigned int cpu);
217 222
218int cpufreq_register_governor(struct cpufreq_governor *governor); 223int cpufreq_register_governor(struct cpufreq_governor *governor);
219void cpufreq_unregister_governor(struct cpufreq_governor *governor); 224void cpufreq_unregister_governor(struct cpufreq_governor *governor);
220 225
221
222/********************************************************************* 226/*********************************************************************
223 * CPUFREQ DRIVER INTERFACE * 227 * CPUFREQ DRIVER INTERFACE *
224 *********************************************************************/ 228 *********************************************************************/
@@ -229,7 +233,7 @@ void cpufreq_unregister_governor(struct cpufreq_governor *governor);
229struct freq_attr; 233struct freq_attr;
230 234
231struct cpufreq_driver { 235struct cpufreq_driver {
232 struct module *owner; 236 struct module *owner;
233 char name[CPUFREQ_NAME_LEN]; 237 char name[CPUFREQ_NAME_LEN];
234 u8 flags; 238 u8 flags;
235 /* 239 /*
@@ -277,11 +281,11 @@ struct cpufreq_driver {
277int cpufreq_register_driver(struct cpufreq_driver *driver_data); 281int cpufreq_register_driver(struct cpufreq_driver *driver_data);
278int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); 282int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
279 283
280
281void cpufreq_notify_transition(struct cpufreq_policy *policy, 284void cpufreq_notify_transition(struct cpufreq_policy *policy,
282 struct cpufreq_freqs *freqs, unsigned int state); 285 struct cpufreq_freqs *freqs, unsigned int state);
283 286
284static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, unsigned int min, unsigned int max) 287static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
288 unsigned int min, unsigned int max)
285{ 289{
286 if (policy->min < min) 290 if (policy->min < min)
287 policy->min = min; 291 policy->min = min;
@@ -337,12 +341,16 @@ const char *cpufreq_get_current_driver(void);
337/********************************************************************* 341/*********************************************************************
338 * CPUFREQ 2.6. INTERFACE * 342 * CPUFREQ 2.6. INTERFACE *
339 *********************************************************************/ 343 *********************************************************************/
344u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy);
340int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); 345int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
341int cpufreq_update_policy(unsigned int cpu); 346int cpufreq_update_policy(unsigned int cpu);
342bool have_governor_per_policy(void); 347bool have_governor_per_policy(void);
348struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);
343 349
344#ifdef CONFIG_CPU_FREQ 350#ifdef CONFIG_CPU_FREQ
345/* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ 351/*
352 * query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it
353 */
346unsigned int cpufreq_get(unsigned int cpu); 354unsigned int cpufreq_get(unsigned int cpu);
347#else 355#else
348static inline unsigned int cpufreq_get(unsigned int cpu) 356static inline unsigned int cpufreq_get(unsigned int cpu)
@@ -351,7 +359,9 @@ static inline unsigned int cpufreq_get(unsigned int cpu)
351} 359}
352#endif 360#endif
353 361
354/* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ 362/*
363 * query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it
364 */
355#ifdef CONFIG_CPU_FREQ 365#ifdef CONFIG_CPU_FREQ
356unsigned int cpufreq_quick_get(unsigned int cpu); 366unsigned int cpufreq_quick_get(unsigned int cpu);
357unsigned int cpufreq_quick_get_max(unsigned int cpu); 367unsigned int cpufreq_quick_get_max(unsigned int cpu);
@@ -366,16 +376,14 @@ static inline unsigned int cpufreq_quick_get_max(unsigned int cpu)
366} 376}
367#endif 377#endif
368 378
369
370/********************************************************************* 379/*********************************************************************
371 * CPUFREQ DEFAULT GOVERNOR * 380 * CPUFREQ DEFAULT GOVERNOR *
372 *********************************************************************/ 381 *********************************************************************/
373 382
374
375/* 383/*
376 Performance governor is fallback governor if any other gov failed to 384 * Performance governor is fallback governor if any other gov failed to auto
377 auto load due latency restrictions 385 * load due latency restrictions
378*/ 386 */
379#ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE 387#ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE
380extern struct cpufreq_governor cpufreq_gov_performance; 388extern struct cpufreq_governor cpufreq_gov_performance;
381#endif 389#endif
@@ -395,7 +403,6 @@ extern struct cpufreq_governor cpufreq_gov_conservative;
395#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_conservative) 403#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_conservative)
396#endif 404#endif
397 405
398
399/********************************************************************* 406/*********************************************************************
400 * FREQUENCY TABLE HELPERS * 407 * FREQUENCY TABLE HELPERS *
401 *********************************************************************/ 408 *********************************************************************/
@@ -404,7 +411,7 @@ extern struct cpufreq_governor cpufreq_gov_conservative;
404#define CPUFREQ_TABLE_END ~1 411#define CPUFREQ_TABLE_END ~1
405 412
406struct cpufreq_frequency_table { 413struct cpufreq_frequency_table {
407 unsigned int index; /* any */ 414 unsigned int driver_data; /* driver specific data, not used by core */
408 unsigned int frequency; /* kHz - doesn't need to be in ascending 415 unsigned int frequency; /* kHz - doesn't need to be in ascending
409 * order */ 416 * order */
410}; 417};
@@ -432,4 +439,7 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
432void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); 439void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy);
433 440
434void cpufreq_frequency_table_put_attr(unsigned int cpu); 441void cpufreq_frequency_table_put_attr(unsigned int cpu);
442
443ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
444
435#endif /* _LINUX_CPUFREQ_H */ 445#endif /* _LINUX_CPUFREQ_H */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 8f0406230a0a..0bc4b74668e9 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -111,6 +111,9 @@ struct cpuidle_driver {
111 struct cpuidle_state states[CPUIDLE_STATE_MAX]; 111 struct cpuidle_state states[CPUIDLE_STATE_MAX];
112 int state_count; 112 int state_count;
113 int safe_state_index; 113 int safe_state_index;
114
115 /* the driver handles the cpus in cpumask */
116 struct cpumask *cpumask;
114}; 117};
115 118
116#ifdef CONFIG_CPU_IDLE 119#ifdef CONFIG_CPU_IDLE
@@ -135,9 +138,6 @@ extern void cpuidle_disable_device(struct cpuidle_device *dev);
135extern int cpuidle_play_dead(void); 138extern int cpuidle_play_dead(void);
136 139
137extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev); 140extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev);
138extern int cpuidle_register_cpu_driver(struct cpuidle_driver *drv, int cpu);
139extern void cpuidle_unregister_cpu_driver(struct cpuidle_driver *drv, int cpu);
140
141#else 141#else
142static inline void disable_cpuidle(void) { } 142static inline void disable_cpuidle(void) { }
143static inline int cpuidle_idle_call(void) { return -ENODEV; } 143static inline int cpuidle_idle_call(void) { return -ENODEV; }
diff --git a/include/linux/crc-t10dif.h b/include/linux/crc-t10dif.h
index a9c96d865ee7..b3cb71f0d3b0 100644
--- a/include/linux/crc-t10dif.h
+++ b/include/linux/crc-t10dif.h
@@ -3,6 +3,10 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#define CRC_T10DIF_DIGEST_SIZE 2
7#define CRC_T10DIF_BLOCK_SIZE 1
8
9__u16 crc_t10dif_generic(__u16 crc, const unsigned char *buffer, size_t len);
6__u16 crc_t10dif(unsigned char const *, size_t); 10__u16 crc_t10dif(unsigned char const *, size_t);
7 11
8#endif 12#endif
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 1a6bb81f0fe5..3092df3614ae 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -146,10 +146,8 @@ enum dentry_d_lock_class
146struct dentry_operations { 146struct dentry_operations {
147 int (*d_revalidate)(struct dentry *, unsigned int); 147 int (*d_revalidate)(struct dentry *, unsigned int);
148 int (*d_weak_revalidate)(struct dentry *, unsigned int); 148 int (*d_weak_revalidate)(struct dentry *, unsigned int);
149 int (*d_hash)(const struct dentry *, const struct inode *, 149 int (*d_hash)(const struct dentry *, struct qstr *);
150 struct qstr *); 150 int (*d_compare)(const struct dentry *, const struct dentry *,
151 int (*d_compare)(const struct dentry *, const struct inode *,
152 const struct dentry *, const struct inode *,
153 unsigned int, const char *, const struct qstr *); 151 unsigned int, const char *, const struct qstr *);
154 int (*d_delete)(const struct dentry *); 152 int (*d_delete)(const struct dentry *);
155 void (*d_release)(struct dentry *); 153 void (*d_release)(struct dentry *);
@@ -246,6 +244,8 @@ extern struct dentry * d_make_root(struct inode *);
246/* <clickety>-<click> the ramfs-type tree */ 244/* <clickety>-<click> the ramfs-type tree */
247extern void d_genocide(struct dentry *); 245extern void d_genocide(struct dentry *);
248 246
247extern void d_tmpfile(struct dentry *, struct inode *);
248
249extern struct dentry *d_find_alias(struct inode *); 249extern struct dentry *d_find_alias(struct inode *);
250extern void d_prune_aliases(struct inode *); 250extern void d_prune_aliases(struct inode *);
251 251
@@ -300,8 +300,7 @@ extern struct dentry *d_lookup(const struct dentry *, const struct qstr *);
300extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *); 300extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *);
301extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *); 301extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *);
302extern struct dentry *__d_lookup_rcu(const struct dentry *parent, 302extern struct dentry *__d_lookup_rcu(const struct dentry *parent,
303 const struct qstr *name, 303 const struct qstr *name, unsigned *seq);
304 unsigned *seq, struct inode *inode);
305 304
306/** 305/**
307 * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok 306 * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok
@@ -325,6 +324,11 @@ static inline int __d_rcu_to_refcount(struct dentry *dentry, unsigned seq)
325 return ret; 324 return ret;
326} 325}
327 326
327static inline unsigned d_count(struct dentry *dentry)
328{
329 return dentry->d_count;
330}
331
328/* validate "insecure" dentry pointer */ 332/* validate "insecure" dentry pointer */
329extern int d_validate(struct dentry *, struct dentry *); 333extern int d_validate(struct dentry *, struct dentry *);
330 334
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
index 21ca773f77bf..822c1354f3a6 100644
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -51,7 +51,7 @@ struct task_struct;
51extern void debug_show_all_locks(void); 51extern void debug_show_all_locks(void);
52extern void debug_show_held_locks(struct task_struct *task); 52extern void debug_show_held_locks(struct task_struct *task);
53extern void debug_check_no_locks_freed(const void *from, unsigned long len); 53extern void debug_check_no_locks_freed(const void *from, unsigned long len);
54extern void debug_check_no_locks_held(struct task_struct *task); 54extern void debug_check_no_locks_held(void);
55#else 55#else
56static inline void debug_show_all_locks(void) 56static inline void debug_show_all_locks(void)
57{ 57{
@@ -67,7 +67,7 @@ debug_check_no_locks_freed(const void *from, unsigned long len)
67} 67}
68 68
69static inline void 69static inline void
70debug_check_no_locks_held(struct task_struct *task) 70debug_check_no_locks_held(void)
71{ 71{
72} 72}
73#endif 73#endif
diff --git a/include/linux/decompress/unlz4.h b/include/linux/decompress/unlz4.h
new file mode 100644
index 000000000000..d5b68bf3ec92
--- /dev/null
+++ b/include/linux/decompress/unlz4.h
@@ -0,0 +1,10 @@
1#ifndef DECOMPRESS_UNLZ4_H
2#define DECOMPRESS_UNLZ4_H
3
4int unlz4(unsigned char *inbuf, int len,
5 int(*fill)(void*, unsigned int),
6 int(*flush)(void*, unsigned int),
7 unsigned char *output,
8 int *pos,
9 void(*error)(char *x));
10#endif
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index fe8c4476f7e4..5f1ab92107e6 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -181,6 +181,8 @@ extern struct devfreq *devfreq_add_device(struct device *dev,
181 const char *governor_name, 181 const char *governor_name,
182 void *data); 182 void *data);
183extern int devfreq_remove_device(struct devfreq *devfreq); 183extern int devfreq_remove_device(struct devfreq *devfreq);
184
185/* Supposed to be called by PM_SLEEP/PM_RUNTIME callbacks */
184extern int devfreq_suspend_device(struct devfreq *devfreq); 186extern int devfreq_suspend_device(struct devfreq *devfreq);
185extern int devfreq_resume_device(struct devfreq *devfreq); 187extern int devfreq_resume_device(struct devfreq *devfreq);
186 188
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 3cd32478f2fd..e151d4c9298d 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -446,9 +446,9 @@ int __must_check dm_set_target_max_io_len(struct dm_target *ti, sector_t len);
446/* 446/*
447 * Table reference counting. 447 * Table reference counting.
448 */ 448 */
449struct dm_table *dm_get_live_table(struct mapped_device *md); 449struct dm_table *dm_get_live_table(struct mapped_device *md, int *srcu_idx);
450void dm_table_get(struct dm_table *t); 450void dm_put_live_table(struct mapped_device *md, int srcu_idx);
451void dm_table_put(struct dm_table *t); 451void dm_sync_table(struct mapped_device *md);
452 452
453/* 453/*
454 * Queries 454 * Queries
diff --git a/include/linux/device.h b/include/linux/device.h
index 9d4835a8f8b8..bcf8c0d4cd98 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -71,6 +71,10 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
71 * the specific driver's probe to initial the matched device. 71 * the specific driver's probe to initial the matched device.
72 * @remove: Called when a device removed from this bus. 72 * @remove: Called when a device removed from this bus.
73 * @shutdown: Called at shut-down time to quiesce the device. 73 * @shutdown: Called at shut-down time to quiesce the device.
74 *
75 * @online: Called to put the device back online (after offlining it).
76 * @offline: Called to put the device offline for hot-removal. May fail.
77 *
74 * @suspend: Called when a device on this bus wants to go to sleep mode. 78 * @suspend: Called when a device on this bus wants to go to sleep mode.
75 * @resume: Called to bring a device on this bus out of sleep mode. 79 * @resume: Called to bring a device on this bus out of sleep mode.
76 * @pm: Power management operations of this bus, callback the specific 80 * @pm: Power management operations of this bus, callback the specific
@@ -105,6 +109,9 @@ struct bus_type {
105 int (*remove)(struct device *dev); 109 int (*remove)(struct device *dev);
106 void (*shutdown)(struct device *dev); 110 void (*shutdown)(struct device *dev);
107 111
112 int (*online)(struct device *dev);
113 int (*offline)(struct device *dev);
114
108 int (*suspend)(struct device *dev, pm_message_t state); 115 int (*suspend)(struct device *dev, pm_message_t state);
109 int (*resume)(struct device *dev); 116 int (*resume)(struct device *dev);
110 117
@@ -652,6 +659,9 @@ struct acpi_dev_node {
652 * device (i.e. the bus driver that discovered the device). 659 * device (i.e. the bus driver that discovered the device).
653 * @iommu_group: IOMMU group the device belongs to. 660 * @iommu_group: IOMMU group the device belongs to.
654 * 661 *
662 * @offline_disabled: If set, the device is permanently online.
663 * @offline: Set after successful invocation of bus type's .offline().
664 *
655 * At the lowest level, every device in a Linux system is represented by an 665 * At the lowest level, every device in a Linux system is represented by an
656 * instance of struct device. The device structure contains the information 666 * instance of struct device. The device structure contains the information
657 * that the device model core needs to model the system. Most subsystems, 667 * that the device model core needs to model the system. Most subsystems,
@@ -723,6 +733,9 @@ struct device {
723 733
724 void (*release)(struct device *dev); 734 void (*release)(struct device *dev);
725 struct iommu_group *iommu_group; 735 struct iommu_group *iommu_group;
736
737 bool offline_disabled:1;
738 bool offline:1;
726}; 739};
727 740
728static inline struct device *kobj_to_dev(struct kobject *kobj) 741static inline struct device *kobj_to_dev(struct kobject *kobj)
@@ -859,6 +872,15 @@ extern const char *device_get_devnode(struct device *dev,
859extern void *dev_get_drvdata(const struct device *dev); 872extern void *dev_get_drvdata(const struct device *dev);
860extern int dev_set_drvdata(struct device *dev, void *data); 873extern int dev_set_drvdata(struct device *dev, void *data);
861 874
875static inline bool device_supports_offline(struct device *dev)
876{
877 return dev->bus && dev->bus->offline && dev->bus->online;
878}
879
880extern void lock_device_hotplug(void);
881extern void unlock_device_hotplug(void);
882extern int device_offline(struct device *dev);
883extern int device_online(struct device *dev);
862/* 884/*
863 * Root device objects for grouping under /sys/devices 885 * Root device objects for grouping under /sys/devices
864 */ 886 */
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 96d3e4ab11a9..cb286b1acdb6 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -66,7 +66,6 @@ enum dma_transaction_type {
66 DMA_PQ, 66 DMA_PQ,
67 DMA_XOR_VAL, 67 DMA_XOR_VAL,
68 DMA_PQ_VAL, 68 DMA_PQ_VAL,
69 DMA_MEMSET,
70 DMA_INTERRUPT, 69 DMA_INTERRUPT,
71 DMA_SG, 70 DMA_SG,
72 DMA_PRIVATE, 71 DMA_PRIVATE,
@@ -520,7 +519,6 @@ struct dma_tx_state {
520 * @device_prep_dma_xor_val: prepares a xor validation operation 519 * @device_prep_dma_xor_val: prepares a xor validation operation
521 * @device_prep_dma_pq: prepares a pq operation 520 * @device_prep_dma_pq: prepares a pq operation
522 * @device_prep_dma_pq_val: prepares a pqzero_sum operation 521 * @device_prep_dma_pq_val: prepares a pqzero_sum operation
523 * @device_prep_dma_memset: prepares a memset operation
524 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation 522 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation
525 * @device_prep_slave_sg: prepares a slave dma operation 523 * @device_prep_slave_sg: prepares a slave dma operation
526 * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio. 524 * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio.
@@ -573,9 +571,6 @@ struct dma_device {
573 struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src, 571 struct dma_chan *chan, dma_addr_t *pq, dma_addr_t *src,
574 unsigned int src_cnt, const unsigned char *scf, size_t len, 572 unsigned int src_cnt, const unsigned char *scf, size_t len,
575 enum sum_check_flags *pqres, unsigned long flags); 573 enum sum_check_flags *pqres, unsigned long flags);
576 struct dma_async_tx_descriptor *(*device_prep_dma_memset)(
577 struct dma_chan *chan, dma_addr_t dest, int value, size_t len,
578 unsigned long flags);
579 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)( 574 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
580 struct dma_chan *chan, unsigned long flags); 575 struct dma_chan *chan, unsigned long flags);
581 struct dma_async_tx_descriptor *(*device_prep_dma_sg)( 576 struct dma_async_tx_descriptor *(*device_prep_dma_sg)(
diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h
index 07261d52a6df..1f79b20918b1 100644
--- a/include/linux/dw_apb_timer.h
+++ b/include/linux/dw_apb_timer.h
@@ -51,6 +51,5 @@ dw_apb_clocksource_init(unsigned rating, const char *name, void __iomem *base,
51void dw_apb_clocksource_register(struct dw_apb_clocksource *dw_cs); 51void dw_apb_clocksource_register(struct dw_apb_clocksource *dw_cs);
52void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs); 52void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs);
53cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs); 53cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs);
54void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs);
55 54
56#endif /* __DW_APB_TIMER_H__ */ 55#endif /* __DW_APB_TIMER_H__ */
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 21ae6b3c0359..5f8f176154f7 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -594,8 +594,8 @@ extern u64 efi_mem_attribute (unsigned long phys_addr, unsigned long size);
594extern int __init efi_uart_console_only (void); 594extern int __init efi_uart_console_only (void);
595extern void efi_initialize_iomem_resources(struct resource *code_resource, 595extern void efi_initialize_iomem_resources(struct resource *code_resource,
596 struct resource *data_resource, struct resource *bss_resource); 596 struct resource *data_resource, struct resource *bss_resource);
597extern unsigned long efi_get_time(void); 597extern void efi_get_time(struct timespec *now);
598extern int efi_set_rtc_mmss(unsigned long nowtime); 598extern int efi_set_rtc_mmss(const struct timespec *now);
599extern void efi_reserve_boot_services(void); 599extern void efi_reserve_boot_services(void);
600extern struct efi_memory_map memmap; 600extern struct efi_memory_map memmap;
601 601
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index acd0312d46fb..306dd8cd0b6f 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -7,6 +7,7 @@
7#ifdef CONFIG_BLOCK 7#ifdef CONFIG_BLOCK
8 8
9struct io_cq; 9struct io_cq;
10struct elevator_type;
10 11
11typedef int (elevator_merge_fn) (struct request_queue *, struct request **, 12typedef int (elevator_merge_fn) (struct request_queue *, struct request **,
12 struct bio *); 13 struct bio *);
@@ -35,7 +36,8 @@ typedef void (elevator_put_req_fn) (struct request *);
35typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *); 36typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *);
36typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *); 37typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *);
37 38
38typedef int (elevator_init_fn) (struct request_queue *); 39typedef int (elevator_init_fn) (struct request_queue *,
40 struct elevator_type *e);
39typedef void (elevator_exit_fn) (struct elevator_queue *); 41typedef void (elevator_exit_fn) (struct elevator_queue *);
40 42
41struct elevator_ops 43struct elevator_ops
@@ -155,6 +157,8 @@ extern int elevator_init(struct request_queue *, char *);
155extern void elevator_exit(struct elevator_queue *); 157extern void elevator_exit(struct elevator_queue *);
156extern int elevator_change(struct request_queue *, const char *); 158extern int elevator_change(struct request_queue *, const char *);
157extern bool elv_rq_merge_ok(struct request *, struct bio *); 159extern bool elv_rq_merge_ok(struct request *, struct bio *);
160extern struct elevator_queue *elevator_alloc(struct request_queue *,
161 struct elevator_type *);
158 162
159/* 163/*
160 * Helper functions. 164 * Helper functions.
diff --git a/include/linux/err.h b/include/linux/err.h
index f2edce25a76b..221fcfb676c4 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -24,17 +24,17 @@ static inline void * __must_check ERR_PTR(long error)
24 return (void *) error; 24 return (void *) error;
25} 25}
26 26
27static inline long __must_check PTR_ERR(const void *ptr) 27static inline long __must_check PTR_ERR(__force const void *ptr)
28{ 28{
29 return (long) ptr; 29 return (long) ptr;
30} 30}
31 31
32static inline long __must_check IS_ERR(const void *ptr) 32static inline long __must_check IS_ERR(__force const void *ptr)
33{ 33{
34 return IS_ERR_VALUE((unsigned long)ptr); 34 return IS_ERR_VALUE((unsigned long)ptr);
35} 35}
36 36
37static inline long __must_check IS_ERR_OR_NULL(const void *ptr) 37static inline long __must_check IS_ERR_OR_NULL(__force const void *ptr)
38{ 38{
39 return !ptr || IS_ERR_VALUE((unsigned long)ptr); 39 return !ptr || IS_ERR_VALUE((unsigned long)ptr);
40} 40}
@@ -46,13 +46,13 @@ static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
46 * Explicitly cast an error-valued pointer to another pointer type in such a 46 * Explicitly cast an error-valued pointer to another pointer type in such a
47 * way as to make it clear that's what's going on. 47 * way as to make it clear that's what's going on.
48 */ 48 */
49static inline void * __must_check ERR_CAST(const void *ptr) 49static inline void * __must_check ERR_CAST(__force const void *ptr)
50{ 50{
51 /* cast away the const */ 51 /* cast away the const */
52 return (void *) ptr; 52 return (void *) ptr;
53} 53}
54 54
55static inline int __must_check PTR_RET(const void *ptr) 55static inline int __must_check PTR_RET(__force const void *ptr)
56{ 56{
57 if (IS_ERR(ptr)) 57 if (IS_ERR(ptr))
58 return PTR_ERR(ptr); 58 return PTR_ERR(ptr);
diff --git a/include/linux/fb.h b/include/linux/fb.h
index d49c60f5aa4c..ffac70aab3e9 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -624,7 +624,7 @@ extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u3
624extern void fb_set_suspend(struct fb_info *info, int state); 624extern void fb_set_suspend(struct fb_info *info, int state);
625extern int fb_get_color_depth(struct fb_var_screeninfo *var, 625extern int fb_get_color_depth(struct fb_var_screeninfo *var,
626 struct fb_fix_screeninfo *fix); 626 struct fb_fix_screeninfo *fix);
627extern int fb_get_options(char *name, char **option); 627extern int fb_get_options(const char *name, char **option);
628extern int fb_new_modelist(struct fb_info *info); 628extern int fb_new_modelist(struct fb_info *info);
629 629
630extern struct fb_info *registered_fb[FB_MAX]; 630extern struct fb_info *registered_fb[FB_MAX];
diff --git a/include/linux/filter.h b/include/linux/filter.h
index f65f5a69db8f..a6ac84871d6d 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -59,10 +59,10 @@ extern void bpf_jit_free(struct sk_filter *fp);
59static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, 59static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen,
60 u32 pass, void *image) 60 u32 pass, void *image)
61{ 61{
62 pr_err("flen=%u proglen=%u pass=%u image=%p\n", 62 pr_err("flen=%u proglen=%u pass=%u image=%pK\n",
63 flen, proglen, pass, image); 63 flen, proglen, pass, image);
64 if (image) 64 if (image)
65 print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_ADDRESS, 65 print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_OFFSET,
66 16, 1, image, proglen, false); 66 16, 1, image, proglen, false);
67} 67}
68#define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns) 68#define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns)
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index 191501afd7fb..3b0e820375ab 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -251,8 +251,10 @@ struct ieee1394_device_id;
251 251
252struct fw_driver { 252struct fw_driver {
253 struct device_driver driver; 253 struct device_driver driver;
254 int (*probe)(struct fw_unit *unit, const struct ieee1394_device_id *id);
254 /* Called when the parent device sits through a bus reset. */ 255 /* Called when the parent device sits through a bus reset. */
255 void (*update)(struct fw_unit *unit); 256 void (*update)(struct fw_unit *unit);
257 void (*remove)(struct fw_unit *unit);
256 const struct ieee1394_device_id *id_table; 258 const struct ieee1394_device_id *id_table;
257}; 259};
258 260
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index e70df40d84f6..7fd81b8c4897 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -3,6 +3,7 @@
3#ifndef FREEZER_H_INCLUDED 3#ifndef FREEZER_H_INCLUDED
4#define FREEZER_H_INCLUDED 4#define FREEZER_H_INCLUDED
5 5
6#include <linux/debug_locks.h>
6#include <linux/sched.h> 7#include <linux/sched.h>
7#include <linux/wait.h> 8#include <linux/wait.h>
8#include <linux/atomic.h> 9#include <linux/atomic.h>
@@ -46,7 +47,11 @@ extern int freeze_kernel_threads(void);
46extern void thaw_processes(void); 47extern void thaw_processes(void);
47extern void thaw_kernel_threads(void); 48extern void thaw_kernel_threads(void);
48 49
49static inline bool try_to_freeze(void) 50/*
51 * DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION
52 * If try_to_freeze causes a lockdep warning it means the caller may deadlock
53 */
54static inline bool try_to_freeze_unsafe(void)
50{ 55{
51 might_sleep(); 56 might_sleep();
52 if (likely(!freezing(current))) 57 if (likely(!freezing(current)))
@@ -54,6 +59,13 @@ static inline bool try_to_freeze(void)
54 return __refrigerator(false); 59 return __refrigerator(false);
55} 60}
56 61
62static inline bool try_to_freeze(void)
63{
64 if (!(current->flags & PF_NOFREEZE))
65 debug_check_no_locks_held();
66 return try_to_freeze_unsafe();
67}
68
57extern bool freeze_task(struct task_struct *p); 69extern bool freeze_task(struct task_struct *p);
58extern bool set_freezable(void); 70extern bool set_freezable(void);
59 71
@@ -115,6 +127,14 @@ static inline void freezer_count(void)
115 try_to_freeze(); 127 try_to_freeze();
116} 128}
117 129
130/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */
131static inline void freezer_count_unsafe(void)
132{
133 current->flags &= ~PF_FREEZER_SKIP;
134 smp_mb();
135 try_to_freeze_unsafe();
136}
137
118/** 138/**
119 * freezer_should_skip - whether to skip a task when determining frozen 139 * freezer_should_skip - whether to skip a task when determining frozen
120 * state is reached 140 * state is reached
@@ -139,28 +159,86 @@ static inline bool freezer_should_skip(struct task_struct *p)
139} 159}
140 160
141/* 161/*
142 * These macros are intended to be used whenever you want allow a sleeping 162 * These functions are intended to be used whenever you want allow a sleeping
143 * task to be frozen. Note that neither return any clear indication of 163 * task to be frozen. Note that neither return any clear indication of
144 * whether a freeze event happened while in this function. 164 * whether a freeze event happened while in this function.
145 */ 165 */
146 166
147/* Like schedule(), but should not block the freezer. */ 167/* Like schedule(), but should not block the freezer. */
148#define freezable_schedule() \ 168static inline void freezable_schedule(void)
149({ \ 169{
150 freezer_do_not_count(); \ 170 freezer_do_not_count();
151 schedule(); \ 171 schedule();
152 freezer_count(); \ 172 freezer_count();
153}) 173}
174
175/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */
176static inline void freezable_schedule_unsafe(void)
177{
178 freezer_do_not_count();
179 schedule();
180 freezer_count_unsafe();
181}
182
183/*
184 * Like freezable_schedule_timeout(), but should not block the freezer. Do not
185 * call this with locks held.
186 */
187static inline long freezable_schedule_timeout(long timeout)
188{
189 long __retval;
190 freezer_do_not_count();
191 __retval = schedule_timeout(timeout);
192 freezer_count();
193 return __retval;
194}
195
196/*
197 * Like schedule_timeout_interruptible(), but should not block the freezer. Do not
198 * call this with locks held.
199 */
200static inline long freezable_schedule_timeout_interruptible(long timeout)
201{
202 long __retval;
203 freezer_do_not_count();
204 __retval = schedule_timeout_interruptible(timeout);
205 freezer_count();
206 return __retval;
207}
154 208
155/* Like schedule_timeout_killable(), but should not block the freezer. */ 209/* Like schedule_timeout_killable(), but should not block the freezer. */
156#define freezable_schedule_timeout_killable(timeout) \ 210static inline long freezable_schedule_timeout_killable(long timeout)
157({ \ 211{
158 long __retval; \ 212 long __retval;
159 freezer_do_not_count(); \ 213 freezer_do_not_count();
160 __retval = schedule_timeout_killable(timeout); \ 214 __retval = schedule_timeout_killable(timeout);
161 freezer_count(); \ 215 freezer_count();
162 __retval; \ 216 return __retval;
163}) 217}
218
219/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */
220static inline long freezable_schedule_timeout_killable_unsafe(long timeout)
221{
222 long __retval;
223 freezer_do_not_count();
224 __retval = schedule_timeout_killable(timeout);
225 freezer_count_unsafe();
226 return __retval;
227}
228
229/*
230 * Like schedule_hrtimeout_range(), but should not block the freezer. Do not
231 * call this with locks held.
232 */
233static inline int freezable_schedule_hrtimeout_range(ktime_t *expires,
234 unsigned long delta, const enum hrtimer_mode mode)
235{
236 int __retval;
237 freezer_do_not_count();
238 __retval = schedule_hrtimeout_range(expires, delta, mode);
239 freezer_count();
240 return __retval;
241}
164 242
165/* 243/*
166 * Freezer-friendly wrappers around wait_event_interruptible(), 244 * Freezer-friendly wrappers around wait_event_interruptible(),
@@ -177,33 +255,45 @@ static inline bool freezer_should_skip(struct task_struct *p)
177 __retval; \ 255 __retval; \
178}) 256})
179 257
258/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */
259#define wait_event_freezekillable_unsafe(wq, condition) \
260({ \
261 int __retval; \
262 freezer_do_not_count(); \
263 __retval = wait_event_killable(wq, (condition)); \
264 freezer_count_unsafe(); \
265 __retval; \
266})
267
180#define wait_event_freezable(wq, condition) \ 268#define wait_event_freezable(wq, condition) \
181({ \ 269({ \
182 int __retval; \ 270 int __retval; \
183 for (;;) { \ 271 freezer_do_not_count(); \
184 __retval = wait_event_interruptible(wq, \ 272 __retval = wait_event_interruptible(wq, (condition)); \
185 (condition) || freezing(current)); \ 273 freezer_count(); \
186 if (__retval || (condition)) \
187 break; \
188 try_to_freeze(); \
189 } \
190 __retval; \ 274 __retval; \
191}) 275})
192 276
193#define wait_event_freezable_timeout(wq, condition, timeout) \ 277#define wait_event_freezable_timeout(wq, condition, timeout) \
194({ \ 278({ \
195 long __retval = timeout; \ 279 long __retval = timeout; \
196 for (;;) { \ 280 freezer_do_not_count(); \
197 __retval = wait_event_interruptible_timeout(wq, \ 281 __retval = wait_event_interruptible_timeout(wq, (condition), \
198 (condition) || freezing(current), \ 282 __retval); \
199 __retval); \ 283 freezer_count(); \
200 if (__retval <= 0 || (condition)) \
201 break; \
202 try_to_freeze(); \
203 } \
204 __retval; \ 284 __retval; \
205}) 285})
206 286
287#define wait_event_freezable_exclusive(wq, condition) \
288({ \
289 int __retval; \
290 freezer_do_not_count(); \
291 __retval = wait_event_interruptible_exclusive(wq, condition); \
292 freezer_count(); \
293 __retval; \
294})
295
296
207#else /* !CONFIG_FREEZER */ 297#else /* !CONFIG_FREEZER */
208static inline bool frozen(struct task_struct *p) { return false; } 298static inline bool frozen(struct task_struct *p) { return false; }
209static inline bool freezing(struct task_struct *p) { return false; } 299static inline bool freezing(struct task_struct *p) { return false; }
@@ -225,18 +315,37 @@ static inline void set_freezable(void) {}
225 315
226#define freezable_schedule() schedule() 316#define freezable_schedule() schedule()
227 317
318#define freezable_schedule_unsafe() schedule()
319
320#define freezable_schedule_timeout(timeout) schedule_timeout(timeout)
321
322#define freezable_schedule_timeout_interruptible(timeout) \
323 schedule_timeout_interruptible(timeout)
324
228#define freezable_schedule_timeout_killable(timeout) \ 325#define freezable_schedule_timeout_killable(timeout) \
229 schedule_timeout_killable(timeout) 326 schedule_timeout_killable(timeout)
230 327
328#define freezable_schedule_timeout_killable_unsafe(timeout) \
329 schedule_timeout_killable(timeout)
330
331#define freezable_schedule_hrtimeout_range(expires, delta, mode) \
332 schedule_hrtimeout_range(expires, delta, mode)
333
231#define wait_event_freezable(wq, condition) \ 334#define wait_event_freezable(wq, condition) \
232 wait_event_interruptible(wq, condition) 335 wait_event_interruptible(wq, condition)
233 336
234#define wait_event_freezable_timeout(wq, condition, timeout) \ 337#define wait_event_freezable_timeout(wq, condition, timeout) \
235 wait_event_interruptible_timeout(wq, condition, timeout) 338 wait_event_interruptible_timeout(wq, condition, timeout)
236 339
340#define wait_event_freezable_exclusive(wq, condition) \
341 wait_event_interruptible_exclusive(wq, condition)
342
237#define wait_event_freezekillable(wq, condition) \ 343#define wait_event_freezekillable(wq, condition) \
238 wait_event_killable(wq, condition) 344 wait_event_killable(wq, condition)
239 345
346#define wait_event_freezekillable_unsafe(wq, condition) \
347 wait_event_killable(wq, condition)
348
240#endif /* !CONFIG_FREEZER */ 349#endif /* !CONFIG_FREEZER */
241 350
242#endif /* FREEZER_H_INCLUDED */ 351#endif /* FREEZER_H_INCLUDED */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f8a5240541b7..a35b10e9a680 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -372,14 +372,15 @@ struct address_space_operations {
372 int (*get_xip_mem)(struct address_space *, pgoff_t, int, 372 int (*get_xip_mem)(struct address_space *, pgoff_t, int,
373 void **, unsigned long *); 373 void **, unsigned long *);
374 /* 374 /*
375 * migrate the contents of a page to the specified target. If sync 375 * migrate the contents of a page to the specified target. If
376 * is false, it must not block. 376 * migrate_mode is MIGRATE_ASYNC, it must not block.
377 */ 377 */
378 int (*migratepage) (struct address_space *, 378 int (*migratepage) (struct address_space *,
379 struct page *, struct page *, enum migrate_mode); 379 struct page *, struct page *, enum migrate_mode);
380 int (*launder_page) (struct page *); 380 int (*launder_page) (struct page *);
381 int (*is_partially_uptodate) (struct page *, read_descriptor_t *, 381 int (*is_partially_uptodate) (struct page *, read_descriptor_t *,
382 unsigned long); 382 unsigned long);
383 void (*is_dirty_writeback) (struct page *, bool *, bool *);
383 int (*error_remove_page)(struct address_space *, struct page *); 384 int (*error_remove_page)(struct address_space *, struct page *);
384 385
385 /* swapfile support */ 386 /* swapfile support */
@@ -908,6 +909,7 @@ struct file_lock_operations {
908 909
909struct lock_manager_operations { 910struct lock_manager_operations {
910 int (*lm_compare_owner)(struct file_lock *, struct file_lock *); 911 int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
912 unsigned long (*lm_owner_key)(struct file_lock *);
911 void (*lm_notify)(struct file_lock *); /* unblock callback */ 913 void (*lm_notify)(struct file_lock *); /* unblock callback */
912 int (*lm_grant)(struct file_lock *, struct file_lock *, int); 914 int (*lm_grant)(struct file_lock *, struct file_lock *, int);
913 void (*lm_break)(struct file_lock *); 915 void (*lm_break)(struct file_lock *);
@@ -926,14 +928,33 @@ int locks_in_grace(struct net *);
926/* that will die - we need it for nfs_lock_info */ 928/* that will die - we need it for nfs_lock_info */
927#include <linux/nfs_fs_i.h> 929#include <linux/nfs_fs_i.h>
928 930
931/*
932 * struct file_lock represents a generic "file lock". It's used to represent
933 * POSIX byte range locks, BSD (flock) locks, and leases. It's important to
934 * note that the same struct is used to represent both a request for a lock and
935 * the lock itself, but the same object is never used for both.
936 *
937 * FIXME: should we create a separate "struct lock_request" to help distinguish
938 * these two uses?
939 *
940 * The i_flock list is ordered by:
941 *
942 * 1) lock type -- FL_LEASEs first, then FL_FLOCK, and finally FL_POSIX
943 * 2) lock owner
944 * 3) lock range start
945 * 4) lock range end
946 *
947 * Obviously, the last two criteria only matter for POSIX locks.
948 */
929struct file_lock { 949struct file_lock {
930 struct file_lock *fl_next; /* singly linked list for this inode */ 950 struct file_lock *fl_next; /* singly linked list for this inode */
931 struct list_head fl_link; /* doubly linked list of all locks */ 951 struct hlist_node fl_link; /* node in global lists */
932 struct list_head fl_block; /* circular list of blocked processes */ 952 struct list_head fl_block; /* circular list of blocked processes */
933 fl_owner_t fl_owner; 953 fl_owner_t fl_owner;
934 unsigned int fl_flags; 954 unsigned int fl_flags;
935 unsigned char fl_type; 955 unsigned char fl_type;
936 unsigned int fl_pid; 956 unsigned int fl_pid;
957 int fl_link_cpu; /* what cpu's list is this on? */
937 struct pid *fl_nspid; 958 struct pid *fl_nspid;
938 wait_queue_head_t fl_wait; 959 wait_queue_head_t fl_wait;
939 struct file *fl_file; 960 struct file *fl_file;
@@ -994,7 +1015,7 @@ extern void locks_release_private(struct file_lock *);
994extern void posix_test_lock(struct file *, struct file_lock *); 1015extern void posix_test_lock(struct file *, struct file_lock *);
995extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); 1016extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *);
996extern int posix_lock_file_wait(struct file *, struct file_lock *); 1017extern int posix_lock_file_wait(struct file *, struct file_lock *);
997extern int posix_unblock_lock(struct file *, struct file_lock *); 1018extern int posix_unblock_lock(struct file_lock *);
998extern int vfs_test_lock(struct file *, struct file_lock *); 1019extern int vfs_test_lock(struct file *, struct file_lock *);
999extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *); 1020extern int vfs_lock_file(struct file *, unsigned int, struct file_lock *, struct file_lock *);
1000extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl); 1021extern int vfs_cancel_lock(struct file *filp, struct file_lock *fl);
@@ -1006,9 +1027,6 @@ extern int vfs_setlease(struct file *, long, struct file_lock **);
1006extern int lease_modify(struct file_lock **, int); 1027extern int lease_modify(struct file_lock **, int);
1007extern int lock_may_read(struct inode *, loff_t start, unsigned long count); 1028extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
1008extern int lock_may_write(struct inode *, loff_t start, unsigned long count); 1029extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
1009extern void locks_delete_block(struct file_lock *waiter);
1010extern void lock_flocks(void);
1011extern void unlock_flocks(void);
1012#else /* !CONFIG_FILE_LOCKING */ 1030#else /* !CONFIG_FILE_LOCKING */
1013static inline int fcntl_getlk(struct file *file, struct flock __user *user) 1031static inline int fcntl_getlk(struct file *file, struct flock __user *user)
1014{ 1032{
@@ -1084,8 +1102,7 @@ static inline int posix_lock_file_wait(struct file *filp, struct file_lock *fl)
1084 return -ENOLCK; 1102 return -ENOLCK;
1085} 1103}
1086 1104
1087static inline int posix_unblock_lock(struct file *filp, 1105static inline int posix_unblock_lock(struct file_lock *waiter)
1088 struct file_lock *waiter)
1089{ 1106{
1090 return -ENOENT; 1107 return -ENOENT;
1091} 1108}
@@ -1150,19 +1167,6 @@ static inline int lock_may_write(struct inode *inode, loff_t start,
1150{ 1167{
1151 return 1; 1168 return 1;
1152} 1169}
1153
1154static inline void locks_delete_block(struct file_lock *waiter)
1155{
1156}
1157
1158static inline void lock_flocks(void)
1159{
1160}
1161
1162static inline void unlock_flocks(void)
1163{
1164}
1165
1166#endif /* !CONFIG_FILE_LOCKING */ 1170#endif /* !CONFIG_FILE_LOCKING */
1167 1171
1168 1172
@@ -1580,6 +1584,7 @@ struct inode_operations {
1580 int (*atomic_open)(struct inode *, struct dentry *, 1584 int (*atomic_open)(struct inode *, struct dentry *,
1581 struct file *, unsigned open_flag, 1585 struct file *, unsigned open_flag,
1582 umode_t create_mode, int *opened); 1586 umode_t create_mode, int *opened);
1587 int (*tmpfile) (struct inode *, struct dentry *, umode_t);
1583} ____cacheline_aligned; 1588} ____cacheline_aligned;
1584 1589
1585ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, 1590ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
@@ -1743,6 +1748,7 @@ struct super_operations {
1743#define I_REFERENCED (1 << 8) 1748#define I_REFERENCED (1 << 8)
1744#define __I_DIO_WAKEUP 9 1749#define __I_DIO_WAKEUP 9
1745#define I_DIO_WAKEUP (1 << I_DIO_WAKEUP) 1750#define I_DIO_WAKEUP (1 << I_DIO_WAKEUP)
1751#define I_LINKABLE (1 << 10)
1746 1752
1747#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) 1753#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
1748 1754
@@ -1896,7 +1902,6 @@ extern int current_umask(void);
1896extern struct kobject *fs_kobj; 1902extern struct kobject *fs_kobj;
1897 1903
1898#define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK) 1904#define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK)
1899extern int rw_verify_area(int, struct file *, loff_t *, size_t);
1900 1905
1901#define FLOCK_VERIFY_READ 1 1906#define FLOCK_VERIFY_READ 1
1902#define FLOCK_VERIFY_WRITE 2 1907#define FLOCK_VERIFY_WRITE 2
@@ -2309,7 +2314,6 @@ extern struct file * open_exec(const char *);
2309/* fs/dcache.c -- generic fs support functions */ 2314/* fs/dcache.c -- generic fs support functions */
2310extern int is_subdir(struct dentry *, struct dentry *); 2315extern int is_subdir(struct dentry *, struct dentry *);
2311extern int path_is_under(struct path *, struct path *); 2316extern int path_is_under(struct path *, struct path *);
2312extern ino_t find_inode_number(struct dentry *, struct qstr *);
2313 2317
2314#include <linux/err.h> 2318#include <linux/err.h>
2315 2319
@@ -2424,9 +2428,12 @@ extern void
2424file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); 2428file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
2425extern loff_t noop_llseek(struct file *file, loff_t offset, int whence); 2429extern loff_t noop_llseek(struct file *file, loff_t offset, int whence);
2426extern loff_t no_llseek(struct file *file, loff_t offset, int whence); 2430extern loff_t no_llseek(struct file *file, loff_t offset, int whence);
2431extern loff_t vfs_setpos(struct file *file, loff_t offset, loff_t maxsize);
2427extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence); 2432extern loff_t generic_file_llseek(struct file *file, loff_t offset, int whence);
2428extern loff_t generic_file_llseek_size(struct file *file, loff_t offset, 2433extern loff_t generic_file_llseek_size(struct file *file, loff_t offset,
2429 int whence, loff_t maxsize, loff_t eof); 2434 int whence, loff_t maxsize, loff_t eof);
2435extern loff_t fixed_size_llseek(struct file *file, loff_t offset,
2436 int whence, loff_t size);
2430extern int generic_file_open(struct inode * inode, struct file * filp); 2437extern int generic_file_open(struct inode * inode, struct file * filp);
2431extern int nonseekable_open(struct inode * inode, struct file * filp); 2438extern int nonseekable_open(struct inode * inode, struct file * filp);
2432 2439
diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h
index a78680a92dba..1c804b057fb1 100644
--- a/include/linux/fsnotify.h
+++ b/include/linux/fsnotify.h
@@ -38,7 +38,7 @@ static inline int fsnotify_parent(struct path *path, struct dentry *dentry, __u3
38static inline int fsnotify_perm(struct file *file, int mask) 38static inline int fsnotify_perm(struct file *file, int mask)
39{ 39{
40 struct path *path = &file->f_path; 40 struct path *path = &file->f_path;
41 struct inode *inode = path->dentry->d_inode; 41 struct inode *inode = file_inode(file);
42 __u32 fsnotify_mask = 0; 42 __u32 fsnotify_mask = 0;
43 int ret; 43 int ret;
44 44
@@ -192,7 +192,7 @@ static inline void fsnotify_mkdir(struct inode *inode, struct dentry *dentry)
192static inline void fsnotify_access(struct file *file) 192static inline void fsnotify_access(struct file *file)
193{ 193{
194 struct path *path = &file->f_path; 194 struct path *path = &file->f_path;
195 struct inode *inode = path->dentry->d_inode; 195 struct inode *inode = file_inode(file);
196 __u32 mask = FS_ACCESS; 196 __u32 mask = FS_ACCESS;
197 197
198 if (S_ISDIR(inode->i_mode)) 198 if (S_ISDIR(inode->i_mode))
@@ -210,7 +210,7 @@ static inline void fsnotify_access(struct file *file)
210static inline void fsnotify_modify(struct file *file) 210static inline void fsnotify_modify(struct file *file)
211{ 211{
212 struct path *path = &file->f_path; 212 struct path *path = &file->f_path;
213 struct inode *inode = path->dentry->d_inode; 213 struct inode *inode = file_inode(file);
214 __u32 mask = FS_MODIFY; 214 __u32 mask = FS_MODIFY;
215 215
216 if (S_ISDIR(inode->i_mode)) 216 if (S_ISDIR(inode->i_mode))
@@ -228,7 +228,7 @@ static inline void fsnotify_modify(struct file *file)
228static inline void fsnotify_open(struct file *file) 228static inline void fsnotify_open(struct file *file)
229{ 229{
230 struct path *path = &file->f_path; 230 struct path *path = &file->f_path;
231 struct inode *inode = path->dentry->d_inode; 231 struct inode *inode = file_inode(file);
232 __u32 mask = FS_OPEN; 232 __u32 mask = FS_OPEN;
233 233
234 if (S_ISDIR(inode->i_mode)) 234 if (S_ISDIR(inode->i_mode))
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 99d0fbcbaf79..9f15c0064c50 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -566,10 +566,6 @@ static inline ssize_t ftrace_filter_write(struct file *file, const char __user *
566 size_t cnt, loff_t *ppos) { return -ENODEV; } 566 size_t cnt, loff_t *ppos) { return -ENODEV; }
567static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf, 567static inline ssize_t ftrace_notrace_write(struct file *file, const char __user *ubuf,
568 size_t cnt, loff_t *ppos) { return -ENODEV; } 568 size_t cnt, loff_t *ppos) { return -ENODEV; }
569static inline loff_t ftrace_regex_lseek(struct file *file, loff_t offset, int whence)
570{
571 return -ENODEV;
572}
573static inline int 569static inline int
574ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; } 570ftrace_regex_release(struct inode *inode, struct file *file) { return -ENODEV; }
575#endif /* CONFIG_DYNAMIC_FTRACE */ 571#endif /* CONFIG_DYNAMIC_FTRACE */
@@ -828,10 +824,15 @@ enum ftrace_dump_mode;
828 824
829extern enum ftrace_dump_mode ftrace_dump_on_oops; 825extern enum ftrace_dump_mode ftrace_dump_on_oops;
830 826
827extern void disable_trace_on_warning(void);
828extern int __disable_trace_on_warning;
829
831#ifdef CONFIG_PREEMPT 830#ifdef CONFIG_PREEMPT
832#define INIT_TRACE_RECURSION .trace_recursion = 0, 831#define INIT_TRACE_RECURSION .trace_recursion = 0,
833#endif 832#endif
834 833
834#else /* CONFIG_TRACING */
835static inline void disable_trace_on_warning(void) { }
835#endif /* CONFIG_TRACING */ 836#endif /* CONFIG_TRACING */
836 837
837#ifndef INIT_TRACE_RECURSION 838#ifndef INIT_TRACE_RECURSION
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 0f615eb23d05..9b4dd491f7e8 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -209,7 +209,7 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
209 * 0x9 => DMA or NORMAL (MOVABLE+DMA) 209 * 0x9 => DMA or NORMAL (MOVABLE+DMA)
210 * 0xa => MOVABLE (Movable is valid only if HIGHMEM is set too) 210 * 0xa => MOVABLE (Movable is valid only if HIGHMEM is set too)
211 * 0xb => BAD (MOVABLE+HIGHMEM+DMA) 211 * 0xb => BAD (MOVABLE+HIGHMEM+DMA)
212 * 0xc => DMA32 (MOVABLE+HIGHMEM+DMA32) 212 * 0xc => DMA32 (MOVABLE+DMA32)
213 * 0xd => BAD (MOVABLE+DMA32+DMA) 213 * 0xd => BAD (MOVABLE+DMA32+DMA)
214 * 0xe => BAD (MOVABLE+DMA32+HIGHMEM) 214 * 0xe => BAD (MOVABLE+DMA32+HIGHMEM)
215 * 0xf => BAD (MOVABLE+DMA32+HIGHMEM+DMA) 215 * 0xf => BAD (MOVABLE+DMA32+HIGHMEM+DMA)
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 528454c2caa9..b60de92e2edc 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -60,9 +60,9 @@ extern pmd_t *page_check_address_pmd(struct page *page,
60#define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER) 60#define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER)
61 61
62#ifdef CONFIG_TRANSPARENT_HUGEPAGE 62#ifdef CONFIG_TRANSPARENT_HUGEPAGE
63#define HPAGE_PMD_SHIFT HPAGE_SHIFT 63#define HPAGE_PMD_SHIFT PMD_SHIFT
64#define HPAGE_PMD_MASK HPAGE_MASK 64#define HPAGE_PMD_SIZE ((1UL) << HPAGE_PMD_SHIFT)
65#define HPAGE_PMD_SIZE HPAGE_SIZE 65#define HPAGE_PMD_MASK (~(HPAGE_PMD_SIZE - 1))
66 66
67extern bool is_vma_temporary_stack(struct vm_area_struct *vma); 67extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
68 68
@@ -123,7 +123,7 @@ extern void __split_huge_page_pmd(struct vm_area_struct *vma,
123 } while (0) 123 } while (0)
124extern void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address, 124extern void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address,
125 pmd_t *pmd); 125 pmd_t *pmd);
126#if HPAGE_PMD_ORDER > MAX_ORDER 126#if HPAGE_PMD_ORDER >= MAX_ORDER
127#error "hugepages can't be allocated by the buddy allocator" 127#error "hugepages can't be allocated by the buddy allocator"
128#endif 128#endif
129extern int hugepage_madvise(struct vm_area_struct *vma, 129extern int hugepage_madvise(struct vm_area_struct *vma,
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index feaf0c7fb7d8..c2b1801a160b 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -55,7 +55,6 @@ void __unmap_hugepage_range_final(struct mmu_gather *tlb,
55void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma, 55void __unmap_hugepage_range(struct mmu_gather *tlb, struct vm_area_struct *vma,
56 unsigned long start, unsigned long end, 56 unsigned long start, unsigned long end,
57 struct page *ref_page); 57 struct page *ref_page);
58int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
59void hugetlb_report_meminfo(struct seq_file *); 58void hugetlb_report_meminfo(struct seq_file *);
60int hugetlb_report_node_meminfo(int, char *); 59int hugetlb_report_node_meminfo(int, char *);
61void hugetlb_show_meminfo(void); 60void hugetlb_show_meminfo(void);
@@ -69,6 +68,10 @@ void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
69int dequeue_hwpoisoned_huge_page(struct page *page); 68int dequeue_hwpoisoned_huge_page(struct page *page);
70void copy_huge_page(struct page *dst, struct page *src); 69void copy_huge_page(struct page *dst, struct page *src);
71 70
71#ifdef CONFIG_ARCH_WANT_HUGE_PMD_SHARE
72pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud);
73#endif
74
72extern unsigned long hugepages_treat_as_movable; 75extern unsigned long hugepages_treat_as_movable;
73extern const unsigned long hugetlb_zero, hugetlb_infinity; 76extern const unsigned long hugetlb_zero, hugetlb_infinity;
74extern int sysctl_hugetlb_shm_group; 77extern int sysctl_hugetlb_shm_group;
@@ -110,7 +113,6 @@ static inline unsigned long hugetlb_total_pages(void)
110#define follow_hugetlb_page(m,v,p,vs,a,b,i,w) ({ BUG(); 0; }) 113#define follow_hugetlb_page(m,v,p,vs,a,b,i,w) ({ BUG(); 0; })
111#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) 114#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL)
112#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) 115#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })
113#define hugetlb_prefault(mapping, vma) ({ BUG(); 0; })
114static inline void hugetlb_report_meminfo(struct seq_file *m) 116static inline void hugetlb_report_meminfo(struct seq_file *m)
115{ 117{
116} 118}
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 488debbef895..81cbbdb96aae 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -658,7 +658,6 @@ struct twl4030_power_data {
658 bool use_poweroff; /* Board is wired for TWL poweroff */ 658 bool use_poweroff; /* Board is wired for TWL poweroff */
659}; 659};
660 660
661extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
662extern int twl4030_remove_script(u8 flags); 661extern int twl4030_remove_script(u8 flags);
663extern void twl4030_power_off(void); 662extern void twl4030_power_off(void);
664 663
@@ -726,7 +725,7 @@ struct twl4030_platform_data {
726 struct regulator_init_data *clk32kg; 725 struct regulator_init_data *clk32kg;
727 struct regulator_init_data *v1v8; 726 struct regulator_init_data *v1v8;
728 struct regulator_init_data *v2v1; 727 struct regulator_init_data *v2v1;
729 /* TWL6025 LDO regulators */ 728 /* TWL6032 LDO regulators */
730 struct regulator_init_data *ldo1; 729 struct regulator_init_data *ldo1;
731 struct regulator_init_data *ldo2; 730 struct regulator_init_data *ldo2;
732 struct regulator_init_data *ldo3; 731 struct regulator_init_data *ldo3;
@@ -736,7 +735,7 @@ struct twl4030_platform_data {
736 struct regulator_init_data *ldo7; 735 struct regulator_init_data *ldo7;
737 struct regulator_init_data *ldoln; 736 struct regulator_init_data *ldoln;
738 struct regulator_init_data *ldousb; 737 struct regulator_init_data *ldousb;
739 /* TWL6025 DCDC regulators */ 738 /* TWL6032 DCDC regulators */
740 struct regulator_init_data *smps3; 739 struct regulator_init_data *smps3;
741 struct regulator_init_data *smps4; 740 struct regulator_init_data *smps4;
742 struct regulator_init_data *vio6025; 741 struct regulator_init_data *vio6025;
@@ -753,7 +752,7 @@ struct twl_regulator_driver_data {
753#define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */ 752#define TPS_SUBSET BIT(1) /* tps659[23]0 have fewer LDOs */
754#define TWL5031 BIT(2) /* twl5031 has different registers */ 753#define TWL5031 BIT(2) /* twl5031 has different registers */
755#define TWL6030_CLASS BIT(3) /* TWL6030 class */ 754#define TWL6030_CLASS BIT(3) /* TWL6030 class */
756#define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */ 755#define TWL6032_SUBCLASS BIT(4) /* TWL6032 has changed registers */
757#define TWL4030_ALLOW_UNSUPPORTED BIT(5) /* Some voltages are possible 756#define TWL4030_ALLOW_UNSUPPORTED BIT(5) /* Some voltages are possible
758 * but not officially supported. 757 * but not officially supported.
759 * This flag is necessary to 758 * This flag is necessary to
@@ -840,20 +839,20 @@ static inline int twl4030charger_usb_en(int enable) { return 0; }
840#define TWL6030_REG_CLK32KG 48 839#define TWL6030_REG_CLK32KG 48
841 840
842/* LDOs on 6025 have different names */ 841/* LDOs on 6025 have different names */
843#define TWL6025_REG_LDO2 49 842#define TWL6032_REG_LDO2 49
844#define TWL6025_REG_LDO4 50 843#define TWL6032_REG_LDO4 50
845#define TWL6025_REG_LDO3 51 844#define TWL6032_REG_LDO3 51
846#define TWL6025_REG_LDO5 52 845#define TWL6032_REG_LDO5 52
847#define TWL6025_REG_LDO1 53 846#define TWL6032_REG_LDO1 53
848#define TWL6025_REG_LDO7 54 847#define TWL6032_REG_LDO7 54
849#define TWL6025_REG_LDO6 55 848#define TWL6032_REG_LDO6 55
850#define TWL6025_REG_LDOLN 56 849#define TWL6032_REG_LDOLN 56
851#define TWL6025_REG_LDOUSB 57 850#define TWL6032_REG_LDOUSB 57
852 851
853/* 6025 DCDC supplies */ 852/* 6025 DCDC supplies */
854#define TWL6025_REG_SMPS3 58 853#define TWL6032_REG_SMPS3 58
855#define TWL6025_REG_SMPS4 59 854#define TWL6032_REG_SMPS4 59
856#define TWL6025_REG_VIO 60 855#define TWL6032_REG_VIO 60
857 856
858 857
859#endif /* End of __TWL4030_H */ 858#endif /* End of __TWL4030_H */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 06b0ed0154a4..b0dc87a2a376 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -146,6 +146,7 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
146#define IEEE80211_MAX_RTS_THRESHOLD 2353 146#define IEEE80211_MAX_RTS_THRESHOLD 2353
147#define IEEE80211_MAX_AID 2007 147#define IEEE80211_MAX_AID 2007
148#define IEEE80211_MAX_TIM_LEN 251 148#define IEEE80211_MAX_TIM_LEN 251
149#define IEEE80211_MAX_MESH_PEERINGS 63
149/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section 150/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
150 6.2.1.1.2. 151 6.2.1.1.2.
151 152
@@ -1829,6 +1830,15 @@ enum ieee80211_key_len {
1829 WLAN_KEY_LEN_AES_CMAC = 16, 1830 WLAN_KEY_LEN_AES_CMAC = 16,
1830}; 1831};
1831 1832
1833#define IEEE80211_WEP_IV_LEN 4
1834#define IEEE80211_WEP_ICV_LEN 4
1835#define IEEE80211_CCMP_HDR_LEN 8
1836#define IEEE80211_CCMP_MIC_LEN 8
1837#define IEEE80211_CCMP_PN_LEN 6
1838#define IEEE80211_TKIP_IV_LEN 8
1839#define IEEE80211_TKIP_ICV_LEN 4
1840#define IEEE80211_CMAC_PN_LEN 6
1841
1832/* Public action codes */ 1842/* Public action codes */
1833enum ieee80211_pub_actioncode { 1843enum ieee80211_pub_actioncode {
1834 WLAN_PUB_ACTION_EXT_CHANSW_ANN = 4, 1844 WLAN_PUB_ACTION_EXT_CHANSW_ANN = 4,
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index c3f817c3eb45..a86784dec3d3 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -12,5 +12,6 @@ struct ifla_vf_info {
12 __u32 qos; 12 __u32 qos;
13 __u32 tx_rate; 13 __u32 tx_rate;
14 __u32 spoofchk; 14 __u32 spoofchk;
15 __u32 linkstate;
15}; 16};
16#endif /* _LINUX_IF_LINK_H */ 17#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 84dde1dd1da4..ddd33fd5904d 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -8,7 +8,7 @@
8#include <net/netlink.h> 8#include <net/netlink.h>
9#include <linux/u64_stats_sync.h> 9#include <linux/u64_stats_sync.h>
10 10
11#if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE) 11#if IS_ENABLED(CONFIG_MACVTAP)
12struct socket *macvtap_get_socket(struct file *); 12struct socket *macvtap_get_socket(struct file *);
13#else 13#else
14#include <linux/err.h> 14#include <linux/err.h>
@@ -50,7 +50,7 @@ struct macvlan_pcpu_stats {
50 * Maximum times a macvtap device can be opened. This can be used to 50 * 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. 51 * configure the number of receive queue, e.g. for multiqueue virtio.
52 */ 52 */
53#define MAX_MACVTAP_QUEUES (NR_CPUS < 16 ? NR_CPUS : 16) 53#define MAX_MACVTAP_QUEUES 16
54 54
55#define MACVLAN_MC_FILTER_BITS 8 55#define MACVLAN_MC_FILTER_BITS 8
56#define MACVLAN_MC_FILTER_SZ (1 << MACVLAN_MC_FILTER_BITS) 56#define MACVLAN_MC_FILTER_SZ (1 << MACVLAN_MC_FILTER_BITS)
@@ -65,12 +65,18 @@ struct macvlan_dev {
65 65
66 DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ); 66 DECLARE_BITMAP(mc_filter, MACVLAN_MC_FILTER_SZ);
67 67
68 netdev_features_t set_features;
68 enum macvlan_mode mode; 69 enum macvlan_mode mode;
69 u16 flags; 70 u16 flags;
70 int (*receive)(struct sk_buff *skb); 71 int (*receive)(struct sk_buff *skb);
71 int (*forward)(struct net_device *dev, struct sk_buff *skb); 72 int (*forward)(struct net_device *dev, struct sk_buff *skb);
72 struct macvtap_queue *taps[MAX_MACVTAP_QUEUES]; 73 /* This array tracks active taps. */
74 struct macvtap_queue __rcu *taps[MAX_MACVTAP_QUEUES];
75 /* This list tracks all taps (both enabled and disabled) */
76 struct list_head queue_list;
73 int numvtaps; 77 int numvtaps;
78 int numqueues;
79 netdev_features_t tap_features;
74 int minor; 80 int minor;
75}; 81};
76 82
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index 16fae6436d0e..f6156f91eb1c 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -69,6 +69,7 @@ struct team_port {
69 s32 priority; /* lower number ~ higher priority */ 69 s32 priority; /* lower number ~ higher priority */
70 u16 queue_id; 70 u16 queue_id;
71 struct list_head qom_list; /* node in queue override mapping list */ 71 struct list_head qom_list; /* node in queue override mapping list */
72 struct rcu_head rcu;
72 long mode_priv[0]; 73 long mode_priv[0];
73}; 74};
74 75
@@ -228,6 +229,16 @@ static inline struct team_port *team_get_port_by_index(struct team *team,
228 return port; 229 return port;
229 return NULL; 230 return NULL;
230} 231}
232
233static inline int team_num_to_port_index(struct team *team, int num)
234{
235 int en_port_count = ACCESS_ONCE(team->en_port_count);
236
237 if (unlikely(!en_port_count))
238 return 0;
239 return num % en_port_count;
240}
241
231static inline struct team_port *team_get_port_by_index_rcu(struct team *team, 242static inline struct team_port *team_get_port_by_index_rcu(struct team *team,
232 int port_index) 243 int port_index)
233{ 244{
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 637fa71de0c7..cdcbafa9b39a 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -243,8 +243,6 @@ static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb,
243 return skb; 243 return skb;
244} 244}
245 245
246#define HAVE_VLAN_PUT_TAG
247
248/** 246/**
249 * vlan_put_tag - inserts VLAN tag according to device features 247 * vlan_put_tag - inserts VLAN tag according to device features
250 * @skb: skbuff to tag 248 * @skb: skbuff to tag
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 7f2bf1518480..e3362b5f13e8 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -84,6 +84,7 @@ struct ip_mc_list {
84 struct ip_mc_list *next; 84 struct ip_mc_list *next;
85 struct ip_mc_list __rcu *next_rcu; 85 struct ip_mc_list __rcu *next_rcu;
86 }; 86 };
87 struct ip_mc_list __rcu *next_hash;
87 struct timer_list timer; 88 struct timer_list timer;
88 int users; 89 int users;
89 atomic_t refcnt; 90 atomic_t refcnt;
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index ea1e3b863890..b99cd23f3474 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -50,12 +50,17 @@ struct ipv4_devconf {
50 DECLARE_BITMAP(state, IPV4_DEVCONF_MAX); 50 DECLARE_BITMAP(state, IPV4_DEVCONF_MAX);
51}; 51};
52 52
53#define MC_HASH_SZ_LOG 9
54
53struct in_device { 55struct in_device {
54 struct net_device *dev; 56 struct net_device *dev;
55 atomic_t refcnt; 57 atomic_t refcnt;
56 int dead; 58 int dead;
57 struct in_ifaddr *ifa_list; /* IP ifaddr chain */ 59 struct in_ifaddr *ifa_list; /* IP ifaddr chain */
60
58 struct ip_mc_list __rcu *mc_list; /* IP multicast filter chain */ 61 struct ip_mc_list __rcu *mc_list; /* IP multicast filter chain */
62 struct ip_mc_list __rcu * __rcu *mc_hash;
63
59 int mc_count; /* Number of installed mcasts */ 64 int mc_count; /* Number of installed mcasts */
60 spinlock_t mc_tomb_lock; 65 spinlock_t mc_tomb_lock;
61 struct ip_mc_list *mc_tomb; 66 struct ip_mc_list *mc_tomb;
diff --git a/include/linux/init.h b/include/linux/init.h
index 861814710d52..e73f2b708525 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -93,13 +93,13 @@
93 93
94#define __exit __section(.exit.text) __exitused __cold notrace 94#define __exit __section(.exit.text) __exitused __cold notrace
95 95
96/* Used for HOTPLUG_CPU */ 96/* temporary, until all users are removed */
97#define __cpuinit __section(.cpuinit.text) __cold notrace 97#define __cpuinit
98#define __cpuinitdata __section(.cpuinit.data) 98#define __cpuinitdata
99#define __cpuinitconst __constsection(.cpuinit.rodata) 99#define __cpuinitconst
100#define __cpuexit __section(.cpuexit.text) __exitused __cold notrace 100#define __cpuexit
101#define __cpuexitdata __section(.cpuexit.data) 101#define __cpuexitdata
102#define __cpuexitconst __constsection(.cpuexit.rodata) 102#define __cpuexitconst
103 103
104/* Used for MEMORY_HOTPLUG */ 104/* Used for MEMORY_HOTPLUG */
105#define __meminit __section(.meminit.text) __cold notrace 105#define __meminit __section(.meminit.text) __cold notrace
@@ -118,9 +118,8 @@
118#define __INITRODATA .section ".init.rodata","a",%progbits 118#define __INITRODATA .section ".init.rodata","a",%progbits
119#define __FINITDATA .previous 119#define __FINITDATA .previous
120 120
121#define __CPUINIT .section ".cpuinit.text", "ax" 121/* temporary, until all users are removed */
122#define __CPUINITDATA .section ".cpuinit.data", "aw" 122#define __CPUINIT
123#define __CPUINITRODATA .section ".cpuinit.rodata", "a"
124 123
125#define __MEMINIT .section ".meminit.text", "ax" 124#define __MEMINIT .section ".meminit.text", "ax"
126#define __MEMINITDATA .section ".meminit.data", "aw" 125#define __MEMINITDATA .section ".meminit.data", "aw"
diff --git a/include/linux/input/ti_am335x_tsc.h b/include/linux/input/ti_am335x_tsc.h
deleted file mode 100644
index 49269a2aa329..000000000000
--- a/include/linux/input/ti_am335x_tsc.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef __LINUX_TI_AM335X_TSC_H
2#define __LINUX_TI_AM335X_TSC_H
3
4/**
5 * struct tsc_data Touchscreen wire configuration
6 * @wires: Wires refer to application modes
7 * i.e. 4/5/8 wire touchscreen support
8 * on the platform.
9 * @x_plate_resistance: X plate resistance.
10 * @steps_to_configure: The sequencer supports a total of
11 * 16 programmable steps.
12 * A step configured to read a single
13 * co-ordinate value, can be applied
14 * more number of times for better results.
15 */
16
17struct tsc_data {
18 int wires;
19 int x_plate_resistance;
20 int steps_to_configure;
21};
22
23#endif
diff --git a/include/linux/input/tps6507x-ts.h b/include/linux/input/tps6507x-ts.h
index ab1440313924..b433df801d92 100644
--- a/include/linux/input/tps6507x-ts.h
+++ b/include/linux/input/tps6507x-ts.h
@@ -14,7 +14,6 @@
14/* Board specific touch screen initial values */ 14/* Board specific touch screen initial values */
15struct touchscreen_init_data { 15struct touchscreen_init_data {
16 int poll_period; /* ms */ 16 int poll_period; /* ms */
17 int vref; /* non-zero to leave vref on */
18 __u16 min_pressure; /* min reading to be treated as a touch */ 17 __u16 min_pressure; /* min reading to be treated as a touch */
19 __u16 vendor; 18 __u16 vendor;
20 __u16 product; 19 __u16 product;
diff --git a/include/linux/io.h b/include/linux/io.h
index 069e4075f872..f4f42faec686 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -76,4 +76,29 @@ void devm_ioremap_release(struct device *dev, void *res);
76#define arch_has_dev_port() (1) 76#define arch_has_dev_port() (1)
77#endif 77#endif
78 78
79/*
80 * Some systems (x86 without PAT) have a somewhat reliable way to mark a
81 * physical address range such that uncached mappings will actually
82 * end up write-combining. This facility should be used in conjunction
83 * with pgprot_writecombine, ioremap-wc, or set_memory_wc, since it has
84 * no effect if the per-page mechanisms are functional.
85 * (On x86 without PAT, these functions manipulate MTRRs.)
86 *
87 * arch_phys_del_wc(0) or arch_phys_del_wc(any error code) is guaranteed
88 * to have no effect.
89 */
90#ifndef arch_phys_wc_add
91static inline int __must_check arch_phys_wc_add(unsigned long base,
92 unsigned long size)
93{
94 return 0; /* It worked (i.e. did nothing). */
95}
96
97static inline void arch_phys_wc_del(int handle)
98{
99}
100
101#define arch_phys_wc_add arch_phys_wc_add
102#endif
103
79#endif /* _LINUX_IO_H */ 104#endif /* _LINUX_IO_H */
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index ba2c708adcff..c983ed18c332 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -73,57 +73,48 @@ struct irq_domain_chip_generic;
73/** 73/**
74 * struct irq_domain - Hardware interrupt number translation object 74 * struct irq_domain - Hardware interrupt number translation object
75 * @link: Element in global irq_domain list. 75 * @link: Element in global irq_domain list.
76 * @revmap_type: Method used for reverse mapping hwirq numbers to linux irq. This 76 * @name: Name of interrupt domain
77 * will be one of the IRQ_DOMAIN_MAP_* values.
78 * @revmap_data: Revmap method specific data.
79 * @ops: pointer to irq_domain methods 77 * @ops: pointer to irq_domain methods
80 * @host_data: private data pointer for use by owner. Not touched by irq_domain 78 * @host_data: private data pointer for use by owner. Not touched by irq_domain
81 * core code. 79 * core code.
82 * @irq_base: Start of irq_desc range assigned to the irq_domain. The creator 80 *
83 * of the irq_domain is responsible for allocating the array of 81 * Optional elements
84 * irq_desc structures. 82 * @of_node: Pointer to device tree nodes associated with the irq_domain. Used
85 * @nr_irq: Number of irqs managed by the irq domain 83 * when decoding device tree interrupt specifiers.
86 * @hwirq_base: Starting number for hwirqs managed by the irq domain 84 * @gc: Pointer to a list of generic chips. There is a helper function for
87 * @of_node: (optional) Pointer to device tree nodes associated with the 85 * setting up one or more generic chips for interrupt controllers
88 * irq_domain. Used when decoding device tree interrupt specifiers. 86 * drivers using the generic chip library which uses this pointer.
87 *
88 * Revmap data, used internally by irq_domain
89 * @revmap_direct_max_irq: The largest hwirq that can be set for controllers that
90 * support direct mapping
91 * @revmap_size: Size of the linear map table @linear_revmap[]
92 * @revmap_tree: Radix map tree for hwirqs that don't fit in the linear map
93 * @linear_revmap: Linear table of hwirq->virq reverse mappings
89 */ 94 */
90struct irq_domain { 95struct irq_domain {
91 struct list_head link; 96 struct list_head link;
92 97 const char *name;
93 /* type of reverse mapping_technique */
94 unsigned int revmap_type;
95 union {
96 struct {
97 unsigned int size;
98 unsigned int first_irq;
99 irq_hw_number_t first_hwirq;
100 } legacy;
101 struct {
102 unsigned int size;
103 unsigned int *revmap;
104 } linear;
105 struct {
106 unsigned int max_irq;
107 } nomap;
108 struct radix_tree_root tree;
109 } revmap_data;
110 const struct irq_domain_ops *ops; 98 const struct irq_domain_ops *ops;
111 void *host_data; 99 void *host_data;
112 irq_hw_number_t inval_irq;
113 100
114 /* Optional device node pointer */ 101 /* Optional data */
115 struct device_node *of_node; 102 struct device_node *of_node;
116 /* Optional pointer to generic interrupt chips */
117 struct irq_domain_chip_generic *gc; 103 struct irq_domain_chip_generic *gc;
118};
119 104
120#define IRQ_DOMAIN_MAP_LEGACY 0 /* driver allocated fixed range of irqs. 105 /* reverse map data. The linear map gets appended to the irq_domain */
121 * ie. legacy 8259, gets irqs 1..15 */ 106 irq_hw_number_t hwirq_max;
122#define IRQ_DOMAIN_MAP_NOMAP 1 /* no fast reverse mapping */ 107 unsigned int revmap_direct_max_irq;
123#define IRQ_DOMAIN_MAP_LINEAR 2 /* linear map of interrupts */ 108 unsigned int revmap_size;
124#define IRQ_DOMAIN_MAP_TREE 3 /* radix tree */ 109 struct radix_tree_root revmap_tree;
110 unsigned int linear_revmap[];
111};
125 112
126#ifdef CONFIG_IRQ_DOMAIN 113#ifdef CONFIG_IRQ_DOMAIN
114struct irq_domain *__irq_domain_add(struct device_node *of_node, int size,
115 irq_hw_number_t hwirq_max, int direct_max,
116 const struct irq_domain_ops *ops,
117 void *host_data);
127struct irq_domain *irq_domain_add_simple(struct device_node *of_node, 118struct irq_domain *irq_domain_add_simple(struct device_node *of_node,
128 unsigned int size, 119 unsigned int size,
129 unsigned int first_irq, 120 unsigned int first_irq,
@@ -135,21 +126,30 @@ struct irq_domain *irq_domain_add_legacy(struct device_node *of_node,
135 irq_hw_number_t first_hwirq, 126 irq_hw_number_t first_hwirq,
136 const struct irq_domain_ops *ops, 127 const struct irq_domain_ops *ops,
137 void *host_data); 128 void *host_data);
138struct irq_domain *irq_domain_add_linear(struct device_node *of_node, 129extern struct irq_domain *irq_find_host(struct device_node *node);
130extern void irq_set_default_host(struct irq_domain *host);
131
132/**
133 * irq_domain_add_linear() - Allocate and register a linear revmap irq_domain.
134 * @of_node: pointer to interrupt controller's device tree node.
135 * @size: Number of interrupts in the domain.
136 * @ops: map/unmap domain callbacks
137 * @host_data: Controller private data pointer
138 */
139static inline struct irq_domain *irq_domain_add_linear(struct device_node *of_node,
139 unsigned int size, 140 unsigned int size,
140 const struct irq_domain_ops *ops, 141 const struct irq_domain_ops *ops,
141 void *host_data); 142 void *host_data)
142struct irq_domain *irq_domain_add_nomap(struct device_node *of_node, 143{
144 return __irq_domain_add(of_node, size, size, 0, ops, host_data);
145}
146static inline struct irq_domain *irq_domain_add_nomap(struct device_node *of_node,
143 unsigned int max_irq, 147 unsigned int max_irq,
144 const struct irq_domain_ops *ops, 148 const struct irq_domain_ops *ops,
145 void *host_data); 149 void *host_data)
146struct irq_domain *irq_domain_add_tree(struct device_node *of_node, 150{
147 const struct irq_domain_ops *ops, 151 return __irq_domain_add(of_node, 0, max_irq, max_irq, ops, host_data);
148 void *host_data); 152}
149
150extern struct irq_domain *irq_find_host(struct device_node *node);
151extern void irq_set_default_host(struct irq_domain *host);
152
153static inline struct irq_domain *irq_domain_add_legacy_isa( 153static inline struct irq_domain *irq_domain_add_legacy_isa(
154 struct device_node *of_node, 154 struct device_node *of_node,
155 const struct irq_domain_ops *ops, 155 const struct irq_domain_ops *ops,
@@ -158,21 +158,40 @@ static inline struct irq_domain *irq_domain_add_legacy_isa(
158 return irq_domain_add_legacy(of_node, NUM_ISA_INTERRUPTS, 0, 0, ops, 158 return irq_domain_add_legacy(of_node, NUM_ISA_INTERRUPTS, 0, 0, ops,
159 host_data); 159 host_data);
160} 160}
161static inline struct irq_domain *irq_domain_add_tree(struct device_node *of_node,
162 const struct irq_domain_ops *ops,
163 void *host_data)
164{
165 return __irq_domain_add(of_node, 0, ~0, 0, ops, host_data);
166}
161 167
162extern void irq_domain_remove(struct irq_domain *host); 168extern void irq_domain_remove(struct irq_domain *host);
163 169
164extern int irq_domain_associate_many(struct irq_domain *domain, 170extern int irq_domain_associate(struct irq_domain *domain, unsigned int irq,
165 unsigned int irq_base, 171 irq_hw_number_t hwirq);
166 irq_hw_number_t hwirq_base, int count); 172extern void irq_domain_associate_many(struct irq_domain *domain,
167static inline int irq_domain_associate(struct irq_domain *domain, unsigned int irq, 173 unsigned int irq_base,
168 irq_hw_number_t hwirq) 174 irq_hw_number_t hwirq_base, int count);
169{
170 return irq_domain_associate_many(domain, irq, hwirq, 1);
171}
172 175
173extern unsigned int irq_create_mapping(struct irq_domain *host, 176extern unsigned int irq_create_mapping(struct irq_domain *host,
174 irq_hw_number_t hwirq); 177 irq_hw_number_t hwirq);
175extern void irq_dispose_mapping(unsigned int virq); 178extern void irq_dispose_mapping(unsigned int virq);
179
180/**
181 * irq_linear_revmap() - Find a linux irq from a hw irq number.
182 * @domain: domain owning this hardware interrupt
183 * @hwirq: hardware irq number in that domain space
184 *
185 * This is a fast path alternative to irq_find_mapping() that can be
186 * called directly by irq controller code to save a handful of
187 * instructions. It is always safe to call, but won't find irqs mapped
188 * using the radix tree.
189 */
190static inline unsigned int irq_linear_revmap(struct irq_domain *domain,
191 irq_hw_number_t hwirq)
192{
193 return hwirq < domain->revmap_size ? domain->linear_revmap[hwirq] : 0;
194}
176extern unsigned int irq_find_mapping(struct irq_domain *host, 195extern unsigned int irq_find_mapping(struct irq_domain *host,
177 irq_hw_number_t hwirq); 196 irq_hw_number_t hwirq);
178extern unsigned int irq_create_direct_mapping(struct irq_domain *host); 197extern unsigned int irq_create_direct_mapping(struct irq_domain *host);
@@ -186,9 +205,6 @@ static inline int irq_create_identity_mapping(struct irq_domain *host,
186 return irq_create_strict_mappings(host, hwirq, hwirq, 1); 205 return irq_create_strict_mappings(host, hwirq, hwirq, 1);
187} 206}
188 207
189extern unsigned int irq_linear_revmap(struct irq_domain *host,
190 irq_hw_number_t hwirq);
191
192extern const struct irq_domain_ops irq_domain_simple_ops; 208extern const struct irq_domain_ops irq_domain_simple_ops;
193 209
194/* stock xlate functions */ 210/* stock xlate functions */
@@ -202,14 +218,6 @@ int irq_domain_xlate_onetwocell(struct irq_domain *d, struct device_node *ctrlr,
202 const u32 *intspec, unsigned int intsize, 218 const u32 *intspec, unsigned int intsize,
203 irq_hw_number_t *out_hwirq, unsigned int *out_type); 219 irq_hw_number_t *out_hwirq, unsigned int *out_type);
204 220
205#if defined(CONFIG_OF_IRQ)
206extern void irq_domain_generate_simple(const struct of_device_id *match,
207 u64 phys_base, unsigned int irq_start);
208#else /* CONFIG_OF_IRQ */
209static inline void irq_domain_generate_simple(const struct of_device_id *match,
210 u64 phys_base, unsigned int irq_start) { }
211#endif /* !CONFIG_OF_IRQ */
212
213#else /* CONFIG_IRQ_DOMAIN */ 221#else /* CONFIG_IRQ_DOMAIN */
214static inline void irq_dispose_mapping(unsigned int virq) { } 222static inline void irq_dispose_mapping(unsigned int virq) { }
215#endif /* !CONFIG_IRQ_DOMAIN */ 223#endif /* !CONFIG_IRQ_DOMAIN */
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 8fb8edf12417..97ba4e78a37e 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -139,6 +139,10 @@ static inline u64 get_jiffies_64(void)
139 ((__s64)(a) - (__s64)(b) >= 0)) 139 ((__s64)(a) - (__s64)(b) >= 0))
140#define time_before_eq64(a,b) time_after_eq64(b,a) 140#define time_before_eq64(a,b) time_after_eq64(b,a)
141 141
142#define time_in_range64(a, b, c) \
143 (time_after_eq64(a, b) && \
144 time_before_eq64(a, c))
145
142/* 146/*
143 * These four macros compare jiffies and 'a' for convenience. 147 * These four macros compare jiffies and 'a' for convenience.
144 */ 148 */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 7e6b97e77fb9..3bef14c6586b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -561,9 +561,6 @@ int __trace_bprintk(unsigned long ip, const char *fmt, ...);
561extern __printf(2, 3) 561extern __printf(2, 3)
562int __trace_printk(unsigned long ip, const char *fmt, ...); 562int __trace_printk(unsigned long ip, const char *fmt, ...);
563 563
564extern int __trace_bputs(unsigned long ip, const char *str);
565extern int __trace_puts(unsigned long ip, const char *str, int size);
566
567/** 564/**
568 * trace_puts - write a string into the ftrace buffer 565 * trace_puts - write a string into the ftrace buffer
569 * @str: the string to record 566 * @str: the string to record
@@ -599,6 +596,8 @@ extern int __trace_puts(unsigned long ip, const char *str, int size);
599 else \ 596 else \
600 __trace_puts(_THIS_IP_, str, strlen(str)); \ 597 __trace_puts(_THIS_IP_, str, strlen(str)); \
601}) 598})
599extern int __trace_bputs(unsigned long ip, const char *str);
600extern int __trace_puts(unsigned long ip, const char *str, int size);
602 601
603extern void trace_dump_stack(int skip); 602extern void trace_dump_stack(int skip);
604 603
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index bbca12804d12..debf208b7611 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -229,7 +229,8 @@ static inline ktime_t timespec_to_ktime(const struct timespec ts)
229static inline ktime_t timeval_to_ktime(const struct timeval tv) 229static inline ktime_t timeval_to_ktime(const struct timeval tv)
230{ 230{
231 return (ktime_t) { .tv = { .sec = (s32)tv.tv_sec, 231 return (ktime_t) { .tv = { .sec = (s32)tv.tv_sec,
232 .nsec = (s32)tv.tv_usec * 1000 } }; 232 .nsec = (s32)(tv.tv_usec *
233 NSEC_PER_USEC) } };
233} 234}
234 235
235/** 236/**
@@ -320,12 +321,17 @@ static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier)
320 321
321static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec) 322static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec)
322{ 323{
323 return ktime_add_ns(kt, usec * 1000); 324 return ktime_add_ns(kt, usec * NSEC_PER_USEC);
325}
326
327static inline ktime_t ktime_add_ms(const ktime_t kt, const u64 msec)
328{
329 return ktime_add_ns(kt, msec * NSEC_PER_MSEC);
324} 330}
325 331
326static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec) 332static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec)
327{ 333{
328 return ktime_sub_ns(kt, usec * 1000); 334 return ktime_sub_ns(kt, usec * NSEC_PER_USEC);
329} 335}
330 336
331extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs); 337extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
@@ -338,7 +344,8 @@ extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
338 * 344 *
339 * Returns true if there was a successful conversion, false if kt was 0. 345 * Returns true if there was a successful conversion, false if kt was 0.
340 */ 346 */
341static inline bool ktime_to_timespec_cond(const ktime_t kt, struct timespec *ts) 347static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt,
348 struct timespec *ts)
342{ 349{
343 if (kt.tv64) { 350 if (kt.tv64) {
344 *ts = ktime_to_timespec(kt); 351 *ts = ktime_to_timespec(kt);
@@ -366,7 +373,15 @@ extern void ktime_get_ts(struct timespec *ts);
366static inline ktime_t ns_to_ktime(u64 ns) 373static inline ktime_t ns_to_ktime(u64 ns)
367{ 374{
368 static const ktime_t ktime_zero = { .tv64 = 0 }; 375 static const ktime_t ktime_zero = { .tv64 = 0 };
376
369 return ktime_add_ns(ktime_zero, ns); 377 return ktime_add_ns(ktime_zero, ns);
370} 378}
371 379
380static inline ktime_t ms_to_ktime(u64 ms)
381{
382 static const ktime_t ktime_zero = { .tv64 = 0 };
383
384 return ktime_add_ms(ktime_zero, ms);
385}
386
372#endif 387#endif
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 8db53cfaccdb..a63d83ebd151 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -125,6 +125,7 @@ static inline bool is_error_page(struct page *page)
125#define KVM_REQ_MCLOCK_INPROGRESS 19 125#define KVM_REQ_MCLOCK_INPROGRESS 19
126#define KVM_REQ_EPR_EXIT 20 126#define KVM_REQ_EPR_EXIT 20
127#define KVM_REQ_SCAN_IOAPIC 21 127#define KVM_REQ_SCAN_IOAPIC 21
128#define KVM_REQ_GLOBAL_CLOCK_UPDATE 22
128 129
129#define KVM_USERSPACE_IRQ_SOURCE_ID 0 130#define KVM_USERSPACE_IRQ_SOURCE_ID 0
130#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 131#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1
@@ -145,7 +146,8 @@ struct kvm_io_range {
145#define NR_IOBUS_DEVS 1000 146#define NR_IOBUS_DEVS 1000
146 147
147struct kvm_io_bus { 148struct kvm_io_bus {
148 int dev_count; 149 int dev_count;
150 int ioeventfd_count;
149 struct kvm_io_range range[]; 151 struct kvm_io_range range[];
150}; 152};
151 153
diff --git a/include/linux/lcd.h b/include/linux/lcd.h
index e00c3b0ebc6b..504f6246f38f 100644
--- a/include/linux/lcd.h
+++ b/include/linux/lcd.h
@@ -112,7 +112,12 @@ static inline void lcd_set_power(struct lcd_device *ld, int power)
112 112
113extern struct lcd_device *lcd_device_register(const char *name, 113extern struct lcd_device *lcd_device_register(const char *name,
114 struct device *parent, void *devdata, struct lcd_ops *ops); 114 struct device *parent, void *devdata, struct lcd_ops *ops);
115extern struct lcd_device *devm_lcd_device_register(struct device *dev,
116 const char *name, struct device *parent,
117 void *devdata, struct lcd_ops *ops);
115extern void lcd_device_unregister(struct lcd_device *ld); 118extern void lcd_device_unregister(struct lcd_device *ld);
119extern void devm_lcd_device_unregister(struct device *dev,
120 struct lcd_device *ld);
116 121
117#define to_lcd_device(obj) container_of(obj, struct lcd_device, dev) 122#define to_lcd_device(obj) container_of(obj, struct lcd_device, dev)
118 123
diff --git a/include/linux/libata.h b/include/linux/libata.h
index eae7a053dc51..4ea55bb45deb 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -399,6 +399,7 @@ enum {
399 ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ 399 ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */
400 ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ 400 ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */
401 ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ 401 ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */
402 ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */
402 403
403 /* DMA mask for user DMA control: User visible values; DO NOT 404 /* DMA mask for user DMA control: User visible values; DO NOT
404 renumber */ 405 renumber */
@@ -746,6 +747,7 @@ struct ata_port {
746 /* Flags that change dynamically, protected by ap->lock */ 747 /* Flags that change dynamically, protected by ap->lock */
747 unsigned int pflags; /* ATA_PFLAG_xxx */ 748 unsigned int pflags; /* ATA_PFLAG_xxx */
748 unsigned int print_id; /* user visible unique port ID */ 749 unsigned int print_id; /* user visible unique port ID */
750 unsigned int local_port_no; /* host local port num */
749 unsigned int port_no; /* 0 based port no. inside the host */ 751 unsigned int port_no; /* 0 based port no. inside the host */
750 752
751#ifdef CONFIG_ATA_SFF 753#ifdef CONFIG_ATA_SFF
@@ -908,6 +910,9 @@ struct ata_port_operations {
908 ssize_t (*sw_activity_show)(struct ata_device *dev, char *buf); 910 ssize_t (*sw_activity_show)(struct ata_device *dev, char *buf);
909 ssize_t (*sw_activity_store)(struct ata_device *dev, 911 ssize_t (*sw_activity_store)(struct ata_device *dev,
910 enum sw_activity val); 912 enum sw_activity val);
913 ssize_t (*transmit_led_message)(struct ata_port *ap, u32 state,
914 ssize_t size);
915
911 /* 916 /*
912 * Obsolete 917 * Obsolete
913 */ 918 */
diff --git a/include/linux/lz4.h b/include/linux/lz4.h
new file mode 100644
index 000000000000..d21c13f10a64
--- /dev/null
+++ b/include/linux/lz4.h
@@ -0,0 +1,87 @@
1#ifndef __LZ4_H__
2#define __LZ4_H__
3/*
4 * LZ4 Kernel Interface
5 *
6 * Copyright (C) 2013, LG Electronics, Kyungsik Lee <kyungsik.lee@lge.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#define LZ4_MEM_COMPRESS (4096 * sizeof(unsigned char *))
13#define LZ4HC_MEM_COMPRESS (65538 * sizeof(unsigned char *))
14
15/*
16 * lz4_compressbound()
17 * Provides the maximum size that LZ4 may output in a "worst case" scenario
18 * (input data not compressible)
19 */
20static inline size_t lz4_compressbound(size_t isize)
21{
22 return isize + (isize / 255) + 16;
23}
24
25/*
26 * lz4_compress()
27 * src : source address of the original data
28 * src_len : size of the original data
29 * dst : output buffer address of the compressed data
30 * This requires 'dst' of size LZ4_COMPRESSBOUND.
31 * dst_len : is the output size, which is returned after compress done
32 * workmem : address of the working memory.
33 * This requires 'workmem' of size LZ4_MEM_COMPRESS.
34 * return : Success if return 0
35 * Error if return (< 0)
36 * note : Destination buffer and workmem must be already allocated with
37 * the defined size.
38 */
39int lz4_compress(const unsigned char *src, size_t src_len,
40 unsigned char *dst, size_t *dst_len, void *wrkmem);
41
42 /*
43 * lz4hc_compress()
44 * src : source address of the original data
45 * src_len : size of the original data
46 * dst : output buffer address of the compressed data
47 * This requires 'dst' of size LZ4_COMPRESSBOUND.
48 * dst_len : is the output size, which is returned after compress done
49 * workmem : address of the working memory.
50 * This requires 'workmem' of size LZ4HC_MEM_COMPRESS.
51 * return : Success if return 0
52 * Error if return (< 0)
53 * note : Destination buffer and workmem must be already allocated with
54 * the defined size.
55 */
56int lz4hc_compress(const unsigned char *src, size_t src_len,
57 unsigned char *dst, size_t *dst_len, void *wrkmem);
58
59/*
60 * lz4_decompress()
61 * src : source address of the compressed data
62 * src_len : is the input size, whcih is returned after decompress done
63 * dest : output buffer address of the decompressed data
64 * actual_dest_len: is the size of uncompressed data, supposing it's known
65 * return : Success if return 0
66 * Error if return (< 0)
67 * note : Destination buffer must be already allocated.
68 * slightly faster than lz4_decompress_unknownoutputsize()
69 */
70int lz4_decompress(const char *src, size_t *src_len, char *dest,
71 size_t actual_dest_len);
72
73/*
74 * lz4_decompress_unknownoutputsize()
75 * src : source address of the compressed data
76 * src_len : is the input size, therefore the compressed size
77 * dest : output buffer address of the decompressed data
78 * dest_len: is the max size of the destination buffer, which is
79 * returned with actual size of decompressed data after
80 * decompress done
81 * return : Success if return 0
82 * Error if return (< 0)
83 * note : Destination buffer must be already allocated.
84 */
85int lz4_decompress_unknownoutputsize(const char *src, size_t src_len,
86 char *dest, size_t *dest_len);
87#endif
diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h
index dd3c34ebca9a..8e9a029e093d 100644
--- a/include/linux/marvell_phy.h
+++ b/include/linux/marvell_phy.h
@@ -14,6 +14,8 @@
14#define MARVELL_PHY_ID_88E1149R 0x01410e50 14#define MARVELL_PHY_ID_88E1149R 0x01410e50
15#define MARVELL_PHY_ID_88E1240 0x01410e30 15#define MARVELL_PHY_ID_88E1240 0x01410e30
16#define MARVELL_PHY_ID_88E1318S 0x01410e90 16#define MARVELL_PHY_ID_88E1318S 0x01410e90
17#define MARVELL_PHY_ID_88E1116R 0x01410e40
18#define MARVELL_PHY_ID_88E1510 0x01410dd0
17 19
18/* struct phy_device dev_flags definitions */ 20/* struct phy_device dev_flags definitions */
19#define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001 21#define MARVELL_PHY_M1145_FLAGS_RESISTANCE 0x00000001
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index d6183f06d8c1..7b4d9d79570b 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -77,7 +77,8 @@ extern void mem_cgroup_uncharge_cache_page(struct page *page);
77 77
78bool __mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg, 78bool __mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg,
79 struct mem_cgroup *memcg); 79 struct mem_cgroup *memcg);
80int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg); 80bool task_in_mem_cgroup(struct task_struct *task,
81 const struct mem_cgroup *memcg);
81 82
82extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); 83extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page);
83extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); 84extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
@@ -273,10 +274,10 @@ static inline bool mm_match_cgroup(struct mm_struct *mm,
273 return true; 274 return true;
274} 275}
275 276
276static inline int task_in_mem_cgroup(struct task_struct *task, 277static inline bool task_in_mem_cgroup(struct task_struct *task,
277 const struct mem_cgroup *memcg) 278 const struct mem_cgroup *memcg)
278{ 279{
279 return 1; 280 return true;
280} 281}
281 282
282static inline struct cgroup_subsys_state 283static inline struct cgroup_subsys_state
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 3e622c610925..dd38e62b84d2 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -234,6 +234,8 @@ static inline void unlock_memory_hotplug(void) {}
234 234
235extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); 235extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages);
236extern void try_offline_node(int nid); 236extern void try_offline_node(int nid);
237extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages);
238extern void remove_memory(int nid, u64 start, u64 size);
237 239
238#else 240#else
239static inline int is_mem_section_removable(unsigned long pfn, 241static inline int is_mem_section_removable(unsigned long pfn,
@@ -243,15 +245,23 @@ static inline int is_mem_section_removable(unsigned long pfn,
243} 245}
244 246
245static inline void try_offline_node(int nid) {} 247static inline void try_offline_node(int nid) {}
248
249static inline int offline_pages(unsigned long start_pfn, unsigned long nr_pages)
250{
251 return -EINVAL;
252}
253
254static inline void remove_memory(int nid, u64 start, u64 size) {}
246#endif /* CONFIG_MEMORY_HOTREMOVE */ 255#endif /* CONFIG_MEMORY_HOTREMOVE */
247 256
257extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn,
258 void *arg, int (*func)(struct memory_block *, void *));
248extern int mem_online_node(int nid); 259extern int mem_online_node(int nid);
249extern int add_memory(int nid, u64 start, u64 size); 260extern int add_memory(int nid, u64 start, u64 size);
250extern int arch_add_memory(int nid, u64 start, u64 size); 261extern int arch_add_memory(int nid, u64 start, u64 size);
251extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); 262extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages);
252extern int offline_memory_block(struct memory_block *mem);
253extern bool is_memblock_offlined(struct memory_block *mem); 263extern bool is_memblock_offlined(struct memory_block *mem);
254extern int remove_memory(int nid, u64 start, u64 size); 264extern void remove_memory(int nid, u64 start, u64 size);
255extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, 265extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
256 int nr_pages); 266 int nr_pages);
257extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); 267extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms);
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h
index e94537befabd..97cb283cc8e1 100644
--- a/include/linux/mfd/88pm80x.h
+++ b/include/linux/mfd/88pm80x.h
@@ -17,7 +17,6 @@
17#include <linux/regmap.h> 17#include <linux/regmap.h>
18#include <linux/atomic.h> 18#include <linux/atomic.h>
19 19
20#define PM80X_VERSION_MASK (0xFF) /* 80X chip ID mask */
21enum { 20enum {
22 CHIP_INVALID = 0, 21 CHIP_INVALID = 0,
23 CHIP_PM800, 22 CHIP_PM800,
@@ -299,8 +298,7 @@ struct pm80x_chip {
299 struct regmap *regmap; 298 struct regmap *regmap;
300 struct regmap_irq_chip *regmap_irq_chip; 299 struct regmap_irq_chip *regmap_irq_chip;
301 struct regmap_irq_chip_data *irq_data; 300 struct regmap_irq_chip_data *irq_data;
302 unsigned char version; 301 int type;
303 int id;
304 int irq; 302 int irq;
305 int irq_mode; 303 int irq_mode;
306 unsigned long wu_flag; 304 unsigned long wu_flag;
@@ -309,8 +307,14 @@ struct pm80x_chip {
309 307
310struct pm80x_platform_data { 308struct pm80x_platform_data {
311 struct pm80x_rtc_pdata *rtc; 309 struct pm80x_rtc_pdata *rtc;
312 unsigned short power_page_addr; /* power page I2C address */ 310 /*
313 unsigned short gpadc_page_addr; /* gpadc page I2C address */ 311 * For the regulator not defined, set regulators[not_defined] to be
312 * NULL. num_regulators are the number of regulators supposed to be
313 * initialized. If all regulators are not defined, set num_regulators
314 * to be 0.
315 */
316 struct regulator_init_data *regulators[PM800_ID_RG_MAX];
317 unsigned int num_regulators;
314 int irq_mode; /* Clear interrupt by read/write(0/1) */ 318 int irq_mode; /* Clear interrupt by read/write(0/1) */
315 int batt_det; /* enable/disable */ 319 int batt_det; /* enable/disable */
316 int (*plat_config)(struct pm80x_chip *chip, 320 int (*plat_config)(struct pm80x_chip *chip,
@@ -363,7 +367,6 @@ static inline int pm80x_dev_resume(struct device *dev)
363} 367}
364#endif 368#endif
365 369
366extern int pm80x_init(struct i2c_client *client, 370extern int pm80x_init(struct i2c_client *client);
367 const struct i2c_device_id *id);
368extern int pm80x_deinit(void); 371extern int pm80x_deinit(void);
369#endif /* __LINUX_MFD_88PM80X_H */ 372#endif /* __LINUX_MFD_88PM80X_H */
diff --git a/include/linux/mfd/abx500/ab8500-sysctrl.h b/include/linux/mfd/abx500/ab8500-sysctrl.h
index 990bc93f46e1..adba89d9c660 100644
--- a/include/linux/mfd/abx500/ab8500-sysctrl.h
+++ b/include/linux/mfd/abx500/ab8500-sysctrl.h
@@ -278,8 +278,8 @@ struct ab8500_sysctrl_platform_data {
278 278
279#define AB9540_SYSCLK12CONFCTRL_PLL26TO38ENA BIT(0) 279#define AB9540_SYSCLK12CONFCTRL_PLL26TO38ENA BIT(0)
280#define AB9540_SYSCLK12CONFCTRL_SYSCLK12USBMUXSEL BIT(1) 280#define AB9540_SYSCLK12CONFCTRL_SYSCLK12USBMUXSEL BIT(1)
281#define AB9540_SYSCLK12CONFCTRL_INT384MHZMUXSEL_MASK 0x0C 281#define AB9540_SYSCLK12CONFCTRL_INT384MHZMUXSEL0 BIT(2)
282#define AB9540_SYSCLK12CONFCTRL_INT384MHZMUXSEL_SHIFT 2 282#define AB9540_SYSCLK12CONFCTRL_INT384MHZMUXSEL1 BIT(3)
283#define AB9540_SYSCLK12CONFCTRL_SYSCLK12BUFMUX BIT(4) 283#define AB9540_SYSCLK12CONFCTRL_SYSCLK12BUFMUX BIT(4)
284#define AB9540_SYSCLK12CONFCTRL_SYSCLK12PLLMUX BIT(5) 284#define AB9540_SYSCLK12CONFCTRL_SYSCLK12PLLMUX BIT(5)
285#define AB9540_SYSCLK12CONFCTRL_SYSCLK2MUXVALID BIT(6) 285#define AB9540_SYSCLK12CONFCTRL_SYSCLK2MUXVALID BIT(6)
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 0390d5943ed6..f4acd898dac9 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -291,6 +291,8 @@ enum ab8500_version {
291#define AB8540_INT_FSYNC2R 213 291#define AB8540_INT_FSYNC2R 213
292#define AB8540_INT_BITCLK2F 214 292#define AB8540_INT_BITCLK2F 214
293#define AB8540_INT_BITCLK2R 215 293#define AB8540_INT_BITCLK2R 215
294/* ab8540_irq_regoffset[27] -> IT[Source|Latch|Mask]33 */
295#define AB8540_INT_RTC_1S 216
294 296
295/* 297/*
296 * AB8500_AB9540_NR_IRQS is used when configuring the IRQ numbers for the 298 * AB8500_AB9540_NR_IRQS is used when configuring the IRQ numbers for the
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h
index cc281368dc55..5cf8b91ce996 100644
--- a/include/linux/mfd/arizona/core.h
+++ b/include/linux/mfd/arizona/core.h
@@ -23,6 +23,7 @@
23enum arizona_type { 23enum arizona_type {
24 WM5102 = 1, 24 WM5102 = 1,
25 WM5110 = 2, 25 WM5110 = 2,
26 WM8997 = 3,
26}; 27};
27 28
28#define ARIZONA_IRQ_GP1 0 29#define ARIZONA_IRQ_GP1 0
@@ -95,6 +96,8 @@ struct arizona {
95 96
96 struct arizona_pdata pdata; 97 struct arizona_pdata pdata;
97 98
99 unsigned int external_dcvdd:1;
100
98 int irq; 101 int irq;
99 struct irq_domain *virq; 102 struct irq_domain *virq;
100 struct regmap_irq_chip_data *aod_irq_chip; 103 struct regmap_irq_chip_data *aod_irq_chip;
@@ -119,5 +122,6 @@ int arizona_set_irq_wake(struct arizona *arizona, int irq, int on);
119 122
120int wm5102_patch(struct arizona *arizona); 123int wm5102_patch(struct arizona *arizona);
121int wm5110_patch(struct arizona *arizona); 124int wm5110_patch(struct arizona *arizona);
125int wm8997_patch(struct arizona *arizona);
122 126
123#endif 127#endif
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 80dead1f7100..12a5c135c746 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -77,7 +77,7 @@ struct arizona_micbias {
77 int mV; /** Regulated voltage */ 77 int mV; /** Regulated voltage */
78 unsigned int ext_cap:1; /** External capacitor fitted */ 78 unsigned int ext_cap:1; /** External capacitor fitted */
79 unsigned int discharge:1; /** Actively discharge */ 79 unsigned int discharge:1; /** Actively discharge */
80 unsigned int fast_start:1; /** Enable aggressive startup ramp rate */ 80 unsigned int soft_start:1; /** Disable aggressive startup ramp rate */
81 unsigned int bypass:1; /** Use bypass mode */ 81 unsigned int bypass:1; /** Use bypass mode */
82}; 82};
83 83
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h
index 715b6ba3d52a..4706d3d46e56 100644
--- a/include/linux/mfd/arizona/registers.h
+++ b/include/linux/mfd/arizona/registers.h
@@ -215,6 +215,9 @@
215#define ARIZONA_DAC_DIGITAL_VOLUME_6R 0x43D 215#define ARIZONA_DAC_DIGITAL_VOLUME_6R 0x43D
216#define ARIZONA_DAC_VOLUME_LIMIT_6R 0x43E 216#define ARIZONA_DAC_VOLUME_LIMIT_6R 0x43E
217#define ARIZONA_NOISE_GATE_SELECT_6R 0x43F 217#define ARIZONA_NOISE_GATE_SELECT_6R 0x43F
218#define ARIZONA_DRE_ENABLE 0x440
219#define ARIZONA_DRE_CONTROL_2 0x442
220#define ARIZONA_DRE_CONTROL_3 0x443
218#define ARIZONA_DAC_AEC_CONTROL_1 0x450 221#define ARIZONA_DAC_AEC_CONTROL_1 0x450
219#define ARIZONA_NOISE_GATE_CONTROL 0x458 222#define ARIZONA_NOISE_GATE_CONTROL 0x458
220#define ARIZONA_PDM_SPK1_CTRL_1 0x490 223#define ARIZONA_PDM_SPK1_CTRL_1 0x490
@@ -1002,6 +1005,7 @@
1002#define ARIZONA_DSP2_CLOCKING_1 0x1201 1005#define ARIZONA_DSP2_CLOCKING_1 0x1201
1003#define ARIZONA_DSP2_STATUS_1 0x1204 1006#define ARIZONA_DSP2_STATUS_1 0x1204
1004#define ARIZONA_DSP2_STATUS_2 0x1205 1007#define ARIZONA_DSP2_STATUS_2 0x1205
1008#define ARIZONA_DSP2_STATUS_3 0x1206
1005#define ARIZONA_DSP2_SCRATCH_0 0x1240 1009#define ARIZONA_DSP2_SCRATCH_0 0x1240
1006#define ARIZONA_DSP2_SCRATCH_1 0x1241 1010#define ARIZONA_DSP2_SCRATCH_1 0x1241
1007#define ARIZONA_DSP2_SCRATCH_2 0x1242 1011#define ARIZONA_DSP2_SCRATCH_2 0x1242
@@ -1010,6 +1014,7 @@
1010#define ARIZONA_DSP3_CLOCKING_1 0x1301 1014#define ARIZONA_DSP3_CLOCKING_1 0x1301
1011#define ARIZONA_DSP3_STATUS_1 0x1304 1015#define ARIZONA_DSP3_STATUS_1 0x1304
1012#define ARIZONA_DSP3_STATUS_2 0x1305 1016#define ARIZONA_DSP3_STATUS_2 0x1305
1017#define ARIZONA_DSP3_STATUS_3 0x1306
1013#define ARIZONA_DSP3_SCRATCH_0 0x1340 1018#define ARIZONA_DSP3_SCRATCH_0 0x1340
1014#define ARIZONA_DSP3_SCRATCH_1 0x1341 1019#define ARIZONA_DSP3_SCRATCH_1 0x1341
1015#define ARIZONA_DSP3_SCRATCH_2 0x1342 1020#define ARIZONA_DSP3_SCRATCH_2 0x1342
@@ -1018,6 +1023,7 @@
1018#define ARIZONA_DSP4_CLOCKING_1 0x1401 1023#define ARIZONA_DSP4_CLOCKING_1 0x1401
1019#define ARIZONA_DSP4_STATUS_1 0x1404 1024#define ARIZONA_DSP4_STATUS_1 0x1404
1020#define ARIZONA_DSP4_STATUS_2 0x1405 1025#define ARIZONA_DSP4_STATUS_2 0x1405
1026#define ARIZONA_DSP4_STATUS_3 0x1406
1021#define ARIZONA_DSP4_SCRATCH_0 0x1440 1027#define ARIZONA_DSP4_SCRATCH_0 0x1440
1022#define ARIZONA_DSP4_SCRATCH_1 0x1441 1028#define ARIZONA_DSP4_SCRATCH_1 0x1441
1023#define ARIZONA_DSP4_SCRATCH_2 0x1442 1029#define ARIZONA_DSP4_SCRATCH_2 0x1442
@@ -3130,6 +3136,47 @@
3130#define ARIZONA_OUT6R_NGATE_SRC_WIDTH 12 /* OUT6R_NGATE_SRC - [11:0] */ 3136#define ARIZONA_OUT6R_NGATE_SRC_WIDTH 12 /* OUT6R_NGATE_SRC - [11:0] */
3131 3137
3132/* 3138/*
3139 * R1088 (0x440) - DRE Enable
3140 */
3141#define ARIZONA_DRE3L_ENA 0x0010 /* DRE3L_ENA */
3142#define ARIZONA_DRE3L_ENA_MASK 0x0010 /* DRE3L_ENA */
3143#define ARIZONA_DRE3L_ENA_SHIFT 4 /* DRE3L_ENA */
3144#define ARIZONA_DRE3L_ENA_WIDTH 1 /* DRE3L_ENA */
3145#define ARIZONA_DRE2R_ENA 0x0008 /* DRE2R_ENA */
3146#define ARIZONA_DRE2R_ENA_MASK 0x0008 /* DRE2R_ENA */
3147#define ARIZONA_DRE2R_ENA_SHIFT 3 /* DRE2R_ENA */
3148#define ARIZONA_DRE2R_ENA_WIDTH 1 /* DRE2R_ENA */
3149#define ARIZONA_DRE2L_ENA 0x0004 /* DRE2L_ENA */
3150#define ARIZONA_DRE2L_ENA_MASK 0x0004 /* DRE2L_ENA */
3151#define ARIZONA_DRE2L_ENA_SHIFT 2 /* DRE2L_ENA */
3152#define ARIZONA_DRE2L_ENA_WIDTH 1 /* DRE2L_ENA */
3153#define ARIZONA_DRE1R_ENA 0x0002 /* DRE1R_ENA */
3154#define ARIZONA_DRE1R_ENA_MASK 0x0002 /* DRE1R_ENA */
3155#define ARIZONA_DRE1R_ENA_SHIFT 1 /* DRE1R_ENA */
3156#define ARIZONA_DRE1R_ENA_WIDTH 1 /* DRE1R_ENA */
3157#define ARIZONA_DRE1L_ENA 0x0001 /* DRE1L_ENA */
3158#define ARIZONA_DRE1L_ENA_MASK 0x0001 /* DRE1L_ENA */
3159#define ARIZONA_DRE1L_ENA_SHIFT 0 /* DRE1L_ENA */
3160#define ARIZONA_DRE1L_ENA_WIDTH 1 /* DRE1L_ENA */
3161
3162/*
3163 * R1090 (0x442) - DRE Control 2
3164 */
3165#define ARIZONA_DRE_T_LOW_MASK 0x3F00 /* DRE_T_LOW - [13:8] */
3166#define ARIZONA_DRE_T_LOW_SHIFT 8 /* DRE_T_LOW - [13:8] */
3167#define ARIZONA_DRE_T_LOW_WIDTH 6 /* DRE_T_LOW - [13:8] */
3168
3169/*
3170 * R1091 (0x443) - DRE Control 3
3171 */
3172#define ARIZONA_DRE_GAIN_SHIFT_MASK 0xC000 /* DRE_GAIN_SHIFT - [15:14] */
3173#define ARIZONA_DRE_GAIN_SHIFT_SHIFT 14 /* DRE_GAIN_SHIFT - [15:14] */
3174#define ARIZONA_DRE_GAIN_SHIFT_WIDTH 2 /* DRE_GAIN_SHIFT - [15:14] */
3175#define ARIZONA_DRE_LOW_LEVEL_ABS_MASK 0x000F /* LOW_LEVEL_ABS - [3:0] */
3176#define ARIZONA_DRE_LOW_LEVEL_ABS_SHIFT 0 /* LOW_LEVEL_ABS - [3:0] */
3177#define ARIZONA_DRE_LOW_LEVEL_ABS_WIDTH 4 /* LOW_LEVEL_ABS - [3:0] */
3178
3179/*
3133 * R1104 (0x450) - DAC AEC Control 1 3180 * R1104 (0x450) - DAC AEC Control 1
3134 */ 3181 */
3135#define ARIZONA_AEC_LOOPBACK_SRC_MASK 0x003C /* AEC_LOOPBACK_SRC - [5:2] */ 3182#define ARIZONA_AEC_LOOPBACK_SRC_MASK 0x003C /* AEC_LOOPBACK_SRC - [5:2] */
diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h
index 7dd6524d2aac..13a1ee95a233 100644
--- a/include/linux/mfd/davinci_voicecodec.h
+++ b/include/linux/mfd/davinci_voicecodec.h
@@ -28,6 +28,8 @@
28#include <linux/mfd/core.h> 28#include <linux/mfd/core.h>
29#include <linux/platform_data/edma.h> 29#include <linux/platform_data/edma.h>
30 30
31#include <mach/hardware.h>
32
31/* 33/*
32 * Register values. 34 * Register values.
33 */ 35 */
@@ -111,8 +113,6 @@ struct davinci_vc {
111 113
112 /* Memory resources */ 114 /* Memory resources */
113 void __iomem *base; 115 void __iomem *base;
114 resource_size_t pbase;
115 size_t base_size;
116 116
117 /* MFD cells */ 117 /* MFD cells */
118 struct mfd_cell cells[DAVINCI_VC_CELLS]; 118 struct mfd_cell cells[DAVINCI_VC_CELLS];
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
index 689e6a0d9c99..ca0790fba2f5 100644
--- a/include/linux/mfd/dbx500-prcmu.h
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -134,6 +134,11 @@ enum prcmu_clock {
134 PRCMU_SIACLK, 134 PRCMU_SIACLK,
135 PRCMU_SVACLK, 135 PRCMU_SVACLK,
136 PRCMU_ACLK, 136 PRCMU_ACLK,
137 PRCMU_HVACLK, /* Ux540 only */
138 PRCMU_G1CLK, /* Ux540 only */
139 PRCMU_SDMMCHCLK,
140 PRCMU_CAMCLK,
141 PRCMU_BML8580CLK,
137 PRCMU_NUM_REG_CLOCKS, 142 PRCMU_NUM_REG_CLOCKS,
138 PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS, 143 PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS,
139 PRCMU_CDCLK, 144 PRCMU_CDCLK,
@@ -148,6 +153,13 @@ enum prcmu_clock {
148 PRCMU_DSI0ESCCLK, 153 PRCMU_DSI0ESCCLK,
149 PRCMU_DSI1ESCCLK, 154 PRCMU_DSI1ESCCLK,
150 PRCMU_DSI2ESCCLK, 155 PRCMU_DSI2ESCCLK,
156 /* LCD DSI PLL - Ux540 only */
157 PRCMU_PLLDSI_LCD,
158 PRCMU_DSI0CLK_LCD,
159 PRCMU_DSI1CLK_LCD,
160 PRCMU_DSI0ESCCLK_LCD,
161 PRCMU_DSI1ESCCLK_LCD,
162 PRCMU_DSI2ESCCLK_LCD,
151}; 163};
152 164
153/** 165/**
diff --git a/include/linux/mfd/kempld.h b/include/linux/mfd/kempld.h
new file mode 100644
index 000000000000..b911ef3add03
--- /dev/null
+++ b/include/linux/mfd/kempld.h
@@ -0,0 +1,125 @@
1/*
2 * Kontron PLD driver definitions
3 *
4 * Copyright (c) 2010-2012 Kontron Europe GmbH
5 * Author: Michael Brunner <michael.brunner@kontron.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 2 as published
9 * by the Free Software Foundation.
10 */
11
12#ifndef _LINUX_MFD_KEMPLD_H_
13#define _LINUX_MFD_KEMPLD_H_
14
15/* kempld register definitions */
16#define KEMPLD_IOINDEX 0xa80
17#define KEMPLD_IODATA 0xa81
18#define KEMPLD_MUTEX_KEY 0x80
19#define KEMPLD_VERSION 0x00
20#define KEMPLD_VERSION_LSB 0x00
21#define KEMPLD_VERSION_MSB 0x01
22#define KEMPLD_VERSION_GET_MINOR(x) (x & 0x1f)
23#define KEMPLD_VERSION_GET_MAJOR(x) ((x >> 5) & 0x1f)
24#define KEMPLD_VERSION_GET_NUMBER(x) ((x >> 10) & 0xf)
25#define KEMPLD_VERSION_GET_TYPE(x) ((x >> 14) & 0x3)
26#define KEMPLD_BUILDNR 0x02
27#define KEMPLD_BUILDNR_LSB 0x02
28#define KEMPLD_BUILDNR_MSB 0x03
29#define KEMPLD_FEATURE 0x04
30#define KEMPLD_FEATURE_LSB 0x04
31#define KEMPLD_FEATURE_MSB 0x05
32#define KEMPLD_FEATURE_BIT_I2C (1 << 0)
33#define KEMPLD_FEATURE_BIT_WATCHDOG (1 << 1)
34#define KEMPLD_FEATURE_BIT_GPIO (1 << 2)
35#define KEMPLD_FEATURE_MASK_UART (7 << 3)
36#define KEMPLD_FEATURE_BIT_NMI (1 << 8)
37#define KEMPLD_FEATURE_BIT_SMI (1 << 9)
38#define KEMPLD_FEATURE_BIT_SCI (1 << 10)
39#define KEMPLD_SPEC 0x06
40#define KEMPLD_SPEC_GET_MINOR(x) (x & 0x0f)
41#define KEMPLD_SPEC_GET_MAJOR(x) ((x >> 4) & 0x0f)
42#define KEMPLD_IRQ_GPIO 0x35
43#define KEMPLD_IRQ_I2C 0x36
44#define KEMPLD_CFG 0x37
45#define KEMPLD_CFG_GPIO_I2C_MUX (1 << 0)
46#define KEMPLD_CFG_BIOS_WP (1 << 7)
47
48#define KEMPLD_CLK 33333333
49
50#define KEMPLD_TYPE_RELEASE 0x0
51#define KEMPLD_TYPE_DEBUG 0x1
52#define KEMPLD_TYPE_CUSTOM 0x2
53
54/**
55 * struct kempld_info - PLD device information structure
56 * @major: PLD major revision
57 * @minor: PLD minor revision
58 * @buildnr: PLD build number
59 * @number: PLD board specific index
60 * @type: PLD type
61 * @spec_major: PLD FW specification major revision
62 * @spec_minor: PLD FW specification minor revision
63 */
64struct kempld_info {
65 unsigned int major;
66 unsigned int minor;
67 unsigned int buildnr;
68 unsigned int number;
69 unsigned int type;
70 unsigned int spec_major;
71 unsigned int spec_minor;
72};
73
74/**
75 * struct kempld_device_data - Internal representation of the PLD device
76 * @io_base: Pointer to the IO memory
77 * @io_index: Pointer to the IO index register
78 * @io_data: Pointer to the IO data register
79 * @pld_clock: PLD clock frequency
80 * @feature_mask: PLD feature mask
81 * @dev: Pointer to kernel device structure
82 * @info: KEMPLD info structure
83 * @lock: PLD mutex
84 */
85struct kempld_device_data {
86 void __iomem *io_base;
87 void __iomem *io_index;
88 void __iomem *io_data;
89 u32 pld_clock;
90 u32 feature_mask;
91 struct device *dev;
92 struct kempld_info info;
93 struct mutex lock;
94};
95
96/**
97 * struct kempld_platform_data - PLD hardware configuration structure
98 * @pld_clock: PLD clock frequency
99 * @gpio_base GPIO base pin number
100 * @ioresource: IO addresses of the PLD
101 * @get_mutex: PLD specific get_mutex callback
102 * @release_mutex: PLD specific release_mutex callback
103 * @get_info: PLD specific get_info callback
104 * @register_cells: PLD specific register_cells callback
105 */
106struct kempld_platform_data {
107 u32 pld_clock;
108 int gpio_base;
109 struct resource *ioresource;
110 void (*get_hardware_mutex) (struct kempld_device_data *);
111 void (*release_hardware_mutex) (struct kempld_device_data *);
112 int (*get_info) (struct kempld_device_data *);
113 int (*register_cells) (struct kempld_device_data *);
114};
115
116extern void kempld_get_mutex(struct kempld_device_data *pld);
117extern void kempld_release_mutex(struct kempld_device_data *pld);
118extern u8 kempld_read8(struct kempld_device_data *pld, u8 index);
119extern void kempld_write8(struct kempld_device_data *pld, u8 index, u8 data);
120extern u16 kempld_read16(struct kempld_device_data *pld, u8 index);
121extern void kempld_write16(struct kempld_device_data *pld, u8 index, u16 data);
122extern u32 kempld_read32(struct kempld_device_data *pld, u8 index);
123extern void kempld_write32(struct kempld_device_data *pld, u8 index, u32 data);
124
125#endif /* _LINUX_MFD_KEMPLD_H_ */
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h
index 1aa4f13cdfa6..244fb0d51589 100644
--- a/include/linux/mfd/max77693-private.h
+++ b/include/linux/mfd/max77693-private.h
@@ -85,6 +85,19 @@ enum max77693_pmic_reg {
85 MAX77693_PMIC_REG_END, 85 MAX77693_PMIC_REG_END,
86}; 86};
87 87
88/* MAX77693 CHG_CNFG_00 register */
89#define CHG_CNFG_00_CHG_MASK 0x1
90#define CHG_CNFG_00_BUCK_MASK 0x4
91
92/* MAX77693 CHG_CNFG_09 Register */
93#define CHG_CNFG_09_CHGIN_ILIM_MASK 0x7F
94
95/* MAX77693 CHG_CTRL Register */
96#define SAFEOUT_CTRL_SAFEOUT1_MASK 0x3
97#define SAFEOUT_CTRL_SAFEOUT2_MASK 0xC
98#define SAFEOUT_CTRL_ENSAFEOUT1_MASK 0x40
99#define SAFEOUT_CTRL_ENSAFEOUT2_MASK 0x80
100
88/* Slave addr = 0x4A: MUIC */ 101/* Slave addr = 0x4A: MUIC */
89enum max77693_muic_reg { 102enum max77693_muic_reg {
90 MAX77693_MUIC_REG_ID = 0x00, 103 MAX77693_MUIC_REG_ID = 0x00,
diff --git a/include/linux/mfd/max77693.h b/include/linux/mfd/max77693.h
index 3109a6c5c948..676f0f388992 100644
--- a/include/linux/mfd/max77693.h
+++ b/include/linux/mfd/max77693.h
@@ -30,6 +30,20 @@
30#ifndef __LINUX_MFD_MAX77693_H 30#ifndef __LINUX_MFD_MAX77693_H
31#define __LINUX_MFD_MAX77693_H 31#define __LINUX_MFD_MAX77693_H
32 32
33/* MAX77686 regulator IDs */
34enum max77693_regulators {
35 MAX77693_ESAFEOUT1 = 0,
36 MAX77693_ESAFEOUT2,
37 MAX77693_CHARGER,
38 MAX77693_REG_MAX,
39};
40
41struct max77693_regulator_data {
42 int id;
43 struct regulator_init_data *initdata;
44 struct device_node *of_node;
45};
46
33struct max77693_reg_data { 47struct max77693_reg_data {
34 u8 addr; 48 u8 addr;
35 u8 data; 49 u8 data;
@@ -52,6 +66,10 @@ struct max77693_muic_platform_data {
52struct max77693_platform_data { 66struct max77693_platform_data {
53 int wakeup; 67 int wakeup;
54 68
69 /* regulator data */
70 struct max77693_regulator_data *regulators;
71 int num_regulators;
72
55 /* muic data */ 73 /* muic data */
56 struct max77693_muic_platform_data *muic_data; 74 struct max77693_muic_platform_data *muic_data;
57}; 75};
diff --git a/include/linux/mfd/max8998-private.h b/include/linux/mfd/max8998-private.h
index effa5d3b96ae..84844e0a5704 100644
--- a/include/linux/mfd/max8998-private.h
+++ b/include/linux/mfd/max8998-private.h
@@ -132,9 +132,12 @@ enum {
132 132
133#define MAX8998_ENRAMP (1 << 4) 133#define MAX8998_ENRAMP (1 << 4)
134 134
135struct irq_domain;
136
135/** 137/**
136 * struct max8998_dev - max8998 master device for sub-drivers 138 * struct max8998_dev - max8998 master device for sub-drivers
137 * @dev: master device of the chip (can be used to access platform data) 139 * @dev: master device of the chip (can be used to access platform data)
140 * @pdata: platform data for the driver and subdrivers
138 * @i2c: i2c client private data for regulator 141 * @i2c: i2c client private data for regulator
139 * @rtc: i2c client private data for rtc 142 * @rtc: i2c client private data for rtc
140 * @iolock: mutex for serializing io access 143 * @iolock: mutex for serializing io access
@@ -148,12 +151,14 @@ enum {
148 */ 151 */
149struct max8998_dev { 152struct max8998_dev {
150 struct device *dev; 153 struct device *dev;
154 struct max8998_platform_data *pdata;
151 struct i2c_client *i2c; 155 struct i2c_client *i2c;
152 struct i2c_client *rtc; 156 struct i2c_client *rtc;
153 struct mutex iolock; 157 struct mutex iolock;
154 struct mutex irqlock; 158 struct mutex irqlock;
155 159
156 int irq_base; 160 unsigned int irq_base;
161 struct irq_domain *irq_domain;
157 int irq; 162 int irq;
158 int ono; 163 int ono;
159 u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS]; 164 u8 irq_masks_cur[MAX8998_NUM_IRQ_REGS];
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h
index 6823548d0c0a..e3956a654cbc 100644
--- a/include/linux/mfd/max8998.h
+++ b/include/linux/mfd/max8998.h
@@ -58,10 +58,12 @@ enum {
58 * max8998_regulator_data - regulator data 58 * max8998_regulator_data - regulator data
59 * @id: regulator id 59 * @id: regulator id
60 * @initdata: regulator init data (contraints, supplies, ...) 60 * @initdata: regulator init data (contraints, supplies, ...)
61 * @reg_node: DT node of regulator (unused on non-DT platforms)
61 */ 62 */
62struct max8998_regulator_data { 63struct max8998_regulator_data {
63 int id; 64 int id;
64 struct regulator_init_data *initdata; 65 struct regulator_init_data *initdata;
66 struct device_node *reg_node;
65}; 67};
66 68
67/** 69/**
@@ -73,12 +75,8 @@ struct max8998_regulator_data {
73 * @buck_voltage_lock: Do NOT change the values of the following six 75 * @buck_voltage_lock: Do NOT change the values of the following six
74 * registers set by buck?_voltage?. The voltage of BUCK1/2 cannot 76 * registers set by buck?_voltage?. The voltage of BUCK1/2 cannot
75 * be other than the preset values. 77 * be other than the preset values.
76 * @buck1_voltage1: BUCK1 DVS mode 1 voltage register 78 * @buck1_voltage: BUCK1 DVS mode 1 voltage registers
77 * @buck1_voltage2: BUCK1 DVS mode 2 voltage register 79 * @buck2_voltage: BUCK2 DVS mode 2 voltage registers
78 * @buck1_voltage3: BUCK1 DVS mode 3 voltage register
79 * @buck1_voltage4: BUCK1 DVS mode 4 voltage register
80 * @buck2_voltage1: BUCK2 DVS mode 1 voltage register
81 * @buck2_voltage2: BUCK2 DVS mode 2 voltage register
82 * @buck1_set1: BUCK1 gpio pin 1 to set output voltage 80 * @buck1_set1: BUCK1 gpio pin 1 to set output voltage
83 * @buck1_set2: BUCK1 gpio pin 2 to set output voltage 81 * @buck1_set2: BUCK1 gpio pin 2 to set output voltage
84 * @buck1_default_idx: Default for BUCK1 gpio pin 1, 2 82 * @buck1_default_idx: Default for BUCK1 gpio pin 1, 2
@@ -100,15 +98,11 @@ struct max8998_regulator_data {
100struct max8998_platform_data { 98struct max8998_platform_data {
101 struct max8998_regulator_data *regulators; 99 struct max8998_regulator_data *regulators;
102 int num_regulators; 100 int num_regulators;
103 int irq_base; 101 unsigned int irq_base;
104 int ono; 102 int ono;
105 bool buck_voltage_lock; 103 bool buck_voltage_lock;
106 int buck1_voltage1; 104 int buck1_voltage[4];
107 int buck1_voltage2; 105 int buck2_voltage[2];
108 int buck1_voltage3;
109 int buck1_voltage4;
110 int buck2_voltage1;
111 int buck2_voltage2;
112 int buck1_set1; 106 int buck1_set1;
113 int buck1_set2; 107 int buck1_set2;
114 int buck1_default_idx; 108 int buck1_default_idx;
diff --git a/include/linux/mfd/mc13xxx.h b/include/linux/mfd/mc13xxx.h
index bf070755982e..41ed59276c00 100644
--- a/include/linux/mfd/mc13xxx.h
+++ b/include/linux/mfd/mc13xxx.h
@@ -78,20 +78,30 @@ struct mc13xxx_regulator_platform_data {
78 struct mc13xxx_regulator_init_data *regulators; 78 struct mc13xxx_regulator_init_data *regulators;
79}; 79};
80 80
81enum {
82 /* MC13783 LED IDs */
83 MC13783_LED_MD,
84 MC13783_LED_AD,
85 MC13783_LED_KP,
86 MC13783_LED_R1,
87 MC13783_LED_G1,
88 MC13783_LED_B1,
89 MC13783_LED_R2,
90 MC13783_LED_G2,
91 MC13783_LED_B2,
92 MC13783_LED_R3,
93 MC13783_LED_G3,
94 MC13783_LED_B3,
95 /* MC13892 LED IDs */
96 MC13892_LED_MD,
97 MC13892_LED_AD,
98 MC13892_LED_KP,
99 MC13892_LED_R,
100 MC13892_LED_G,
101 MC13892_LED_B,
102};
103
81struct mc13xxx_led_platform_data { 104struct mc13xxx_led_platform_data {
82#define MC13783_LED_MD 0
83#define MC13783_LED_AD 1
84#define MC13783_LED_KP 2
85#define MC13783_LED_R1 3
86#define MC13783_LED_G1 4
87#define MC13783_LED_B1 5
88#define MC13783_LED_R2 6
89#define MC13783_LED_G2 7
90#define MC13783_LED_B2 8
91#define MC13783_LED_R3 9
92#define MC13783_LED_G3 10
93#define MC13783_LED_B3 11
94#define MC13783_LED_MAX MC13783_LED_B3
95 int id; 105 int id;
96 const char *name; 106 const char *name;
97 const char *default_trigger; 107 const char *default_trigger;
@@ -100,46 +110,36 @@ struct mc13xxx_led_platform_data {
100 char max_current; 110 char max_current;
101}; 111};
102 112
113#define MAX_LED_CONTROL_REGS 6
114
103struct mc13xxx_leds_platform_data { 115struct mc13xxx_leds_platform_data {
104 int num_leds;
105 struct mc13xxx_led_platform_data *led; 116 struct mc13xxx_led_platform_data *led;
117 int num_leds;
106 118
107#define MC13783_LED_TRIODE_MD (1 << 0) 119/* LED Control 0 */
108#define MC13783_LED_TRIODE_AD (1 << 1) 120#define MC13783_LED_C0_ENABLE (1 << 0)
109#define MC13783_LED_TRIODE_KP (1 << 2) 121#define MC13783_LED_C0_TRIODE_MD (1 << 7)
110#define MC13783_LED_BOOST_EN (1 << 3) 122#define MC13783_LED_C0_TRIODE_AD (1 << 8)
111#define MC13783_LED_TC1HALF (1 << 4) 123#define MC13783_LED_C0_TRIODE_KP (1 << 9)
112#define MC13783_LED_SLEWLIMTC (1 << 5) 124#define MC13783_LED_C0_BOOST (1 << 10)
113#define MC13783_LED_SLEWLIMBL (1 << 6) 125#define MC13783_LED_C0_ABMODE(x) (((x) & 0x7) << 11)
114#define MC13783_LED_TRIODE_TC1 (1 << 7) 126#define MC13783_LED_C0_ABREF(x) (((x) & 0x3) << 14)
115#define MC13783_LED_TRIODE_TC2 (1 << 8) 127/* LED Control 1 */
116#define MC13783_LED_TRIODE_TC3 (1 << 9) 128#define MC13783_LED_C1_TC1HALF (1 << 18)
117 int flags; 129#define MC13783_LED_C1_SLEWLIM (1 << 23)
118 130/* LED Control 2 */
119#define MC13783_LED_AB_DISABLED 0 131#define MC13783_LED_C2_PERIOD(x) (((x) & 0x3) << 21)
120#define MC13783_LED_AB_MD1 1 132#define MC13783_LED_C2_SLEWLIM (1 << 23)
121#define MC13783_LED_AB_MD12 2 133/* LED Control 3 */
122#define MC13783_LED_AB_MD123 3 134#define MC13783_LED_C3_PERIOD(x) (((x) & 0x3) << 21)
123#define MC13783_LED_AB_MD1234 4 135#define MC13783_LED_C3_TRIODE_TC1 (1 << 23)
124#define MC13783_LED_AB_MD1234_AD1 5 136/* LED Control 4 */
125#define MC13783_LED_AB_MD1234_AD12 6 137#define MC13783_LED_C4_PERIOD(x) (((x) & 0x3) << 21)
126#define MC13783_LED_AB_MD1_AD 7 138#define MC13783_LED_C4_TRIODE_TC2 (1 << 23)
127 char abmode; 139/* LED Control 5 */
128 140#define MC13783_LED_C5_PERIOD(x) (((x) & 0x3) << 21)
129#define MC13783_LED_ABREF_200MV 0 141#define MC13783_LED_C5_TRIODE_TC3 (1 << 23)
130#define MC13783_LED_ABREF_400MV 1 142 u32 led_control[MAX_LED_CONTROL_REGS];
131#define MC13783_LED_ABREF_600MV 2
132#define MC13783_LED_ABREF_800MV 3
133 char abref;
134
135#define MC13783_LED_PERIOD_10MS 0
136#define MC13783_LED_PERIOD_100MS 1
137#define MC13783_LED_PERIOD_500MS 2
138#define MC13783_LED_PERIOD_2S 3
139 char bl_period;
140 char tc1_period;
141 char tc2_period;
142 char tc3_period;
143}; 143};
144 144
145struct mc13xxx_buttons_platform_data { 145struct mc13xxx_buttons_platform_data {
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 9b81b2bdc46b..1a8dd7afe084 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -34,6 +34,19 @@
34 ((a) == PALMAS_CHIP_ID)) 34 ((a) == PALMAS_CHIP_ID))
35#define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID) 35#define is_palmas_charger(a) ((a) == PALMAS_CHIP_CHARGER_ID)
36 36
37/**
38 * Palmas PMIC feature types
39 *
40 * PALMAS_PMIC_FEATURE_SMPS10_BOOST - used when the PMIC provides SMPS10_BOOST
41 * regulator.
42 *
43 * PALMAS_PMIC_HAS(b, f) - macro to check if a bandgap device is capable of a
44 * specific feature (above) or not. Return non-zero, if yes.
45 */
46#define PALMAS_PMIC_FEATURE_SMPS10_BOOST BIT(0)
47#define PALMAS_PMIC_HAS(b, f) \
48 ((b)->features & PALMAS_PMIC_FEATURE_ ## f)
49
37struct palmas_pmic; 50struct palmas_pmic;
38struct palmas_gpadc; 51struct palmas_gpadc;
39struct palmas_resource; 52struct palmas_resource;
@@ -54,6 +67,7 @@ struct palmas {
54 /* Stored chip id */ 67 /* Stored chip id */
55 int id; 68 int id;
56 69
70 unsigned int features;
57 /* IRQ Data */ 71 /* IRQ Data */
58 int irq; 72 int irq;
59 u32 irq_mask; 73 u32 irq_mask;
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
index 86bc635f8385..7a9f7089435d 100644
--- a/include/linux/mfd/rtsx_pci.h
+++ b/include/linux/mfd/rtsx_pci.h
@@ -575,6 +575,7 @@
575 575
576#define CARD_PWR_CTL 0xFD50 576#define CARD_PWR_CTL 0xFD50
577#define CARD_CLK_SWITCH 0xFD51 577#define CARD_CLK_SWITCH 0xFD51
578#define RTL8411B_PACKAGE_MODE 0xFD51
578#define CARD_SHARE_MODE 0xFD52 579#define CARD_SHARE_MODE 0xFD52
579#define CARD_DRIVE_SEL 0xFD53 580#define CARD_DRIVE_SEL 0xFD53
580#define CARD_STOP 0xFD54 581#define CARD_STOP 0xFD54
diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h
index f0f4de3b4ccc..378ae8a04c6a 100644
--- a/include/linux/mfd/samsung/core.h
+++ b/include/linux/mfd/samsung/core.h
@@ -14,8 +14,6 @@
14#ifndef __LINUX_MFD_SEC_CORE_H 14#ifndef __LINUX_MFD_SEC_CORE_H
15#define __LINUX_MFD_SEC_CORE_H 15#define __LINUX_MFD_SEC_CORE_H
16 16
17#define NUM_IRQ_REGS 4
18
19enum sec_device_type { 17enum sec_device_type {
20 S5M8751X, 18 S5M8751X,
21 S5M8763X, 19 S5M8763X,
@@ -44,8 +42,6 @@ struct sec_pmic_dev {
44 struct regmap *regmap; 42 struct regmap *regmap;
45 struct i2c_client *i2c; 43 struct i2c_client *i2c;
46 struct i2c_client *rtc; 44 struct i2c_client *rtc;
47 struct mutex iolock;
48 struct mutex irqlock;
49 45
50 int device_type; 46 int device_type;
51 int irq_base; 47 int irq_base;
@@ -53,8 +49,6 @@ struct sec_pmic_dev {
53 struct regmap_irq_chip_data *irq_data; 49 struct regmap_irq_chip_data *irq_data;
54 50
55 int ono; 51 int ono;
56 u8 irq_masks_cur[NUM_IRQ_REGS];
57 u8 irq_masks_cache[NUM_IRQ_REGS];
58 int type; 52 int type;
59 bool wakeup; 53 bool wakeup;
60}; 54};
diff --git a/include/linux/mfd/samsung/s2mps11.h b/include/linux/mfd/samsung/s2mps11.h
index ad2252f239d7..4e94dc65f987 100644
--- a/include/linux/mfd/samsung/s2mps11.h
+++ b/include/linux/mfd/samsung/s2mps11.h
@@ -189,6 +189,7 @@ enum s2mps11_regulators {
189#define S2MPS11_ENABLE_SHIFT 0x06 189#define S2MPS11_ENABLE_SHIFT 0x06
190#define S2MPS11_LDO_N_VOLTAGES (S2MPS11_LDO_VSEL_MASK + 1) 190#define S2MPS11_LDO_N_VOLTAGES (S2MPS11_LDO_VSEL_MASK + 1)
191#define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1) 191#define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1)
192#define S2MPS11_RAMP_DELAY 25000 /* uV/us */
192 193
193#define S2MPS11_PMIC_EN_SHIFT 6 194#define S2MPS11_PMIC_EN_SHIFT 6
194#define S2MPS11_REGULATOR_MAX (S2MPS11_REG_MAX - 3) 195#define S2MPS11_REGULATOR_MAX (S2MPS11_REG_MAX - 3)
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
index c79ad5d2f271..8d73fe29796a 100644
--- a/include/linux/mfd/ti_am335x_tscadc.h
+++ b/include/linux/mfd/ti_am335x_tscadc.h
@@ -30,8 +30,8 @@
30#define REG_IDLECONFIG 0x058 30#define REG_IDLECONFIG 0x058
31#define REG_CHARGECONFIG 0x05C 31#define REG_CHARGECONFIG 0x05C
32#define REG_CHARGEDELAY 0x060 32#define REG_CHARGEDELAY 0x060
33#define REG_STEPCONFIG(n) (0x64 + ((n - 1) * 8)) 33#define REG_STEPCONFIG(n) (0x64 + ((n) * 8))
34#define REG_STEPDELAY(n) (0x68 + ((n - 1) * 8)) 34#define REG_STEPDELAY(n) (0x68 + ((n) * 8))
35#define REG_FIFO0CNT 0xE4 35#define REG_FIFO0CNT 0xE4
36#define REG_FIFO0THR 0xE8 36#define REG_FIFO0THR 0xE8
37#define REG_FIFO1CNT 0xF0 37#define REG_FIFO1CNT 0xF0
@@ -46,8 +46,6 @@
46/* Step Enable */ 46/* Step Enable */
47#define STEPENB_MASK (0x1FFFF << 0) 47#define STEPENB_MASK (0x1FFFF << 0)
48#define STEPENB(val) ((val) << 0) 48#define STEPENB(val) ((val) << 0)
49#define STPENB_STEPENB STEPENB(0x1FFFF)
50#define STPENB_STEPENB_TC STEPENB(0x1FFF)
51 49
52/* IRQ enable */ 50/* IRQ enable */
53#define IRQENB_HW_PEN BIT(0) 51#define IRQENB_HW_PEN BIT(0)
@@ -73,8 +71,6 @@
73#define STEPCONFIG_INM_ADCREFM STEPCONFIG_INM(8) 71#define STEPCONFIG_INM_ADCREFM STEPCONFIG_INM(8)
74#define STEPCONFIG_INP_MASK (0xF << 19) 72#define STEPCONFIG_INP_MASK (0xF << 19)
75#define STEPCONFIG_INP(val) ((val) << 19) 73#define STEPCONFIG_INP(val) ((val) << 19)
76#define STEPCONFIG_INP_AN2 STEPCONFIG_INP(2)
77#define STEPCONFIG_INP_AN3 STEPCONFIG_INP(3)
78#define STEPCONFIG_INP_AN4 STEPCONFIG_INP(4) 74#define STEPCONFIG_INP_AN4 STEPCONFIG_INP(4)
79#define STEPCONFIG_INP_ADCREFM STEPCONFIG_INP(8) 75#define STEPCONFIG_INP_ADCREFM STEPCONFIG_INP(8)
80#define STEPCONFIG_FIFO1 BIT(26) 76#define STEPCONFIG_FIFO1 BIT(26)
@@ -96,7 +92,6 @@
96#define STEPCHARGE_INM_AN1 STEPCHARGE_INM(1) 92#define STEPCHARGE_INM_AN1 STEPCHARGE_INM(1)
97#define STEPCHARGE_INP_MASK (0xF << 19) 93#define STEPCHARGE_INP_MASK (0xF << 19)
98#define STEPCHARGE_INP(val) ((val) << 19) 94#define STEPCHARGE_INP(val) ((val) << 19)
99#define STEPCHARGE_INP_AN1 STEPCHARGE_INP(1)
100#define STEPCHARGE_RFM_MASK (3 << 23) 95#define STEPCHARGE_RFM_MASK (3 << 23)
101#define STEPCHARGE_RFM(val) ((val) << 23) 96#define STEPCHARGE_RFM(val) ((val) << 23)
102#define STEPCHARGE_RFM_XNUR STEPCHARGE_RFM(1) 97#define STEPCHARGE_RFM_XNUR STEPCHARGE_RFM(1)
@@ -125,22 +120,17 @@
125 120
126#define TSCADC_CELLS 2 121#define TSCADC_CELLS 2
127 122
128enum tscadc_cells {
129 TSC_CELL,
130 ADC_CELL,
131};
132
133struct mfd_tscadc_board {
134 struct tsc_data *tsc_init;
135 struct adc_data *adc_init;
136};
137
138struct ti_tscadc_dev { 123struct ti_tscadc_dev {
139 struct device *dev; 124 struct device *dev;
140 struct regmap *regmap_tscadc; 125 struct regmap *regmap_tscadc;
141 void __iomem *tscadc_base; 126 void __iomem *tscadc_base;
142 int irq; 127 int irq;
128 int used_cells; /* 1-2 */
129 int tsc_cell; /* -1 if not used */
130 int adc_cell; /* -1 if not used */
143 struct mfd_cell cells[TSCADC_CELLS]; 131 struct mfd_cell cells[TSCADC_CELLS];
132 u32 reg_se_cache;
133 spinlock_t reg_lock;
144 134
145 /* tsc device */ 135 /* tsc device */
146 struct titsc *tsc; 136 struct titsc *tsc;
@@ -149,4 +139,15 @@ struct ti_tscadc_dev {
149 struct adc_device *adc; 139 struct adc_device *adc;
150}; 140};
151 141
142static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p)
143{
144 struct ti_tscadc_dev **tscadc_dev = p->dev.platform_data;
145
146 return *tscadc_dev;
147}
148
149void am335x_tsc_se_update(struct ti_tscadc_dev *tsadc);
150void am335x_tsc_se_set(struct ti_tscadc_dev *tsadc, u32 val);
151void am335x_tsc_se_clr(struct ti_tscadc_dev *tsadc, u32 val);
152
152#endif 153#endif
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 99bf3e665997..ce3511326f80 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -81,10 +81,15 @@ int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
81void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); 81void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
82void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); 82void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
83 83
84struct dma_chan;
85
84struct tmio_mmc_dma { 86struct tmio_mmc_dma {
85 void *chan_priv_tx; 87 void *chan_priv_tx;
86 void *chan_priv_rx; 88 void *chan_priv_rx;
89 int slave_id_tx;
90 int slave_id_rx;
87 int alignment_shift; 91 int alignment_shift;
92 bool (*filter)(struct dma_chan *chan, void *arg);
88}; 93};
89 94
90struct tmio_mmc_host; 95struct tmio_mmc_host;
diff --git a/include/linux/mfd/tps6507x.h b/include/linux/mfd/tps6507x.h
index c923e4864f55..c2ae56933539 100644
--- a/include/linux/mfd/tps6507x.h
+++ b/include/linux/mfd/tps6507x.h
@@ -163,7 +163,6 @@ struct tps6507x_dev {
163 163
164 /* Client devices */ 164 /* Client devices */
165 struct tps6507x_pmic *pmic; 165 struct tps6507x_pmic *pmic;
166 struct tps6507x_ts *ts;
167}; 166};
168 167
169#endif /* __LINUX_MFD_TPS6507X_H */ 168#endif /* __LINUX_MFD_TPS6507X_H */
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h
index 94ac944d12f0..7e7fbce7a308 100644
--- a/include/linux/mfd/twl6040.h
+++ b/include/linux/mfd/twl6040.h
@@ -125,8 +125,15 @@
125 125
126#define TWL6040_HSDACENA (1 << 0) 126#define TWL6040_HSDACENA (1 << 0)
127#define TWL6040_HSDACMODE (1 << 1) 127#define TWL6040_HSDACMODE (1 << 1)
128#define TWL6040_HSDRVENA (1 << 2)
128#define TWL6040_HSDRVMODE (1 << 3) 129#define TWL6040_HSDRVMODE (1 << 3)
129 130
131/* HFLCTL/R (0x14/0x16) fields */
132
133#define TWL6040_HFDACENA (1 << 0)
134#define TWL6040_HFPGAENA (1 << 1)
135#define TWL6040_HFDRVENA (1 << 4)
136
130/* VIBCTLL/R (0x18/0x1A) fields */ 137/* VIBCTLL/R (0x18/0x1A) fields */
131 138
132#define TWL6040_VIBENA (1 << 0) 139#define TWL6040_VIBENA (1 << 0)
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index ae5c249530b4..40854ac0ba3d 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -29,6 +29,7 @@ enum wm8994_type {
29 29
30struct regulator_dev; 30struct regulator_dev;
31struct regulator_bulk_data; 31struct regulator_bulk_data;
32struct irq_domain;
32 33
33#define WM8994_NUM_GPIO_REGS 11 34#define WM8994_NUM_GPIO_REGS 11
34#define WM8994_NUM_LDO_REGS 2 35#define WM8994_NUM_LDO_REGS 2
@@ -73,6 +74,7 @@ struct wm8994 {
73 74
74 int irq; 75 int irq;
75 struct regmap_irq_chip_data *irq_data; 76 struct regmap_irq_chip_data *irq_data;
77 struct irq_domain *edge_irq;
76 78
77 /* Used over suspend/resume */ 79 /* Used over suspend/resume */
78 bool suspended; 80 bool suspended;
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index 68e776594889..90c60524a496 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -182,6 +182,11 @@ struct wm8994_pdata {
182 */ 182 */
183 int micdet_delay; 183 int micdet_delay;
184 184
185 /* Delay between microphone detect completing and reporting on
186 * insert (specified in ms)
187 */
188 int mic_id_delay;
189
185 /* IRQ for microphone detection if brought out directly as a 190 /* IRQ for microphone detection if brought out directly as a
186 * signal. 191 * signal.
187 */ 192 */
@@ -223,6 +228,11 @@ struct wm8994_pdata {
223 * lines is mastered. 228 * lines is mastered.
224 */ 229 */
225 int max_channels_clocked[WM8994_NUM_AIF]; 230 int max_channels_clocked[WM8994_NUM_AIF];
231
232 /**
233 * GPIO for the IRQ pin if host only supports edge triggering
234 */
235 int irq_gpio;
226}; 236};
227 237
228#endif 238#endif
diff --git a/include/linux/mfd/wm8994/registers.h b/include/linux/mfd/wm8994/registers.h
index 053548961c15..db8cef3d5321 100644
--- a/include/linux/mfd/wm8994/registers.h
+++ b/include/linux/mfd/wm8994/registers.h
@@ -2668,6 +2668,10 @@
2668/* 2668/*
2669 * R772 (0x304) - AIF1ADC LRCLK 2669 * R772 (0x304) - AIF1ADC LRCLK
2670 */ 2670 */
2671#define WM8958_AIF1_LRCLK_INV 0x1000 /* AIF1_LRCLK_INV */
2672#define WM8958_AIF1_LRCLK_INV_MASK 0x1000 /* AIF1_LRCLK_INV */
2673#define WM8958_AIF1_LRCLK_INV_SHIFT 12 /* AIF1_LRCLK_INV */
2674#define WM8958_AIF1_LRCLK_INV_WIDTH 1 /* AIF1_LRCLK_INV */
2671#define WM8994_AIF1ADC_LRCLK_DIR 0x0800 /* AIF1ADC_LRCLK_DIR */ 2675#define WM8994_AIF1ADC_LRCLK_DIR 0x0800 /* AIF1ADC_LRCLK_DIR */
2672#define WM8994_AIF1ADC_LRCLK_DIR_MASK 0x0800 /* AIF1ADC_LRCLK_DIR */ 2676#define WM8994_AIF1ADC_LRCLK_DIR_MASK 0x0800 /* AIF1ADC_LRCLK_DIR */
2673#define WM8994_AIF1ADC_LRCLK_DIR_SHIFT 11 /* AIF1ADC_LRCLK_DIR */ 2677#define WM8994_AIF1ADC_LRCLK_DIR_SHIFT 11 /* AIF1ADC_LRCLK_DIR */
@@ -2679,6 +2683,10 @@
2679/* 2683/*
2680 * R773 (0x305) - AIF1DAC LRCLK 2684 * R773 (0x305) - AIF1DAC LRCLK
2681 */ 2685 */
2686#define WM8958_AIF1_LRCLK_INV 0x1000 /* AIF1_LRCLK_INV */
2687#define WM8958_AIF1_LRCLK_INV_MASK 0x1000 /* AIF1_LRCLK_INV */
2688#define WM8958_AIF1_LRCLK_INV_SHIFT 12 /* AIF1_LRCLK_INV */
2689#define WM8958_AIF1_LRCLK_INV_WIDTH 1 /* AIF1_LRCLK_INV */
2682#define WM8994_AIF1DAC_LRCLK_DIR 0x0800 /* AIF1DAC_LRCLK_DIR */ 2690#define WM8994_AIF1DAC_LRCLK_DIR 0x0800 /* AIF1DAC_LRCLK_DIR */
2683#define WM8994_AIF1DAC_LRCLK_DIR_MASK 0x0800 /* AIF1DAC_LRCLK_DIR */ 2691#define WM8994_AIF1DAC_LRCLK_DIR_MASK 0x0800 /* AIF1DAC_LRCLK_DIR */
2684#define WM8994_AIF1DAC_LRCLK_DIR_SHIFT 11 /* AIF1DAC_LRCLK_DIR */ 2692#define WM8994_AIF1DAC_LRCLK_DIR_SHIFT 11 /* AIF1DAC_LRCLK_DIR */
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index adf6e0648f20..bb1c8096a7eb 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -111,6 +111,7 @@ enum {
111 MLX4_CMD_INIT2INIT_QP = 0x2d, 111 MLX4_CMD_INIT2INIT_QP = 0x2d,
112 MLX4_CMD_SUSPEND_QP = 0x32, 112 MLX4_CMD_SUSPEND_QP = 0x32,
113 MLX4_CMD_UNSUSPEND_QP = 0x33, 113 MLX4_CMD_UNSUSPEND_QP = 0x33,
114 MLX4_CMD_UPDATE_QP = 0x61,
114 /* special QP and management commands */ 115 /* special QP and management commands */
115 MLX4_CMD_CONF_SPECIAL_QP = 0x23, 116 MLX4_CMD_CONF_SPECIAL_QP = 0x23,
116 MLX4_CMD_MAD_IFC = 0x24, 117 MLX4_CMD_MAD_IFC = 0x24,
@@ -237,7 +238,7 @@ int mlx4_set_vf_mac(struct mlx4_dev *dev, int port, int vf, u64 mac);
237int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos); 238int mlx4_set_vf_vlan(struct mlx4_dev *dev, int port, int vf, u16 vlan, u8 qos);
238int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting); 239int mlx4_set_vf_spoofchk(struct mlx4_dev *dev, int port, int vf, bool setting);
239int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_info *ivf); 240int mlx4_get_vf_config(struct mlx4_dev *dev, int port, int vf, struct ifla_vf_info *ivf);
240 241int mlx4_set_vf_link_state(struct mlx4_dev *dev, int port, int vf, int link_state);
241 242
242#define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8) 243#define MLX4_COMM_GET_IF_REV(cmd_chan_ver) (u8)((cmd_chan_ver) >> 8)
243 244
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index a51b0134ce18..52c23a892bab 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -157,7 +157,8 @@ enum {
157 MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN = 1LL << 4, 157 MLX4_DEV_CAP_FLAGS2_REASSIGN_MAC_EN = 1LL << 4,
158 MLX4_DEV_CAP_FLAG2_TS = 1LL << 5, 158 MLX4_DEV_CAP_FLAG2_TS = 1LL << 5,
159 MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6, 159 MLX4_DEV_CAP_FLAG2_VLAN_CONTROL = 1LL << 6,
160 MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7 160 MLX4_DEV_CAP_FLAG2_FSM = 1LL << 7,
161 MLX4_DEV_CAP_FLAG2_UPDATE_QP = 1LL << 8
161}; 162};
162 163
163enum { 164enum {
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 352eec9df1b8..262deac02c9e 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -152,6 +152,8 @@ enum { /* fl */
152}; 152};
153enum { /* vlan_control */ 153enum { /* vlan_control */
154 MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED = 1 << 6, 154 MLX4_VLAN_CTRL_ETH_TX_BLOCK_TAGGED = 1 << 6,
155 MLX4_VLAN_CTRL_ETH_TX_BLOCK_PRIO_TAGGED = 1 << 5, /* 802.1p priority tag */
156 MLX4_VLAN_CTRL_ETH_TX_BLOCK_UNTAGGED = 1 << 4,
155 MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED = 1 << 2, 157 MLX4_VLAN_CTRL_ETH_RX_BLOCK_TAGGED = 1 << 2,
156 MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED = 1 << 1, /* 802.1p priority tag */ 158 MLX4_VLAN_CTRL_ETH_RX_BLOCK_PRIO_TAGGED = 1 << 1, /* 802.1p priority tag */
157 MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED = 1 << 0 159 MLX4_VLAN_CTRL_ETH_RX_BLOCK_UNTAGGED = 1 << 0
@@ -206,6 +208,40 @@ struct mlx4_qp_context {
206 u32 reserved5[10]; 208 u32 reserved5[10];
207}; 209};
208 210
211struct mlx4_update_qp_context {
212 __be64 qp_mask;
213 __be64 primary_addr_path_mask;
214 __be64 secondary_addr_path_mask;
215 u64 reserved1;
216 struct mlx4_qp_context qp_context;
217 u64 reserved2[58];
218};
219
220enum {
221 MLX4_UPD_QP_MASK_PM_STATE = 32,
222 MLX4_UPD_QP_MASK_VSD = 33,
223};
224
225enum {
226 MLX4_UPD_QP_PATH_MASK_PKEY_INDEX = 0 + 32,
227 MLX4_UPD_QP_PATH_MASK_FSM = 1 + 32,
228 MLX4_UPD_QP_PATH_MASK_MAC_INDEX = 2 + 32,
229 MLX4_UPD_QP_PATH_MASK_FVL = 3 + 32,
230 MLX4_UPD_QP_PATH_MASK_CV = 4 + 32,
231 MLX4_UPD_QP_PATH_MASK_VLAN_INDEX = 5 + 32,
232 MLX4_UPD_QP_PATH_MASK_ETH_HIDE_CQE_VLAN = 6 + 32,
233 MLX4_UPD_QP_PATH_MASK_ETH_TX_BLOCK_UNTAGGED = 7 + 32,
234 MLX4_UPD_QP_PATH_MASK_ETH_TX_BLOCK_1P = 8 + 32,
235 MLX4_UPD_QP_PATH_MASK_ETH_TX_BLOCK_TAGGED = 9 + 32,
236 MLX4_UPD_QP_PATH_MASK_ETH_RX_BLOCK_UNTAGGED = 10 + 32,
237 MLX4_UPD_QP_PATH_MASK_ETH_RX_BLOCK_1P = 11 + 32,
238 MLX4_UPD_QP_PATH_MASK_ETH_RX_BLOCK_TAGGED = 12 + 32,
239 MLX4_UPD_QP_PATH_MASK_FEUP = 13 + 32,
240 MLX4_UPD_QP_PATH_MASK_SCHED_QUEUE = 14 + 32,
241 MLX4_UPD_QP_PATH_MASK_IF_COUNTER_INDEX = 15 + 32,
242 MLX4_UPD_QP_PATH_MASK_FVL_RX = 16 + 32,
243};
244
209enum { /* param3 */ 245enum { /* param3 */
210 MLX4_STRIP_VLAN = 1 << 30 246 MLX4_STRIP_VLAN = 1 << 30
211}; 247};
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 66d881f1d576..f0224608d15e 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -25,11 +25,17 @@ struct file_ra_state;
25struct user_struct; 25struct user_struct;
26struct writeback_control; 26struct writeback_control;
27 27
28#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ 28#ifndef CONFIG_NEED_MULTIPLE_NODES /* Don't use mapnrs, do it properly */
29extern unsigned long max_mapnr; 29extern unsigned long max_mapnr;
30
31static inline void set_max_mapnr(unsigned long limit)
32{
33 max_mapnr = limit;
34}
35#else
36static inline void set_max_mapnr(unsigned long limit) { }
30#endif 37#endif
31 38
32extern unsigned long num_physpages;
33extern unsigned long totalram_pages; 39extern unsigned long totalram_pages;
34extern void * high_memory; 40extern void * high_memory;
35extern int page_cluster; 41extern int page_cluster;
@@ -52,6 +58,9 @@ extern unsigned long sysctl_admin_reserve_kbytes;
52/* to align the pointer to the (next) page boundary */ 58/* to align the pointer to the (next) page boundary */
53#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE) 59#define PAGE_ALIGN(addr) ALIGN(addr, PAGE_SIZE)
54 60
61/* test whether an address (unsigned long or pointer) is aligned to PAGE_SIZE */
62#define PAGE_ALIGNED(addr) IS_ALIGNED((unsigned long)addr, PAGE_SIZE)
63
55/* 64/*
56 * Linux kernel virtual memory manager primitives. 65 * Linux kernel virtual memory manager primitives.
57 * The idea being to have a "virtual" mm in the same way 66 * The idea being to have a "virtual" mm in the same way
@@ -142,12 +151,6 @@ extern unsigned int kobjsize(const void *objp);
142#define VM_STACK_FLAGS (VM_GROWSDOWN | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT) 151#define VM_STACK_FLAGS (VM_GROWSDOWN | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT)
143#endif 152#endif
144 153
145#define VM_READHINTMASK (VM_SEQ_READ | VM_RAND_READ)
146#define VM_ClearReadHint(v) (v)->vm_flags &= ~VM_READHINTMASK
147#define VM_NormalReadHint(v) (!((v)->vm_flags & VM_READHINTMASK))
148#define VM_SequentialReadHint(v) ((v)->vm_flags & VM_SEQ_READ)
149#define VM_RandomReadHint(v) ((v)->vm_flags & VM_RAND_READ)
150
151/* 154/*
152 * Special vmas that are non-mergable, non-mlock()able. 155 * Special vmas that are non-mergable, non-mlock()able.
153 * Note: mm/huge_memory.c VM_NO_THP depends on this definition. 156 * Note: mm/huge_memory.c VM_NO_THP depends on this definition.
@@ -1305,11 +1308,12 @@ extern void free_initmem(void);
1305/* 1308/*
1306 * Free reserved pages within range [PAGE_ALIGN(start), end & PAGE_MASK) 1309 * Free reserved pages within range [PAGE_ALIGN(start), end & PAGE_MASK)
1307 * into the buddy system. The freed pages will be poisoned with pattern 1310 * into the buddy system. The freed pages will be poisoned with pattern
1308 * "poison" if it's non-zero. 1311 * "poison" if it's within range [0, UCHAR_MAX].
1309 * Return pages freed into the buddy system. 1312 * Return pages freed into the buddy system.
1310 */ 1313 */
1311extern unsigned long free_reserved_area(unsigned long start, unsigned long end, 1314extern unsigned long free_reserved_area(void *start, void *end,
1312 int poison, char *s); 1315 int poison, char *s);
1316
1313#ifdef CONFIG_HIGHMEM 1317#ifdef CONFIG_HIGHMEM
1314/* 1318/*
1315 * Free a highmem page into the buddy system, adjusting totalhigh_pages 1319 * Free a highmem page into the buddy system, adjusting totalhigh_pages
@@ -1318,10 +1322,8 @@ extern unsigned long free_reserved_area(unsigned long start, unsigned long end,
1318extern void free_highmem_page(struct page *page); 1322extern void free_highmem_page(struct page *page);
1319#endif 1323#endif
1320 1324
1321static inline void adjust_managed_page_count(struct page *page, long count) 1325extern void adjust_managed_page_count(struct page *page, long count);
1322{ 1326extern void mem_init_print_info(const char *str);
1323 totalram_pages += count;
1324}
1325 1327
1326/* Free the reserved page into the buddy system, so it gets managed. */ 1328/* Free the reserved page into the buddy system, so it gets managed. */
1327static inline void __free_reserved_page(struct page *page) 1329static inline void __free_reserved_page(struct page *page)
@@ -1345,18 +1347,29 @@ static inline void mark_page_reserved(struct page *page)
1345 1347
1346/* 1348/*
1347 * Default method to free all the __init memory into the buddy system. 1349 * Default method to free all the __init memory into the buddy system.
1348 * The freed pages will be poisoned with pattern "poison" if it is 1350 * The freed pages will be poisoned with pattern "poison" if it's within
1349 * non-zero. Return pages freed into the buddy system. 1351 * range [0, UCHAR_MAX].
1352 * Return pages freed into the buddy system.
1350 */ 1353 */
1351static inline unsigned long free_initmem_default(int poison) 1354static inline unsigned long free_initmem_default(int poison)
1352{ 1355{
1353 extern char __init_begin[], __init_end[]; 1356 extern char __init_begin[], __init_end[];
1354 1357
1355 return free_reserved_area(PAGE_ALIGN((unsigned long)&__init_begin) , 1358 return free_reserved_area(&__init_begin, &__init_end,
1356 ((unsigned long)&__init_end) & PAGE_MASK,
1357 poison, "unused kernel"); 1359 poison, "unused kernel");
1358} 1360}
1359 1361
1362static inline unsigned long get_num_physpages(void)
1363{
1364 int nid;
1365 unsigned long phys_pages = 0;
1366
1367 for_each_online_node(nid)
1368 phys_pages += node_present_pages(nid);
1369
1370 return phys_pages;
1371}
1372
1360#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 1373#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
1361/* 1374/*
1362 * With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its 1375 * With CONFIG_HAVE_MEMBLOCK_NODE_MAP set, an architecture may initialise its
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index ace9a5f01c64..fb425aa16c01 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -330,12 +330,9 @@ struct mm_struct {
330 unsigned long (*get_unmapped_area) (struct file *filp, 330 unsigned long (*get_unmapped_area) (struct file *filp,
331 unsigned long addr, unsigned long len, 331 unsigned long addr, unsigned long len,
332 unsigned long pgoff, unsigned long flags); 332 unsigned long pgoff, unsigned long flags);
333 void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
334#endif 333#endif
335 unsigned long mmap_base; /* base of mmap area */ 334 unsigned long mmap_base; /* base of mmap area */
336 unsigned long task_size; /* size of task vm space */ 335 unsigned long task_size; /* size of task vm space */
337 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
338 unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */
339 unsigned long highest_vm_end; /* highest vma end address */ 336 unsigned long highest_vm_end; /* highest vma end address */
340 pgd_t * pgd; 337 pgd_t * pgd;
341 atomic_t mm_users; /* How many users with user space? */ 338 atomic_t mm_users; /* How many users with user space? */
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 9aa863da287f..92dc257251e4 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -11,11 +11,17 @@ extern int sysctl_overcommit_memory;
11extern int sysctl_overcommit_ratio; 11extern int sysctl_overcommit_ratio;
12extern struct percpu_counter vm_committed_as; 12extern struct percpu_counter vm_committed_as;
13 13
14#ifdef CONFIG_SMP
15extern s32 vm_committed_as_batch;
16#else
17#define vm_committed_as_batch 0
18#endif
19
14unsigned long vm_memory_committed(void); 20unsigned long vm_memory_committed(void);
15 21
16static inline void vm_acct_memory(long pages) 22static inline void vm_acct_memory(long pages)
17{ 23{
18 percpu_counter_add(&vm_committed_as, pages); 24 __percpu_counter_add(&vm_committed_as, pages, vm_committed_as_batch);
19} 25}
20 26
21static inline void vm_unacct_memory(long pages) 27static inline void vm_unacct_memory(long pages)
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index f31725ba49f3..842de3e21e70 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -94,7 +94,11 @@ struct mmc_ext_csd {
94 u8 raw_ext_csd_structure; /* 194 */ 94 u8 raw_ext_csd_structure; /* 194 */
95 u8 raw_card_type; /* 196 */ 95 u8 raw_card_type; /* 196 */
96 u8 out_of_int_time; /* 198 */ 96 u8 out_of_int_time; /* 198 */
97 u8 raw_s_a_timeout; /* 217 */ 97 u8 raw_pwr_cl_52_195; /* 200 */
98 u8 raw_pwr_cl_26_195; /* 201 */
99 u8 raw_pwr_cl_52_360; /* 202 */
100 u8 raw_pwr_cl_26_360; /* 203 */
101 u8 raw_s_a_timeout; /* 217 */
98 u8 raw_hc_erase_gap_size; /* 221 */ 102 u8 raw_hc_erase_gap_size; /* 221 */
99 u8 raw_erase_timeout_mult; /* 223 */ 103 u8 raw_erase_timeout_mult; /* 223 */
100 u8 raw_hc_erase_grp_size; /* 224 */ 104 u8 raw_hc_erase_grp_size; /* 224 */
@@ -102,6 +106,10 @@ struct mmc_ext_csd {
102 u8 raw_sec_erase_mult; /* 230 */ 106 u8 raw_sec_erase_mult; /* 230 */
103 u8 raw_sec_feature_support;/* 231 */ 107 u8 raw_sec_feature_support;/* 231 */
104 u8 raw_trim_mult; /* 232 */ 108 u8 raw_trim_mult; /* 232 */
109 u8 raw_pwr_cl_200_195; /* 236 */
110 u8 raw_pwr_cl_200_360; /* 237 */
111 u8 raw_pwr_cl_ddr_52_195; /* 238 */
112 u8 raw_pwr_cl_ddr_52_360; /* 239 */
105 u8 raw_bkops_status; /* 246 */ 113 u8 raw_bkops_status; /* 246 */
106 u8 raw_sectors[4]; /* 212 - 4 bytes */ 114 u8 raw_sectors[4]; /* 212 - 4 bytes */
107 115
@@ -512,6 +520,7 @@ struct mmc_driver {
512 void (*remove)(struct mmc_card *); 520 void (*remove)(struct mmc_card *);
513 int (*suspend)(struct mmc_card *); 521 int (*suspend)(struct mmc_card *);
514 int (*resume)(struct mmc_card *); 522 int (*resume)(struct mmc_card *);
523 void (*shutdown)(struct mmc_card *);
515}; 524};
516 525
517extern int mmc_register_driver(struct mmc_driver *); 526extern int mmc_register_driver(struct mmc_driver *);
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 39613b9a6fc5..443243b241d5 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -96,6 +96,8 @@ struct mmc_command {
96 */ 96 */
97 97
98 unsigned int cmd_timeout_ms; /* in milliseconds */ 98 unsigned int cmd_timeout_ms; /* in milliseconds */
99 /* Set this flag only for blocking sanitize request */
100 bool sanitize_busy;
99 101
100 struct mmc_data *data; /* data segment associated with cmd */ 102 struct mmc_data *data; /* data segment associated with cmd */
101 struct mmc_request *mrq; /* associated request */ 103 struct mmc_request *mrq; /* associated request */
@@ -188,6 +190,9 @@ extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort);
188extern void mmc_release_host(struct mmc_host *host); 190extern void mmc_release_host(struct mmc_host *host);
189extern int mmc_try_claim_host(struct mmc_host *host); 191extern int mmc_try_claim_host(struct mmc_host *host);
190 192
193extern void mmc_get_card(struct mmc_card *card);
194extern void mmc_put_card(struct mmc_card *card);
195
191extern int mmc_flush_cache(struct mmc_card *); 196extern int mmc_flush_cache(struct mmc_card *);
192 197
193extern int mmc_detect_card_removed(struct mmc_host *host); 198extern int mmc_detect_card_removed(struct mmc_host *host);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index e326ae2882a0..3b0c33ae13e1 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -239,7 +239,7 @@ struct mmc_host {
239#define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ 239#define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */
240#define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ 240#define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */
241#define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ 241#define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */
242 242#define MMC_CAP_AGGRESSIVE_PM (1 << 7) /* Suspend (e)MMC/SD at idle */
243#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ 243#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */
244#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ 244#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */
245#define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */ 245#define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */
@@ -264,7 +264,7 @@ struct mmc_host {
264 264
265#define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ 265#define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */
266#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ 266#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */
267#define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ 267#define MMC_CAP2_FULL_PWR_CYCLE (1 << 2) /* Can do full power cycle */
268#define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ 268#define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */
269#define MMC_CAP2_NO_SLEEP_CMD (1 << 4) /* Don't allow sleep command */ 269#define MMC_CAP2_NO_SLEEP_CMD (1 << 4) /* Don't allow sleep command */
270#define MMC_CAP2_HS200_1_8V_SDR (1 << 5) /* can support */ 270#define MMC_CAP2_HS200_1_8V_SDR (1 << 5) /* can support */
@@ -272,7 +272,6 @@ struct mmc_host {
272#define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \ 272#define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \
273 MMC_CAP2_HS200_1_2V_SDR) 273 MMC_CAP2_HS200_1_2V_SDR)
274#define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */ 274#define MMC_CAP2_BROKEN_VOLTAGE (1 << 7) /* Use the broken voltage */
275#define MMC_CAP2_DETECT_ON_ERR (1 << 8) /* On I/O err check card removal */
276#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */ 275#define MMC_CAP2_HC_ERASE_SZ (1 << 9) /* High-capacity erase size */
277#define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */ 276#define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10) /* Card-detect signal active high */
278#define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */ 277#define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11) /* Write-protect signal active high */
@@ -281,6 +280,7 @@ struct mmc_host {
281#define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \ 280#define MMC_CAP2_PACKED_CMD (MMC_CAP2_PACKED_RD | \
282 MMC_CAP2_PACKED_WR) 281 MMC_CAP2_PACKED_WR)
283#define MMC_CAP2_NO_PRESCAN_POWERUP (1 << 14) /* Don't power up before scan */ 282#define MMC_CAP2_NO_PRESCAN_POWERUP (1 << 14) /* Don't power up before scan */
283#define MMC_CAP2_SANITIZE (1 << 15) /* Support Sanitize */
284 284
285 mmc_pm_flag_t pm_caps; /* supported pm features */ 285 mmc_pm_flag_t pm_caps; /* supported pm features */
286 286
@@ -369,7 +369,7 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *);
369int mmc_add_host(struct mmc_host *); 369int mmc_add_host(struct mmc_host *);
370void mmc_remove_host(struct mmc_host *); 370void mmc_remove_host(struct mmc_host *);
371void mmc_free_host(struct mmc_host *); 371void mmc_free_host(struct mmc_host *);
372void mmc_of_parse(struct mmc_host *host); 372int mmc_of_parse(struct mmc_host *host);
373 373
374static inline void *mmc_priv(struct mmc_host *host) 374static inline void *mmc_priv(struct mmc_host *host)
375{ 375{
@@ -425,10 +425,6 @@ static inline int mmc_regulator_get_supply(struct mmc_host *mmc)
425} 425}
426#endif 426#endif
427 427
428int mmc_card_awake(struct mmc_host *host);
429int mmc_card_sleep(struct mmc_host *host);
430int mmc_card_can_sleep(struct mmc_host *host);
431
432int mmc_pm_notify(struct notifier_block *notify_block, unsigned long, void *); 428int mmc_pm_notify(struct notifier_block *notify_block, unsigned long, void *);
433 429
434/* Module parameter */ 430/* Module parameter */
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index b838ffc49e4a..e3c6a74d980a 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -95,6 +95,9 @@ struct sdhci_host {
95/* The system physically doesn't support 1.8v, even if the host does */ 95/* The system physically doesn't support 1.8v, even if the host does */
96#define SDHCI_QUIRK2_NO_1_8_V (1<<2) 96#define SDHCI_QUIRK2_NO_1_8_V (1<<2)
97#define SDHCI_QUIRK2_PRESET_VALUE_BROKEN (1<<3) 97#define SDHCI_QUIRK2_PRESET_VALUE_BROKEN (1<<3)
98#define SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON (1<<4)
99/* Controller has a non-standard host control register */
100#define SDHCI_QUIRK2_BROKEN_HOST_CONTROL (1<<5)
98 101
99 int irq; /* Device IRQ */ 102 int irq; /* Device IRQ */
100 void __iomem *ioaddr; /* Mapped address */ 103 void __iomem *ioaddr; /* Mapped address */
@@ -126,7 +129,7 @@ struct sdhci_host {
126#define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ 129#define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */
127#define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ 130#define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */
128#define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ 131#define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */
129#define SDHCI_HS200_NEEDS_TUNING (1<<10) /* HS200 needs tuning */ 132#define SDHCI_SDR104_NEEDS_TUNING (1<<10) /* SDR104/HS200 needs tuning */
130#define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */ 133#define SDHCI_USING_RETUNING_TIMER (1<<11) /* Host is using a retuning timer for the card */
131 134
132 unsigned int version; /* SDHCI spec. version */ 135 unsigned int version; /* SDHCI spec. version */
@@ -139,6 +142,7 @@ struct sdhci_host {
139 u8 pwr; /* Current voltage */ 142 u8 pwr; /* Current voltage */
140 143
141 bool runtime_suspended; /* Host is runtime suspended */ 144 bool runtime_suspended; /* Host is runtime suspended */
145 bool bus_on; /* Bus power prevents runtime suspend */
142 146
143 struct mmc_request *mrq; /* Current request */ 147 struct mmc_request *mrq; /* Current request */
144 struct mmc_command *cmd; /* Current command */ 148 struct mmc_command *cmd; /* Current command */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 5c76737d836b..af4a3b77a8de 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -474,10 +474,16 @@ struct zone {
474 * frequently read in proximity to zone->lock. It's good to 474 * frequently read in proximity to zone->lock. It's good to
475 * give them a chance of being in the same cacheline. 475 * give them a chance of being in the same cacheline.
476 * 476 *
477 * Write access to present_pages and managed_pages at runtime should 477 * Write access to present_pages at runtime should be protected by
478 * be protected by lock_memory_hotplug()/unlock_memory_hotplug(). 478 * lock_memory_hotplug()/unlock_memory_hotplug(). Any reader who can't
479 * Any reader who can't tolerant drift of present_pages and 479 * tolerant drift of present_pages should hold memory hotplug lock to
480 * managed_pages should hold memory hotplug lock to get a stable value. 480 * get a stable value.
481 *
482 * Read access to managed_pages should be safe because it's unsigned
483 * long. Write access to zone->managed_pages and totalram_pages are
484 * protected by managed_page_count_lock at runtime. Idealy only
485 * adjust_managed_page_count() should be used instead of directly
486 * touching zone->managed_pages and totalram_pages.
481 */ 487 */
482 unsigned long spanned_pages; 488 unsigned long spanned_pages;
483 unsigned long present_pages; 489 unsigned long present_pages;
@@ -495,6 +501,13 @@ typedef enum {
495 ZONE_CONGESTED, /* zone has many dirty pages backed by 501 ZONE_CONGESTED, /* zone has many dirty pages backed by
496 * a congested BDI 502 * a congested BDI
497 */ 503 */
504 ZONE_TAIL_LRU_DIRTY, /* reclaim scanning has recently found
505 * many dirty file pages at the tail
506 * of the LRU.
507 */
508 ZONE_WRITEBACK, /* reclaim scanning has recently found
509 * many pages under writeback
510 */
498} zone_flags_t; 511} zone_flags_t;
499 512
500static inline void zone_set_flag(struct zone *zone, zone_flags_t flag) 513static inline void zone_set_flag(struct zone *zone, zone_flags_t flag)
@@ -517,6 +530,16 @@ static inline int zone_is_reclaim_congested(const struct zone *zone)
517 return test_bit(ZONE_CONGESTED, &zone->flags); 530 return test_bit(ZONE_CONGESTED, &zone->flags);
518} 531}
519 532
533static inline int zone_is_reclaim_dirty(const struct zone *zone)
534{
535 return test_bit(ZONE_TAIL_LRU_DIRTY, &zone->flags);
536}
537
538static inline int zone_is_reclaim_writeback(const struct zone *zone)
539{
540 return test_bit(ZONE_WRITEBACK, &zone->flags);
541}
542
520static inline int zone_is_reclaim_locked(const struct zone *zone) 543static inline int zone_is_reclaim_locked(const struct zone *zone)
521{ 544{
522 return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags); 545 return test_bit(ZONE_RECLAIM_LOCKED, &zone->flags);
@@ -716,7 +739,10 @@ typedef struct pglist_data {
716 * or node_spanned_pages stay constant. Holding this will also 739 * or node_spanned_pages stay constant. Holding this will also
717 * guarantee that any pfn_valid() stays that way. 740 * guarantee that any pfn_valid() stays that way.
718 * 741 *
719 * Nests above zone->lock and zone->size_seqlock. 742 * pgdat_resize_lock() and pgdat_resize_unlock() are provided to
743 * manipulate node_size_lock without checking for CONFIG_MEMORY_HOTPLUG.
744 *
745 * Nests above zone->lock and zone->span_seqlock
720 */ 746 */
721 spinlock_t node_size_lock; 747 spinlock_t node_size_lock;
722#endif 748#endif
@@ -843,11 +869,6 @@ static inline int is_highmem_idx(enum zone_type idx)
843#endif 869#endif
844} 870}
845 871
846static inline int is_normal_idx(enum zone_type idx)
847{
848 return (idx == ZONE_NORMAL);
849}
850
851/** 872/**
852 * is_highmem - helper function to quickly check if a struct zone is a 873 * is_highmem - helper function to quickly check if a struct zone is a
853 * highmem zone or not. This is an attempt to keep references 874 * highmem zone or not. This is an attempt to keep references
@@ -866,29 +887,6 @@ static inline int is_highmem(struct zone *zone)
866#endif 887#endif
867} 888}
868 889
869static inline int is_normal(struct zone *zone)
870{
871 return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL;
872}
873
874static inline int is_dma32(struct zone *zone)
875{
876#ifdef CONFIG_ZONE_DMA32
877 return zone == zone->zone_pgdat->node_zones + ZONE_DMA32;
878#else
879 return 0;
880#endif
881}
882
883static inline int is_dma(struct zone *zone)
884{
885#ifdef CONFIG_ZONE_DMA
886 return zone == zone->zone_pgdat->node_zones + ZONE_DMA;
887#else
888 return 0;
889#endif
890}
891
892/* These two functions are used to setup the per zone pages min values */ 890/* These two functions are used to setup the per zone pages min values */
893struct ctl_table; 891struct ctl_table;
894int min_free_kbytes_sysctl_handler(struct ctl_table *, int, 892int min_free_kbytes_sysctl_handler(struct ctl_table *, int,
@@ -1111,6 +1109,10 @@ struct mem_section {
1111 struct page_cgroup *page_cgroup; 1109 struct page_cgroup *page_cgroup;
1112 unsigned long pad; 1110 unsigned long pad;
1113#endif 1111#endif
1112 /*
1113 * WARNING: mem_section must be a power-of-2 in size for the
1114 * calculation and use of SECTION_ROOT_MASK to make sense.
1115 */
1114}; 1116};
1115 1117
1116#ifdef CONFIG_SPARSEMEM_EXTREME 1118#ifdef CONFIG_SPARSEMEM_EXTREME
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index b508016fb76d..b62d4af6c667 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -456,7 +456,8 @@ enum dmi_field {
456}; 456};
457 457
458struct dmi_strmatch { 458struct dmi_strmatch {
459 unsigned char slot; 459 unsigned char slot:7;
460 unsigned char exact_match:1;
460 char substr[79]; 461 char substr[79];
461}; 462};
462 463
@@ -474,7 +475,8 @@ struct dmi_system_id {
474 */ 475 */
475#define dmi_device_id dmi_system_id 476#define dmi_device_id dmi_system_id
476 477
477#define DMI_MATCH(a, b) { a, b } 478#define DMI_MATCH(a, b) { .slot = a, .substr = b }
479#define DMI_EXACT_MATCH(a, b) { .slot = a, .substr = b, .exact_match = 1 }
478 480
479#define PLATFORM_NAME_SIZE 20 481#define PLATFORM_NAME_SIZE 20
480#define PLATFORM_MODULE_PREFIX "platform:" 482#define PLATFORM_MODULE_PREFIX "platform:"
@@ -577,4 +579,23 @@ struct mei_cl_device_id {
577 kernel_ulong_t driver_info; 579 kernel_ulong_t driver_info;
578}; 580};
579 581
582/* RapidIO */
583
584#define RIO_ANY_ID 0xffff
585
586/**
587 * struct rio_device_id - RIO device identifier
588 * @did: RapidIO device ID
589 * @vid: RapidIO vendor ID
590 * @asm_did: RapidIO assembly device ID
591 * @asm_vid: RapidIO assembly vendor ID
592 *
593 * Identifies a RapidIO device based on both the device/vendor IDs and
594 * the assembly device/vendor IDs.
595 */
596struct rio_device_id {
597 __u16 did, vid;
598 __u16 asm_did, asm_vid;
599};
600
580#endif /* LINUX_MOD_DEVICETABLE_H */ 601#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 137b4198fc03..27d9da3f86ff 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -439,7 +439,7 @@ extern struct kernel_param_ops param_ops_string;
439extern int param_set_copystring(const char *val, const struct kernel_param *); 439extern int param_set_copystring(const char *val, const struct kernel_param *);
440extern int param_get_string(char *buffer, const struct kernel_param *kp); 440extern int param_get_string(char *buffer, const struct kernel_param *kp);
441 441
442/* for exporting parameters in /sys/parameters */ 442/* for exporting parameters in /sys/module/.../parameters */
443 443
444struct module; 444struct module;
445 445
diff --git a/include/linux/msi.h b/include/linux/msi.h
index 20c2d6dd5d25..ee66f3a12fb6 100644
--- a/include/linux/msi.h
+++ b/include/linux/msi.h
@@ -35,6 +35,7 @@ struct msi_desc {
35 35
36 u32 masked; /* mask bits */ 36 u32 masked; /* mask bits */
37 unsigned int irq; 37 unsigned int irq;
38 unsigned int nvec_used; /* number of messages */
38 struct list_head list; 39 struct list_head list;
39 40
40 union { 41 union {
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index 141d395bbb5f..6e8215b15998 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -30,6 +30,7 @@ struct mv643xx_eth_shared_platform_data {
30#define MV643XX_ETH_PHY_ADDR(x) (0x80 | (x)) 30#define MV643XX_ETH_PHY_ADDR(x) (0x80 | (x))
31#define MV643XX_ETH_PHY_NONE 0xff 31#define MV643XX_ETH_PHY_NONE 0xff
32 32
33struct device_node;
33struct mv643xx_eth_platform_data { 34struct mv643xx_eth_platform_data {
34 /* 35 /*
35 * Pointer back to our parent instance, and our port number. 36 * Pointer back to our parent instance, and our port number.
@@ -41,6 +42,7 @@ struct mv643xx_eth_platform_data {
41 * Whether a PHY is present, and if yes, at which address. 42 * Whether a PHY is present, and if yes, at which address.
42 */ 43 */
43 int phy_addr; 44 int phy_addr;
45 struct device_node *phy_node;
44 46
45 /* 47 /*
46 * Use this MAC address if it is valid, overriding the 48 * Use this MAC address if it is valid, overriding the
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index 4871170a04a0..ae4981ebd18e 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -41,6 +41,7 @@ struct nbd_device {
41 u64 bytesize; 41 u64 bytesize;
42 pid_t pid; /* pid of nbd-client, if attached */ 42 pid_t pid; /* pid of nbd-client, if attached */
43 int xmit_timeout; 43 int xmit_timeout;
44 int disconnect; /* a disconnect has been requested by user */
44}; 45};
45 46
46#endif 47#endif
diff --git a/include/linux/net.h b/include/linux/net.h
index 99c9f0c103c2..4f27575ce1d6 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -79,9 +79,9 @@ enum sock_type {
79#endif /* ARCH_HAS_SOCKET_TYPES */ 79#endif /* ARCH_HAS_SOCKET_TYPES */
80 80
81enum sock_shutdown_cmd { 81enum sock_shutdown_cmd {
82 SHUT_RD = 0, 82 SHUT_RD,
83 SHUT_WR = 1, 83 SHUT_WR,
84 SHUT_RDWR = 2, 84 SHUT_RDWR,
85}; 85};
86 86
87struct socket_wq { 87struct socket_wq {
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
index 09906b7ca47d..a2a89a5c7be5 100644
--- a/include/linux/netdev_features.h
+++ b/include/linux/netdev_features.h
@@ -43,8 +43,9 @@ enum {
43 NETIF_F_FSO_BIT, /* ... FCoE segmentation */ 43 NETIF_F_FSO_BIT, /* ... FCoE segmentation */
44 NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */ 44 NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */
45 NETIF_F_GSO_UDP_TUNNEL_BIT, /* ... UDP TUNNEL with TSO */ 45 NETIF_F_GSO_UDP_TUNNEL_BIT, /* ... UDP TUNNEL with TSO */
46 NETIF_F_GSO_MPLS_BIT, /* ... MPLS segmentation */
46 /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */ 47 /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */
47 NETIF_F_GSO_UDP_TUNNEL_BIT, 48 NETIF_F_GSO_MPLS_BIT,
48 49
49 NETIF_F_FCOE_CRC_BIT, /* FCoE CRC32 */ 50 NETIF_F_FCOE_CRC_BIT, /* FCoE CRC32 */
50 NETIF_F_SCTP_CSUM_BIT, /* SCTP checksum offload */ 51 NETIF_F_SCTP_CSUM_BIT, /* SCTP checksum offload */
@@ -107,6 +108,7 @@ enum {
107#define NETIF_F_RXALL __NETIF_F(RXALL) 108#define NETIF_F_RXALL __NETIF_F(RXALL)
108#define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE) 109#define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE)
109#define NETIF_F_GSO_UDP_TUNNEL __NETIF_F(GSO_UDP_TUNNEL) 110#define NETIF_F_GSO_UDP_TUNNEL __NETIF_F(GSO_UDP_TUNNEL)
111#define NETIF_F_GSO_MPLS __NETIF_F(GSO_MPLS)
110#define NETIF_F_HW_VLAN_STAG_FILTER __NETIF_F(HW_VLAN_STAG_FILTER) 112#define NETIF_F_HW_VLAN_STAG_FILTER __NETIF_F(HW_VLAN_STAG_FILTER)
111#define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX) 113#define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX)
112#define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX) 114#define NETIF_F_HW_VLAN_STAG_TX __NETIF_F(HW_VLAN_STAG_TX)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 96e4c21e15e0..bb82871b8494 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -324,12 +324,15 @@ struct napi_struct {
324 struct sk_buff *gro_list; 324 struct sk_buff *gro_list;
325 struct sk_buff *skb; 325 struct sk_buff *skb;
326 struct list_head dev_list; 326 struct list_head dev_list;
327 struct hlist_node napi_hash_node;
328 unsigned int napi_id;
327}; 329};
328 330
329enum { 331enum {
330 NAPI_STATE_SCHED, /* Poll is scheduled */ 332 NAPI_STATE_SCHED, /* Poll is scheduled */
331 NAPI_STATE_DISABLE, /* Disable pending */ 333 NAPI_STATE_DISABLE, /* Disable pending */
332 NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */ 334 NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */
335 NAPI_STATE_HASHED, /* In NAPI hash */
333}; 336};
334 337
335enum gro_result { 338enum gro_result {
@@ -446,6 +449,32 @@ extern void __napi_complete(struct napi_struct *n);
446extern void napi_complete(struct napi_struct *n); 449extern void napi_complete(struct napi_struct *n);
447 450
448/** 451/**
452 * napi_by_id - lookup a NAPI by napi_id
453 * @napi_id: hashed napi_id
454 *
455 * lookup @napi_id in napi_hash table
456 * must be called under rcu_read_lock()
457 */
458extern struct napi_struct *napi_by_id(unsigned int napi_id);
459
460/**
461 * napi_hash_add - add a NAPI to global hashtable
462 * @napi: napi context
463 *
464 * generate a new napi_id and store a @napi under it in napi_hash
465 */
466extern void napi_hash_add(struct napi_struct *napi);
467
468/**
469 * napi_hash_del - remove a NAPI from global table
470 * @napi: napi context
471 *
472 * Warning: caller must observe rcu grace period
473 * before freeing memory containing @napi
474 */
475extern void napi_hash_del(struct napi_struct *napi);
476
477/**
449 * napi_disable - prevent NAPI from scheduling 478 * napi_disable - prevent NAPI from scheduling
450 * @n: napi context 479 * @n: napi context
451 * 480 *
@@ -800,6 +829,7 @@ struct netdev_fcoe_hbainfo {
800 * int (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool setting); 829 * int (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool setting);
801 * int (*ndo_get_vf_config)(struct net_device *dev, 830 * int (*ndo_get_vf_config)(struct net_device *dev,
802 * int vf, struct ifla_vf_info *ivf); 831 * int vf, struct ifla_vf_info *ivf);
832 * int (*ndo_set_vf_link_state)(struct net_device *dev, int vf, int link_state);
803 * int (*ndo_set_vf_port)(struct net_device *dev, int vf, 833 * int (*ndo_set_vf_port)(struct net_device *dev, int vf,
804 * struct nlattr *port[]); 834 * struct nlattr *port[]);
805 * int (*ndo_get_vf_port)(struct net_device *dev, int vf, struct sk_buff *skb); 835 * int (*ndo_get_vf_port)(struct net_device *dev, int vf, struct sk_buff *skb);
@@ -943,6 +973,9 @@ struct net_device_ops {
943 gfp_t gfp); 973 gfp_t gfp);
944 void (*ndo_netpoll_cleanup)(struct net_device *dev); 974 void (*ndo_netpoll_cleanup)(struct net_device *dev);
945#endif 975#endif
976#ifdef CONFIG_NET_LL_RX_POLL
977 int (*ndo_ll_poll)(struct napi_struct *dev);
978#endif
946 int (*ndo_set_vf_mac)(struct net_device *dev, 979 int (*ndo_set_vf_mac)(struct net_device *dev,
947 int queue, u8 *mac); 980 int queue, u8 *mac);
948 int (*ndo_set_vf_vlan)(struct net_device *dev, 981 int (*ndo_set_vf_vlan)(struct net_device *dev,
@@ -954,6 +987,8 @@ struct net_device_ops {
954 int (*ndo_get_vf_config)(struct net_device *dev, 987 int (*ndo_get_vf_config)(struct net_device *dev,
955 int vf, 988 int vf,
956 struct ifla_vf_info *ivf); 989 struct ifla_vf_info *ivf);
990 int (*ndo_set_vf_link_state)(struct net_device *dev,
991 int vf, int link_state);
957 int (*ndo_set_vf_port)(struct net_device *dev, 992 int (*ndo_set_vf_port)(struct net_device *dev,
958 int vf, 993 int vf,
959 struct nlattr *port[]); 994 struct nlattr *port[]);
@@ -1088,6 +1123,8 @@ struct net_device {
1088 * need to set them appropriately. 1123 * need to set them appropriately.
1089 */ 1124 */
1090 netdev_features_t hw_enc_features; 1125 netdev_features_t hw_enc_features;
1126 /* mask of fetures inheritable by MPLS */
1127 netdev_features_t mpls_features;
1091 1128
1092 /* Interface index. Unique device identifier */ 1129 /* Interface index. Unique device identifier */
1093 int ifindex; 1130 int ifindex;
@@ -1140,8 +1177,10 @@ struct net_device {
1140 unsigned char addr_assign_type; /* hw address assignment type */ 1177 unsigned char addr_assign_type; /* hw address assignment type */
1141 unsigned char addr_len; /* hardware address length */ 1178 unsigned char addr_len; /* hardware address length */
1142 unsigned char neigh_priv_len; 1179 unsigned char neigh_priv_len;
1143 unsigned short dev_id; /* for shared network cards */ 1180 unsigned short dev_id; /* Used to differentiate devices
1144 1181 * that share the same link
1182 * layer address
1183 */
1145 spinlock_t addr_list_lock; 1184 spinlock_t addr_list_lock;
1146 struct netdev_hw_addr_list uc; /* Unicast mac addresses */ 1185 struct netdev_hw_addr_list uc; /* Unicast mac addresses */
1147 struct netdev_hw_addr_list mc; /* Multicast mac addresses */ 1186 struct netdev_hw_addr_list mc; /* Multicast mac addresses */
@@ -1593,9 +1632,34 @@ struct packet_offload {
1593#define NETDEV_RELEASE 0x0012 1632#define NETDEV_RELEASE 0x0012
1594#define NETDEV_NOTIFY_PEERS 0x0013 1633#define NETDEV_NOTIFY_PEERS 0x0013
1595#define NETDEV_JOIN 0x0014 1634#define NETDEV_JOIN 0x0014
1635#define NETDEV_CHANGEUPPER 0x0015
1596 1636
1597extern int register_netdevice_notifier(struct notifier_block *nb); 1637extern int register_netdevice_notifier(struct notifier_block *nb);
1598extern int unregister_netdevice_notifier(struct notifier_block *nb); 1638extern int unregister_netdevice_notifier(struct notifier_block *nb);
1639
1640struct netdev_notifier_info {
1641 struct net_device *dev;
1642};
1643
1644struct netdev_notifier_change_info {
1645 struct netdev_notifier_info info; /* must be first */
1646 unsigned int flags_changed;
1647};
1648
1649static inline void netdev_notifier_info_init(struct netdev_notifier_info *info,
1650 struct net_device *dev)
1651{
1652 info->dev = dev;
1653}
1654
1655static inline struct net_device *
1656netdev_notifier_info_to_dev(const struct netdev_notifier_info *info)
1657{
1658 return info->dev;
1659}
1660
1661extern int call_netdevice_notifiers_info(unsigned long val, struct net_device *dev,
1662 struct netdev_notifier_info *info);
1599extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); 1663extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1600 1664
1601 1665
@@ -1779,6 +1843,19 @@ static inline int unregister_gifconf(unsigned int family)
1779 return register_gifconf(family, NULL); 1843 return register_gifconf(family, NULL);
1780} 1844}
1781 1845
1846#ifdef CONFIG_NET_FLOW_LIMIT
1847#define FLOW_LIMIT_HISTORY (1 << 7) /* must be ^2 and !overflow buckets */
1848struct sd_flow_limit {
1849 u64 count;
1850 unsigned int num_buckets;
1851 unsigned int history_head;
1852 u16 history[FLOW_LIMIT_HISTORY];
1853 u8 buckets[];
1854};
1855
1856extern int netdev_flow_limit_table_len;
1857#endif /* CONFIG_NET_FLOW_LIMIT */
1858
1782/* 1859/*
1783 * Incoming packets are placed on per-cpu queues 1860 * Incoming packets are placed on per-cpu queues
1784 */ 1861 */
@@ -1808,6 +1885,10 @@ struct softnet_data {
1808 unsigned int dropped; 1885 unsigned int dropped;
1809 struct sk_buff_head input_pkt_queue; 1886 struct sk_buff_head input_pkt_queue;
1810 struct napi_struct backlog; 1887 struct napi_struct backlog;
1888
1889#ifdef CONFIG_NET_FLOW_LIMIT
1890 struct sd_flow_limit __rcu *flow_limit;
1891#endif
1811}; 1892};
1812 1893
1813static inline void input_queue_head_incr(struct softnet_data *sd) 1894static inline void input_queue_head_incr(struct softnet_data *sd)
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 0060fde3160e..de70f7b45b68 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -35,7 +35,7 @@ static inline void nf_inet_addr_mask(const union nf_inet_addr *a1,
35 result->all[3] = a1->all[3] & mask->all[3]; 35 result->all[3] = a1->all[3] & mask->all[3];
36} 36}
37 37
38extern void netfilter_init(void); 38extern int netfilter_init(void);
39 39
40/* Largest hook number + 1 */ 40/* Largest hook number + 1 */
41#define NF_MAX_HOOKS 8 41#define NF_MAX_HOOKS 8
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 6358da5eeee8..7a6c396a263b 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -46,6 +46,7 @@ struct netlink_kernel_cfg {
46 void (*input)(struct sk_buff *skb); 46 void (*input)(struct sk_buff *skb);
47 struct mutex *cb_mutex; 47 struct mutex *cb_mutex;
48 void (*bind)(int group); 48 void (*bind)(int group);
49 bool (*compare)(struct net *net, struct sock *sk);
49}; 50};
50 51
51extern struct sock *__netlink_kernel_create(struct net *net, int unit, 52extern struct sock *__netlink_kernel_create(struct net *net, int unit,
@@ -84,6 +85,22 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb,
84void netlink_detachskb(struct sock *sk, struct sk_buff *skb); 85void netlink_detachskb(struct sock *sk, struct sk_buff *skb);
85int netlink_sendskb(struct sock *sk, struct sk_buff *skb); 86int netlink_sendskb(struct sock *sk, struct sk_buff *skb);
86 87
88static inline struct sk_buff *
89netlink_skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
90{
91 struct sk_buff *nskb;
92
93 nskb = skb_clone(skb, gfp_mask);
94 if (!nskb)
95 return NULL;
96
97 /* This is a large skb, set destructor callback to release head */
98 if (is_vmalloc_addr(skb->head))
99 nskb->destructor = skb->destructor;
100
101 return nskb;
102}
103
87/* 104/*
88 * skb should fit one page. This choice is good for headerless malloc. 105 * skb should fit one page. This choice is good for headerless malloc.
89 * But we should limit to 8K so that userspace does not have to 106 * But we should limit to 8K so that userspace does not have to
@@ -144,4 +161,14 @@ static inline int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
144 return __netlink_dump_start(ssk, skb, nlh, control); 161 return __netlink_dump_start(ssk, skb, nlh, control);
145} 162}
146 163
164struct netlink_tap {
165 struct net_device *dev;
166 struct module *module;
167 struct list_head list;
168};
169
170extern 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);
173
147#endif /* __LINUX_NETLINK_H */ 174#endif /* __LINUX_NETLINK_H */
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index fa2cb76a7029..f3c7c24bec1c 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -53,10 +53,10 @@ struct netpoll_info {
53}; 53};
54 54
55#ifdef CONFIG_NETPOLL 55#ifdef CONFIG_NETPOLL
56extern int netpoll_rx_disable(struct net_device *dev); 56extern void netpoll_rx_disable(struct net_device *dev);
57extern void netpoll_rx_enable(struct net_device *dev); 57extern void netpoll_rx_enable(struct net_device *dev);
58#else 58#else
59static inline int netpoll_rx_disable(struct net_device *dev) { return 0; } 59static inline void netpoll_rx_disable(struct net_device *dev) { return; }
60static inline void netpoll_rx_enable(struct net_device *dev) { return; } 60static inline void netpoll_rx_enable(struct net_device *dev) { return; }
61#endif 61#endif
62 62
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 7b8fc73810ad..e36dee52f224 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -32,6 +32,15 @@ struct nfs4_acl {
32 struct nfs4_ace aces[0]; 32 struct nfs4_ace aces[0];
33}; 33};
34 34
35#define NFS4_MAXLABELLEN 2048
36
37struct nfs4_label {
38 uint32_t lfs;
39 uint32_t pi;
40 u32 len;
41 char *label;
42};
43
35typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier; 44typedef struct { char data[NFS4_VERIFIER_SIZE]; } nfs4_verifier;
36 45
37struct nfs_stateid4 { 46struct nfs_stateid4 {
@@ -219,6 +228,14 @@ enum nfsstat4 {
219 NFS4ERR_REJECT_DELEG = 10085, /* on callback */ 228 NFS4ERR_REJECT_DELEG = 10085, /* on callback */
220 NFS4ERR_RETURNCONFLICT = 10086, /* outstanding layoutreturn */ 229 NFS4ERR_RETURNCONFLICT = 10086, /* outstanding layoutreturn */
221 NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */ 230 NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */
231
232 /* nfs42 */
233 NFS4ERR_PARTNER_NOTSUPP = 10088,
234 NFS4ERR_PARTNER_NO_AUTH = 10089,
235 NFS4ERR_METADATA_NOTSUPP = 10090,
236 NFS4ERR_OFFLOAD_DENIED = 10091,
237 NFS4ERR_WRONG_LFS = 10092,
238 NFS4ERR_BADLABEL = 10093,
222}; 239};
223 240
224static inline bool seqid_mutating_err(u32 err) 241static inline bool seqid_mutating_err(u32 err)
@@ -378,6 +395,7 @@ enum lock_type4 {
378#define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30) 395#define FATTR4_WORD1_FS_LAYOUT_TYPES (1UL << 30)
379#define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1) 396#define FATTR4_WORD2_LAYOUT_BLKSIZE (1UL << 1)
380#define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4) 397#define FATTR4_WORD2_MDSTHRESHOLD (1UL << 4)
398#define FATTR4_WORD2_SECURITY_LABEL (1UL << 17)
381 399
382/* MDS threshold bitmap bits */ 400/* MDS threshold bitmap bits */
383#define THRESHOLD_RD (1UL << 0) 401#define THRESHOLD_RD (1UL << 0)
@@ -390,11 +408,15 @@ enum lock_type4 {
390#define NFS4_VERSION 4 408#define NFS4_VERSION 4
391#define NFS4_MINOR_VERSION 0 409#define NFS4_MINOR_VERSION 0
392 410
411#if defined(CONFIG_NFS_V4_2)
412#define NFS4_MAX_MINOR_VERSION 2
413#else
393#if defined(CONFIG_NFS_V4_1) 414#if defined(CONFIG_NFS_V4_1)
394#define NFS4_MAX_MINOR_VERSION 1 415#define NFS4_MAX_MINOR_VERSION 1
395#else 416#else
396#define NFS4_MAX_MINOR_VERSION 0 417#define NFS4_MAX_MINOR_VERSION 0
397#endif /* CONFIG_NFS_V4_1 */ 418#endif /* CONFIG_NFS_V4_1 */
419#endif /* CONFIG_NFS_V4_2 */
398 420
399#define NFS4_DEBUG 1 421#define NFS4_DEBUG 1
400 422
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index fc01d5cb4cf1..7125cef74164 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -207,6 +207,7 @@ struct nfs_inode {
207#define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */ 207#define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */
208#define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */ 208#define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */
209#define NFS_INO_REVAL_FORCED 0x0040 /* force revalidation ignoring a delegation */ 209#define NFS_INO_REVAL_FORCED 0x0040 /* force revalidation ignoring a delegation */
210#define NFS_INO_INVALID_LABEL 0x0080 /* cached label is invalid */
210 211
211/* 212/*
212 * Bit offsets in flags field 213 * Bit offsets in flags field
@@ -336,7 +337,7 @@ extern void nfs_zap_mapping(struct inode *inode, struct address_space *mapping);
336extern void nfs_zap_caches(struct inode *); 337extern void nfs_zap_caches(struct inode *);
337extern void nfs_invalidate_atime(struct inode *); 338extern void nfs_invalidate_atime(struct inode *);
338extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, 339extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
339 struct nfs_fattr *); 340 struct nfs_fattr *, struct nfs4_label *);
340extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *); 341extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
341extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); 342extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr);
342extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); 343extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr);
@@ -347,15 +348,19 @@ extern int nfs_permission(struct inode *, int);
347extern int nfs_open(struct inode *, struct file *); 348extern int nfs_open(struct inode *, struct file *);
348extern int nfs_release(struct inode *, struct file *); 349extern int nfs_release(struct inode *, struct file *);
349extern int nfs_attribute_timeout(struct inode *inode); 350extern int nfs_attribute_timeout(struct inode *inode);
351extern int nfs_attribute_cache_expired(struct inode *inode);
350extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode); 352extern int nfs_revalidate_inode(struct nfs_server *server, struct inode *inode);
351extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *); 353extern int __nfs_revalidate_inode(struct nfs_server *, struct inode *);
352extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping); 354extern int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping);
353extern int nfs_setattr(struct dentry *, struct iattr *); 355extern int nfs_setattr(struct dentry *, struct iattr *);
354extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr); 356extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr);
357extern void nfs_setsecurity(struct inode *inode, struct nfs_fattr *fattr,
358 struct nfs4_label *label);
355extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 359extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
356extern void put_nfs_open_context(struct nfs_open_context *ctx); 360extern void put_nfs_open_context(struct nfs_open_context *ctx);
357extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); 361extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode);
358extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode); 362extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, fmode_t f_mode);
363extern void nfs_inode_attach_open_context(struct nfs_open_context *ctx);
359extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); 364extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx);
360extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); 365extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx);
361extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); 366extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx);
@@ -468,7 +473,8 @@ extern const struct file_operations nfs_dir_operations;
468extern const struct dentry_operations nfs_dentry_operations; 473extern const struct dentry_operations nfs_dentry_operations;
469 474
470extern void nfs_force_lookup_revalidate(struct inode *dir); 475extern void nfs_force_lookup_revalidate(struct inode *dir);
471extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_fattr *fattr); 476extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh,
477 struct nfs_fattr *fattr, struct nfs4_label *label);
472extern int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags); 478extern int nfs_may_open(struct inode *inode, struct rpc_cred *cred, int openflags);
473extern void nfs_access_zap_cache(struct inode *inode); 479extern void nfs_access_zap_cache(struct inode *inode);
474 480
@@ -497,6 +503,24 @@ extern int nfs_mountpoint_expiry_timeout;
497extern void nfs_release_automount_timer(void); 503extern void nfs_release_automount_timer(void);
498 504
499/* 505/*
506 * linux/fs/nfs/nfs4proc.c
507 */
508#ifdef CONFIG_NFS_V4_SECURITY_LABEL
509extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags);
510static inline void nfs4_label_free(struct nfs4_label *label)
511{
512 if (label) {
513 kfree(label->label);
514 kfree(label);
515 }
516 return;
517}
518#else
519static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; }
520static inline void nfs4_label_free(void *label) {}
521#endif
522
523/*
500 * linux/fs/nfs/unlink.c 524 * linux/fs/nfs/unlink.c
501 */ 525 */
502extern void nfs_complete_unlink(struct dentry *dentry, struct inode *); 526extern void nfs_complete_unlink(struct dentry *dentry, struct inode *);
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 3b7fa2abecca..d2212432c456 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -146,7 +146,12 @@ struct nfs_server {
146 u32 attr_bitmask[3];/* V4 bitmask representing the set 146 u32 attr_bitmask[3];/* V4 bitmask representing the set
147 of attributes supported on this 147 of attributes supported on this
148 filesystem */ 148 filesystem */
149 u32 cache_consistency_bitmask[2]; 149 u32 attr_bitmask_nl[3];
150 /* V4 bitmask representing the
151 set of attributes supported
152 on this filesystem excluding
153 the label support bit. */
154 u32 cache_consistency_bitmask[3];
150 /* V4 bitmask representing the subset 155 /* V4 bitmask representing the subset
151 of change attribute, size, ctime 156 of change attribute, size, ctime
152 and mtime attributes supported by 157 and mtime attributes supported by
@@ -200,5 +205,6 @@ struct nfs_server {
200#define NFS_CAP_UIDGID_NOMAP (1U << 15) 205#define NFS_CAP_UIDGID_NOMAP (1U << 15)
201#define NFS_CAP_STATEID_NFSV41 (1U << 16) 206#define NFS_CAP_STATEID_NFSV41 (1U << 16)
202#define NFS_CAP_ATOMIC_OPEN_V1 (1U << 17) 207#define NFS_CAP_ATOMIC_OPEN_V1 (1U << 17)
208#define NFS_CAP_SECURITY_LABEL (1U << 18)
203 209
204#endif 210#endif
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 104b62f23ee0..8651574a305b 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -101,6 +101,7 @@ struct nfs_fattr {
101#define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 22) 101#define NFS_ATTR_FATTR_MOUNTED_ON_FILEID (1U << 22)
102#define NFS_ATTR_FATTR_OWNER_NAME (1U << 23) 102#define NFS_ATTR_FATTR_OWNER_NAME (1U << 23)
103#define NFS_ATTR_FATTR_GROUP_NAME (1U << 24) 103#define NFS_ATTR_FATTR_GROUP_NAME (1U << 24)
104#define NFS_ATTR_FATTR_V4_SECURITY_LABEL (1U << 25)
104 105
105#define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \ 106#define NFS_ATTR_FATTR (NFS_ATTR_FATTR_TYPE \
106 | NFS_ATTR_FATTR_MODE \ 107 | NFS_ATTR_FATTR_MODE \
@@ -120,7 +121,8 @@ struct nfs_fattr {
120#define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \ 121#define NFS_ATTR_FATTR_V3 (NFS_ATTR_FATTR \
121 | NFS_ATTR_FATTR_SPACE_USED) 122 | NFS_ATTR_FATTR_SPACE_USED)
122#define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \ 123#define NFS_ATTR_FATTR_V4 (NFS_ATTR_FATTR \
123 | NFS_ATTR_FATTR_SPACE_USED) 124 | NFS_ATTR_FATTR_SPACE_USED \
125 | NFS_ATTR_FATTR_V4_SECURITY_LABEL)
124 126
125/* 127/*
126 * Info on the file system 128 * Info on the file system
@@ -246,6 +248,7 @@ struct nfs4_layoutget_res {
246struct nfs4_layoutget { 248struct nfs4_layoutget {
247 struct nfs4_layoutget_args args; 249 struct nfs4_layoutget_args args;
248 struct nfs4_layoutget_res res; 250 struct nfs4_layoutget_res res;
251 struct rpc_cred *cred;
249 gfp_t gfp_flags; 252 gfp_t gfp_flags;
250}; 253};
251 254
@@ -347,6 +350,7 @@ struct nfs_openargs {
347 const u32 * open_bitmap; 350 const u32 * open_bitmap;
348 __u32 claim; 351 __u32 claim;
349 enum createmode4 createmode; 352 enum createmode4 createmode;
353 const struct nfs4_label *label;
350}; 354};
351 355
352struct nfs_openres { 356struct nfs_openres {
@@ -356,6 +360,7 @@ struct nfs_openres {
356 struct nfs4_change_info cinfo; 360 struct nfs4_change_info cinfo;
357 __u32 rflags; 361 __u32 rflags;
358 struct nfs_fattr * f_attr; 362 struct nfs_fattr * f_attr;
363 struct nfs4_label *f_label;
359 struct nfs_seqid * seqid; 364 struct nfs_seqid * seqid;
360 const struct nfs_server *server; 365 const struct nfs_server *server;
361 fmode_t delegation_type; 366 fmode_t delegation_type;
@@ -598,6 +603,7 @@ struct nfs_entry {
598 int eof; 603 int eof;
599 struct nfs_fh * fh; 604 struct nfs_fh * fh;
600 struct nfs_fattr * fattr; 605 struct nfs_fattr * fattr;
606 struct nfs4_label *label;
601 unsigned char d_type; 607 unsigned char d_type;
602 struct nfs_server * server; 608 struct nfs_server * server;
603}; 609};
@@ -630,6 +636,7 @@ struct nfs_setattrargs {
630 struct iattr * iap; 636 struct iattr * iap;
631 const struct nfs_server * server; /* Needed for name mapping */ 637 const struct nfs_server * server; /* Needed for name mapping */
632 const u32 * bitmask; 638 const u32 * bitmask;
639 const struct nfs4_label *label;
633}; 640};
634 641
635struct nfs_setaclargs { 642struct nfs_setaclargs {
@@ -665,6 +672,7 @@ struct nfs_getaclres {
665struct nfs_setattrres { 672struct nfs_setattrres {
666 struct nfs4_sequence_res seq_res; 673 struct nfs4_sequence_res seq_res;
667 struct nfs_fattr * fattr; 674 struct nfs_fattr * fattr;
675 struct nfs4_label *label;
668 const struct nfs_server * server; 676 const struct nfs_server * server;
669}; 677};
670 678
@@ -862,6 +870,7 @@ struct nfs4_create_arg {
862 const struct iattr * attrs; 870 const struct iattr * attrs;
863 const struct nfs_fh * dir_fh; 871 const struct nfs_fh * dir_fh;
864 const u32 * bitmask; 872 const u32 * bitmask;
873 const struct nfs4_label *label;
865}; 874};
866 875
867struct nfs4_create_res { 876struct nfs4_create_res {
@@ -869,6 +878,7 @@ struct nfs4_create_res {
869 const struct nfs_server * server; 878 const struct nfs_server * server;
870 struct nfs_fh * fh; 879 struct nfs_fh * fh;
871 struct nfs_fattr * fattr; 880 struct nfs_fattr * fattr;
881 struct nfs4_label *label;
872 struct nfs4_change_info dir_cinfo; 882 struct nfs4_change_info dir_cinfo;
873}; 883};
874 884
@@ -893,6 +903,7 @@ struct nfs4_getattr_res {
893 struct nfs4_sequence_res seq_res; 903 struct nfs4_sequence_res seq_res;
894 const struct nfs_server * server; 904 const struct nfs_server * server;
895 struct nfs_fattr * fattr; 905 struct nfs_fattr * fattr;
906 struct nfs4_label *label;
896}; 907};
897 908
898struct nfs4_link_arg { 909struct nfs4_link_arg {
@@ -907,6 +918,7 @@ struct nfs4_link_res {
907 struct nfs4_sequence_res seq_res; 918 struct nfs4_sequence_res seq_res;
908 const struct nfs_server * server; 919 const struct nfs_server * server;
909 struct nfs_fattr * fattr; 920 struct nfs_fattr * fattr;
921 struct nfs4_label *label;
910 struct nfs4_change_info cinfo; 922 struct nfs4_change_info cinfo;
911 struct nfs_fattr * dir_attr; 923 struct nfs_fattr * dir_attr;
912}; 924};
@@ -924,6 +936,7 @@ struct nfs4_lookup_res {
924 const struct nfs_server * server; 936 const struct nfs_server * server;
925 struct nfs_fattr * fattr; 937 struct nfs_fattr * fattr;
926 struct nfs_fh * fh; 938 struct nfs_fh * fh;
939 struct nfs4_label *label;
927}; 940};
928 941
929struct nfs4_lookup_root_arg { 942struct nfs4_lookup_root_arg {
@@ -1366,11 +1379,12 @@ struct nfs_rpc_ops {
1366 struct dentry *(*try_mount) (int, const char *, struct nfs_mount_info *, 1379 struct dentry *(*try_mount) (int, const char *, struct nfs_mount_info *,
1367 struct nfs_subversion *); 1380 struct nfs_subversion *);
1368 int (*getattr) (struct nfs_server *, struct nfs_fh *, 1381 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1369 struct nfs_fattr *); 1382 struct nfs_fattr *, struct nfs4_label *);
1370 int (*setattr) (struct dentry *, struct nfs_fattr *, 1383 int (*setattr) (struct dentry *, struct nfs_fattr *,
1371 struct iattr *); 1384 struct iattr *);
1372 int (*lookup) (struct inode *, struct qstr *, 1385 int (*lookup) (struct inode *, struct qstr *,
1373 struct nfs_fh *, struct nfs_fattr *); 1386 struct nfs_fh *, struct nfs_fattr *,
1387 struct nfs4_label *);
1374 int (*access) (struct inode *, struct nfs_access_entry *); 1388 int (*access) (struct inode *, struct nfs_access_entry *);
1375 int (*readlink)(struct inode *, struct page *, unsigned int, 1389 int (*readlink)(struct inode *, struct page *, unsigned int,
1376 unsigned int); 1390 unsigned int);
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 901b7435e890..9d27475feec1 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -4,12 +4,12 @@
4#include <linux/platform_device.h> 4#include <linux/platform_device.h>
5#include <linux/of_platform.h> /* temporary until merge */ 5#include <linux/of_platform.h> /* temporary until merge */
6 6
7#ifdef CONFIG_OF_DEVICE
8#include <linux/of.h> 7#include <linux/of.h>
9#include <linux/mod_devicetable.h> 8#include <linux/mod_devicetable.h>
10 9
11struct device; 10struct device;
12 11
12#ifdef CONFIG_OF
13extern const struct of_device_id *of_match_device( 13extern const struct of_device_id *of_match_device(
14 const struct of_device_id *matches, const struct device *dev); 14 const struct of_device_id *matches, const struct device *dev);
15extern void of_device_make_bus_id(struct device *dev); 15extern void of_device_make_bus_id(struct device *dev);
@@ -43,7 +43,7 @@ static inline void of_device_node_put(struct device *dev)
43 of_node_put(dev->of_node); 43 of_node_put(dev->of_node);
44} 44}
45 45
46#else /* CONFIG_OF_DEVICE */ 46#else /* CONFIG_OF */
47 47
48static inline int of_driver_match_device(struct device *dev, 48static inline int of_driver_match_device(struct device *dev,
49 struct device_driver *drv) 49 struct device_driver *drv)
@@ -67,6 +67,6 @@ static inline const struct of_device_id *of_match_device(
67{ 67{
68 return NULL; 68 return NULL;
69} 69}
70#endif /* CONFIG_OF_DEVICE */ 70#endif /* CONFIG_OF */
71 71
72#endif /* _LINUX_OF_DEVICE_H */ 72#endif /* _LINUX_OF_DEVICE_H */
diff --git a/include/linux/of_dma.h b/include/linux/of_dma.h
index 364dda734877..ae36298ba076 100644
--- a/include/linux/of_dma.h
+++ b/include/linux/of_dma.h
@@ -21,7 +21,6 @@ struct device_node;
21struct of_dma { 21struct of_dma {
22 struct list_head of_dma_controllers; 22 struct list_head of_dma_controllers;
23 struct device_node *of_node; 23 struct device_node *of_node;
24 int of_dma_nbcells;
25 struct dma_chan *(*of_dma_xlate) 24 struct dma_chan *(*of_dma_xlate)
26 (struct of_phandle_args *, struct of_dma *); 25 (struct of_phandle_args *, struct of_dma *);
27 void *of_dma_data; 26 void *of_dma_data;
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 2a93b64a3869..05cb4a928252 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -13,8 +13,6 @@
13 13
14#include <linux/device.h> 14#include <linux/device.h>
15#include <linux/mod_devicetable.h> 15#include <linux/mod_devicetable.h>
16
17#ifdef CONFIG_OF_DEVICE
18#include <linux/pm.h> 16#include <linux/pm.h>
19#include <linux/of_device.h> 17#include <linux/of_device.h>
20#include <linux/platform_device.h> 18#include <linux/platform_device.h>
@@ -53,27 +51,6 @@ struct of_dev_auxdata {
53 { .compatible = _compat, .phys_addr = _phys, .name = _name, \ 51 { .compatible = _compat, .phys_addr = _phys, .name = _name, \
54 .platform_data = _pdata } 52 .platform_data = _pdata }
55 53
56/**
57 * of_platform_driver - Legacy of-aware driver for platform devices.
58 *
59 * An of_platform_driver driver is attached to a basic platform_device on
60 * the ibm ebus (ibmebus_bus_type).
61 */
62struct of_platform_driver
63{
64 int (*probe)(struct platform_device* dev,
65 const struct of_device_id *match);
66 int (*remove)(struct platform_device* dev);
67
68 int (*suspend)(struct platform_device* dev, pm_message_t state);
69 int (*resume)(struct platform_device* dev);
70 int (*shutdown)(struct platform_device* dev);
71
72 struct device_driver driver;
73};
74#define to_of_platform_driver(drv) \
75 container_of(drv,struct of_platform_driver, driver)
76
77extern const struct of_device_id of_default_bus_match_table[]; 54extern const struct of_device_id of_default_bus_match_table[];
78 55
79/* Platform drivers register/unregister */ 56/* Platform drivers register/unregister */
@@ -82,7 +59,6 @@ extern struct platform_device *of_device_alloc(struct device_node *np,
82 struct device *parent); 59 struct device *parent);
83extern struct platform_device *of_find_device_by_node(struct device_node *np); 60extern struct platform_device *of_find_device_by_node(struct device_node *np);
84 61
85#ifdef CONFIG_OF_ADDRESS /* device reg helpers depend on OF_ADDRESS */
86/* Platform devices and busses creation */ 62/* Platform devices and busses creation */
87extern struct platform_device *of_platform_device_create(struct device_node *np, 63extern struct platform_device *of_platform_device_create(struct device_node *np,
88 const char *bus_id, 64 const char *bus_id,
@@ -91,17 +67,12 @@ extern struct platform_device *of_platform_device_create(struct device_node *np,
91extern int of_platform_bus_probe(struct device_node *root, 67extern int of_platform_bus_probe(struct device_node *root,
92 const struct of_device_id *matches, 68 const struct of_device_id *matches,
93 struct device *parent); 69 struct device *parent);
70#ifdef CONFIG_OF_ADDRESS
94extern int of_platform_populate(struct device_node *root, 71extern int of_platform_populate(struct device_node *root,
95 const struct of_device_id *matches, 72 const struct of_device_id *matches,
96 const struct of_dev_auxdata *lookup, 73 const struct of_dev_auxdata *lookup,
97 struct device *parent); 74 struct device *parent);
98#endif /* CONFIG_OF_ADDRESS */ 75#else
99
100#endif /* CONFIG_OF_DEVICE */
101
102#if !defined(CONFIG_OF_ADDRESS)
103struct of_dev_auxdata;
104struct device_node;
105static inline int of_platform_populate(struct device_node *root, 76static inline int of_platform_populate(struct device_node *root,
106 const struct of_device_id *matches, 77 const struct of_device_id *matches,
107 const struct of_dev_auxdata *lookup, 78 const struct of_dev_auxdata *lookup,
@@ -109,6 +80,6 @@ static inline int of_platform_populate(struct device_node *root,
109{ 80{
110 return -ENODEV; 81 return -ENODEV;
111} 82}
112#endif /* !CONFIG_OF_ADDRESS */ 83#endif
113 84
114#endif /* _LINUX_OF_PLATFORM_H */ 85#endif /* _LINUX_OF_PLATFORM_H */
diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h
index be655e4a2a75..2ee8cd2466b5 100644
--- a/include/linux/pageblock-flags.h
+++ b/include/linux/pageblock-flags.h
@@ -80,10 +80,4 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags,
80 PB_migrate_skip) 80 PB_migrate_skip)
81#endif /* CONFIG_COMPACTION */ 81#endif /* CONFIG_COMPACTION */
82 82
83#define get_pageblock_flags(page) \
84 get_pageblock_flags_group(page, 0, PB_migrate_end)
85#define set_pageblock_flags(page, flags) \
86 set_pageblock_flags_group(page, flags, \
87 0, PB_migrate_end)
88
89#endif /* PAGEBLOCK_FLAGS_H */ 83#endif /* PAGEBLOCK_FLAGS_H */
diff --git a/include/linux/pagevec.h b/include/linux/pagevec.h
index 2aa12b8499c0..e4dbfab37729 100644
--- a/include/linux/pagevec.h
+++ b/include/linux/pagevec.h
@@ -21,7 +21,7 @@ struct pagevec {
21}; 21};
22 22
23void __pagevec_release(struct pagevec *pvec); 23void __pagevec_release(struct pagevec *pvec);
24void __pagevec_lru_add(struct pagevec *pvec, enum lru_list lru); 24void __pagevec_lru_add(struct pagevec *pvec);
25unsigned pagevec_lookup(struct pagevec *pvec, struct address_space *mapping, 25unsigned pagevec_lookup(struct pagevec *pvec, struct address_space *mapping,
26 pgoff_t start, unsigned nr_pages); 26 pgoff_t start, unsigned nr_pages);
27unsigned pagevec_lookup_tag(struct pagevec *pvec, 27unsigned pagevec_lookup_tag(struct pagevec *pvec,
@@ -64,36 +64,4 @@ static inline void pagevec_release(struct pagevec *pvec)
64 __pagevec_release(pvec); 64 __pagevec_release(pvec);
65} 65}
66 66
67static inline void __pagevec_lru_add_anon(struct pagevec *pvec)
68{
69 __pagevec_lru_add(pvec, LRU_INACTIVE_ANON);
70}
71
72static inline void __pagevec_lru_add_active_anon(struct pagevec *pvec)
73{
74 __pagevec_lru_add(pvec, LRU_ACTIVE_ANON);
75}
76
77static inline void __pagevec_lru_add_file(struct pagevec *pvec)
78{
79 __pagevec_lru_add(pvec, LRU_INACTIVE_FILE);
80}
81
82static inline void __pagevec_lru_add_active_file(struct pagevec *pvec)
83{
84 __pagevec_lru_add(pvec, LRU_ACTIVE_FILE);
85}
86
87static inline void pagevec_lru_add_file(struct pagevec *pvec)
88{
89 if (pagevec_count(pvec))
90 __pagevec_lru_add_file(pvec);
91}
92
93static inline void pagevec_lru_add_anon(struct pagevec *pvec)
94{
95 if (pagevec_count(pvec))
96 __pagevec_lru_add_anon(pvec);
97}
98
99#endif /* _LINUX_PAGEVEC_H */ 67#endif /* _LINUX_PAGEVEC_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 3a24e4ff3248..0fd1f1582fa1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -364,7 +364,8 @@ static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
364 return dev; 364 return dev;
365} 365}
366 366
367struct pci_dev *alloc_pci_dev(void); 367struct pci_dev *pci_alloc_dev(struct pci_bus *bus);
368struct pci_dev * __deprecated alloc_pci_dev(void);
368 369
369#define to_pci_dev(n) container_of(n, struct pci_dev, dev) 370#define to_pci_dev(n) container_of(n, struct pci_dev, dev)
370#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL) 371#define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, d)) != NULL)
@@ -1018,6 +1019,8 @@ int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *);
1018void pci_release_selected_regions(struct pci_dev *, int); 1019void pci_release_selected_regions(struct pci_dev *, int);
1019 1020
1020/* drivers/pci/bus.c */ 1021/* drivers/pci/bus.c */
1022struct pci_bus *pci_bus_get(struct pci_bus *bus);
1023void pci_bus_put(struct pci_bus *bus);
1021void pci_add_resource(struct list_head *resources, struct resource *res); 1024void pci_add_resource(struct list_head *resources, struct resource *res);
1022void pci_add_resource_offset(struct list_head *resources, struct resource *res, 1025void pci_add_resource_offset(struct list_head *resources, struct resource *res,
1023 resource_size_t offset); 1026 resource_size_t offset);
@@ -1643,6 +1646,7 @@ void pcibios_set_master(struct pci_dev *dev);
1643int pcibios_set_pcie_reset_state(struct pci_dev *dev, 1646int pcibios_set_pcie_reset_state(struct pci_dev *dev,
1644 enum pcie_reset_state state); 1647 enum pcie_reset_state state);
1645int pcibios_add_device(struct pci_dev *dev); 1648int pcibios_add_device(struct pci_dev *dev);
1649void pcibios_release_device(struct pci_dev *dev);
1646 1650
1647#ifdef CONFIG_PCI_MMCONFIG 1651#ifdef CONFIG_PCI_MMCONFIG
1648void __init pci_mmcfg_early_init(void); 1652void __init pci_mmcfg_early_init(void);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index c12916248469..3bed2e89611b 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -556,7 +556,6 @@
556#define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 556#define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450
557#define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 557#define PCI_DEVICE_ID_AMD_8131_APIC 0x7451
558#define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 558#define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458
559#define PCI_DEVICE_ID_AMD_HUDSON2_SMBUS 0x780b
560#define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F 559#define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F
561#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 560#define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090
562#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 561#define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091
@@ -568,8 +567,9 @@
568#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A 567#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A
569#define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081 568#define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081
570#define PCI_DEVICE_ID_AMD_LX_AES 0x2082 569#define PCI_DEVICE_ID_AMD_LX_AES 0x2082
571#define PCI_DEVICE_ID_AMD_HUDSON2_IDE 0x780c
572#define PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE 0x7800 570#define PCI_DEVICE_ID_AMD_HUDSON2_SATA_IDE 0x7800
571#define PCI_DEVICE_ID_AMD_HUDSON2_SMBUS 0x780b
572#define PCI_DEVICE_ID_AMD_HUDSON2_IDE 0x780c
573 573
574#define PCI_VENDOR_ID_TRIDENT 0x1023 574#define PCI_VENDOR_ID_TRIDENT 0x1023
575#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 575#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000
@@ -2476,6 +2476,9 @@
2476 2476
2477#define PCI_VENDOR_ID_ASMEDIA 0x1b21 2477#define PCI_VENDOR_ID_ASMEDIA 0x1b21
2478 2478
2479#define PCI_VENDOR_ID_CIRCUITCO 0x1cc8
2480#define PCI_SUBSYSTEM_ID_CIRCUITCO_MINNOWBOARD 0x0001
2481
2479#define PCI_VENDOR_ID_TEKRAM 0x1de1 2482#define PCI_VENDOR_ID_TEKRAM 0x1de1
2480#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 2483#define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29
2481 2484
diff --git a/include/linux/percpu-refcount.h b/include/linux/percpu-refcount.h
new file mode 100644
index 000000000000..95961f0bf62d
--- /dev/null
+++ b/include/linux/percpu-refcount.h
@@ -0,0 +1,174 @@
1/*
2 * Percpu refcounts:
3 * (C) 2012 Google, Inc.
4 * Author: Kent Overstreet <koverstreet@google.com>
5 *
6 * This implements a refcount with similar semantics to atomic_t - atomic_inc(),
7 * atomic_dec_and_test() - but percpu.
8 *
9 * There's one important difference between percpu refs and normal atomic_t
10 * refcounts; you have to keep track of your initial refcount, and then when you
11 * start shutting down you call percpu_ref_kill() _before_ dropping the initial
12 * refcount.
13 *
14 * The refcount will have a range of 0 to ((1U << 31) - 1), i.e. one bit less
15 * than an atomic_t - this is because of the way shutdown works, see
16 * percpu_ref_kill()/PCPU_COUNT_BIAS.
17 *
18 * Before you call percpu_ref_kill(), percpu_ref_put() does not check for the
19 * refcount hitting 0 - it can't, if it was in percpu mode. percpu_ref_kill()
20 * puts the ref back in single atomic_t mode, collecting the per cpu refs and
21 * issuing the appropriate barriers, and then marks the ref as shutting down so
22 * that percpu_ref_put() will check for the ref hitting 0. After it returns,
23 * it's safe to drop the initial ref.
24 *
25 * USAGE:
26 *
27 * See fs/aio.c for some example usage; it's used there for struct kioctx, which
28 * is created when userspaces calls io_setup(), and destroyed when userspace
29 * calls io_destroy() or the process exits.
30 *
31 * In the aio code, kill_ioctx() is called when we wish to destroy a kioctx; it
32 * calls percpu_ref_kill(), then hlist_del_rcu() and sychronize_rcu() to remove
33 * the kioctx from the proccess's list of kioctxs - after that, there can't be
34 * any new users of the kioctx (from lookup_ioctx()) and it's then safe to drop
35 * the initial ref with percpu_ref_put().
36 *
37 * Code that does a two stage shutdown like this often needs some kind of
38 * explicit synchronization to ensure the initial refcount can only be dropped
39 * once - percpu_ref_kill() does this for you, it returns true once and false if
40 * someone else already called it. The aio code uses it this way, but it's not
41 * necessary if the code has some other mechanism to synchronize teardown.
42 * around.
43 */
44
45#ifndef _LINUX_PERCPU_REFCOUNT_H
46#define _LINUX_PERCPU_REFCOUNT_H
47
48#include <linux/atomic.h>
49#include <linux/kernel.h>
50#include <linux/percpu.h>
51#include <linux/rcupdate.h>
52
53struct percpu_ref;
54typedef void (percpu_ref_func_t)(struct percpu_ref *);
55
56struct percpu_ref {
57 atomic_t count;
58 /*
59 * The low bit of the pointer indicates whether the ref is in percpu
60 * mode; if set, then get/put will manipulate the atomic_t (this is a
61 * hack because we need to keep the pointer around for
62 * percpu_ref_kill_rcu())
63 */
64 unsigned __percpu *pcpu_count;
65 percpu_ref_func_t *release;
66 percpu_ref_func_t *confirm_kill;
67 struct rcu_head rcu;
68};
69
70int __must_check percpu_ref_init(struct percpu_ref *ref,
71 percpu_ref_func_t *release);
72void percpu_ref_cancel_init(struct percpu_ref *ref);
73void percpu_ref_kill_and_confirm(struct percpu_ref *ref,
74 percpu_ref_func_t *confirm_kill);
75
76/**
77 * percpu_ref_kill - drop the initial ref
78 * @ref: percpu_ref to kill
79 *
80 * Must be used to drop the initial ref on a percpu refcount; must be called
81 * precisely once before shutdown.
82 *
83 * Puts @ref in non percpu mode, then does a call_rcu() before gathering up the
84 * percpu counters and dropping the initial ref.
85 */
86static inline void percpu_ref_kill(struct percpu_ref *ref)
87{
88 return percpu_ref_kill_and_confirm(ref, NULL);
89}
90
91#define PCPU_STATUS_BITS 2
92#define PCPU_STATUS_MASK ((1 << PCPU_STATUS_BITS) - 1)
93#define PCPU_REF_PTR 0
94#define PCPU_REF_DEAD 1
95
96#define REF_STATUS(count) (((unsigned long) count) & PCPU_STATUS_MASK)
97
98/**
99 * percpu_ref_get - increment a percpu refcount
100 * @ref: percpu_ref to get
101 *
102 * Analagous to atomic_inc().
103 */
104static inline void percpu_ref_get(struct percpu_ref *ref)
105{
106 unsigned __percpu *pcpu_count;
107
108 rcu_read_lock_sched();
109
110 pcpu_count = ACCESS_ONCE(ref->pcpu_count);
111
112 if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR))
113 __this_cpu_inc(*pcpu_count);
114 else
115 atomic_inc(&ref->count);
116
117 rcu_read_unlock_sched();
118}
119
120/**
121 * percpu_ref_tryget - try to increment a percpu refcount
122 * @ref: percpu_ref to try-get
123 *
124 * Increment a percpu refcount unless it has already been killed. Returns
125 * %true on success; %false on failure.
126 *
127 * Completion of percpu_ref_kill() in itself doesn't guarantee that tryget
128 * will fail. For such guarantee, percpu_ref_kill_and_confirm() should be
129 * used. After the confirm_kill callback is invoked, it's guaranteed that
130 * no new reference will be given out by percpu_ref_tryget().
131 */
132static inline bool percpu_ref_tryget(struct percpu_ref *ref)
133{
134 unsigned __percpu *pcpu_count;
135 int ret = false;
136
137 rcu_read_lock_sched();
138
139 pcpu_count = ACCESS_ONCE(ref->pcpu_count);
140
141 if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR)) {
142 __this_cpu_inc(*pcpu_count);
143 ret = true;
144 }
145
146 rcu_read_unlock_sched();
147
148 return ret;
149}
150
151/**
152 * percpu_ref_put - decrement a percpu refcount
153 * @ref: percpu_ref to put
154 *
155 * Decrement the refcount, and if 0, call the release function (which was passed
156 * to percpu_ref_init())
157 */
158static inline void percpu_ref_put(struct percpu_ref *ref)
159{
160 unsigned __percpu *pcpu_count;
161
162 rcu_read_lock_sched();
163
164 pcpu_count = ACCESS_ONCE(ref->pcpu_count);
165
166 if (likely(REF_STATUS(pcpu_count) == PCPU_REF_PTR))
167 __this_cpu_dec(*pcpu_count);
168 else if (unlikely(atomic_dec_and_test(&ref->count)))
169 ref->release(ref);
170
171 rcu_read_unlock_sched();
172}
173
174#endif
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 9e11039dd7a3..64ab823f7b74 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -49,6 +49,7 @@
49 49
50#define PHY_HAS_INTERRUPT 0x00000001 50#define PHY_HAS_INTERRUPT 0x00000001
51#define PHY_HAS_MAGICANEG 0x00000002 51#define PHY_HAS_MAGICANEG 0x00000002
52#define PHY_IS_INTERNAL 0x00000004
52 53
53/* Interface Mode definitions */ 54/* Interface Mode definitions */
54typedef enum { 55typedef enum {
@@ -57,6 +58,7 @@ typedef enum {
57 PHY_INTERFACE_MODE_GMII, 58 PHY_INTERFACE_MODE_GMII,
58 PHY_INTERFACE_MODE_SGMII, 59 PHY_INTERFACE_MODE_SGMII,
59 PHY_INTERFACE_MODE_TBI, 60 PHY_INTERFACE_MODE_TBI,
61 PHY_INTERFACE_MODE_REVMII,
60 PHY_INTERFACE_MODE_RMII, 62 PHY_INTERFACE_MODE_RMII,
61 PHY_INTERFACE_MODE_RGMII, 63 PHY_INTERFACE_MODE_RGMII,
62 PHY_INTERFACE_MODE_RGMII_ID, 64 PHY_INTERFACE_MODE_RGMII_ID,
@@ -261,6 +263,7 @@ struct phy_c45_device_ids {
261 * phy_id: UID for this device found during discovery 263 * phy_id: UID for this device found during discovery
262 * c45_ids: 802.3-c45 Device Identifers if is_c45. 264 * c45_ids: 802.3-c45 Device Identifers if is_c45.
263 * is_c45: Set to true if this phy uses clause 45 addressing. 265 * is_c45: Set to true if this phy uses clause 45 addressing.
266 * is_internal: Set to true if this phy is internal to a MAC.
264 * state: state of the PHY for management purposes 267 * state: state of the PHY for management purposes
265 * dev_flags: Device-specific flags used by the PHY driver. 268 * dev_flags: Device-specific flags used by the PHY driver.
266 * addr: Bus address of PHY 269 * addr: Bus address of PHY
@@ -298,6 +301,7 @@ struct phy_device {
298 301
299 struct phy_c45_device_ids c45_ids; 302 struct phy_c45_device_ids c45_ids;
300 bool is_c45; 303 bool is_c45;
304 bool is_internal;
301 305
302 enum phy_state state; 306 enum phy_state state;
303 307
@@ -508,6 +512,27 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val)
508 return mdiobus_write(phydev->bus, phydev->addr, regnum, val); 512 return mdiobus_write(phydev->bus, phydev->addr, regnum, val);
509} 513}
510 514
515/**
516 * phy_interrupt_is_valid - Convenience function for testing a given PHY irq
517 * @phydev: the phy_device struct
518 *
519 * NOTE: must be kept in sync with addition/removal of PHY_POLL and
520 * PHY_IGNORE_INTERRUPT
521 */
522static inline bool phy_interrupt_is_valid(struct phy_device *phydev)
523{
524 return phydev->irq != PHY_POLL && phydev->irq != PHY_IGNORE_INTERRUPT;
525}
526
527/**
528 * phy_is_internal - Convenience function for testing if a PHY is internal
529 * @phydev: the phy_device struct
530 */
531static inline bool phy_is_internal(struct phy_device *phydev)
532{
533 return phydev->is_internal;
534}
535
511struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, 536struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
512 bool is_c45, struct phy_c45_device_ids *c45_ids); 537 bool is_c45, struct phy_c45_device_ids *c45_ids);
513struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); 538struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);
@@ -545,6 +570,8 @@ void phy_drivers_unregister(struct phy_driver *drv, int n);
545int phy_driver_register(struct phy_driver *new_driver); 570int phy_driver_register(struct phy_driver *new_driver);
546int phy_drivers_register(struct phy_driver *new_driver, int n); 571int phy_drivers_register(struct phy_driver *new_driver, int n);
547void phy_state_machine(struct work_struct *work); 572void phy_state_machine(struct work_struct *work);
573void phy_change(struct work_struct *work);
574void phy_mac_interrupt(struct phy_device *phydev, int new_link);
548void phy_start_machine(struct phy_device *phydev, 575void phy_start_machine(struct phy_device *phydev,
549 void (*handler)(struct net_device *)); 576 void (*handler)(struct net_device *));
550void phy_stop_machine(struct phy_device *phydev); 577void phy_stop_machine(struct phy_device *phydev);
diff --git a/include/linux/pid.h b/include/linux/pid.h
index a089a3c447fc..23705a53abba 100644
--- a/include/linux/pid.h
+++ b/include/linux/pid.h
@@ -86,11 +86,9 @@ extern struct task_struct *get_pid_task(struct pid *pid, enum pid_type);
86extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); 86extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type);
87 87
88/* 88/*
89 * attach_pid() and detach_pid() must be called with the tasklist_lock 89 * these helpers must be called with the tasklist_lock write-held.
90 * write-held.
91 */ 90 */
92extern void attach_pid(struct task_struct *task, enum pid_type type, 91extern void attach_pid(struct task_struct *task, enum pid_type);
93 struct pid *pid);
94extern void detach_pid(struct task_struct *task, enum pid_type); 92extern void detach_pid(struct task_struct *task, enum pid_type);
95extern void change_pid(struct task_struct *task, enum pid_type, 93extern void change_pid(struct task_struct *task, enum pid_type,
96 struct pid *pid); 94 struct pid *pid);
diff --git a/include/linux/pinctrl/consumer.h b/include/linux/pinctrl/consumer.h
index 4aad3cea69ae..18eccefea06e 100644
--- a/include/linux/pinctrl/consumer.h
+++ b/include/linux/pinctrl/consumer.h
@@ -40,6 +40,25 @@ extern int pinctrl_select_state(struct pinctrl *p, struct pinctrl_state *s);
40extern struct pinctrl * __must_check devm_pinctrl_get(struct device *dev); 40extern struct pinctrl * __must_check devm_pinctrl_get(struct device *dev);
41extern void devm_pinctrl_put(struct pinctrl *p); 41extern void devm_pinctrl_put(struct pinctrl *p);
42 42
43#ifdef CONFIG_PM
44extern int pinctrl_pm_select_default_state(struct device *dev);
45extern int pinctrl_pm_select_sleep_state(struct device *dev);
46extern int pinctrl_pm_select_idle_state(struct device *dev);
47#else
48static inline int pinctrl_pm_select_default_state(struct device *dev)
49{
50 return 0;
51}
52static inline int pinctrl_pm_select_sleep_state(struct device *dev)
53{
54 return 0;
55}
56static inline int pinctrl_pm_select_idle_state(struct device *dev)
57{
58 return 0;
59}
60#endif
61
43#else /* !CONFIG_PINCTRL */ 62#else /* !CONFIG_PINCTRL */
44 63
45static inline int pinctrl_request_gpio(unsigned gpio) 64static inline int pinctrl_request_gpio(unsigned gpio)
@@ -92,6 +111,21 @@ static inline void devm_pinctrl_put(struct pinctrl *p)
92{ 111{
93} 112}
94 113
114static inline int pinctrl_pm_select_default_state(struct device *dev)
115{
116 return 0;
117}
118
119static inline int pinctrl_pm_select_sleep_state(struct device *dev)
120{
121 return 0;
122}
123
124static inline int pinctrl_pm_select_idle_state(struct device *dev)
125{
126 return 0;
127}
128
95#endif /* CONFIG_PINCTRL */ 129#endif /* CONFIG_PINCTRL */
96 130
97static inline struct pinctrl * __must_check pinctrl_get_select( 131static inline struct pinctrl * __must_check pinctrl_get_select(
@@ -158,47 +192,4 @@ static inline struct pinctrl * __must_check devm_pinctrl_get_select_default(
158 return devm_pinctrl_get_select(dev, PINCTRL_STATE_DEFAULT); 192 return devm_pinctrl_get_select(dev, PINCTRL_STATE_DEFAULT);
159} 193}
160 194
161#ifdef CONFIG_PINCONF
162
163extern int pin_config_get(const char *dev_name, const char *name,
164 unsigned long *config);
165extern int pin_config_set(const char *dev_name, const char *name,
166 unsigned long config);
167extern int pin_config_group_get(const char *dev_name,
168 const char *pin_group,
169 unsigned long *config);
170extern int pin_config_group_set(const char *dev_name,
171 const char *pin_group,
172 unsigned long config);
173
174#else
175
176static inline int pin_config_get(const char *dev_name, const char *name,
177 unsigned long *config)
178{
179 return 0;
180}
181
182static inline int pin_config_set(const char *dev_name, const char *name,
183 unsigned long config)
184{
185 return 0;
186}
187
188static inline int pin_config_group_get(const char *dev_name,
189 const char *pin_group,
190 unsigned long *config)
191{
192 return 0;
193}
194
195static inline int pin_config_group_set(const char *dev_name,
196 const char *pin_group,
197 unsigned long config)
198{
199 return 0;
200}
201
202#endif
203
204#endif /* __LINUX_PINCTRL_CONSUMER_H */ 195#endif /* __LINUX_PINCTRL_CONSUMER_H */
diff --git a/include/linux/pinctrl/devinfo.h b/include/linux/pinctrl/devinfo.h
index 6e5f8a985ea7..281cb91ddcf5 100644
--- a/include/linux/pinctrl/devinfo.h
+++ b/include/linux/pinctrl/devinfo.h
@@ -28,6 +28,10 @@
28struct dev_pin_info { 28struct dev_pin_info {
29 struct pinctrl *p; 29 struct pinctrl *p;
30 struct pinctrl_state *default_state; 30 struct pinctrl_state *default_state;
31#ifdef CONFIG_PM
32 struct pinctrl_state *sleep_state;
33 struct pinctrl_state *idle_state;
34#endif
31}; 35};
32 36
33extern int pinctrl_bind_pins(struct device *dev); 37extern int pinctrl_bind_pins(struct device *dev);
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index 6aa238096622..bf7e989abcb5 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -29,12 +29,25 @@
29 * if for example some other pin is going to drive the signal connected 29 * if for example some other pin is going to drive the signal connected
30 * to it for a while. Pins used for input are usually always high 30 * to it for a while. Pins used for input are usually always high
31 * impedance. 31 * impedance.
32 * @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it
33 * weakly drives the last value on a tristate bus, also known as a "bus
34 * holder", "bus keeper" or "repeater". This allows another device on the
35 * bus to change the value by driving the bus high or low and switching to
36 * tristate. The argument is ignored.
32 * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high 37 * @PIN_CONFIG_BIAS_PULL_UP: the pin will be pulled up (usually with high
33 * impedance to VDD). If the argument is != 0 pull-up is enabled, 38 * impedance to VDD). If the argument is != 0 pull-up is enabled,
34 * if it is 0, pull-up is disabled. 39 * if it is 0, pull-up is total, i.e. the pin is connected to VDD.
35 * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high 40 * @PIN_CONFIG_BIAS_PULL_DOWN: the pin will be pulled down (usually with high
36 * impedance to GROUND). If the argument is != 0 pull-down is enabled, 41 * impedance to GROUND). If the argument is != 0 pull-down is enabled,
37 * if it is 0, pull-down is disabled. 42 * if it is 0, pull-down is total, i.e. the pin is connected to GROUND.
43 * @PIN_CONFIG_BIAS_PULL_PIN_DEFAULT: the pin will be pulled up or down based
44 * on embedded knowledge of the controller hardware, like current mux
45 * function. The pull direction and possibly strength too will normally
46 * be decided completely inside the hardware block and not be readable
47 * from the kernel side.
48 * If the argument is != 0 pull up/down is enabled, if it is 0, the
49 * configuration is ignored. The proper way to disable it is to use
50 * @PIN_CONFIG_BIAS_DISABLE.
38 * @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and 51 * @PIN_CONFIG_DRIVE_PUSH_PULL: the pin will be driven actively high and
39 * low, this is the most typical case and is typically achieved with two 52 * low, this is the most typical case and is typically achieved with two
40 * active transistors on the output. Setting this config will enable 53 * active transistors on the output. Setting this config will enable
@@ -57,14 +70,14 @@
57 * setting pins to this mode. 70 * setting pins to this mode.
58 * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode, 71 * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode,
59 * which means it will wait for signals to settle when reading inputs. The 72 * which means it will wait for signals to settle when reading inputs. The
60 * argument gives the debounce time on a custom format. Setting the 73 * argument gives the debounce time in usecs. Setting the
61 * argument to zero turns debouncing off. 74 * argument to zero turns debouncing off.
62 * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power 75 * @PIN_CONFIG_POWER_SOURCE: if the pin can select between different power
63 * supplies, the argument to this parameter (on a custom format) tells 76 * supplies, the argument to this parameter (on a custom format) tells
64 * the driver which alternative power source to use. 77 * the driver which alternative power source to use.
65 * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to 78 * @PIN_CONFIG_SLEW_RATE: if the pin can select slew rate, the argument to
66 * this parameter (on a custom format) tells the driver which alternative 79 * this parameter (on a custom format) tells the driver which alternative
67 * slew rate to use. 80 * slew rate to use.
68 * @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power 81 * @PIN_CONFIG_LOW_POWER_MODE: this will configure the pin for low power
69 * operation, if several modes of operation are supported these can be 82 * operation, if several modes of operation are supported these can be
70 * passed in the argument on a custom form, else just use argument 1 83 * passed in the argument on a custom form, else just use argument 1
@@ -78,8 +91,10 @@
78enum pin_config_param { 91enum pin_config_param {
79 PIN_CONFIG_BIAS_DISABLE, 92 PIN_CONFIG_BIAS_DISABLE,
80 PIN_CONFIG_BIAS_HIGH_IMPEDANCE, 93 PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
94 PIN_CONFIG_BIAS_BUS_HOLD,
81 PIN_CONFIG_BIAS_PULL_UP, 95 PIN_CONFIG_BIAS_PULL_UP,
82 PIN_CONFIG_BIAS_PULL_DOWN, 96 PIN_CONFIG_BIAS_PULL_DOWN,
97 PIN_CONFIG_BIAS_PULL_PIN_DEFAULT,
83 PIN_CONFIG_DRIVE_PUSH_PULL, 98 PIN_CONFIG_DRIVE_PUSH_PULL,
84 PIN_CONFIG_DRIVE_OPEN_DRAIN, 99 PIN_CONFIG_DRIVE_OPEN_DRAIN,
85 PIN_CONFIG_DRIVE_OPEN_SOURCE, 100 PIN_CONFIG_DRIVE_OPEN_SOURCE,
diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h
index 1ad4f31ef6b8..f6998692bdc9 100644
--- a/include/linux/pinctrl/pinconf.h
+++ b/include/linux/pinctrl/pinconf.h
@@ -30,7 +30,7 @@ struct seq_file;
30 * @pin_config_set: configure an individual pin 30 * @pin_config_set: configure an individual pin
31 * @pin_config_group_get: get configurations for an entire pin group 31 * @pin_config_group_get: get configurations for an entire pin group
32 * @pin_config_group_set: configure all pins in a group 32 * @pin_config_group_set: configure all pins in a group
33 * @pin_config_group_dbg_set: optional debugfs to modify a pin configuration 33 * @pin_config_dbg_parse_modify: optional debugfs to modify a pin configuration
34 * @pin_config_dbg_show: optional debugfs display hook that will provide 34 * @pin_config_dbg_show: optional debugfs display hook that will provide
35 * per-device info for a certain pin in debugfs 35 * per-device info for a certain pin in debugfs
36 * @pin_config_group_dbg_show: optional debugfs display hook that will provide 36 * @pin_config_group_dbg_show: optional debugfs display hook that will provide
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 2c2a9e8d8578..5979147d2bda 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -49,7 +49,8 @@ struct pinctrl_pin_desc {
49 * @name: a name for the chip in this range 49 * @name: a name for the chip in this range
50 * @id: an ID number for the chip in this range 50 * @id: an ID number for the chip in this range
51 * @base: base offset of the GPIO range 51 * @base: base offset of the GPIO range
52 * @pin_base: base pin number of the GPIO range 52 * @pin_base: base pin number of the GPIO range if pins == NULL
53 * @pins: enumeration of pins in GPIO range or NULL
53 * @npins: number of pins in the GPIO range, including the base number 54 * @npins: number of pins in the GPIO range, including the base number
54 * @gc: an optional pointer to a gpio_chip 55 * @gc: an optional pointer to a gpio_chip
55 */ 56 */
@@ -59,6 +60,7 @@ struct pinctrl_gpio_range {
59 unsigned int id; 60 unsigned int id;
60 unsigned int base; 61 unsigned int base;
61 unsigned int pin_base; 62 unsigned int pin_base;
63 unsigned const *pins;
62 unsigned int npins; 64 unsigned int npins;
63 struct gpio_chip *gc; 65 struct gpio_chip *gc;
64}; 66};
diff --git a/include/linux/platform_data/brcmfmac-sdio.h b/include/linux/platform_data/brcmfmac-sdio.h
index 1ade657d5fc1..b7174998c24a 100644
--- a/include/linux/platform_data/brcmfmac-sdio.h
+++ b/include/linux/platform_data/brcmfmac-sdio.h
@@ -90,6 +90,10 @@ void __init brcmfmac_init_pdata(void)
90 * oob_irq_nr, oob_irq_flags: the OOB interrupt information. The values are 90 * oob_irq_nr, oob_irq_flags: the OOB interrupt information. The values are
91 * used for registering the irq using request_irq function. 91 * used for registering the irq using request_irq function.
92 * 92 *
93 * broken_sg_support: flag for broken sg list support of SDIO host controller.
94 * Set this to true if the SDIO host controller has higher align requirement
95 * than 32 bytes for each scatterlist item.
96 *
93 * power_on: This function is called by the brcmfmac when the module gets 97 * power_on: This function is called by the brcmfmac when the module gets
94 * loaded. This can be particularly useful for low power devices. The platform 98 * loaded. This can be particularly useful for low power devices. The platform
95 * spcific routine may for example decide to power up the complete device. 99 * spcific routine may for example decide to power up the complete device.
@@ -116,6 +120,7 @@ struct brcmfmac_sdio_platform_data {
116 bool oob_irq_supported; 120 bool oob_irq_supported;
117 unsigned int oob_irq_nr; 121 unsigned int oob_irq_nr;
118 unsigned long oob_irq_flags; 122 unsigned long oob_irq_flags;
123 bool broken_sg_support;
119 void (*power_on)(void); 124 void (*power_on)(void);
120 void (*power_off)(void); 125 void (*power_off)(void);
121 void (*reset)(void); 126 void (*reset)(void);
diff --git a/include/linux/platform_data/clk-ux500.h b/include/linux/platform_data/clk-ux500.h
index 320d9c39ea0a..9d98f3aaa16c 100644
--- a/include/linux/platform_data/clk-ux500.h
+++ b/include/linux/platform_data/clk-ux500.h
@@ -12,7 +12,9 @@
12 12
13void u8500_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, 13void u8500_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base,
14 u32 clkrst5_base, u32 clkrst6_base); 14 u32 clkrst5_base, u32 clkrst6_base);
15void u9540_clk_init(void); 15void u9540_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base,
16void u8540_clk_init(void); 16 u32 clkrst5_base, u32 clkrst6_base);
17void u8540_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base,
18 u32 clkrst5_base, u32 clkrst6_base);
17 19
18#endif /* __CLK_UX500_H */ 20#endif /* __CLK_UX500_H */
diff --git a/include/linux/platform_data/cyttsp4.h b/include/linux/platform_data/cyttsp4.h
new file mode 100644
index 000000000000..6eba54aff1dc
--- /dev/null
+++ b/include/linux/platform_data/cyttsp4.h
@@ -0,0 +1,76 @@
1/*
2 * Header file for:
3 * Cypress TrueTouch(TM) Standard Product (TTSP) touchscreen drivers.
4 * For use with Cypress Txx3xx parts.
5 * Supported parts include:
6 * CY8CTST341
7 * CY8CTMA340
8 *
9 * Copyright (C) 2009, 2010, 2011 Cypress Semiconductor, Inc.
10 * Copyright (C) 2012 Javier Martinez Canillas <javier@dowhile0.org>
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * version 2, and only version 2, as published by the
15 * Free Software Foundation.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License along
23 * with this program; if not, write to the Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 *
26 * Contact Cypress Semiconductor at www.cypress.com (kev@cypress.com)
27 *
28 */
29#ifndef _CYTTSP4_H_
30#define _CYTTSP4_H_
31
32#define CYTTSP4_MT_NAME "cyttsp4_mt"
33#define CYTTSP4_I2C_NAME "cyttsp4_i2c_adapter"
34#define CYTTSP4_SPI_NAME "cyttsp4_spi_adapter"
35
36#define CY_TOUCH_SETTINGS_MAX 32
37
38struct touch_framework {
39 const uint16_t *abs;
40 uint8_t size;
41 uint8_t enable_vkeys;
42} __packed;
43
44struct cyttsp4_mt_platform_data {
45 struct touch_framework *frmwrk;
46 unsigned short flags;
47 char const *inp_dev_name;
48};
49
50struct touch_settings {
51 const uint8_t *data;
52 uint32_t size;
53 uint8_t tag;
54} __packed;
55
56struct cyttsp4_core_platform_data {
57 int irq_gpio;
58 int rst_gpio;
59 int level_irq_udelay;
60 int (*xres)(struct cyttsp4_core_platform_data *pdata,
61 struct device *dev);
62 int (*init)(struct cyttsp4_core_platform_data *pdata,
63 int on, struct device *dev);
64 int (*power)(struct cyttsp4_core_platform_data *pdata,
65 int on, struct device *dev, atomic_t *ignore_irq);
66 int (*irq_stat)(struct cyttsp4_core_platform_data *pdata,
67 struct device *dev);
68 struct touch_settings *sett[CY_TOUCH_SETTINGS_MAX];
69};
70
71struct cyttsp4_platform_data {
72 struct cyttsp4_core_platform_data *core_pdata;
73 struct cyttsp4_mt_platform_data *mt_pdata;
74};
75
76#endif /* _CYTTSP4_H_ */
diff --git a/include/linux/platform_data/dma-atmel.h b/include/linux/platform_data/dma-atmel.h
index cab0997be3de..e95f19c65873 100644
--- a/include/linux/platform_data/dma-atmel.h
+++ b/include/linux/platform_data/dma-atmel.h
@@ -35,16 +35,20 @@ struct at_dma_slave {
35 35
36 36
37/* Platform-configurable bits in CFG */ 37/* Platform-configurable bits in CFG */
38#define ATC_PER_MSB(h) ((0x30U & (h)) >> 4) /* Extract most significant bits of a handshaking identifier */
39
38#define ATC_SRC_PER(h) (0xFU & (h)) /* Channel src rq associated with periph handshaking ifc h */ 40#define ATC_SRC_PER(h) (0xFU & (h)) /* Channel src rq associated with periph handshaking ifc h */
39#define ATC_DST_PER(h) ((0xFU & (h)) << 4) /* Channel dst rq associated with periph handshaking ifc h */ 41#define ATC_DST_PER(h) ((0xFU & (h)) << 4) /* Channel dst rq associated with periph handshaking ifc h */
40#define ATC_SRC_REP (0x1 << 8) /* Source Replay Mod */ 42#define ATC_SRC_REP (0x1 << 8) /* Source Replay Mod */
41#define ATC_SRC_H2SEL (0x1 << 9) /* Source Handshaking Mod */ 43#define ATC_SRC_H2SEL (0x1 << 9) /* Source Handshaking Mod */
42#define ATC_SRC_H2SEL_SW (0x0 << 9) 44#define ATC_SRC_H2SEL_SW (0x0 << 9)
43#define ATC_SRC_H2SEL_HW (0x1 << 9) 45#define ATC_SRC_H2SEL_HW (0x1 << 9)
46#define ATC_SRC_PER_MSB(h) (ATC_PER_MSB(h) << 10) /* Channel src rq (most significant bits) */
44#define ATC_DST_REP (0x1 << 12) /* Destination Replay Mod */ 47#define ATC_DST_REP (0x1 << 12) /* Destination Replay Mod */
45#define ATC_DST_H2SEL (0x1 << 13) /* Destination Handshaking Mod */ 48#define ATC_DST_H2SEL (0x1 << 13) /* Destination Handshaking Mod */
46#define ATC_DST_H2SEL_SW (0x0 << 13) 49#define ATC_DST_H2SEL_SW (0x0 << 13)
47#define ATC_DST_H2SEL_HW (0x1 << 13) 50#define ATC_DST_H2SEL_HW (0x1 << 13)
51#define ATC_DST_PER_MSB(h) (ATC_PER_MSB(h) << 14) /* Channel dst rq (most significant bits) */
48#define ATC_SOD (0x1 << 16) /* Stop On Done */ 52#define ATC_SOD (0x1 << 16) /* Stop On Done */
49#define ATC_LOCK_IF (0x1 << 20) /* Interface Lock */ 53#define ATC_LOCK_IF (0x1 << 20) /* Interface Lock */
50#define ATC_LOCK_B (0x1 << 21) /* AHB Bus Lock */ 54#define ATC_LOCK_B (0x1 << 21) /* AHB Bus Lock */
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h
index f6d30cc1cb77..beac6b8b6a7b 100644
--- a/include/linux/platform_data/dma-imx.h
+++ b/include/linux/platform_data/dma-imx.h
@@ -60,10 +60,8 @@ static inline int imx_dma_is_ipu(struct dma_chan *chan)
60 60
61static inline int imx_dma_is_general_purpose(struct dma_chan *chan) 61static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
62{ 62{
63 return strstr(dev_name(chan->device->dev), "sdma") || 63 return !strcmp(chan->device->dev->driver->name, "imx-sdma") ||
64 !strcmp(dev_name(chan->device->dev), "imx1-dma") || 64 !strcmp(chan->device->dev->driver->name, "imx-dma");
65 !strcmp(dev_name(chan->device->dev), "imx21-dma") ||
66 !strcmp(dev_name(chan->device->dev), "imx27-dma");
67} 65}
68 66
69#endif 67#endif
diff --git a/include/linux/platform_data/g762.h b/include/linux/platform_data/g762.h
new file mode 100644
index 000000000000..d3c51283764d
--- /dev/null
+++ b/include/linux/platform_data/g762.h
@@ -0,0 +1,37 @@
1/*
2 * Platform data structure for g762 fan controller driver
3 *
4 * Copyright (C) 2013, Arnaud EBALARD <arno@natisbad.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20#ifndef __LINUX_PLATFORM_DATA_G762_H__
21#define __LINUX_PLATFORM_DATA_G762_H__
22
23/*
24 * Following structure can be used to set g762 driver platform specific data
25 * during board init. Note that passing a sparse structure is possible but
26 * will result in non-specified attributes to be set to default value, hence
27 * overloading those installed during boot (e.g. by u-boot).
28 */
29
30struct g762_platform_data {
31 u32 fan_startv;
32 u32 fan_gear_mode;
33 u32 pwm_polarity;
34 u32 clk_freq;
35};
36
37#endif /* __LINUX_PLATFORM_DATA_G762_H__ */
diff --git a/include/linux/platform_data/keypad-pxa27x.h b/include/linux/platform_data/keypad-pxa27x.h
index 5ce8d5e6ea51..24625569d16d 100644
--- a/include/linux/platform_data/keypad-pxa27x.h
+++ b/include/linux/platform_data/keypad-pxa27x.h
@@ -36,10 +36,9 @@
36struct pxa27x_keypad_platform_data { 36struct pxa27x_keypad_platform_data {
37 37
38 /* code map for the matrix keys */ 38 /* code map for the matrix keys */
39 const struct matrix_keymap_data *matrix_keymap_data;
39 unsigned int matrix_key_rows; 40 unsigned int matrix_key_rows;
40 unsigned int matrix_key_cols; 41 unsigned int matrix_key_cols;
41 unsigned int *matrix_key_map;
42 int matrix_key_map_size;
43 42
44 /* direct keys */ 43 /* direct keys */
45 int direct_key_num; 44 int direct_key_num;
diff --git a/include/linux/platform_data/mmc-esdhc-imx.h b/include/linux/platform_data/mmc-esdhc-imx.h
index b4a0521ce411..d44912d81578 100644
--- a/include/linux/platform_data/mmc-esdhc-imx.h
+++ b/include/linux/platform_data/mmc-esdhc-imx.h
@@ -40,5 +40,6 @@ struct esdhc_platform_data {
40 enum wp_types wp_type; 40 enum wp_types wp_type;
41 enum cd_types cd_type; 41 enum cd_types cd_type;
42 int max_bus_width; 42 int max_bus_width;
43 unsigned int f_max;
43}; 44};
44#endif /* __ASM_ARCH_IMX_ESDHC_H */ 45#endif /* __ASM_ARCH_IMX_ESDHC_H */
diff --git a/include/linux/platform_data/net-cw1200.h b/include/linux/platform_data/net-cw1200.h
new file mode 100644
index 000000000000..c6fbc3ce4ab0
--- /dev/null
+++ b/include/linux/platform_data/net-cw1200.h
@@ -0,0 +1,81 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 *
4 * Author: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8#ifndef CW1200_PLAT_H_INCLUDED
9#define CW1200_PLAT_H_INCLUDED
10
11struct cw1200_platform_data_spi {
12 u8 spi_bits_per_word; /* REQUIRED */
13 u16 ref_clk; /* REQUIRED (in KHz) */
14
15 /* All others are optional */
16 bool have_5ghz;
17 int reset; /* GPIO to RSTn signal (0 disables) */
18 int powerup; /* GPIO to POWERUP signal (0 disables) */
19 int (*power_ctrl)(const struct cw1200_platform_data_spi *pdata,
20 bool enable); /* Control 3v3 / 1v8 supply */
21 int (*clk_ctrl)(const struct cw1200_platform_data_spi *pdata,
22 bool enable); /* Control CLK32K */
23 const u8 *macaddr; /* if NULL, use cw1200_mac_template module parameter */
24 const char *sdd_file; /* if NULL, will use default for detected hw type */
25};
26
27struct cw1200_platform_data_sdio {
28 u16 ref_clk; /* REQUIRED (in KHz) */
29
30 /* All others are optional */
31 bool have_5ghz;
32 bool no_nptb; /* SDIO hardware does not support non-power-of-2-blocksizes */
33 int reset; /* GPIO to RSTn signal (0 disables) */
34 int powerup; /* GPIO to POWERUP signal (0 disables) */
35 int irq; /* IRQ line or 0 to use SDIO IRQ */
36 int (*power_ctrl)(const struct cw1200_platform_data_sdio *pdata,
37 bool enable); /* Control 3v3 / 1v8 supply */
38 int (*clk_ctrl)(const struct cw1200_platform_data_sdio *pdata,
39 bool enable); /* Control CLK32K */
40 const u8 *macaddr; /* if NULL, use cw1200_mac_template module parameter */
41 const char *sdd_file; /* if NULL, will use default for detected hw type */
42};
43
44
45/* An example of SPI support in your board setup file:
46
47 static struct cw1200_platform_data_spi cw1200_platform_data = {
48 .ref_clk = 38400,
49 .spi_bits_per_word = 16,
50 .reset = GPIO_RF_RESET,
51 .powerup = GPIO_RF_POWERUP,
52 .macaddr = wifi_mac_addr,
53 .sdd_file = "sdd_sagrad_1091_1098.bin",
54 };
55 static struct spi_board_info myboard_spi_devices[] __initdata = {
56 {
57 .modalias = "cw1200_wlan_spi",
58 .max_speed_hz = 52000000,
59 .bus_num = 0,
60 .irq = WIFI_IRQ,
61 .platform_data = &cw1200_platform_data,
62 .chip_select = 0,
63 },
64 };
65
66 */
67
68/* An example of SDIO support in your board setup file:
69
70 static struct cw1200_platform_data_sdio my_cw1200_platform_data = {
71 .ref_clk = 38400,
72 .have_5ghz = false,
73 .sdd_file = "sdd_myplatform.bin",
74 };
75 cw1200_sdio_set_platform_data(&my_cw1200_platform_data);
76
77 */
78
79void __init cw1200_sdio_set_platform_data(struct cw1200_platform_data_sdio *pdata);
80
81#endif /* CW1200_PLAT_H_INCLUDED */
diff --git a/include/linux/platform_data/pwm-renesas-tpu.h b/include/linux/platform_data/pwm-renesas-tpu.h
new file mode 100644
index 000000000000..a7220b10ddab
--- /dev/null
+++ b/include/linux/platform_data/pwm-renesas-tpu.h
@@ -0,0 +1,16 @@
1#ifndef __PWM_RENESAS_TPU_H__
2#define __PWM_RENESAS_TPU_H__
3
4#include <linux/pwm.h>
5
6#define TPU_CHANNEL_MAX 4
7
8struct tpu_pwm_channel_data {
9 enum pwm_polarity polarity;
10};
11
12struct tpu_pwm_platform_data {
13 struct tpu_pwm_channel_data channels[TPU_CHANNEL_MAX];
14};
15
16#endif /* __PWM_RENESAS_TPU_H__ */
diff --git a/include/linux/platform_data/rcar-du.h b/include/linux/platform_data/rcar-du.h
new file mode 100644
index 000000000000..80587fdbba3e
--- /dev/null
+++ b/include/linux/platform_data/rcar-du.h
@@ -0,0 +1,54 @@
1/*
2 * rcar_du.h -- R-Car Display Unit DRM driver
3 *
4 * Copyright (C) 2013 Renesas Corporation
5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13
14#ifndef __RCAR_DU_H__
15#define __RCAR_DU_H__
16
17#include <drm/drm_mode.h>
18
19enum rcar_du_encoder_type {
20 RCAR_DU_ENCODER_UNUSED = 0,
21 RCAR_DU_ENCODER_VGA,
22 RCAR_DU_ENCODER_LVDS,
23};
24
25struct rcar_du_panel_data {
26 unsigned int width_mm; /* Panel width in mm */
27 unsigned int height_mm; /* Panel height in mm */
28 struct drm_mode_modeinfo mode;
29};
30
31struct rcar_du_encoder_lvds_data {
32 struct rcar_du_panel_data panel;
33};
34
35struct rcar_du_encoder_vga_data {
36 /* TODO: Add DDC information for EDID retrieval */
37};
38
39struct rcar_du_encoder_data {
40 enum rcar_du_encoder_type encoder;
41 unsigned int output;
42
43 union {
44 struct rcar_du_encoder_lvds_data lvds;
45 struct rcar_du_encoder_vga_data vga;
46 } u;
47};
48
49struct rcar_du_platform_data {
50 struct rcar_du_encoder_data *encoders;
51 unsigned int num_encoders;
52};
53
54#endif /* __RCAR_DU_H__ */
diff --git a/include/linux/platform_data/remoteproc-omap.h b/include/linux/platform_data/remoteproc-omap.h
index 3c1c6444ec4b..bfbd12b41162 100644
--- a/include/linux/platform_data/remoteproc-omap.h
+++ b/include/linux/platform_data/remoteproc-omap.h
@@ -50,7 +50,7 @@ void __init omap_rproc_reserve_cma(void);
50 50
51#else 51#else
52 52
53void __init omap_rproc_reserve_cma(void) 53static inline void __init omap_rproc_reserve_cma(void)
54{ 54{
55} 55}
56 56
diff --git a/include/linux/platform_data/si5351.h b/include/linux/platform_data/si5351.h
index 92dabcaf6499..54334393ab92 100644
--- a/include/linux/platform_data/si5351.h
+++ b/include/linux/platform_data/si5351.h
@@ -79,6 +79,23 @@ enum si5351_drive_strength {
79}; 79};
80 80
81/** 81/**
82 * enum si5351_disable_state - Si5351 clock output disable state
83 * @SI5351_DISABLE_DEFAULT: default, do not change eeprom config
84 * @SI5351_DISABLE_LOW: CLKx is set to a LOW state when disabled
85 * @SI5351_DISABLE_HIGH: CLKx is set to a HIGH state when disabled
86 * @SI5351_DISABLE_FLOATING: CLKx is set to a FLOATING state when
87 * disabled
88 * @SI5351_DISABLE_NEVER: CLKx is NEVER disabled
89 */
90enum si5351_disable_state {
91 SI5351_DISABLE_DEFAULT = 0,
92 SI5351_DISABLE_LOW,
93 SI5351_DISABLE_HIGH,
94 SI5351_DISABLE_FLOATING,
95 SI5351_DISABLE_NEVER,
96};
97
98/**
82 * struct si5351_clkout_config - Si5351 clock output configuration 99 * struct si5351_clkout_config - Si5351 clock output configuration
83 * @clkout: clkout number 100 * @clkout: clkout number
84 * @multisynth_src: multisynth source clock 101 * @multisynth_src: multisynth source clock
@@ -91,6 +108,7 @@ struct si5351_clkout_config {
91 enum si5351_multisynth_src multisynth_src; 108 enum si5351_multisynth_src multisynth_src;
92 enum si5351_clkout_src clkout_src; 109 enum si5351_clkout_src clkout_src;
93 enum si5351_drive_strength drive; 110 enum si5351_drive_strength drive;
111 enum si5351_disable_state disable_state;
94 bool pll_master; 112 bool pll_master;
95 unsigned long rate; 113 unsigned long rate;
96}; 114};
diff --git a/include/linux/platform_data/ssm2518.h b/include/linux/platform_data/ssm2518.h
new file mode 100644
index 000000000000..9a8e3ea287e3
--- /dev/null
+++ b/include/linux/platform_data/ssm2518.h
@@ -0,0 +1,22 @@
1/*
2 * SSM2518 amplifier audio driver
3 *
4 * Copyright 2013 Analog Devices Inc.
5 * Author: Lars-Peter Clausen <lars@metafoo.de>
6 *
7 * Licensed under the GPL-2.
8 */
9
10#ifndef __LINUX_PLATFORM_DATA_SSM2518_H__
11#define __LINUX_PLATFORM_DATA_SSM2518_H__
12
13/**
14 * struct ssm2518_platform_data - Platform data for the ssm2518 driver
15 * @enable_gpio: GPIO connected to the nSD pin. Set to -1 if the nSD pin is
16 * hardwired.
17 */
18struct ssm2518_platform_data {
19 int enable_gpio;
20};
21
22#endif
diff --git a/include/linux/platform_data/ti_am335x_adc.h b/include/linux/platform_data/ti_am335x_adc.h
deleted file mode 100644
index e41d5834cb84..000000000000
--- a/include/linux/platform_data/ti_am335x_adc.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef __LINUX_TI_AM335X_ADC_H
2#define __LINUX_TI_AM335X_ADC_H
3
4/**
5 * struct adc_data ADC Input information
6 * @adc_channels: Number of analog inputs
7 * available for ADC.
8 */
9
10struct adc_data {
11 unsigned int adc_channels;
12};
13
14#endif
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index cd46ee58b9dc..ce8e4ffd78c7 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -180,6 +180,9 @@ struct platform_driver {
180 const struct platform_device_id *id_table; 180 const struct platform_device_id *id_table;
181}; 181};
182 182
183#define to_platform_driver(drv) (container_of((drv), struct platform_driver, \
184 driver))
185
183/* 186/*
184 * use a macro to avoid include chaining to get THIS_MODULE 187 * use a macro to avoid include chaining to get THIS_MODULE
185 */ 188 */
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 7d7e09efff9b..6fa7cea25da9 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -37,7 +37,6 @@ extern void pm_runtime_enable(struct device *dev);
37extern void __pm_runtime_disable(struct device *dev, bool check_resume); 37extern void __pm_runtime_disable(struct device *dev, bool check_resume);
38extern void pm_runtime_allow(struct device *dev); 38extern void pm_runtime_allow(struct device *dev);
39extern void pm_runtime_forbid(struct device *dev); 39extern void pm_runtime_forbid(struct device *dev);
40extern int pm_generic_runtime_idle(struct device *dev);
41extern int pm_generic_runtime_suspend(struct device *dev); 40extern int pm_generic_runtime_suspend(struct device *dev);
42extern int pm_generic_runtime_resume(struct device *dev); 41extern int pm_generic_runtime_resume(struct device *dev);
43extern void pm_runtime_no_callbacks(struct device *dev); 42extern void pm_runtime_no_callbacks(struct device *dev);
@@ -143,7 +142,6 @@ static inline bool pm_runtime_active(struct device *dev) { return true; }
143static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } 142static inline bool pm_runtime_status_suspended(struct device *dev) { return false; }
144static inline bool pm_runtime_enabled(struct device *dev) { return false; } 143static inline bool pm_runtime_enabled(struct device *dev) { return false; }
145 144
146static inline int pm_generic_runtime_idle(struct device *dev) { return 0; }
147static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } 145static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
148static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } 146static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
149static inline void pm_runtime_no_callbacks(struct device *dev) {} 147static inline void pm_runtime_no_callbacks(struct device *dev) {}
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index 7794d75ed155..907f3fd191ac 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -7,14 +7,20 @@
7#include <linux/timex.h> 7#include <linux/timex.h>
8#include <linux/alarmtimer.h> 8#include <linux/alarmtimer.h>
9 9
10union cpu_time_count { 10
11 cputime_t cpu; 11static inline unsigned long long cputime_to_expires(cputime_t expires)
12 unsigned long long sched; 12{
13}; 13 return (__force unsigned long long)expires;
14}
15
16static inline cputime_t expires_to_cputime(unsigned long long expires)
17{
18 return (__force cputime_t)expires;
19}
14 20
15struct cpu_timer_list { 21struct cpu_timer_list {
16 struct list_head entry; 22 struct list_head entry;
17 union cpu_time_count expires, incr; 23 unsigned long long expires, incr;
18 struct task_struct *task; 24 struct task_struct *task;
19 int firing; 25 int firing;
20}; 26};
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h
index c0f44c2b006d..d8b187c3925d 100644
--- a/include/linux/power/smartreflex.h
+++ b/include/linux/power/smartreflex.h
@@ -299,11 +299,11 @@ void omap_sr_disable_reset_volt(struct voltagedomain *voltdm);
299void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data); 299void omap_sr_register_pmic(struct omap_sr_pmic_data *pmic_data);
300 300
301/* Smartreflex driver hooks to be called from Smartreflex class driver */ 301/* Smartreflex driver hooks to be called from Smartreflex class driver */
302int sr_enable(struct voltagedomain *voltdm, unsigned long volt); 302int sr_enable(struct omap_sr *sr, unsigned long volt);
303void sr_disable(struct voltagedomain *voltdm); 303void sr_disable(struct omap_sr *sr);
304int sr_configure_errgen(struct voltagedomain *voltdm); 304int sr_configure_errgen(struct omap_sr *sr);
305int sr_disable_errgen(struct voltagedomain *voltdm); 305int sr_disable_errgen(struct omap_sr *sr);
306int sr_configure_minmax(struct voltagedomain *voltdm); 306int sr_configure_minmax(struct omap_sr *sr);
307 307
308/* API to register the smartreflex class driver with the smartreflex driver */ 308/* API to register the smartreflex class driver with the smartreflex driver */
309int sr_register_class(struct omap_sr_class_data *class_data); 309int sr_register_class(struct omap_sr_class_data *class_data);
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index 3828cefb4f65..804b90643a85 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -162,6 +162,8 @@ union power_supply_propval {
162 const char *strval; 162 const char *strval;
163}; 163};
164 164
165struct device_node;
166
165struct power_supply { 167struct power_supply {
166 const char *name; 168 const char *name;
167 enum power_supply_type type; 169 enum power_supply_type type;
@@ -173,9 +175,7 @@ struct power_supply {
173 175
174 char **supplied_from; 176 char **supplied_from;
175 size_t num_supplies; 177 size_t num_supplies;
176#ifdef CONFIG_OF
177 struct device_node *of_node; 178 struct device_node *of_node;
178#endif
179 179
180 int (*get_property)(struct power_supply *psy, 180 int (*get_property)(struct power_supply *psy,
181 enum power_supply_property psp, 181 enum power_supply_property psp,
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index 75d01760c911..4aa80ba830a2 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -35,6 +35,10 @@ enum pstore_type_id {
35 PSTORE_TYPE_MCE = 1, 35 PSTORE_TYPE_MCE = 1,
36 PSTORE_TYPE_CONSOLE = 2, 36 PSTORE_TYPE_CONSOLE = 2,
37 PSTORE_TYPE_FTRACE = 3, 37 PSTORE_TYPE_FTRACE = 3,
38 /* PPC64 partition types */
39 PSTORE_TYPE_PPC_RTAS = 4,
40 PSTORE_TYPE_PPC_OF = 5,
41 PSTORE_TYPE_PPC_COMMON = 6,
38 PSTORE_TYPE_UNKNOWN = 255 42 PSTORE_TYPE_UNKNOWN = 255
39}; 43};
40 44
@@ -54,12 +58,12 @@ struct pstore_info {
54 struct pstore_info *psi); 58 struct pstore_info *psi);
55 int (*write)(enum pstore_type_id type, 59 int (*write)(enum pstore_type_id type,
56 enum kmsg_dump_reason reason, u64 *id, 60 enum kmsg_dump_reason reason, u64 *id,
57 unsigned int part, int count, size_t size, 61 unsigned int part, int count, size_t hsize,
58 struct pstore_info *psi); 62 size_t size, struct pstore_info *psi);
59 int (*write_buf)(enum pstore_type_id type, 63 int (*write_buf)(enum pstore_type_id type,
60 enum kmsg_dump_reason reason, u64 *id, 64 enum kmsg_dump_reason reason, u64 *id,
61 unsigned int part, const char *buf, size_t size, 65 unsigned int part, const char *buf, size_t hsize,
62 struct pstore_info *psi); 66 size_t size, struct pstore_info *psi);
63 int (*erase)(enum pstore_type_id type, u64 id, 67 int (*erase)(enum pstore_type_id type, u64 id,
64 int count, struct timespec time, 68 int count, struct timespec time,
65 struct pstore_info *psi); 69 struct pstore_info *psi);
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 89573a33ab3c..07d0df6bf768 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -142,9 +142,6 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace)
142{ 142{
143 INIT_LIST_HEAD(&child->ptrace_entry); 143 INIT_LIST_HEAD(&child->ptrace_entry);
144 INIT_LIST_HEAD(&child->ptraced); 144 INIT_LIST_HEAD(&child->ptraced);
145#ifdef CONFIG_HAVE_HW_BREAKPOINT
146 atomic_set(&child->ptrace_bp_refcnt, 1);
147#endif
148 child->jobctl = 0; 145 child->jobctl = 0;
149 child->ptrace = 0; 146 child->ptrace = 0;
150 child->parent = child->real_parent; 147 child->parent = child->real_parent;
@@ -351,11 +348,4 @@ extern int task_current_syscall(struct task_struct *target, long *callno,
351 unsigned long args[6], unsigned int maxargs, 348 unsigned long args[6], unsigned int maxargs,
352 unsigned long *sp, unsigned long *pc); 349 unsigned long *sp, unsigned long *pc);
353 350
354#ifdef CONFIG_HAVE_HW_BREAKPOINT
355extern int ptrace_get_breakpoints(struct task_struct *tsk);
356extern void ptrace_put_breakpoints(struct task_struct *tsk);
357#else
358static inline void ptrace_put_breakpoints(struct task_struct *tsk) { }
359#endif /* CONFIG_HAVE_HW_BREAKPOINT */
360
361#endif 351#endif
diff --git a/include/linux/pvclock_gtod.h b/include/linux/pvclock_gtod.h
index 0ca75825b60d..a71d2dbd3610 100644
--- a/include/linux/pvclock_gtod.h
+++ b/include/linux/pvclock_gtod.h
@@ -3,6 +3,13 @@
3 3
4#include <linux/notifier.h> 4#include <linux/notifier.h>
5 5
6/*
7 * The pvclock gtod notifier is called when the system time is updated
8 * and is used to keep guest time synchronized with host time.
9 *
10 * The 'action' parameter in the notifier function is false (0), or
11 * true (non-zero) if system time was stepped.
12 */
6extern int pvclock_gtod_register_notifier(struct notifier_block *nb); 13extern int pvclock_gtod_register_notifier(struct notifier_block *nb);
7extern int pvclock_gtod_unregister_notifier(struct notifier_block *nb); 14extern int pvclock_gtod_unregister_notifier(struct notifier_block *nb);
8 15
diff --git a/include/linux/pwm.h b/include/linux/pwm.h
index a4df2042b79c..f0feafd184a0 100644
--- a/include/linux/pwm.h
+++ b/include/linux/pwm.h
@@ -76,6 +76,7 @@ enum pwm_polarity {
76enum { 76enum {
77 PWMF_REQUESTED = 1 << 0, 77 PWMF_REQUESTED = 1 << 0,
78 PWMF_ENABLED = 1 << 1, 78 PWMF_ENABLED = 1 << 1,
79 PWMF_EXPORTED = 1 << 2,
79}; 80};
80 81
81struct pwm_device { 82struct pwm_device {
@@ -86,7 +87,9 @@ struct pwm_device {
86 struct pwm_chip *chip; 87 struct pwm_chip *chip;
87 void *chip_data; 88 void *chip_data;
88 89
89 unsigned int period; /* in nanoseconds */ 90 unsigned int period; /* in nanoseconds */
91 unsigned int duty_cycle; /* in nanoseconds */
92 enum pwm_polarity polarity;
90}; 93};
91 94
92static inline void pwm_set_period(struct pwm_device *pwm, unsigned int period) 95static inline void pwm_set_period(struct pwm_device *pwm, unsigned int period)
@@ -100,6 +103,17 @@ static inline unsigned int pwm_get_period(struct pwm_device *pwm)
100 return pwm ? pwm->period : 0; 103 return pwm ? pwm->period : 0;
101} 104}
102 105
106static inline void pwm_set_duty_cycle(struct pwm_device *pwm, unsigned int duty)
107{
108 if (pwm)
109 pwm->duty_cycle = duty;
110}
111
112static inline unsigned int pwm_get_duty_cycle(struct pwm_device *pwm)
113{
114 return pwm ? pwm->duty_cycle : 0;
115}
116
103/* 117/*
104 * pwm_set_polarity - configure the polarity of a PWM signal 118 * pwm_set_polarity - configure the polarity of a PWM signal
105 */ 119 */
@@ -278,4 +292,17 @@ static inline void pwm_add_table(struct pwm_lookup *table, size_t num)
278} 292}
279#endif 293#endif
280 294
295#ifdef CONFIG_PWM_SYSFS
296void pwmchip_sysfs_export(struct pwm_chip *chip);
297void pwmchip_sysfs_unexport(struct pwm_chip *chip);
298#else
299static inline void pwmchip_sysfs_export(struct pwm_chip *chip)
300{
301}
302
303static inline void pwmchip_sysfs_unexport(struct pwm_chip *chip)
304{
305}
306#endif /* CONFIG_PWM_SYSFS */
307
281#endif /* __LINUX_PWM_H */ 308#endif /* __LINUX_PWM_H */
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 23b36304cd88..8e00f9f6f963 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -10,6 +10,31 @@
10#define SYS_HALT 0x0002 /* Notify of system halt */ 10#define SYS_HALT 0x0002 /* Notify of system halt */
11#define SYS_POWER_OFF 0x0003 /* Notify of system power off */ 11#define SYS_POWER_OFF 0x0003 /* Notify of system power off */
12 12
13enum reboot_mode {
14 REBOOT_COLD = 0,
15 REBOOT_WARM,
16 REBOOT_HARD,
17 REBOOT_SOFT,
18 REBOOT_GPIO,
19};
20extern enum reboot_mode reboot_mode;
21
22enum reboot_type {
23 BOOT_TRIPLE = 't',
24 BOOT_KBD = 'k',
25 BOOT_BIOS = 'b',
26 BOOT_ACPI = 'a',
27 BOOT_EFI = 'e',
28 BOOT_CF9 = 'p',
29 BOOT_CF9_COND = 'q',
30};
31extern enum reboot_type reboot_type;
32
33extern int reboot_default;
34extern int reboot_cpu;
35extern int reboot_force;
36
37
13extern int register_reboot_notifier(struct notifier_block *); 38extern int register_reboot_notifier(struct notifier_block *);
14extern int unregister_reboot_notifier(struct notifier_block *); 39extern int unregister_reboot_notifier(struct notifier_block *);
15 40
@@ -26,7 +51,7 @@ extern void machine_shutdown(void);
26struct pt_regs; 51struct pt_regs;
27extern void machine_crash_shutdown(struct pt_regs *); 52extern void machine_crash_shutdown(struct pt_regs *);
28 53
29/* 54/*
30 * Architecture independent implemenations of sys_reboot commands. 55 * Architecture independent implemenations of sys_reboot commands.
31 */ 56 */
32 57
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 02d84e24b7c2..75981d0b57dc 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -23,6 +23,7 @@ struct irq_domain;
23struct spi_device; 23struct spi_device;
24struct regmap; 24struct regmap;
25struct regmap_range_cfg; 25struct regmap_range_cfg;
26struct regmap_field;
26 27
27/* An enum of all the supported cache types */ 28/* An enum of all the supported cache types */
28enum regcache_type { 29enum regcache_type {
@@ -394,10 +395,15 @@ bool regmap_can_raw_write(struct regmap *map);
394int regcache_sync(struct regmap *map); 395int regcache_sync(struct regmap *map);
395int regcache_sync_region(struct regmap *map, unsigned int min, 396int regcache_sync_region(struct regmap *map, unsigned int min,
396 unsigned int max); 397 unsigned int max);
398int regcache_drop_region(struct regmap *map, unsigned int min,
399 unsigned int max);
397void regcache_cache_only(struct regmap *map, bool enable); 400void regcache_cache_only(struct regmap *map, bool enable);
398void regcache_cache_bypass(struct regmap *map, bool enable); 401void regcache_cache_bypass(struct regmap *map, bool enable);
399void regcache_mark_dirty(struct regmap *map); 402void regcache_mark_dirty(struct regmap *map);
400 403
404bool regmap_check_range_table(struct regmap *map, unsigned int reg,
405 const struct regmap_access_table *table);
406
401int regmap_register_patch(struct regmap *map, const struct reg_default *regs, 407int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
402 int num_regs); 408 int num_regs);
403 409
@@ -412,6 +418,36 @@ bool regmap_reg_in_ranges(unsigned int reg,
412 unsigned int nranges); 418 unsigned int nranges);
413 419
414/** 420/**
421 * Description of an register field
422 *
423 * @reg: Offset of the register within the regmap bank
424 * @lsb: lsb of the register field.
425 * @reg: msb of the register field.
426 */
427struct reg_field {
428 unsigned int reg;
429 unsigned int lsb;
430 unsigned int msb;
431};
432
433#define REG_FIELD(_reg, _lsb, _msb) { \
434 .reg = _reg, \
435 .lsb = _lsb, \
436 .msb = _msb, \
437 }
438
439struct regmap_field *regmap_field_alloc(struct regmap *regmap,
440 struct reg_field reg_field);
441void regmap_field_free(struct regmap_field *field);
442
443struct regmap_field *devm_regmap_field_alloc(struct device *dev,
444 struct regmap *regmap, struct reg_field reg_field);
445void devm_regmap_field_free(struct device *dev, struct regmap_field *field);
446
447int regmap_field_read(struct regmap_field *field, unsigned int *val);
448int regmap_field_write(struct regmap_field *field, unsigned int val);
449
450/**
415 * Description of an IRQ for the generic regmap irq_chip. 451 * Description of an IRQ for the generic regmap irq_chip.
416 * 452 *
417 * @reg_offset: Offset of the status/mask register within the bank 453 * @reg_offset: Offset of the status/mask register within the bank
@@ -562,6 +598,13 @@ static inline int regcache_sync_region(struct regmap *map, unsigned int min,
562 return -EINVAL; 598 return -EINVAL;
563} 599}
564 600
601static inline int regcache_drop_region(struct regmap *map, unsigned int min,
602 unsigned int max)
603{
604 WARN_ONCE(1, "regmap API is disabled");
605 return -EINVAL;
606}
607
565static inline void regcache_cache_only(struct regmap *map, bool enable) 608static inline void regcache_cache_only(struct regmap *map, bool enable)
566{ 609{
567 WARN_ONCE(1, "regmap API is disabled"); 610 WARN_ONCE(1, "regmap API is disabled");
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h
index 7c5ff0c55773..75307447cef9 100644
--- a/include/linux/regulator/ab8500.h
+++ b/include/linux/regulator/ab8500.h
@@ -336,8 +336,4 @@ static inline int ab8500_regulator_debug_exit(struct platform_device *pdev)
336} 336}
337#endif 337#endif
338 338
339/* AB8500 external regulator functions. */
340int ab8500_ext_regulator_init(struct platform_device *pdev);
341void ab8500_ext_regulator_exit(struct platform_device *pdev);
342
343#endif 339#endif
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 145022a83085..3a76389c6aaa 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -165,6 +165,7 @@ int regulator_count_voltages(struct regulator *regulator);
165int regulator_list_voltage(struct regulator *regulator, unsigned selector); 165int regulator_list_voltage(struct regulator *regulator, unsigned selector);
166int regulator_is_supported_voltage(struct regulator *regulator, 166int regulator_is_supported_voltage(struct regulator *regulator,
167 int min_uV, int max_uV); 167 int min_uV, int max_uV);
168unsigned int regulator_get_linear_step(struct regulator *regulator);
168int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV); 169int regulator_set_voltage(struct regulator *regulator, int min_uV, int max_uV);
169int regulator_set_voltage_time(struct regulator *regulator, 170int regulator_set_voltage_time(struct regulator *regulator,
170 int old_uV, int new_uV); 171 int old_uV, int new_uV);
diff --git a/include/linux/reservation.h b/include/linux/reservation.h
new file mode 100644
index 000000000000..e9ee806a9d72
--- /dev/null
+++ b/include/linux/reservation.h
@@ -0,0 +1,62 @@
1/*
2 * Header file for reservations for dma-buf and ttm
3 *
4 * Copyright(C) 2011 Linaro Limited. All rights reserved.
5 * Copyright (C) 2012-2013 Canonical Ltd
6 * Copyright (C) 2012 Texas Instruments
7 *
8 * Authors:
9 * Rob Clark <rob.clark@linaro.org>
10 * Maarten Lankhorst <maarten.lankhorst@canonical.com>
11 * Thomas Hellstrom <thellstrom-at-vmware-dot-com>
12 *
13 * Based on bo.c which bears the following copyright notice,
14 * but is dual licensed:
15 *
16 * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA
17 * All Rights Reserved.
18 *
19 * Permission is hereby granted, free of charge, to any person obtaining a
20 * copy of this software and associated documentation files (the
21 * "Software"), to deal in the Software without restriction, including
22 * without limitation the rights to use, copy, modify, merge, publish,
23 * distribute, sub license, and/or sell copies of the Software, and to
24 * permit persons to whom the Software is furnished to do so, subject to
25 * the following conditions:
26 *
27 * The above copyright notice and this permission notice (including the
28 * next paragraph) shall be included in all copies or substantial portions
29 * of the Software.
30 *
31 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
34 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
35 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
36 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
37 * USE OR OTHER DEALINGS IN THE SOFTWARE.
38 */
39#ifndef _LINUX_RESERVATION_H
40#define _LINUX_RESERVATION_H
41
42#include <linux/mutex.h>
43
44extern struct ww_class reservation_ww_class;
45
46struct reservation_object {
47 struct ww_mutex lock;
48};
49
50static inline void
51reservation_object_init(struct reservation_object *obj)
52{
53 ww_mutex_init(&obj->lock, &reservation_ww_class);
54}
55
56static inline void
57reservation_object_fini(struct reservation_object *obj)
58{
59 ww_mutex_destroy(&obj->lock);
60}
61
62#endif /* _LINUX_RESERVATION_H */
diff --git a/include/linux/rio.h b/include/linux/rio.h
index 18e099342e6f..b71d5738e683 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -20,6 +20,7 @@
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/device.h> 21#include <linux/device.h>
22#include <linux/rio_regs.h> 22#include <linux/rio_regs.h>
23#include <linux/mod_devicetable.h>
23#ifdef CONFIG_RAPIDIO_DMA_ENGINE 24#ifdef CONFIG_RAPIDIO_DMA_ENGINE
24#include <linux/dmaengine.h> 25#include <linux/dmaengine.h>
25#endif 26#endif
@@ -91,9 +92,24 @@ union rio_pw_msg;
91/** 92/**
92 * struct rio_switch - RIO switch info 93 * struct rio_switch - RIO switch info
93 * @node: Node in global list of switches 94 * @node: Node in global list of switches
94 * @switchid: Switch ID that is unique across a network
95 * @route_table: Copy of switch routing table 95 * @route_table: Copy of switch routing table
96 * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0 96 * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0
97 * @ops: pointer to switch-specific operations
98 * @lock: lock to serialize operations updates
99 * @nextdev: Array of per-port pointers to the next attached device
100 */
101struct rio_switch {
102 struct list_head node;
103 u8 *route_table;
104 u32 port_ok;
105 struct rio_switch_ops *ops;
106 spinlock_t lock;
107 struct rio_dev *nextdev[0];
108};
109
110/**
111 * struct rio_switch_ops - Per-switch operations
112 * @owner: The module owner of this structure
97 * @add_entry: Callback for switch-specific route add function 113 * @add_entry: Callback for switch-specific route add function
98 * @get_entry: Callback for switch-specific route get function 114 * @get_entry: Callback for switch-specific route get function
99 * @clr_table: Callback for switch-specific clear route table function 115 * @clr_table: Callback for switch-specific clear route table function
@@ -101,14 +117,12 @@ union rio_pw_msg;
101 * @get_domain: Callback for switch-specific domain get function 117 * @get_domain: Callback for switch-specific domain get function
102 * @em_init: Callback for switch-specific error management init function 118 * @em_init: Callback for switch-specific error management init function
103 * @em_handle: Callback for switch-specific error management handler function 119 * @em_handle: Callback for switch-specific error management handler function
104 * @sw_sysfs: Callback that initializes switch-specific sysfs attributes 120 *
105 * @nextdev: Array of per-port pointers to the next attached device 121 * Defines the operations that are necessary to initialize/control
122 * a particular RIO switch device.
106 */ 123 */
107struct rio_switch { 124struct rio_switch_ops {
108 struct list_head node; 125 struct module *owner;
109 u16 switchid;
110 u8 *route_table;
111 u32 port_ok;
112 int (*add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, 126 int (*add_entry) (struct rio_mport *mport, u16 destid, u8 hopcount,
113 u16 table, u16 route_destid, u8 route_port); 127 u16 table, u16 route_destid, u8 route_port);
114 int (*get_entry) (struct rio_mport *mport, u16 destid, u8 hopcount, 128 int (*get_entry) (struct rio_mport *mport, u16 destid, u8 hopcount,
@@ -121,8 +135,6 @@ struct rio_switch {
121 u8 *sw_domain); 135 u8 *sw_domain);
122 int (*em_init) (struct rio_dev *dev); 136 int (*em_init) (struct rio_dev *dev);
123 int (*em_handle) (struct rio_dev *dev, u8 swport); 137 int (*em_handle) (struct rio_dev *dev, u8 swport);
124 int (*sw_sysfs) (struct rio_dev *dev, int create);
125 struct rio_dev *nextdev[0];
126}; 138};
127 139
128/** 140/**
@@ -130,6 +142,7 @@ struct rio_switch {
130 * @global_list: Node in list of all RIO devices 142 * @global_list: Node in list of all RIO devices
131 * @net_list: Node in list of RIO devices in a network 143 * @net_list: Node in list of RIO devices in a network
132 * @net: Network this device is a part of 144 * @net: Network this device is a part of
145 * @do_enum: Enumeration flag
133 * @did: Device ID 146 * @did: Device ID
134 * @vid: Vendor ID 147 * @vid: Vendor ID
135 * @device_rev: Device revision 148 * @device_rev: Device revision
@@ -158,6 +171,7 @@ struct rio_dev {
158 struct list_head global_list; /* node in list of all RIO devices */ 171 struct list_head global_list; /* node in list of all RIO devices */
159 struct list_head net_list; /* node in per net list */ 172 struct list_head net_list; /* node in per net list */
160 struct rio_net *net; /* RIO net this device resides in */ 173 struct rio_net *net; /* RIO net this device resides in */
174 bool do_enum;
161 u16 did; 175 u16 did;
162 u16 vid; 176 u16 vid;
163 u32 device_rev; 177 u32 device_rev;
@@ -297,10 +311,6 @@ struct rio_net {
297 struct rio_id_table destid_table; /* destID allocation table */ 311 struct rio_id_table destid_table; /* destID allocation table */
298}; 312};
299 313
300/* Definitions used by switch sysfs initialization callback */
301#define RIO_SW_SYSFS_CREATE 1 /* Create switch attributes */
302#define RIO_SW_SYSFS_REMOVE 0 /* Remove switch attributes */
303
304/* Low-level architecture-dependent routines */ 314/* Low-level architecture-dependent routines */
305 315
306/** 316/**
@@ -385,35 +395,6 @@ struct rio_driver {
385 395
386#define to_rio_driver(drv) container_of(drv,struct rio_driver, driver) 396#define to_rio_driver(drv) container_of(drv,struct rio_driver, driver)
387 397
388/**
389 * struct rio_device_id - RIO device identifier
390 * @did: RIO device ID
391 * @vid: RIO vendor ID
392 * @asm_did: RIO assembly device ID
393 * @asm_vid: RIO assembly vendor ID
394 *
395 * Identifies a RIO device based on both the device/vendor IDs and
396 * the assembly device/vendor IDs.
397 */
398struct rio_device_id {
399 u16 did, vid;
400 u16 asm_did, asm_vid;
401};
402
403/**
404 * struct rio_switch_ops - Per-switch operations
405 * @vid: RIO vendor ID
406 * @did: RIO device ID
407 * @init_hook: Callback that performs switch device initialization
408 *
409 * Defines the operations that are necessary to initialize/control
410 * a particular RIO switch device.
411 */
412struct rio_switch_ops {
413 u16 vid, did;
414 int (*init_hook) (struct rio_dev *rdev, int do_enum);
415};
416
417union rio_pw_msg { 398union rio_pw_msg {
418 struct { 399 struct {
419 u32 comptag; /* Component Tag CSR */ 400 u32 comptag; /* Component Tag CSR */
@@ -468,14 +449,29 @@ static inline struct rio_mport *dma_to_mport(struct dma_device *ddev)
468 449
469/** 450/**
470 * struct rio_scan - RIO enumeration and discovery operations 451 * struct rio_scan - RIO enumeration and discovery operations
452 * @owner: The module owner of this structure
471 * @enumerate: Callback to perform RapidIO fabric enumeration. 453 * @enumerate: Callback to perform RapidIO fabric enumeration.
472 * @discover: Callback to perform RapidIO fabric discovery. 454 * @discover: Callback to perform RapidIO fabric discovery.
473 */ 455 */
474struct rio_scan { 456struct rio_scan {
457 struct module *owner;
475 int (*enumerate)(struct rio_mport *mport, u32 flags); 458 int (*enumerate)(struct rio_mport *mport, u32 flags);
476 int (*discover)(struct rio_mport *mport, u32 flags); 459 int (*discover)(struct rio_mport *mport, u32 flags);
477}; 460};
478 461
462/**
463 * struct rio_scan_node - list node to register RapidIO enumeration and
464 * discovery methods with RapidIO core.
465 * @mport_id: ID of an mport (net) serviced by this enumerator
466 * @node: node in global list of registered enumerators
467 * @ops: RIO enumeration and discovery operations
468 */
469struct rio_scan_node {
470 int mport_id;
471 struct list_head node;
472 struct rio_scan *ops;
473};
474
479/* Architecture and hardware-specific functions */ 475/* Architecture and hardware-specific functions */
480extern int rio_register_mport(struct rio_mport *); 476extern int rio_register_mport(struct rio_mport *);
481extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int); 477extern int rio_open_inb_mbox(struct rio_mport *, void *, int, int);
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h
index b66d13d1bdc0..2543bc163d54 100644
--- a/include/linux/rio_ids.h
+++ b/include/linux/rio_ids.h
@@ -13,8 +13,6 @@
13#ifndef LINUX_RIO_IDS_H 13#ifndef LINUX_RIO_IDS_H
14#define LINUX_RIO_IDS_H 14#define LINUX_RIO_IDS_H
15 15
16#define RIO_ANY_ID 0xffff
17
18#define RIO_VID_FREESCALE 0x0002 16#define RIO_VID_FREESCALE 0x0002
19#define RIO_DID_MPC8560 0x0003 17#define RIO_DID_MPC8560 0x0003
20 18
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 26806775b11b..adae88f5b0ab 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -244,6 +244,11 @@ size_t sg_copy_from_buffer(struct scatterlist *sgl, unsigned int nents,
244size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents, 244size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents,
245 void *buf, size_t buflen); 245 void *buf, size_t buflen);
246 246
247size_t sg_pcopy_from_buffer(struct scatterlist *sgl, unsigned int nents,
248 void *buf, size_t buflen, off_t skip);
249size_t sg_pcopy_to_buffer(struct scatterlist *sgl, unsigned int nents,
250 void *buf, size_t buflen, off_t skip);
251
247/* 252/*
248 * Maximum number of entries that will be allocated in one piece, if 253 * Maximum number of entries that will be allocated in one piece, if
249 * a list larger than this is required then chaining will be utilized. 254 * a list larger than this is required then chaining will be utilized.
diff --git a/include/linux/sched.h b/include/linux/sched.h
index ec80684a0127..50d04b92ceda 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -322,8 +322,6 @@ extern unsigned long
322arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, 322arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
323 unsigned long len, unsigned long pgoff, 323 unsigned long len, unsigned long pgoff,
324 unsigned long flags); 324 unsigned long flags);
325extern void arch_unmap_area(struct mm_struct *, unsigned long);
326extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
327#else 325#else
328static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} 326static inline void arch_pick_mmap_layout(struct mm_struct *mm) {}
329#endif 327#endif
@@ -1401,9 +1399,6 @@ struct task_struct {
1401 } memcg_batch; 1399 } memcg_batch;
1402 unsigned int memcg_kmem_skip_account; 1400 unsigned int memcg_kmem_skip_account;
1403#endif 1401#endif
1404#ifdef CONFIG_HAVE_HW_BREAKPOINT
1405 atomic_t ptrace_bp_refcnt;
1406#endif
1407#ifdef CONFIG_UPROBES 1402#ifdef CONFIG_UPROBES
1408 struct uprobe_task *utask; 1403 struct uprobe_task *utask;
1409#endif 1404#endif
@@ -1950,8 +1945,6 @@ extern struct task_struct *find_task_by_vpid(pid_t nr);
1950extern struct task_struct *find_task_by_pid_ns(pid_t nr, 1945extern struct task_struct *find_task_by_pid_ns(pid_t nr,
1951 struct pid_namespace *ns); 1946 struct pid_namespace *ns);
1952 1947
1953extern void __set_special_pids(struct pid *pid);
1954
1955/* per-UID process charging. */ 1948/* per-UID process charging. */
1956extern struct user_struct * alloc_uid(kuid_t); 1949extern struct user_struct * alloc_uid(kuid_t);
1957static inline struct user_struct *get_uid(struct user_struct *u) 1950static inline struct user_struct *get_uid(struct user_struct *u)
@@ -2439,6 +2432,15 @@ extern int __cond_resched_softirq(void);
2439 __cond_resched_softirq(); \ 2432 __cond_resched_softirq(); \
2440}) 2433})
2441 2434
2435static inline void cond_resched_rcu(void)
2436{
2437#if defined(CONFIG_DEBUG_ATOMIC_SLEEP) || !defined(CONFIG_PREEMPT_RCU)
2438 rcu_read_unlock();
2439 cond_resched();
2440 rcu_read_lock();
2441#endif
2442}
2443
2442/* 2444/*
2443 * Does a critical section need to be broken due to another 2445 * Does a critical section need to be broken due to another
2444 * task waiting?: (technically does not depend on CONFIG_PREEMPT, 2446 * task waiting?: (technically does not depend on CONFIG_PREEMPT,
diff --git a/include/linux/sched_clock.h b/include/linux/sched_clock.h
new file mode 100644
index 000000000000..fa7922c80a41
--- /dev/null
+++ b/include/linux/sched_clock.h
@@ -0,0 +1,21 @@
1/*
2 * sched_clock.h: support for extending counters to full 64-bit ns counter
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 LINUX_SCHED_CLOCK
9#define LINUX_SCHED_CLOCK
10
11#ifdef CONFIG_GENERIC_SCHED_CLOCK
12extern void sched_clock_postinit(void);
13#else
14static inline void sched_clock_postinit(void) { }
15#endif
16
17extern void setup_sched_clock(u32 (*read)(void), int bits, unsigned long rate);
18
19extern unsigned long long (*sched_clock_func)(void);
20
21#endif
diff --git a/include/linux/security.h b/include/linux/security.h
index 4686491852a7..7ce53ae1266b 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -26,6 +26,7 @@
26#include <linux/capability.h> 26#include <linux/capability.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/err.h> 28#include <linux/err.h>
29#include <linux/string.h>
29 30
30struct linux_binprm; 31struct linux_binprm;
31struct cred; 32struct cred;
@@ -60,6 +61,9 @@ struct mm_struct;
60#define SECURITY_CAP_NOAUDIT 0 61#define SECURITY_CAP_NOAUDIT 0
61#define SECURITY_CAP_AUDIT 1 62#define SECURITY_CAP_AUDIT 1
62 63
64/* LSM Agnostic defines for sb_set_mnt_opts */
65#define SECURITY_LSM_NATIVE_LABELS 1
66
63struct ctl_table; 67struct ctl_table;
64struct audit_krule; 68struct audit_krule;
65struct user_namespace; 69struct user_namespace;
@@ -306,6 +310,15 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
306 * Parse a string of security data filling in the opts structure 310 * Parse a string of security data filling in the opts structure
307 * @options string containing all mount options known by the LSM 311 * @options string containing all mount options known by the LSM
308 * @opts binary data structure usable by the LSM 312 * @opts binary data structure usable by the LSM
313 * @dentry_init_security:
314 * Compute a context for a dentry as the inode is not yet available
315 * since NFSv4 has no label backed by an EA anyway.
316 * @dentry dentry to use in calculating the context.
317 * @mode mode used to determine resource type.
318 * @name name of the last path component used to create file
319 * @ctx pointer to place the pointer to the resulting context in.
320 * @ctxlen point to place the length of the resulting context.
321 *
309 * 322 *
310 * Security hooks for inode operations. 323 * Security hooks for inode operations.
311 * 324 *
@@ -1313,6 +1326,13 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1313 * @pages contains the number of pages. 1326 * @pages contains the number of pages.
1314 * Return 0 if permission is granted. 1327 * Return 0 if permission is granted.
1315 * 1328 *
1329 * @ismaclabel:
1330 * Check if the extended attribute specified by @name
1331 * represents a MAC label. Returns 1 if name is a MAC
1332 * attribute otherwise returns 0.
1333 * @name full extended attribute name to check against
1334 * LSM as a MAC label.
1335 *
1316 * @secid_to_secctx: 1336 * @secid_to_secctx:
1317 * Convert secid to security context. If secdata is NULL the length of 1337 * Convert secid to security context. If secdata is NULL the length of
1318 * the result will be returned in seclen, but no secdata will be returned. 1338 * the result will be returned in seclen, but no secdata will be returned.
@@ -1392,7 +1412,8 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1392 * @ctxlen contains the length of @ctx. 1412 * @ctxlen contains the length of @ctx.
1393 * 1413 *
1394 * @inode_getsecctx: 1414 * @inode_getsecctx:
1395 * Returns a string containing all relevant security context information 1415 * On success, returns 0 and fills out @ctx and @ctxlen with the security
1416 * context for the given @inode.
1396 * 1417 *
1397 * @inode we wish to get the security context of. 1418 * @inode we wish to get the security context of.
1398 * @ctx is a pointer in which to place the allocated security context. 1419 * @ctx is a pointer in which to place the allocated security context.
@@ -1439,10 +1460,16 @@ struct security_operations {
1439 int (*sb_pivotroot) (struct path *old_path, 1460 int (*sb_pivotroot) (struct path *old_path,
1440 struct path *new_path); 1461 struct path *new_path);
1441 int (*sb_set_mnt_opts) (struct super_block *sb, 1462 int (*sb_set_mnt_opts) (struct super_block *sb,
1442 struct security_mnt_opts *opts); 1463 struct security_mnt_opts *opts,
1464 unsigned long kern_flags,
1465 unsigned long *set_kern_flags);
1443 int (*sb_clone_mnt_opts) (const struct super_block *oldsb, 1466 int (*sb_clone_mnt_opts) (const struct super_block *oldsb,
1444 struct super_block *newsb); 1467 struct super_block *newsb);
1445 int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts); 1468 int (*sb_parse_opts_str) (char *options, struct security_mnt_opts *opts);
1469 int (*dentry_init_security) (struct dentry *dentry, int mode,
1470 struct qstr *name, void **ctx,
1471 u32 *ctxlen);
1472
1446 1473
1447#ifdef CONFIG_SECURITY_PATH 1474#ifdef CONFIG_SECURITY_PATH
1448 int (*path_unlink) (struct path *dir, struct dentry *dentry); 1475 int (*path_unlink) (struct path *dir, struct dentry *dentry);
@@ -1590,6 +1617,7 @@ struct security_operations {
1590 1617
1591 int (*getprocattr) (struct task_struct *p, char *name, char **value); 1618 int (*getprocattr) (struct task_struct *p, char *name, char **value);
1592 int (*setprocattr) (struct task_struct *p, char *name, void *value, size_t size); 1619 int (*setprocattr) (struct task_struct *p, char *name, void *value, size_t size);
1620 int (*ismaclabel) (const char *name);
1593 int (*secid_to_secctx) (u32 secid, char **secdata, u32 *seclen); 1621 int (*secid_to_secctx) (u32 secid, char **secdata, u32 *seclen);
1594 int (*secctx_to_secid) (const char *secdata, u32 seclen, u32 *secid); 1622 int (*secctx_to_secid) (const char *secdata, u32 seclen, u32 *secid);
1595 void (*release_secctx) (char *secdata, u32 seclen); 1623 void (*release_secctx) (char *secdata, u32 seclen);
@@ -1725,10 +1753,16 @@ int security_sb_mount(const char *dev_name, struct path *path,
1725 const char *type, unsigned long flags, void *data); 1753 const char *type, unsigned long flags, void *data);
1726int security_sb_umount(struct vfsmount *mnt, int flags); 1754int security_sb_umount(struct vfsmount *mnt, int flags);
1727int security_sb_pivotroot(struct path *old_path, struct path *new_path); 1755int security_sb_pivotroot(struct path *old_path, struct path *new_path);
1728int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); 1756int security_sb_set_mnt_opts(struct super_block *sb,
1757 struct security_mnt_opts *opts,
1758 unsigned long kern_flags,
1759 unsigned long *set_kern_flags);
1729int security_sb_clone_mnt_opts(const struct super_block *oldsb, 1760int security_sb_clone_mnt_opts(const struct super_block *oldsb,
1730 struct super_block *newsb); 1761 struct super_block *newsb);
1731int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts); 1762int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts);
1763int security_dentry_init_security(struct dentry *dentry, int mode,
1764 struct qstr *name, void **ctx,
1765 u32 *ctxlen);
1732 1766
1733int security_inode_alloc(struct inode *inode); 1767int security_inode_alloc(struct inode *inode);
1734void security_inode_free(struct inode *inode); 1768void security_inode_free(struct inode *inode);
@@ -1840,6 +1874,7 @@ void security_d_instantiate(struct dentry *dentry, struct inode *inode);
1840int security_getprocattr(struct task_struct *p, char *name, char **value); 1874int security_getprocattr(struct task_struct *p, char *name, char **value);
1841int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size); 1875int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size);
1842int security_netlink_send(struct sock *sk, struct sk_buff *skb); 1876int security_netlink_send(struct sock *sk, struct sk_buff *skb);
1877int security_ismaclabel(const char *name);
1843int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen); 1878int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen);
1844int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); 1879int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid);
1845void security_release_secctx(char *secdata, u32 seclen); 1880void security_release_secctx(char *secdata, u32 seclen);
@@ -2011,7 +2046,9 @@ static inline int security_sb_pivotroot(struct path *old_path,
2011} 2046}
2012 2047
2013static inline int security_sb_set_mnt_opts(struct super_block *sb, 2048static inline int security_sb_set_mnt_opts(struct super_block *sb,
2014 struct security_mnt_opts *opts) 2049 struct security_mnt_opts *opts,
2050 unsigned long kern_flags,
2051 unsigned long *set_kern_flags)
2015{ 2052{
2016 return 0; 2053 return 0;
2017} 2054}
@@ -2035,6 +2072,16 @@ static inline int security_inode_alloc(struct inode *inode)
2035static inline void security_inode_free(struct inode *inode) 2072static inline void security_inode_free(struct inode *inode)
2036{ } 2073{ }
2037 2074
2075static inline int security_dentry_init_security(struct dentry *dentry,
2076 int mode,
2077 struct qstr *name,
2078 void **ctx,
2079 u32 *ctxlen)
2080{
2081 return -EOPNOTSUPP;
2082}
2083
2084
2038static inline int security_inode_init_security(struct inode *inode, 2085static inline int security_inode_init_security(struct inode *inode,
2039 struct inode *dir, 2086 struct inode *dir,
2040 const struct qstr *qstr, 2087 const struct qstr *qstr,
@@ -2520,6 +2567,11 @@ static inline int security_netlink_send(struct sock *sk, struct sk_buff *skb)
2520 return cap_netlink_send(sk, skb); 2567 return cap_netlink_send(sk, skb);
2521} 2568}
2522 2569
2570static inline int security_ismaclabel(const char *name)
2571{
2572 return 0;
2573}
2574
2523static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) 2575static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen)
2524{ 2576{
2525 return -EOPNOTSUPP; 2577 return -EOPNOTSUPP;
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 53d42650b193..976ce3a19f1b 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -12,10 +12,12 @@ struct task_struct;
12struct sem_array { 12struct sem_array {
13 struct kern_ipc_perm ____cacheline_aligned_in_smp 13 struct kern_ipc_perm ____cacheline_aligned_in_smp
14 sem_perm; /* permissions .. see ipc.h */ 14 sem_perm; /* permissions .. see ipc.h */
15 time_t sem_otime; /* last semop time */
16 time_t sem_ctime; /* last change time */ 15 time_t sem_ctime; /* last change time */
17 struct sem *sem_base; /* ptr to first semaphore in array */ 16 struct sem *sem_base; /* ptr to first semaphore in array */
18 struct list_head sem_pending; /* pending operations to be processed */ 17 struct list_head pending_alter; /* pending operations */
18 /* that alter the array */
19 struct list_head pending_const; /* pending complex operations */
20 /* that do not alter semvals */
19 struct list_head list_id; /* undo requests on this array */ 21 struct list_head list_id; /* undo requests on this array */
20 int sem_nsems; /* no. of semaphores in array */ 22 int sem_nsems; /* no. of semaphores in array */
21 int complex_count; /* pending complex operations */ 23 int complex_count; /* pending complex operations */
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 2da29ac178fc..4e32edc8f506 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -173,4 +173,10 @@ extern struct hlist_node *seq_hlist_start_head_rcu(struct hlist_head *head,
173extern struct hlist_node *seq_hlist_next_rcu(void *v, 173extern struct hlist_node *seq_hlist_next_rcu(void *v,
174 struct hlist_head *head, 174 struct hlist_head *head,
175 loff_t *ppos); 175 loff_t *ppos);
176
177/* Helpers for iterating over per-cpu hlist_head-s in seq_files */
178extern struct hlist_node *seq_hlist_start_percpu(struct hlist_head __percpu *head, int *cpu, loff_t pos);
179
180extern struct hlist_node *seq_hlist_next_percpu(void *v, struct hlist_head __percpu *head, int *cpu, loff_t *pos);
181
176#endif 182#endif
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
index b64d6bec6f90..4e83f3e034f3 100644
--- a/include/linux/sh_dma.h
+++ b/include/linux/sh_dma.h
@@ -99,6 +99,4 @@ struct sh_dmae_pdata {
99#define CHCR_TE 0x00000002 99#define CHCR_TE 0x00000002
100#define CHCR_IE 0x00000004 100#define CHCR_IE 0x00000004
101 101
102bool shdma_chan_filter(struct dma_chan *chan, void *arg);
103
104#endif 102#endif
diff --git a/include/linux/shdma-base.h b/include/linux/shdma-base.h
index a3728bf66f0e..382cf710ca9a 100644
--- a/include/linux/shdma-base.h
+++ b/include/linux/shdma-base.h
@@ -68,6 +68,8 @@ struct shdma_chan {
68 int id; /* Raw id of this channel */ 68 int id; /* Raw id of this channel */
69 int irq; /* Channel IRQ */ 69 int irq; /* Channel IRQ */
70 int slave_id; /* Client ID for slave DMA */ 70 int slave_id; /* Client ID for slave DMA */
71 int hw_req; /* DMA request line for slave DMA - same
72 * as MID/RID, used with DT */
71 enum shdma_pm_state pm_state; 73 enum shdma_pm_state pm_state;
72}; 74};
73 75
@@ -122,5 +124,6 @@ void shdma_chan_remove(struct shdma_chan *schan);
122int shdma_init(struct device *dev, struct shdma_dev *sdev, 124int shdma_init(struct device *dev, struct shdma_dev *sdev,
123 int chan_num); 125 int chan_num);
124void shdma_cleanup(struct shdma_dev *sdev); 126void shdma_cleanup(struct shdma_dev *sdev);
127bool shdma_chan_filter(struct dma_chan *chan, void *arg);
125 128
126#endif 129#endif
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index dec1748cd002..5afefa01a13c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -319,6 +319,8 @@ enum {
319 SKB_GSO_GRE = 1 << 6, 319 SKB_GSO_GRE = 1 << 6,
320 320
321 SKB_GSO_UDP_TUNNEL = 1 << 7, 321 SKB_GSO_UDP_TUNNEL = 1 << 7,
322
323 SKB_GSO_MPLS = 1 << 8,
322}; 324};
323 325
324#if BITS_PER_LONG > 32 326#if BITS_PER_LONG > 32
@@ -384,11 +386,13 @@ typedef unsigned char *sk_buff_data_t;
384 * @no_fcs: Request NIC to treat last 4 bytes as Ethernet FCS 386 * @no_fcs: Request NIC to treat last 4 bytes as Ethernet FCS
385 * @dma_cookie: a cookie to one of several possible DMA operations 387 * @dma_cookie: a cookie to one of several possible DMA operations
386 * done by skb DMA functions 388 * done by skb DMA functions
389 * @napi_id: id of the NAPI struct this skb came from
387 * @secmark: security marking 390 * @secmark: security marking
388 * @mark: Generic packet mark 391 * @mark: Generic packet mark
389 * @dropcount: total number of sk_receive_queue overflows 392 * @dropcount: total number of sk_receive_queue overflows
390 * @vlan_proto: vlan encapsulation protocol 393 * @vlan_proto: vlan encapsulation protocol
391 * @vlan_tci: vlan tag control information 394 * @vlan_tci: vlan tag control information
395 * @inner_protocol: Protocol (encapsulation)
392 * @inner_transport_header: Inner transport layer header (encapsulation) 396 * @inner_transport_header: Inner transport layer header (encapsulation)
393 * @inner_network_header: Network layer header (encapsulation) 397 * @inner_network_header: Network layer header (encapsulation)
394 * @inner_mac_header: Link layer header (encapsulation) 398 * @inner_mac_header: Link layer header (encapsulation)
@@ -497,8 +501,11 @@ struct sk_buff {
497 /* 7/9 bit hole (depending on ndisc_nodetype presence) */ 501 /* 7/9 bit hole (depending on ndisc_nodetype presence) */
498 kmemcheck_bitfield_end(flags2); 502 kmemcheck_bitfield_end(flags2);
499 503
500#ifdef CONFIG_NET_DMA 504#if defined CONFIG_NET_DMA || defined CONFIG_NET_LL_RX_POLL
501 dma_cookie_t dma_cookie; 505 union {
506 unsigned int napi_id;
507 dma_cookie_t dma_cookie;
508 };
502#endif 509#endif
503#ifdef CONFIG_NETWORK_SECMARK 510#ifdef CONFIG_NETWORK_SECMARK
504 __u32 secmark; 511 __u32 secmark;
@@ -509,12 +516,13 @@ struct sk_buff {
509 __u32 reserved_tailroom; 516 __u32 reserved_tailroom;
510 }; 517 };
511 518
512 sk_buff_data_t inner_transport_header; 519 __be16 inner_protocol;
513 sk_buff_data_t inner_network_header; 520 __u16 inner_transport_header;
514 sk_buff_data_t inner_mac_header; 521 __u16 inner_network_header;
515 sk_buff_data_t transport_header; 522 __u16 inner_mac_header;
516 sk_buff_data_t network_header; 523 __u16 transport_header;
517 sk_buff_data_t mac_header; 524 __u16 network_header;
525 __u16 mac_header;
518 /* These elements must be at the end, see alloc_skb() for details. */ 526 /* These elements must be at the end, see alloc_skb() for details. */
519 sk_buff_data_t tail; 527 sk_buff_data_t tail;
520 sk_buff_data_t end; 528 sk_buff_data_t end;
@@ -1388,6 +1396,7 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset)
1388 skb_reset_tail_pointer(skb); 1396 skb_reset_tail_pointer(skb);
1389 skb->tail += offset; 1397 skb->tail += offset;
1390} 1398}
1399
1391#else /* NET_SKBUFF_DATA_USES_OFFSET */ 1400#else /* NET_SKBUFF_DATA_USES_OFFSET */
1392static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb) 1401static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb)
1393{ 1402{
@@ -1528,7 +1537,6 @@ static inline void skb_reset_mac_len(struct sk_buff *skb)
1528 skb->mac_len = skb->network_header - skb->mac_header; 1537 skb->mac_len = skb->network_header - skb->mac_header;
1529} 1538}
1530 1539
1531#ifdef NET_SKBUFF_DATA_USES_OFFSET
1532static inline unsigned char *skb_inner_transport_header(const struct sk_buff 1540static inline unsigned char *skb_inner_transport_header(const struct sk_buff
1533 *skb) 1541 *skb)
1534{ 1542{
@@ -1582,7 +1590,7 @@ static inline void skb_set_inner_mac_header(struct sk_buff *skb,
1582} 1590}
1583static inline bool skb_transport_header_was_set(const struct sk_buff *skb) 1591static inline bool skb_transport_header_was_set(const struct sk_buff *skb)
1584{ 1592{
1585 return skb->transport_header != ~0U; 1593 return skb->transport_header != (typeof(skb->transport_header))~0U;
1586} 1594}
1587 1595
1588static inline unsigned char *skb_transport_header(const struct sk_buff *skb) 1596static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
@@ -1625,7 +1633,7 @@ static inline unsigned char *skb_mac_header(const struct sk_buff *skb)
1625 1633
1626static inline int skb_mac_header_was_set(const struct sk_buff *skb) 1634static inline int skb_mac_header_was_set(const struct sk_buff *skb)
1627{ 1635{
1628 return skb->mac_header != ~0U; 1636 return skb->mac_header != (typeof(skb->mac_header))~0U;
1629} 1637}
1630 1638
1631static inline void skb_reset_mac_header(struct sk_buff *skb) 1639static inline void skb_reset_mac_header(struct sk_buff *skb)
@@ -1639,112 +1647,6 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
1639 skb->mac_header += offset; 1647 skb->mac_header += offset;
1640} 1648}
1641 1649
1642#else /* NET_SKBUFF_DATA_USES_OFFSET */
1643static inline unsigned char *skb_inner_transport_header(const struct sk_buff
1644 *skb)
1645{
1646 return skb->inner_transport_header;
1647}
1648
1649static inline void skb_reset_inner_transport_header(struct sk_buff *skb)
1650{
1651 skb->inner_transport_header = skb->data;
1652}
1653
1654static inline void skb_set_inner_transport_header(struct sk_buff *skb,
1655 const int offset)
1656{
1657 skb->inner_transport_header = skb->data + offset;
1658}
1659
1660static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb)
1661{
1662 return skb->inner_network_header;
1663}
1664
1665static inline void skb_reset_inner_network_header(struct sk_buff *skb)
1666{
1667 skb->inner_network_header = skb->data;
1668}
1669
1670static inline void skb_set_inner_network_header(struct sk_buff *skb,
1671 const int offset)
1672{
1673 skb->inner_network_header = skb->data + offset;
1674}
1675
1676static inline unsigned char *skb_inner_mac_header(const struct sk_buff *skb)
1677{
1678 return skb->inner_mac_header;
1679}
1680
1681static inline void skb_reset_inner_mac_header(struct sk_buff *skb)
1682{
1683 skb->inner_mac_header = skb->data;
1684}
1685
1686static inline void skb_set_inner_mac_header(struct sk_buff *skb,
1687 const int offset)
1688{
1689 skb->inner_mac_header = skb->data + offset;
1690}
1691static inline bool skb_transport_header_was_set(const struct sk_buff *skb)
1692{
1693 return skb->transport_header != NULL;
1694}
1695
1696static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
1697{
1698 return skb->transport_header;
1699}
1700
1701static inline void skb_reset_transport_header(struct sk_buff *skb)
1702{
1703 skb->transport_header = skb->data;
1704}
1705
1706static inline void skb_set_transport_header(struct sk_buff *skb,
1707 const int offset)
1708{
1709 skb->transport_header = skb->data + offset;
1710}
1711
1712static inline unsigned char *skb_network_header(const struct sk_buff *skb)
1713{
1714 return skb->network_header;
1715}
1716
1717static inline void skb_reset_network_header(struct sk_buff *skb)
1718{
1719 skb->network_header = skb->data;
1720}
1721
1722static inline void skb_set_network_header(struct sk_buff *skb, const int offset)
1723{
1724 skb->network_header = skb->data + offset;
1725}
1726
1727static inline unsigned char *skb_mac_header(const struct sk_buff *skb)
1728{
1729 return skb->mac_header;
1730}
1731
1732static inline int skb_mac_header_was_set(const struct sk_buff *skb)
1733{
1734 return skb->mac_header != NULL;
1735}
1736
1737static inline void skb_reset_mac_header(struct sk_buff *skb)
1738{
1739 skb->mac_header = skb->data;
1740}
1741
1742static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
1743{
1744 skb->mac_header = skb->data + offset;
1745}
1746#endif /* NET_SKBUFF_DATA_USES_OFFSET */
1747
1748static inline void skb_probe_transport_header(struct sk_buff *skb, 1650static inline void skb_probe_transport_header(struct sk_buff *skb,
1749 const int offset_hint) 1651 const int offset_hint)
1750{ 1652{
@@ -2483,6 +2385,7 @@ extern void skb_split(struct sk_buff *skb,
2483 struct sk_buff *skb1, const u32 len); 2385 struct sk_buff *skb1, const u32 len);
2484extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, 2386extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb,
2485 int shiftlen); 2387 int shiftlen);
2388extern void skb_scrub_packet(struct sk_buff *skb);
2486 2389
2487extern struct sk_buff *skb_segment(struct sk_buff *skb, 2390extern struct sk_buff *skb_segment(struct sk_buff *skb,
2488 netdev_features_t features); 2391 netdev_features_t features);
diff --git a/include/linux/smp.h b/include/linux/smp.h
index c8488763277f..c181399f2c20 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -11,7 +11,6 @@
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/irqflags.h>
15 14
16extern void cpu_idle(void); 15extern void cpu_idle(void);
17 16
@@ -140,17 +139,14 @@ static inline int up_smp_call_function(smp_call_func_t func, void *info)
140} 139}
141#define smp_call_function(func, info, wait) \ 140#define smp_call_function(func, info, wait) \
142 (up_smp_call_function(func, info)) 141 (up_smp_call_function(func, info))
143 142#define on_each_cpu(func, info, wait) \
144static inline int on_each_cpu(smp_call_func_t func, void *info, int wait) 143 ({ \
145{ 144 unsigned long __flags; \
146 unsigned long flags; 145 local_irq_save(__flags); \
147 146 func(info); \
148 local_irq_save(flags); 147 local_irq_restore(__flags); \
149 func(info); 148 0; \
150 local_irq_restore(flags); 149 })
151 return 0;
152}
153
154/* 150/*
155 * Note we still need to test the mask even for UP 151 * Note we still need to test the mask even for UP
156 * because we actually can get an empty mask from 152 * because we actually can get an empty mask from
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 6ff26c8db7b9..28e440be1c07 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -308,6 +308,9 @@ struct spi_master {
308 308
309 /* bitmask of supported bits_per_word for transfers */ 309 /* bitmask of supported bits_per_word for transfers */
310 u32 bits_per_word_mask; 310 u32 bits_per_word_mask;
311#define SPI_BPW_MASK(bits) BIT((bits) - 1)
312#define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0UL : (BIT(bits) - 1))
313#define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - SPI_BIT_MASK(min - 1))
311 314
312 /* other constraints relevant to this driver */ 315 /* other constraints relevant to this driver */
313 u16 flags; 316 u16 flags;
diff --git a/include/linux/spi/xilinx_spi.h b/include/linux/spi/xilinx_spi.h
index 6f17278810b0..333ecdfee0d9 100644
--- a/include/linux/spi/xilinx_spi.h
+++ b/include/linux/spi/xilinx_spi.h
@@ -11,7 +11,6 @@
11 */ 11 */
12struct xspi_platform_data { 12struct xspi_platform_data {
13 u16 num_chipselect; 13 u16 num_chipselect;
14 bool little_endian;
15 u8 bits_per_word; 14 u8 bits_per_word;
16 struct spi_board_info *devices; 15 struct spi_board_info *devices;
17 u8 num_devices; 16 u8 num_devices;
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h
index 51df117abe46..bdb9993f0fda 100644
--- a/include/linux/spinlock_api_smp.h
+++ b/include/linux/spinlock_api_smp.h
@@ -144,7 +144,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
144 LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); 144 LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock);
145} 145}
146 146
147#endif /* CONFIG_PREEMPT */ 147#endif /* !CONFIG_GENERIC_LOCKBREAK || CONFIG_DEBUG_LOCK_ALLOC */
148 148
149static inline void __raw_spin_unlock(raw_spinlock_t *lock) 149static inline void __raw_spin_unlock(raw_spinlock_t *lock)
150{ 150{
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h
index afe79d40a99e..6535e4718fde 100644
--- a/include/linux/ssb/ssb_driver_mips.h
+++ b/include/linux/ssb/ssb_driver_mips.h
@@ -20,6 +20,18 @@ struct ssb_pflash {
20 u32 window_size; 20 u32 window_size;
21}; 21};
22 22
23#ifdef CONFIG_SSB_SFLASH
24struct ssb_sflash {
25 bool present;
26 u32 window;
27 u32 blocksize;
28 u16 numblocks;
29 u32 size;
30
31 void *priv;
32};
33#endif
34
23struct ssb_mipscore { 35struct ssb_mipscore {
24 struct ssb_device *dev; 36 struct ssb_device *dev;
25 37
@@ -27,6 +39,9 @@ struct ssb_mipscore {
27 struct ssb_serial_port serial_ports[4]; 39 struct ssb_serial_port serial_ports[4];
28 40
29 struct ssb_pflash pflash; 41 struct ssb_pflash pflash;
42#ifdef CONFIG_SSB_SFLASH
43 struct ssb_sflash sflash;
44#endif
30}; 45};
31 46
32extern void ssb_mipscore_init(struct ssb_mipscore *mcore); 47extern void ssb_mipscore_init(struct ssb_mipscore *mcore);
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index 3a7256955b10..f9f931c89e3e 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -172,6 +172,7 @@
172#define SSB_SPROMSIZE_WORDS_R4 220 172#define SSB_SPROMSIZE_WORDS_R4 220
173#define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16)) 173#define SSB_SPROMSIZE_BYTES_R123 (SSB_SPROMSIZE_WORDS_R123 * sizeof(u16))
174#define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16)) 174#define SSB_SPROMSIZE_BYTES_R4 (SSB_SPROMSIZE_WORDS_R4 * sizeof(u16))
175#define SSB_SPROMSIZE_WORDS_R10 230
175#define SSB_SPROM_BASE1 0x1000 176#define SSB_SPROM_BASE1 0x1000
176#define SSB_SPROM_BASE31 0x0800 177#define SSB_SPROM_BASE31 0x0800
177#define SSB_SPROM_REVISION 0x007E 178#define SSB_SPROM_REVISION 0x007E
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index c1b3ed3fb787..9e495d31516e 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -80,6 +80,10 @@ struct stmmac_mdio_bus_data {
80 unsigned int phy_mask; 80 unsigned int phy_mask;
81 int *irqs; 81 int *irqs;
82 int probed_phy_irq; 82 int probed_phy_irq;
83#ifdef CONFIG_OF
84 int reset_gpio, active_low;
85 u32 delays[3];
86#endif
83}; 87};
84 88
85struct stmmac_dma_cfg { 89struct stmmac_dma_cfg {
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 303399b1ba59..6ce690de447f 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -57,6 +57,7 @@ struct cache_head {
57#define CACHE_VALID 0 /* Entry contains valid data */ 57#define CACHE_VALID 0 /* Entry contains valid data */
58#define CACHE_NEGATIVE 1 /* Negative entry - there is no match for the key */ 58#define CACHE_NEGATIVE 1 /* Negative entry - there is no match for the key */
59#define CACHE_PENDING 2 /* An upcall has been sent but no reply received yet*/ 59#define CACHE_PENDING 2 /* An upcall has been sent but no reply received yet*/
60#define CACHE_CLEANED 3 /* Entry has been cleaned from cache */
60 61
61#define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ 62#define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */
62 63
@@ -148,6 +149,24 @@ struct cache_deferred_req {
148 int too_many); 149 int too_many);
149}; 150};
150 151
152/*
153 * timestamps kept in the cache are expressed in seconds
154 * since boot. This is the best for measuring differences in
155 * real time.
156 */
157static inline time_t seconds_since_boot(void)
158{
159 struct timespec boot;
160 getboottime(&boot);
161 return get_seconds() - boot.tv_sec;
162}
163
164static inline time_t convert_to_wallclock(time_t sinceboot)
165{
166 struct timespec boot;
167 getboottime(&boot);
168 return boot.tv_sec + sinceboot;
169}
151 170
152extern const struct file_operations cache_file_operations_pipefs; 171extern const struct file_operations cache_file_operations_pipefs;
153extern const struct file_operations content_file_operations_pipefs; 172extern const struct file_operations content_file_operations_pipefs;
@@ -181,15 +200,10 @@ static inline void cache_put(struct cache_head *h, struct cache_detail *cd)
181 kref_put(&h->ref, cd->cache_put); 200 kref_put(&h->ref, cd->cache_put);
182} 201}
183 202
184static inline int cache_valid(struct cache_head *h) 203static inline int cache_is_expired(struct cache_detail *detail, struct cache_head *h)
185{ 204{
186 /* If an item has been unhashed pending removal when 205 return (h->expiry_time < seconds_since_boot()) ||
187 * the refcount drops to 0, the expiry_time will be 206 (detail->flush_time > h->last_refresh);
188 * set to 0. We don't want to consider such items
189 * valid in this context even though CACHE_VALID is
190 * set.
191 */
192 return (h->expiry_time != 0 && test_bit(CACHE_VALID, &h->flags));
193} 207}
194 208
195extern int cache_check(struct cache_detail *detail, 209extern int cache_check(struct cache_detail *detail,
@@ -250,25 +264,6 @@ static inline int get_uint(char **bpp, unsigned int *anint)
250 return 0; 264 return 0;
251} 265}
252 266
253/*
254 * timestamps kept in the cache are expressed in seconds
255 * since boot. This is the best for measuring differences in
256 * real time.
257 */
258static inline time_t seconds_since_boot(void)
259{
260 struct timespec boot;
261 getboottime(&boot);
262 return get_seconds() - boot.tv_sec;
263}
264
265static inline time_t convert_to_wallclock(time_t sinceboot)
266{
267 struct timespec boot;
268 getboottime(&boot);
269 return boot.tv_sec + sinceboot;
270}
271
272static inline time_t get_expiry(char **bpp) 267static inline time_t get_expiry(char **bpp)
273{ 268{
274 int rv; 269 int rv;
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 161463e59624..1f911ccb2a75 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -151,6 +151,8 @@ struct gss_api_mech *gss_mech_get_by_pseudoflavor(u32);
151/* Fill in an array with a list of supported pseudoflavors */ 151/* Fill in an array with a list of supported pseudoflavors */
152int gss_mech_list_pseudoflavors(rpc_authflavor_t *, int); 152int gss_mech_list_pseudoflavors(rpc_authflavor_t *, int);
153 153
154struct gss_api_mech * gss_mech_get(struct gss_api_mech *);
155
154/* For every successful gss_mech_get or gss_mech_get_by_* call there must be a 156/* For every successful gss_mech_get or gss_mech_get_by_* call there must be a
155 * corresponding call to gss_mech_put. */ 157 * corresponding call to gss_mech_put. */
156void gss_mech_put(struct gss_api_mech *); 158void gss_mech_put(struct gss_api_mech *);
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 84ca436b76c2..6d870353674a 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -88,15 +88,6 @@ struct rpc_task {
88 tk_rebind_retry : 2; 88 tk_rebind_retry : 2;
89}; 89};
90 90
91/* support walking a list of tasks on a wait queue */
92#define task_for_each(task, pos, head) \
93 list_for_each(pos, head) \
94 if ((task=list_entry(pos, struct rpc_task, u.tk_wait.list)),1)
95
96#define task_for_first(task, head) \
97 if (!list_empty(head) && \
98 ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1))
99
100typedef void (*rpc_action)(struct rpc_task *); 91typedef void (*rpc_action)(struct rpc_task *);
101 92
102struct rpc_call_ops { 93struct rpc_call_ops {
@@ -238,7 +229,6 @@ struct rpc_task *rpc_wake_up_first(struct rpc_wait_queue *,
238 bool (*)(struct rpc_task *, void *), 229 bool (*)(struct rpc_task *, void *),
239 void *); 230 void *);
240void rpc_wake_up_status(struct rpc_wait_queue *, int); 231void rpc_wake_up_status(struct rpc_wait_queue *, int);
241int rpc_queue_empty(struct rpc_wait_queue *);
242void rpc_delay(struct rpc_task *, unsigned long); 232void rpc_delay(struct rpc_task *, unsigned long);
243void * rpc_malloc(struct rpc_task *, size_t); 233void * rpc_malloc(struct rpc_task *, size_t);
244void rpc_free(void *); 234void rpc_free(void *);
@@ -259,16 +249,6 @@ static inline int rpc_wait_for_completion_task(struct rpc_task *task)
259 return __rpc_wait_for_completion_task(task, NULL); 249 return __rpc_wait_for_completion_task(task, NULL);
260} 250}
261 251
262static inline void rpc_task_set_priority(struct rpc_task *task, unsigned char prio)
263{
264 task->tk_priority = prio - RPC_PRIORITY_LOW;
265}
266
267static inline int rpc_task_has_priority(struct rpc_task *task, unsigned char prio)
268{
269 return (task->tk_priority + RPC_PRIORITY_LOW == prio);
270}
271
272#if defined(RPC_DEBUG) || defined (RPC_TRACEPOINTS) 252#if defined(RPC_DEBUG) || defined (RPC_TRACEPOINTS)
273static inline const char * rpc_qname(const struct rpc_wait_queue *q) 253static inline const char * rpc_qname(const struct rpc_wait_queue *q)
274{ 254{
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
index ff374ab30839..8d71d6577459 100644
--- a/include/linux/sunrpc/svcauth.h
+++ b/include/linux/sunrpc/svcauth.h
@@ -14,6 +14,7 @@
14#include <linux/string.h> 14#include <linux/string.h>
15#include <linux/sunrpc/msg_prot.h> 15#include <linux/sunrpc/msg_prot.h>
16#include <linux/sunrpc/cache.h> 16#include <linux/sunrpc/cache.h>
17#include <linux/sunrpc/gss_api.h>
17#include <linux/hash.h> 18#include <linux/hash.h>
18#include <linux/cred.h> 19#include <linux/cred.h>
19 20
@@ -23,13 +24,23 @@ struct svc_cred {
23 struct group_info *cr_group_info; 24 struct group_info *cr_group_info;
24 u32 cr_flavor; /* pseudoflavor */ 25 u32 cr_flavor; /* pseudoflavor */
25 char *cr_principal; /* for gss */ 26 char *cr_principal; /* for gss */
27 struct gss_api_mech *cr_gss_mech;
26}; 28};
27 29
30static inline void init_svc_cred(struct svc_cred *cred)
31{
32 cred->cr_group_info = NULL;
33 cred->cr_principal = NULL;
34 cred->cr_gss_mech = NULL;
35}
36
28static inline void free_svc_cred(struct svc_cred *cred) 37static inline void free_svc_cred(struct svc_cred *cred)
29{ 38{
30 if (cred->cr_group_info) 39 if (cred->cr_group_info)
31 put_group_info(cred->cr_group_info); 40 put_group_info(cred->cr_group_info);
32 kfree(cred->cr_principal); 41 kfree(cred->cr_principal);
42 gss_mech_put(cred->cr_gss_mech);
43 init_svc_cred(cred);
33} 44}
34 45
35struct svc_rqst; /* forward decl */ 46struct svc_rqst; /* forward decl */
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index d4e3f16d5e89..f73cabf59012 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -363,6 +363,7 @@ extern bool pm_wakeup_pending(void);
363extern bool pm_get_wakeup_count(unsigned int *count, bool block); 363extern bool pm_get_wakeup_count(unsigned int *count, bool block);
364extern bool pm_save_wakeup_count(unsigned int count); 364extern bool pm_save_wakeup_count(unsigned int count);
365extern void pm_wakep_autosleep_enabled(bool set); 365extern void pm_wakep_autosleep_enabled(bool set);
366extern void pm_print_active_wakeup_sources(void);
366 367
367static inline void lock_system_sleep(void) 368static inline void lock_system_sleep(void)
368{ 369{
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 1701ce4be746..d95cde5e257d 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -10,6 +10,7 @@
10#include <linux/node.h> 10#include <linux/node.h>
11#include <linux/fs.h> 11#include <linux/fs.h>
12#include <linux/atomic.h> 12#include <linux/atomic.h>
13#include <linux/page-flags.h>
13#include <asm/page.h> 14#include <asm/page.h>
14 15
15struct notifier_block; 16struct notifier_block;
@@ -19,10 +20,13 @@ struct bio;
19#define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */ 20#define SWAP_FLAG_PREFER 0x8000 /* set if swap priority specified */
20#define SWAP_FLAG_PRIO_MASK 0x7fff 21#define SWAP_FLAG_PRIO_MASK 0x7fff
21#define SWAP_FLAG_PRIO_SHIFT 0 22#define SWAP_FLAG_PRIO_SHIFT 0
22#define SWAP_FLAG_DISCARD 0x10000 /* discard swap cluster after use */ 23#define SWAP_FLAG_DISCARD 0x10000 /* enable discard for swap */
24#define SWAP_FLAG_DISCARD_ONCE 0x20000 /* discard swap area at swapon-time */
25#define SWAP_FLAG_DISCARD_PAGES 0x40000 /* discard page-clusters after use */
23 26
24#define SWAP_FLAGS_VALID (SWAP_FLAG_PRIO_MASK | SWAP_FLAG_PREFER | \ 27#define SWAP_FLAGS_VALID (SWAP_FLAG_PRIO_MASK | SWAP_FLAG_PREFER | \
25 SWAP_FLAG_DISCARD) 28 SWAP_FLAG_DISCARD | SWAP_FLAG_DISCARD_ONCE | \
29 SWAP_FLAG_DISCARD_PAGES)
26 30
27static inline int current_is_kswapd(void) 31static inline int current_is_kswapd(void)
28{ 32{
@@ -146,14 +150,16 @@ struct swap_extent {
146enum { 150enum {
147 SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ 151 SWP_USED = (1 << 0), /* is slot in swap_info[] used? */
148 SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ 152 SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */
149 SWP_DISCARDABLE = (1 << 2), /* swapon+blkdev support discard */ 153 SWP_DISCARDABLE = (1 << 2), /* blkdev support discard */
150 SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */ 154 SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */
151 SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ 155 SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */
152 SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */ 156 SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */
153 SWP_BLKDEV = (1 << 6), /* its a block device */ 157 SWP_BLKDEV = (1 << 6), /* its a block device */
154 SWP_FILE = (1 << 7), /* set after swap_activate success */ 158 SWP_FILE = (1 << 7), /* set after swap_activate success */
159 SWP_AREA_DISCARD = (1 << 8), /* single-time swap area discards */
160 SWP_PAGE_DISCARD = (1 << 9), /* freed swap page-cluster discards */
155 /* add others here before... */ 161 /* add others here before... */
156 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ 162 SWP_SCANNING = (1 << 10), /* refcount in scan_swap_map */
157}; 163};
158 164
159#define SWAP_CLUSTER_MAX 32UL 165#define SWAP_CLUSTER_MAX 32UL
@@ -233,8 +239,8 @@ extern unsigned long nr_free_pagecache_pages(void);
233 239
234 240
235/* linux/mm/swap.c */ 241/* linux/mm/swap.c */
236extern void __lru_cache_add(struct page *, enum lru_list lru); 242extern void __lru_cache_add(struct page *);
237extern void lru_cache_add_lru(struct page *, enum lru_list lru); 243extern void lru_cache_add(struct page *);
238extern void lru_add_page_tail(struct page *page, struct page *page_tail, 244extern void lru_add_page_tail(struct page *page, struct page *page_tail,
239 struct lruvec *lruvec, struct list_head *head); 245 struct lruvec *lruvec, struct list_head *head);
240extern void activate_page(struct page *); 246extern void activate_page(struct page *);
@@ -254,12 +260,14 @@ extern void add_page_to_unevictable_list(struct page *page);
254 */ 260 */
255static inline void lru_cache_add_anon(struct page *page) 261static inline void lru_cache_add_anon(struct page *page)
256{ 262{
257 __lru_cache_add(page, LRU_INACTIVE_ANON); 263 ClearPageActive(page);
264 __lru_cache_add(page);
258} 265}
259 266
260static inline void lru_cache_add_file(struct page *page) 267static inline void lru_cache_add_file(struct page *page)
261{ 268{
262 __lru_cache_add(page, LRU_INACTIVE_FILE); 269 ClearPageActive(page);
270 __lru_cache_add(page);
263} 271}
264 272
265/* linux/mm/vmscan.c */ 273/* linux/mm/vmscan.c */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 5adbc33d1ab3..472120b4fac5 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -246,7 +246,6 @@ struct tcp_sock {
246 246
247 /* from STCP, retrans queue hinting */ 247 /* from STCP, retrans queue hinting */
248 struct sk_buff* lost_skb_hint; 248 struct sk_buff* lost_skb_hint;
249 struct sk_buff *scoreboard_skb_hint;
250 struct sk_buff *retransmit_skb_hint; 249 struct sk_buff *retransmit_skb_hint;
251 250
252 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ 251 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */
diff --git a/include/linux/tpm.h b/include/linux/tpm.h
index fcb627ff8d3e..9a9051bb1a03 100644
--- a/include/linux/tpm.h
+++ b/include/linux/tpm.h
@@ -22,6 +22,8 @@
22#ifndef __LINUX_TPM_H__ 22#ifndef __LINUX_TPM_H__
23#define __LINUX_TPM_H__ 23#define __LINUX_TPM_H__
24 24
25#define TPM_DIGEST_SIZE 20 /* Max TPM v1.2 PCR size */
26
25/* 27/*
26 * Chip num is this value or a valid tpm idx 28 * Chip num is this value or a valid tpm idx
27 */ 29 */
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
index ea7168a68081..617c01b8f74a 100644
--- a/include/linux/vexpress.h
+++ b/include/linux/vexpress.h
@@ -15,6 +15,7 @@
15#define _LINUX_VEXPRESS_H 15#define _LINUX_VEXPRESS_H
16 16
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/reboot.h>
18 19
19#define VEXPRESS_SITE_MB 0 20#define VEXPRESS_SITE_MB 0
20#define VEXPRESS_SITE_DB1 1 21#define VEXPRESS_SITE_DB1 1
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 9ff8645b7e0b..36d36cc89329 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -34,13 +34,6 @@ struct virtqueue {
34 void *priv; 34 void *priv;
35}; 35};
36 36
37int virtqueue_add_buf(struct virtqueue *vq,
38 struct scatterlist sg[],
39 unsigned int out_num,
40 unsigned int in_num,
41 void *data,
42 gfp_t gfp);
43
44int virtqueue_add_outbuf(struct virtqueue *vq, 37int virtqueue_add_outbuf(struct virtqueue *vq,
45 struct scatterlist sg[], unsigned int num, 38 struct scatterlist sg[], unsigned int num,
46 void *data, 39 void *data,
@@ -70,6 +63,10 @@ void virtqueue_disable_cb(struct virtqueue *vq);
70 63
71bool virtqueue_enable_cb(struct virtqueue *vq); 64bool virtqueue_enable_cb(struct virtqueue *vq);
72 65
66unsigned virtqueue_enable_cb_prepare(struct virtqueue *vq);
67
68bool virtqueue_poll(struct virtqueue *vq, unsigned);
69
73bool virtqueue_enable_cb_delayed(struct virtqueue *vq); 70bool virtqueue_enable_cb_delayed(struct virtqueue *vq);
74 71
75void *virtqueue_detach_unused_buf(struct virtqueue *vq); 72void *virtqueue_detach_unused_buf(struct virtqueue *vq);
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index ca3ad41c2c82..b300787af8e0 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_VIRTIO_RING_H 1#ifndef _LINUX_VIRTIO_RING_H
2#define _LINUX_VIRTIO_RING_H 2#define _LINUX_VIRTIO_RING_H
3 3
4#include <asm/barrier.h>
4#include <linux/irqreturn.h> 5#include <linux/irqreturn.h>
5#include <uapi/linux/virtio_ring.h> 6#include <uapi/linux/virtio_ring.h>
6 7
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 7d5773a99f20..4b8a89189a29 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -10,12 +10,12 @@
10struct vm_area_struct; /* vma defining user mapping in mm_types.h */ 10struct vm_area_struct; /* vma defining user mapping in mm_types.h */
11 11
12/* bits in flags of vmalloc's vm_struct below */ 12/* bits in flags of vmalloc's vm_struct below */
13#define VM_IOREMAP 0x00000001 /* ioremap() and friends */ 13#define VM_IOREMAP 0x00000001 /* ioremap() and friends */
14#define VM_ALLOC 0x00000002 /* vmalloc() */ 14#define VM_ALLOC 0x00000002 /* vmalloc() */
15#define VM_MAP 0x00000004 /* vmap()ed pages */ 15#define VM_MAP 0x00000004 /* vmap()ed pages */
16#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */ 16#define VM_USERMAP 0x00000008 /* suitable for remap_vmalloc_range */
17#define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */ 17#define VM_VPAGES 0x00000010 /* buffer for pages was vmalloc'ed */
18#define VM_UNLIST 0x00000020 /* vm_struct is not listed in vmlist */ 18#define VM_UNINITIALIZED 0x00000020 /* vm_struct is not fully initialized */
19/* bits [20..32] reserved for arch specific ioremap internals */ 19/* bits [20..32] reserved for arch specific ioremap internals */
20 20
21/* 21/*
@@ -82,6 +82,10 @@ extern void *vmap(struct page **pages, unsigned int count,
82 unsigned long flags, pgprot_t prot); 82 unsigned long flags, pgprot_t prot);
83extern void vunmap(const void *addr); 83extern void vunmap(const void *addr);
84 84
85extern int remap_vmalloc_range_partial(struct vm_area_struct *vma,
86 unsigned long uaddr, void *kaddr,
87 unsigned long size);
88
85extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr, 89extern int remap_vmalloc_range(struct vm_area_struct *vma, void *addr,
86 unsigned long pgoff); 90 unsigned long pgoff);
87void vmalloc_sync_all(void); 91void vmalloc_sync_all(void);
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 623488fdc1f5..a0ed78ab54d7 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -303,6 +303,33 @@ enum {
303 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ 303 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */
304 WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */ 304 WQ_SYSFS = 1 << 6, /* visible in sysfs, see wq_sysfs_register() */
305 305
306 /*
307 * Per-cpu workqueues are generally preferred because they tend to
308 * show better performance thanks to cache locality. Per-cpu
309 * workqueues exclude the scheduler from choosing the CPU to
310 * execute the worker threads, which has an unfortunate side effect
311 * of increasing power consumption.
312 *
313 * The scheduler considers a CPU idle if it doesn't have any task
314 * to execute and tries to keep idle cores idle to conserve power;
315 * however, for example, a per-cpu work item scheduled from an
316 * interrupt handler on an idle CPU will force the scheduler to
317 * excute the work item on that CPU breaking the idleness, which in
318 * turn may lead to more scheduling choices which are sub-optimal
319 * in terms of power consumption.
320 *
321 * Workqueues marked with WQ_POWER_EFFICIENT are per-cpu by default
322 * but become unbound if workqueue.power_efficient kernel param is
323 * specified. Per-cpu workqueues which are identified to
324 * contribute significantly to power-consumption are identified and
325 * marked with this flag and enabling the power_efficient mode
326 * leads to noticeable power saving at the cost of small
327 * performance disadvantage.
328 *
329 * http://thread.gmane.org/gmane.linux.kernel/1480396
330 */
331 WQ_POWER_EFFICIENT = 1 << 7,
332
306 __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */ 333 __WQ_DRAINING = 1 << 16, /* internal: workqueue is draining */
307 __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */ 334 __WQ_ORDERED = 1 << 17, /* internal: workqueue is ordered */
308 335
@@ -333,11 +360,19 @@ enum {
333 * 360 *
334 * system_freezable_wq is equivalent to system_wq except that it's 361 * system_freezable_wq is equivalent to system_wq except that it's
335 * freezable. 362 * freezable.
363 *
364 * *_power_efficient_wq are inclined towards saving power and converted
365 * into WQ_UNBOUND variants if 'wq_power_efficient' is enabled; otherwise,
366 * they are same as their non-power-efficient counterparts - e.g.
367 * system_power_efficient_wq is identical to system_wq if
368 * 'wq_power_efficient' is disabled. See WQ_POWER_EFFICIENT for more info.
336 */ 369 */
337extern struct workqueue_struct *system_wq; 370extern struct workqueue_struct *system_wq;
338extern struct workqueue_struct *system_long_wq; 371extern struct workqueue_struct *system_long_wq;
339extern struct workqueue_struct *system_unbound_wq; 372extern struct workqueue_struct *system_unbound_wq;
340extern struct workqueue_struct *system_freezable_wq; 373extern struct workqueue_struct *system_freezable_wq;
374extern struct workqueue_struct *system_power_efficient_wq;
375extern struct workqueue_struct *system_freezable_power_efficient_wq;
341 376
342static inline struct workqueue_struct * __deprecated __system_nrt_wq(void) 377static inline struct workqueue_struct * __deprecated __system_nrt_wq(void)
343{ 378{
@@ -410,11 +445,12 @@ __alloc_workqueue_key(const char *fmt, unsigned int flags, int max_active,
410 alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | (flags), 1, ##args) 445 alloc_workqueue(fmt, WQ_UNBOUND | __WQ_ORDERED | (flags), 1, ##args)
411 446
412#define create_workqueue(name) \ 447#define create_workqueue(name) \
413 alloc_workqueue((name), WQ_MEM_RECLAIM, 1) 448 alloc_workqueue("%s", WQ_MEM_RECLAIM, 1, (name))
414#define create_freezable_workqueue(name) \ 449#define create_freezable_workqueue(name) \
415 alloc_workqueue((name), WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, 1) 450 alloc_workqueue("%s", WQ_FREEZABLE | WQ_UNBOUND | WQ_MEM_RECLAIM, \
451 1, (name))
416#define create_singlethread_workqueue(name) \ 452#define create_singlethread_workqueue(name) \
417 alloc_workqueue((name), WQ_UNBOUND | WQ_MEM_RECLAIM, 1) 453 alloc_workqueue("%s", WQ_UNBOUND | WQ_MEM_RECLAIM, 1, (name))
418 454
419extern void destroy_workqueue(struct workqueue_struct *wq); 455extern void destroy_workqueue(struct workqueue_struct *wq);
420 456
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index abfe11787af3..4e198ca1f685 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -47,11 +47,16 @@ enum wb_reason {
47 WB_REASON_LAPTOP_TIMER, 47 WB_REASON_LAPTOP_TIMER,
48 WB_REASON_FREE_MORE_MEM, 48 WB_REASON_FREE_MORE_MEM,
49 WB_REASON_FS_FREE_SPACE, 49 WB_REASON_FS_FREE_SPACE,
50 /*
51 * There is no bdi forker thread any more and works are done
52 * by emergency worker, however, this is TPs userland visible
53 * and we'll be exposing exactly the same information,
54 * so it has a mismatch name.
55 */
50 WB_REASON_FORKER_THREAD, 56 WB_REASON_FORKER_THREAD,
51 57
52 WB_REASON_MAX, 58 WB_REASON_MAX,
53}; 59};
54extern const char *wb_reason_name[];
55 60
56/* 61/*
57 * A control structure which tells the writeback code what to do. These are 62 * A control structure which tells the writeback code what to do. These are
@@ -95,7 +100,6 @@ int try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr,
95void sync_inodes_sb(struct super_block *); 100void sync_inodes_sb(struct super_block *);
96long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, 101long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages,
97 enum wb_reason reason); 102 enum wb_reason reason);
98long wb_do_writeback(struct bdi_writeback *wb, int force_wait);
99void wakeup_flusher_threads(long nr_pages, enum wb_reason reason); 103void wakeup_flusher_threads(long nr_pages, enum wb_reason reason);
100void inode_wait_for_writeback(struct inode *inode); 104void inode_wait_for_writeback(struct inode *inode);
101 105
diff --git a/include/linux/zbud.h b/include/linux/zbud.h
new file mode 100644
index 000000000000..2571a5cfa5fc
--- /dev/null
+++ b/include/linux/zbud.h
@@ -0,0 +1,22 @@
1#ifndef _ZBUD_H_
2#define _ZBUD_H_
3
4#include <linux/types.h>
5
6struct zbud_pool;
7
8struct zbud_ops {
9 int (*evict)(struct zbud_pool *pool, unsigned long handle);
10};
11
12struct zbud_pool *zbud_create_pool(gfp_t gfp, struct zbud_ops *ops);
13void zbud_destroy_pool(struct zbud_pool *pool);
14int zbud_alloc(struct zbud_pool *pool, int size, gfp_t gfp,
15 unsigned long *handle);
16void zbud_free(struct zbud_pool *pool, unsigned long handle);
17int zbud_reclaim_page(struct zbud_pool *pool, unsigned int retries);
18void *zbud_map(struct zbud_pool *pool, unsigned long handle);
19void zbud_unmap(struct zbud_pool *pool, unsigned long handle);
20u64 zbud_get_pool_size(struct zbud_pool *pool);
21
22#endif /* _ZBUD_H_ */
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index adcbb20f6511..d9fa68f26c41 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -26,6 +26,9 @@
26#ifndef NET_9P_TRANSPORT_H 26#ifndef NET_9P_TRANSPORT_H
27#define NET_9P_TRANSPORT_H 27#define NET_9P_TRANSPORT_H
28 28
29#define P9_DEF_MIN_RESVPORT (665U)
30#define P9_DEF_MAX_RESVPORT (1023U)
31
29/** 32/**
30 * struct p9_trans_module - transport module interface 33 * struct p9_trans_module - transport module interface
31 * @list: used to maintain a list of currently available transports 34 * @list: used to maintain a list of currently available transports
@@ -37,6 +40,8 @@
37 * @close: member function to discard a connection on this transport 40 * @close: member function to discard a connection on this transport
38 * @request: member function to issue a request to the transport 41 * @request: member function to issue a request to the transport
39 * @cancel: member function to cancel a request (if it hasn't been sent) 42 * @cancel: member function to cancel a request (if it hasn't been sent)
43 * @cancelled: member function to notify that a cancelled request will not
44 * not receive a reply
40 * 45 *
41 * This is the basic API for a transport module which is registered by the 46 * This is the basic API for a transport module which is registered by the
42 * transport module with the 9P core network module and used by the client 47 * transport module with the 9P core network module and used by the client
@@ -55,6 +60,7 @@ struct p9_trans_module {
55 void (*close) (struct p9_client *); 60 void (*close) (struct p9_client *);
56 int (*request) (struct p9_client *, struct p9_req_t *req); 61 int (*request) (struct p9_client *, struct p9_req_t *req);
57 int (*cancel) (struct p9_client *, struct p9_req_t *req); 62 int (*cancel) (struct p9_client *, struct p9_req_t *req);
63 int (*cancelled)(struct p9_client *, struct p9_req_t *req);
58 int (*zc_request)(struct p9_client *, struct p9_req_t *, 64 int (*zc_request)(struct p9_client *, struct p9_req_t *,
59 char *, char *, int , int, int, int); 65 char *, char *, int , int, int, int);
60}; 66};
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 06ef7e926a66..b8ffac7b6bab 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -18,7 +18,7 @@ struct tcf_common {
18 struct tcf_t tcfc_tm; 18 struct tcf_t tcfc_tm;
19 struct gnet_stats_basic_packed tcfc_bstats; 19 struct gnet_stats_basic_packed tcfc_bstats;
20 struct gnet_stats_queue tcfc_qstats; 20 struct gnet_stats_queue tcfc_qstats;
21 struct gnet_stats_rate_est tcfc_rate_est; 21 struct gnet_stats_rate_est64 tcfc_rate_est;
22 spinlock_t tcfc_lock; 22 spinlock_t tcfc_lock;
23 struct rcu_head tcfc_rcu; 23 struct rcu_head tcfc_rcu;
24}; 24};
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 21f702704f24..c7b181cb47a6 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -86,6 +86,9 @@ extern int ipv6_dev_get_saddr(struct net *net,
86 const struct in6_addr *daddr, 86 const struct in6_addr *daddr,
87 unsigned int srcprefs, 87 unsigned int srcprefs,
88 struct in6_addr *saddr); 88 struct in6_addr *saddr);
89extern int __ipv6_get_lladdr(struct inet6_dev *idev,
90 struct in6_addr *addr,
91 unsigned char banned_flags);
89extern int ipv6_get_lladdr(struct net_device *dev, 92extern int ipv6_get_lladdr(struct net_device *dev,
90 struct in6_addr *addr, 93 struct in6_addr *addr,
91 unsigned char banned_flags); 94 unsigned char banned_flags);
@@ -155,6 +158,7 @@ extern bool ipv6_chk_mcast_addr(struct net_device *dev,
155 const struct in6_addr *group, 158 const struct in6_addr *group,
156 const struct in6_addr *src_addr); 159 const struct in6_addr *src_addr);
157 160
161extern void ipv6_mc_dad_complete(struct inet6_dev *idev);
158/* 162/*
159 * identify MLD packets for MLD filter exceptions 163 * identify MLD packets for MLD filter exceptions
160 */ 164 */
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index e0512aaef4b8..3c592cf473da 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -107,7 +107,6 @@ enum {
107 HCI_MGMT, 107 HCI_MGMT,
108 HCI_PAIRABLE, 108 HCI_PAIRABLE,
109 HCI_SERVICE_CACHE, 109 HCI_SERVICE_CACHE,
110 HCI_LINK_KEYS,
111 HCI_DEBUG_KEYS, 110 HCI_DEBUG_KEYS,
112 HCI_UNREGISTER, 111 HCI_UNREGISTER,
113 112
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 7cb6d360d147..f77885ea78c2 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -117,13 +117,6 @@ struct oob_data {
117 u8 randomizer[16]; 117 u8 randomizer[16];
118}; 118};
119 119
120struct le_scan_params {
121 u8 type;
122 u16 interval;
123 u16 window;
124 int timeout;
125};
126
127#define HCI_MAX_SHORT_NAME_LENGTH 10 120#define HCI_MAX_SHORT_NAME_LENGTH 10
128 121
129struct amp_assoc { 122struct amp_assoc {
@@ -283,9 +276,6 @@ struct hci_dev {
283 276
284 struct delayed_work le_scan_disable; 277 struct delayed_work le_scan_disable;
285 278
286 struct work_struct le_scan;
287 struct le_scan_params le_scan_params;
288
289 __s8 adv_tx_power; 279 __s8 adv_tx_power;
290 __u8 adv_data[HCI_MAX_AD_LENGTH]; 280 __u8 adv_data[HCI_MAX_AD_LENGTH];
291 __u8 adv_data_len; 281 __u8 adv_data_len;
@@ -432,6 +422,7 @@ void hci_inquiry_cache_update_resolve(struct hci_dev *hdev,
432 struct inquiry_entry *ie); 422 struct inquiry_entry *ie);
433bool hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data, 423bool hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data,
434 bool name_known, bool *ssp); 424 bool name_known, bool *ssp);
425void hci_inquiry_cache_flush(struct hci_dev *hdev);
435 426
436/* ----- HCI Connections ----- */ 427/* ----- HCI Connections ----- */
437enum { 428enum {
@@ -1114,6 +1105,16 @@ void hci_sock_dev_event(struct hci_dev *hdev, int event);
1114 BIT(BDADDR_LE_PUBLIC) | \ 1105 BIT(BDADDR_LE_PUBLIC) | \
1115 BIT(BDADDR_LE_RANDOM)) 1106 BIT(BDADDR_LE_RANDOM))
1116 1107
1108/* These LE scan and inquiry parameters were chosen according to LE General
1109 * Discovery Procedure specification.
1110 */
1111#define DISCOV_LE_SCAN_WIN 0x12
1112#define DISCOV_LE_SCAN_INT 0x12
1113#define DISCOV_LE_TIMEOUT msecs_to_jiffies(10240)
1114#define DISCOV_INTERLEAVED_TIMEOUT msecs_to_jiffies(5120)
1115#define DISCOV_INTERLEAVED_INQUIRY_LEN 0x04
1116#define DISCOV_BREDR_INQUIRY_LEN 0x08
1117
1117int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); 1118int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len);
1118int mgmt_index_added(struct hci_dev *hdev); 1119int mgmt_index_added(struct hci_dev *hdev);
1119int mgmt_index_removed(struct hci_dev *hdev); 1120int mgmt_index_removed(struct hci_dev *hdev);
@@ -1169,10 +1170,7 @@ int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
1169 u8 ssp, u8 *eir, u16 eir_len); 1170 u8 ssp, u8 *eir, u16 eir_len);
1170int mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 1171int mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
1171 u8 addr_type, s8 rssi, u8 *name, u8 name_len); 1172 u8 addr_type, s8 rssi, u8 *name, u8 name_len);
1172int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status);
1173int mgmt_stop_discovery_failed(struct hci_dev *hdev, u8 status);
1174int mgmt_discovering(struct hci_dev *hdev, u8 discovering); 1173int mgmt_discovering(struct hci_dev *hdev, u8 discovering);
1175int mgmt_interleaved_discovery(struct hci_dev *hdev);
1176int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); 1174int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
1177int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); 1175int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type);
1178bool mgmt_valid_hdev(struct hci_dev *hdev); 1176bool mgmt_valid_hdev(struct hci_dev *hdev);
@@ -1212,11 +1210,6 @@ void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
1212 u16 latency, u16 to_multiplier); 1210 u16 latency, u16 to_multiplier);
1213void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8], 1211void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],
1214 __u8 ltk[16]); 1212 __u8 ltk[16]);
1215int hci_do_inquiry(struct hci_dev *hdev, u8 length);
1216int hci_cancel_inquiry(struct hci_dev *hdev);
1217int hci_le_scan(struct hci_dev *hdev, u8 type, u16 interval, u16 window,
1218 int timeout);
1219int hci_cancel_le_scan(struct hci_dev *hdev);
1220 1213
1221u8 bdaddr_to_le(u8 bdaddr_type); 1214u8 bdaddr_to_le(u8 bdaddr_type);
1222 1215
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index fb94cf13c777..1a966afbbfa8 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -242,7 +242,7 @@ struct l2cap_conn_rsp {
242#define L2CAP_CID_SIGNALING 0x0001 242#define L2CAP_CID_SIGNALING 0x0001
243#define L2CAP_CID_CONN_LESS 0x0002 243#define L2CAP_CID_CONN_LESS 0x0002
244#define L2CAP_CID_A2MP 0x0003 244#define L2CAP_CID_A2MP 0x0003
245#define L2CAP_CID_LE_DATA 0x0004 245#define L2CAP_CID_ATT 0x0004
246#define L2CAP_CID_LE_SIGNALING 0x0005 246#define L2CAP_CID_LE_SIGNALING 0x0005
247#define L2CAP_CID_SMP 0x0006 247#define L2CAP_CID_SMP 0x0006
248#define L2CAP_CID_DYN_START 0x0040 248#define L2CAP_CID_DYN_START 0x0040
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 26b5b692c22b..7b0730aeb892 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -188,6 +188,8 @@ struct ieee80211_channel {
188 * when used with 802.11g (on the 2.4 GHz band); filled by the 188 * when used with 802.11g (on the 2.4 GHz band); filled by the
189 * core code when registering the wiphy. 189 * core code when registering the wiphy.
190 * @IEEE80211_RATE_ERP_G: This is an ERP rate in 802.11g mode. 190 * @IEEE80211_RATE_ERP_G: This is an ERP rate in 802.11g mode.
191 * @IEEE80211_RATE_SUPPORTS_5MHZ: Rate can be used in 5 MHz mode
192 * @IEEE80211_RATE_SUPPORTS_10MHZ: Rate can be used in 10 MHz mode
191 */ 193 */
192enum ieee80211_rate_flags { 194enum ieee80211_rate_flags {
193 IEEE80211_RATE_SHORT_PREAMBLE = 1<<0, 195 IEEE80211_RATE_SHORT_PREAMBLE = 1<<0,
@@ -195,6 +197,8 @@ enum ieee80211_rate_flags {
195 IEEE80211_RATE_MANDATORY_B = 1<<2, 197 IEEE80211_RATE_MANDATORY_B = 1<<2,
196 IEEE80211_RATE_MANDATORY_G = 1<<3, 198 IEEE80211_RATE_MANDATORY_G = 1<<3,
197 IEEE80211_RATE_ERP_G = 1<<4, 199 IEEE80211_RATE_ERP_G = 1<<4,
200 IEEE80211_RATE_SUPPORTS_5MHZ = 1<<5,
201 IEEE80211_RATE_SUPPORTS_10MHZ = 1<<6,
198}; 202};
199 203
200/** 204/**
@@ -433,6 +437,30 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
433 u32 prohibited_flags); 437 u32 prohibited_flags);
434 438
435/** 439/**
440 * ieee80211_chandef_rate_flags - returns rate flags for a channel
441 *
442 * In some channel types, not all rates may be used - for example CCK
443 * rates may not be used in 5/10 MHz channels.
444 *
445 * @chandef: channel definition for the channel
446 *
447 * Returns: rate flags which apply for this channel
448 */
449static inline enum ieee80211_rate_flags
450ieee80211_chandef_rate_flags(struct cfg80211_chan_def *chandef)
451{
452 switch (chandef->width) {
453 case NL80211_CHAN_WIDTH_5:
454 return IEEE80211_RATE_SUPPORTS_5MHZ;
455 case NL80211_CHAN_WIDTH_10:
456 return IEEE80211_RATE_SUPPORTS_10MHZ;
457 default:
458 break;
459 }
460 return 0;
461}
462
463/**
436 * enum survey_info_flags - survey information flags 464 * enum survey_info_flags - survey information flags
437 * 465 *
438 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in 466 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in
@@ -753,6 +781,8 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
753 * @STATION_INFO_LOCAL_PM: @local_pm filled 781 * @STATION_INFO_LOCAL_PM: @local_pm filled
754 * @STATION_INFO_PEER_PM: @peer_pm filled 782 * @STATION_INFO_PEER_PM: @peer_pm filled
755 * @STATION_INFO_NONPEER_PM: @nonpeer_pm filled 783 * @STATION_INFO_NONPEER_PM: @nonpeer_pm filled
784 * @STATION_INFO_CHAIN_SIGNAL: @chain_signal filled
785 * @STATION_INFO_CHAIN_SIGNAL_AVG: @chain_signal_avg filled
756 */ 786 */
757enum station_info_flags { 787enum station_info_flags {
758 STATION_INFO_INACTIVE_TIME = 1<<0, 788 STATION_INFO_INACTIVE_TIME = 1<<0,
@@ -781,6 +811,8 @@ enum station_info_flags {
781 STATION_INFO_NONPEER_PM = 1<<23, 811 STATION_INFO_NONPEER_PM = 1<<23,
782 STATION_INFO_RX_BYTES64 = 1<<24, 812 STATION_INFO_RX_BYTES64 = 1<<24,
783 STATION_INFO_TX_BYTES64 = 1<<25, 813 STATION_INFO_TX_BYTES64 = 1<<25,
814 STATION_INFO_CHAIN_SIGNAL = 1<<26,
815 STATION_INFO_CHAIN_SIGNAL_AVG = 1<<27,
784}; 816};
785 817
786/** 818/**
@@ -857,6 +889,8 @@ struct sta_bss_parameters {
857 u16 beacon_interval; 889 u16 beacon_interval;
858}; 890};
859 891
892#define IEEE80211_MAX_CHAINS 4
893
860/** 894/**
861 * struct station_info - station information 895 * struct station_info - station information
862 * 896 *
@@ -874,6 +908,9 @@ struct sta_bss_parameters {
874 * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. 908 * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
875 * @signal_avg: Average signal strength, type depends on the wiphy's signal_type. 909 * @signal_avg: Average signal strength, type depends on the wiphy's signal_type.
876 * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_. 910 * For CFG80211_SIGNAL_TYPE_MBM, value is expressed in _dBm_.
911 * @chains: bitmask for filled values in @chain_signal, @chain_signal_avg
912 * @chain_signal: per-chain signal strength of last received packet in dBm
913 * @chain_signal_avg: per-chain signal strength average in dBm
877 * @txrate: current unicast bitrate from this station 914 * @txrate: current unicast bitrate from this station
878 * @rxrate: current unicast bitrate to this station 915 * @rxrate: current unicast bitrate to this station
879 * @rx_packets: packets received from this station 916 * @rx_packets: packets received from this station
@@ -909,6 +946,11 @@ struct station_info {
909 u8 plink_state; 946 u8 plink_state;
910 s8 signal; 947 s8 signal;
911 s8 signal_avg; 948 s8 signal_avg;
949
950 u8 chains;
951 s8 chain_signal[IEEE80211_MAX_CHAINS];
952 s8 chain_signal_avg[IEEE80211_MAX_CHAINS];
953
912 struct rate_info txrate; 954 struct rate_info txrate;
913 struct rate_info rxrate; 955 struct rate_info rxrate;
914 u32 rx_packets; 956 u32 rx_packets;
@@ -947,6 +989,7 @@ struct station_info {
947 * @MONITOR_FLAG_CONTROL: pass control frames 989 * @MONITOR_FLAG_CONTROL: pass control frames
948 * @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering 990 * @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering
949 * @MONITOR_FLAG_COOK_FRAMES: report frames after processing 991 * @MONITOR_FLAG_COOK_FRAMES: report frames after processing
992 * @MONITOR_FLAG_ACTIVE: active monitor, ACKs frames on its MAC address
950 */ 993 */
951enum monitor_flags { 994enum monitor_flags {
952 MONITOR_FLAG_FCSFAIL = 1<<NL80211_MNTR_FLAG_FCSFAIL, 995 MONITOR_FLAG_FCSFAIL = 1<<NL80211_MNTR_FLAG_FCSFAIL,
@@ -954,6 +997,7 @@ enum monitor_flags {
954 MONITOR_FLAG_CONTROL = 1<<NL80211_MNTR_FLAG_CONTROL, 997 MONITOR_FLAG_CONTROL = 1<<NL80211_MNTR_FLAG_CONTROL,
955 MONITOR_FLAG_OTHER_BSS = 1<<NL80211_MNTR_FLAG_OTHER_BSS, 998 MONITOR_FLAG_OTHER_BSS = 1<<NL80211_MNTR_FLAG_OTHER_BSS,
956 MONITOR_FLAG_COOK_FRAMES = 1<<NL80211_MNTR_FLAG_COOK_FRAMES, 999 MONITOR_FLAG_COOK_FRAMES = 1<<NL80211_MNTR_FLAG_COOK_FRAMES,
1000 MONITOR_FLAG_ACTIVE = 1<<NL80211_MNTR_FLAG_ACTIVE,
957}; 1001};
958 1002
959/** 1003/**
@@ -1108,6 +1152,9 @@ struct bss_parameters {
1108 * setting for new peer links. 1152 * setting for new peer links.
1109 * @dot11MeshAwakeWindowDuration: The duration in TUs the STA will remain awake 1153 * @dot11MeshAwakeWindowDuration: The duration in TUs the STA will remain awake
1110 * after transmitting its beacon. 1154 * after transmitting its beacon.
1155 * @plink_timeout: If no tx activity is seen from a STA we've established
1156 * peering with for longer than this time (in seconds), then remove it
1157 * from the STA's list of peers. Default is 30 minutes.
1111 */ 1158 */
1112struct mesh_config { 1159struct mesh_config {
1113 u16 dot11MeshRetryTimeout; 1160 u16 dot11MeshRetryTimeout;
@@ -1137,6 +1184,7 @@ struct mesh_config {
1137 u16 dot11MeshHWMPconfirmationInterval; 1184 u16 dot11MeshHWMPconfirmationInterval;
1138 enum nl80211_mesh_power_mode power_mode; 1185 enum nl80211_mesh_power_mode power_mode;
1139 u16 dot11MeshAwakeWindowDuration; 1186 u16 dot11MeshAwakeWindowDuration;
1187 u32 plink_timeout;
1140}; 1188};
1141 1189
1142/** 1190/**
@@ -1147,6 +1195,7 @@ struct mesh_config {
1147 * @sync_method: which synchronization method to use 1195 * @sync_method: which synchronization method to use
1148 * @path_sel_proto: which path selection protocol to use 1196 * @path_sel_proto: which path selection protocol to use
1149 * @path_metric: which metric to use 1197 * @path_metric: which metric to use
1198 * @auth_id: which authentication method this mesh is using
1150 * @ie: vendor information elements (optional) 1199 * @ie: vendor information elements (optional)
1151 * @ie_len: length of vendor information elements 1200 * @ie_len: length of vendor information elements
1152 * @is_authenticated: this mesh requires authentication 1201 * @is_authenticated: this mesh requires authentication
@@ -1155,6 +1204,7 @@ struct mesh_config {
1155 * @dtim_period: DTIM period to use 1204 * @dtim_period: DTIM period to use
1156 * @beacon_interval: beacon interval to use 1205 * @beacon_interval: beacon interval to use
1157 * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a] 1206 * @mcast_rate: multicat rate for Mesh Node [6Mbps is the default for 802.11a]
1207 * @basic_rates: basic rates to use when creating the mesh
1158 * 1208 *
1159 * These parameters are fixed when the mesh is created. 1209 * These parameters are fixed when the mesh is created.
1160 */ 1210 */
@@ -1165,6 +1215,7 @@ struct mesh_setup {
1165 u8 sync_method; 1215 u8 sync_method;
1166 u8 path_sel_proto; 1216 u8 path_sel_proto;
1167 u8 path_metric; 1217 u8 path_metric;
1218 u8 auth_id;
1168 const u8 *ie; 1219 const u8 *ie;
1169 u8 ie_len; 1220 u8 ie_len;
1170 bool is_authenticated; 1221 bool is_authenticated;
@@ -1173,6 +1224,7 @@ struct mesh_setup {
1173 u8 dtim_period; 1224 u8 dtim_period;
1174 u16 beacon_interval; 1225 u16 beacon_interval;
1175 int mcast_rate[IEEE80211_NUM_BANDS]; 1226 int mcast_rate[IEEE80211_NUM_BANDS];
1227 u32 basic_rates;
1176}; 1228};
1177 1229
1178/** 1230/**
@@ -1241,6 +1293,7 @@ struct cfg80211_ssid {
1241 * @scan_start: time (in jiffies) when the scan started 1293 * @scan_start: time (in jiffies) when the scan started
1242 * @wdev: the wireless device to scan for 1294 * @wdev: the wireless device to scan for
1243 * @aborted: (internal) scan request was notified as aborted 1295 * @aborted: (internal) scan request was notified as aborted
1296 * @notified: (internal) scan request was notified as done or aborted
1244 * @no_cck: used to send probe requests at non CCK rate in 2GHz band 1297 * @no_cck: used to send probe requests at non CCK rate in 2GHz band
1245 */ 1298 */
1246struct cfg80211_scan_request { 1299struct cfg80211_scan_request {
@@ -1258,7 +1311,7 @@ struct cfg80211_scan_request {
1258 /* internal */ 1311 /* internal */
1259 struct wiphy *wiphy; 1312 struct wiphy *wiphy;
1260 unsigned long scan_start; 1313 unsigned long scan_start;
1261 bool aborted; 1314 bool aborted, notified;
1262 bool no_cck; 1315 bool no_cck;
1263 1316
1264 /* keep last */ 1317 /* keep last */
@@ -1406,7 +1459,8 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
1406 * This structure provides information needed to complete IEEE 802.11 1459 * This structure provides information needed to complete IEEE 802.11
1407 * authentication. 1460 * authentication.
1408 * 1461 *
1409 * @bss: The BSS to authenticate with. 1462 * @bss: The BSS to authenticate with, the callee must obtain a reference
1463 * to it if it needs to keep it.
1410 * @auth_type: Authentication type (algorithm) 1464 * @auth_type: Authentication type (algorithm)
1411 * @ie: Extra IEs to add to Authentication frame or %NULL 1465 * @ie: Extra IEs to add to Authentication frame or %NULL
1412 * @ie_len: Length of ie buffer in octets 1466 * @ie_len: Length of ie buffer in octets
@@ -1444,11 +1498,10 @@ enum cfg80211_assoc_req_flags {
1444 * 1498 *
1445 * This structure provides information needed to complete IEEE 802.11 1499 * This structure provides information needed to complete IEEE 802.11
1446 * (re)association. 1500 * (re)association.
1447 * @bss: The BSS to associate with. If the call is successful the driver 1501 * @bss: The BSS to associate with. If the call is successful the driver is
1448 * is given a reference that it must release, normally via a call to 1502 * given a reference that it must give back to cfg80211_send_rx_assoc()
1449 * cfg80211_send_rx_assoc(), or, if association timed out, with a 1503 * or to cfg80211_assoc_timeout(). To ensure proper refcounting, new
1450 * call to cfg80211_put_bss() (in addition to calling 1504 * association requests while already associating must be rejected.
1451 * cfg80211_send_assoc_timeout())
1452 * @ie: Extra IEs to add to (Re)Association Request frame or %NULL 1505 * @ie: Extra IEs to add to (Re)Association Request frame or %NULL
1453 * @ie_len: Length of ie buffer in octets 1506 * @ie_len: Length of ie buffer in octets
1454 * @use_mfp: Use management frame protection (IEEE 802.11w) in this association 1507 * @use_mfp: Use management frame protection (IEEE 802.11w) in this association
@@ -1850,7 +1903,9 @@ struct cfg80211_update_ft_ies_params {
1850 * @get_mpath: get a mesh path for the given parameters 1903 * @get_mpath: get a mesh path for the given parameters
1851 * @dump_mpath: dump mesh path callback -- resume dump at index @idx 1904 * @dump_mpath: dump mesh path callback -- resume dump at index @idx
1852 * @join_mesh: join the mesh network with the specified parameters 1905 * @join_mesh: join the mesh network with the specified parameters
1906 * (invoked with the wireless_dev mutex held)
1853 * @leave_mesh: leave the current mesh network 1907 * @leave_mesh: leave the current mesh network
1908 * (invoked with the wireless_dev mutex held)
1854 * 1909 *
1855 * @get_mesh_config: Get the current mesh configuration 1910 * @get_mesh_config: Get the current mesh configuration
1856 * 1911 *
@@ -1877,20 +1932,28 @@ struct cfg80211_update_ft_ies_params {
1877 * the scan/scan_done bracket too. 1932 * the scan/scan_done bracket too.
1878 * 1933 *
1879 * @auth: Request to authenticate with the specified peer 1934 * @auth: Request to authenticate with the specified peer
1935 * (invoked with the wireless_dev mutex held)
1880 * @assoc: Request to (re)associate with the specified peer 1936 * @assoc: Request to (re)associate with the specified peer
1937 * (invoked with the wireless_dev mutex held)
1881 * @deauth: Request to deauthenticate from the specified peer 1938 * @deauth: Request to deauthenticate from the specified peer
1939 * (invoked with the wireless_dev mutex held)
1882 * @disassoc: Request to disassociate from the specified peer 1940 * @disassoc: Request to disassociate from the specified peer
1941 * (invoked with the wireless_dev mutex held)
1883 * 1942 *
1884 * @connect: Connect to the ESS with the specified parameters. When connected, 1943 * @connect: Connect to the ESS with the specified parameters. When connected,
1885 * call cfg80211_connect_result() with status code %WLAN_STATUS_SUCCESS. 1944 * call cfg80211_connect_result() with status code %WLAN_STATUS_SUCCESS.
1886 * If the connection fails for some reason, call cfg80211_connect_result() 1945 * If the connection fails for some reason, call cfg80211_connect_result()
1887 * with the status from the AP. 1946 * with the status from the AP.
1947 * (invoked with the wireless_dev mutex held)
1888 * @disconnect: Disconnect from the BSS/ESS. 1948 * @disconnect: Disconnect from the BSS/ESS.
1949 * (invoked with the wireless_dev mutex held)
1889 * 1950 *
1890 * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call 1951 * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call
1891 * cfg80211_ibss_joined(), also call that function when changing BSSID due 1952 * cfg80211_ibss_joined(), also call that function when changing BSSID due
1892 * to a merge. 1953 * to a merge.
1954 * (invoked with the wireless_dev mutex held)
1893 * @leave_ibss: Leave the IBSS. 1955 * @leave_ibss: Leave the IBSS.
1956 * (invoked with the wireless_dev mutex held)
1894 * 1957 *
1895 * @set_mcast_rate: Set the specified multicast rate (only if vif is in ADHOC or 1958 * @set_mcast_rate: Set the specified multicast rate (only if vif is in ADHOC or
1896 * MESH mode) 1959 * MESH mode)
@@ -2307,6 +2370,7 @@ struct cfg80211_ops {
2307 * responds to probe-requests in hardware. 2370 * responds to probe-requests in hardware.
2308 * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX. 2371 * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX.
2309 * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call. 2372 * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call.
2373 * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels.
2310 */ 2374 */
2311enum wiphy_flags { 2375enum wiphy_flags {
2312 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 2376 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -2330,6 +2394,7 @@ enum wiphy_flags {
2330 WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD = BIT(19), 2394 WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD = BIT(19),
2331 WIPHY_FLAG_OFFCHAN_TX = BIT(20), 2395 WIPHY_FLAG_OFFCHAN_TX = BIT(20),
2332 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21), 2396 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21),
2397 WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22),
2333}; 2398};
2334 2399
2335/** 2400/**
@@ -2556,6 +2621,9 @@ struct wiphy_wowlan_support {
2556 * may request, if implemented. 2621 * may request, if implemented.
2557 * 2622 *
2558 * @wowlan: WoWLAN support information 2623 * @wowlan: WoWLAN support information
2624 * @wowlan_config: current WoWLAN configuration; this should usually not be
2625 * used since access to it is necessarily racy, use the parameter passed
2626 * to the suspend() operation instead.
2559 * 2627 *
2560 * @ap_sme_capa: AP SME capabilities, flags from &enum nl80211_ap_sme_features. 2628 * @ap_sme_capa: AP SME capabilities, flags from &enum nl80211_ap_sme_features.
2561 * @ht_capa_mod_mask: Specify what ht_cap values can be over-ridden. 2629 * @ht_capa_mod_mask: Specify what ht_cap values can be over-ridden.
@@ -2622,7 +2690,8 @@ struct wiphy {
2622 u32 hw_version; 2690 u32 hw_version;
2623 2691
2624#ifdef CONFIG_PM 2692#ifdef CONFIG_PM
2625 struct wiphy_wowlan_support wowlan; 2693 const struct wiphy_wowlan_support *wowlan;
2694 struct cfg80211_wowlan *wowlan_config;
2626#endif 2695#endif
2627 2696
2628 u16 max_remain_on_channel_duration; 2697 u16 max_remain_on_channel_duration;
@@ -2820,7 +2889,7 @@ struct cfg80211_cached_keys;
2820 * @current_bss: (private) Used by the internal configuration code 2889 * @current_bss: (private) Used by the internal configuration code
2821 * @channel: (private) Used by the internal configuration code to track 2890 * @channel: (private) Used by the internal configuration code to track
2822 * the user-set AP, monitor and WDS channel 2891 * the user-set AP, monitor and WDS channel
2823 * @preset_chan: (private) Used by the internal configuration code to 2892 * @preset_chandef: (private) Used by the internal configuration code to
2824 * track the channel to be used for AP later 2893 * track the channel to be used for AP later
2825 * @bssid: (private) Used by the internal configuration code 2894 * @bssid: (private) Used by the internal configuration code
2826 * @ssid: (private) Used by the internal configuration code 2895 * @ssid: (private) Used by the internal configuration code
@@ -2834,14 +2903,23 @@ struct cfg80211_cached_keys;
2834 * by cfg80211 on change_interface 2903 * by cfg80211 on change_interface
2835 * @mgmt_registrations: list of registrations for management frames 2904 * @mgmt_registrations: list of registrations for management frames
2836 * @mgmt_registrations_lock: lock for the list 2905 * @mgmt_registrations_lock: lock for the list
2837 * @mtx: mutex used to lock data in this struct 2906 * @mtx: mutex used to lock data in this struct, may be used by drivers
2838 * @cleanup_work: work struct used for cleanup that can't be done directly 2907 * and some API functions require it held
2839 * @beacon_interval: beacon interval used on this device for transmitting 2908 * @beacon_interval: beacon interval used on this device for transmitting
2840 * beacons, 0 when not valid 2909 * beacons, 0 when not valid
2841 * @address: The address for this device, valid only if @netdev is %NULL 2910 * @address: The address for this device, valid only if @netdev is %NULL
2842 * @p2p_started: true if this is a P2P Device that has been started 2911 * @p2p_started: true if this is a P2P Device that has been started
2843 * @cac_started: true if DFS channel availability check has been started 2912 * @cac_started: true if DFS channel availability check has been started
2844 * @cac_start_time: timestamp (jiffies) when the dfs state was entered. 2913 * @cac_start_time: timestamp (jiffies) when the dfs state was entered.
2914 * @ps: powersave mode is enabled
2915 * @ps_timeout: dynamic powersave timeout
2916 * @ap_unexpected_nlportid: (private) netlink port ID of application
2917 * registered for unexpected class 3 frames (AP mode)
2918 * @conn: (private) cfg80211 software SME connection state machine data
2919 * @connect_keys: (private) keys to set after connection is established
2920 * @ibss_fixed: (private) IBSS is using fixed BSSID
2921 * @event_list: (private) list for internal event processing
2922 * @event_lock: (private) lock for event list
2845 */ 2923 */
2846struct wireless_dev { 2924struct wireless_dev {
2847 struct wiphy *wiphy; 2925 struct wiphy *wiphy;
@@ -2858,8 +2936,6 @@ struct wireless_dev {
2858 2936
2859 struct mutex mtx; 2937 struct mutex mtx;
2860 2938
2861 struct work_struct cleanup_work;
2862
2863 bool use_4addr, p2p_started; 2939 bool use_4addr, p2p_started;
2864 2940
2865 u8 address[ETH_ALEN] __aligned(sizeof(u16)); 2941 u8 address[ETH_ALEN] __aligned(sizeof(u16));
@@ -2867,11 +2943,6 @@ struct wireless_dev {
2867 /* currently used for IBSS and SME - might be rearranged later */ 2943 /* currently used for IBSS and SME - might be rearranged later */
2868 u8 ssid[IEEE80211_MAX_SSID_LEN]; 2944 u8 ssid[IEEE80211_MAX_SSID_LEN];
2869 u8 ssid_len, mesh_id_len, mesh_id_up_len; 2945 u8 ssid_len, mesh_id_len, mesh_id_up_len;
2870 enum {
2871 CFG80211_SME_IDLE,
2872 CFG80211_SME_CONNECTING,
2873 CFG80211_SME_CONNECTED,
2874 } sme_state;
2875 struct cfg80211_conn *conn; 2946 struct cfg80211_conn *conn;
2876 struct cfg80211_cached_keys *connect_keys; 2947 struct cfg80211_cached_keys *connect_keys;
2877 2948
@@ -2989,6 +3060,15 @@ struct ieee80211_rate *
2989ieee80211_get_response_rate(struct ieee80211_supported_band *sband, 3060ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
2990 u32 basic_rates, int bitrate); 3061 u32 basic_rates, int bitrate);
2991 3062
3063/**
3064 * ieee80211_mandatory_rates - get mandatory rates for a given band
3065 * @sband: the band to look for rates in
3066 *
3067 * This function returns a bitmap of the mandatory rates for the given
3068 * band, bits are set according to the rate position in the bitrates array.
3069 */
3070u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband);
3071
2992/* 3072/*
2993 * Radiotap parsing functions -- for controlled injection support 3073 * Radiotap parsing functions -- for controlled injection support
2994 * 3074 *
@@ -3392,122 +3472,87 @@ void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3392void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); 3472void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3393 3473
3394/** 3474/**
3395 * cfg80211_send_rx_auth - notification of processed authentication 3475 * cfg80211_rx_mlme_mgmt - notification of processed MLME management frame
3396 * @dev: network device 3476 * @dev: network device
3397 * @buf: authentication frame (header + body) 3477 * @buf: authentication frame (header + body)
3398 * @len: length of the frame data 3478 * @len: length of the frame data
3399 * 3479 *
3400 * This function is called whenever an authentication has been processed in 3480 * This function is called whenever an authentication, disassociation or
3401 * station mode. The driver is required to call either this function or 3481 * deauthentication frame has been received and processed in station mode.
3402 * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth() 3482 * After being asked to authenticate via cfg80211_ops::auth() the driver must
3403 * call. This function may sleep. 3483 * call either this function or cfg80211_auth_timeout().
3484 * After being asked to associate via cfg80211_ops::assoc() the driver must
3485 * call either this function or cfg80211_auth_timeout().
3486 * While connected, the driver must calls this for received and processed
3487 * disassociation and deauthentication frames. If the frame couldn't be used
3488 * because it was unprotected, the driver must call the function
3489 * cfg80211_rx_unprot_mlme_mgmt() instead.
3490 *
3491 * This function may sleep. The caller must hold the corresponding wdev's mutex.
3404 */ 3492 */
3405void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); 3493void cfg80211_rx_mlme_mgmt(struct net_device *dev, const u8 *buf, size_t len);
3406 3494
3407/** 3495/**
3408 * cfg80211_send_auth_timeout - notification of timed out authentication 3496 * cfg80211_auth_timeout - notification of timed out authentication
3409 * @dev: network device 3497 * @dev: network device
3410 * @addr: The MAC address of the device with which the authentication timed out 3498 * @addr: The MAC address of the device with which the authentication timed out
3411 * 3499 *
3412 * This function may sleep. 3500 * This function may sleep. The caller must hold the corresponding wdev's
3501 * mutex.
3413 */ 3502 */
3414void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); 3503void cfg80211_auth_timeout(struct net_device *dev, const u8 *addr);
3415 3504
3416/** 3505/**
3417 * cfg80211_send_rx_assoc - notification of processed association 3506 * cfg80211_rx_assoc_resp - notification of processed association response
3418 * @dev: network device 3507 * @dev: network device
3419 * @bss: the BSS struct association was requested for, the struct reference 3508 * @bss: the BSS that association was requested with, ownership of the pointer
3420 * is owned by cfg80211 after this call 3509 * moves to cfg80211 in this call
3421 * @buf: (re)association response frame (header + body) 3510 * @buf: authentication frame (header + body)
3422 * @len: length of the frame data 3511 * @len: length of the frame data
3423 * 3512 *
3424 * This function is called whenever a (re)association response has been 3513 * After being asked to associate via cfg80211_ops::assoc() the driver must
3425 * processed in station mode. The driver is required to call either this 3514 * call either this function or cfg80211_auth_timeout().
3426 * function or cfg80211_send_assoc_timeout() to indicate the result of 3515 *
3427 * cfg80211_ops::assoc() call. This function may sleep. 3516 * This function may sleep. The caller must hold the corresponding wdev's mutex.
3428 */ 3517 */
3429void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss, 3518void cfg80211_rx_assoc_resp(struct net_device *dev,
3519 struct cfg80211_bss *bss,
3430 const u8 *buf, size_t len); 3520 const u8 *buf, size_t len);
3431 3521
3432/** 3522/**
3433 * cfg80211_send_assoc_timeout - notification of timed out association 3523 * cfg80211_assoc_timeout - notification of timed out association
3434 * @dev: network device 3524 * @dev: network device
3435 * @addr: The MAC address of the device with which the association timed out 3525 * @bss: The BSS entry with which association timed out.
3436 * 3526 *
3437 * This function may sleep. 3527 * This function may sleep. The caller must hold the corresponding wdev's mutex.
3438 */ 3528 */
3439void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); 3529void cfg80211_assoc_timeout(struct net_device *dev, struct cfg80211_bss *bss);
3440 3530
3441/** 3531/**
3442 * cfg80211_send_deauth - notification of processed deauthentication 3532 * cfg80211_tx_mlme_mgmt - notification of transmitted deauth/disassoc frame
3443 * @dev: network device 3533 * @dev: network device
3444 * @buf: deauthentication frame (header + body) 3534 * @buf: 802.11 frame (header + body)
3445 * @len: length of the frame data 3535 * @len: length of the frame data
3446 * 3536 *
3447 * This function is called whenever deauthentication has been processed in 3537 * This function is called whenever deauthentication has been processed in
3448 * station mode. This includes both received deauthentication frames and 3538 * station mode. This includes both received deauthentication frames and
3449 * locally generated ones. This function may sleep. 3539 * locally generated ones. This function may sleep. The caller must hold the
3450 */ 3540 * corresponding wdev's mutex.
3451void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
3452
3453/**
3454 * __cfg80211_send_deauth - notification of processed deauthentication
3455 * @dev: network device
3456 * @buf: deauthentication frame (header + body)
3457 * @len: length of the frame data
3458 *
3459 * Like cfg80211_send_deauth(), but doesn't take the wdev lock.
3460 */
3461void __cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len);
3462
3463/**
3464 * cfg80211_send_disassoc - notification of processed disassociation
3465 * @dev: network device
3466 * @buf: disassociation response frame (header + body)
3467 * @len: length of the frame data
3468 *
3469 * This function is called whenever disassociation has been processed in
3470 * station mode. This includes both received disassociation frames and locally
3471 * generated ones. This function may sleep.
3472 */
3473void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len);
3474
3475/**
3476 * __cfg80211_send_disassoc - notification of processed disassociation
3477 * @dev: network device
3478 * @buf: disassociation response frame (header + body)
3479 * @len: length of the frame data
3480 *
3481 * Like cfg80211_send_disassoc(), but doesn't take the wdev lock.
3482 */ 3541 */
3483void __cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, 3542void cfg80211_tx_mlme_mgmt(struct net_device *dev, const u8 *buf, size_t len);
3484 size_t len);
3485 3543
3486/** 3544/**
3487 * cfg80211_send_unprot_deauth - notification of unprotected deauthentication 3545 * cfg80211_rx_unprot_mlme_mgmt - notification of unprotected mlme mgmt frame
3488 * @dev: network device 3546 * @dev: network device
3489 * @buf: deauthentication frame (header + body) 3547 * @buf: deauthentication frame (header + body)
3490 * @len: length of the frame data 3548 * @len: length of the frame data
3491 * 3549 *
3492 * This function is called whenever a received Deauthentication frame has been 3550 * This function is called whenever a received deauthentication or dissassoc
3493 * dropped in station mode because of MFP being used but the Deauthentication 3551 * frame has been dropped in station mode because of MFP being used but the
3494 * frame was not protected. This function may sleep. 3552 * frame was not protected. This function may sleep.
3495 */ 3553 */
3496void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf, 3554void cfg80211_rx_unprot_mlme_mgmt(struct net_device *dev,
3497 size_t len); 3555 const u8 *buf, size_t len);
3498
3499/**
3500 * cfg80211_send_unprot_disassoc - notification of unprotected disassociation
3501 * @dev: network device
3502 * @buf: disassociation frame (header + body)
3503 * @len: length of the frame data
3504 *
3505 * This function is called whenever a received Disassociation frame has been
3506 * dropped in station mode because of MFP being used but the Disassociation
3507 * frame was not protected. This function may sleep.
3508 */
3509void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf,
3510 size_t len);
3511 3556
3512/** 3557/**
3513 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) 3558 * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP)
@@ -4153,6 +4198,7 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
4153 * cfg80211_crit_proto_stopped() - indicate critical protocol stopped by driver. 4198 * cfg80211_crit_proto_stopped() - indicate critical protocol stopped by driver.
4154 * 4199 *
4155 * @wdev: the wireless device for which critical protocol is stopped. 4200 * @wdev: the wireless device for which critical protocol is stopped.
4201 * @gfp: allocation flags
4156 * 4202 *
4157 * This function can be called by the driver to indicate it has reverted 4203 * This function can be called by the driver to indicate it has reverted
4158 * operation back to normal. One reason could be that the duration given 4204 * operation back to normal. One reason could be that the duration given
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h
index a79b6cfb02a8..cf8439ba4d11 100644
--- a/include/net/gen_stats.h
+++ b/include/net/gen_stats.h
@@ -30,7 +30,7 @@ extern int gnet_stats_copy_basic(struct gnet_dump *d,
30 struct gnet_stats_basic_packed *b); 30 struct gnet_stats_basic_packed *b);
31extern int gnet_stats_copy_rate_est(struct gnet_dump *d, 31extern int gnet_stats_copy_rate_est(struct gnet_dump *d,
32 const struct gnet_stats_basic_packed *b, 32 const struct gnet_stats_basic_packed *b,
33 struct gnet_stats_rate_est *r); 33 struct gnet_stats_rate_est64 *r);
34extern int gnet_stats_copy_queue(struct gnet_dump *d, 34extern int gnet_stats_copy_queue(struct gnet_dump *d,
35 struct gnet_stats_queue *q); 35 struct gnet_stats_queue *q);
36extern int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len); 36extern int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len);
@@ -38,13 +38,13 @@ extern int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len);
38extern int gnet_stats_finish_copy(struct gnet_dump *d); 38extern int gnet_stats_finish_copy(struct gnet_dump *d);
39 39
40extern int gen_new_estimator(struct gnet_stats_basic_packed *bstats, 40extern int gen_new_estimator(struct gnet_stats_basic_packed *bstats,
41 struct gnet_stats_rate_est *rate_est, 41 struct gnet_stats_rate_est64 *rate_est,
42 spinlock_t *stats_lock, struct nlattr *opt); 42 spinlock_t *stats_lock, struct nlattr *opt);
43extern void gen_kill_estimator(struct gnet_stats_basic_packed *bstats, 43extern void gen_kill_estimator(struct gnet_stats_basic_packed *bstats,
44 struct gnet_stats_rate_est *rate_est); 44 struct gnet_stats_rate_est64 *rate_est);
45extern int gen_replace_estimator(struct gnet_stats_basic_packed *bstats, 45extern int gen_replace_estimator(struct gnet_stats_basic_packed *bstats,
46 struct gnet_stats_rate_est *rate_est, 46 struct gnet_stats_rate_est64 *rate_est,
47 spinlock_t *stats_lock, struct nlattr *opt); 47 spinlock_t *stats_lock, struct nlattr *opt);
48extern bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats, 48extern bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats,
49 const struct gnet_stats_rate_est *rate_est); 49 const struct gnet_stats_rate_est64 *rate_est);
50#endif 50#endif
diff --git a/include/net/gre.h b/include/net/gre.h
index 9f03a390c826..57e4afdf7879 100644
--- a/include/net/gre.h
+++ b/include/net/gre.h
@@ -7,6 +7,7 @@
7#define GREPROTO_CISCO 0 7#define GREPROTO_CISCO 0
8#define GREPROTO_PPTP 1 8#define GREPROTO_PPTP 1
9#define GREPROTO_MAX 2 9#define GREPROTO_MAX 2
10#define GRE_IP_PROTO_MAX 2
10 11
11struct gre_protocol { 12struct gre_protocol {
12 int (*handler)(struct sk_buff *skb); 13 int (*handler)(struct sk_buff *skb);
@@ -22,6 +23,36 @@ struct gre_base_hdr {
22int gre_add_protocol(const struct gre_protocol *proto, u8 version); 23int gre_add_protocol(const struct gre_protocol *proto, u8 version);
23int gre_del_protocol(const struct gre_protocol *proto, u8 version); 24int gre_del_protocol(const struct gre_protocol *proto, u8 version);
24 25
26struct gre_cisco_protocol {
27 int (*handler)(struct sk_buff *skb, const struct tnl_ptk_info *tpi);
28 int (*err_handler)(struct sk_buff *skb, u32 info,
29 const struct tnl_ptk_info *tpi);
30 u8 priority;
31};
32
33int gre_cisco_register(struct gre_cisco_protocol *proto);
34int gre_cisco_unregister(struct gre_cisco_protocol *proto);
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,
40 int hdr_len);
41struct sk_buff *gre_handle_offloads(struct sk_buff *skb, bool gre_csum);
42
43static inline int ip_gre_calc_hlen(__be16 o_flags)
44{
45 int addend = 4;
46
47 if (o_flags&TUNNEL_CSUM)
48 addend += 4;
49 if (o_flags&TUNNEL_KEY)
50 addend += 4;
51 if (o_flags&TUNNEL_SEQ)
52 addend += 4;
53 return addend;
54}
55
25static inline __be16 gre_flags_to_tnl_flags(__be16 flags) 56static inline __be16 gre_flags_to_tnl_flags(__be16 flags)
26{ 57{
27 __be16 tflags = 0; 58 __be16 tflags = 0;
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index c3999632e616..c6d07cb074bc 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -269,6 +269,7 @@ enum ieee80211_radiotap_type {
269#define IEEE80211_RADIOTAP_MCS_HAVE_GI 0x04 269#define IEEE80211_RADIOTAP_MCS_HAVE_GI 0x04
270#define IEEE80211_RADIOTAP_MCS_HAVE_FMT 0x08 270#define IEEE80211_RADIOTAP_MCS_HAVE_FMT 0x08
271#define IEEE80211_RADIOTAP_MCS_HAVE_FEC 0x10 271#define IEEE80211_RADIOTAP_MCS_HAVE_FEC 0x10
272#define IEEE80211_RADIOTAP_MCS_HAVE_STBC 0x20
272 273
273#define IEEE80211_RADIOTAP_MCS_BW_MASK 0x03 274#define IEEE80211_RADIOTAP_MCS_BW_MASK 0x03
274#define IEEE80211_RADIOTAP_MCS_BW_20 0 275#define IEEE80211_RADIOTAP_MCS_BW_20 0
@@ -278,6 +279,12 @@ enum ieee80211_radiotap_type {
278#define IEEE80211_RADIOTAP_MCS_SGI 0x04 279#define IEEE80211_RADIOTAP_MCS_SGI 0x04
279#define IEEE80211_RADIOTAP_MCS_FMT_GF 0x08 280#define IEEE80211_RADIOTAP_MCS_FMT_GF 0x08
280#define IEEE80211_RADIOTAP_MCS_FEC_LDPC 0x10 281#define IEEE80211_RADIOTAP_MCS_FEC_LDPC 0x10
282#define IEEE80211_RADIOTAP_MCS_STBC_MASK 0x60
283#define IEEE80211_RADIOTAP_MCS_STBC_1 1
284#define IEEE80211_RADIOTAP_MCS_STBC_2 2
285#define IEEE80211_RADIOTAP_MCS_STBC_3 3
286
287#define IEEE80211_RADIOTAP_MCS_STBC_SHIFT 5
281 288
282/* For IEEE80211_RADIOTAP_AMPDU_STATUS */ 289/* For IEEE80211_RADIOTAP_AMPDU_STATUS */
283#define IEEE80211_RADIOTAP_AMPDU_REPORT_ZEROLEN 0x0001 290#define IEEE80211_RADIOTAP_AMPDU_REPORT_ZEROLEN 0x0001
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 100fb8cec17c..736b5fb95474 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -50,7 +50,7 @@ struct inet6_ifaddr {
50 50
51 int state; 51 int state;
52 52
53 __u8 probes; 53 __u8 dad_probes;
54 __u8 flags; 54 __u8 flags;
55 55
56 __u16 scope; 56 __u16 scope;
@@ -58,7 +58,7 @@ struct inet6_ifaddr {
58 unsigned long cstamp; /* created timestamp */ 58 unsigned long cstamp; /* created timestamp */
59 unsigned long tstamp; /* updated timestamp */ 59 unsigned long tstamp; /* updated timestamp */
60 60
61 struct timer_list timer; 61 struct timer_list dad_timer;
62 62
63 struct inet6_dev *idev; 63 struct inet6_dev *idev;
64 struct rt6_info *rt; 64 struct rt6_info *rt;
@@ -74,6 +74,7 @@ struct inet6_ifaddr {
74 bool tokenized; 74 bool tokenized;
75 75
76 struct rcu_head rcu; 76 struct rcu_head rcu;
77 struct in6_addr peer_addr;
77}; 78};
78 79
79struct ip6_sf_socklist { 80struct ip6_sf_socklist {
@@ -165,6 +166,7 @@ struct inet6_dev {
165 struct net_device *dev; 166 struct net_device *dev;
166 167
167 struct list_head addr_list; 168 struct list_head addr_list;
169 int valid_ll_addr_cnt;
168 170
169 struct ifmcaddr6 *mc_list; 171 struct ifmcaddr6 *mc_list;
170 struct ifmcaddr6 *mc_tomb; 172 struct ifmcaddr6 *mc_tomb;
@@ -172,10 +174,12 @@ struct inet6_dev {
172 unsigned char mc_qrv; 174 unsigned char mc_qrv;
173 unsigned char mc_gq_running; 175 unsigned char mc_gq_running;
174 unsigned char mc_ifc_count; 176 unsigned char mc_ifc_count;
177 unsigned char mc_dad_count;
175 unsigned long mc_v1_seen; 178 unsigned long mc_v1_seen;
176 unsigned long mc_maxdelay; 179 unsigned long mc_maxdelay;
177 struct timer_list mc_gq_timer; /* general query timer */ 180 struct timer_list mc_gq_timer; /* general query timer */
178 struct timer_list mc_ifc_timer; /* interface change timer */ 181 struct timer_list mc_ifc_timer; /* interface change timer */
182 struct timer_list mc_dad_timer; /* dad complete mc timer */
179 183
180 struct ifacaddr6 *ac_list; 184 struct ifacaddr6 *ac_list;
181 rwlock_t lock; 185 rwlock_t lock;
@@ -192,9 +196,12 @@ struct inet6_dev {
192 struct in6_addr token; 196 struct in6_addr token;
193 197
194 struct neigh_parms *nd_parms; 198 struct neigh_parms *nd_parms;
195 struct inet6_dev *next;
196 struct ipv6_devconf cnf; 199 struct ipv6_devconf cnf;
197 struct ipv6_devstat stats; 200 struct ipv6_devstat stats;
201
202 struct timer_list rs_timer;
203 __u8 rs_probes;
204
198 unsigned long tstamp; /* ipv6InterfaceTable update timestamp */ 205 unsigned long tstamp; /* ipv6InterfaceTable update timestamp */
199 struct rcu_head rcu; 206 struct rcu_head rcu;
200}; 207};
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index aab73757bc4d..3bd22795c3e2 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -134,12 +134,14 @@ static inline int INET_ECN_set_ce(struct sk_buff *skb)
134{ 134{
135 switch (skb->protocol) { 135 switch (skb->protocol) {
136 case cpu_to_be16(ETH_P_IP): 136 case cpu_to_be16(ETH_P_IP):
137 if (skb->network_header + sizeof(struct iphdr) <= skb->tail) 137 if (skb_network_header(skb) + sizeof(struct iphdr) <=
138 skb_tail_pointer(skb))
138 return IP_ECN_set_ce(ip_hdr(skb)); 139 return IP_ECN_set_ce(ip_hdr(skb));
139 break; 140 break;
140 141
141 case cpu_to_be16(ETH_P_IPV6): 142 case cpu_to_be16(ETH_P_IPV6):
142 if (skb->network_header + sizeof(struct ipv6hdr) <= skb->tail) 143 if (skb_network_header(skb) + sizeof(struct ipv6hdr) <=
144 skb_tail_pointer(skb))
143 return IP6_ECN_set_ce(ipv6_hdr(skb)); 145 return IP6_ECN_set_ce(ipv6_hdr(skb));
144 break; 146 break;
145 } 147 }
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 7235ae73a1e8..b21a7f06d6a4 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -32,7 +32,6 @@
32 * 32 *
33 * @faddr - Saved first hop address 33 * @faddr - Saved first hop address
34 * @nexthop - Saved nexthop address in LSRR and SSRR 34 * @nexthop - Saved nexthop address in LSRR and SSRR
35 * @is_data - Options in __data, rather than skb
36 * @is_strictroute - Strict source route 35 * @is_strictroute - Strict source route
37 * @srr_is_hit - Packet destination addr was our one 36 * @srr_is_hit - Packet destination addr was our one
38 * @is_changed - IP checksum more not valid 37 * @is_changed - IP checksum more not valid
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h
index e49db91593a9..cbf2be37c91a 100644
--- a/include/net/ip_fib.h
+++ b/include/net/ip_fib.h
@@ -51,11 +51,13 @@ struct rtable;
51 51
52struct fib_nh_exception { 52struct fib_nh_exception {
53 struct fib_nh_exception __rcu *fnhe_next; 53 struct fib_nh_exception __rcu *fnhe_next;
54 int fnhe_genid;
54 __be32 fnhe_daddr; 55 __be32 fnhe_daddr;
55 u32 fnhe_pmtu; 56 u32 fnhe_pmtu;
56 __be32 fnhe_gw; 57 __be32 fnhe_gw;
57 unsigned long fnhe_expires; 58 unsigned long fnhe_expires;
58 struct rtable __rcu *fnhe_rth; 59 struct rtable __rcu *fnhe_rth_input;
60 struct rtable __rcu *fnhe_rth_output;
59 unsigned long fnhe_stamp; 61 unsigned long fnhe_stamp;
60}; 62};
61 63
@@ -289,7 +291,6 @@ static inline int fib_num_tclassid_users(struct net *net)
289extern int ip_fib_check_default(__be32 gw, struct net_device *dev); 291extern int ip_fib_check_default(__be32 gw, struct net_device *dev);
290extern int fib_sync_down_dev(struct net_device *dev, int force); 292extern int fib_sync_down_dev(struct net_device *dev, int force);
291extern int fib_sync_down_addr(struct net *net, __be32 local); 293extern int fib_sync_down_addr(struct net *net, __be32 local);
292extern void fib_update_nh_saddrs(struct net_device *dev);
293extern int fib_sync_up(struct net_device *dev); 294extern int fib_sync_up(struct net_device *dev);
294extern void fib_select_multipath(struct fib_result *res); 295extern void fib_select_multipath(struct fib_result *res);
295 296
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index 09b1360e10bf..781b3cf86a2f 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -42,6 +42,7 @@ struct ip_tunnel {
42 struct ip_tunnel __rcu *next; 42 struct ip_tunnel __rcu *next;
43 struct hlist_node hash_node; 43 struct hlist_node hash_node;
44 struct net_device *dev; 44 struct net_device *dev;
45 struct net *net; /* netns for packet i/o */
45 46
46 int err_count; /* Number of arrived ICMP errors */ 47 int err_count; /* Number of arrived ICMP errors */
47 unsigned long err_time; /* Time when the last ICMP error 48 unsigned long err_time; /* Time when the last ICMP error
@@ -73,6 +74,7 @@ struct ip_tunnel {
73#define TUNNEL_REC __cpu_to_be16(0x20) 74#define TUNNEL_REC __cpu_to_be16(0x20)
74#define TUNNEL_VERSION __cpu_to_be16(0x40) 75#define TUNNEL_VERSION __cpu_to_be16(0x40)
75#define TUNNEL_NO_KEY __cpu_to_be16(0x80) 76#define TUNNEL_NO_KEY __cpu_to_be16(0x80)
77#define TUNNEL_DONT_FRAGMENT __cpu_to_be16(0x0100)
76 78
77struct tnl_ptk_info { 79struct tnl_ptk_info {
78 __be16 flags; 80 __be16 flags;
@@ -92,6 +94,8 @@ struct ip_tunnel_net {
92 struct net_device *fb_tunnel_dev; 94 struct net_device *fb_tunnel_dev;
93}; 95};
94 96
97#ifdef CONFIG_INET
98
95int ip_tunnel_init(struct net_device *dev); 99int ip_tunnel_init(struct net_device *dev);
96void ip_tunnel_uninit(struct net_device *dev); 100void ip_tunnel_uninit(struct net_device *dev);
97void ip_tunnel_dellink(struct net_device *dev, struct list_head *head); 101void ip_tunnel_dellink(struct net_device *dev, struct list_head *head);
@@ -101,7 +105,7 @@ int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
101void ip_tunnel_delete_net(struct ip_tunnel_net *itn); 105void ip_tunnel_delete_net(struct ip_tunnel_net *itn);
102 106
103void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, 107void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
104 const struct iphdr *tnl_params); 108 const struct iphdr *tnl_params, const u8 protocol);
105int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd); 109int ip_tunnel_ioctl(struct net_device *dev, struct ip_tunnel_parm *p, int cmd);
106int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu); 110int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu);
107 111
@@ -155,23 +159,31 @@ static inline void tunnel_ip_select_ident(struct sk_buff *skb,
155 (skb_shinfo(skb)->gso_segs ?: 1) - 1); 159 (skb_shinfo(skb)->gso_segs ?: 1) - 1);
156} 160}
157 161
158static inline void iptunnel_xmit(struct sk_buff *skb, struct net_device *dev) 162int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto);
159{ 163int iptunnel_xmit(struct net *net, struct rtable *rt,
160 int err; 164 struct sk_buff *skb,
161 int pkt_len = skb->len - skb_transport_offset(skb); 165 __be32 src, __be32 dst, __u8 proto,
162 struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats); 166 __u8 tos, __u8 ttl, __be16 df);
163 167
164 nf_reset(skb); 168static inline void iptunnel_xmit_stats(int err,
169 struct net_device_stats *err_stats,
170 struct pcpu_tstats __percpu *stats)
171{
172 if (err > 0) {
173 struct pcpu_tstats *tstats = this_cpu_ptr(stats);
165 174
166 err = ip_local_out(skb);
167 if (likely(net_xmit_eval(err) == 0)) {
168 u64_stats_update_begin(&tstats->syncp); 175 u64_stats_update_begin(&tstats->syncp);
169 tstats->tx_bytes += pkt_len; 176 tstats->tx_bytes += err;
170 tstats->tx_packets++; 177 tstats->tx_packets++;
171 u64_stats_update_end(&tstats->syncp); 178 u64_stats_update_end(&tstats->syncp);
179 } else if (err < 0) {
180 err_stats->tx_errors++;
181 err_stats->tx_aborted_errors++;
172 } else { 182 } else {
173 dev->stats.tx_errors++; 183 err_stats->tx_dropped++;
174 dev->stats.tx_aborted_errors++;
175 } 184 }
176} 185}
186
187#endif /* CONFIG_INET */
188
177#endif /* __NET_IP_TUNNELS_H */ 189#endif /* __NET_IP_TUNNELS_H */
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 4c062ccff9aa..f0d70f066f3d 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -197,31 +197,6 @@ ip_vs_fill_iph_skb(int af, const struct sk_buff *skb, struct ip_vs_iphdr *iphdr)
197 } 197 }
198} 198}
199 199
200/* This function is a faster version of ip_vs_fill_iph_skb().
201 * Where we only populate {s,d}addr (and avoid calling ipv6_find_hdr()).
202 * This is used by the some of the ip_vs_*_schedule() functions.
203 * (Mostly done to avoid ABI breakage of external schedulers)
204 */
205static inline void
206ip_vs_fill_iph_addr_only(int af, const struct sk_buff *skb,
207 struct ip_vs_iphdr *iphdr)
208{
209#ifdef CONFIG_IP_VS_IPV6
210 if (af == AF_INET6) {
211 const struct ipv6hdr *iph =
212 (struct ipv6hdr *)skb_network_header(skb);
213 iphdr->saddr.in6 = iph->saddr;
214 iphdr->daddr.in6 = iph->daddr;
215 } else
216#endif
217 {
218 const struct iphdr *iph =
219 (struct iphdr *)skb_network_header(skb);
220 iphdr->saddr.ip = iph->saddr;
221 iphdr->daddr.ip = iph->daddr;
222 }
223}
224
225static inline void ip_vs_addr_copy(int af, union nf_inet_addr *dst, 200static inline void ip_vs_addr_copy(int af, union nf_inet_addr *dst,
226 const union nf_inet_addr *src) 201 const union nf_inet_addr *src)
227{ 202{
@@ -405,17 +380,18 @@ enum {
405 */ 380 */
406enum ip_vs_sctp_states { 381enum ip_vs_sctp_states {
407 IP_VS_SCTP_S_NONE, 382 IP_VS_SCTP_S_NONE,
408 IP_VS_SCTP_S_INIT_CLI, 383 IP_VS_SCTP_S_INIT1,
409 IP_VS_SCTP_S_INIT_SER, 384 IP_VS_SCTP_S_INIT,
410 IP_VS_SCTP_S_INIT_ACK_CLI, 385 IP_VS_SCTP_S_COOKIE_SENT,
411 IP_VS_SCTP_S_INIT_ACK_SER, 386 IP_VS_SCTP_S_COOKIE_REPLIED,
412 IP_VS_SCTP_S_ECHO_CLI, 387 IP_VS_SCTP_S_COOKIE_WAIT,
413 IP_VS_SCTP_S_ECHO_SER, 388 IP_VS_SCTP_S_COOKIE,
389 IP_VS_SCTP_S_COOKIE_ECHOED,
414 IP_VS_SCTP_S_ESTABLISHED, 390 IP_VS_SCTP_S_ESTABLISHED,
415 IP_VS_SCTP_S_SHUT_CLI, 391 IP_VS_SCTP_S_SHUTDOWN_SENT,
416 IP_VS_SCTP_S_SHUT_SER, 392 IP_VS_SCTP_S_SHUTDOWN_RECEIVED,
417 IP_VS_SCTP_S_SHUT_ACK_CLI, 393 IP_VS_SCTP_S_SHUTDOWN_ACK_SENT,
418 IP_VS_SCTP_S_SHUT_ACK_SER, 394 IP_VS_SCTP_S_REJECTED,
419 IP_VS_SCTP_S_CLOSED, 395 IP_VS_SCTP_S_CLOSED,
420 IP_VS_SCTP_S_LAST 396 IP_VS_SCTP_S_LAST
421}; 397};
@@ -814,7 +790,8 @@ struct ip_vs_scheduler {
814 790
815 /* selecting a server from the given service */ 791 /* selecting a server from the given service */
816 struct ip_vs_dest* (*schedule)(struct ip_vs_service *svc, 792 struct ip_vs_dest* (*schedule)(struct ip_vs_service *svc,
817 const struct sk_buff *skb); 793 const struct sk_buff *skb,
794 struct ip_vs_iphdr *iph);
818}; 795};
819 796
820/* The persistence engine object */ 797/* The persistence engine object */
@@ -905,7 +882,7 @@ struct ip_vs_app {
905struct ipvs_master_sync_state { 882struct ipvs_master_sync_state {
906 struct list_head sync_queue; 883 struct list_head sync_queue;
907 struct ip_vs_sync_buff *sync_buff; 884 struct ip_vs_sync_buff *sync_buff;
908 int sync_queue_len; 885 unsigned long sync_queue_len;
909 unsigned int sync_queue_delay; 886 unsigned int sync_queue_delay;
910 struct task_struct *master_thread; 887 struct task_struct *master_thread;
911 struct delayed_work master_wakeup_work; 888 struct delayed_work master_wakeup_work;
@@ -998,10 +975,13 @@ struct netns_ipvs {
998 int sysctl_snat_reroute; 975 int sysctl_snat_reroute;
999 int sysctl_sync_ver; 976 int sysctl_sync_ver;
1000 int sysctl_sync_ports; 977 int sysctl_sync_ports;
1001 int sysctl_sync_qlen_max; 978 int sysctl_sync_persist_mode;
979 unsigned long sysctl_sync_qlen_max;
1002 int sysctl_sync_sock_size; 980 int sysctl_sync_sock_size;
1003 int sysctl_cache_bypass; 981 int sysctl_cache_bypass;
1004 int sysctl_expire_nodest_conn; 982 int sysctl_expire_nodest_conn;
983 int sysctl_sloppy_tcp;
984 int sysctl_sloppy_sctp;
1005 int sysctl_expire_quiescent_template; 985 int sysctl_expire_quiescent_template;
1006 int sysctl_sync_threshold[2]; 986 int sysctl_sync_threshold[2];
1007 unsigned int sysctl_sync_refresh_period; 987 unsigned int sysctl_sync_refresh_period;
@@ -1044,6 +1024,8 @@ struct netns_ipvs {
1044#define DEFAULT_SYNC_THRESHOLD 3 1024#define DEFAULT_SYNC_THRESHOLD 3
1045#define DEFAULT_SYNC_PERIOD 50 1025#define DEFAULT_SYNC_PERIOD 50
1046#define DEFAULT_SYNC_VER 1 1026#define DEFAULT_SYNC_VER 1
1027#define DEFAULT_SLOPPY_TCP 0
1028#define DEFAULT_SLOPPY_SCTP 0
1047#define DEFAULT_SYNC_REFRESH_PERIOD (0U * HZ) 1029#define DEFAULT_SYNC_REFRESH_PERIOD (0U * HZ)
1048#define DEFAULT_SYNC_RETRIES 0 1030#define DEFAULT_SYNC_RETRIES 0
1049#define IPVS_SYNC_WAKEUP_RATE 8 1031#define IPVS_SYNC_WAKEUP_RATE 8
@@ -1080,12 +1062,27 @@ static inline int sysctl_sync_ver(struct netns_ipvs *ipvs)
1080 return ipvs->sysctl_sync_ver; 1062 return ipvs->sysctl_sync_ver;
1081} 1063}
1082 1064
1065static inline int sysctl_sloppy_tcp(struct netns_ipvs *ipvs)
1066{
1067 return ipvs->sysctl_sloppy_tcp;
1068}
1069
1070static inline int sysctl_sloppy_sctp(struct netns_ipvs *ipvs)
1071{
1072 return ipvs->sysctl_sloppy_sctp;
1073}
1074
1083static inline int sysctl_sync_ports(struct netns_ipvs *ipvs) 1075static inline int sysctl_sync_ports(struct netns_ipvs *ipvs)
1084{ 1076{
1085 return ACCESS_ONCE(ipvs->sysctl_sync_ports); 1077 return ACCESS_ONCE(ipvs->sysctl_sync_ports);
1086} 1078}
1087 1079
1088static inline int sysctl_sync_qlen_max(struct netns_ipvs *ipvs) 1080static inline int sysctl_sync_persist_mode(struct netns_ipvs *ipvs)
1081{
1082 return ipvs->sysctl_sync_persist_mode;
1083}
1084
1085static inline unsigned long sysctl_sync_qlen_max(struct netns_ipvs *ipvs)
1089{ 1086{
1090 return ipvs->sysctl_sync_qlen_max; 1087 return ipvs->sysctl_sync_qlen_max;
1091} 1088}
@@ -1133,12 +1130,27 @@ static inline int sysctl_sync_ver(struct netns_ipvs *ipvs)
1133 return DEFAULT_SYNC_VER; 1130 return DEFAULT_SYNC_VER;
1134} 1131}
1135 1132
1133static inline int sysctl_sloppy_tcp(struct netns_ipvs *ipvs)
1134{
1135 return DEFAULT_SLOPPY_TCP;
1136}
1137
1138static inline int sysctl_sloppy_sctp(struct netns_ipvs *ipvs)
1139{
1140 return DEFAULT_SLOPPY_SCTP;
1141}
1142
1136static inline int sysctl_sync_ports(struct netns_ipvs *ipvs) 1143static inline int sysctl_sync_ports(struct netns_ipvs *ipvs)
1137{ 1144{
1138 return 1; 1145 return 1;
1139} 1146}
1140 1147
1141static inline int sysctl_sync_qlen_max(struct netns_ipvs *ipvs) 1148static inline int sysctl_sync_persist_mode(struct netns_ipvs *ipvs)
1149{
1150 return 0;
1151}
1152
1153static inline unsigned long sysctl_sync_qlen_max(struct netns_ipvs *ipvs)
1142{ 1154{
1143 return IPVS_SYNC_QLEN_MAX; 1155 return IPVS_SYNC_QLEN_MAX;
1144} 1156}
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 0810aa57c780..5fe564985171 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -260,6 +260,12 @@ static inline void fl6_sock_release(struct ip6_flowlabel *fl)
260 260
261extern void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info); 261extern void icmpv6_notify(struct sk_buff *skb, u8 type, u8 code, __be32 info);
262 262
263int icmpv6_push_pending_frames(struct sock *sk, struct flowi6 *fl6,
264 struct icmp6hdr *thdr, int len);
265
266struct dst_entry *icmpv6_route_lookup(struct net *net, struct sk_buff *skb,
267 struct sock *sk, struct flowi6 *fl6);
268
263extern int ip6_ra_control(struct sock *sk, int sel); 269extern int ip6_ra_control(struct sock *sk, int sel);
264 270
265extern int ipv6_parse_hopopts(struct sk_buff *skb); 271extern int ipv6_parse_hopopts(struct sk_buff *skb);
@@ -853,8 +859,8 @@ static inline int snmp6_unregister_dev(struct inet6_dev *idev) { return 0; }
853#endif 859#endif
854 860
855#ifdef CONFIG_SYSCTL 861#ifdef CONFIG_SYSCTL
856extern ctl_table ipv6_route_table_template[]; 862extern struct ctl_table ipv6_route_table_template[];
857extern ctl_table ipv6_icmp_table_template[]; 863extern struct ctl_table ipv6_icmp_table_template[];
858 864
859extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net); 865extern struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
860extern struct ctl_table *ipv6_route_sysctl_init(struct net *net); 866extern struct ctl_table *ipv6_route_sysctl_init(struct net *net);
diff --git a/include/net/ll_poll.h b/include/net/ll_poll.h
new file mode 100644
index 000000000000..76f034087743
--- /dev/null
+++ b/include/net/ll_poll.h
@@ -0,0 +1,183 @@
1/*
2 * Low Latency Sockets
3 * Copyright(c) 2013 Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Author: Eliezer Tamir
19 *
20 * Contact Information:
21 * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
22 */
23
24#ifndef _LINUX_NET_LL_POLL_H
25#define _LINUX_NET_LL_POLL_H
26
27#include <linux/netdevice.h>
28#include <net/ip.h>
29
30#ifdef CONFIG_NET_LL_RX_POLL
31
32struct napi_struct;
33extern unsigned int sysctl_net_ll_read __read_mostly;
34extern unsigned int sysctl_net_ll_poll __read_mostly;
35
36/* return values from ndo_ll_poll */
37#define LL_FLUSH_FAILED -1
38#define LL_FLUSH_BUSY -2
39
40static inline bool net_busy_loop_on(void)
41{
42 return sysctl_net_ll_poll;
43}
44
45/* a wrapper to make debug_smp_processor_id() happy
46 * we can use sched_clock() because we don't care much about precision
47 * we only care that the average is bounded
48 */
49#ifdef CONFIG_DEBUG_PREEMPT
50static inline u64 busy_loop_us_clock(void)
51{
52 u64 rc;
53
54 preempt_disable_notrace();
55 rc = sched_clock();
56 preempt_enable_no_resched_notrace();
57
58 return rc >> 10;
59}
60#else /* CONFIG_DEBUG_PREEMPT */
61static inline u64 busy_loop_us_clock(void)
62{
63 return sched_clock() >> 10;
64}
65#endif /* CONFIG_DEBUG_PREEMPT */
66
67static inline unsigned long sk_busy_loop_end_time(struct sock *sk)
68{
69 return busy_loop_us_clock() + ACCESS_ONCE(sk->sk_ll_usec);
70}
71
72/* in poll/select we use the global sysctl_net_ll_poll value */
73static inline unsigned long busy_loop_end_time(void)
74{
75 return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_ll_poll);
76}
77
78static inline bool sk_can_busy_loop(struct sock *sk)
79{
80 return sk->sk_ll_usec && sk->sk_napi_id &&
81 !need_resched() && !signal_pending(current);
82}
83
84
85static inline bool busy_loop_timeout(unsigned long end_time)
86{
87 unsigned long now = busy_loop_us_clock();
88
89 return time_after(now, end_time);
90}
91
92/* when used in sock_poll() nonblock is known at compile time to be true
93 * so the loop and end_time will be optimized out
94 */
95static inline bool sk_busy_loop(struct sock *sk, int nonblock)
96{
97 unsigned long end_time = !nonblock ? sk_busy_loop_end_time(sk) : 0;
98 const struct net_device_ops *ops;
99 struct napi_struct *napi;
100 int rc = false;
101
102 /*
103 * rcu read lock for napi hash
104 * bh so we don't race with net_rx_action
105 */
106 rcu_read_lock_bh();
107
108 napi = napi_by_id(sk->sk_napi_id);
109 if (!napi)
110 goto out;
111
112 ops = napi->dev->netdev_ops;
113 if (!ops->ndo_ll_poll)
114 goto out;
115
116 do {
117 rc = ops->ndo_ll_poll(napi);
118
119 if (rc == LL_FLUSH_FAILED)
120 break; /* permanent failure */
121
122 if (rc > 0)
123 /* local bh are disabled so it is ok to use _BH */
124 NET_ADD_STATS_BH(sock_net(sk),
125 LINUX_MIB_LOWLATENCYRXPACKETS, rc);
126
127 } while (!nonblock && skb_queue_empty(&sk->sk_receive_queue) &&
128 !need_resched() && !busy_loop_timeout(end_time));
129
130 rc = !skb_queue_empty(&sk->sk_receive_queue);
131out:
132 rcu_read_unlock_bh();
133 return rc;
134}
135
136/* used in the NIC receive handler to mark the skb */
137static inline void skb_mark_ll(struct sk_buff *skb, struct napi_struct *napi)
138{
139 skb->napi_id = napi->napi_id;
140}
141
142/* used in the protocol hanlder to propagate the napi_id to the socket */
143static inline void sk_mark_ll(struct sock *sk, struct sk_buff *skb)
144{
145 sk->sk_napi_id = skb->napi_id;
146}
147
148#else /* CONFIG_NET_LL_RX_POLL */
149static inline unsigned long net_busy_loop_on(void)
150{
151 return 0;
152}
153
154static inline unsigned long busy_loop_end_time(void)
155{
156 return 0;
157}
158
159static inline bool sk_can_busy_loop(struct sock *sk)
160{
161 return false;
162}
163
164static inline bool sk_busy_poll(struct sock *sk, int nonblock)
165{
166 return false;
167}
168
169static inline void skb_mark_ll(struct sk_buff *skb, struct napi_struct *napi)
170{
171}
172
173static inline void sk_mark_ll(struct sock *sk, struct sk_buff *skb)
174{
175}
176
177static inline bool busy_loop_timeout(unsigned long end_time)
178{
179 return true;
180}
181
182#endif /* CONFIG_NET_LL_RX_POLL */
183#endif /* _LINUX_NET_LL_POLL_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 885898a40d13..5b7a3dadadde 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -217,8 +217,8 @@ struct ieee80211_chanctx_conf {
217 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface 217 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface
218 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS) 218 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS)
219 * changed (currently only in P2P client mode, GO mode will be later) 219 * changed (currently only in P2P client mode, GO mode will be later)
220 * @BSS_CHANGED_DTIM_PERIOD: the DTIM period value was changed (set when 220 * @BSS_CHANGED_BEACON_INFO: Data from the AP's beacon became available:
221 * it becomes valid, managed mode only) 221 * currently dtim_period only is under consideration.
222 * @BSS_CHANGED_BANDWIDTH: The bandwidth used by this interface changed, 222 * @BSS_CHANGED_BANDWIDTH: The bandwidth used by this interface changed,
223 * note that this is only called when it changes after the channel 223 * note that this is only called when it changes after the channel
224 * context had been assigned. 224 * context had been assigned.
@@ -244,7 +244,7 @@ enum ieee80211_bss_change {
244 BSS_CHANGED_PS = 1<<17, 244 BSS_CHANGED_PS = 1<<17,
245 BSS_CHANGED_TXPOWER = 1<<18, 245 BSS_CHANGED_TXPOWER = 1<<18,
246 BSS_CHANGED_P2P_PS = 1<<19, 246 BSS_CHANGED_P2P_PS = 1<<19,
247 BSS_CHANGED_DTIM_PERIOD = 1<<20, 247 BSS_CHANGED_BEACON_INFO = 1<<20,
248 BSS_CHANGED_BANDWIDTH = 1<<21, 248 BSS_CHANGED_BANDWIDTH = 1<<21,
249 249
250 /* when adding here, make sure to change ieee80211_reconfig */ 250 /* when adding here, make sure to change ieee80211_reconfig */
@@ -288,7 +288,7 @@ enum ieee80211_rssi_event {
288 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag 288 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag
289 * @dtim_period: num of beacons before the next DTIM, for beaconing, 289 * @dtim_period: num of beacons before the next DTIM, for beaconing,
290 * valid in station mode only if after the driver was notified 290 * valid in station mode only if after the driver was notified
291 * with the %BSS_CHANGED_DTIM_PERIOD flag, will be non-zero then. 291 * with the %BSS_CHANGED_BEACON_INFO flag, will be non-zero then.
292 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old 292 * @sync_tsf: last beacon's/probe response's TSF timestamp (could be old
293 * as it may have been received during scanning long ago). If the 293 * as it may have been received during scanning long ago). If the
294 * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can 294 * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can
@@ -305,6 +305,7 @@ enum ieee80211_rssi_event {
305 * @basic_rates: bitmap of basic rates, each bit stands for an 305 * @basic_rates: bitmap of basic rates, each bit stands for an
306 * index into the rate table configured by the driver in 306 * index into the rate table configured by the driver in
307 * the current band. 307 * the current band.
308 * @beacon_rate: associated AP's beacon TX rate
308 * @mcast_rate: per-band multicast rate index + 1 (0: disabled) 309 * @mcast_rate: per-band multicast rate index + 1 (0: disabled)
309 * @bssid: The BSSID for this BSS 310 * @bssid: The BSSID for this BSS
310 * @enable_beacon: whether beaconing should be enabled or not 311 * @enable_beacon: whether beaconing should be enabled or not
@@ -352,6 +353,7 @@ struct ieee80211_bss_conf {
352 u32 sync_device_ts; 353 u32 sync_device_ts;
353 u8 sync_dtim_count; 354 u8 sync_dtim_count;
354 u32 basic_rates; 355 u32 basic_rates;
356 struct ieee80211_rate *beacon_rate;
355 int mcast_rate[IEEE80211_NUM_BANDS]; 357 int mcast_rate[IEEE80211_NUM_BANDS];
356 u16 ht_operation_mode; 358 u16 ht_operation_mode;
357 s32 cqm_rssi_thold; 359 s32 cqm_rssi_thold;
@@ -460,6 +462,8 @@ struct ieee80211_bss_conf {
460 * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it 462 * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it
461 * would be fragmented by size (this is optional, only used for 463 * would be fragmented by size (this is optional, only used for
462 * monitor injection). 464 * monitor injection).
465 * @IEEE80211_TX_CTL_PS_RESPONSE: This frame is a response to a poll
466 * frame (PS-Poll or uAPSD).
463 * 467 *
464 * Note: If you have to add new flags to the enumeration, then don't 468 * Note: If you have to add new flags to the enumeration, then don't
465 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. 469 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
@@ -495,6 +499,7 @@ enum mac80211_tx_control_flags {
495 IEEE80211_TX_STATUS_EOSP = BIT(28), 499 IEEE80211_TX_STATUS_EOSP = BIT(28),
496 IEEE80211_TX_CTL_USE_MINRATE = BIT(29), 500 IEEE80211_TX_CTL_USE_MINRATE = BIT(29),
497 IEEE80211_TX_CTL_DONTFRAG = BIT(30), 501 IEEE80211_TX_CTL_DONTFRAG = BIT(30),
502 IEEE80211_TX_CTL_PS_RESPONSE = BIT(31),
498}; 503};
499 504
500#define IEEE80211_TX_CTL_STBC_SHIFT 23 505#define IEEE80211_TX_CTL_STBC_SHIFT 23
@@ -805,6 +810,7 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
805 * on this subframe 810 * on this subframe
806 * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC 811 * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC
807 * is stored in the @ampdu_delimiter_crc field) 812 * is stored in the @ampdu_delimiter_crc field)
813 * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3
808 */ 814 */
809enum mac80211_rx_flags { 815enum mac80211_rx_flags {
810 RX_FLAG_MMIC_ERROR = BIT(0), 816 RX_FLAG_MMIC_ERROR = BIT(0),
@@ -832,8 +838,11 @@ enum mac80211_rx_flags {
832 RX_FLAG_80MHZ = BIT(23), 838 RX_FLAG_80MHZ = BIT(23),
833 RX_FLAG_80P80MHZ = BIT(24), 839 RX_FLAG_80P80MHZ = BIT(24),
834 RX_FLAG_160MHZ = BIT(25), 840 RX_FLAG_160MHZ = BIT(25),
841 RX_FLAG_STBC_MASK = BIT(26) | BIT(27),
835}; 842};
836 843
844#define RX_FLAG_STBC_SHIFT 26
845
837/** 846/**
838 * struct ieee80211_rx_status - receive status 847 * struct ieee80211_rx_status - receive status
839 * 848 *
@@ -850,6 +859,10 @@ enum mac80211_rx_flags {
850 * @signal: signal strength when receiving this frame, either in dBm, in dB or 859 * @signal: signal strength when receiving this frame, either in dBm, in dB or
851 * unspecified depending on the hardware capabilities flags 860 * unspecified depending on the hardware capabilities flags
852 * @IEEE80211_HW_SIGNAL_* 861 * @IEEE80211_HW_SIGNAL_*
862 * @chains: bitmask of receive chains for which separate signal strength
863 * values were filled.
864 * @chain_signal: per-chain signal strength, in dBm (unlike @signal, doesn't
865 * support dB or unspecified units)
853 * @antenna: antenna used 866 * @antenna: antenna used
854 * @rate_idx: index of data rate into band's supported rates or MCS index if 867 * @rate_idx: index of data rate into band's supported rates or MCS index if
855 * HT or VHT is used (%RX_FLAG_HT/%RX_FLAG_VHT) 868 * HT or VHT is used (%RX_FLAG_HT/%RX_FLAG_VHT)
@@ -881,6 +894,8 @@ struct ieee80211_rx_status {
881 u8 band; 894 u8 band;
882 u8 antenna; 895 u8 antenna;
883 s8 signal; 896 s8 signal;
897 u8 chains;
898 s8 chain_signal[IEEE80211_MAX_CHAINS];
884 u8 ampdu_delimiter_crc; 899 u8 ampdu_delimiter_crc;
885 u8 vendor_radiotap_align; 900 u8 vendor_radiotap_align;
886 u8 vendor_radiotap_oui[3]; 901 u8 vendor_radiotap_oui[3];
@@ -1235,7 +1250,7 @@ enum ieee80211_sta_rx_bandwidth {
1235 * struct ieee80211_sta_rates - station rate selection table 1250 * struct ieee80211_sta_rates - station rate selection table
1236 * 1251 *
1237 * @rcu_head: RCU head used for freeing the table on update 1252 * @rcu_head: RCU head used for freeing the table on update
1238 * @rates: transmit rates/flags to be used by default. 1253 * @rate: transmit rates/flags to be used by default.
1239 * Overriding entries per-packet is possible by using cb tx control. 1254 * Overriding entries per-packet is possible by using cb tx control.
1240 */ 1255 */
1241struct ieee80211_sta_rates { 1256struct ieee80211_sta_rates {
@@ -1276,7 +1291,7 @@ struct ieee80211_sta_rates {
1276 * notifications and capabilities. The value is only valid after 1291 * notifications and capabilities. The value is only valid after
1277 * the station moves to associated state. 1292 * the station moves to associated state.
1278 * @smps_mode: current SMPS mode (off, static or dynamic) 1293 * @smps_mode: current SMPS mode (off, static or dynamic)
1279 * @tx_rates: rate control selection table 1294 * @rates: rate control selection table
1280 */ 1295 */
1281struct ieee80211_sta { 1296struct ieee80211_sta {
1282 u32 supp_rates[IEEE80211_NUM_BANDS]; 1297 u32 supp_rates[IEEE80211_NUM_BANDS];
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 745bf741e029..949d77528f2f 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -230,7 +230,7 @@ extern int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl,
230 void __user *buffer, 230 void __user *buffer,
231 size_t *lenp, 231 size_t *lenp,
232 loff_t *ppos); 232 loff_t *ppos);
233int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, 233int ndisc_ifinfo_sysctl_strategy(struct ctl_table *ctl,
234 void __user *oldval, size_t __user *oldlenp, 234 void __user *oldval, size_t __user *oldlenp,
235 void __user *newval, size_t newlen); 235 void __user *newval, size_t newlen);
236#endif 236#endif
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index b17697827482..84e37b1ca9e1 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -115,9 +115,12 @@ struct net {
115#ifdef CONFIG_XFRM 115#ifdef CONFIG_XFRM
116 struct netns_xfrm xfrm; 116 struct netns_xfrm xfrm;
117#endif 117#endif
118#if IS_ENABLED(CONFIG_IP_VS)
118 struct netns_ipvs *ipvs; 119 struct netns_ipvs *ipvs;
120#endif
119 struct sock *diag_nlsk; 121 struct sock *diag_nlsk;
120 atomic_t rt_genid; 122 atomic_t rt_genid;
123 atomic_t fnhe_genid;
121}; 124};
122 125
123/* 126/*
@@ -340,4 +343,14 @@ static inline void rt_genid_bump(struct net *net)
340 atomic_inc(&net->rt_genid); 343 atomic_inc(&net->rt_genid);
341} 344}
342 345
346static inline int fnhe_genid(struct net *net)
347{
348 return atomic_read(&net->fnhe_genid);
349}
350
351static inline void fnhe_genid_bump(struct net *net)
352{
353 atomic_inc(&net->fnhe_genid);
354}
355
343#endif /* __NET_NET_NAMESPACE_H */ 356#endif /* __NET_NET_NAMESPACE_H */
diff --git a/include/net/netfilter/xt_rateest.h b/include/net/netfilter/xt_rateest.h
index 5a2978d1cb22..495c71f66e7e 100644
--- a/include/net/netfilter/xt_rateest.h
+++ b/include/net/netfilter/xt_rateest.h
@@ -6,7 +6,7 @@ struct xt_rateest {
6 struct gnet_stats_basic_packed bstats; 6 struct gnet_stats_basic_packed bstats;
7 spinlock_t lock; 7 spinlock_t lock;
8 /* keep rstats and lock on same cache line to speedup xt_rateest_mt() */ 8 /* keep rstats and lock on same cache line to speedup xt_rateest_mt() */
9 struct gnet_stats_rate_est rstats; 9 struct gnet_stats_rate_est64 rstats;
10 10
11 /* following fields not accessed in hot path */ 11 /* following fields not accessed in hot path */
12 struct hlist_node list; 12 struct hlist_node list;
diff --git a/include/net/netns/x_tables.h b/include/net/netns/x_tables.h
index c24060ee411e..02fe40f8c8fd 100644
--- a/include/net/netns/x_tables.h
+++ b/include/net/netns/x_tables.h
@@ -15,5 +15,11 @@ struct netns_xt {
15 struct ebt_table *frame_filter; 15 struct ebt_table *frame_filter;
16 struct ebt_table *frame_nat; 16 struct ebt_table *frame_nat;
17#endif 17#endif
18#if IS_ENABLED(CONFIG_IP_NF_TARGET_ULOG)
19 bool ulog_warn_deprecated;
20#endif
21#if IS_ENABLED(CONFIG_BRIDGE_EBT_ULOG)
22 bool ebt_ulog_warn_deprecated;
23#endif
18}; 24};
19#endif 25#endif
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index b87a1692b086..0af851c3b038 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -59,8 +59,10 @@ struct nfc_hci_ops {
59 struct nfc_target *target); 59 struct nfc_target *target);
60 int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, 60 int (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event,
61 struct sk_buff *skb); 61 struct sk_buff *skb);
62 int (*enable_se)(struct nfc_dev *dev, u32 secure_element); 62 int (*fw_upload)(struct nfc_hci_dev *hdev, const char *firmware_name);
63 int (*disable_se)(struct nfc_dev *dev, u32 secure_element); 63 int (*discover_se)(struct nfc_hci_dev *dev);
64 int (*enable_se)(struct nfc_hci_dev *dev, u32 se_idx);
65 int (*disable_se)(struct nfc_hci_dev *dev, u32 se_idx);
64}; 66};
65 67
66/* Pipes */ 68/* Pipes */
@@ -152,7 +154,6 @@ struct nfc_hci_dev *nfc_hci_allocate_device(struct nfc_hci_ops *ops,
152 struct nfc_hci_init_data *init_data, 154 struct nfc_hci_init_data *init_data,
153 unsigned long quirks, 155 unsigned long quirks,
154 u32 protocols, 156 u32 protocols,
155 u32 supported_se,
156 const char *llc_name, 157 const char *llc_name,
157 int tx_headroom, 158 int tx_headroom,
158 int tx_tailroom, 159 int tx_tailroom,
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index 5bc0c460edc0..99fc1f3a392a 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -3,6 +3,7 @@
3 * NFC Controller (NFCC) and a Device Host (DH). 3 * NFC Controller (NFCC) and a Device Host (DH).
4 * 4 *
5 * Copyright (C) 2011 Texas Instruments, Inc. 5 * Copyright (C) 2011 Texas Instruments, Inc.
6 * Copyright (C) 2013 Intel Corporation. All rights reserved.
6 * 7 *
7 * Written by Ilan Elias <ilane@ti.com> 8 * Written by Ilan Elias <ilane@ti.com>
8 * 9 *
@@ -66,7 +67,7 @@ struct nci_dev;
66struct nci_ops { 67struct nci_ops {
67 int (*open)(struct nci_dev *ndev); 68 int (*open)(struct nci_dev *ndev);
68 int (*close)(struct nci_dev *ndev); 69 int (*close)(struct nci_dev *ndev);
69 int (*send)(struct sk_buff *skb); 70 int (*send)(struct nci_dev *ndev, struct sk_buff *skb);
70}; 71};
71 72
72#define NCI_MAX_SUPPORTED_RF_INTERFACES 4 73#define NCI_MAX_SUPPORTED_RF_INTERFACES 4
@@ -147,13 +148,12 @@ struct nci_dev {
147/* ----- NCI Devices ----- */ 148/* ----- NCI Devices ----- */
148struct nci_dev *nci_allocate_device(struct nci_ops *ops, 149struct nci_dev *nci_allocate_device(struct nci_ops *ops,
149 __u32 supported_protocols, 150 __u32 supported_protocols,
150 __u32 supported_se,
151 int tx_headroom, 151 int tx_headroom,
152 int tx_tailroom); 152 int tx_tailroom);
153void nci_free_device(struct nci_dev *ndev); 153void 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 sk_buff *skb); 156int nci_recv_frame(struct nci_dev *ndev, struct sk_buff *skb);
157 157
158static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, 158static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev,
159 unsigned int len, 159 unsigned int len,
@@ -202,4 +202,56 @@ void nci_req_complete(struct nci_dev *ndev, int result);
202/* ----- NCI status code ----- */ 202/* ----- NCI status code ----- */
203int nci_to_errno(__u8 code); 203int nci_to_errno(__u8 code);
204 204
205/* ----- NCI over SPI acknowledge modes ----- */
206#define NCI_SPI_CRC_DISABLED 0x00
207#define NCI_SPI_CRC_ENABLED 0x01
208
209/* ----- NCI SPI structures ----- */
210struct nci_spi_dev;
211
212struct nci_spi_ops {
213 int (*open)(struct nci_spi_dev *ndev);
214 int (*close)(struct nci_spi_dev *ndev);
215 void (*assert_int)(struct nci_spi_dev *ndev);
216 void (*deassert_int)(struct nci_spi_dev *ndev);
217};
218
219struct nci_spi_dev {
220 struct nci_dev *nci_dev;
221 struct spi_device *spi;
222 struct nci_spi_ops *ops;
223
224 unsigned int xfer_udelay; /* microseconds delay between
225 transactions */
226 u8 acknowledge_mode;
227
228 struct completion req_completion;
229 u8 req_result;
230
231 void *driver_data;
232};
233
234/* ----- NCI SPI Devices ----- */
235struct nci_spi_dev *nci_spi_allocate_device(struct spi_device *spi,
236 struct nci_spi_ops *ops,
237 u32 supported_protocols,
238 u32 supported_se,
239 u8 acknowledge_mode,
240 unsigned int delay);
241void nci_spi_free_device(struct nci_spi_dev *ndev);
242int nci_spi_register_device(struct nci_spi_dev *ndev);
243void nci_spi_unregister_device(struct nci_spi_dev *ndev);
244int nci_spi_recv_frame(struct nci_spi_dev *ndev);
245
246static inline void nci_spi_set_drvdata(struct nci_spi_dev *ndev,
247 void *data)
248{
249 ndev->driver_data = data;
250}
251
252static inline void *nci_spi_get_drvdata(struct nci_spi_dev *ndev)
253{
254 return ndev->driver_data;
255}
256
205#endif /* __NCI_CORE_H */ 257#endif /* __NCI_CORE_H */
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 5eb80bb3cbb2..0e353f1658bb 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -68,8 +68,12 @@ struct nfc_ops {
68 void *cb_context); 68 void *cb_context);
69 int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb); 69 int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb);
70 int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); 70 int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target);
71 int (*enable_se)(struct nfc_dev *dev, u32 secure_element); 71 int (*fw_upload)(struct nfc_dev *dev, const char *firmware_name);
72 int (*disable_se)(struct nfc_dev *dev, u32 secure_element); 72
73 /* Secure Element API */
74 int (*discover_se)(struct nfc_dev *dev);
75 int (*enable_se)(struct nfc_dev *dev, u32 se_idx);
76 int (*disable_se)(struct nfc_dev *dev, u32 se_idx);
73}; 77};
74 78
75#define NFC_TARGET_IDX_ANY -1 79#define NFC_TARGET_IDX_ANY -1
@@ -83,6 +87,8 @@ struct nfc_target {
83 u8 sel_res; 87 u8 sel_res;
84 u8 nfcid1_len; 88 u8 nfcid1_len;
85 u8 nfcid1[NFC_NFCID1_MAXSIZE]; 89 u8 nfcid1[NFC_NFCID1_MAXSIZE];
90 u8 nfcid2_len;
91 u8 nfcid2[NFC_NFCID2_MAXSIZE];
86 u8 sensb_res_len; 92 u8 sensb_res_len;
87 u8 sensb_res[NFC_SENSB_RES_MAXSIZE]; 93 u8 sensb_res[NFC_SENSB_RES_MAXSIZE];
88 u8 sensf_res_len; 94 u8 sensf_res_len;
@@ -91,6 +97,23 @@ struct nfc_target {
91 u8 logical_idx; 97 u8 logical_idx;
92}; 98};
93 99
100/**
101 * nfc_se - A structure for NFC accessible secure elements.
102 *
103 * @idx: The secure element index. User space will enable or
104 * disable a secure element by its index.
105 * @type: The secure element type. It can be SE_UICC or
106 * SE_EMBEDDED.
107 * @state: The secure element state, either enabled or disabled.
108 *
109 */
110struct nfc_se {
111 struct list_head list;
112 u32 idx;
113 u16 type;
114 u16 state;
115};
116
94struct nfc_genl_data { 117struct nfc_genl_data {
95 u32 poll_req_portid; 118 u32 poll_req_portid;
96 struct mutex genl_data_mutex; 119 struct mutex genl_data_mutex;
@@ -104,6 +127,7 @@ struct nfc_dev {
104 int targets_generation; 127 int targets_generation;
105 struct device dev; 128 struct device dev;
106 bool dev_up; 129 bool dev_up;
130 bool fw_upload_in_progress;
107 u8 rf_mode; 131 u8 rf_mode;
108 bool polling; 132 bool polling;
109 struct nfc_target *active_target; 133 struct nfc_target *active_target;
@@ -111,8 +135,7 @@ struct nfc_dev {
111 struct nfc_genl_data genl_data; 135 struct nfc_genl_data genl_data;
112 u32 supported_protocols; 136 u32 supported_protocols;
113 137
114 u32 supported_se; 138 struct list_head secure_elements;
115 u32 active_se;
116 139
117 int tx_headroom; 140 int tx_headroom;
118 int tx_tailroom; 141 int tx_tailroom;
@@ -132,7 +155,6 @@ extern struct class nfc_class;
132 155
133struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, 156struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
134 u32 supported_protocols, 157 u32 supported_protocols,
135 u32 supported_se,
136 int tx_headroom, 158 int tx_headroom,
137 int tx_tailroom); 159 int tx_tailroom);
138 160
@@ -216,4 +238,7 @@ int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb);
216 238
217void nfc_driver_failure(struct nfc_dev *dev, int err); 239void nfc_driver_failure(struct nfc_dev *dev, int err);
218 240
241int nfc_add_se(struct nfc_dev *dev, u32 se_idx, u16 type);
242int nfc_remove_se(struct nfc_dev *dev, u32 se_idx);
243
219#endif /* __NET_NFC_H */ 244#endif /* __NET_NFC_H */
diff --git a/include/net/ping.h b/include/net/ping.h
index 682b5ae9af51..5db0224b73ac 100644
--- a/include/net/ping.h
+++ b/include/net/ping.h
@@ -13,6 +13,7 @@
13#ifndef _PING_H 13#ifndef _PING_H
14#define _PING_H 14#define _PING_H
15 15
16#include <net/icmp.h>
16#include <net/netns/hash.h> 17#include <net/netns/hash.h>
17 18
18/* PING_HTABLE_SIZE must be power of 2 */ 19/* PING_HTABLE_SIZE must be power of 2 */
@@ -28,6 +29,18 @@
28 */ 29 */
29#define GID_T_MAX (((gid_t)~0U) >> 1) 30#define GID_T_MAX (((gid_t)~0U) >> 1)
30 31
32/* Compatibility glue so we can support IPv6 when it's compiled as a module */
33struct pingv6_ops {
34 int (*ipv6_recv_error)(struct sock *sk, struct msghdr *msg, int len);
35 int (*ip6_datagram_recv_ctl)(struct sock *sk, struct msghdr *msg,
36 struct sk_buff *skb);
37 int (*icmpv6_err_convert)(u8 type, u8 code, int *err);
38 void (*ipv6_icmp_error)(struct sock *sk, struct sk_buff *skb, int err,
39 __be16 port, u32 info, u8 *payload);
40 int (*ipv6_chk_addr)(struct net *net, const struct in6_addr *addr,
41 const struct net_device *dev, int strict);
42};
43
31struct ping_table { 44struct ping_table {
32 struct hlist_nulls_head hash[PING_HTABLE_SIZE]; 45 struct hlist_nulls_head hash[PING_HTABLE_SIZE];
33 rwlock_t lock; 46 rwlock_t lock;
@@ -36,20 +49,66 @@ struct ping_table {
36struct ping_iter_state { 49struct ping_iter_state {
37 struct seq_net_private p; 50 struct seq_net_private p;
38 int bucket; 51 int bucket;
52 sa_family_t family;
39}; 53};
40 54
41extern struct proto ping_prot; 55extern struct proto ping_prot;
56extern struct ping_table ping_table;
57#if IS_ENABLED(CONFIG_IPV6)
58extern struct pingv6_ops pingv6_ops;
59#endif
60
61struct pingfakehdr {
62 struct icmphdr icmph;
63 struct iovec *iov;
64 sa_family_t family;
65 __wsum wcheck;
66};
67
68int ping_get_port(struct sock *sk, unsigned short ident);
69void ping_hash(struct sock *sk);
70void ping_unhash(struct sock *sk);
42 71
72int ping_init_sock(struct sock *sk);
73void ping_close(struct sock *sk, long timeout);
74int ping_bind(struct sock *sk, struct sockaddr *uaddr, int addr_len);
75void ping_err(struct sk_buff *skb, int offset, u32 info);
76int ping_getfrag(void *from, char *to, int offset, int fraglen, int odd,
77 struct sk_buff *);
43 78
44extern void ping_rcv(struct sk_buff *); 79int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
45extern void ping_err(struct sk_buff *, u32 info); 80 size_t len, int noblock, int flags, int *addr_len);
81int ping_common_sendmsg(int family, struct msghdr *msg, size_t len,
82 void *user_icmph, size_t icmph_len);
83int ping_v4_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
84 size_t len);
85int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
86 size_t len);
87int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
88void ping_rcv(struct sk_buff *skb);
46 89
47#ifdef CONFIG_PROC_FS 90#ifdef CONFIG_PROC_FS
91struct ping_seq_afinfo {
92 char *name;
93 sa_family_t family;
94 const struct file_operations *seq_fops;
95 const struct seq_operations seq_ops;
96};
97
98extern const struct file_operations ping_seq_fops;
99
100void *ping_seq_start(struct seq_file *seq, loff_t *pos, sa_family_t family);
101void *ping_seq_next(struct seq_file *seq, void *v, loff_t *pos);
102void ping_seq_stop(struct seq_file *seq, void *v);
103int ping_proc_register(struct net *net, struct ping_seq_afinfo *afinfo);
104void ping_proc_unregister(struct net *net, struct ping_seq_afinfo *afinfo);
105
48extern int __init ping_proc_init(void); 106extern int __init ping_proc_init(void);
49extern void ping_proc_exit(void); 107extern void ping_proc_exit(void);
50#endif 108#endif
51 109
52void __init ping_init(void); 110void __init ping_init(void);
53 111int __init pingv6_init(void);
112void pingv6_exit(void);
54 113
55#endif /* _PING_H */ 114#endif /* _PING_H */
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index e7f4e21cc3e1..6eab63363e59 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -58,14 +58,12 @@ struct Qdisc {
58 * multiqueue device. 58 * multiqueue device.
59 */ 59 */
60#define TCQ_F_WARN_NONWC (1 << 16) 60#define TCQ_F_WARN_NONWC (1 << 16)
61 int padded; 61 u32 limit;
62 const struct Qdisc_ops *ops; 62 const struct Qdisc_ops *ops;
63 struct qdisc_size_table __rcu *stab; 63 struct qdisc_size_table __rcu *stab;
64 struct list_head list; 64 struct list_head list;
65 u32 handle; 65 u32 handle;
66 u32 parent; 66 u32 parent;
67 atomic_t refcnt;
68 struct gnet_stats_rate_est rate_est;
69 int (*reshape_fail)(struct sk_buff *skb, 67 int (*reshape_fail)(struct sk_buff *skb,
70 struct Qdisc *q); 68 struct Qdisc *q);
71 69
@@ -76,8 +74,9 @@ struct Qdisc {
76 */ 74 */
77 struct Qdisc *__parent; 75 struct Qdisc *__parent;
78 struct netdev_queue *dev_queue; 76 struct netdev_queue *dev_queue;
79 struct Qdisc *next_sched;
80 77
78 struct gnet_stats_rate_est64 rate_est;
79 struct Qdisc *next_sched;
81 struct sk_buff *gso_skb; 80 struct sk_buff *gso_skb;
82 /* 81 /*
83 * For performance sake on SMP, we put highly modified fields at the end 82 * For performance sake on SMP, we put highly modified fields at the end
@@ -88,8 +87,10 @@ struct Qdisc {
88 unsigned int __state; 87 unsigned int __state;
89 struct gnet_stats_queue qstats; 88 struct gnet_stats_queue qstats;
90 struct rcu_head rcu_head; 89 struct rcu_head rcu_head;
91 spinlock_t busylock; 90 int padded;
92 u32 limit; 91 atomic_t refcnt;
92
93 spinlock_t busylock ____cacheline_aligned_in_smp;
93}; 94};
94 95
95static inline bool qdisc_is_running(const struct Qdisc *qdisc) 96static inline bool qdisc_is_running(const struct Qdisc *qdisc)
@@ -679,7 +680,7 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask,
679#endif 680#endif
680 681
681struct psched_ratecfg { 682struct psched_ratecfg {
682 u64 rate_bps; 683 u64 rate_bytes_ps; /* bytes per second */
683 u32 mult; 684 u32 mult;
684 u16 overhead; 685 u16 overhead;
685 u8 shift; 686 u8 shift;
@@ -697,7 +698,7 @@ static inline void psched_ratecfg_getrate(struct tc_ratespec *res,
697 const struct psched_ratecfg *r) 698 const struct psched_ratecfg *r)
698{ 699{
699 memset(res, 0, sizeof(*res)); 700 memset(res, 0, sizeof(*res));
700 res->rate = r->rate_bps >> 3; 701 res->rate = r->rate_bytes_ps;
701 res->overhead = r->overhead; 702 res->overhead = r->overhead;
702} 703}
703 704
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index 5a2110d3176d..0cb08e6fb6df 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -42,6 +42,9 @@
42 * be incorporated into the next SCTP release. 42 * be incorporated into the next SCTP release.
43 */ 43 */
44 44
45#ifndef __sctp_checksum_h__
46#define __sctp_checksum_h__
47
45#include <linux/types.h> 48#include <linux/types.h>
46#include <net/sctp/sctp.h> 49#include <net/sctp/sctp.h>
47#include <linux/crc32c.h> 50#include <linux/crc32c.h>
@@ -81,3 +84,5 @@ static inline __le32 sctp_end_cksum(__u32 crc32)
81{ 84{
82 return cpu_to_le32(~crc32); 85 return cpu_to_le32(~crc32);
83} 86}
87
88#endif /* __sctp_checksum_h__ */
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index cd89510eab2a..d8e37ecea691 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -83,30 +83,12 @@
83#include <net/sctp/structs.h> 83#include <net/sctp/structs.h>
84#include <net/sctp/constants.h> 84#include <net/sctp/constants.h>
85 85
86
87/* Set SCTP_DEBUG flag via config if not already set. */
88#ifndef SCTP_DEBUG
89#ifdef CONFIG_SCTP_DBG_MSG
90#define SCTP_DEBUG 1
91#else
92#define SCTP_DEBUG 0
93#endif /* CONFIG_SCTP_DBG */
94#endif /* SCTP_DEBUG */
95
96#ifdef CONFIG_IP_SCTP_MODULE 86#ifdef CONFIG_IP_SCTP_MODULE
97#define SCTP_PROTOSW_FLAG 0 87#define SCTP_PROTOSW_FLAG 0
98#else /* static! */ 88#else /* static! */
99#define SCTP_PROTOSW_FLAG INET_PROTOSW_PERMANENT 89#define SCTP_PROTOSW_FLAG INET_PROTOSW_PERMANENT
100#endif 90#endif
101 91
102
103/* Certain internal static functions need to be exported when
104 * compiled into the test frame.
105 */
106#ifndef SCTP_STATIC
107#define SCTP_STATIC static
108#endif
109
110/* 92/*
111 * Function declarations. 93 * Function declarations.
112 */ 94 */
@@ -196,11 +178,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
196 * Section: Macros, externs, and inlines 178 * Section: Macros, externs, and inlines
197 */ 179 */
198 180
199
200#ifdef TEST_FRAME
201#include <test_frame.h>
202#else
203
204/* spin lock wrappers. */ 181/* spin lock wrappers. */
205#define sctp_spin_lock_irqsave(lock, flags) spin_lock_irqsave(lock, flags) 182#define sctp_spin_lock_irqsave(lock, flags) spin_lock_irqsave(lock, flags)
206#define sctp_spin_unlock_irqrestore(lock, flags) \ 183#define sctp_spin_unlock_irqrestore(lock, flags) \
@@ -226,8 +203,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
226#define SCTP_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)->sctp.sctp_statistics, field) 203#define SCTP_INC_STATS_USER(net, field) SNMP_INC_STATS_USER((net)->sctp.sctp_statistics, field)
227#define SCTP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->sctp.sctp_statistics, field) 204#define SCTP_DEC_STATS(net, field) SNMP_DEC_STATS((net)->sctp.sctp_statistics, field)
228 205
229#endif /* !TEST_FRAME */
230
231/* sctp mib definitions */ 206/* sctp mib definitions */
232enum { 207enum {
233 SCTP_MIB_NUM = 0, 208 SCTP_MIB_NUM = 0,
@@ -285,61 +260,6 @@ static inline void sctp_max_rto(struct sctp_association *asoc,
285 } 260 }
286} 261}
287 262
288/* Print debugging messages. */
289#if SCTP_DEBUG
290extern int sctp_debug_flag;
291#define SCTP_DEBUG_PRINTK(fmt, args...) \
292do { \
293 if (sctp_debug_flag) \
294 printk(KERN_DEBUG pr_fmt(fmt), ##args); \
295} while (0)
296#define SCTP_DEBUG_PRINTK_CONT(fmt, args...) \
297do { \
298 if (sctp_debug_flag) \
299 pr_cont(fmt, ##args); \
300} while (0)
301#define SCTP_DEBUG_PRINTK_IPADDR(fmt_lead, fmt_trail, \
302 args_lead, addr, args_trail...) \
303do { \
304 const union sctp_addr *_addr = (addr); \
305 if (sctp_debug_flag) { \
306 if (_addr->sa.sa_family == AF_INET6) { \
307 printk(KERN_DEBUG \
308 pr_fmt(fmt_lead "%pI6" fmt_trail), \
309 args_lead, \
310 &_addr->v6.sin6_addr, \
311 args_trail); \
312 } else { \
313 printk(KERN_DEBUG \
314 pr_fmt(fmt_lead "%pI4" fmt_trail), \
315 args_lead, \
316 &_addr->v4.sin_addr.s_addr, \
317 args_trail); \
318 } \
319 } \
320} while (0)
321#define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; }
322#define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; }
323
324#define SCTP_ASSERT(expr, str, func) \
325 if (!(expr)) { \
326 SCTP_DEBUG_PRINTK("Assertion Failed: %s(%s) at %s:%s:%d\n", \
327 str, (#expr), __FILE__, __func__, __LINE__); \
328 func; \
329 }
330
331#else /* SCTP_DEBUG */
332
333#define SCTP_DEBUG_PRINTK(whatever...)
334#define SCTP_DEBUG_PRINTK_CONT(fmt, args...)
335#define SCTP_DEBUG_PRINTK_IPADDR(whatever...)
336#define SCTP_ENABLE_DEBUG
337#define SCTP_DISABLE_DEBUG
338#define SCTP_ASSERT(expr, str, func)
339
340#endif /* SCTP_DEBUG */
341
342
343/* 263/*
344 * Macros for keeping a global reference of object allocations. 264 * Macros for keeping a global reference of object allocations.
345 */ 265 */
@@ -575,27 +495,6 @@ for (pos = chunk->subh.fwdtsn_hdr->skip;\
575/* Round an int up to the next multiple of 4. */ 495/* Round an int up to the next multiple of 4. */
576#define WORD_ROUND(s) (((s)+3)&~3) 496#define WORD_ROUND(s) (((s)+3)&~3)
577 497
578/* Make a new instance of type. */
579#define t_new(type, flags) kzalloc(sizeof(type), flags)
580
581/* Compare two timevals. */
582#define tv_lt(s, t) \
583 (s.tv_sec < t.tv_sec || (s.tv_sec == t.tv_sec && s.tv_usec < t.tv_usec))
584
585/* Add tv1 to tv2. */
586#define TIMEVAL_ADD(tv1, tv2) \
587({ \
588 suseconds_t usecs = (tv2).tv_usec + (tv1).tv_usec; \
589 time_t secs = (tv2).tv_sec + (tv1).tv_sec; \
590\
591 if (usecs >= 1000000) { \
592 usecs -= 1000000; \
593 secs++; \
594 } \
595 (tv2).tv_sec = secs; \
596 (tv2).tv_usec = usecs; \
597})
598
599/* External references. */ 498/* External references. */
600 499
601extern struct proto sctp_prot; 500extern struct proto sctp_prot;
@@ -633,16 +532,6 @@ static inline int param_type2af(__be16 type)
633 } 532 }
634} 533}
635 534
636/* Perform some sanity checks. */
637static inline int sctp_sanity_check(void)
638{
639 SCTP_ASSERT(sizeof(struct sctp_ulpevent) <=
640 sizeof(((struct sk_buff *)0)->cb),
641 "SCTP: ulpevent does not fit in skb!\n", return 0);
642
643 return 1;
644}
645
646/* Warning: The following hash functions assume a power of two 'size'. */ 535/* Warning: The following hash functions assume a power of two 'size'. */
647/* This is the hash function for the SCTP port hash table. */ 536/* This is the hash function for the SCTP port hash table. */
648static inline int sctp_phashfn(struct net *net, __u16 lport) 537static inline int sctp_phashfn(struct net *net, __u16 lport)
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 1bd4c4144fe8..e745c92a1532 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -54,7 +54,7 @@
54#ifndef __sctp_structs_h__ 54#ifndef __sctp_structs_h__
55#define __sctp_structs_h__ 55#define __sctp_structs_h__
56 56
57#include <linux/time.h> /* We get struct timespec. */ 57#include <linux/ktime.h>
58#include <linux/socket.h> /* linux/in.h needs this!! */ 58#include <linux/socket.h> /* linux/in.h needs this!! */
59#include <linux/in.h> /* We get struct sockaddr_in. */ 59#include <linux/in.h> /* We get struct sockaddr_in. */
60#include <linux/in6.h> /* We get struct in6_addr */ 60#include <linux/in6.h> /* We get struct in6_addr */
@@ -284,7 +284,7 @@ struct sctp_cookie {
284 __u32 peer_ttag; 284 __u32 peer_ttag;
285 285
286 /* When does this cookie expire? */ 286 /* When does this cookie expire? */
287 struct timeval expiration; 287 ktime_t expiration;
288 288
289 /* Number of inbound/outbound streams which are set 289 /* Number of inbound/outbound streams which are set
290 * and negotiated during the INIT process. 290 * and negotiated during the INIT process.
@@ -1537,7 +1537,7 @@ struct sctp_association {
1537 sctp_state_t state; 1537 sctp_state_t state;
1538 1538
1539 /* The cookie life I award for any cookie. */ 1539 /* The cookie life I award for any cookie. */
1540 struct timeval cookie_life; 1540 ktime_t cookie_life;
1541 1541
1542 /* Overall : The overall association error count. 1542 /* Overall : The overall association error count.
1543 * Error Count : [Clear this any time I get something.] 1543 * Error Count : [Clear this any time I get something.]
diff --git a/include/net/sock.h b/include/net/sock.h
index 66772cf8c3c5..95a5a2c6925a 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -229,6 +229,8 @@ struct cg_proto;
229 * @sk_omem_alloc: "o" is "option" or "other" 229 * @sk_omem_alloc: "o" is "option" or "other"
230 * @sk_wmem_queued: persistent queue size 230 * @sk_wmem_queued: persistent queue size
231 * @sk_forward_alloc: space allocated forward 231 * @sk_forward_alloc: space allocated forward
232 * @sk_napi_id: id of the last napi context to receive data for sk
233 * @sk_ll_usec: usecs to busypoll when there is no data
232 * @sk_allocation: allocation mode 234 * @sk_allocation: allocation mode
233 * @sk_sndbuf: size of send buffer in bytes 235 * @sk_sndbuf: size of send buffer in bytes
234 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, 236 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE,
@@ -325,6 +327,10 @@ struct sock {
325#ifdef CONFIG_RPS 327#ifdef CONFIG_RPS
326 __u32 sk_rxhash; 328 __u32 sk_rxhash;
327#endif 329#endif
330#ifdef CONFIG_NET_LL_RX_POLL
331 unsigned int sk_napi_id;
332 unsigned int sk_ll_usec;
333#endif
328 atomic_t sk_drops; 334 atomic_t sk_drops;
329 int sk_rcvbuf; 335 int sk_rcvbuf;
330 336
@@ -2041,18 +2047,21 @@ static inline void sk_wake_async(struct sock *sk, int how, int band)
2041 sock_wake_async(sk->sk_socket, how, band); 2047 sock_wake_async(sk->sk_socket, how, band);
2042} 2048}
2043 2049
2044#define SOCK_MIN_SNDBUF 2048 2050/* Since sk_{r,w}mem_alloc sums skb->truesize, even a small frame might
2045/* 2051 * need sizeof(sk_buff) + MTU + padding, unless net driver perform copybreak.
2046 * Since sk_rmem_alloc sums skb->truesize, even a small frame might need 2052 * Note: for send buffers, TCP works better if we can build two skbs at
2047 * sizeof(sk_buff) + MTU + padding, unless net driver perform copybreak 2053 * minimum.
2048 */ 2054 */
2049#define SOCK_MIN_RCVBUF (2048 + sizeof(struct sk_buff)) 2055#define TCP_SKB_MIN_TRUESIZE (2048 + SKB_DATA_ALIGN(sizeof(struct sk_buff)))
2056
2057#define SOCK_MIN_SNDBUF (TCP_SKB_MIN_TRUESIZE * 2)
2058#define SOCK_MIN_RCVBUF TCP_SKB_MIN_TRUESIZE
2050 2059
2051static inline void sk_stream_moderate_sndbuf(struct sock *sk) 2060static inline void sk_stream_moderate_sndbuf(struct sock *sk)
2052{ 2061{
2053 if (!(sk->sk_userlocks & SOCK_SNDBUF_LOCK)) { 2062 if (!(sk->sk_userlocks & SOCK_SNDBUF_LOCK)) {
2054 sk->sk_sndbuf = min(sk->sk_sndbuf, sk->sk_wmem_queued >> 1); 2063 sk->sk_sndbuf = min(sk->sk_sndbuf, sk->sk_wmem_queued >> 1);
2055 sk->sk_sndbuf = max(sk->sk_sndbuf, SOCK_MIN_SNDBUF); 2064 sk->sk_sndbuf = max_t(u32, sk->sk_sndbuf, SOCK_MIN_SNDBUF);
2056 } 2065 }
2057} 2066}
2058 2067
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 5bba80fbd1d9..d1980054ec75 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -61,9 +61,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
61 */ 61 */
62#define MAX_TCP_WINDOW 32767U 62#define MAX_TCP_WINDOW 32767U
63 63
64/* Offer an initial receive window of 10 mss. */
65#define TCP_DEFAULT_INIT_RCVWND 10
66
67/* Minimal accepted MSS. It is (60+60+8) - (20+20). */ 64/* Minimal accepted MSS. It is (60+60+8) - (20+20). */
68#define TCP_MIN_MSS 88U 65#define TCP_MIN_MSS 88U
69 66
@@ -1047,6 +1044,8 @@ static inline void tcp_sack_reset(struct tcp_options_received *rx_opt)
1047 rx_opt->num_sacks = 0; 1044 rx_opt->num_sacks = 0;
1048} 1045}
1049 1046
1047extern u32 tcp_default_init_rwnd(u32 mss);
1048
1050/* Determine a window scaling and initial window to offer. */ 1049/* Determine a window scaling and initial window to offer. */
1051extern void tcp_select_initial_window(int __space, __u32 mss, 1050extern void tcp_select_initial_window(int __space, __u32 mss,
1052 __u32 *rcv_wnd, __u32 *window_clamp, 1051 __u32 *rcv_wnd, __u32 *window_clamp,
@@ -1193,7 +1192,6 @@ static inline void tcp_mib_init(struct net *net)
1193static inline void tcp_clear_retrans_hints_partial(struct tcp_sock *tp) 1192static inline void tcp_clear_retrans_hints_partial(struct tcp_sock *tp)
1194{ 1193{
1195 tp->lost_skb_hint = NULL; 1194 tp->lost_skb_hint = NULL;
1196 tp->scoreboard_skb_hint = NULL;
1197} 1195}
1198 1196
1199static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp) 1197static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp)
@@ -1284,11 +1282,13 @@ static inline struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk,
1284#define tcp_twsk_md5_key(twsk) NULL 1282#define tcp_twsk_md5_key(twsk) NULL
1285#endif 1283#endif
1286 1284
1287extern struct tcp_md5sig_pool __percpu *tcp_alloc_md5sig_pool(struct sock *); 1285extern bool tcp_alloc_md5sig_pool(void);
1288extern void tcp_free_md5sig_pool(void);
1289 1286
1290extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); 1287extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void);
1291extern void tcp_put_md5sig_pool(void); 1288static inline void tcp_put_md5sig_pool(void)
1289{
1290 local_bh_enable();
1291}
1292 1292
1293extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, const struct tcphdr *); 1293extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, const struct tcphdr *);
1294extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff *, 1294extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff *,
@@ -1319,9 +1319,9 @@ void tcp_fastopen_cookie_gen(__be32 addr, struct tcp_fastopen_cookie *foc);
1319 1319
1320/* Fastopen key context */ 1320/* Fastopen key context */
1321struct tcp_fastopen_context { 1321struct tcp_fastopen_context {
1322 struct crypto_cipher __rcu *tfm; 1322 struct crypto_cipher *tfm;
1323 __u8 key[TCP_FASTOPEN_KEY_LENGTH]; 1323 __u8 key[TCP_FASTOPEN_KEY_LENGTH];
1324 struct rcu_head rcu; 1324 struct rcu_head rcu;
1325}; 1325};
1326 1326
1327/* write queue abstraction */ 1327/* write queue abstraction */
@@ -1540,15 +1540,14 @@ extern struct request_sock_ops tcp6_request_sock_ops;
1540 1540
1541extern void tcp_v4_destroy_sock(struct sock *sk); 1541extern void tcp_v4_destroy_sock(struct sock *sk);
1542 1542
1543extern int tcp_v4_gso_send_check(struct sk_buff *skb);
1544extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, 1543extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb,
1545 netdev_features_t features); 1544 netdev_features_t features);
1546extern struct sk_buff **tcp_gro_receive(struct sk_buff **head, 1545extern struct sk_buff **tcp_gro_receive(struct sk_buff **head,
1547 struct sk_buff *skb); 1546 struct sk_buff *skb);
1548extern struct sk_buff **tcp4_gro_receive(struct sk_buff **head,
1549 struct sk_buff *skb);
1550extern int tcp_gro_complete(struct sk_buff *skb); 1547extern int tcp_gro_complete(struct sk_buff *skb);
1551extern int tcp4_gro_complete(struct sk_buff *skb); 1548
1549extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr,
1550 __be32 daddr);
1552 1551
1553#ifdef CONFIG_PROC_FS 1552#ifdef CONFIG_PROC_FS
1554extern int tcp4_proc_init(void); 1553extern int tcp4_proc_init(void);
@@ -1583,6 +1582,8 @@ struct tcp_request_sock_ops {
1583#endif 1582#endif
1584}; 1583};
1585 1584
1585extern int tcpv4_offload_init(void);
1586
1586extern void tcp_v4_init(void); 1587extern void tcp_v4_init(void);
1587extern void tcp_init(void); 1588extern void tcp_init(void);
1588 1589
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 938b7fd11204..48660e50ae90 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -3,56 +3,57 @@
3 3
4#include <net/checksum.h> 4#include <net/checksum.h>
5 5
6/* 6/* IPv6 transport protocols */
7 * IPv6 transport protocols
8 */
9
10extern struct proto rawv6_prot; 7extern struct proto rawv6_prot;
11extern struct proto udpv6_prot; 8extern struct proto udpv6_prot;
12extern struct proto udplitev6_prot; 9extern struct proto udplitev6_prot;
13extern struct proto tcpv6_prot; 10extern struct proto tcpv6_prot;
11extern struct proto pingv6_prot;
14 12
15struct flowi6; 13struct flowi6;
16 14
17/* extension headers */ 15/* extension headers */
18extern int ipv6_exthdrs_init(void); 16int ipv6_exthdrs_init(void);
19extern void ipv6_exthdrs_exit(void); 17void ipv6_exthdrs_exit(void);
20extern int ipv6_frag_init(void); 18int ipv6_frag_init(void);
21extern void ipv6_frag_exit(void); 19void ipv6_frag_exit(void);
22 20
23/* transport protocols */ 21/* transport protocols */
24extern int rawv6_init(void); 22int pingv6_init(void);
25extern void rawv6_exit(void); 23void pingv6_exit(void);
26extern int udpv6_init(void); 24int rawv6_init(void);
27extern void udpv6_exit(void); 25void rawv6_exit(void);
28extern int udplitev6_init(void); 26int udpv6_init(void);
29extern void udplitev6_exit(void); 27void udpv6_exit(void);
30extern int tcpv6_init(void); 28int udplitev6_init(void);
31extern void tcpv6_exit(void); 29void udplitev6_exit(void);
32 30int tcpv6_init(void);
33extern int udpv6_connect(struct sock *sk, 31void tcpv6_exit(void);
34 struct sockaddr *uaddr, 32
35 int addr_len); 33int udpv6_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
36 34
37extern int ip6_datagram_recv_ctl(struct sock *sk, 35int ip6_datagram_recv_ctl(struct sock *sk, struct msghdr *msg,
38 struct msghdr *msg, 36 struct sk_buff *skb);
39 struct sk_buff *skb); 37
40 38int ip6_datagram_send_ctl(struct net *net, struct sock *sk, struct msghdr *msg,
41extern int ip6_datagram_send_ctl(struct net *net, 39 struct flowi6 *fl6, struct ipv6_txoptions *opt,
42 struct sock *sk, 40 int *hlimit, int *tclass, int *dontfrag);
43 struct msghdr *msg, 41
44 struct flowi6 *fl6, 42void ip6_dgram_sock_seq_show(struct seq_file *seq, struct sock *sp,
45 struct ipv6_txoptions *opt, 43 __u16 srcp, __u16 destp, int bucket);
46 int *hlimit, int *tclass, 44
47 int *dontfrag); 45#define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006)
48 46
49#define LOOPBACK4_IPV6 cpu_to_be32(0x7f000006) 47/* address family specific functions */
50
51/*
52 * address family specific functions
53 */
54extern const struct inet_connection_sock_af_ops ipv4_specific; 48extern const struct inet_connection_sock_af_ops ipv4_specific;
55 49
56extern void inet6_destroy_sock(struct sock *sk); 50void inet6_destroy_sock(struct sock *sk);
51
52#define IPV6_SEQ_DGRAM_HEADER \
53 " sl " \
54 "local_address " \
55 "remote_address " \
56 "st tx_queue rx_queue tr tm->when retrnsmt" \
57 " uid timeout inode ref pointer drops\n"
57 58
58#endif 59#endif
diff --git a/include/net/udp.h b/include/net/udp.h
index 065f379c6503..74c10ec5e74f 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -181,12 +181,15 @@ extern int udp_get_port(struct sock *sk, unsigned short snum,
181extern void udp_err(struct sk_buff *, u32); 181extern void udp_err(struct sk_buff *, u32);
182extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk, 182extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
183 struct msghdr *msg, size_t len); 183 struct msghdr *msg, size_t len);
184extern int udp_push_pending_frames(struct sock *sk);
184extern void udp_flush_pending_frames(struct sock *sk); 185extern void udp_flush_pending_frames(struct sock *sk);
185extern int udp_rcv(struct sk_buff *skb); 186extern int udp_rcv(struct sk_buff *skb);
186extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); 187extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
187extern int udp_disconnect(struct sock *sk, int flags); 188extern int udp_disconnect(struct sock *sk, int flags);
188extern unsigned int udp_poll(struct file *file, struct socket *sock, 189extern unsigned int udp_poll(struct file *file, struct socket *sock,
189 poll_table *wait); 190 poll_table *wait);
191extern struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
192 netdev_features_t features);
190extern int udp_lib_getsockopt(struct sock *sk, int level, int optname, 193extern int udp_lib_getsockopt(struct sock *sk, int level, int optname,
191 char __user *optval, int __user *optlen); 194 char __user *optval, int __user *optlen);
192extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, 195extern int udp_lib_setsockopt(struct sock *sk, int level, int optname,
@@ -262,11 +265,10 @@ extern int udp4_proc_init(void);
262extern void udp4_proc_exit(void); 265extern void udp4_proc_exit(void);
263#endif 266#endif
264 267
268extern int udpv4_offload_init(void);
269
265extern void udp_init(void); 270extern void udp_init(void);
266 271
267extern int udp4_ufo_send_check(struct sk_buff *skb);
268extern struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb,
269 netdev_features_t features);
270extern void udp_encap_enable(void); 272extern void udp_encap_enable(void);
271#if IS_ENABLED(CONFIG_IPV6) 273#if IS_ENABLED(CONFIG_IPV6)
272extern void udpv6_encap_enable(void); 274extern void udpv6_encap_enable(void);
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index fe7f06c86f68..9d28ded2a3f4 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -489,6 +489,11 @@ enum iscsi_param {
489 489
490 ISCSI_PARAM_CHAP_IN_IDX, 490 ISCSI_PARAM_CHAP_IN_IDX,
491 ISCSI_PARAM_CHAP_OUT_IDX, 491 ISCSI_PARAM_CHAP_OUT_IDX,
492
493 ISCSI_PARAM_BOOT_ROOT,
494 ISCSI_PARAM_BOOT_NIC,
495 ISCSI_PARAM_BOOT_TARGET,
496
492 /* must always be last */ 497 /* must always be last */
493 ISCSI_PARAM_MAX, 498 ISCSI_PARAM_MAX,
494}; 499};
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 09c041e6c35f..4265a4bb83cd 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -287,6 +287,10 @@ struct iscsi_session {
287 char *targetalias; 287 char *targetalias;
288 char *ifacename; 288 char *ifacename;
289 char *initiatorname; 289 char *initiatorname;
290 char *boot_root;
291 char *boot_nic;
292 char *boot_target;
293
290 /* control data */ 294 /* control data */
291 struct iscsi_transport *tt; 295 struct iscsi_transport *tt;
292 struct Scsi_Host *host; 296 struct Scsi_Host *host;
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index e2c1e66d58ae..f843dd8722a9 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -608,7 +608,7 @@ struct sas_ssp_task {
608 u8 enable_first_burst:1; 608 u8 enable_first_burst:1;
609 enum task_attribute task_attr; 609 enum task_attribute task_attr;
610 u8 task_prio; 610 u8 task_prio;
611 u8 cdb[16]; 611 struct scsi_cmnd *cmd;
612}; 612};
613 613
614struct sas_task { 614struct sas_task {
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 66216c1acb48..4b87d99e7fa1 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -10,9 +10,14 @@
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12#include <linux/scatterlist.h> 12#include <linux/scatterlist.h>
13#include <linux/kernel.h>
13 14
14struct scsi_cmnd; 15struct scsi_cmnd;
15 16
17enum scsi_timeouts {
18 SCSI_DEFAULT_EH_TIMEOUT = 10 * HZ,
19};
20
16/* 21/*
17 * The maximum number of SG segments that we will put inside a 22 * The maximum number of SG segments that we will put inside a
18 * scatterlist (unless chaining is used). Should ideally fit inside a 23 * scatterlist (unless chaining is used). Should ideally fit inside a
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index cc645876d147..a44954c7cdc2 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -113,6 +113,7 @@ struct scsi_device {
113 * scsi_devinfo.[hc]. For now used only to 113 * scsi_devinfo.[hc]. For now used only to
114 * pass settings from slave_alloc to scsi 114 * pass settings from slave_alloc to scsi
115 * core. */ 115 * core. */
116 unsigned int eh_timeout; /* Error handling timeout */
116 unsigned writeable:1; 117 unsigned writeable:1;
117 unsigned removable:1; 118 unsigned removable:1;
118 unsigned changed:1; /* Data invalid due to media change */ 119 unsigned changed:1; /* Data invalid due to media change */
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h
index cc1f3e786ad7..447d2d7466fc 100644
--- a/include/scsi/scsi_devinfo.h
+++ b/include/scsi/scsi_devinfo.h
@@ -31,4 +31,5 @@
31#define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */ 31#define BLIST_MAX_512 0x800000 /* maximum 512 sector cdb length */
32#define BLIST_ATTACH_PQ3 0x1000000 /* Scan: Attach to PQ3 devices */ 32#define BLIST_ATTACH_PQ3 0x1000000 /* Scan: Attach to PQ3 devices */
33#define BLIST_NO_DIF 0x2000000 /* Disable T10 PI (DIF) */ 33#define BLIST_NO_DIF 0x2000000 /* Disable T10 PI (DIF) */
34#define BLIST_SKIP_VPD_PAGES 0x4000000 /* Ignore SBC-3 VPD pages */
34#endif 35#endif
diff --git a/include/sound/control.h b/include/sound/control.h
index 34bc93d80d55..5358892b1b39 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -233,7 +233,8 @@ snd_ctl_add_slave_uncached(struct snd_kcontrol *master,
233int snd_ctl_add_vmaster_hook(struct snd_kcontrol *kctl, 233int snd_ctl_add_vmaster_hook(struct snd_kcontrol *kctl,
234 void (*hook)(void *private_data, int), 234 void (*hook)(void *private_data, int),
235 void *private_data); 235 void *private_data);
236void snd_ctl_sync_vmaster_hook(struct snd_kcontrol *kctl); 236void snd_ctl_sync_vmaster(struct snd_kcontrol *kctl, bool hook_only);
237#define snd_ctl_sync_vmaster_hook(kctl) snd_ctl_sync_vmaster(kctl, true)
237 238
238/* 239/*
239 * Helper functions for jack-detection controls 240 * Helper functions for jack-detection controls
diff --git a/include/sound/core.h b/include/sound/core.h
index 5bfe5136441c..c586617cfa0d 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -30,7 +30,7 @@
30 30
31/* number of supported soundcards */ 31/* number of supported soundcards */
32#ifdef CONFIG_SND_DYNAMIC_MINORS 32#ifdef CONFIG_SND_DYNAMIC_MINORS
33#define SNDRV_CARDS 32 33#define SNDRV_CARDS CONFIG_SND_MAX_CARDS
34#else 34#else
35#define SNDRV_CARDS 8 /* don't change - minor numbers */ 35#define SNDRV_CARDS 8 /* don't change - minor numbers */
36#endif 36#endif
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index b48792fe386b..84b10f9a2832 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -384,7 +384,7 @@ struct snd_pcm_substream {
384 unsigned int dma_buf_id; 384 unsigned int dma_buf_id;
385 size_t dma_max; 385 size_t dma_max;
386 /* -- hardware operations -- */ 386 /* -- hardware operations -- */
387 struct snd_pcm_ops *ops; 387 const struct snd_pcm_ops *ops;
388 /* -- runtime information -- */ 388 /* -- runtime information -- */
389 struct snd_pcm_runtime *runtime; 389 struct snd_pcm_runtime *runtime;
390 /* -- timer section -- */ 390 /* -- timer section -- */
@@ -871,7 +871,8 @@ const unsigned char *snd_pcm_format_silence_64(snd_pcm_format_t format);
871int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames); 871int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int frames);
872snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsigned, int big_endian); 872snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsigned, int big_endian);
873 873
874void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); 874void snd_pcm_set_ops(struct snd_pcm * pcm, int direction,
875 const struct snd_pcm_ops *ops);
875void snd_pcm_set_sync(struct snd_pcm_substream *substream); 876void snd_pcm_set_sync(struct snd_pcm_substream *substream);
876int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream); 877int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream);
877int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream, 878int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
diff --git a/include/sound/rt5640.h b/include/sound/rt5640.h
new file mode 100644
index 000000000000..27cc75ed67f8
--- /dev/null
+++ b/include/sound/rt5640.h
@@ -0,0 +1,22 @@
1/*
2 * linux/sound/rt5640.h -- Platform data for RT5640
3 *
4 * Copyright 2011 Realtek Microelectronics
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef __LINUX_SND_RT5640_H
12#define __LINUX_SND_RT5640_H
13
14struct rt5640_platform_data {
15 /* IN1 & IN2 can optionally be differential */
16 bool in1_diff;
17 bool in2_diff;
18
19 int ldo1_en; /* GPIO for LDO1_EN */
20};
21
22#endif
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 385c6329a967..3e479f4e15f5 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -311,6 +311,8 @@ struct device;
311#define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ 311#define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */
312#define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ 312#define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */
313#define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ 313#define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */
314#define SND_SOC_DAPM_WILL_PMU 0x40 /* called at start of sequence */
315#define SND_SOC_DAPM_WILL_PMD 0x80 /* called at start of sequence */
314#define SND_SOC_DAPM_PRE_POST_PMD \ 316#define SND_SOC_DAPM_PRE_POST_PMD \
315 (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD) 317 (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD)
316 318
@@ -479,7 +481,6 @@ struct snd_soc_dapm_route {
479/* dapm audio path between two widgets */ 481/* dapm audio path between two widgets */
480struct snd_soc_dapm_path { 482struct snd_soc_dapm_path {
481 const char *name; 483 const char *name;
482 const char *long_name;
483 484
484 /* source (input) and sink (output) widgets */ 485 /* source (input) and sink (output) widgets */
485 struct snd_soc_dapm_widget *source; 486 struct snd_soc_dapm_widget *source;
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 85c15226103b..6eabee7ec15a 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -340,7 +340,7 @@ struct snd_soc_jack_gpio;
340 340
341typedef int (*hw_write_t)(void *,const char* ,int); 341typedef int (*hw_write_t)(void *,const char* ,int);
342 342
343extern struct snd_ac97_bus_ops soc_ac97_ops; 343extern struct snd_ac97_bus_ops *soc_ac97_ops;
344 344
345enum snd_soc_control_type { 345enum snd_soc_control_type {
346 SND_SOC_I2C = 1, 346 SND_SOC_I2C = 1,
@@ -467,6 +467,8 @@ int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
467 struct snd_ac97_bus_ops *ops, int num); 467 struct snd_ac97_bus_ops *ops, int num);
468void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); 468void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
469 469
470int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops);
471
470/* 472/*
471 *Controls 473 *Controls
472 */ 474 */
diff --git a/include/target/iscsi/iscsi_transport.h b/include/target/iscsi/iscsi_transport.h
index 23a87d0cd72c..e5d09d242ba3 100644
--- a/include/target/iscsi/iscsi_transport.h
+++ b/include/target/iscsi/iscsi_transport.h
@@ -34,8 +34,6 @@ extern void iscsit_put_transport(struct iscsit_transport *);
34/* 34/*
35 * From iscsi_target.c 35 * From iscsi_target.c
36 */ 36 */
37extern int iscsit_add_reject_from_cmd(u8, int, int, unsigned char *,
38 struct iscsi_cmd *);
39extern int iscsit_setup_scsi_cmd(struct iscsi_conn *, struct iscsi_cmd *, 37extern int iscsit_setup_scsi_cmd(struct iscsi_conn *, struct iscsi_cmd *,
40 unsigned char *); 38 unsigned char *);
41extern void iscsit_set_unsoliticed_dataout(struct iscsi_cmd *); 39extern void iscsit_set_unsoliticed_dataout(struct iscsi_cmd *);
@@ -45,18 +43,26 @@ extern int iscsit_check_dataout_hdr(struct iscsi_conn *, unsigned char *,
45 struct iscsi_cmd **); 43 struct iscsi_cmd **);
46extern int iscsit_check_dataout_payload(struct iscsi_cmd *, struct iscsi_data *, 44extern int iscsit_check_dataout_payload(struct iscsi_cmd *, struct iscsi_data *,
47 bool); 45 bool);
48extern int iscsit_handle_nop_out(struct iscsi_conn *, struct iscsi_cmd *, 46extern int iscsit_setup_nop_out(struct iscsi_conn *, struct iscsi_cmd *,
49 unsigned char *); 47 struct iscsi_nopout *);
48extern int iscsit_process_nop_out(struct iscsi_conn *, struct iscsi_cmd *,
49 struct iscsi_nopout *);
50extern int iscsit_handle_logout_cmd(struct iscsi_conn *, struct iscsi_cmd *, 50extern int iscsit_handle_logout_cmd(struct iscsi_conn *, struct iscsi_cmd *,
51 unsigned char *); 51 unsigned char *);
52extern int iscsit_handle_task_mgt_cmd(struct iscsi_conn *, struct iscsi_cmd *, 52extern int iscsit_handle_task_mgt_cmd(struct iscsi_conn *, struct iscsi_cmd *,
53 unsigned char *); 53 unsigned char *);
54extern int iscsit_setup_text_cmd(struct iscsi_conn *, struct iscsi_cmd *,
55 struct iscsi_text *);
56extern int iscsit_process_text_cmd(struct iscsi_conn *, struct iscsi_cmd *,
57 struct iscsi_text *);
54extern void iscsit_build_rsp_pdu(struct iscsi_cmd *, struct iscsi_conn *, 58extern void iscsit_build_rsp_pdu(struct iscsi_cmd *, struct iscsi_conn *,
55 bool, struct iscsi_scsi_rsp *); 59 bool, struct iscsi_scsi_rsp *);
56extern void iscsit_build_nopin_rsp(struct iscsi_cmd *, struct iscsi_conn *, 60extern void iscsit_build_nopin_rsp(struct iscsi_cmd *, struct iscsi_conn *,
57 struct iscsi_nopin *, bool); 61 struct iscsi_nopin *, bool);
58extern void iscsit_build_task_mgt_rsp(struct iscsi_cmd *, struct iscsi_conn *, 62extern void iscsit_build_task_mgt_rsp(struct iscsi_cmd *, struct iscsi_conn *,
59 struct iscsi_tm_rsp *); 63 struct iscsi_tm_rsp *);
64extern int iscsit_build_text_rsp(struct iscsi_cmd *, struct iscsi_conn *,
65 struct iscsi_text_rsp *);
60extern void iscsit_build_reject(struct iscsi_cmd *, struct iscsi_conn *, 66extern void iscsit_build_reject(struct iscsi_cmd *, struct iscsi_conn *,
61 struct iscsi_reject *); 67 struct iscsi_reject *);
62extern int iscsit_build_logout_rsp(struct iscsi_cmd *, struct iscsi_conn *, 68extern int iscsit_build_logout_rsp(struct iscsi_cmd *, struct iscsi_conn *,
@@ -67,6 +73,10 @@ extern int iscsit_logout_post_handler(struct iscsi_cmd *, struct iscsi_conn *);
67 */ 73 */
68extern void iscsit_increment_maxcmdsn(struct iscsi_cmd *, struct iscsi_session *); 74extern void iscsit_increment_maxcmdsn(struct iscsi_cmd *, struct iscsi_session *);
69/* 75/*
76 * From iscsi_target_erl0.c
77 */
78extern void iscsit_cause_connection_reinstatement(struct iscsi_conn *, int);
79/*
70 * From iscsi_target_erl1.c 80 * From iscsi_target_erl1.c
71 */ 81 */
72extern void iscsit_stop_dataout_timer(struct iscsi_cmd *); 82extern void iscsit_stop_dataout_timer(struct iscsi_cmd *);
@@ -80,4 +90,5 @@ extern int iscsit_tmr_post_handler(struct iscsi_cmd *, struct iscsi_conn *);
80 * From iscsi_target_util.c 90 * From iscsi_target_util.c
81 */ 91 */
82extern struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *, gfp_t); 92extern struct iscsi_cmd *iscsit_allocate_cmd(struct iscsi_conn *, gfp_t);
83extern int iscsit_sequence_cmd(struct iscsi_conn *, struct iscsi_cmd *, __be32); 93extern int iscsit_sequence_cmd(struct iscsi_conn *, struct iscsi_cmd *,
94 unsigned char *, __be32);
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 4ea4f985f394..e34fc904f2e1 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -218,14 +218,11 @@ enum tcm_tmreq_table {
218 218
219/* fabric independent task management response values */ 219/* fabric independent task management response values */
220enum tcm_tmrsp_table { 220enum tcm_tmrsp_table {
221 TMR_FUNCTION_COMPLETE = 0, 221 TMR_FUNCTION_COMPLETE = 1,
222 TMR_TASK_DOES_NOT_EXIST = 1, 222 TMR_TASK_DOES_NOT_EXIST = 2,
223 TMR_LUN_DOES_NOT_EXIST = 2, 223 TMR_LUN_DOES_NOT_EXIST = 3,
224 TMR_TASK_STILL_ALLEGIANT = 3, 224 TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED = 4,
225 TMR_TASK_FAILOVER_NOT_SUPPORTED = 4, 225 TMR_FUNCTION_REJECTED = 5,
226 TMR_TASK_MGMT_FUNCTION_NOT_SUPPORTED = 5,
227 TMR_FUNCTION_AUTHORIZATION_FAILED = 6,
228 TMR_FUNCTION_REJECTED = 255,
229}; 226};
230 227
231/* 228/*
@@ -339,8 +336,6 @@ struct t10_pr_registration {
339 /* Used during APTPL metadata reading */ 336 /* Used during APTPL metadata reading */
340#define PR_APTPL_MAX_TPORT_LEN 256 337#define PR_APTPL_MAX_TPORT_LEN 256
341 unsigned char pr_tport[PR_APTPL_MAX_TPORT_LEN]; 338 unsigned char pr_tport[PR_APTPL_MAX_TPORT_LEN];
342 /* For writing out live meta data */
343 unsigned char *pr_aptpl_buf;
344 u16 pr_aptpl_rpti; 339 u16 pr_aptpl_rpti;
345 u16 pr_reg_tpgt; 340 u16 pr_reg_tpgt;
346 /* Reservation effects all target ports */ 341 /* Reservation effects all target ports */
@@ -374,9 +369,7 @@ struct t10_reservation {
374 /* Activate Persistence across Target Power Loss enabled 369 /* Activate Persistence across Target Power Loss enabled
375 * for SCSI device */ 370 * for SCSI device */
376 int pr_aptpl_active; 371 int pr_aptpl_active;
377 /* Used by struct t10_reservation->pr_aptpl_buf_len */
378#define PR_APTPL_BUF_LEN 8192 372#define PR_APTPL_BUF_LEN 8192
379 u32 pr_aptpl_buf_len;
380 u32 pr_generation; 373 u32 pr_generation;
381 spinlock_t registration_lock; 374 spinlock_t registration_lock;
382 spinlock_t aptpl_reg_lock; 375 spinlock_t aptpl_reg_lock;
@@ -424,8 +417,6 @@ struct se_cmd {
424 int sam_task_attr; 417 int sam_task_attr;
425 /* Transport protocol dependent state, see transport_state_table */ 418 /* Transport protocol dependent state, see transport_state_table */
426 enum transport_state_table t_state; 419 enum transport_state_table t_state;
427 /* Used to signal cmd->se_tfo->check_release_cmd() usage per cmd */
428 unsigned check_release:1;
429 unsigned cmd_wait_set:1; 420 unsigned cmd_wait_set:1;
430 unsigned unknown_data_length:1; 421 unsigned unknown_data_length:1;
431 /* See se_cmd_flags_table */ 422 /* See se_cmd_flags_table */
@@ -458,7 +449,6 @@ struct se_cmd {
458 unsigned char *t_task_cdb; 449 unsigned char *t_task_cdb;
459 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; 450 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE];
460 unsigned long long t_task_lba; 451 unsigned long long t_task_lba;
461 atomic_t t_fe_count;
462 unsigned int transport_state; 452 unsigned int transport_state;
463#define CMD_T_ABORTED (1 << 0) 453#define CMD_T_ABORTED (1 << 0)
464#define CMD_T_ACTIVE (1 << 1) 454#define CMD_T_ACTIVE (1 << 1)
@@ -802,11 +792,12 @@ struct se_portal_group {
802 struct target_core_fabric_ops *se_tpg_tfo; 792 struct target_core_fabric_ops *se_tpg_tfo;
803 struct se_wwn *se_tpg_wwn; 793 struct se_wwn *se_tpg_wwn;
804 struct config_group tpg_group; 794 struct config_group tpg_group;
805 struct config_group *tpg_default_groups[6]; 795 struct config_group *tpg_default_groups[7];
806 struct config_group tpg_lun_group; 796 struct config_group tpg_lun_group;
807 struct config_group tpg_np_group; 797 struct config_group tpg_np_group;
808 struct config_group tpg_acl_group; 798 struct config_group tpg_acl_group;
809 struct config_group tpg_attrib_group; 799 struct config_group tpg_attrib_group;
800 struct config_group tpg_auth_group;
810 struct config_group tpg_param_group; 801 struct config_group tpg_param_group;
811}; 802};
812 803
diff --git a/include/target/target_core_configfs.h b/include/target/target_core_configfs.h
index 612509592ffd..713c5004f4ae 100644
--- a/include/target/target_core_configfs.h
+++ b/include/target/target_core_configfs.h
@@ -23,6 +23,7 @@ struct target_fabric_configfs_template {
23 struct config_item_type tfc_tpg_np_cit; 23 struct config_item_type tfc_tpg_np_cit;
24 struct config_item_type tfc_tpg_np_base_cit; 24 struct config_item_type tfc_tpg_np_base_cit;
25 struct config_item_type tfc_tpg_attrib_cit; 25 struct config_item_type tfc_tpg_attrib_cit;
26 struct config_item_type tfc_tpg_auth_cit;
26 struct config_item_type tfc_tpg_param_cit; 27 struct config_item_type tfc_tpg_param_cit;
27 struct config_item_type tfc_tpg_nacl_cit; 28 struct config_item_type tfc_tpg_nacl_cit;
28 struct config_item_type tfc_tpg_nacl_base_cit; 29 struct config_item_type tfc_tpg_nacl_base_cit;
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index 1dcce9cc99b9..7a16178424f9 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -61,7 +61,7 @@ struct target_core_fabric_ops {
61 int (*get_cmd_state)(struct se_cmd *); 61 int (*get_cmd_state)(struct se_cmd *);
62 int (*queue_data_in)(struct se_cmd *); 62 int (*queue_data_in)(struct se_cmd *);
63 int (*queue_status)(struct se_cmd *); 63 int (*queue_status)(struct se_cmd *);
64 int (*queue_tm_rsp)(struct se_cmd *); 64 void (*queue_tm_rsp)(struct se_cmd *);
65 /* 65 /*
66 * fabric module calls for target_core_fabric_configfs.c 66 * fabric module calls for target_core_fabric_configfs.c
67 */ 67 */
diff --git a/include/target/target_core_fabric_configfs.h b/include/target/target_core_fabric_configfs.h
index a26fb7586a09..b32a14905cfa 100644
--- a/include/target/target_core_fabric_configfs.h
+++ b/include/target/target_core_fabric_configfs.h
@@ -62,6 +62,17 @@ static struct target_fabric_tpg_attrib_attribute _fabric##_tpg_attrib_##_name =
62 _fabric##_tpg_attrib_show_##_name, \ 62 _fabric##_tpg_attrib_show_##_name, \
63 _fabric##_tpg_attrib_store_##_name); 63 _fabric##_tpg_attrib_store_##_name);
64 64
65CONFIGFS_EATTR_STRUCT(target_fabric_tpg_auth, se_portal_group);
66#define TF_TPG_AUTH_ATTR(_fabric, _name, _mode) \
67static struct target_fabric_tpg_auth_attribute _fabric##_tpg_auth_##_name = \
68 __CONFIGFS_EATTR(_name, _mode, \
69 _fabric##_tpg_auth_show_##_name, \
70 _fabric##_tpg_auth_store_##_name);
71
72#define TF_TPG_AUTH_ATTR_RO(_fabric, _name) \
73static struct target_fabric_tpg_auth_attribute _fabric##_tpg_auth_##_name = \
74 __CONFIGFS_EATTR_RO(_name, \
75 _fabric##_tpg_auth_show_##_name);
65 76
66CONFIGFS_EATTR_STRUCT(target_fabric_tpg_param, se_portal_group); 77CONFIGFS_EATTR_STRUCT(target_fabric_tpg_param, se_portal_group);
67#define TF_TPG_PARAM_ATTR(_fabric, _name, _mode) \ 78#define TF_TPG_PARAM_ATTR(_fabric, _name, _mode) \
diff --git a/include/trace/events/9p.h b/include/trace/events/9p.h
index beeaed8398ec..a0666362c111 100644
--- a/include/trace/events/9p.h
+++ b/include/trace/events/9p.h
@@ -143,31 +143,9 @@ TRACE_EVENT(9p_protocol_dump,
143 __entry->tag = pdu->tag; 143 __entry->tag = pdu->tag;
144 memcpy(__entry->line, pdu->sdata, P9_PROTO_DUMP_SZ); 144 memcpy(__entry->line, pdu->sdata, P9_PROTO_DUMP_SZ);
145 ), 145 ),
146 TP_printk("clnt %lu %s(tag = %d)\n%.3x: " 146 TP_printk("clnt %lu %s(tag = %d)\n%.3x: %16ph\n%.3x: %16ph\n",
147 "%02x %02x %02x %02x %02x %02x %02x %02x " 147 (unsigned long)__entry->clnt, show_9p_op(__entry->type),
148 "%02x %02x %02x %02x %02x %02x %02x %02x\n" 148 __entry->tag, 0, __entry->line, 16, __entry->line + 16)
149 "%.3x: "
150 "%02x %02x %02x %02x %02x %02x %02x %02x "
151 "%02x %02x %02x %02x %02x %02x %02x %02x\n",
152 (long)__entry->clnt, show_9p_op(__entry->type),
153 __entry->tag, 0,
154 __entry->line[0], __entry->line[1],
155 __entry->line[2], __entry->line[3],
156 __entry->line[4], __entry->line[5],
157 __entry->line[6], __entry->line[7],
158 __entry->line[8], __entry->line[9],
159 __entry->line[10], __entry->line[11],
160 __entry->line[12], __entry->line[13],
161 __entry->line[14], __entry->line[15],
162 16,
163 __entry->line[16], __entry->line[17],
164 __entry->line[18], __entry->line[19],
165 __entry->line[20], __entry->line[21],
166 __entry->line[22], __entry->line[23],
167 __entry->line[24], __entry->line[25],
168 __entry->line[26], __entry->line[27],
169 __entry->line[28], __entry->line[29],
170 __entry->line[30], __entry->line[31])
171 ); 149 );
172 150
173#endif /* _TRACE_9P_H */ 151#endif /* _TRACE_9P_H */
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index ea546a4e9609..2902657ba766 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -40,22 +40,25 @@ struct extent_buffer;
40 { BTRFS_ROOT_TREE_DIR_OBJECTID, "ROOT_TREE_DIR" }, \ 40 { BTRFS_ROOT_TREE_DIR_OBJECTID, "ROOT_TREE_DIR" }, \
41 { BTRFS_CSUM_TREE_OBJECTID, "CSUM_TREE" }, \ 41 { BTRFS_CSUM_TREE_OBJECTID, "CSUM_TREE" }, \
42 { BTRFS_TREE_LOG_OBJECTID, "TREE_LOG" }, \ 42 { BTRFS_TREE_LOG_OBJECTID, "TREE_LOG" }, \
43 { BTRFS_QUOTA_TREE_OBJECTID, "QUOTA_TREE" }, \
43 { BTRFS_TREE_RELOC_OBJECTID, "TREE_RELOC" }, \ 44 { BTRFS_TREE_RELOC_OBJECTID, "TREE_RELOC" }, \
44 { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" }) 45 { BTRFS_DATA_RELOC_TREE_OBJECTID, "DATA_RELOC_TREE" })
45 46
46#define show_root_type(obj) \ 47#define show_root_type(obj) \
47 obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \ 48 obj, ((obj >= BTRFS_DATA_RELOC_TREE_OBJECTID) || \
48 (obj >= BTRFS_ROOT_TREE_OBJECTID && \ 49 (obj >= BTRFS_ROOT_TREE_OBJECTID && \
49 obj <= BTRFS_CSUM_TREE_OBJECTID)) ? __show_root_type(obj) : "-" 50 obj <= BTRFS_QUOTA_TREE_OBJECTID)) ? __show_root_type(obj) : "-"
50 51
51#define BTRFS_GROUP_FLAGS \ 52#define BTRFS_GROUP_FLAGS \
52 { BTRFS_BLOCK_GROUP_DATA, "DATA"}, \ 53 { BTRFS_BLOCK_GROUP_DATA, "DATA"}, \
53 { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \ 54 { BTRFS_BLOCK_GROUP_SYSTEM, "SYSTEM"}, \
54 { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \ 55 { BTRFS_BLOCK_GROUP_METADATA, "METADATA"}, \
55 { BTRFS_BLOCK_GROUP_RAID0, "RAID0"}, \ 56 { BTRFS_BLOCK_GROUP_RAID0, "RAID0"}, \
56 { BTRFS_BLOCK_GROUP_RAID1, "RAID1"}, \ 57 { BTRFS_BLOCK_GROUP_RAID1, "RAID1"}, \
57 { BTRFS_BLOCK_GROUP_DUP, "DUP"}, \ 58 { BTRFS_BLOCK_GROUP_DUP, "DUP"}, \
58 { BTRFS_BLOCK_GROUP_RAID10, "RAID10"} 59 { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}, \
60 { BTRFS_BLOCK_GROUP_RAID5, "RAID5"}, \
61 { BTRFS_BLOCK_GROUP_RAID6, "RAID6"}
59 62
60#define BTRFS_UUID_SIZE 16 63#define BTRFS_UUID_SIZE 16
61 64
@@ -154,7 +157,9 @@ DEFINE_EVENT(btrfs__inode, btrfs_inode_evict,
154 { EXTENT_FLAG_PINNED, "PINNED" }, \ 157 { EXTENT_FLAG_PINNED, "PINNED" }, \
155 { EXTENT_FLAG_COMPRESSED, "COMPRESSED" }, \ 158 { EXTENT_FLAG_COMPRESSED, "COMPRESSED" }, \
156 { EXTENT_FLAG_VACANCY, "VACANCY" }, \ 159 { EXTENT_FLAG_VACANCY, "VACANCY" }, \
157 { EXTENT_FLAG_PREALLOC, "PREALLOC" }) 160 { EXTENT_FLAG_PREALLOC, "PREALLOC" }, \
161 { EXTENT_FLAG_LOGGING, "LOGGING" }, \
162 { EXTENT_FLAG_FILLING, "FILLING" })
158 163
159TRACE_EVENT(btrfs_get_extent, 164TRACE_EVENT(btrfs_get_extent,
160 165
@@ -201,13 +206,17 @@ TRACE_EVENT(btrfs_get_extent,
201); 206);
202 207
203#define show_ordered_flags(flags) \ 208#define show_ordered_flags(flags) \
204 __print_symbolic(flags, \ 209 __print_symbolic(flags, \
205 { BTRFS_ORDERED_IO_DONE, "IO_DONE" }, \ 210 { BTRFS_ORDERED_IO_DONE, "IO_DONE" }, \
206 { BTRFS_ORDERED_COMPLETE, "COMPLETE" }, \ 211 { BTRFS_ORDERED_COMPLETE, "COMPLETE" }, \
207 { BTRFS_ORDERED_NOCOW, "NOCOW" }, \ 212 { BTRFS_ORDERED_NOCOW, "NOCOW" }, \
208 { BTRFS_ORDERED_COMPRESSED, "COMPRESSED" }, \ 213 { BTRFS_ORDERED_COMPRESSED, "COMPRESSED" }, \
209 { BTRFS_ORDERED_PREALLOC, "PREALLOC" }, \ 214 { BTRFS_ORDERED_PREALLOC, "PREALLOC" }, \
210 { BTRFS_ORDERED_DIRECT, "DIRECT" }) 215 { BTRFS_ORDERED_DIRECT, "DIRECT" }, \
216 { BTRFS_ORDERED_IOERR, "IOERR" }, \
217 { BTRFS_ORDERED_UPDATED_ISIZE, "UPDATED_ISIZE" }, \
218 { BTRFS_ORDERED_LOGGED_CSUM, "LOGGED_CSUM" })
219
211 220
212DECLARE_EVENT_CLASS(btrfs__ordered_extent, 221DECLARE_EVENT_CLASS(btrfs__ordered_extent,
213 222
@@ -555,7 +564,9 @@ TRACE_EVENT(btrfs_delayed_ref_head,
555 { BTRFS_BLOCK_GROUP_RAID0, "RAID0" }, \ 564 { BTRFS_BLOCK_GROUP_RAID0, "RAID0" }, \
556 { BTRFS_BLOCK_GROUP_RAID1, "RAID1" }, \ 565 { BTRFS_BLOCK_GROUP_RAID1, "RAID1" }, \
557 { BTRFS_BLOCK_GROUP_DUP, "DUP" }, \ 566 { BTRFS_BLOCK_GROUP_DUP, "DUP" }, \
558 { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}) 567 { BTRFS_BLOCK_GROUP_RAID10, "RAID10"}, \
568 { BTRFS_BLOCK_GROUP_RAID5, "RAID5" }, \
569 { BTRFS_BLOCK_GROUP_RAID6, "RAID6" })
559 570
560DECLARE_EVENT_CLASS(btrfs__chunk, 571DECLARE_EVENT_CLASS(btrfs__chunk,
561 572
diff --git a/include/trace/events/pagemap.h b/include/trace/events/pagemap.h
new file mode 100644
index 000000000000..1c9fabde69e4
--- /dev/null
+++ b/include/trace/events/pagemap.h
@@ -0,0 +1,89 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM pagemap
3
4#if !defined(_TRACE_PAGEMAP_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_PAGEMAP_H
6
7#include <linux/tracepoint.h>
8#include <linux/mm.h>
9
10#define PAGEMAP_MAPPED 0x0001u
11#define PAGEMAP_ANONYMOUS 0x0002u
12#define PAGEMAP_FILE 0x0004u
13#define PAGEMAP_SWAPCACHE 0x0008u
14#define PAGEMAP_SWAPBACKED 0x0010u
15#define PAGEMAP_MAPPEDDISK 0x0020u
16#define PAGEMAP_BUFFERS 0x0040u
17
18#define trace_pagemap_flags(page) ( \
19 (PageAnon(page) ? PAGEMAP_ANONYMOUS : PAGEMAP_FILE) | \
20 (page_mapped(page) ? PAGEMAP_MAPPED : 0) | \
21 (PageSwapCache(page) ? PAGEMAP_SWAPCACHE : 0) | \
22 (PageSwapBacked(page) ? PAGEMAP_SWAPBACKED : 0) | \
23 (PageMappedToDisk(page) ? PAGEMAP_MAPPEDDISK : 0) | \
24 (page_has_private(page) ? PAGEMAP_BUFFERS : 0) \
25 )
26
27TRACE_EVENT(mm_lru_insertion,
28
29 TP_PROTO(
30 struct page *page,
31 unsigned long pfn,
32 int lru,
33 unsigned long flags
34 ),
35
36 TP_ARGS(page, pfn, lru, flags),
37
38 TP_STRUCT__entry(
39 __field(struct page *, page )
40 __field(unsigned long, pfn )
41 __field(int, lru )
42 __field(unsigned long, flags )
43 ),
44
45 TP_fast_assign(
46 __entry->page = page;
47 __entry->pfn = pfn;
48 __entry->lru = lru;
49 __entry->flags = flags;
50 ),
51
52 /* Flag format is based on page-types.c formatting for pagemap */
53 TP_printk("page=%p pfn=%lu lru=%d flags=%s%s%s%s%s%s",
54 __entry->page,
55 __entry->pfn,
56 __entry->lru,
57 __entry->flags & PAGEMAP_MAPPED ? "M" : " ",
58 __entry->flags & PAGEMAP_ANONYMOUS ? "a" : "f",
59 __entry->flags & PAGEMAP_SWAPCACHE ? "s" : " ",
60 __entry->flags & PAGEMAP_SWAPBACKED ? "b" : " ",
61 __entry->flags & PAGEMAP_MAPPEDDISK ? "d" : " ",
62 __entry->flags & PAGEMAP_BUFFERS ? "B" : " ")
63);
64
65TRACE_EVENT(mm_lru_activate,
66
67 TP_PROTO(struct page *page, unsigned long pfn),
68
69 TP_ARGS(page, pfn),
70
71 TP_STRUCT__entry(
72 __field(struct page *, page )
73 __field(unsigned long, pfn )
74 ),
75
76 TP_fast_assign(
77 __entry->page = page;
78 __entry->pfn = pfn;
79 ),
80
81 /* Flag format is based on page-types.c formatting for pagemap */
82 TP_printk("page=%p pfn=%lu", __entry->page, __entry->pfn)
83
84);
85
86#endif /* _TRACE_PAGEMAP_H */
87
88/* This part must be outside protection */
89#include <trace/define_trace.h>
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 427acab5d69a..8e42410bd159 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -5,6 +5,7 @@
5#define _TRACE_POWER_H 5#define _TRACE_POWER_H
6 6
7#include <linux/ktime.h> 7#include <linux/ktime.h>
8#include <linux/pm_qos.h>
8#include <linux/tracepoint.h> 9#include <linux/tracepoint.h>
9 10
10DECLARE_EVENT_CLASS(cpu, 11DECLARE_EVENT_CLASS(cpu,
@@ -177,6 +178,178 @@ DEFINE_EVENT(power_domain, power_domain_target,
177 178
178 TP_ARGS(name, state, cpu_id) 179 TP_ARGS(name, state, cpu_id)
179); 180);
181
182/*
183 * The pm qos events are used for pm qos update
184 */
185DECLARE_EVENT_CLASS(pm_qos_request,
186
187 TP_PROTO(int pm_qos_class, s32 value),
188
189 TP_ARGS(pm_qos_class, value),
190
191 TP_STRUCT__entry(
192 __field( int, pm_qos_class )
193 __field( s32, value )
194 ),
195
196 TP_fast_assign(
197 __entry->pm_qos_class = pm_qos_class;
198 __entry->value = value;
199 ),
200
201 TP_printk("pm_qos_class=%s value=%d",
202 __print_symbolic(__entry->pm_qos_class,
203 { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" },
204 { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" },
205 { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }),
206 __entry->value)
207);
208
209DEFINE_EVENT(pm_qos_request, pm_qos_add_request,
210
211 TP_PROTO(int pm_qos_class, s32 value),
212
213 TP_ARGS(pm_qos_class, value)
214);
215
216DEFINE_EVENT(pm_qos_request, pm_qos_update_request,
217
218 TP_PROTO(int pm_qos_class, s32 value),
219
220 TP_ARGS(pm_qos_class, value)
221);
222
223DEFINE_EVENT(pm_qos_request, pm_qos_remove_request,
224
225 TP_PROTO(int pm_qos_class, s32 value),
226
227 TP_ARGS(pm_qos_class, value)
228);
229
230TRACE_EVENT(pm_qos_update_request_timeout,
231
232 TP_PROTO(int pm_qos_class, s32 value, unsigned long timeout_us),
233
234 TP_ARGS(pm_qos_class, value, timeout_us),
235
236 TP_STRUCT__entry(
237 __field( int, pm_qos_class )
238 __field( s32, value )
239 __field( unsigned long, timeout_us )
240 ),
241
242 TP_fast_assign(
243 __entry->pm_qos_class = pm_qos_class;
244 __entry->value = value;
245 __entry->timeout_us = timeout_us;
246 ),
247
248 TP_printk("pm_qos_class=%s value=%d, timeout_us=%ld",
249 __print_symbolic(__entry->pm_qos_class,
250 { PM_QOS_CPU_DMA_LATENCY, "CPU_DMA_LATENCY" },
251 { PM_QOS_NETWORK_LATENCY, "NETWORK_LATENCY" },
252 { PM_QOS_NETWORK_THROUGHPUT, "NETWORK_THROUGHPUT" }),
253 __entry->value, __entry->timeout_us)
254);
255
256DECLARE_EVENT_CLASS(pm_qos_update,
257
258 TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
259
260 TP_ARGS(action, prev_value, curr_value),
261
262 TP_STRUCT__entry(
263 __field( enum pm_qos_req_action, action )
264 __field( int, prev_value )
265 __field( int, curr_value )
266 ),
267
268 TP_fast_assign(
269 __entry->action = action;
270 __entry->prev_value = prev_value;
271 __entry->curr_value = curr_value;
272 ),
273
274 TP_printk("action=%s prev_value=%d curr_value=%d",
275 __print_symbolic(__entry->action,
276 { PM_QOS_ADD_REQ, "ADD_REQ" },
277 { PM_QOS_UPDATE_REQ, "UPDATE_REQ" },
278 { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }),
279 __entry->prev_value, __entry->curr_value)
280);
281
282DEFINE_EVENT(pm_qos_update, pm_qos_update_target,
283
284 TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
285
286 TP_ARGS(action, prev_value, curr_value)
287);
288
289DEFINE_EVENT_PRINT(pm_qos_update, pm_qos_update_flags,
290
291 TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
292
293 TP_ARGS(action, prev_value, curr_value),
294
295 TP_printk("action=%s prev_value=0x%x curr_value=0x%x",
296 __print_symbolic(__entry->action,
297 { PM_QOS_ADD_REQ, "ADD_REQ" },
298 { PM_QOS_UPDATE_REQ, "UPDATE_REQ" },
299 { PM_QOS_REMOVE_REQ, "REMOVE_REQ" }),
300 __entry->prev_value, __entry->curr_value)
301);
302
303DECLARE_EVENT_CLASS(dev_pm_qos_request,
304
305 TP_PROTO(const char *name, enum dev_pm_qos_req_type type,
306 s32 new_value),
307
308 TP_ARGS(name, type, new_value),
309
310 TP_STRUCT__entry(
311 __string( name, name )
312 __field( enum dev_pm_qos_req_type, type )
313 __field( s32, new_value )
314 ),
315
316 TP_fast_assign(
317 __assign_str(name, name);
318 __entry->type = type;
319 __entry->new_value = new_value;
320 ),
321
322 TP_printk("device=%s type=%s new_value=%d",
323 __get_str(name),
324 __print_symbolic(__entry->type,
325 { DEV_PM_QOS_LATENCY, "DEV_PM_QOS_LATENCY" },
326 { DEV_PM_QOS_FLAGS, "DEV_PM_QOS_FLAGS" }),
327 __entry->new_value)
328);
329
330DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_add_request,
331
332 TP_PROTO(const char *name, enum dev_pm_qos_req_type type,
333 s32 new_value),
334
335 TP_ARGS(name, type, new_value)
336);
337
338DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_update_request,
339
340 TP_PROTO(const char *name, enum dev_pm_qos_req_type type,
341 s32 new_value),
342
343 TP_ARGS(name, type, new_value)
344);
345
346DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_remove_request,
347
348 TP_PROTO(const char *name, enum dev_pm_qos_req_type type,
349 s32 new_value),
350
351 TP_ARGS(name, type, new_value)
352);
180#endif /* _TRACE_POWER_H */ 353#endif /* _TRACE_POWER_H */
181 354
182/* This part must be outside protection */ 355/* This part must be outside protection */
diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h
index a43a2f67bd8e..23d561512f64 100644
--- a/include/trace/events/regmap.h
+++ b/include/trace/events/regmap.h
@@ -223,6 +223,29 @@ DEFINE_EVENT(regmap_async, regmap_async_complete_done,
223 223
224); 224);
225 225
226TRACE_EVENT(regcache_drop_region,
227
228 TP_PROTO(struct device *dev, unsigned int from,
229 unsigned int to),
230
231 TP_ARGS(dev, from, to),
232
233 TP_STRUCT__entry(
234 __string( name, dev_name(dev) )
235 __field( unsigned int, from )
236 __field( unsigned int, to )
237 ),
238
239 TP_fast_assign(
240 __assign_str(name, dev_name(dev));
241 __entry->from = from;
242 __entry->to = to;
243 ),
244
245 TP_printk("%s %u-%u", __get_str(name), (unsigned int)__entry->from,
246 (unsigned int)__entry->to)
247);
248
226#endif /* _TRACE_REGMAP_H */ 249#endif /* _TRACE_REGMAP_H */
227 250
228/* This part must be outside protection */ 251/* This part must be outside protection */
diff --git a/include/trace/events/target.h b/include/trace/events/target.h
new file mode 100644
index 000000000000..aef8fc354025
--- /dev/null
+++ b/include/trace/events/target.h
@@ -0,0 +1,214 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM target
3
4#if !defined(_TRACE_TARGET_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_TARGET_H
6
7#include <linux/tracepoint.h>
8#include <linux/trace_seq.h>
9#include <scsi/scsi.h>
10#include <scsi/scsi_tcq.h>
11#include <target/target_core_base.h>
12
13/* cribbed verbatim from <trace/event/scsi.h> */
14#define scsi_opcode_name(opcode) { opcode, #opcode }
15#define show_opcode_name(val) \
16 __print_symbolic(val, \
17 scsi_opcode_name(TEST_UNIT_READY), \
18 scsi_opcode_name(REZERO_UNIT), \
19 scsi_opcode_name(REQUEST_SENSE), \
20 scsi_opcode_name(FORMAT_UNIT), \
21 scsi_opcode_name(READ_BLOCK_LIMITS), \
22 scsi_opcode_name(REASSIGN_BLOCKS), \
23 scsi_opcode_name(INITIALIZE_ELEMENT_STATUS), \
24 scsi_opcode_name(READ_6), \
25 scsi_opcode_name(WRITE_6), \
26 scsi_opcode_name(SEEK_6), \
27 scsi_opcode_name(READ_REVERSE), \
28 scsi_opcode_name(WRITE_FILEMARKS), \
29 scsi_opcode_name(SPACE), \
30 scsi_opcode_name(INQUIRY), \
31 scsi_opcode_name(RECOVER_BUFFERED_DATA), \
32 scsi_opcode_name(MODE_SELECT), \
33 scsi_opcode_name(RESERVE), \
34 scsi_opcode_name(RELEASE), \
35 scsi_opcode_name(COPY), \
36 scsi_opcode_name(ERASE), \
37 scsi_opcode_name(MODE_SENSE), \
38 scsi_opcode_name(START_STOP), \
39 scsi_opcode_name(RECEIVE_DIAGNOSTIC), \
40 scsi_opcode_name(SEND_DIAGNOSTIC), \
41 scsi_opcode_name(ALLOW_MEDIUM_REMOVAL), \
42 scsi_opcode_name(SET_WINDOW), \
43 scsi_opcode_name(READ_CAPACITY), \
44 scsi_opcode_name(READ_10), \
45 scsi_opcode_name(WRITE_10), \
46 scsi_opcode_name(SEEK_10), \
47 scsi_opcode_name(POSITION_TO_ELEMENT), \
48 scsi_opcode_name(WRITE_VERIFY), \
49 scsi_opcode_name(VERIFY), \
50 scsi_opcode_name(SEARCH_HIGH), \
51 scsi_opcode_name(SEARCH_EQUAL), \
52 scsi_opcode_name(SEARCH_LOW), \
53 scsi_opcode_name(SET_LIMITS), \
54 scsi_opcode_name(PRE_FETCH), \
55 scsi_opcode_name(READ_POSITION), \
56 scsi_opcode_name(SYNCHRONIZE_CACHE), \
57 scsi_opcode_name(LOCK_UNLOCK_CACHE), \
58 scsi_opcode_name(READ_DEFECT_DATA), \
59 scsi_opcode_name(MEDIUM_SCAN), \
60 scsi_opcode_name(COMPARE), \
61 scsi_opcode_name(COPY_VERIFY), \
62 scsi_opcode_name(WRITE_BUFFER), \
63 scsi_opcode_name(READ_BUFFER), \
64 scsi_opcode_name(UPDATE_BLOCK), \
65 scsi_opcode_name(READ_LONG), \
66 scsi_opcode_name(WRITE_LONG), \
67 scsi_opcode_name(CHANGE_DEFINITION), \
68 scsi_opcode_name(WRITE_SAME), \
69 scsi_opcode_name(UNMAP), \
70 scsi_opcode_name(READ_TOC), \
71 scsi_opcode_name(LOG_SELECT), \
72 scsi_opcode_name(LOG_SENSE), \
73 scsi_opcode_name(XDWRITEREAD_10), \
74 scsi_opcode_name(MODE_SELECT_10), \
75 scsi_opcode_name(RESERVE_10), \
76 scsi_opcode_name(RELEASE_10), \
77 scsi_opcode_name(MODE_SENSE_10), \
78 scsi_opcode_name(PERSISTENT_RESERVE_IN), \
79 scsi_opcode_name(PERSISTENT_RESERVE_OUT), \
80 scsi_opcode_name(VARIABLE_LENGTH_CMD), \
81 scsi_opcode_name(REPORT_LUNS), \
82 scsi_opcode_name(MAINTENANCE_IN), \
83 scsi_opcode_name(MAINTENANCE_OUT), \
84 scsi_opcode_name(MOVE_MEDIUM), \
85 scsi_opcode_name(EXCHANGE_MEDIUM), \
86 scsi_opcode_name(READ_12), \
87 scsi_opcode_name(WRITE_12), \
88 scsi_opcode_name(WRITE_VERIFY_12), \
89 scsi_opcode_name(SEARCH_HIGH_12), \
90 scsi_opcode_name(SEARCH_EQUAL_12), \
91 scsi_opcode_name(SEARCH_LOW_12), \
92 scsi_opcode_name(READ_ELEMENT_STATUS), \
93 scsi_opcode_name(SEND_VOLUME_TAG), \
94 scsi_opcode_name(WRITE_LONG_2), \
95 scsi_opcode_name(READ_16), \
96 scsi_opcode_name(WRITE_16), \
97 scsi_opcode_name(VERIFY_16), \
98 scsi_opcode_name(WRITE_SAME_16), \
99 scsi_opcode_name(SERVICE_ACTION_IN), \
100 scsi_opcode_name(SAI_READ_CAPACITY_16), \
101 scsi_opcode_name(SAI_GET_LBA_STATUS), \
102 scsi_opcode_name(MI_REPORT_TARGET_PGS), \
103 scsi_opcode_name(MO_SET_TARGET_PGS), \
104 scsi_opcode_name(READ_32), \
105 scsi_opcode_name(WRITE_32), \
106 scsi_opcode_name(WRITE_SAME_32), \
107 scsi_opcode_name(ATA_16), \
108 scsi_opcode_name(ATA_12))
109
110#define show_task_attribute_name(val) \
111 __print_symbolic(val, \
112 { MSG_SIMPLE_TAG, "SIMPLE" }, \
113 { MSG_HEAD_TAG, "HEAD" }, \
114 { MSG_ORDERED_TAG, "ORDERED" }, \
115 { MSG_ACA_TAG, "ACA" } )
116
117#define show_scsi_status_name(val) \
118 __print_symbolic(val, \
119 { SAM_STAT_GOOD, "GOOD" }, \
120 { SAM_STAT_CHECK_CONDITION, "CHECK CONDITION" }, \
121 { SAM_STAT_CONDITION_MET, "CONDITION MET" }, \
122 { SAM_STAT_BUSY, "BUSY" }, \
123 { SAM_STAT_INTERMEDIATE, "INTERMEDIATE" }, \
124 { SAM_STAT_INTERMEDIATE_CONDITION_MET, "INTERMEDIATE CONDITION MET" }, \
125 { SAM_STAT_RESERVATION_CONFLICT, "RESERVATION CONFLICT" }, \
126 { SAM_STAT_COMMAND_TERMINATED, "COMMAND TERMINATED" }, \
127 { SAM_STAT_TASK_SET_FULL, "TASK SET FULL" }, \
128 { SAM_STAT_ACA_ACTIVE, "ACA ACTIVE" }, \
129 { SAM_STAT_TASK_ABORTED, "TASK ABORTED" } )
130
131TRACE_EVENT(target_sequencer_start,
132
133 TP_PROTO(struct se_cmd *cmd),
134
135 TP_ARGS(cmd),
136
137 TP_STRUCT__entry(
138 __field( unsigned int, unpacked_lun )
139 __field( unsigned int, opcode )
140 __field( unsigned int, data_length )
141 __field( unsigned int, task_attribute )
142 __array( unsigned char, cdb, TCM_MAX_COMMAND_SIZE )
143 __string( initiator, cmd->se_sess->se_node_acl->initiatorname )
144 ),
145
146 TP_fast_assign(
147 __entry->unpacked_lun = cmd->se_lun->unpacked_lun;
148 __entry->opcode = cmd->t_task_cdb[0];
149 __entry->data_length = cmd->data_length;
150 __entry->task_attribute = cmd->sam_task_attr;
151 memcpy(__entry->cdb, cmd->t_task_cdb, TCM_MAX_COMMAND_SIZE);
152 __assign_str(initiator, cmd->se_sess->se_node_acl->initiatorname);
153 ),
154
155 TP_printk("%s -> LUN %03u %s data_length %6u CDB %s (TA:%s C:%02x)",
156 __get_str(initiator), __entry->unpacked_lun,
157 show_opcode_name(__entry->opcode),
158 __entry->data_length, __print_hex(__entry->cdb, 16),
159 show_task_attribute_name(__entry->task_attribute),
160 scsi_command_size(__entry->cdb) <= 16 ?
161 __entry->cdb[scsi_command_size(__entry->cdb) - 1] :
162 __entry->cdb[1]
163 )
164);
165
166TRACE_EVENT(target_cmd_complete,
167
168 TP_PROTO(struct se_cmd *cmd),
169
170 TP_ARGS(cmd),
171
172 TP_STRUCT__entry(
173 __field( unsigned int, unpacked_lun )
174 __field( unsigned int, opcode )
175 __field( unsigned int, data_length )
176 __field( unsigned int, task_attribute )
177 __field( unsigned char, scsi_status )
178 __field( unsigned char, sense_length )
179 __array( unsigned char, cdb, TCM_MAX_COMMAND_SIZE )
180 __array( unsigned char, sense_data, 18 )
181 __string(initiator, cmd->se_sess->se_node_acl->initiatorname)
182 ),
183
184 TP_fast_assign(
185 __entry->unpacked_lun = cmd->se_lun->unpacked_lun;
186 __entry->opcode = cmd->t_task_cdb[0];
187 __entry->data_length = cmd->data_length;
188 __entry->task_attribute = cmd->sam_task_attr;
189 __entry->scsi_status = cmd->scsi_status;
190 __entry->sense_length = cmd->scsi_status == SAM_STAT_CHECK_CONDITION ?
191 min(18, ((u8 *) cmd->sense_buffer)[SPC_ADD_SENSE_LEN_OFFSET] + 8) : 0;
192 memcpy(__entry->cdb, cmd->t_task_cdb, TCM_MAX_COMMAND_SIZE);
193 memcpy(__entry->sense_data, cmd->sense_buffer, __entry->sense_length);
194 __assign_str(initiator, cmd->se_sess->se_node_acl->initiatorname);
195 ),
196
197 TP_printk("%s <- LUN %03u status %s (sense len %d%s%s) %s data_length %6u CDB %s (TA:%s C:%02x)",
198 __get_str(initiator), __entry->unpacked_lun,
199 show_scsi_status_name(__entry->scsi_status),
200 __entry->sense_length, __entry->sense_length ? " / " : "",
201 __print_hex(__entry->sense_data, __entry->sense_length),
202 show_opcode_name(__entry->opcode),
203 __entry->data_length, __print_hex(__entry->cdb, 16),
204 show_task_attribute_name(__entry->task_attribute),
205 scsi_command_size(__entry->cdb) <= 16 ?
206 __entry->cdb[scsi_command_size(__entry->cdb) - 1] :
207 __entry->cdb[1]
208 )
209);
210
211#endif /* _TRACE_TARGET_H */
212
213/* This part must be outside protection */
214#include <trace/define_trace.h>
diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index 84bc4197e736..fed853f3d7aa 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -16,6 +16,7 @@
16 * @nb_args: number of parameters it takes 16 * @nb_args: number of parameters it takes
17 * @types: list of types as strings 17 * @types: list of types as strings
18 * @args: list of args as strings (args[i] matches types[i]) 18 * @args: list of args as strings (args[i] matches types[i])
19 * @enter_fields: list of fields for syscall_enter trace event
19 * @enter_event: associated syscall_enter trace event 20 * @enter_event: associated syscall_enter trace event
20 * @exit_event: associated syscall_exit trace event 21 * @exit_event: associated syscall_exit trace event
21 */ 22 */
diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h
index a48937d4a5ea..06632beaa6d5 100644
--- a/include/uapi/asm-generic/fcntl.h
+++ b/include/uapi/asm-generic/fcntl.h
@@ -84,6 +84,10 @@
84#define O_PATH 010000000 84#define O_PATH 010000000
85#endif 85#endif
86 86
87#ifndef O_TMPFILE
88#define O_TMPFILE 020000000
89#endif
90
87#ifndef O_NDELAY 91#ifndef O_NDELAY
88#define O_NDELAY O_NONBLOCK 92#define O_NDELAY O_NONBLOCK
89#endif 93#endif
diff --git a/include/uapi/asm-generic/poll.h b/include/uapi/asm-generic/poll.h
index 9ce7f44aebd2..a9694982689f 100644
--- a/include/uapi/asm-generic/poll.h
+++ b/include/uapi/asm-generic/poll.h
@@ -30,6 +30,8 @@
30 30
31#define POLLFREE 0x4000 /* currently only for epoll */ 31#define POLLFREE 0x4000 /* currently only for epoll */
32 32
33#define POLL_BUSY_LOOP 0x8000
34
33struct pollfd { 35struct pollfd {
34 int fd; 36 int fd;
35 short events; 37 short events;
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index c5d2e3a1cf68..ca3a20d772ac 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -76,4 +76,6 @@
76 76
77#define SO_SELECT_ERR_QUEUE 45 77#define SO_SELECT_ERR_QUEUE 45
78 78
79#define SO_LL 46
80
79#endif /* __ASM_GENERIC_SOCKET_H */ 81#endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 5a57be68bab7..238a166b9fe6 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -732,6 +732,7 @@ struct drm_prime_handle {
732#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2) 732#define DRM_IOCTL_MODE_ADDFB2 DRM_IOWR(0xB8, struct drm_mode_fb_cmd2)
733#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties) 733#define DRM_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xB9, struct drm_mode_obj_get_properties)
734#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property) 734#define DRM_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xBA, struct drm_mode_obj_set_property)
735#define DRM_IOCTL_MODE_CURSOR2 DRM_IOWR(0xBB, struct drm_mode_cursor2)
735 736
736/** 737/**
737 * Device specific ioctls should only be in their respective headers 738 * Device specific ioctls should only be in their respective headers
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 090e5331ab7e..53db7cea373b 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -388,6 +388,19 @@ struct drm_mode_cursor {
388 __u32 handle; 388 __u32 handle;
389}; 389};
390 390
391struct drm_mode_cursor2 {
392 __u32 flags;
393 __u32 crtc_id;
394 __s32 x;
395 __s32 y;
396 __u32 width;
397 __u32 height;
398 /* driver specific handle */
399 __u32 handle;
400 __s32 hot_x;
401 __s32 hot_y;
402};
403
391struct drm_mode_crtc_lut { 404struct drm_mode_crtc_lut {
392 __u32 crtc_id; 405 __u32 crtc_id;
393 __u32 gamma_size; 406 __u32 gamma_size;
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 07d59419fe6b..923ed7fe5775 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -305,7 +305,7 @@ typedef struct drm_i915_irq_wait {
305#define I915_PARAM_HAS_WAIT_TIMEOUT 19 305#define I915_PARAM_HAS_WAIT_TIMEOUT 19
306#define I915_PARAM_HAS_SEMAPHORES 20 306#define I915_PARAM_HAS_SEMAPHORES 20
307#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21 307#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21
308#define I915_PARAM_RSVD_FOR_FUTURE_USE 22 308#define I915_PARAM_HAS_VEBOX 22
309#define I915_PARAM_HAS_SECURE_BATCHES 23 309#define I915_PARAM_HAS_SECURE_BATCHES 23
310#define I915_PARAM_HAS_PINNED_BATCHES 24 310#define I915_PARAM_HAS_PINNED_BATCHES 24
311#define I915_PARAM_HAS_EXEC_NO_RELOC 25 311#define I915_PARAM_HAS_EXEC_NO_RELOC 25
@@ -660,6 +660,7 @@ struct drm_i915_gem_execbuffer2 {
660#define I915_EXEC_RENDER (1<<0) 660#define I915_EXEC_RENDER (1<<0)
661#define I915_EXEC_BSD (2<<0) 661#define I915_EXEC_BSD (2<<0)
662#define I915_EXEC_BLT (3<<0) 662#define I915_EXEC_BLT (3<<0)
663#define I915_EXEC_VEBOX (4<<0)
663 664
664/* Used for switching the constants addressing mode on gen4+ RENDER ring. 665/* Used for switching the constants addressing mode on gen4+ RENDER ring.
665 * Gen6+ only supports relative addressing to dynamic state (default) and 666 * Gen6+ only supports relative addressing to dynamic state (default) and
diff --git a/include/uapi/drm/tegra_drm.h b/include/uapi/drm/tegra_drm.h
index 6e132a2f7420..73bde4eaf16c 100644
--- a/include/uapi/drm/tegra_drm.h
+++ b/include/uapi/drm/tegra_drm.h
@@ -17,6 +17,8 @@
17#ifndef _UAPI_TEGRA_DRM_H_ 17#ifndef _UAPI_TEGRA_DRM_H_
18#define _UAPI_TEGRA_DRM_H_ 18#define _UAPI_TEGRA_DRM_H_
19 19
20#include <drm/drm.h>
21
20struct drm_tegra_gem_create { 22struct drm_tegra_gem_create {
21 __u64 size; 23 __u64 size;
22 __u32 flags; 24 __u32 flags;
diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index 5ef0df545a2a..05aed70627e2 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -447,6 +447,46 @@ struct btrfs_ioctl_send_args {
447 __u64 reserved[4]; /* in */ 447 __u64 reserved[4]; /* in */
448}; 448};
449 449
450/* Error codes as returned by the kernel */
451enum btrfs_err_code {
452 notused,
453 BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET,
454 BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET,
455 BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET,
456 BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET,
457 BTRFS_ERROR_DEV_TGT_REPLACE,
458 BTRFS_ERROR_DEV_MISSING_NOT_FOUND,
459 BTRFS_ERROR_DEV_ONLY_WRITABLE,
460 BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS
461};
462/* An error code to error string mapping for the kernel
463* error codes
464*/
465static inline char *btrfs_err_str(enum btrfs_err_code err_code)
466{
467 switch (err_code) {
468 case BTRFS_ERROR_DEV_RAID1_MIN_NOT_MET:
469 return "unable to go below two devices on raid1";
470 case BTRFS_ERROR_DEV_RAID10_MIN_NOT_MET:
471 return "unable to go below four devices on raid10";
472 case BTRFS_ERROR_DEV_RAID5_MIN_NOT_MET:
473 return "unable to go below two devices on raid5";
474 case BTRFS_ERROR_DEV_RAID6_MIN_NOT_MET:
475 return "unable to go below three devices on raid6";
476 case BTRFS_ERROR_DEV_TGT_REPLACE:
477 return "unable to remove the dev_replace target dev";
478 case BTRFS_ERROR_DEV_MISSING_NOT_FOUND:
479 return "no missing devices found to remove";
480 case BTRFS_ERROR_DEV_ONLY_WRITABLE:
481 return "unable to remove the only writeable device";
482 case BTRFS_ERROR_DEV_EXCL_RUN_IN_PROGRESS:
483 return "add/delete/balance/replace/resize operation "\
484 "in progress";
485 default:
486 return NULL;
487 }
488}
489
450#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \ 490#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
451 struct btrfs_ioctl_vol_args) 491 struct btrfs_ioctl_vol_args)
452#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \ 492#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
@@ -530,6 +570,7 @@ struct btrfs_ioctl_send_args {
530 struct btrfs_ioctl_quota_rescan_args) 570 struct btrfs_ioctl_quota_rescan_args)
531#define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \ 571#define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \
532 struct btrfs_ioctl_quota_rescan_args) 572 struct btrfs_ioctl_quota_rescan_args)
573#define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46)
533#define BTRFS_IOC_GET_FSLABEL _IOR(BTRFS_IOCTL_MAGIC, 49, \ 574#define BTRFS_IOC_GET_FSLABEL _IOR(BTRFS_IOCTL_MAGIC, 49, \
534 char[BTRFS_LABEL_SIZE]) 575 char[BTRFS_LABEL_SIZE])
535#define BTRFS_IOC_SET_FSLABEL _IOW(BTRFS_IOCTL_MAGIC, 50, \ 576#define BTRFS_IOC_SET_FSLABEL _IOW(BTRFS_IOCTL_MAGIC, 50, \
@@ -538,5 +579,4 @@ struct btrfs_ioctl_send_args {
538 struct btrfs_ioctl_get_dev_stats) 579 struct btrfs_ioctl_get_dev_stats)
539#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \ 580#define BTRFS_IOC_DEV_REPLACE _IOWR(BTRFS_IOCTL_MAGIC, 53, \
540 struct btrfs_ioctl_dev_replace_args) 581 struct btrfs_ioctl_dev_replace_args)
541
542#endif /* _UAPI_LINUX_BTRFS_H */ 582#endif /* _UAPI_LINUX_BTRFS_H */
diff --git a/include/uapi/linux/dm-ioctl.h b/include/uapi/linux/dm-ioctl.h
index 7e75b6fd8d45..afd0cbd52edb 100644
--- a/include/uapi/linux/dm-ioctl.h
+++ b/include/uapi/linux/dm-ioctl.h
@@ -267,9 +267,9 @@ enum {
267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
268 268
269#define DM_VERSION_MAJOR 4 269#define DM_VERSION_MAJOR 4
270#define DM_VERSION_MINOR 24 270#define DM_VERSION_MINOR 25
271#define DM_VERSION_PATCHLEVEL 0 271#define DM_VERSION_PATCHLEVEL 0
272#define DM_VERSION_EXTRA "-ioctl (2013-01-15)" 272#define DM_VERSION_EXTRA "-ioctl (2013-06-26)"
273 273
274/* Status bits */ 274/* Status bits */
275#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 275#define DM_READONLY_FLAG (1 << 0) /* In/Out */
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index 0c9b44871df0..38dbafaa5341 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -993,8 +993,8 @@ enum ethtool_sfeatures_retval_bits {
993#define PORT_OTHER 0xff 993#define PORT_OTHER 0xff
994 994
995/* Which transceiver to use. */ 995/* Which transceiver to use. */
996#define XCVR_INTERNAL 0x00 996#define XCVR_INTERNAL 0x00 /* PHY and MAC are in the same package */
997#define XCVR_EXTERNAL 0x01 997#define XCVR_EXTERNAL 0x01 /* PHY and MAC are in different packages */
998#define XCVR_DUMMY1 0x02 998#define XCVR_DUMMY1 0x02
999#define XCVR_DUMMY2 0x03 999#define XCVR_DUMMY2 0x03
1000#define XCVR_DUMMY3 0x04 1000#define XCVR_DUMMY3 0x04
diff --git a/include/uapi/linux/gen_stats.h b/include/uapi/linux/gen_stats.h
index 552c8a0a12d1..6487317ea619 100644
--- a/include/uapi/linux/gen_stats.h
+++ b/include/uapi/linux/gen_stats.h
@@ -9,6 +9,7 @@ enum {
9 TCA_STATS_RATE_EST, 9 TCA_STATS_RATE_EST,
10 TCA_STATS_QUEUE, 10 TCA_STATS_QUEUE,
11 TCA_STATS_APP, 11 TCA_STATS_APP,
12 TCA_STATS_RATE_EST64,
12 __TCA_STATS_MAX, 13 __TCA_STATS_MAX,
13}; 14};
14#define TCA_STATS_MAX (__TCA_STATS_MAX - 1) 15#define TCA_STATS_MAX (__TCA_STATS_MAX - 1)
@@ -38,6 +39,16 @@ struct gnet_stats_rate_est {
38}; 39};
39 40
40/** 41/**
42 * struct gnet_stats_rate_est64 - rate estimator
43 * @bps: current byte rate
44 * @pps: current packet rate
45 */
46struct gnet_stats_rate_est64 {
47 __u64 bps;
48 __u64 pps;
49};
50
51/**
41 * struct gnet_stats_queue - queuing statistics 52 * struct gnet_stats_queue - queuing statistics
42 * @qlen: queue length 53 * @qlen: queue length
43 * @backlog: backlog size of queue 54 * @backlog: backlog size of queue
diff --git a/include/uapi/linux/if_arp.h b/include/uapi/linux/if_arp.h
index 82c7d1bdadeb..d7fea3496f32 100644
--- a/include/uapi/linux/if_arp.h
+++ b/include/uapi/linux/if_arp.h
@@ -93,6 +93,7 @@
93#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ 93#define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */
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 97
97#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */ 98#define ARPHRD_VOID 0xFFFF /* Void type, nothing is known */
98#define ARPHRD_NONE 0xFFFE /* zero header length */ 99#define ARPHRD_NONE 0xFFFE /* zero header length */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index b05823cae784..03f6170ab337 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -221,6 +221,8 @@ enum {
221 IFLA_BRPORT_GUARD, /* bpdu guard */ 221 IFLA_BRPORT_GUARD, /* bpdu guard */
222 IFLA_BRPORT_PROTECT, /* root port protection */ 222 IFLA_BRPORT_PROTECT, /* root port protection */
223 IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave */ 223 IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave */
224 IFLA_BRPORT_LEARNING, /* mac learning */
225 IFLA_BRPORT_UNICAST_FLOOD, /* flood unicast traffic */
224 __IFLA_BRPORT_MAX 226 __IFLA_BRPORT_MAX
225}; 227};
226#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) 228#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
@@ -336,6 +338,7 @@ enum {
336 IFLA_VF_VLAN, 338 IFLA_VF_VLAN,
337 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */ 339 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
338 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */ 340 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
341 IFLA_VF_LINK_STATE, /* link state enable/disable/auto switch */
339 __IFLA_VF_MAX, 342 __IFLA_VF_MAX,
340}; 343};
341 344
@@ -362,6 +365,18 @@ struct ifla_vf_spoofchk {
362 __u32 setting; 365 __u32 setting;
363}; 366};
364 367
368enum {
369 IFLA_VF_LINK_STATE_AUTO, /* link state of the uplink */
370 IFLA_VF_LINK_STATE_ENABLE, /* link always up */
371 IFLA_VF_LINK_STATE_DISABLE, /* link always down */
372 __IFLA_VF_LINK_STATE_MAX,
373};
374
375struct ifla_vf_link_state {
376 __u32 vf;
377 __u32 link_state;
378};
379
365/* VF ports management section 380/* VF ports management section
366 * 381 *
367 * Nested layout of set/get msg is: 382 * Nested layout of set/get msg is:
diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
index 0b46fd57c8f6..e36a4aecd311 100644
--- a/include/uapi/linux/if_pppox.h
+++ b/include/uapi/linux/if_pppox.h
@@ -135,11 +135,11 @@ struct pppoe_tag {
135 135
136struct pppoe_hdr { 136struct pppoe_hdr {
137#if defined(__LITTLE_ENDIAN_BITFIELD) 137#if defined(__LITTLE_ENDIAN_BITFIELD)
138 __u8 ver : 4;
139 __u8 type : 4; 138 __u8 type : 4;
139 __u8 ver : 4;
140#elif defined(__BIG_ENDIAN_BITFIELD) 140#elif defined(__BIG_ENDIAN_BITFIELD)
141 __u8 type : 4;
142 __u8 ver : 4; 141 __u8 ver : 4;
142 __u8 type : 4;
143#else 143#else
144#error "Please fix <asm/byteorder.h>" 144#error "Please fix <asm/byteorder.h>"
145#endif 145#endif
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
index 2835b85fd46d..82334f88967e 100644
--- a/include/uapi/linux/if_tun.h
+++ b/include/uapi/linux/if_tun.h
@@ -68,6 +68,8 @@
68#define IFF_MULTI_QUEUE 0x0100 68#define IFF_MULTI_QUEUE 0x0100
69#define IFF_ATTACH_QUEUE 0x0200 69#define IFF_ATTACH_QUEUE 0x0200
70#define IFF_DETACH_QUEUE 0x0400 70#define IFF_DETACH_QUEUE 0x0400
71/* read-only flag */
72#define IFF_PERSIST 0x0800
71 73
72/* Features for GSO (TUNSETOFFLOAD). */ 74/* Features for GSO (TUNSETOFFLOAD). */
73#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ 75#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
index 4649ee35b605..d584047b072b 100644
--- a/include/uapi/linux/input.h
+++ b/include/uapi/linux/input.h
@@ -506,11 +506,15 @@ struct input_keymap_entry {
506#define BTN_DEAD 0x12f 506#define BTN_DEAD 0x12f
507 507
508#define BTN_GAMEPAD 0x130 508#define BTN_GAMEPAD 0x130
509#define BTN_A 0x130 509#define BTN_SOUTH 0x130
510#define BTN_B 0x131 510#define BTN_A BTN_SOUTH
511#define BTN_EAST 0x131
512#define BTN_B BTN_EAST
511#define BTN_C 0x132 513#define BTN_C 0x132
512#define BTN_X 0x133 514#define BTN_NORTH 0x133
513#define BTN_Y 0x134 515#define BTN_X BTN_NORTH
516#define BTN_WEST 0x134
517#define BTN_Y BTN_WEST
514#define BTN_Z 0x135 518#define BTN_Z 0x135
515#define BTN_TL 0x136 519#define BTN_TL 0x136
516#define BTN_TR 0x137 520#define BTN_TR 0x137
@@ -707,6 +711,11 @@ struct input_keymap_entry {
707#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */ 711#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */
708#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */ 712#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */
709 713
714#define BTN_DPAD_UP 0x220
715#define BTN_DPAD_DOWN 0x221
716#define BTN_DPAD_LEFT 0x222
717#define BTN_DPAD_RIGHT 0x223
718
710#define BTN_TRIGGER_HAPPY 0x2c0 719#define BTN_TRIGGER_HAPPY 0x2c0
711#define BTN_TRIGGER_HAPPY1 0x2c0 720#define BTN_TRIGGER_HAPPY1 0x2c0
712#define BTN_TRIGGER_HAPPY2 0x2c1 721#define BTN_TRIGGER_HAPPY2 0x2c1
diff --git a/include/uapi/linux/ip_vs.h b/include/uapi/linux/ip_vs.h
index a24537725e80..29458223d044 100644
--- a/include/uapi/linux/ip_vs.h
+++ b/include/uapi/linux/ip_vs.h
@@ -20,6 +20,12 @@
20#define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */ 20#define IP_VS_SVC_F_PERSISTENT 0x0001 /* persistent port */
21#define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */ 21#define IP_VS_SVC_F_HASHED 0x0002 /* hashed entry */
22#define IP_VS_SVC_F_ONEPACKET 0x0004 /* one-packet scheduling */ 22#define IP_VS_SVC_F_ONEPACKET 0x0004 /* one-packet scheduling */
23#define IP_VS_SVC_F_SCHED1 0x0008 /* scheduler flag 1 */
24#define IP_VS_SVC_F_SCHED2 0x0010 /* scheduler flag 2 */
25#define IP_VS_SVC_F_SCHED3 0x0020 /* scheduler flag 3 */
26
27#define IP_VS_SVC_F_SCHED_SH_FALLBACK IP_VS_SVC_F_SCHED1 /* SH fallback */
28#define IP_VS_SVC_F_SCHED_SH_PORT IP_VS_SVC_F_SCHED2 /* SH use port */
23 29
24/* 30/*
25 * Destination Server Flags 31 * Destination Server Flags
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index d88c8ee00c8b..acccd08be6c7 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -666,6 +666,7 @@ struct kvm_ppc_smmu_info {
666#define KVM_CAP_IRQ_MPIC 90 666#define KVM_CAP_IRQ_MPIC 90
667#define KVM_CAP_PPC_RTAS 91 667#define KVM_CAP_PPC_RTAS 91
668#define KVM_CAP_IRQ_XICS 92 668#define KVM_CAP_IRQ_XICS 92
669#define KVM_CAP_ARM_EL1_32BIT 93
669 670
670#ifdef KVM_CAP_IRQ_ROUTING 671#ifdef KVM_CAP_IRQ_ROUTING
671 672
@@ -783,6 +784,7 @@ struct kvm_dirty_tlb {
783#define KVM_REG_IA64 0x3000000000000000ULL 784#define KVM_REG_IA64 0x3000000000000000ULL
784#define KVM_REG_ARM 0x4000000000000000ULL 785#define KVM_REG_ARM 0x4000000000000000ULL
785#define KVM_REG_S390 0x5000000000000000ULL 786#define KVM_REG_S390 0x5000000000000000ULL
787#define KVM_REG_ARM64 0x6000000000000000ULL
786#define KVM_REG_MIPS 0x7000000000000000ULL 788#define KVM_REG_MIPS 0x7000000000000000ULL
787 789
788#define KVM_REG_SIZE_SHIFT 52 790#define KVM_REG_SIZE_SHIFT 52
diff --git a/include/uapi/linux/msdos_fs.h b/include/uapi/linux/msdos_fs.h
index f055e58b3147..e284ff919d6e 100644
--- a/include/uapi/linux/msdos_fs.h
+++ b/include/uapi/linux/msdos_fs.h
@@ -104,6 +104,8 @@ struct __fat_dirent {
104/* <linux/videotext.h> has used 0x72 ('r') in collision, so skip a few */ 104/* <linux/videotext.h> has used 0x72 ('r') in collision, so skip a few */
105#define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32) 105#define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32)
106#define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32) 106#define FAT_IOCTL_SET_ATTRIBUTES _IOW('r', 0x11, __u32)
107/*Android kernel has used 0x12, so we use 0x13*/
108#define FAT_IOCTL_GET_VOLUME_ID _IOR('r', 0x13, __u32)
107 109
108struct fat_boot_sector { 110struct fat_boot_sector {
109 __u8 ignored[3]; /* Boot strap short or near jump */ 111 __u8 ignored[3]; /* Boot strap short or near jump */
@@ -128,6 +130,10 @@ struct fat_boot_sector {
128 __u8 drive_number; /* Physical drive number */ 130 __u8 drive_number; /* Physical drive number */
129 __u8 state; /* undocumented, but used 131 __u8 state; /* undocumented, but used
130 for mount state. */ 132 for mount state. */
133 __u8 signature; /* extended boot signature */
134 __u8 vol_id[4]; /* volume ID */
135 __u8 vol_label[11]; /* volume label */
136 __u8 fs_type[8]; /* file system type */
131 /* other fiealds are not added here */ 137 /* other fiealds are not added here */
132 } fat16; 138 } fat16;
133 139
@@ -147,6 +153,10 @@ struct fat_boot_sector {
147 __u8 drive_number; /* Physical drive number */ 153 __u8 drive_number; /* Physical drive number */
148 __u8 state; /* undocumented, but used 154 __u8 state; /* undocumented, but used
149 for mount state. */ 155 for mount state. */
156 __u8 signature; /* extended boot signature */
157 __u8 vol_id[4]; /* volume ID */
158 __u8 vol_label[11]; /* volume label */
159 __u8 fs_type[8]; /* file system type */
150 /* other fiealds are not added here */ 160 /* other fiealds are not added here */
151 } fat32; 161 } fat32;
152 }; 162 };
diff --git a/include/uapi/linux/netfilter/nfnetlink_queue.h b/include/uapi/linux/netfilter/nfnetlink_queue.h
index a2308ae5a73d..3a9b92147339 100644
--- a/include/uapi/linux/netfilter/nfnetlink_queue.h
+++ b/include/uapi/linux/netfilter/nfnetlink_queue.h
@@ -105,5 +105,7 @@ enum nfqnl_attr_config {
105#define NFQA_SKB_CSUMNOTREADY (1 << 0) 105#define NFQA_SKB_CSUMNOTREADY (1 << 0)
106/* packet is GSO (i.e., exceeds device mtu) */ 106/* packet is GSO (i.e., exceeds device mtu) */
107#define NFQA_SKB_GSO (1 << 1) 107#define NFQA_SKB_GSO (1 << 1)
108/* csum not validated (incoming device doesn't support hw checksum, etc.) */
109#define NFQA_SKB_CSUM_NOTVERIFIED (1 << 2)
108 110
109#endif /* _NFNETLINK_QUEUE_H */ 111#endif /* _NFNETLINK_QUEUE_H */
diff --git a/include/uapi/linux/netfilter/xt_socket.h b/include/uapi/linux/netfilter/xt_socket.h
index 26d7217bd4f1..6315e2ac3474 100644
--- a/include/uapi/linux/netfilter/xt_socket.h
+++ b/include/uapi/linux/netfilter/xt_socket.h
@@ -5,10 +5,17 @@
5 5
6enum { 6enum {
7 XT_SOCKET_TRANSPARENT = 1 << 0, 7 XT_SOCKET_TRANSPARENT = 1 << 0,
8 XT_SOCKET_NOWILDCARD = 1 << 1,
8}; 9};
9 10
10struct xt_socket_mtinfo1 { 11struct xt_socket_mtinfo1 {
11 __u8 flags; 12 __u8 flags;
12}; 13};
14#define XT_SOCKET_FLAGS_V1 XT_SOCKET_TRANSPARENT
15
16struct xt_socket_mtinfo2 {
17 __u8 flags;
18};
19#define XT_SOCKET_FLAGS_V2 (XT_SOCKET_TRANSPARENT | XT_SOCKET_NOWILDCARD)
13 20
14#endif /* _XT_SOCKET_H */ 21#endif /* _XT_SOCKET_H */
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index 7c6f627a717d..caed0f324d5f 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -69,6 +69,8 @@
69 * starting a poll from a device which has a secure element enabled means 69 * starting a poll from a device which has a secure element enabled means
70 * we want to do SE based card emulation. 70 * we want to do SE based card emulation.
71 * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element. 71 * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element.
72 * @NFC_CMD_FW_UPLOAD: Request to Load/flash firmware, or event to inform that
73 * some firmware was loaded
72 */ 74 */
73enum nfc_commands { 75enum nfc_commands {
74 NFC_CMD_UNSPEC, 76 NFC_CMD_UNSPEC,
@@ -92,6 +94,9 @@ enum nfc_commands {
92 NFC_CMD_DISABLE_SE, 94 NFC_CMD_DISABLE_SE,
93 NFC_CMD_LLC_SDREQ, 95 NFC_CMD_LLC_SDREQ,
94 NFC_EVENT_LLC_SDRES, 96 NFC_EVENT_LLC_SDRES,
97 NFC_CMD_FW_UPLOAD,
98 NFC_EVENT_SE_ADDED,
99 NFC_EVENT_SE_REMOVED,
95/* private: internal use only */ 100/* private: internal use only */
96 __NFC_CMD_AFTER_LAST 101 __NFC_CMD_AFTER_LAST
97}; 102};
@@ -121,6 +126,9 @@ enum nfc_commands {
121 * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter 126 * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter
122 * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter 127 * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter
123 * @NFC_ATTR_SE: Available Secure Elements 128 * @NFC_ATTR_SE: Available Secure Elements
129 * @NFC_ATTR_FIRMWARE_NAME: Free format firmware version
130 * @NFC_ATTR_SE_INDEX: Secure element index
131 * @NFC_ATTR_SE_TYPE: Secure element type (UICC or EMBEDDED)
124 */ 132 */
125enum nfc_attrs { 133enum nfc_attrs {
126 NFC_ATTR_UNSPEC, 134 NFC_ATTR_UNSPEC,
@@ -143,6 +151,9 @@ enum nfc_attrs {
143 NFC_ATTR_LLC_PARAM_MIUX, 151 NFC_ATTR_LLC_PARAM_MIUX,
144 NFC_ATTR_SE, 152 NFC_ATTR_SE,
145 NFC_ATTR_LLC_SDP, 153 NFC_ATTR_LLC_SDP,
154 NFC_ATTR_FIRMWARE_NAME,
155 NFC_ATTR_SE_INDEX,
156 NFC_ATTR_SE_TYPE,
146/* private: internal use only */ 157/* private: internal use only */
147 __NFC_ATTR_AFTER_LAST 158 __NFC_ATTR_AFTER_LAST
148}; 159};
@@ -159,9 +170,12 @@ enum nfc_sdp_attr {
159 170
160#define NFC_DEVICE_NAME_MAXSIZE 8 171#define NFC_DEVICE_NAME_MAXSIZE 8
161#define NFC_NFCID1_MAXSIZE 10 172#define NFC_NFCID1_MAXSIZE 10
173#define NFC_NFCID2_MAXSIZE 8
174#define NFC_NFCID3_MAXSIZE 10
162#define NFC_SENSB_RES_MAXSIZE 12 175#define NFC_SENSB_RES_MAXSIZE 12
163#define NFC_SENSF_RES_MAXSIZE 18 176#define NFC_SENSF_RES_MAXSIZE 18
164#define NFC_GB_MAXSIZE 48 177#define NFC_GB_MAXSIZE 48
178#define NFC_FIRMWARE_NAME_MAXSIZE 32
165 179
166/* NFC protocols */ 180/* NFC protocols */
167#define NFC_PROTO_JEWEL 1 181#define NFC_PROTO_JEWEL 1
@@ -191,10 +205,12 @@ enum nfc_sdp_attr {
191#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B) 205#define NFC_PROTO_ISO14443_B_MASK (1 << NFC_PROTO_ISO14443_B)
192 206
193/* NFC Secure Elements */ 207/* NFC Secure Elements */
194#define NFC_SE_NONE 0x0
195#define NFC_SE_UICC 0x1 208#define NFC_SE_UICC 0x1
196#define NFC_SE_EMBEDDED 0x2 209#define NFC_SE_EMBEDDED 0x2
197 210
211#define NFC_SE_DISABLED 0x0
212#define NFC_SE_ENABLED 0x1
213
198struct sockaddr_nfc { 214struct sockaddr_nfc {
199 sa_family_t sa_family; 215 sa_family_t sa_family;
200 __u32 dev_idx; 216 __u32 dev_idx;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index d1e48b5e348f..861e5eba3953 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -27,6 +27,8 @@
27 27
28#include <linux/types.h> 28#include <linux/types.h>
29 29
30#define NL80211_GENL_NAME "nl80211"
31
30/** 32/**
31 * DOC: Station handling 33 * DOC: Station handling
32 * 34 *
@@ -1429,6 +1431,11 @@ enum nl80211_commands {
1429 * @NL80211_ATTR_MAX_CRIT_PROT_DURATION: duration in milliseconds in which 1431 * @NL80211_ATTR_MAX_CRIT_PROT_DURATION: duration in milliseconds in which
1430 * the connection should have increased reliability (u16). 1432 * the connection should have increased reliability (u16).
1431 * 1433 *
1434 * @NL80211_ATTR_PEER_AID: Association ID for the peer TDLS station (u16).
1435 * This is similar to @NL80211_ATTR_STA_AID but with a difference of being
1436 * allowed to be used with the first @NL80211_CMD_SET_STATION command to
1437 * update a TDLS peer STA entry.
1438 *
1432 * @NL80211_ATTR_MAX: highest attribute number currently defined 1439 * @NL80211_ATTR_MAX: highest attribute number currently defined
1433 * @__NL80211_ATTR_AFTER_LAST: internal use 1440 * @__NL80211_ATTR_AFTER_LAST: internal use
1434 */ 1441 */
@@ -1727,6 +1734,8 @@ enum nl80211_attrs {
1727 NL80211_ATTR_CRIT_PROT_ID, 1734 NL80211_ATTR_CRIT_PROT_ID,
1728 NL80211_ATTR_MAX_CRIT_PROT_DURATION, 1735 NL80211_ATTR_MAX_CRIT_PROT_DURATION,
1729 1736
1737 NL80211_ATTR_PEER_AID,
1738
1730 /* add attributes here, update the policy in nl80211.c */ 1739 /* add attributes here, update the policy in nl80211.c */
1731 1740
1732 __NL80211_ATTR_AFTER_LAST, 1741 __NL80211_ATTR_AFTER_LAST,
@@ -1991,6 +2000,10 @@ enum nl80211_sta_bss_param {
1991 * @NL80211_STA_INFO_PEER_PM: peer mesh STA link-specific power mode 2000 * @NL80211_STA_INFO_PEER_PM: peer mesh STA link-specific power mode
1992 * @NL80211_STA_INFO_NONPEER_PM: neighbor mesh STA power save mode towards 2001 * @NL80211_STA_INFO_NONPEER_PM: neighbor mesh STA power save mode towards
1993 * non-peer STA 2002 * non-peer STA
2003 * @NL80211_STA_INFO_CHAIN_SIGNAL: per-chain signal strength of last PPDU
2004 * Contains a nested array of signal strength attributes (u8, dBm)
2005 * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average
2006 * Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
1994 * @__NL80211_STA_INFO_AFTER_LAST: internal 2007 * @__NL80211_STA_INFO_AFTER_LAST: internal
1995 * @NL80211_STA_INFO_MAX: highest possible station info attribute 2008 * @NL80211_STA_INFO_MAX: highest possible station info attribute
1996 */ 2009 */
@@ -2020,6 +2033,8 @@ enum nl80211_sta_info {
2020 NL80211_STA_INFO_NONPEER_PM, 2033 NL80211_STA_INFO_NONPEER_PM,
2021 NL80211_STA_INFO_RX_BYTES64, 2034 NL80211_STA_INFO_RX_BYTES64,
2022 NL80211_STA_INFO_TX_BYTES64, 2035 NL80211_STA_INFO_TX_BYTES64,
2036 NL80211_STA_INFO_CHAIN_SIGNAL,
2037 NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
2023 2038
2024 /* keep last */ 2039 /* keep last */
2025 __NL80211_STA_INFO_AFTER_LAST, 2040 __NL80211_STA_INFO_AFTER_LAST,
@@ -2413,6 +2428,8 @@ enum nl80211_survey_info {
2413 * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering 2428 * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
2414 * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing. 2429 * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
2415 * overrides all other flags. 2430 * overrides all other flags.
2431 * @NL80211_MNTR_FLAG_ACTIVE: use the configured MAC address
2432 * and ACK incoming unicast packets.
2416 * 2433 *
2417 * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use 2434 * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
2418 * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag 2435 * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
@@ -2424,6 +2441,7 @@ enum nl80211_mntr_flags {
2424 NL80211_MNTR_FLAG_CONTROL, 2441 NL80211_MNTR_FLAG_CONTROL,
2425 NL80211_MNTR_FLAG_OTHER_BSS, 2442 NL80211_MNTR_FLAG_OTHER_BSS,
2426 NL80211_MNTR_FLAG_COOK_FRAMES, 2443 NL80211_MNTR_FLAG_COOK_FRAMES,
2444 NL80211_MNTR_FLAG_ACTIVE,
2427 2445
2428 /* keep last */ 2446 /* keep last */
2429 __NL80211_MNTR_FLAG_AFTER_LAST, 2447 __NL80211_MNTR_FLAG_AFTER_LAST,
@@ -2559,6 +2577,10 @@ enum nl80211_mesh_power_mode {
2559 * 2577 *
2560 * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs) 2578 * @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs)
2561 * 2579 *
2580 * @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've
2581 * established peering with for longer than this time (in seconds), then
2582 * remove it from the STA's list of peers. Default is 30 minutes.
2583 *
2562 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use 2584 * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
2563 */ 2585 */
2564enum nl80211_meshconf_params { 2586enum nl80211_meshconf_params {
@@ -2590,6 +2612,7 @@ enum nl80211_meshconf_params {
2590 NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL, 2612 NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,
2591 NL80211_MESHCONF_POWER_MODE, 2613 NL80211_MESHCONF_POWER_MODE,
2592 NL80211_MESHCONF_AWAKE_WINDOW, 2614 NL80211_MESHCONF_AWAKE_WINDOW,
2615 NL80211_MESHCONF_PLINK_TIMEOUT,
2593 2616
2594 /* keep last */ 2617 /* keep last */
2595 __NL80211_MESHCONF_ATTR_AFTER_LAST, 2618 __NL80211_MESHCONF_ATTR_AFTER_LAST,
@@ -2637,6 +2660,10 @@ enum nl80211_meshconf_params {
2637 * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will 2660 * @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will
2638 * implement an MPM which handles peer allocation and state. 2661 * implement an MPM which handles peer allocation and state.
2639 * 2662 *
2663 * @NL80211_MESH_SETUP_AUTH_PROTOCOL: Inform the kernel of the authentication
2664 * method (u8, as defined in IEEE 8.4.2.100.6, e.g. 0x1 for SAE).
2665 * Default is no authentication method required.
2666 *
2640 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number 2667 * @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
2641 * 2668 *
2642 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use 2669 * @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
@@ -2650,6 +2677,7 @@ enum nl80211_mesh_setup_params {
2650 NL80211_MESH_SETUP_USERSPACE_AMPE, 2677 NL80211_MESH_SETUP_USERSPACE_AMPE,
2651 NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC, 2678 NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC,
2652 NL80211_MESH_SETUP_USERSPACE_MPM, 2679 NL80211_MESH_SETUP_USERSPACE_MPM,
2680 NL80211_MESH_SETUP_AUTH_PROTOCOL,
2653 2681
2654 /* keep last */ 2682 /* keep last */
2655 __NL80211_MESH_SETUP_ATTR_AFTER_LAST, 2683 __NL80211_MESH_SETUP_ATTR_AFTER_LAST,
@@ -2730,6 +2758,8 @@ enum nl80211_channel_type {
2730 * and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well 2758 * and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well
2731 * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 2759 * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2732 * attribute must be provided as well 2760 * attribute must be provided as well
2761 * @NL80211_CHAN_WIDTH_5: 5 MHz OFDM channel
2762 * @NL80211_CHAN_WIDTH_10: 10 MHz OFDM channel
2733 */ 2763 */
2734enum nl80211_chan_width { 2764enum nl80211_chan_width {
2735 NL80211_CHAN_WIDTH_20_NOHT, 2765 NL80211_CHAN_WIDTH_20_NOHT,
@@ -2738,6 +2768,8 @@ enum nl80211_chan_width {
2738 NL80211_CHAN_WIDTH_80, 2768 NL80211_CHAN_WIDTH_80,
2739 NL80211_CHAN_WIDTH_80P80, 2769 NL80211_CHAN_WIDTH_80P80,
2740 NL80211_CHAN_WIDTH_160, 2770 NL80211_CHAN_WIDTH_160,
2771 NL80211_CHAN_WIDTH_5,
2772 NL80211_CHAN_WIDTH_10,
2741}; 2773};
2742 2774
2743/** 2775/**
@@ -3556,6 +3588,10 @@ enum nl80211_ap_sme_features {
3556 * Peering Management entity which may be implemented by registering for 3588 * Peering Management entity which may be implemented by registering for
3557 * beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is 3589 * beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is
3558 * still generated by the driver. 3590 * still generated by the driver.
3591 * @NL80211_FEATURE_ACTIVE_MONITOR: This driver supports an active monitor
3592 * interface. An active monitor interface behaves like a normal monitor
3593 * interface, but gets added to the driver. It ensures that incoming
3594 * unicast packets directed at the configured interface address get ACKed.
3559 */ 3595 */
3560enum nl80211_feature_flags { 3596enum nl80211_feature_flags {
3561 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 3597 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3575,6 +3611,7 @@ enum nl80211_feature_flags {
3575 NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14, 3611 NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14,
3576 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15, 3612 NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
3577 NL80211_FEATURE_USERSPACE_MPM = 1 << 16, 3613 NL80211_FEATURE_USERSPACE_MPM = 1 << 16,
3614 NL80211_FEATURE_ACTIVE_MONITOR = 1 << 17,
3578}; 3615};
3579 3616
3580/** 3617/**
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index 405918dd7b3f..c55efaaa9bb4 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -164,6 +164,7 @@ enum ovs_vport_type {
164 OVS_VPORT_TYPE_UNSPEC, 164 OVS_VPORT_TYPE_UNSPEC,
165 OVS_VPORT_TYPE_NETDEV, /* network device */ 165 OVS_VPORT_TYPE_NETDEV, /* network device */
166 OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */ 166 OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */
167 OVS_VPORT_TYPE_GRE, /* GRE tunnel. */
167 __OVS_VPORT_TYPE_MAX 168 __OVS_VPORT_TYPE_MAX
168}; 169};
169 170
@@ -192,7 +193,6 @@ enum ovs_vport_type {
192 * optional; if not specified a free port number is automatically selected. 193 * optional; if not specified a free port number is automatically selected.
193 * Whether %OVS_VPORT_ATTR_OPTIONS is required or optional depends on the type 194 * Whether %OVS_VPORT_ATTR_OPTIONS is required or optional depends on the type
194 * of vport. 195 * of vport.
195 * and other attributes are ignored.
196 * 196 *
197 * For other requests, if %OVS_VPORT_ATTR_NAME is specified then it is used to 197 * For other requests, if %OVS_VPORT_ATTR_NAME is specified then it is used to
198 * look up the vport to operate on; otherwise dp_idx from the &struct 198 * look up the vport to operate on; otherwise dp_idx from the &struct
@@ -247,11 +247,29 @@ enum ovs_key_attr {
247 OVS_KEY_ATTR_ARP, /* struct ovs_key_arp */ 247 OVS_KEY_ATTR_ARP, /* struct ovs_key_arp */
248 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */ 248 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */
249 OVS_KEY_ATTR_SKB_MARK, /* u32 skb mark */ 249 OVS_KEY_ATTR_SKB_MARK, /* u32 skb mark */
250 OVS_KEY_ATTR_TUNNEL, /* Nested set of ovs_tunnel attributes */
251
252#ifdef __KERNEL__
253 OVS_KEY_ATTR_IPV4_TUNNEL, /* struct ovs_key_ipv4_tunnel */
254#endif
250 __OVS_KEY_ATTR_MAX 255 __OVS_KEY_ATTR_MAX
251}; 256};
252 257
253#define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1) 258#define OVS_KEY_ATTR_MAX (__OVS_KEY_ATTR_MAX - 1)
254 259
260enum ovs_tunnel_key_attr {
261 OVS_TUNNEL_KEY_ATTR_ID, /* be64 Tunnel ID */
262 OVS_TUNNEL_KEY_ATTR_IPV4_SRC, /* be32 src IP address. */
263 OVS_TUNNEL_KEY_ATTR_IPV4_DST, /* be32 dst IP address. */
264 OVS_TUNNEL_KEY_ATTR_TOS, /* u8 Tunnel IP ToS. */
265 OVS_TUNNEL_KEY_ATTR_TTL, /* u8 Tunnel IP TTL. */
266 OVS_TUNNEL_KEY_ATTR_DONT_FRAGMENT, /* No argument, set DF. */
267 OVS_TUNNEL_KEY_ATTR_CSUM, /* No argument. CSUM packet. */
268 __OVS_TUNNEL_KEY_ATTR_MAX
269};
270
271#define OVS_TUNNEL_KEY_ATTR_MAX (__OVS_TUNNEL_KEY_ATTR_MAX - 1)
272
255/** 273/**
256 * enum ovs_frag_type - IPv4 and IPv6 fragment type 274 * enum ovs_frag_type - IPv4 and IPv6 fragment type
257 * @OVS_FRAG_TYPE_NONE: Packet is not a fragment. 275 * @OVS_FRAG_TYPE_NONE: Packet is not a fragment.
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index 864e324da80d..c3cc01d474b0 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -468,7 +468,7 @@
468#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */ 468#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */
469#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */ 469#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */
470#define PCI_EXP_LNKCAP_L1EL 0x00038000 /* L1 Exit Latency */ 470#define PCI_EXP_LNKCAP_L1EL 0x00038000 /* L1 Exit Latency */
471#define PCI_EXP_LNKCAP_CLKPM 0x00040000 /* L1 Clock Power Management */ 471#define PCI_EXP_LNKCAP_CLKPM 0x00040000 /* Clock Power Management */
472#define PCI_EXP_LNKCAP_SDERC 0x00080000 /* Surprise Down Error Reporting Capable */ 472#define PCI_EXP_LNKCAP_SDERC 0x00080000 /* Surprise Down Error Reporting Capable */
473#define PCI_EXP_LNKCAP_DLLLARC 0x00100000 /* Data Link Layer Link Active Reporting Capable */ 473#define PCI_EXP_LNKCAP_DLLLARC 0x00100000 /* Data Link Layer Link Active Reporting Capable */
474#define PCI_EXP_LNKCAP_LBNC 0x00200000 /* Link Bandwidth Notification Capability */ 474#define PCI_EXP_LNKCAP_LBNC 0x00200000 /* Link Bandwidth Notification Capability */
diff --git a/include/uapi/linux/ptrace.h b/include/uapi/linux/ptrace.h
index 52ebcc89f306..cf1019e15f5b 100644
--- a/include/uapi/linux/ptrace.h
+++ b/include/uapi/linux/ptrace.h
@@ -61,6 +61,9 @@ struct ptrace_peeksiginfo_args {
61 __s32 nr; /* how may siginfos to take */ 61 __s32 nr; /* how may siginfos to take */
62}; 62};
63 63
64#define PTRACE_GETSIGMASK 0x420a
65#define PTRACE_SETSIGMASK 0x420b
66
64/* Read signals from a shared (process wide) queue */ 67/* Read signals from a shared (process wide) queue */
65#define PTRACE_PEEKSIGINFO_SHARED (1 << 0) 68#define PTRACE_PEEKSIGINFO_SHARED (1 << 0)
66 69
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index 7a2144e1afae..eb0f1a554d7b 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -386,6 +386,8 @@ enum {
386#define RTAX_RTO_MIN RTAX_RTO_MIN 386#define RTAX_RTO_MIN RTAX_RTO_MIN
387 RTAX_INITRWND, 387 RTAX_INITRWND,
388#define RTAX_INITRWND RTAX_INITRWND 388#define RTAX_INITRWND RTAX_INITRWND
389 RTAX_QUICKACK,
390#define RTAX_QUICKACK RTAX_QUICKACK
389 __RTAX_MAX 391 __RTAX_MAX
390}; 392};
391 393
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h
index df2e8b4f9c03..af0a674cc677 100644
--- a/include/uapi/linux/snmp.h
+++ b/include/uapi/linux/snmp.h
@@ -253,6 +253,7 @@ enum
253 LINUX_MIB_TCPFASTOPENLISTENOVERFLOW, /* TCPFastOpenListenOverflow */ 253 LINUX_MIB_TCPFASTOPENLISTENOVERFLOW, /* TCPFastOpenListenOverflow */
254 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */ 254 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */
255 LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */ 255 LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */
256 LINUX_MIB_LOWLATENCYRXPACKETS, /* LowLatencyRxPackets */
256 __LINUX_MIB_MAX 257 __LINUX_MIB_MAX
257}; 258};
258 259
@@ -287,6 +288,7 @@ enum
287 LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */ 288 LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */
288 LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/ 289 LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/
289 LINUX_MIB_XFRMOUTSTATEINVALID, /* XfrmOutStateInvalid */ 290 LINUX_MIB_XFRMOUTSTATEINVALID, /* XfrmOutStateInvalid */
291 LINUX_MIB_XFRMACQUIREERROR, /* XfrmAcquireError */
290 __LINUX_MIB_XFRMMAX 292 __LINUX_MIB_XFRMMAX
291}; 293};
292 294
diff --git a/include/uapi/linux/tipc.h b/include/uapi/linux/tipc.h
index f2d90091cc20..852373d27dbb 100644
--- a/include/uapi/linux/tipc.h
+++ b/include/uapi/linux/tipc.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/linux/tipc.h: Include file for TIPC socket interface 2 * include/uapi/linux/tipc.h: Header for TIPC socket interface
3 * 3 *
4 * Copyright (c) 2003-2006, Ericsson AB 4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005, 2010-2011, Wind River Systems 5 * Copyright (c) 2005, 2010-2011, Wind River Systems
diff --git a/include/uapi/linux/tipc_config.h b/include/uapi/linux/tipc_config.h
index 0b1e3f218a36..6b0bff09b3a7 100644
--- a/include/uapi/linux/tipc_config.h
+++ b/include/uapi/linux/tipc_config.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * include/linux/tipc_config.h: Include file for TIPC configuration interface 2 * include/uapi/linux/tipc_config.h: Header for TIPC configuration interface
3 * 3 *
4 * Copyright (c) 2003-2006, Ericsson AB 4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005-2007, 2010-2011, Wind River Systems 5 * Copyright (c) 2005-2007, 2010-2011, Wind River Systems
diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
index 284ff2436829..916e444e6f74 100644
--- a/include/uapi/linux/vfio.h
+++ b/include/uapi/linux/vfio.h
@@ -22,6 +22,7 @@
22/* Extensions */ 22/* Extensions */
23 23
24#define VFIO_TYPE1_IOMMU 1 24#define VFIO_TYPE1_IOMMU 1
25#define VFIO_SPAPR_TCE_IOMMU 2
25 26
26/* 27/*
27 * The IOCTL interface is designed for extensibility by embedding the 28 * The IOCTL interface is designed for extensibility by embedding the
@@ -361,10 +362,14 @@ struct vfio_iommu_type1_dma_map {
361#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13) 362#define VFIO_IOMMU_MAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 13)
362 363
363/** 364/**
364 * VFIO_IOMMU_UNMAP_DMA - _IOW(VFIO_TYPE, VFIO_BASE + 14, struct vfio_dma_unmap) 365 * VFIO_IOMMU_UNMAP_DMA - _IOWR(VFIO_TYPE, VFIO_BASE + 14,
366 * struct vfio_dma_unmap)
365 * 367 *
366 * Unmap IO virtual addresses using the provided struct vfio_dma_unmap. 368 * Unmap IO virtual addresses using the provided struct vfio_dma_unmap.
367 * Caller sets argsz. 369 * Caller sets argsz. The actual unmapped size is returned in the size
370 * field. No guarantee is made to the user that arbitrary unmaps of iova
371 * or size different from those used in the original mapping call will
372 * succeed.
368 */ 373 */
369struct vfio_iommu_type1_dma_unmap { 374struct vfio_iommu_type1_dma_unmap {
370 __u32 argsz; 375 __u32 argsz;
@@ -375,4 +380,37 @@ struct vfio_iommu_type1_dma_unmap {
375 380
376#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14) 381#define VFIO_IOMMU_UNMAP_DMA _IO(VFIO_TYPE, VFIO_BASE + 14)
377 382
383/*
384 * IOCTLs to enable/disable IOMMU container usage.
385 * No parameters are supported.
386 */
387#define VFIO_IOMMU_ENABLE _IO(VFIO_TYPE, VFIO_BASE + 15)
388#define VFIO_IOMMU_DISABLE _IO(VFIO_TYPE, VFIO_BASE + 16)
389
390/* -------- Additional API for SPAPR TCE (Server POWERPC) IOMMU -------- */
391
392/*
393 * The SPAPR TCE info struct provides the information about the PCI bus
394 * address ranges available for DMA, these values are programmed into
395 * the hardware so the guest has to know that information.
396 *
397 * The DMA 32 bit window start is an absolute PCI bus address.
398 * The IOVA address passed via map/unmap ioctls are absolute PCI bus
399 * addresses too so the window works as a filter rather than an offset
400 * for IOVA addresses.
401 *
402 * A flag will need to be added if other page sizes are supported,
403 * so as defined here, it is always 4k.
404 */
405struct vfio_iommu_spapr_tce_info {
406 __u32 argsz;
407 __u32 flags; /* reserved for future use */
408 __u32 dma32_window_start; /* 32 bit window start (bytes) */
409 __u32 dma32_window_size; /* 32 bit window size (bytes) */
410};
411
412#define VFIO_IOMMU_SPAPR_TCE_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
413
414/* ***************************************************************** */
415
378#endif /* _UAPIVFIO_H */ 416#endif /* _UAPIVFIO_H */
diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h
index b7cda390fd00..3ce768c6910d 100644
--- a/include/uapi/linux/virtio_config.h
+++ b/include/uapi/linux/virtio_config.h
@@ -51,4 +51,7 @@
51 * suppressed them? */ 51 * suppressed them? */
52#define VIRTIO_F_NOTIFY_ON_EMPTY 24 52#define VIRTIO_F_NOTIFY_ON_EMPTY 24
53 53
54/* Can the device handle any descriptor layout? */
55#define VIRTIO_F_ANY_LAYOUT 27
56
54#endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */ 57#endif /* _UAPI_LINUX_VIRTIO_CONFIG_H */
diff --git a/include/uapi/linux/virtio_console.h b/include/uapi/linux/virtio_console.h
index c312f16bc4e7..ba260dd0b33a 100644
--- a/include/uapi/linux/virtio_console.h
+++ b/include/uapi/linux/virtio_console.h
@@ -38,6 +38,7 @@
38/* Feature bits */ 38/* Feature bits */
39#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ 39#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */
40#define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */ 40#define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */
41#define VIRTIO_CONSOLE_F_EMERG_WRITE 2 /* Does host support emergency write? */
41 42
42#define VIRTIO_CONSOLE_BAD_ID (~(__u32)0) 43#define VIRTIO_CONSOLE_BAD_ID (~(__u32)0)
43 44
@@ -48,6 +49,8 @@ struct virtio_console_config {
48 __u16 rows; 49 __u16 rows;
49 /* max. number of ports this device can hold */ 50 /* max. number of ports this device can hold */
50 __u32 max_nr_ports; 51 __u32 max_nr_ports;
52 /* emergency write register */
53 __u32 emerg_wr;
51} __attribute__((packed)); 54} __attribute__((packed));
52 55
53/* 56/*
diff --git a/include/uapi/linux/virtio_pci.h b/include/uapi/linux/virtio_pci.h
index ea66f3f60d63..e5ec1caab82a 100644
--- a/include/uapi/linux/virtio_pci.h
+++ b/include/uapi/linux/virtio_pci.h
@@ -80,7 +80,9 @@
80 80
81/* The remaining space is defined by each driver as the per-driver 81/* The remaining space is defined by each driver as the per-driver
82 * configuration space */ 82 * configuration space */
83#define VIRTIO_PCI_CONFIG(dev) ((dev)->msix_enabled ? 24 : 20) 83#define VIRTIO_PCI_CONFIG_OFF(msix_enabled) ((msix_enabled) ? 24 : 20)
84/* Deprecated: please use VIRTIO_PCI_CONFIG_OFF instead */
85#define VIRTIO_PCI_CONFIG(dev) VIRTIO_PCI_CONFIG_OFF((dev)->msix_enabled)
84 86
85/* Virtio ABI version, this must match exactly */ 87/* Virtio ABI version, this must match exactly */
86#define VIRTIO_PCI_ABI_VERSION 0 88#define VIRTIO_PCI_ABI_VERSION 0
diff --git a/include/uapi/mtd/ubi-user.h b/include/uapi/mtd/ubi-user.h
index 53cae1e11e57..723c324590c1 100644
--- a/include/uapi/mtd/ubi-user.h
+++ b/include/uapi/mtd/ubi-user.h
@@ -173,7 +173,10 @@
173 173
174#define UBI_VOL_IOC_MAGIC 'O' 174#define UBI_VOL_IOC_MAGIC 'O'
175 175
176/* Start UBI volume update */ 176/* Start UBI volume update
177 * Note: This actually takes a pointer (__s64*), but we can't change
178 * that without breaking the ABI on 32bit systems
179 */
177#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, __s64) 180#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, __s64)
178/* LEB erasure command, used for debugging, disabled by default */ 181/* LEB erasure command, used for debugging, disabled by default */
179#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, __s32) 182#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, __s32)
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h
index e3983d508272..041203f20f6d 100644
--- a/include/uapi/sound/asound.h
+++ b/include/uapi/sound/asound.h
@@ -817,6 +817,8 @@ typedef int __bitwise snd_ctl_elem_iface_t;
817#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */ 817#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
818#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */ 818#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
819 819
820#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44
821
820struct snd_ctl_elem_id { 822struct snd_ctl_elem_id {
821 unsigned int numid; /* numeric identifier, zero = invalid */ 823 unsigned int numid; /* numeric identifier, zero = invalid */
822 snd_ctl_elem_iface_t iface; /* interface identifier */ 824 snd_ctl_elem_iface_t iface; /* interface identifier */
diff --git a/include/video/display_timing.h b/include/video/display_timing.h
index 5d0259b08e01..28d9d0d566ca 100644
--- a/include/video/display_timing.h
+++ b/include/video/display_timing.h
@@ -27,6 +27,7 @@ enum display_flags {
27 DISPLAY_FLAGS_PIXDATA_NEGEDGE = BIT(7), 27 DISPLAY_FLAGS_PIXDATA_NEGEDGE = BIT(7),
28 DISPLAY_FLAGS_INTERLACED = BIT(8), 28 DISPLAY_FLAGS_INTERLACED = BIT(8),
29 DISPLAY_FLAGS_DOUBLESCAN = BIT(9), 29 DISPLAY_FLAGS_DOUBLESCAN = BIT(9),
30 DISPLAY_FLAGS_DOUBLECLK = BIT(10),
30}; 31};
31 32
32/* 33/*
diff --git a/include/video/of_display_timing.h b/include/video/of_display_timing.h
index 8016eb727cf3..79e6697af6cf 100644
--- a/include/video/of_display_timing.h
+++ b/include/video/of_display_timing.h
@@ -10,10 +10,13 @@
10#define __LINUX_OF_DISPLAY_TIMING_H 10#define __LINUX_OF_DISPLAY_TIMING_H
11 11
12struct device_node; 12struct device_node;
13struct display_timing;
13struct display_timings; 14struct display_timings;
14 15
15#define OF_USE_NATIVE_MODE -1 16#define OF_USE_NATIVE_MODE -1
16 17
18int of_get_display_timing(struct device_node *np, const char *name,
19 struct display_timing *dt);
17struct display_timings *of_get_display_timings(struct device_node *np); 20struct display_timings *of_get_display_timings(struct device_node *np);
18int of_display_timings_exist(struct device_node *np); 21int of_display_timings_exist(struct device_node *np);
19 22
diff --git a/include/video/omap-panel-data.h b/include/video/omap-panel-data.h
index 0c3b46d3daf3..6b2366fb6e53 100644
--- a/include/video/omap-panel-data.h
+++ b/include/video/omap-panel-data.h
@@ -27,6 +27,9 @@
27#ifndef __OMAP_PANEL_DATA_H 27#ifndef __OMAP_PANEL_DATA_H
28#define __OMAP_PANEL_DATA_H 28#define __OMAP_PANEL_DATA_H
29 29
30#include <video/omapdss.h>
31#include <video/display_timing.h>
32
30struct omap_dss_device; 33struct omap_dss_device;
31 34
32/** 35/**
@@ -147,4 +150,210 @@ struct panel_tpo_td043_data {
147 int nreset_gpio; 150 int nreset_gpio;
148}; 151};
149 152
153/**
154 * encoder_tfp410 platform data
155 * @name: name for this display entity
156 * @power_down_gpio: gpio number for PD pin (or -1 if not available)
157 * @data_lines: number of DPI datalines
158 */
159struct encoder_tfp410_platform_data {
160 const char *name;
161 const char *source;
162 int power_down_gpio;
163 int data_lines;
164};
165
166/**
167 * encoder_tpd12s015 platform data
168 * @name: name for this display entity
169 * @ct_cp_hpd_gpio: CT_CP_HPD gpio number
170 * @ls_oe_gpio: LS_OE gpio number
171 * @hpd_gpio: HPD gpio number
172 */
173struct encoder_tpd12s015_platform_data {
174 const char *name;
175 const char *source;
176
177 int ct_cp_hpd_gpio;
178 int ls_oe_gpio;
179 int hpd_gpio;
180};
181
182/**
183 * connector_dvi platform data
184 * @name: name for this display entity
185 * @source: name of the display entity used as a video source
186 * @i2c_bus_num: i2c bus number to be used for reading EDID
187 */
188struct connector_dvi_platform_data {
189 const char *name;
190 const char *source;
191 int i2c_bus_num;
192};
193
194/**
195 * connector_hdmi platform data
196 * @name: name for this display entity
197 * @source: name of the display entity used as a video source
198 */
199struct connector_hdmi_platform_data {
200 const char *name;
201 const char *source;
202};
203
204/**
205 * connector_atv platform data
206 * @name: name for this display entity
207 * @source: name of the display entity used as a video source
208 * @connector_type: composite/svideo
209 * @invert_polarity: invert signal polarity
210 */
211struct connector_atv_platform_data {
212 const char *name;
213 const char *source;
214
215 enum omap_dss_venc_type connector_type;
216 bool invert_polarity;
217};
218
219/**
220 * panel_dpi platform data
221 * @name: name for this display entity
222 * @source: name of the display entity used as a video source
223 * @data_lines: number of DPI datalines
224 * @display_timing: timings for this panel
225 * @backlight_gpio: gpio to enable/disable the backlight (or -1)
226 * @enable_gpio: gpio to enable/disable the panel (or -1)
227 */
228struct panel_dpi_platform_data {
229 const char *name;
230 const char *source;
231
232 int data_lines;
233
234 const struct display_timing *display_timing;
235
236 int backlight_gpio;
237 int enable_gpio;
238};
239
240/**
241 * panel_dsicm platform data
242 * @name: name for this display entity
243 * @source: name of the display entity used as a video source
244 * @reset_gpio: gpio to reset the panel (or -1)
245 * @use_ext_te: use external TE GPIO
246 * @ext_te_gpio: external TE GPIO
247 * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms)
248 * @use_dsi_backlight: true if panel uses DSI command to control backlight
249 * @pin_config: DSI pin configuration
250 */
251struct panel_dsicm_platform_data {
252 const char *name;
253 const char *source;
254
255 int reset_gpio;
256
257 bool use_ext_te;
258 int ext_te_gpio;
259
260 unsigned ulps_timeout;
261
262 bool use_dsi_backlight;
263
264 struct omap_dsi_pin_config pin_config;
265};
266
267/**
268 * panel_acx565akm platform data
269 * @name: name for this display entity
270 * @source: name of the display entity used as a video source
271 * @reset_gpio: gpio to reset the panel (or -1)
272 * @datapairs: number of SDI datapairs
273 */
274struct panel_acx565akm_platform_data {
275 const char *name;
276 const char *source;
277
278 int reset_gpio;
279
280 int datapairs;
281};
282
283/**
284 * panel_lb035q02 platform data
285 * @name: name for this display entity
286 * @source: name of the display entity used as a video source
287 * @data_lines: number of DPI datalines
288 * @backlight_gpio: gpio to enable/disable the backlight (or -1)
289 * @enable_gpio: gpio to enable/disable the panel (or -1)
290 */
291struct panel_lb035q02_platform_data {
292 const char *name;
293 const char *source;
294
295 int data_lines;
296
297 int backlight_gpio;
298 int enable_gpio;
299};
300
301/**
302 * panel_sharp_ls037v7dw01 platform data
303 * @name: name for this display entity
304 * @source: name of the display entity used as a video source
305 * @data_lines: number of DPI datalines
306 * @resb_gpio: reset signal GPIO
307 * @ini_gpio: power on control GPIO
308 * @mo_gpio: selection for resolution(VGA/QVGA) GPIO
309 * @lr_gpio: selection for horizontal scanning direction GPIO
310 * @ud_gpio: selection for vertical scanning direction GPIO
311 */
312struct panel_sharp_ls037v7dw01_platform_data {
313 const char *name;
314 const char *source;
315
316 int data_lines;
317
318 int resb_gpio;
319 int ini_gpio;
320 int mo_gpio;
321 int lr_gpio;
322 int ud_gpio;
323};
324
325/**
326 * panel-tpo-td043mtea1 platform data
327 * @name: name for this display entity
328 * @source: name of the display entity used as a video source
329 * @data_lines: number of DPI datalines
330 * @nreset_gpio: reset signal
331 */
332struct panel_tpo_td043mtea1_platform_data {
333 const char *name;
334 const char *source;
335
336 int data_lines;
337
338 int nreset_gpio;
339};
340
341/**
342 * panel-nec-nl8048hl11 platform data
343 * @name: name for this display entity
344 * @source: name of the display entity used as a video source
345 * @data_lines: number of DPI datalines
346 * @res_gpio: reset signal
347 * @qvga_gpio: selection for resolution(QVGA/WVGA)
348 */
349struct panel_nec_nl8048hl11_platform_data {
350 const char *name;
351 const char *source;
352
353 int data_lines;
354
355 int res_gpio;
356 int qvga_gpio;
357};
358
150#endif /* __OMAP_PANEL_DATA_H */ 359#endif /* __OMAP_PANEL_DATA_H */
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index aeb4e9a0c5d1..b39463553845 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -23,6 +23,8 @@
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25 25
26#include <video/videomode.h>
27
26#define DISPC_IRQ_FRAMEDONE (1 << 0) 28#define DISPC_IRQ_FRAMEDONE (1 << 0)
27#define DISPC_IRQ_VSYNC (1 << 1) 29#define DISPC_IRQ_VSYNC (1 << 1)
28#define DISPC_IRQ_EVSYNC_EVEN (1 << 2) 30#define DISPC_IRQ_EVSYNC_EVEN (1 << 2)
@@ -68,6 +70,7 @@ enum omap_display_type {
68 OMAP_DISPLAY_TYPE_DSI = 1 << 3, 70 OMAP_DISPLAY_TYPE_DSI = 1 << 3,
69 OMAP_DISPLAY_TYPE_VENC = 1 << 4, 71 OMAP_DISPLAY_TYPE_VENC = 1 << 4,
70 OMAP_DISPLAY_TYPE_HDMI = 1 << 5, 72 OMAP_DISPLAY_TYPE_HDMI = 1 << 5,
73 OMAP_DISPLAY_TYPE_DVI = 1 << 6,
71}; 74};
72 75
73enum omap_plane { 76enum omap_plane {
@@ -169,6 +172,11 @@ enum omap_dss_audio_state {
169 OMAP_DSS_AUDIO_PLAYING, 172 OMAP_DSS_AUDIO_PLAYING,
170}; 173};
171 174
175struct omap_dss_audio {
176 struct snd_aes_iec958 *iec;
177 struct snd_cea_861_aud_if *cea;
178};
179
172enum omap_dss_rotation_type { 180enum omap_dss_rotation_type {
173 OMAP_DSS_ROT_DMA = 1 << 0, 181 OMAP_DSS_ROT_DMA = 1 << 0,
174 OMAP_DSS_ROT_VRFB = 1 << 1, 182 OMAP_DSS_ROT_VRFB = 1 << 1,
@@ -365,6 +373,7 @@ struct omap_dss_board_info {
365 int num_devices; 373 int num_devices;
366 struct omap_dss_device **devices; 374 struct omap_dss_device **devices;
367 struct omap_dss_device *default_device; 375 struct omap_dss_device *default_device;
376 const char *default_display_name;
368 int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask); 377 int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask);
369 void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask); 378 void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask);
370 int (*set_min_bus_tput)(struct device *dev, unsigned long r); 379 int (*set_min_bus_tput)(struct device *dev, unsigned long r);
@@ -512,7 +521,7 @@ struct omap_overlay_manager {
512 enum omap_dss_output_id supported_outputs; 521 enum omap_dss_output_id supported_outputs;
513 522
514 /* dynamic fields */ 523 /* dynamic fields */
515 struct omap_dss_output *output; 524 struct omap_dss_device *output;
516 525
517 /* 526 /*
518 * The following functions do not block: 527 * The following functions do not block:
@@ -526,7 +535,7 @@ struct omap_overlay_manager {
526 */ 535 */
527 536
528 int (*set_output)(struct omap_overlay_manager *mgr, 537 int (*set_output)(struct omap_overlay_manager *mgr,
529 struct omap_dss_output *output); 538 struct omap_dss_device *output);
530 int (*unset_output)(struct omap_overlay_manager *mgr); 539 int (*unset_output)(struct omap_overlay_manager *mgr);
531 540
532 int (*set_manager_info)(struct omap_overlay_manager *mgr, 541 int (*set_manager_info)(struct omap_overlay_manager *mgr,
@@ -569,33 +578,192 @@ struct omap_dss_writeback_info {
569 u8 pre_mult_alpha; 578 u8 pre_mult_alpha;
570}; 579};
571 580
572struct omap_dss_output { 581struct omapdss_dpi_ops {
573 struct list_head list; 582 int (*connect)(struct omap_dss_device *dssdev,
583 struct omap_dss_device *dst);
584 void (*disconnect)(struct omap_dss_device *dssdev,
585 struct omap_dss_device *dst);
574 586
575 const char *name; 587 int (*enable)(struct omap_dss_device *dssdev);
588 void (*disable)(struct omap_dss_device *dssdev);
576 589
577 /* display type supported by the output */ 590 int (*check_timings)(struct omap_dss_device *dssdev,
578 enum omap_display_type type; 591 struct omap_video_timings *timings);
592 void (*set_timings)(struct omap_dss_device *dssdev,
593 struct omap_video_timings *timings);
594 void (*get_timings)(struct omap_dss_device *dssdev,
595 struct omap_video_timings *timings);
579 596
580 /* DISPC channel for this output */ 597 void (*set_data_lines)(struct omap_dss_device *dssdev, int data_lines);
581 enum omap_channel dispc_channel; 598};
582 599
583 /* output instance */ 600struct omapdss_sdi_ops {
584 enum omap_dss_output_id id; 601 int (*connect)(struct omap_dss_device *dssdev,
602 struct omap_dss_device *dst);
603 void (*disconnect)(struct omap_dss_device *dssdev,
604 struct omap_dss_device *dst);
585 605
586 /* output's platform device pointer */ 606 int (*enable)(struct omap_dss_device *dssdev);
587 struct platform_device *pdev; 607 void (*disable)(struct omap_dss_device *dssdev);
588 608
589 /* dynamic fields */ 609 int (*check_timings)(struct omap_dss_device *dssdev,
590 struct omap_overlay_manager *manager; 610 struct omap_video_timings *timings);
611 void (*set_timings)(struct omap_dss_device *dssdev,
612 struct omap_video_timings *timings);
613 void (*get_timings)(struct omap_dss_device *dssdev,
614 struct omap_video_timings *timings);
591 615
592 struct omap_dss_device *device; 616 void (*set_datapairs)(struct omap_dss_device *dssdev, int datapairs);
617};
618
619struct omapdss_dvi_ops {
620 int (*connect)(struct omap_dss_device *dssdev,
621 struct omap_dss_device *dst);
622 void (*disconnect)(struct omap_dss_device *dssdev,
623 struct omap_dss_device *dst);
624
625 int (*enable)(struct omap_dss_device *dssdev);
626 void (*disable)(struct omap_dss_device *dssdev);
627
628 int (*check_timings)(struct omap_dss_device *dssdev,
629 struct omap_video_timings *timings);
630 void (*set_timings)(struct omap_dss_device *dssdev,
631 struct omap_video_timings *timings);
632 void (*get_timings)(struct omap_dss_device *dssdev,
633 struct omap_video_timings *timings);
634};
635
636struct omapdss_atv_ops {
637 int (*connect)(struct omap_dss_device *dssdev,
638 struct omap_dss_device *dst);
639 void (*disconnect)(struct omap_dss_device *dssdev,
640 struct omap_dss_device *dst);
641
642 int (*enable)(struct omap_dss_device *dssdev);
643 void (*disable)(struct omap_dss_device *dssdev);
644
645 int (*check_timings)(struct omap_dss_device *dssdev,
646 struct omap_video_timings *timings);
647 void (*set_timings)(struct omap_dss_device *dssdev,
648 struct omap_video_timings *timings);
649 void (*get_timings)(struct omap_dss_device *dssdev,
650 struct omap_video_timings *timings);
651
652 void (*set_type)(struct omap_dss_device *dssdev,
653 enum omap_dss_venc_type type);
654 void (*invert_vid_out_polarity)(struct omap_dss_device *dssdev,
655 bool invert_polarity);
656
657 int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
658 u32 (*get_wss)(struct omap_dss_device *dssdev);
659};
660
661struct omapdss_hdmi_ops {
662 int (*connect)(struct omap_dss_device *dssdev,
663 struct omap_dss_device *dst);
664 void (*disconnect)(struct omap_dss_device *dssdev,
665 struct omap_dss_device *dst);
666
667 int (*enable)(struct omap_dss_device *dssdev);
668 void (*disable)(struct omap_dss_device *dssdev);
669
670 int (*check_timings)(struct omap_dss_device *dssdev,
671 struct omap_video_timings *timings);
672 void (*set_timings)(struct omap_dss_device *dssdev,
673 struct omap_video_timings *timings);
674 void (*get_timings)(struct omap_dss_device *dssdev,
675 struct omap_video_timings *timings);
676
677 int (*read_edid)(struct omap_dss_device *dssdev, u8 *buf, int len);
678 bool (*detect)(struct omap_dss_device *dssdev);
679
680 /*
681 * Note: These functions might sleep. Do not call while
682 * holding a spinlock/readlock.
683 */
684 int (*audio_enable)(struct omap_dss_device *dssdev);
685 void (*audio_disable)(struct omap_dss_device *dssdev);
686 bool (*audio_supported)(struct omap_dss_device *dssdev);
687 int (*audio_config)(struct omap_dss_device *dssdev,
688 struct omap_dss_audio *audio);
689 /* Note: These functions may not sleep */
690 int (*audio_start)(struct omap_dss_device *dssdev);
691 void (*audio_stop)(struct omap_dss_device *dssdev);
692};
693
694struct omapdss_dsi_ops {
695 int (*connect)(struct omap_dss_device *dssdev,
696 struct omap_dss_device *dst);
697 void (*disconnect)(struct omap_dss_device *dssdev,
698 struct omap_dss_device *dst);
699
700 int (*enable)(struct omap_dss_device *dssdev);
701 void (*disable)(struct omap_dss_device *dssdev, bool disconnect_lanes,
702 bool enter_ulps);
703
704 /* bus configuration */
705 int (*set_config)(struct omap_dss_device *dssdev,
706 const struct omap_dss_dsi_config *cfg);
707 int (*configure_pins)(struct omap_dss_device *dssdev,
708 const struct omap_dsi_pin_config *pin_cfg);
709
710 void (*enable_hs)(struct omap_dss_device *dssdev, int channel,
711 bool enable);
712 int (*enable_te)(struct omap_dss_device *dssdev, bool enable);
713
714 int (*update)(struct omap_dss_device *dssdev, int channel,
715 void (*callback)(int, void *), void *data);
716
717 void (*bus_lock)(struct omap_dss_device *dssdev);
718 void (*bus_unlock)(struct omap_dss_device *dssdev);
719
720 int (*enable_video_output)(struct omap_dss_device *dssdev, int channel);
721 void (*disable_video_output)(struct omap_dss_device *dssdev,
722 int channel);
723
724 int (*request_vc)(struct omap_dss_device *dssdev, int *channel);
725 int (*set_vc_id)(struct omap_dss_device *dssdev, int channel,
726 int vc_id);
727 void (*release_vc)(struct omap_dss_device *dssdev, int channel);
728
729 /* data transfer */
730 int (*dcs_write)(struct omap_dss_device *dssdev, int channel,
731 u8 *data, int len);
732 int (*dcs_write_nosync)(struct omap_dss_device *dssdev, int channel,
733 u8 *data, int len);
734 int (*dcs_read)(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
735 u8 *data, int len);
736
737 int (*gen_write)(struct omap_dss_device *dssdev, int channel,
738 u8 *data, int len);
739 int (*gen_write_nosync)(struct omap_dss_device *dssdev, int channel,
740 u8 *data, int len);
741 int (*gen_read)(struct omap_dss_device *dssdev, int channel,
742 u8 *reqdata, int reqlen,
743 u8 *data, int len);
744
745 int (*bta_sync)(struct omap_dss_device *dssdev, int channel);
746
747 int (*set_max_rx_packet_size)(struct omap_dss_device *dssdev,
748 int channel, u16 plen);
593}; 749};
594 750
595struct omap_dss_device { 751struct omap_dss_device {
596 struct device dev; 752 /* old device, to be removed */
753 struct device old_dev;
754
755 /* new device, pointer to panel device */
756 struct device *dev;
757
758 struct module *owner;
759
760 struct list_head panel_list;
761
762 /* alias in the form of "display%d" */
763 char alias[16];
597 764
598 enum omap_display_type type; 765 enum omap_display_type type;
766 enum omap_display_type output_type;
599 767
600 /* obsolete, to be removed */ 768 /* obsolete, to be removed */
601 enum omap_channel channel; 769 enum omap_channel channel;
@@ -616,9 +784,6 @@ struct omap_dss_device {
616 784
617 struct { 785 struct {
618 int module; 786 int module;
619
620 bool ext_te;
621 u8 ext_te_gpio;
622 } dsi; 787 } dsi;
623 788
624 struct { 789 struct {
@@ -639,10 +804,6 @@ struct omap_dss_device {
639 struct rfbi_timings rfbi_timings; 804 struct rfbi_timings rfbi_timings;
640 } ctrl; 805 } ctrl;
641 806
642 int reset_gpio;
643
644 int max_backlight_level;
645
646 const char *name; 807 const char *name;
647 808
648 /* used to match device to driver */ 809 /* used to match device to driver */
@@ -652,22 +813,40 @@ struct omap_dss_device {
652 813
653 struct omap_dss_driver *driver; 814 struct omap_dss_driver *driver;
654 815
816 union {
817 const struct omapdss_dpi_ops *dpi;
818 const struct omapdss_sdi_ops *sdi;
819 const struct omapdss_dvi_ops *dvi;
820 const struct omapdss_hdmi_ops *hdmi;
821 const struct omapdss_atv_ops *atv;
822 const struct omapdss_dsi_ops *dsi;
823 } ops;
824
655 /* helper variable for driver suspend/resume */ 825 /* helper variable for driver suspend/resume */
656 bool activate_after_resume; 826 bool activate_after_resume;
657 827
658 enum omap_display_caps caps; 828 enum omap_display_caps caps;
659 829
660 struct omap_dss_output *output; 830 struct omap_dss_device *output;
661 831
662 enum omap_dss_display_state state; 832 enum omap_dss_display_state state;
663 833
664 enum omap_dss_audio_state audio_state; 834 enum omap_dss_audio_state audio_state;
665 835
666 /* platform specific */ 836 /* OMAP DSS output specific fields */
667 int (*platform_enable)(struct omap_dss_device *dssdev); 837
668 void (*platform_disable)(struct omap_dss_device *dssdev); 838 struct list_head list;
669 int (*set_backlight)(struct omap_dss_device *dssdev, int level); 839
670 int (*get_backlight)(struct omap_dss_device *dssdev); 840 /* DISPC channel for this output */
841 enum omap_channel dispc_channel;
842
843 /* output instance */
844 enum omap_dss_output_id id;
845
846 /* dynamic fields */
847 struct omap_overlay_manager *manager;
848
849 struct omap_dss_device *device;
671}; 850};
672 851
673struct omap_dss_hdmi_data 852struct omap_dss_hdmi_data
@@ -677,17 +856,15 @@ struct omap_dss_hdmi_data
677 int hpd_gpio; 856 int hpd_gpio;
678}; 857};
679 858
680struct omap_dss_audio {
681 struct snd_aes_iec958 *iec;
682 struct snd_cea_861_aud_if *cea;
683};
684
685struct omap_dss_driver { 859struct omap_dss_driver {
686 struct device_driver driver; 860 struct device_driver driver;
687 861
688 int (*probe)(struct omap_dss_device *); 862 int (*probe)(struct omap_dss_device *);
689 void (*remove)(struct omap_dss_device *); 863 void (*remove)(struct omap_dss_device *);
690 864
865 int (*connect)(struct omap_dss_device *dssdev);
866 void (*disconnect)(struct omap_dss_device *dssdev);
867
691 int (*enable)(struct omap_dss_device *display); 868 int (*enable)(struct omap_dss_device *display);
692 void (*disable)(struct omap_dss_device *display); 869 void (*disable)(struct omap_dss_device *display);
693 int (*run_test)(struct omap_dss_device *display, int test); 870 int (*run_test)(struct omap_dss_device *display, int test);
@@ -753,7 +930,10 @@ bool omapdss_is_initialized(void);
753int omap_dss_register_driver(struct omap_dss_driver *); 930int omap_dss_register_driver(struct omap_dss_driver *);
754void omap_dss_unregister_driver(struct omap_dss_driver *); 931void omap_dss_unregister_driver(struct omap_dss_driver *);
755 932
756void omap_dss_get_device(struct omap_dss_device *dssdev); 933int omapdss_register_display(struct omap_dss_device *dssdev);
934void omapdss_unregister_display(struct omap_dss_device *dssdev);
935
936struct omap_dss_device *omap_dss_get_device(struct omap_dss_device *dssdev);
757void omap_dss_put_device(struct omap_dss_device *dssdev); 937void omap_dss_put_device(struct omap_dss_device *dssdev);
758#define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL) 938#define for_each_dss_dev(d) while ((d = omap_dss_get_next_device(d)) != NULL)
759struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from); 939struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from);
@@ -761,8 +941,10 @@ struct omap_dss_device *omap_dss_find_device(void *data,
761 int (*match)(struct omap_dss_device *dssdev, void *data)); 941 int (*match)(struct omap_dss_device *dssdev, void *data));
762const char *omapdss_get_default_display_name(void); 942const char *omapdss_get_default_display_name(void);
763 943
764int omap_dss_start_device(struct omap_dss_device *dssdev); 944void videomode_to_omap_video_timings(const struct videomode *vm,
765void omap_dss_stop_device(struct omap_dss_device *dssdev); 945 struct omap_video_timings *ovt);
946void omap_video_timings_to_videomode(const struct omap_video_timings *ovt,
947 struct videomode *vm);
766 948
767int dss_feat_get_num_mgrs(void); 949int dss_feat_get_num_mgrs(void);
768int dss_feat_get_num_ovls(void); 950int dss_feat_get_num_ovls(void);
@@ -778,10 +960,17 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
778int omap_dss_get_num_overlays(void); 960int omap_dss_get_num_overlays(void);
779struct omap_overlay *omap_dss_get_overlay(int num); 961struct omap_overlay *omap_dss_get_overlay(int num);
780 962
781struct omap_dss_output *omap_dss_get_output(enum omap_dss_output_id id); 963int omapdss_register_output(struct omap_dss_device *output);
782int omapdss_output_set_device(struct omap_dss_output *out, 964void omapdss_unregister_output(struct omap_dss_device *output);
965struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id);
966struct omap_dss_device *omap_dss_find_output(const char *name);
967struct omap_dss_device *omap_dss_find_output_by_node(struct device_node *node);
968int omapdss_output_set_device(struct omap_dss_device *out,
783 struct omap_dss_device *dssdev); 969 struct omap_dss_device *dssdev);
784int omapdss_output_unset_device(struct omap_dss_output *out); 970int omapdss_output_unset_device(struct omap_dss_device *out);
971
972struct omap_dss_device *omapdss_find_output_from_display(struct omap_dss_device *dssdev);
973struct omap_overlay_manager *omapdss_find_mgr_from_display(struct omap_dss_device *dssdev);
785 974
786void omapdss_default_get_resolution(struct omap_dss_device *dssdev, 975void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
787 u16 *xres, u16 *yres); 976 u16 *xres, u16 *yres);
@@ -832,7 +1021,7 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
832 bool mem_to_mem); 1021 bool mem_to_mem);
833 1022
834#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) 1023#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
835#define to_dss_device(x) container_of((x), struct omap_dss_device, dev) 1024#define to_dss_device(x) container_of((x), struct omap_dss_device, old_dev)
836 1025
837void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel, 1026void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
838 bool enable); 1027 bool enable);
@@ -883,6 +1072,11 @@ int omapdss_compat_init(void);
883void omapdss_compat_uninit(void); 1072void omapdss_compat_uninit(void);
884 1073
885struct dss_mgr_ops { 1074struct dss_mgr_ops {
1075 int (*connect)(struct omap_overlay_manager *mgr,
1076 struct omap_dss_device *dst);
1077 void (*disconnect)(struct omap_overlay_manager *mgr,
1078 struct omap_dss_device *dst);
1079
886 void (*start_update)(struct omap_overlay_manager *mgr); 1080 void (*start_update)(struct omap_overlay_manager *mgr);
887 int (*enable)(struct omap_overlay_manager *mgr); 1081 int (*enable)(struct omap_overlay_manager *mgr);
888 void (*disable)(struct omap_overlay_manager *mgr); 1082 void (*disable)(struct omap_overlay_manager *mgr);
@@ -899,6 +1093,10 @@ struct dss_mgr_ops {
899int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops); 1093int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
900void dss_uninstall_mgr_ops(void); 1094void dss_uninstall_mgr_ops(void);
901 1095
1096int dss_mgr_connect(struct omap_overlay_manager *mgr,
1097 struct omap_dss_device *dst);
1098void dss_mgr_disconnect(struct omap_overlay_manager *mgr,
1099 struct omap_dss_device *dst);
902void dss_mgr_set_timings(struct omap_overlay_manager *mgr, 1100void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
903 const struct omap_video_timings *timings); 1101 const struct omap_video_timings *timings);
904void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr, 1102void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
@@ -910,4 +1108,15 @@ int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
910 void (*handler)(void *), void *data); 1108 void (*handler)(void *), void *data);
911void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr, 1109void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
912 void (*handler)(void *), void *data); 1110 void (*handler)(void *), void *data);
1111
1112static inline bool omapdss_device_is_connected(struct omap_dss_device *dssdev)
1113{
1114 return dssdev->output;
1115}
1116
1117static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
1118{
1119 return dssdev->state == OMAP_DSS_DISPLAY_ACTIVE;
1120}
1121
913#endif 1122#endif
diff --git a/include/video/uvesafb.h b/include/video/uvesafb.h
index 1a91850cb961..30f53625415c 100644
--- a/include/video/uvesafb.h
+++ b/include/video/uvesafb.h
@@ -134,6 +134,7 @@ struct uvesafb_par {
134 134
135 int mode_idx; 135 int mode_idx;
136 struct vbe_crtc_ib crtc; 136 struct vbe_crtc_ib crtc;
137 int mtrr_handle;
137}; 138};
138 139
139#endif /* _UVESAFB_H */ 140#endif /* _UVESAFB_H */
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index 68d73d09b770..46aa3d1c1654 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -78,11 +78,25 @@ static inline int xen_acpi_get_pxm(acpi_handle h)
78int xen_acpi_notify_hypervisor_state(u8 sleep_state, 78int xen_acpi_notify_hypervisor_state(u8 sleep_state,
79 u32 pm1a_cnt, u32 pm1b_cnd); 79 u32 pm1a_cnt, u32 pm1b_cnd);
80 80
81static inline int xen_acpi_suspend_lowlevel(void)
82{
83 /*
84 * Xen will save and restore CPU context, so
85 * we can skip that and just go straight to
86 * the suspend.
87 */
88 acpi_enter_sleep_state(ACPI_STATE_S3);
89 return 0;
90}
91
81static inline void xen_acpi_sleep_register(void) 92static inline void xen_acpi_sleep_register(void)
82{ 93{
83 if (xen_initial_domain()) 94 if (xen_initial_domain()) {
84 acpi_os_set_prepare_sleep( 95 acpi_os_set_prepare_sleep(
85 &xen_acpi_notify_hypervisor_state); 96 &xen_acpi_notify_hypervisor_state);
97
98 acpi_suspend_lowlevel = xen_acpi_suspend_lowlevel;
99 }
86} 100}
87#else 101#else
88static inline void xen_acpi_sleep_register(void) 102static inline void xen_acpi_sleep_register(void)
diff --git a/include/xen/hvm.h b/include/xen/hvm.h
index 13e43e41637d..63917a8de3b0 100644
--- a/include/xen/hvm.h
+++ b/include/xen/hvm.h
@@ -44,8 +44,8 @@ static inline int hvm_get_parameter(int idx, uint64_t *value)
44 xhv.index = idx; 44 xhv.index = idx;
45 r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv); 45 r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv);
46 if (r < 0) { 46 if (r < 0) {
47 printk(KERN_ERR "Cannot get hvm parameter %s (%d): %d!\n", 47 pr_err("Cannot get hvm parameter %s (%d): %d!\n",
48 param_name(idx), idx, r); 48 param_name(idx), idx, r);
49 return r; 49 return r;
50 } 50 }
51 *value = xhv.value; 51 *value = xhv.value;
diff --git a/include/xen/interface/io/netif.h b/include/xen/interface/io/netif.h
index 3ef3fe05ee99..eb262e3324d2 100644
--- a/include/xen/interface/io/netif.h
+++ b/include/xen/interface/io/netif.h
@@ -38,6 +38,18 @@
38 * that it cannot safely queue packets (as it may not be kicked to send them). 38 * that it cannot safely queue packets (as it may not be kicked to send them).
39 */ 39 */
40 40
41 /*
42 * "feature-split-event-channels" is introduced to separate guest TX
43 * and RX notificaion. Backend either doesn't support this feature or
44 * advertise it via xenstore as 0 (disabled) or 1 (enabled).
45 *
46 * To make use of this feature, frontend should allocate two event
47 * channels for TX and RX, advertise them to backend as
48 * "event-channel-tx" and "event-channel-rx" respectively. If frontend
49 * doesn't want to use this feature, it just writes "event-channel"
50 * node as before.
51 */
52
41/* 53/*
42 * This is the 'wire' format for packets: 54 * This is the 'wire' format for packets:
43 * Request 1: xen_netif_tx_request -- XEN_NETTXF_* (any flags) 55 * Request 1: xen_netif_tx_request -- XEN_NETTXF_* (any flags)
diff --git a/include/xen/interface/io/protocols.h b/include/xen/interface/io/protocols.h
index 0eafaf254fff..056744b4b05e 100644
--- a/include/xen/interface/io/protocols.h
+++ b/include/xen/interface/io/protocols.h
@@ -15,7 +15,7 @@
15# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_IA64 15# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_IA64
16#elif defined(__powerpc64__) 16#elif defined(__powerpc64__)
17# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_POWERPC64 17# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_POWERPC64
18#elif defined(__arm__) 18#elif defined(__arm__) || defined(__aarch64__)
19# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_ARM 19# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_ARM
20#else 20#else
21# error arch fixup needed here 21# error arch fixup needed here