aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h42
-rw-r--r--include/acpi/acpi_drivers.h14
-rw-r--r--include/acpi/acpixf.h8
-rw-r--r--include/acpi/actypes.h21
-rw-r--r--include/asm-generic/pgtable.h34
-rw-r--r--include/asm-generic/tlb.h2
-rw-r--r--include/asm-generic/vmlinux.lds.h7
-rw-r--r--include/asm-generic/vtime.h0
-rw-r--r--include/clocksource/arm_arch_timer.h10
-rw-r--r--include/drm/drmP.h254
-rw-r--r--include/drm/drm_agpsupport.h194
-rw-r--r--include/drm/drm_crtc.h85
-rw-r--r--include/drm/drm_dp_helper.h31
-rw-r--r--include/drm/drm_edid.h5
-rw-r--r--include/drm/drm_fb_cma_helper.h1
-rw-r--r--include/drm/drm_flip_work.h76
-rw-r--r--include/drm/drm_gem_cma_helper.h8
-rw-r--r--include/drm/drm_mm.h142
-rw-r--r--include/drm/drm_pciids.h48
-rw-r--r--include/drm/drm_vma_manager.h257
-rw-r--r--include/drm/exynos_drm.h3
-rw-r--r--include/drm/i2c/tda998x.h30
-rw-r--r--include/drm/ttm/ttm_bo_api.h15
-rw-r--r--include/drm/ttm/ttm_bo_driver.h10
-rw-r--r--include/dt-bindings/pwm/pwm.h14
-rw-r--r--include/dt-bindings/sound/fsl-imx-audmux.h56
-rw-r--r--include/kvm/arm_vgic.h2
-rw-r--r--include/linux/acpi.h7
-rw-r--r--include/linux/ata.h123
-rw-r--r--include/linux/atmel-ssc.h2
-rw-r--r--include/linux/atmel_serial.h2
-rw-r--r--include/linux/bcma/bcma.h17
-rw-r--r--include/linux/bcma/bcma_driver_pci.h24
-rw-r--r--include/linux/buffer_head.h2
-rw-r--r--include/linux/can/platform/mcp251x.h15
-rw-r--r--include/linux/cgroup.h303
-rw-r--r--include/linux/coda.h1
-rw-r--r--include/linux/compat.h7
-rw-r--r--include/linux/context_tracking.h128
-rw-r--r--include/linux/context_tracking_state.h39
-rw-r--r--include/linux/cpu.h5
-rw-r--r--include/linux/cpufreq.h388
-rw-r--r--include/linux/cpuidle.h9
-rw-r--r--include/linux/dcache.h40
-rw-r--r--include/linux/debugfs.h7
-rw-r--r--include/linux/debugobjects.h6
-rw-r--r--include/linux/device.h33
-rw-r--r--include/linux/dm9000.h4
-rw-r--r--include/linux/dma-contiguous.h2
-rw-r--r--include/linux/dma-mapping.h5
-rw-r--r--include/linux/err.h5
-rw-r--r--include/linux/etherdevice.h15
-rw-r--r--include/linux/extcon/of_extcon.h31
-rw-r--r--include/linux/f2fs_fs.h20
-rw-r--r--include/linux/fs.h10
-rw-r--r--include/linux/fs_enet_pd.h6
-rw-r--r--include/linux/ftrace_event.h46
-rw-r--r--include/linux/hardirq.h117
-rw-r--r--include/linux/hdmi.h53
-rw-r--r--include/linux/hid-sensor-hub.h2
-rw-r--r--include/linux/hid-sensor-ids.h2
-rw-r--r--include/linux/hid.h16
-rw-r--r--include/linux/hidraw.h1
-rw-r--r--include/linux/hyperv.h31
-rw-r--r--include/linux/i2c.h24
-rw-r--r--include/linux/i2c/i2c-hid.h3
-rw-r--r--include/linux/i2c/pxa-i2c.h3
-rw-r--r--include/linux/ieee80211.h72
-rw-r--r--include/linux/if_team.h14
-rw-r--r--include/linux/igmp.h1
-rw-r--r--include/linux/iio/common/st_sensors.h14
-rw-r--r--include/linux/iio/iio.h54
-rw-r--r--include/linux/iio/sysfs.h5
-rw-r--r--include/linux/iio/trigger.h3
-rw-r--r--include/linux/inetdevice.h34
-rw-r--r--include/linux/ipv6.h4
-rw-r--r--include/linux/jbd.h17
-rw-r--r--include/linux/jiffies.h8
-rw-r--r--include/linux/jump_label.h28
-rw-r--r--include/linux/jump_label_ratelimit.h34
-rw-r--r--include/linux/kbd_kern.h3
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/kobject.h4
-rw-r--r--include/linux/ktime.h28
-rw-r--r--include/linux/kvm_host.h13
-rw-r--r--include/linux/libata.h120
-rw-r--r--include/linux/llist.h23
-rw-r--r--include/linux/lockdep.h92
-rw-r--r--include/linux/lockref.h36
-rw-r--r--include/linux/memcontrol.h2
-rw-r--r--include/linux/memory.h14
-rw-r--r--include/linux/mfd/arizona/gpio.h96
-rw-r--r--include/linux/mfd/palmas.h52
-rw-r--r--include/linux/mfd/samsung/s2mps11.h11
-rw-r--r--include/linux/mfd/ti_am335x_tscadc.h16
-rw-r--r--include/linux/mfd/tps65217.h19
-rw-r--r--include/linux/mlx4/cmd.h1
-rw-r--r--include/linux/mlx4/device.h17
-rw-r--r--include/linux/mlx4/qp.h5
-rw-r--r--include/linux/mlx5/device.h22
-rw-r--r--include/linux/mlx5/driver.h7
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/mm_types.h1
-rw-r--r--include/linux/mod_devicetable.h2
-rw-r--r--include/linux/module.h6
-rw-r--r--include/linux/moduleparam.h13
-rw-r--r--include/linux/mv643xx_eth.h3
-rw-r--r--include/linux/namei.h1
-rw-r--r--include/linux/netdevice.h54
-rw-r--r--include/linux/netfilter.h15
-rw-r--r--include/linux/nodemask.h11
-rw-r--r--include/linux/nsproxy.h6
-rw-r--r--include/linux/of.h14
-rw-r--r--include/linux/of_device.h15
-rw-r--r--include/linux/of_i2c.h46
-rw-r--r--include/linux/olpc-ec.h1
-rw-r--r--include/linux/oprofile.h16
-rw-r--r--include/linux/pci-acpi.h10
-rw-r--r--include/linux/pci.h29
-rw-r--r--include/linux/pci_hotplug.h17
-rw-r--r--include/linux/pci_ids.h6
-rw-r--r--include/linux/percpu-defs.h5
-rw-r--r--include/linux/perf_event.h25
-rw-r--r--include/linux/pinctrl/pinconf-generic.h33
-rw-r--r--include/linux/pinctrl/pinconf.h6
-rw-r--r--include/linux/platform_data/asoc-s3c.h1
-rw-r--r--include/linux/platform_data/at91_adc.h4
-rw-r--r--include/linux/platform_data/brcmfmac-sdio.h6
-rw-r--r--include/linux/platform_data/camera-mx3.h4
-rw-r--r--include/linux/platform_data/camera-rcar.h25
-rw-r--r--include/linux/platform_data/cpsw.h44
-rw-r--r--include/linux/platform_data/efm32-spi.h14
-rw-r--r--include/linux/platform_data/max310x.h9
-rw-r--r--include/linux/platform_data/omap-abe-twl6040.h49
-rw-r--r--include/linux/platform_data/pinctrl-nomadik.h24
-rw-r--r--include/linux/platform_data/rcar-du.h34
-rw-r--r--include/linux/platform_data/serial-sccnxp.h3
-rw-r--r--include/linux/platform_data/simplefb.h64
-rw-r--r--include/linux/platform_data/st_sensors_pdata.h24
-rw-r--r--include/linux/platform_data/tegra_usb.h32
-rw-r--r--include/linux/platform_data/vsp1.h25
-rw-r--r--include/linux/pps_kernel.h2
-rw-r--r--include/linux/preempt_mask.h122
-rw-r--r--include/linux/printk.h2
-rw-r--r--include/linux/pstore.h6
-rw-r--r--include/linux/pxa2xx_ssp.h11
-rw-r--r--include/linux/quotaops.h15
-rw-r--r--include/linux/raid/pq.h5
-rw-r--r--include/linux/rculist.h5
-rw-r--r--include/linux/rcupdate.h26
-rw-r--r--include/linux/regmap.h12
-rw-r--r--include/linux/regulator/consumer.h32
-rw-r--r--include/linux/regulator/driver.h25
-rw-r--r--include/linux/regulator/fan53555.h1
-rw-r--r--include/linux/regulator/machine.h1
-rw-r--r--include/linux/regulator/max8660.h2
-rw-r--r--include/linux/regulator/pfuze100.h44
-rw-r--r--include/linux/sched.h17
-rw-r--r--include/linux/sh_eth.h10
-rw-r--r--include/linux/signal.h8
-rw-r--r--include/linux/skbuff.h19
-rw-r--r--include/linux/smsc911x.h3
-rw-r--r--include/linux/socket.h2
-rw-r--r--include/linux/spi/spi.h36
-rw-r--r--include/linux/spi/spi_bitbang.h5
-rw-r--r--include/linux/spinlock.h14
-rw-r--r--include/linux/stmmac.h1
-rw-r--r--include/linux/sunrpc/sched.h1
-rw-r--r--include/linux/swapops.h2
-rw-r--r--include/linux/syscalls.h5
-rw-r--r--include/linux/sysfs.h36
-rw-r--r--include/linux/tcp.h2
-rw-r--r--include/linux/tick.h45
-rw-r--r--include/linux/tty.h66
-rw-r--r--include/linux/tty_flip.h8
-rw-r--r--include/linux/tty_ldisc.h16
-rw-r--r--include/linux/usb.h32
-rw-r--r--include/linux/usb/chipidea.h7
-rw-r--r--include/linux/usb/dwc3-omap.h30
-rw-r--r--include/linux/usb/gadget.h4
-rw-r--r--include/linux/usb/hcd.h19
-rw-r--r--include/linux/usb/of.h10
-rw-r--r--include/linux/usb/phy.h18
-rw-r--r--include/linux/usb/tegra_usb_phy.h40
-rw-r--r--include/linux/usb/usb_phy_gen_xceiv.h (renamed from include/linux/usb/nop-usb-xceiv.h)4
-rw-r--r--include/linux/usb/usbnet.h4
-rw-r--r--include/linux/usb/wusb-wa.h1
-rw-r--r--include/linux/user_namespace.h1
-rw-r--r--include/linux/uwb/spec.h5
-rw-r--r--include/linux/vga_switcheroo.h13
-rw-r--r--include/linux/vmpressure.h6
-rw-r--r--include/linux/vtime.h74
-rw-r--r--include/linux/wait.h57
-rw-r--r--include/linux/workqueue.h7
-rw-r--r--include/media/adv7343.h20
-rw-r--r--include/media/adv7511.h48
-rw-r--r--include/media/adv7842.h226
-rw-r--r--include/media/davinci/vpif_types.h4
-rw-r--r--include/media/lirc_dev.h1
-rw-r--r--include/media/media-entity.h4
-rw-r--r--include/media/mt9v032.h4
-rw-r--r--include/media/rc-core.h4
-rw-r--r--include/media/saa7115.h77
-rw-r--r--include/media/smiapp.h1
-rw-r--r--include/media/tea575x.h (renamed from include/sound/tea575x-tuner.h)1
-rw-r--r--include/media/tveeprom.h4
-rw-r--r--include/media/v4l2-async.h36
-rw-r--r--include/media/v4l2-common.h14
-rw-r--r--include/media/v4l2-ctrls.h1
-rw-r--r--include/media/v4l2-dv-timings.h161
-rw-r--r--include/media/v4l2-mediabus.h3
-rw-r--r--include/media/v4l2-mem2mem.h13
-rw-r--r--include/media/v4l2-subdev.h13
-rw-r--r--include/media/videobuf2-core.h11
-rw-r--r--include/net/9p/transport.h3
-rw-r--r--include/net/act_api.h60
-rw-r--r--include/net/addrconf.h180
-rw-r--r--include/net/af_rxrpc.h35
-rw-r--r--include/net/af_unix.h17
-rw-r--r--include/net/af_vsock.h175
-rw-r--r--include/net/arp.h30
-rw-r--r--include/net/ax25.h215
-rw-r--r--include/net/bluetooth/bluetooth.h8
-rw-r--r--include/net/bluetooth/hci.h7
-rw-r--r--include/net/bluetooth/hci_core.h10
-rw-r--r--include/net/bluetooth/sco.h1
-rw-r--r--include/net/busy_poll.h8
-rw-r--r--include/net/cfg80211.h239
-rw-r--r--include/net/checksum.h10
-rw-r--r--include/net/cls_cgroup.h6
-rw-r--r--include/net/dst.h12
-rw-r--r--include/net/fib_rules.h14
-rw-r--r--include/net/genetlink.h20
-rw-r--r--include/net/ieee80211_radiotap.h4
-rw-r--r--include/net/if_inet6.h9
-rw-r--r--include/net/ip.h12
-rw-r--r--include/net/ip6_route.h4
-rw-r--r--include/net/ip6_tunnel.h2
-rw-r--r--include/net/ip_tunnels.h25
-rw-r--r--include/net/ipv6.h3
-rw-r--r--include/net/irda/irlan_common.h3
-rw-r--r--include/net/llc_if.h30
-rw-r--r--include/net/mac80211.h193
-rw-r--r--include/net/mld.h51
-rw-r--r--include/net/ndisc.h5
-rw-r--r--include/net/neighbour.h98
-rw-r--r--include/net/net_namespace.h37
-rw-r--r--include/net/netfilter/nf_conntrack.h9
-rw-r--r--include/net/netfilter/nf_conntrack_extend.h6
-rw-r--r--include/net/netfilter/nf_conntrack_l4proto.h7
-rw-r--r--include/net/netfilter/nf_conntrack_seqadj.h51
-rw-r--r--include/net/netfilter/nf_conntrack_synproxy.h77
-rw-r--r--include/net/netfilter/nf_nat.h10
-rw-r--r--include/net/netfilter/nf_nat_helper.h19
-rw-r--r--include/net/netfilter/nf_tproxy_core.h210
-rw-r--r--include/net/netfilter/nfnetlink_queue.h8
-rw-r--r--include/net/netns/ipv4.h1
-rw-r--r--include/net/netns/ipv6.h1
-rw-r--r--include/net/netprio_cgroup.h10
-rw-r--r--include/net/nfc/nfc.h3
-rw-r--r--include/net/pkt_cls.h42
-rw-r--r--include/net/pkt_sched.h53
-rw-r--r--include/net/route.h8
-rw-r--r--include/net/sch_generic.h63
-rw-r--r--include/net/sctp/auth.h8
-rw-r--r--include/net/sctp/checksum.h23
-rw-r--r--include/net/sctp/command.h18
-rw-r--r--include/net/sctp/constants.h8
-rw-r--r--include/net/sctp/sctp.h10
-rw-r--r--include/net/sctp/sm.h8
-rw-r--r--include/net/sctp/structs.h29
-rw-r--r--include/net/sctp/tsnmap.h8
-rw-r--r--include/net/sctp/ulpevent.h8
-rw-r--r--include/net/sctp/ulpqueue.h8
-rw-r--r--include/net/sock.h29
-rw-r--r--include/net/tcp.h44
-rw-r--r--include/net/udp.h1
-rw-r--r--include/net/vsock_addr.h30
-rw-r--r--include/net/vxlan.h40
-rw-r--r--include/net/xfrm.h8
-rw-r--r--include/rdma/ib_verbs.h128
-rw-r--r--include/rdma/iw_cm.h8
-rw-r--r--include/scsi/iscsi_if.h32
-rw-r--r--include/scsi/libiscsi.h31
-rw-r--r--include/scsi/scsi.h3
-rw-r--r--include/scsi/scsi_device.h13
-rw-r--r--include/sound/core.h8
-rw-r--r--include/sound/pxa2xx-lib.h7
-rw-r--r--include/sound/rcar_snd.h84
-rw-r--r--include/sound/soc-dapm.h201
-rw-r--r--include/sound/soc-dpcm.h2
-rw-r--r--include/sound/soc.h47
-rw-r--r--include/trace/events/context_tracking.h58
-rw-r--r--include/trace/events/ext4.h29
-rw-r--r--include/trace/events/power.h37
-rw-r--r--include/trace/events/rcu.h82
-rw-r--r--include/trace/events/sched.h22
-rw-r--r--include/trace/ftrace.h33
-rw-r--r--include/uapi/drm/Kbuild1
-rw-r--r--include/uapi/drm/drm.h3
-rw-r--r--include/uapi/drm/drm_mode.h16
-rw-r--r--include/uapi/drm/i915_drm.h49
-rw-r--r--include/uapi/drm/msm_drm.h207
-rw-r--r--include/uapi/drm/radeon_drm.h2
-rw-r--r--include/uapi/linux/Kbuild1
-rw-r--r--include/uapi/linux/can/gw.h9
-rw-r--r--include/uapi/linux/cm4000_cs.h1
-rw-r--r--include/uapi/linux/dn.h3
-rw-r--r--include/uapi/linux/fib_rules.h4
-rw-r--r--include/uapi/linux/fiemap.h1
-rw-r--r--include/uapi/linux/icmpv6.h2
-rw-r--r--include/uapi/linux/if_bridge.h3
-rw-r--r--include/uapi/linux/if_link.h3
-rw-r--r--include/uapi/linux/if_packet.h1
-rw-r--r--include/uapi/linux/if_pppox.h2
-rw-r--r--include/uapi/linux/if_tun.h6
-rw-r--r--include/uapi/linux/in.h49
-rw-r--r--include/uapi/linux/in6.h36
-rw-r--r--include/uapi/linux/input.h25
-rw-r--r--include/uapi/linux/ip.h36
-rw-r--r--include/uapi/linux/ipv6.h3
-rw-r--r--include/uapi/linux/kvm.h1
-rw-r--r--include/uapi/linux/kvm_para.h1
-rw-r--r--include/uapi/linux/libc-compat.h103
-rw-r--r--include/uapi/linux/netfilter/Kbuild2
-rw-r--r--include/uapi/linux/netfilter/nf_conntrack_common.h3
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_conntrack.h15
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_queue.h1
-rw-r--r--include/uapi/linux/netfilter/xt_HMARK.h (renamed from include/linux/netfilter/xt_HMARK.h)0
-rw-r--r--include/uapi/linux/netfilter/xt_SYNPROXY.h16
-rw-r--r--include/uapi/linux/netfilter/xt_rpfilter.h (renamed from include/linux/netfilter/xt_rpfilter.h)0
-rw-r--r--include/uapi/linux/netfilter_bridge/ebt_802_3.h5
-rw-r--r--include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h3
-rw-r--r--include/uapi/linux/nfc.h20
-rw-r--r--include/uapi/linux/nl80211.h199
-rw-r--r--include/uapi/linux/openvswitch.h26
-rw-r--r--include/uapi/linux/pci_regs.h113
-rw-r--r--include/uapi/linux/perf_event.h123
-rw-r--r--include/uapi/linux/pkt_sched.h51
-rw-r--r--include/uapi/linux/sctp.h2
-rw-r--r--include/uapi/linux/serial_core.h3
-rw-r--r--include/uapi/linux/snmp.h6
-rw-r--r--include/uapi/linux/tcp.h1
-rw-r--r--include/uapi/linux/uhid.h4
-rw-r--r--include/uapi/linux/v4l2-controls.h29
-rw-r--r--include/uapi/linux/v4l2-dv-timings.h8
-rw-r--r--include/uapi/linux/v4l2-mediabus.h6
-rw-r--r--include/uapi/linux/videodev2.h12
-rw-r--r--include/uapi/linux/virtio_net.h6
-rw-r--r--include/uapi/linux/wimax/i2400m.h4
-rw-r--r--include/uapi/rdma/ib_user_verbs.h99
-rw-r--r--include/uapi/sound/hdspm.h2
-rw-r--r--include/video/da8xx-fb.h5
-rw-r--r--include/video/omap-panel-data.h118
-rw-r--r--include/video/omapdss.h106
-rw-r--r--include/xen/acpi.h8
-rw-r--r--include/xen/balloon.h3
-rw-r--r--include/xen/interface/io/tpmif.h52
-rw-r--r--include/xen/interface/platform.h7
-rw-r--r--include/xen/interface/vcpu.h2
360 files changed, 7453 insertions, 3461 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 56e6b68c8d2f..02e113bb8b7d 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -56,6 +56,16 @@ acpi_evaluate_hotplug_ost(acpi_handle handle, u32 source_event,
56 56
57acpi_status 57acpi_status
58acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld); 58acpi_get_physical_device_location(acpi_handle handle, struct acpi_pld_info **pld);
59
60bool acpi_has_method(acpi_handle handle, char *name);
61acpi_status acpi_execute_simple_method(acpi_handle handle, char *method,
62 u64 arg);
63acpi_status acpi_evaluate_ej0(acpi_handle handle);
64acpi_status acpi_evaluate_lck(acpi_handle handle, int lock);
65bool acpi_ata_match(acpi_handle handle);
66bool acpi_bay_match(acpi_handle handle);
67bool acpi_dock_match(acpi_handle handle);
68
59#ifdef CONFIG_ACPI 69#ifdef CONFIG_ACPI
60 70
61#include <linux/proc_fs.h> 71#include <linux/proc_fs.h>
@@ -157,9 +167,8 @@ struct acpi_device_flags {
157 u32 removable:1; 167 u32 removable:1;
158 u32 ejectable:1; 168 u32 ejectable:1;
159 u32 power_manageable:1; 169 u32 power_manageable:1;
160 u32 eject_pending:1;
161 u32 match_driver:1; 170 u32 match_driver:1;
162 u32 reserved:26; 171 u32 reserved:27;
163}; 172};
164 173
165/* File System */ 174/* File System */
@@ -274,15 +283,12 @@ struct acpi_device_wakeup {
274}; 283};
275 284
276struct acpi_device_physical_node { 285struct acpi_device_physical_node {
277 u8 node_id; 286 unsigned int node_id;
278 struct list_head node; 287 struct list_head node;
279 struct device *dev; 288 struct device *dev;
280 bool put_online:1; 289 bool put_online:1;
281}; 290};
282 291
283/* set maximum of physical nodes to 32 for expansibility */
284#define ACPI_MAX_PHYSICAL_NODE 32
285
286/* Device */ 292/* Device */
287struct acpi_device { 293struct acpi_device {
288 int device_type; 294 int device_type;
@@ -302,10 +308,9 @@ struct acpi_device {
302 struct acpi_driver *driver; 308 struct acpi_driver *driver;
303 void *driver_data; 309 void *driver_data;
304 struct device dev; 310 struct device dev;
305 u8 physical_node_count; 311 unsigned int physical_node_count;
306 struct list_head physical_node_list; 312 struct list_head physical_node_list;
307 struct mutex physical_node_lock; 313 struct mutex physical_node_lock;
308 DECLARE_BITMAP(physical_node_id_bitmap, ACPI_MAX_PHYSICAL_NODE);
309 struct list_head power_dependent; 314 struct list_head power_dependent;
310 void (*remove)(struct acpi_device *); 315 void (*remove)(struct acpi_device *);
311}; 316};
@@ -356,14 +361,11 @@ extern int acpi_notifier_call_chain(struct acpi_device *, u32, u32);
356extern int register_acpi_notifier(struct notifier_block *); 361extern int register_acpi_notifier(struct notifier_block *);
357extern int unregister_acpi_notifier(struct notifier_block *); 362extern int unregister_acpi_notifier(struct notifier_block *);
358 363
359extern int register_acpi_bus_notifier(struct notifier_block *nb);
360extern void unregister_acpi_bus_notifier(struct notifier_block *nb);
361/* 364/*
362 * External Functions 365 * External Functions
363 */ 366 */
364 367
365int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); 368int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
366void acpi_bus_data_handler(acpi_handle handle, void *context);
367acpi_status acpi_bus_get_status_handle(acpi_handle handle, 369acpi_status acpi_bus_get_status_handle(acpi_handle handle,
368 unsigned long long *sta); 370 unsigned long long *sta);
369int acpi_bus_get_status(struct acpi_device *device); 371int acpi_bus_get_status(struct acpi_device *device);
@@ -383,15 +385,6 @@ bool acpi_bus_can_wakeup(acpi_handle handle);
383static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; } 385static inline bool acpi_bus_can_wakeup(acpi_handle handle) { return false; }
384#endif 386#endif
385 387
386#ifdef CONFIG_ACPI_PROC_EVENT
387int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data);
388int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data);
389int acpi_bus_receive_event(struct acpi_bus_event *event);
390#else
391static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data)
392 { return 0; }
393#endif
394
395void acpi_scan_lock_acquire(void); 388void acpi_scan_lock_acquire(void);
396void acpi_scan_lock_release(void); 389void acpi_scan_lock_release(void);
397int acpi_scan_add_handler(struct acpi_scan_handler *handler); 390int acpi_scan_add_handler(struct acpi_scan_handler *handler);
@@ -445,7 +438,11 @@ struct acpi_pci_root {
445}; 438};
446 439
447/* helper */ 440/* helper */
448acpi_handle acpi_get_child(acpi_handle, u64); 441acpi_handle acpi_find_child(acpi_handle, u64, bool);
442static inline acpi_handle acpi_get_child(acpi_handle handle, u64 addr)
443{
444 return acpi_find_child(handle, addr, false);
445}
449int acpi_is_root_bridge(acpi_handle); 446int acpi_is_root_bridge(acpi_handle);
450struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); 447struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
451#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)ACPI_HANDLE(dev)) 448#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)ACPI_HANDLE(dev))
@@ -478,7 +475,8 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
478 if (p) 475 if (p)
479 *p = ACPI_STATE_D0; 476 *p = ACPI_STATE_D0;
480 477
481 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0; 478 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3_COLD) ?
479 m : ACPI_STATE_D0;
482} 480}
483static inline void acpi_dev_pm_add_dependent(acpi_handle handle, 481static inline void acpi_dev_pm_add_dependent(acpi_handle handle,
484 struct device *depdev) {} 482 struct device *depdev) {}
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index b420939f5eb5..1cedfcb1bd88 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -113,14 +113,13 @@ void pci_acpi_crs_quirks(void);
113 Dock Station 113 Dock Station
114 -------------------------------------------------------------------------- */ 114 -------------------------------------------------------------------------- */
115struct acpi_dock_ops { 115struct acpi_dock_ops {
116 acpi_notify_handler fixup;
116 acpi_notify_handler handler; 117 acpi_notify_handler handler;
117 acpi_notify_handler uevent; 118 acpi_notify_handler uevent;
118}; 119};
119 120
120#if defined(CONFIG_ACPI_DOCK) || defined(CONFIG_ACPI_DOCK_MODULE) 121#ifdef CONFIG_ACPI_DOCK
121extern int is_dock_device(acpi_handle handle); 122extern int is_dock_device(acpi_handle handle);
122extern int register_dock_notifier(struct notifier_block *nb);
123extern void unregister_dock_notifier(struct notifier_block *nb);
124extern int register_hotplug_dock_device(acpi_handle handle, 123extern int register_hotplug_dock_device(acpi_handle handle,
125 const struct acpi_dock_ops *ops, 124 const struct acpi_dock_ops *ops,
126 void *context, 125 void *context,
@@ -132,13 +131,6 @@ static inline int is_dock_device(acpi_handle handle)
132{ 131{
133 return 0; 132 return 0;
134} 133}
135static inline int register_dock_notifier(struct notifier_block *nb)
136{
137 return -ENODEV;
138}
139static inline void unregister_dock_notifier(struct notifier_block *nb)
140{
141}
142static inline int register_hotplug_dock_device(acpi_handle handle, 134static inline int register_hotplug_dock_device(acpi_handle handle,
143 const struct acpi_dock_ops *ops, 135 const struct acpi_dock_ops *ops,
144 void *context, 136 void *context,
@@ -150,6 +142,6 @@ static inline int register_hotplug_dock_device(acpi_handle handle,
150static inline void unregister_hotplug_dock_device(acpi_handle handle) 142static inline void unregister_hotplug_dock_device(acpi_handle handle)
151{ 143{
152} 144}
153#endif 145#endif /* CONFIG_ACPI_DOCK */
154 146
155#endif /*__ACPI_DRIVERS_H__*/ 147#endif /*__ACPI_DRIVERS_H__*/
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 22d497ee6ef9..85bfdbe17805 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,7 +46,7 @@
46 46
47/* Current ACPICA subsystem version in YYYYMMDD format */ 47/* Current ACPICA subsystem version in YYYYMMDD format */
48 48
49#define ACPI_CA_VERSION 0x20130517 49#define ACPI_CA_VERSION 0x20130725
50 50
51#include <acpi/acconfig.h> 51#include <acpi/acconfig.h>
52#include <acpi/actypes.h> 52#include <acpi/actypes.h>
@@ -147,6 +147,8 @@ acpi_status acpi_install_interface(acpi_string interface_name);
147 147
148acpi_status acpi_remove_interface(acpi_string interface_name); 148acpi_status acpi_remove_interface(acpi_string interface_name);
149 149
150acpi_status acpi_update_interfaces(u8 action);
151
150u32 152u32
151acpi_check_address_range(acpi_adr_space_type space_id, 153acpi_check_address_range(acpi_adr_space_type space_id,
152 acpi_physical_address address, 154 acpi_physical_address address,
@@ -210,8 +212,8 @@ acpi_status
210acpi_walk_namespace(acpi_object_type type, 212acpi_walk_namespace(acpi_object_type type,
211 acpi_handle start_object, 213 acpi_handle start_object,
212 u32 max_depth, 214 u32 max_depth,
213 acpi_walk_callback pre_order_visit, 215 acpi_walk_callback descending_callback,
214 acpi_walk_callback post_order_visit, 216 acpi_walk_callback ascending_callback,
215 void *context, void **return_value); 217 void *context, void **return_value);
216 218
217acpi_status 219acpi_status
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 22b03c9286e9..b748aefce929 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -668,13 +668,6 @@ typedef u32 acpi_event_status;
668#define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x04 668#define ACPI_EVENT_FLAG_SET (acpi_event_status) 0x04
669#define ACPI_EVENT_FLAG_HANDLE (acpi_event_status) 0x08 669#define ACPI_EVENT_FLAG_HANDLE (acpi_event_status) 0x08
670 670
671/*
672 * General Purpose Events (GPE)
673 */
674#define ACPI_GPE_INVALID 0xFF
675#define ACPI_GPE_MAX 0xFF
676#define ACPI_NUM_GPE 256
677
678/* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */ 671/* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */
679 672
680#define ACPI_GPE_ENABLE 0 673#define ACPI_GPE_ENABLE 0
@@ -1144,7 +1137,19 @@ struct acpi_memory_list {
1144#endif 1137#endif
1145}; 1138};
1146 1139
1147/* Definitions for _OSI support */ 1140/* Definitions of _OSI support */
1141
1142#define ACPI_VENDOR_STRINGS 0x01
1143#define ACPI_FEATURE_STRINGS 0x02
1144#define ACPI_ENABLE_INTERFACES 0x00
1145#define ACPI_DISABLE_INTERFACES 0x04
1146
1147#define ACPI_DISABLE_ALL_VENDOR_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS)
1148#define ACPI_DISABLE_ALL_FEATURE_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_FEATURE_STRINGS)
1149#define ACPI_DISABLE_ALL_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
1150#define ACPI_ENABLE_ALL_VENDOR_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS)
1151#define ACPI_ENABLE_ALL_FEATURE_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_FEATURE_STRINGS)
1152#define ACPI_ENABLE_ALL_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
1148 1153
1149#define ACPI_OSI_WIN_2000 0x01 1154#define ACPI_OSI_WIN_2000 0x01
1150#define ACPI_OSI_WIN_XP 0x02 1155#define ACPI_OSI_WIN_XP 0x02
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 2f47ade1b567..f330d28e4d0e 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -208,10 +208,6 @@ static inline int pmd_same(pmd_t pmd_a, pmd_t pmd_b)
208#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ 208#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
209#endif 209#endif
210 210
211#ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG
212#define page_test_and_clear_young(pfn) (0)
213#endif
214
215#ifndef __HAVE_ARCH_PGD_OFFSET_GATE 211#ifndef __HAVE_ARCH_PGD_OFFSET_GATE
216#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr) 212#define pgd_offset_gate(mm, addr) pgd_offset(mm, addr)
217#endif 213#endif
@@ -417,6 +413,36 @@ static inline pmd_t pmd_mksoft_dirty(pmd_t pmd)
417{ 413{
418 return pmd; 414 return pmd;
419} 415}
416
417static inline pte_t pte_swp_mksoft_dirty(pte_t pte)
418{
419 return pte;
420}
421
422static inline int pte_swp_soft_dirty(pte_t pte)
423{
424 return 0;
425}
426
427static inline pte_t pte_swp_clear_soft_dirty(pte_t pte)
428{
429 return pte;
430}
431
432static inline pte_t pte_file_clear_soft_dirty(pte_t pte)
433{
434 return pte;
435}
436
437static inline pte_t pte_file_mksoft_dirty(pte_t pte)
438{
439 return pte;
440}
441
442static inline int pte_file_soft_dirty(pte_t pte)
443{
444 return 0;
445}
420#endif 446#endif
421 447
422#ifndef __HAVE_PFNMAP_TRACKING 448#ifndef __HAVE_PFNMAP_TRACKING
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h
index 13821c339a41..5672d7ea1fa0 100644
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -112,7 +112,7 @@ struct mmu_gather {
112 112
113#define HAVE_GENERIC_MMU_GATHER 113#define HAVE_GENERIC_MMU_GATHER
114 114
115void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, bool fullmm); 115void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm, unsigned long start, unsigned long end);
116void tlb_flush_mmu(struct mmu_gather *tlb); 116void tlb_flush_mmu(struct mmu_gather *tlb);
117void tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, 117void tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start,
118 unsigned long end); 118 unsigned long end);
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 69732d279e8b..83e2c31e8b00 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -122,8 +122,12 @@
122#define TRACE_PRINTKS() VMLINUX_SYMBOL(__start___trace_bprintk_fmt) = .; \ 122#define TRACE_PRINTKS() VMLINUX_SYMBOL(__start___trace_bprintk_fmt) = .; \
123 *(__trace_printk_fmt) /* Trace_printk fmt' pointer */ \ 123 *(__trace_printk_fmt) /* Trace_printk fmt' pointer */ \
124 VMLINUX_SYMBOL(__stop___trace_bprintk_fmt) = .; 124 VMLINUX_SYMBOL(__stop___trace_bprintk_fmt) = .;
125#define TRACEPOINT_STR() VMLINUX_SYMBOL(__start___tracepoint_str) = .; \
126 *(__tracepoint_str) /* Trace_printk fmt' pointer */ \
127 VMLINUX_SYMBOL(__stop___tracepoint_str) = .;
125#else 128#else
126#define TRACE_PRINTKS() 129#define TRACE_PRINTKS()
130#define TRACEPOINT_STR()
127#endif 131#endif
128 132
129#ifdef CONFIG_FTRACE_SYSCALLS 133#ifdef CONFIG_FTRACE_SYSCALLS
@@ -190,7 +194,8 @@
190 VMLINUX_SYMBOL(__stop___verbose) = .; \ 194 VMLINUX_SYMBOL(__stop___verbose) = .; \
191 LIKELY_PROFILE() \ 195 LIKELY_PROFILE() \
192 BRANCH_PROFILE() \ 196 BRANCH_PROFILE() \
193 TRACE_PRINTKS() 197 TRACE_PRINTKS() \
198 TRACEPOINT_STR()
194 199
195/* 200/*
196 * Data section helpers 201 * Data section helpers
diff --git a/include/asm-generic/vtime.h b/include/asm-generic/vtime.h
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/include/asm-generic/vtime.h
diff --git a/include/clocksource/arm_arch_timer.h b/include/clocksource/arm_arch_timer.h
index c463ce990c48..93b7f96f9c59 100644
--- a/include/clocksource/arm_arch_timer.h
+++ b/include/clocksource/arm_arch_timer.h
@@ -23,16 +23,20 @@
23#define ARCH_TIMER_CTRL_IT_MASK (1 << 1) 23#define ARCH_TIMER_CTRL_IT_MASK (1 << 1)
24#define ARCH_TIMER_CTRL_IT_STAT (1 << 2) 24#define ARCH_TIMER_CTRL_IT_STAT (1 << 2)
25 25
26#define ARCH_TIMER_REG_CTRL 0 26enum arch_timer_reg {
27#define ARCH_TIMER_REG_TVAL 1 27 ARCH_TIMER_REG_CTRL,
28 ARCH_TIMER_REG_TVAL,
29};
28 30
29#define ARCH_TIMER_PHYS_ACCESS 0 31#define ARCH_TIMER_PHYS_ACCESS 0
30#define ARCH_TIMER_VIRT_ACCESS 1 32#define ARCH_TIMER_VIRT_ACCESS 1
33#define ARCH_TIMER_MEM_PHYS_ACCESS 2
34#define ARCH_TIMER_MEM_VIRT_ACCESS 3
31 35
32#ifdef CONFIG_ARM_ARCH_TIMER 36#ifdef CONFIG_ARM_ARCH_TIMER
33 37
34extern u32 arch_timer_get_rate(void); 38extern u32 arch_timer_get_rate(void);
35extern u64 arch_timer_read_counter(void); 39extern u64 (*arch_timer_read_counter)(void);
36extern struct timecounter *arch_timer_get_timecounter(void); 40extern struct timecounter *arch_timer_get_timecounter(void);
37 41
38#else 42#else
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 12083dc862a9..290734191f72 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -45,7 +45,6 @@
45#include <linux/kernel.h> 45#include <linux/kernel.h>
46#include <linux/miscdevice.h> 46#include <linux/miscdevice.h>
47#include <linux/fs.h> 47#include <linux/fs.h>
48#include <linux/proc_fs.h>
49#include <linux/init.h> 48#include <linux/init.h>
50#include <linux/file.h> 49#include <linux/file.h>
51#include <linux/platform_device.h> 50#include <linux/platform_device.h>
@@ -62,20 +61,18 @@
62#endif 61#endif
63#include <asm/mman.h> 62#include <asm/mman.h>
64#include <asm/uaccess.h> 63#include <asm/uaccess.h>
65#if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
66#include <linux/types.h> 64#include <linux/types.h>
67#include <linux/agp_backend.h> 65#include <linux/agp_backend.h>
68#endif
69#include <linux/workqueue.h> 66#include <linux/workqueue.h>
70#include <linux/poll.h> 67#include <linux/poll.h>
71#include <asm/pgalloc.h> 68#include <asm/pgalloc.h>
72#include <drm/drm.h> 69#include <drm/drm.h>
73#include <drm/drm_sarea.h> 70#include <drm/drm_sarea.h>
71#include <drm/drm_vma_manager.h>
74 72
75#include <linux/idr.h> 73#include <linux/idr.h>
76 74
77#define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) 75#define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE)))
78#define __OS_HAS_MTRR (defined(CONFIG_MTRR))
79 76
80struct module; 77struct module;
81 78
@@ -140,19 +137,15 @@ int drm_err(const char *func, const char *format, ...);
140/* driver capabilities and requirements mask */ 137/* driver capabilities and requirements mask */
141#define DRIVER_USE_AGP 0x1 138#define DRIVER_USE_AGP 0x1
142#define DRIVER_REQUIRE_AGP 0x2 139#define DRIVER_REQUIRE_AGP 0x2
143#define DRIVER_USE_MTRR 0x4
144#define DRIVER_PCI_DMA 0x8 140#define DRIVER_PCI_DMA 0x8
145#define DRIVER_SG 0x10 141#define DRIVER_SG 0x10
146#define DRIVER_HAVE_DMA 0x20 142#define DRIVER_HAVE_DMA 0x20
147#define DRIVER_HAVE_IRQ 0x40 143#define DRIVER_HAVE_IRQ 0x40
148#define DRIVER_IRQ_SHARED 0x80 144#define DRIVER_IRQ_SHARED 0x80
149#define DRIVER_IRQ_VBL 0x100
150#define DRIVER_DMA_QUEUE 0x200
151#define DRIVER_FB_DMA 0x400
152#define DRIVER_IRQ_VBL2 0x800
153#define DRIVER_GEM 0x1000 145#define DRIVER_GEM 0x1000
154#define DRIVER_MODESET 0x2000 146#define DRIVER_MODESET 0x2000
155#define DRIVER_PRIME 0x4000 147#define DRIVER_PRIME 0x4000
148#define DRIVER_RENDER 0x8000
156 149
157#define DRIVER_BUS_PCI 0x1 150#define DRIVER_BUS_PCI 0x1
158#define DRIVER_BUS_PLATFORM 0x2 151#define DRIVER_BUS_PLATFORM 0x2
@@ -168,13 +161,7 @@ int drm_err(const char *func, const char *format, ...);
168#define DRM_MAGIC_HASH_ORDER 4 /**< Size of key hash table. Must be power of 2. */ 161#define DRM_MAGIC_HASH_ORDER 4 /**< Size of key hash table. Must be power of 2. */
169#define DRM_KERNEL_CONTEXT 0 /**< Change drm_resctx if changed */ 162#define DRM_KERNEL_CONTEXT 0 /**< Change drm_resctx if changed */
170#define DRM_RESERVED_CONTEXTS 1 /**< Change drm_resctx if changed */ 163#define DRM_RESERVED_CONTEXTS 1 /**< Change drm_resctx if changed */
171#define DRM_LOOPING_LIMIT 5000000
172#define DRM_TIME_SLICE (HZ/20) /**< Time slice for GLXContexts */
173#define DRM_LOCK_SLICE 1 /**< Time slice for lock, in jiffies */
174
175#define DRM_FLAG_DEBUG 0x01
176 164
177#define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8)
178#define DRM_MAP_HASH_OFFSET 0x10000000 165#define DRM_MAP_HASH_OFFSET 0x10000000
179 166
180/*@}*/ 167/*@}*/
@@ -263,9 +250,6 @@ int drm_err(const char *func, const char *format, ...);
263 250
264#define DRM_ARRAY_SIZE(x) ARRAY_SIZE(x) 251#define DRM_ARRAY_SIZE(x) ARRAY_SIZE(x)
265 252
266#define DRM_LEFTCOUNT(x) (((x)->rp + (x)->count - (x)->wp) % ((x)->count + 1))
267#define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x))
268
269#define DRM_IF_VERSION(maj, min) (maj << 16 | min) 253#define DRM_IF_VERSION(maj, min) (maj << 16 | min)
270 254
271/** 255/**
@@ -307,6 +291,7 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd,
307#define DRM_ROOT_ONLY 0x4 291#define DRM_ROOT_ONLY 0x4
308#define DRM_CONTROL_ALLOW 0x8 292#define DRM_CONTROL_ALLOW 0x8
309#define DRM_UNLOCKED 0x10 293#define DRM_UNLOCKED 0x10
294#define DRM_RENDER_ALLOW 0x20
310 295
311struct drm_ioctl_desc { 296struct drm_ioctl_desc {
312 unsigned int cmd; 297 unsigned int cmd;
@@ -587,7 +572,6 @@ struct drm_map_list {
587 struct drm_local_map *map; /**< mapping */ 572 struct drm_local_map *map; /**< mapping */
588 uint64_t user_token; 573 uint64_t user_token;
589 struct drm_master *master; 574 struct drm_master *master;
590 struct drm_mm_node *file_offset_node; /**< fake offset */
591}; 575};
592 576
593/** 577/**
@@ -622,8 +606,7 @@ struct drm_ati_pcigart_info {
622 * GEM specific mm private for tracking GEM objects 606 * GEM specific mm private for tracking GEM objects
623 */ 607 */
624struct drm_gem_mm { 608struct drm_gem_mm {
625 struct drm_mm offset_manager; /**< Offset mgmt for buffer objects */ 609 struct drm_vma_offset_manager vma_manager;
626 struct drm_open_hash offset_hash; /**< User token hash table for maps */
627}; 610};
628 611
629/** 612/**
@@ -634,8 +617,16 @@ struct drm_gem_object {
634 /** Reference count of this object */ 617 /** Reference count of this object */
635 struct kref refcount; 618 struct kref refcount;
636 619
637 /** Handle count of this object. Each handle also holds a reference */ 620 /**
638 atomic_t handle_count; /* number of handles on this object */ 621 * handle_count - gem file_priv handle count of this object
622 *
623 * Each handle also holds a reference. Note that when the handle_count
624 * drops to 0 any global names (e.g. the id in the flink namespace) will
625 * be cleared.
626 *
627 * Protected by dev->object_name_lock.
628 * */
629 unsigned handle_count;
639 630
640 /** Related drm device */ 631 /** Related drm device */
641 struct drm_device *dev; 632 struct drm_device *dev;
@@ -644,7 +635,7 @@ struct drm_gem_object {
644 struct file *filp; 635 struct file *filp;
645 636
646 /* Mapping info for this object */ 637 /* Mapping info for this object */
647 struct drm_map_list map_list; 638 struct drm_vma_offset_node vma_node;
648 639
649 /** 640 /**
650 * Size of the object, in bytes. Immutable over the object's 641 * Size of the object, in bytes. Immutable over the object's
@@ -678,10 +669,32 @@ struct drm_gem_object {
678 669
679 void *driver_private; 670 void *driver_private;
680 671
681 /* dma buf exported from this GEM object */ 672 /**
682 struct dma_buf *export_dma_buf; 673 * dma_buf - dma buf associated with this GEM object
674 *
675 * Pointer to the dma-buf associated with this gem object (either
676 * through importing or exporting). We break the resulting reference
677 * loop when the last gem handle for this object is released.
678 *
679 * Protected by obj->object_name_lock
680 */
681 struct dma_buf *dma_buf;
683 682
684 /* dma buf attachment backing this object */ 683 /**
684 * import_attach - dma buf attachment backing this object
685 *
686 * Any foreign dma_buf imported as a gem object has this set to the
687 * attachment point for the device. This is invariant over the lifetime
688 * of a gem object.
689 *
690 * The driver's ->gem_free_object callback is responsible for cleaning
691 * up the dma_buf attachment and references acquired at import time.
692 *
693 * Note that the drm gem/prime core does not depend upon drivers setting
694 * this field any more. So for drivers where this doesn't make sense
695 * (e.g. virtual devices or a displaylink behind an usb bus) they can
696 * simply leave it as NULL.
697 */
685 struct dma_buf_attachment *import_attach; 698 struct dma_buf_attachment *import_attach;
686}; 699};
687 700
@@ -737,6 +750,7 @@ struct drm_bus {
737 int (*irq_by_busid)(struct drm_device *dev, struct drm_irq_busid *p); 750 int (*irq_by_busid)(struct drm_device *dev, struct drm_irq_busid *p);
738 /* hooks that are for PCI */ 751 /* hooks that are for PCI */
739 int (*agp_init)(struct drm_device *dev); 752 int (*agp_init)(struct drm_device *dev);
753 void (*agp_destroy)(struct drm_device *dev);
740 754
741}; 755};
742 756
@@ -885,8 +899,6 @@ struct drm_driver {
885 void (*irq_preinstall) (struct drm_device *dev); 899 void (*irq_preinstall) (struct drm_device *dev);
886 int (*irq_postinstall) (struct drm_device *dev); 900 int (*irq_postinstall) (struct drm_device *dev);
887 void (*irq_uninstall) (struct drm_device *dev); 901 void (*irq_uninstall) (struct drm_device *dev);
888 void (*set_version) (struct drm_device *dev,
889 struct drm_set_version *sv);
890 902
891 /* Master routines */ 903 /* Master routines */
892 int (*master_create)(struct drm_device *dev, struct drm_master *master); 904 int (*master_create)(struct drm_device *dev, struct drm_master *master);
@@ -966,7 +978,7 @@ struct drm_driver {
966 978
967 u32 driver_features; 979 u32 driver_features;
968 int dev_priv_size; 980 int dev_priv_size;
969 struct drm_ioctl_desc *ioctls; 981 const struct drm_ioctl_desc *ioctls;
970 int num_ioctls; 982 int num_ioctls;
971 const struct file_operations *fops; 983 const struct file_operations *fops;
972 union { 984 union {
@@ -1037,8 +1049,6 @@ struct drm_minor {
1037 struct device kdev; /**< Linux device */ 1049 struct device kdev; /**< Linux device */
1038 struct drm_device *dev; 1050 struct drm_device *dev;
1039 1051
1040 struct proc_dir_entry *proc_root; /**< proc directory entry */
1041 struct drm_info_node proc_nodes;
1042 struct dentry *debugfs_root; 1052 struct dentry *debugfs_root;
1043 1053
1044 struct list_head debugfs_list; 1054 struct list_head debugfs_list;
@@ -1131,12 +1141,7 @@ struct drm_device {
1131 /*@{ */ 1141 /*@{ */
1132 int irq_enabled; /**< True if irq handler is enabled */ 1142 int irq_enabled; /**< True if irq handler is enabled */
1133 __volatile__ long context_flag; /**< Context swapping flag */ 1143 __volatile__ long context_flag; /**< Context swapping flag */
1134 __volatile__ long interrupt_flag; /**< Interruption handler flag */
1135 __volatile__ long dma_flag; /**< DMA dispatch flag */
1136 wait_queue_head_t context_wait; /**< Processes waiting on ctx switch */
1137 int last_checked; /**< Last context checked for DMA */
1138 int last_context; /**< Last current context */ 1144 int last_context; /**< Last current context */
1139 unsigned long last_switch; /**< jiffies at last context switch */
1140 /*@} */ 1145 /*@} */
1141 1146
1142 struct work_struct work; 1147 struct work_struct work;
@@ -1174,12 +1179,6 @@ struct drm_device {
1174 spinlock_t event_lock; 1179 spinlock_t event_lock;
1175 1180
1176 /*@} */ 1181 /*@} */
1177 cycles_t ctx_start;
1178 cycles_t lck_start;
1179
1180 struct fasync_struct *buf_async;/**< Processes waiting for SIGIO */
1181 wait_queue_head_t buf_readers; /**< Processes waiting to read */
1182 wait_queue_head_t buf_writers; /**< Processes waiting to ctx switch */
1183 1182
1184 struct drm_agp_head *agp; /**< AGP data */ 1183 struct drm_agp_head *agp; /**< AGP data */
1185 1184
@@ -1207,12 +1206,13 @@ struct drm_device {
1207 unsigned int agp_buffer_token; 1206 unsigned int agp_buffer_token;
1208 struct drm_minor *control; /**< Control node for card */ 1207 struct drm_minor *control; /**< Control node for card */
1209 struct drm_minor *primary; /**< render type primary screen head */ 1208 struct drm_minor *primary; /**< render type primary screen head */
1209 struct drm_minor *render; /**< render node for card */
1210 1210
1211 struct drm_mode_config mode_config; /**< Current mode config */ 1211 struct drm_mode_config mode_config; /**< Current mode config */
1212 1212
1213 /** \name GEM information */ 1213 /** \name GEM information */
1214 /*@{ */ 1214 /*@{ */
1215 spinlock_t object_name_lock; 1215 struct mutex object_name_lock;
1216 struct idr object_name_idr; 1216 struct idr object_name_idr;
1217 /*@} */ 1217 /*@} */
1218 int switch_power_state; 1218 int switch_power_state;
@@ -1223,6 +1223,7 @@ struct drm_device {
1223#define DRM_SWITCH_POWER_ON 0 1223#define DRM_SWITCH_POWER_ON 0
1224#define DRM_SWITCH_POWER_OFF 1 1224#define DRM_SWITCH_POWER_OFF 1
1225#define DRM_SWITCH_POWER_CHANGING 2 1225#define DRM_SWITCH_POWER_CHANGING 2
1226#define DRM_SWITCH_POWER_DYNAMIC_OFF 3
1226 1227
1227static __inline__ int drm_core_check_feature(struct drm_device *dev, 1228static __inline__ int drm_core_check_feature(struct drm_device *dev,
1228 int feature) 1229 int feature)
@@ -1235,25 +1236,6 @@ static inline int drm_dev_to_irq(struct drm_device *dev)
1235 return dev->driver->bus->get_irq(dev); 1236 return dev->driver->bus->get_irq(dev);
1236} 1237}
1237 1238
1238
1239#if __OS_HAS_AGP
1240static inline int drm_core_has_AGP(struct drm_device *dev)
1241{
1242 return drm_core_check_feature(dev, DRIVER_USE_AGP);
1243}
1244#else
1245#define drm_core_has_AGP(dev) (0)
1246#endif
1247
1248#if __OS_HAS_MTRR
1249static inline int drm_core_has_MTRR(struct drm_device *dev)
1250{
1251 return drm_core_check_feature(dev, DRIVER_USE_MTRR);
1252}
1253#else
1254#define drm_core_has_MTRR(dev) (0)
1255#endif
1256
1257static inline void drm_device_set_unplugged(struct drm_device *dev) 1239static inline void drm_device_set_unplugged(struct drm_device *dev)
1258{ 1240{
1259 smp_wmb(); 1241 smp_wmb();
@@ -1272,6 +1254,11 @@ static inline bool drm_modeset_is_locked(struct drm_device *dev)
1272 return mutex_is_locked(&dev->mode_config.mutex); 1254 return mutex_is_locked(&dev->mode_config.mutex);
1273} 1255}
1274 1256
1257static inline bool drm_is_render_client(struct drm_file *file_priv)
1258{
1259 return file_priv->minor->type == DRM_MINOR_RENDER;
1260}
1261
1275/******************************************************************/ 1262/******************************************************************/
1276/** \name Internal function definitions */ 1263/** \name Internal function definitions */
1277/*@{*/ 1264/*@{*/
@@ -1287,7 +1274,6 @@ extern int drm_lastclose(struct drm_device *dev);
1287extern struct mutex drm_global_mutex; 1274extern struct mutex drm_global_mutex;
1288extern int drm_open(struct inode *inode, struct file *filp); 1275extern int drm_open(struct inode *inode, struct file *filp);
1289extern int drm_stub_open(struct inode *inode, struct file *filp); 1276extern int drm_stub_open(struct inode *inode, struct file *filp);
1290extern int drm_fasync(int fd, struct file *filp, int on);
1291extern ssize_t drm_read(struct file *filp, char __user *buffer, 1277extern ssize_t drm_read(struct file *filp, char __user *buffer,
1292 size_t count, loff_t *offset); 1278 size_t count, loff_t *offset);
1293extern int drm_release(struct inode *inode, struct file *filp); 1279extern int drm_release(struct inode *inode, struct file *filp);
@@ -1301,14 +1287,6 @@ extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
1301 1287
1302 /* Memory management support (drm_memory.h) */ 1288 /* Memory management support (drm_memory.h) */
1303#include <drm/drm_memory.h> 1289#include <drm/drm_memory.h>
1304extern void drm_free_agp(DRM_AGP_MEM * handle, int pages);
1305extern int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start);
1306extern DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
1307 struct page **pages,
1308 unsigned long num_pages,
1309 uint32_t gtt_offset,
1310 uint32_t type);
1311extern int drm_unbind_agp(DRM_AGP_MEM * handle);
1312 1290
1313 /* Misc. IOCTL support (drm_ioctl.h) */ 1291 /* Misc. IOCTL support (drm_ioctl.h) */
1314extern int drm_irq_by_busid(struct drm_device *dev, void *data, 1292extern int drm_irq_by_busid(struct drm_device *dev, void *data,
@@ -1335,8 +1313,6 @@ extern int drm_resctx(struct drm_device *dev, void *data,
1335 struct drm_file *file_priv); 1313 struct drm_file *file_priv);
1336extern int drm_addctx(struct drm_device *dev, void *data, 1314extern int drm_addctx(struct drm_device *dev, void *data,
1337 struct drm_file *file_priv); 1315 struct drm_file *file_priv);
1338extern int drm_modctx(struct drm_device *dev, void *data,
1339 struct drm_file *file_priv);
1340extern int drm_getctx(struct drm_device *dev, void *data, 1316extern int drm_getctx(struct drm_device *dev, void *data,
1341 struct drm_file *file_priv); 1317 struct drm_file *file_priv);
1342extern int drm_switchctx(struct drm_device *dev, void *data, 1318extern int drm_switchctx(struct drm_device *dev, void *data,
@@ -1346,9 +1322,10 @@ extern int drm_newctx(struct drm_device *dev, void *data,
1346extern int drm_rmctx(struct drm_device *dev, void *data, 1322extern int drm_rmctx(struct drm_device *dev, void *data,
1347 struct drm_file *file_priv); 1323 struct drm_file *file_priv);
1348 1324
1349extern int drm_ctxbitmap_init(struct drm_device *dev); 1325extern void drm_legacy_ctxbitmap_init(struct drm_device *dev);
1350extern void drm_ctxbitmap_cleanup(struct drm_device *dev); 1326extern void drm_legacy_ctxbitmap_cleanup(struct drm_device *dev);
1351extern void drm_ctxbitmap_free(struct drm_device *dev, int ctx_handle); 1327extern void drm_legacy_ctxbitmap_release(struct drm_device *dev,
1328 struct drm_file *file_priv);
1352 1329
1353extern int drm_setsareactx(struct drm_device *dev, void *data, 1330extern int drm_setsareactx(struct drm_device *dev, void *data,
1354 struct drm_file *file_priv); 1331 struct drm_file *file_priv);
@@ -1405,11 +1382,12 @@ extern int drm_freebufs(struct drm_device *dev, void *data,
1405 struct drm_file *file_priv); 1382 struct drm_file *file_priv);
1406extern int drm_mapbufs(struct drm_device *dev, void *data, 1383extern int drm_mapbufs(struct drm_device *dev, void *data,
1407 struct drm_file *file_priv); 1384 struct drm_file *file_priv);
1408extern int drm_order(unsigned long size); 1385extern int drm_dma_ioctl(struct drm_device *dev, void *data,
1386 struct drm_file *file_priv);
1409 1387
1410 /* DMA support (drm_dma.h) */ 1388 /* DMA support (drm_dma.h) */
1411extern int drm_dma_setup(struct drm_device *dev); 1389extern int drm_legacy_dma_setup(struct drm_device *dev);
1412extern void drm_dma_takedown(struct drm_device *dev); 1390extern void drm_legacy_dma_takedown(struct drm_device *dev);
1413extern void drm_free_buffer(struct drm_device *dev, struct drm_buf * buf); 1391extern void drm_free_buffer(struct drm_device *dev, struct drm_buf * buf);
1414extern void drm_core_reclaim_buffers(struct drm_device *dev, 1392extern void drm_core_reclaim_buffers(struct drm_device *dev,
1415 struct drm_file *filp); 1393 struct drm_file *filp);
@@ -1423,7 +1401,6 @@ extern int drm_irq_uninstall(struct drm_device *dev);
1423extern int drm_vblank_init(struct drm_device *dev, int num_crtcs); 1401extern int drm_vblank_init(struct drm_device *dev, int num_crtcs);
1424extern int drm_wait_vblank(struct drm_device *dev, void *data, 1402extern int drm_wait_vblank(struct drm_device *dev, void *data,
1425 struct drm_file *filp); 1403 struct drm_file *filp);
1426extern int drm_vblank_wait(struct drm_device *dev, unsigned int *vbl_seq);
1427extern u32 drm_vblank_count(struct drm_device *dev, int crtc); 1404extern u32 drm_vblank_count(struct drm_device *dev, int crtc);
1428extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc, 1405extern u32 drm_vblank_count_and_time(struct drm_device *dev, int crtc,
1429 struct timeval *vblanktime); 1406 struct timeval *vblanktime);
@@ -1465,31 +1442,8 @@ extern int drm_modeset_ctl(struct drm_device *dev, void *data,
1465 struct drm_file *file_priv); 1442 struct drm_file *file_priv);
1466 1443
1467 /* AGP/GART support (drm_agpsupport.h) */ 1444 /* AGP/GART support (drm_agpsupport.h) */
1468extern struct drm_agp_head *drm_agp_init(struct drm_device *dev); 1445
1469extern int drm_agp_acquire(struct drm_device *dev); 1446#include <drm/drm_agpsupport.h>
1470extern int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
1471 struct drm_file *file_priv);
1472extern int drm_agp_release(struct drm_device *dev);
1473extern int drm_agp_release_ioctl(struct drm_device *dev, void *data,
1474 struct drm_file *file_priv);
1475extern int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode);
1476extern int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
1477 struct drm_file *file_priv);
1478extern int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info);
1479extern int drm_agp_info_ioctl(struct drm_device *dev, void *data,
1480 struct drm_file *file_priv);
1481extern int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request);
1482extern int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
1483 struct drm_file *file_priv);
1484extern int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request);
1485extern int drm_agp_free_ioctl(struct drm_device *dev, void *data,
1486 struct drm_file *file_priv);
1487extern int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request);
1488extern int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
1489 struct drm_file *file_priv);
1490extern int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
1491extern int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
1492 struct drm_file *file_priv);
1493 1447
1494 /* Stub support (drm_stub.h) */ 1448 /* Stub support (drm_stub.h) */
1495extern int drm_setmaster_ioctl(struct drm_device *dev, void *data, 1449extern int drm_setmaster_ioctl(struct drm_device *dev, void *data,
@@ -1504,23 +1458,19 @@ extern void drm_put_dev(struct drm_device *dev);
1504extern int drm_put_minor(struct drm_minor **minor); 1458extern int drm_put_minor(struct drm_minor **minor);
1505extern void drm_unplug_dev(struct drm_device *dev); 1459extern void drm_unplug_dev(struct drm_device *dev);
1506extern unsigned int drm_debug; 1460extern unsigned int drm_debug;
1461extern unsigned int drm_rnodes;
1507 1462
1508extern unsigned int drm_vblank_offdelay; 1463extern unsigned int drm_vblank_offdelay;
1509extern unsigned int drm_timestamp_precision; 1464extern unsigned int drm_timestamp_precision;
1510extern unsigned int drm_timestamp_monotonic; 1465extern unsigned int drm_timestamp_monotonic;
1511 1466
1512extern struct class *drm_class; 1467extern struct class *drm_class;
1513extern struct proc_dir_entry *drm_proc_root;
1514extern struct dentry *drm_debugfs_root; 1468extern struct dentry *drm_debugfs_root;
1515 1469
1516extern struct idr drm_minors_idr; 1470extern struct idr drm_minors_idr;
1517 1471
1518extern struct drm_local_map *drm_getsarea(struct drm_device *dev); 1472extern struct drm_local_map *drm_getsarea(struct drm_device *dev);
1519 1473
1520 /* Proc support (drm_proc.h) */
1521extern int drm_proc_init(struct drm_minor *minor, struct proc_dir_entry *root);
1522extern int drm_proc_cleanup(struct drm_minor *minor, struct proc_dir_entry *root);
1523
1524 /* Debugfs support */ 1474 /* Debugfs support */
1525#if defined(CONFIG_DEBUG_FS) 1475#if defined(CONFIG_DEBUG_FS)
1526extern int drm_debugfs_init(struct drm_minor *minor, int minor_id, 1476extern int drm_debugfs_init(struct drm_minor *minor, int minor_id,
@@ -1550,6 +1500,7 @@ extern struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev,
1550 struct dma_buf *dma_buf); 1500 struct dma_buf *dma_buf);
1551extern int drm_gem_prime_fd_to_handle(struct drm_device *dev, 1501extern int drm_gem_prime_fd_to_handle(struct drm_device *dev,
1552 struct drm_file *file_priv, int prime_fd, uint32_t *handle); 1502 struct drm_file *file_priv, int prime_fd, uint32_t *handle);
1503extern void drm_gem_dmabuf_release(struct dma_buf *dma_buf);
1553 1504
1554extern int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data, 1505extern int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data,
1555 struct drm_file *file_priv); 1506 struct drm_file *file_priv);
@@ -1561,25 +1512,22 @@ extern int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **
1561extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages); 1512extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, int nr_pages);
1562extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg); 1513extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg);
1563 1514
1515int drm_gem_dumb_destroy(struct drm_file *file,
1516 struct drm_device *dev,
1517 uint32_t handle);
1564 1518
1565void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv); 1519void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv);
1566void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv); 1520void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv);
1567int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf, uint32_t *handle); 1521void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf);
1568void drm_prime_remove_buf_handle(struct drm_prime_file_private *prime_fpriv, struct dma_buf *dma_buf);
1569
1570int drm_prime_add_dma_buf(struct drm_device *dev, struct drm_gem_object *obj);
1571int drm_prime_lookup_obj(struct drm_device *dev, struct dma_buf *buf,
1572 struct drm_gem_object **obj);
1573 1522
1574#if DRM_DEBUG_CODE 1523#if DRM_DEBUG_CODE
1575extern int drm_vma_info(struct seq_file *m, void *data); 1524extern int drm_vma_info(struct seq_file *m, void *data);
1576#endif 1525#endif
1577 1526
1578 /* Scatter Gather Support (drm_scatter.h) */ 1527 /* Scatter Gather Support (drm_scatter.h) */
1579extern void drm_sg_cleanup(struct drm_sg_mem * entry); 1528extern void drm_legacy_sg_cleanup(struct drm_device *dev);
1580extern int drm_sg_alloc_ioctl(struct drm_device *dev, void *data, 1529extern int drm_sg_alloc(struct drm_device *dev, void *data,
1581 struct drm_file *file_priv); 1530 struct drm_file *file_priv);
1582extern int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request);
1583extern int drm_sg_free(struct drm_device *dev, void *data, 1531extern int drm_sg_free(struct drm_device *dev, void *data,
1584 struct drm_file *file_priv); 1532 struct drm_file *file_priv);
1585 1533
@@ -1613,9 +1561,8 @@ struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev,
1613 size_t size); 1561 size_t size);
1614int drm_gem_object_init(struct drm_device *dev, 1562int drm_gem_object_init(struct drm_device *dev,
1615 struct drm_gem_object *obj, size_t size); 1563 struct drm_gem_object *obj, size_t size);
1616int drm_gem_private_object_init(struct drm_device *dev, 1564void drm_gem_private_object_init(struct drm_device *dev,
1617 struct drm_gem_object *obj, size_t size); 1565 struct drm_gem_object *obj, size_t size);
1618void drm_gem_object_handle_free(struct drm_gem_object *obj);
1619void drm_gem_vm_open(struct vm_area_struct *vma); 1566void drm_gem_vm_open(struct vm_area_struct *vma);
1620void drm_gem_vm_close(struct vm_area_struct *vma); 1567void drm_gem_vm_close(struct vm_area_struct *vma);
1621int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size, 1568int drm_gem_mmap_obj(struct drm_gem_object *obj, unsigned long obj_size,
@@ -1640,66 +1587,32 @@ drm_gem_object_unreference(struct drm_gem_object *obj)
1640static inline void 1587static inline void
1641drm_gem_object_unreference_unlocked(struct drm_gem_object *obj) 1588drm_gem_object_unreference_unlocked(struct drm_gem_object *obj)
1642{ 1589{
1643 if (obj != NULL) { 1590 if (obj && !atomic_add_unless(&obj->refcount.refcount, -1, 1)) {
1644 struct drm_device *dev = obj->dev; 1591 struct drm_device *dev = obj->dev;
1592
1645 mutex_lock(&dev->struct_mutex); 1593 mutex_lock(&dev->struct_mutex);
1646 kref_put(&obj->refcount, drm_gem_object_free); 1594 if (likely(atomic_dec_and_test(&obj->refcount.refcount)))
1595 drm_gem_object_free(&obj->refcount);
1647 mutex_unlock(&dev->struct_mutex); 1596 mutex_unlock(&dev->struct_mutex);
1648 } 1597 }
1649} 1598}
1650 1599
1600int drm_gem_handle_create_tail(struct drm_file *file_priv,
1601 struct drm_gem_object *obj,
1602 u32 *handlep);
1651int drm_gem_handle_create(struct drm_file *file_priv, 1603int drm_gem_handle_create(struct drm_file *file_priv,
1652 struct drm_gem_object *obj, 1604 struct drm_gem_object *obj,
1653 u32 *handlep); 1605 u32 *handlep);
1654int drm_gem_handle_delete(struct drm_file *filp, u32 handle); 1606int drm_gem_handle_delete(struct drm_file *filp, u32 handle);
1655 1607
1656static inline void
1657drm_gem_object_handle_reference(struct drm_gem_object *obj)
1658{
1659 drm_gem_object_reference(obj);
1660 atomic_inc(&obj->handle_count);
1661}
1662
1663static inline void
1664drm_gem_object_handle_unreference(struct drm_gem_object *obj)
1665{
1666 if (obj == NULL)
1667 return;
1668
1669 if (atomic_read(&obj->handle_count) == 0)
1670 return;
1671 /*
1672 * Must bump handle count first as this may be the last
1673 * ref, in which case the object would disappear before we
1674 * checked for a name
1675 */
1676 if (atomic_dec_and_test(&obj->handle_count))
1677 drm_gem_object_handle_free(obj);
1678 drm_gem_object_unreference(obj);
1679}
1680
1681static inline void
1682drm_gem_object_handle_unreference_unlocked(struct drm_gem_object *obj)
1683{
1684 if (obj == NULL)
1685 return;
1686
1687 if (atomic_read(&obj->handle_count) == 0)
1688 return;
1689
1690 /*
1691 * Must bump handle count first as this may be the last
1692 * ref, in which case the object would disappear before we
1693 * checked for a name
1694 */
1695
1696 if (atomic_dec_and_test(&obj->handle_count))
1697 drm_gem_object_handle_free(obj);
1698 drm_gem_object_unreference_unlocked(obj);
1699}
1700 1608
1701void drm_gem_free_mmap_offset(struct drm_gem_object *obj); 1609void drm_gem_free_mmap_offset(struct drm_gem_object *obj);
1702int drm_gem_create_mmap_offset(struct drm_gem_object *obj); 1610int drm_gem_create_mmap_offset(struct drm_gem_object *obj);
1611int drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size);
1612
1613struct page **drm_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask);
1614void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
1615 bool dirty, bool accessed);
1703 1616
1704struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev, 1617struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev,
1705 struct drm_file *filp, 1618 struct drm_file *filp,
@@ -1769,9 +1682,6 @@ extern int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *speed_mask);
1769extern int drm_platform_init(struct drm_driver *driver, struct platform_device *platform_device); 1682extern int drm_platform_init(struct drm_driver *driver, struct platform_device *platform_device);
1770extern void drm_platform_exit(struct drm_driver *driver, struct platform_device *platform_device); 1683extern void drm_platform_exit(struct drm_driver *driver, struct platform_device *platform_device);
1771 1684
1772extern int drm_get_platform_dev(struct platform_device *pdev,
1773 struct drm_driver *driver);
1774
1775/* returns true if currently okay to sleep */ 1685/* returns true if currently okay to sleep */
1776static __inline__ bool drm_can_sleep(void) 1686static __inline__ bool drm_can_sleep(void)
1777{ 1687{
diff --git a/include/drm/drm_agpsupport.h b/include/drm/drm_agpsupport.h
new file mode 100644
index 000000000000..a184eeee9c96
--- /dev/null
+++ b/include/drm/drm_agpsupport.h
@@ -0,0 +1,194 @@
1#ifndef _DRM_AGPSUPPORT_H_
2#define _DRM_AGPSUPPORT_H_
3
4#include <linux/kernel.h>
5#include <linux/mm.h>
6#include <linux/mutex.h>
7#include <linux/types.h>
8#include <linux/agp_backend.h>
9#include <drm/drmP.h>
10
11#if __OS_HAS_AGP
12
13void drm_free_agp(DRM_AGP_MEM * handle, int pages);
14int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start);
15int drm_unbind_agp(DRM_AGP_MEM * handle);
16DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
17 struct page **pages,
18 unsigned long num_pages,
19 uint32_t gtt_offset,
20 uint32_t type);
21
22struct drm_agp_head *drm_agp_init(struct drm_device *dev);
23void drm_agp_destroy(struct drm_agp_head *agp);
24void drm_agp_clear(struct drm_device *dev);
25int drm_agp_acquire(struct drm_device *dev);
26int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
27 struct drm_file *file_priv);
28int drm_agp_release(struct drm_device *dev);
29int drm_agp_release_ioctl(struct drm_device *dev, void *data,
30 struct drm_file *file_priv);
31int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode);
32int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
33 struct drm_file *file_priv);
34int drm_agp_info(struct drm_device *dev, struct drm_agp_info *info);
35int drm_agp_info_ioctl(struct drm_device *dev, void *data,
36 struct drm_file *file_priv);
37int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request);
38int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
39 struct drm_file *file_priv);
40int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request);
41int drm_agp_free_ioctl(struct drm_device *dev, void *data,
42 struct drm_file *file_priv);
43int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request);
44int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
45 struct drm_file *file_priv);
46int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request);
47int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
48 struct drm_file *file_priv);
49
50static inline int drm_core_has_AGP(struct drm_device *dev)
51{
52 return drm_core_check_feature(dev, DRIVER_USE_AGP);
53}
54
55#else /* __OS_HAS_AGP */
56
57static inline void drm_free_agp(DRM_AGP_MEM * handle, int pages)
58{
59}
60
61static inline int drm_bind_agp(DRM_AGP_MEM * handle, unsigned int start)
62{
63 return -ENODEV;
64}
65
66static inline int drm_unbind_agp(DRM_AGP_MEM * handle)
67{
68 return -ENODEV;
69}
70
71static inline DRM_AGP_MEM *drm_agp_bind_pages(struct drm_device *dev,
72 struct page **pages,
73 unsigned long num_pages,
74 uint32_t gtt_offset,
75 uint32_t type)
76{
77 return NULL;
78}
79
80static inline struct drm_agp_head *drm_agp_init(struct drm_device *dev)
81{
82 return NULL;
83}
84
85static inline void drm_agp_destroy(struct drm_agp_head *agp)
86{
87}
88
89static inline void drm_agp_clear(struct drm_device *dev)
90{
91}
92
93static inline int drm_agp_acquire(struct drm_device *dev)
94{
95 return -ENODEV;
96}
97
98static inline int drm_agp_acquire_ioctl(struct drm_device *dev, void *data,
99 struct drm_file *file_priv)
100{
101 return -ENODEV;
102}
103
104static inline int drm_agp_release(struct drm_device *dev)
105{
106 return -ENODEV;
107}
108
109static inline int drm_agp_release_ioctl(struct drm_device *dev, void *data,
110 struct drm_file *file_priv)
111{
112 return -ENODEV;
113}
114
115static inline int drm_agp_enable(struct drm_device *dev,
116 struct drm_agp_mode mode)
117{
118 return -ENODEV;
119}
120
121static inline int drm_agp_enable_ioctl(struct drm_device *dev, void *data,
122 struct drm_file *file_priv)
123{
124 return -ENODEV;
125}
126
127static inline int drm_agp_info(struct drm_device *dev,
128 struct drm_agp_info *info)
129{
130 return -ENODEV;
131}
132
133static inline int drm_agp_info_ioctl(struct drm_device *dev, void *data,
134 struct drm_file *file_priv)
135{
136 return -ENODEV;
137}
138
139static inline int drm_agp_alloc(struct drm_device *dev,
140 struct drm_agp_buffer *request)
141{
142 return -ENODEV;
143}
144
145static inline int drm_agp_alloc_ioctl(struct drm_device *dev, void *data,
146 struct drm_file *file_priv)
147{
148 return -ENODEV;
149}
150
151static inline int drm_agp_free(struct drm_device *dev,
152 struct drm_agp_buffer *request)
153{
154 return -ENODEV;
155}
156
157static inline int drm_agp_free_ioctl(struct drm_device *dev, void *data,
158 struct drm_file *file_priv)
159{
160 return -ENODEV;
161}
162
163static inline int drm_agp_unbind(struct drm_device *dev,
164 struct drm_agp_binding *request)
165{
166 return -ENODEV;
167}
168
169static inline int drm_agp_unbind_ioctl(struct drm_device *dev, void *data,
170 struct drm_file *file_priv)
171{
172 return -ENODEV;
173}
174
175static inline int drm_agp_bind(struct drm_device *dev,
176 struct drm_agp_binding *request)
177{
178 return -ENODEV;
179}
180
181static inline int drm_agp_bind_ioctl(struct drm_device *dev, void *data,
182 struct drm_file *file_priv)
183{
184 return -ENODEV;
185}
186
187static inline int drm_core_has_AGP(struct drm_device *dev)
188{
189 return 0;
190}
191
192#endif /* __OS_HAS_AGP */
193
194#endif /* _DRM_AGPSUPPORT_H_ */
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index fa12a2fa4293..24f499569a2f 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -49,6 +49,7 @@ struct drm_clip_rect;
49#define DRM_MODE_OBJECT_FB 0xfbfbfbfb 49#define DRM_MODE_OBJECT_FB 0xfbfbfbfb
50#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb 50#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb
51#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee 51#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
52#define DRM_MODE_OBJECT_BRIDGE 0xbdbdbdbd
52 53
53struct drm_mode_object { 54struct drm_mode_object {
54 uint32_t id; 55 uint32_t id;
@@ -305,6 +306,7 @@ struct drm_connector;
305struct drm_encoder; 306struct drm_encoder;
306struct drm_pending_vblank_event; 307struct drm_pending_vblank_event;
307struct drm_plane; 308struct drm_plane;
309struct drm_bridge;
308 310
309/** 311/**
310 * drm_crtc_funcs - control CRTCs for a given device 312 * drm_crtc_funcs - control CRTCs for a given device
@@ -363,7 +365,8 @@ struct drm_crtc_funcs {
363 */ 365 */
364 int (*page_flip)(struct drm_crtc *crtc, 366 int (*page_flip)(struct drm_crtc *crtc,
365 struct drm_framebuffer *fb, 367 struct drm_framebuffer *fb,
366 struct drm_pending_vblank_event *event); 368 struct drm_pending_vblank_event *event,
369 uint32_t flags);
367 370
368 int (*set_property)(struct drm_crtc *crtc, 371 int (*set_property)(struct drm_crtc *crtc,
369 struct drm_property *property, uint64_t val); 372 struct drm_property *property, uint64_t val);
@@ -494,8 +497,6 @@ struct drm_encoder_funcs {
494 void (*destroy)(struct drm_encoder *encoder); 497 void (*destroy)(struct drm_encoder *encoder);
495}; 498};
496 499
497#define DRM_CONNECTOR_MAX_UMODES 16
498#define DRM_CONNECTOR_LEN 32
499#define DRM_CONNECTOR_MAX_ENCODER 3 500#define DRM_CONNECTOR_MAX_ENCODER 3
500 501
501/** 502/**
@@ -507,6 +508,7 @@ struct drm_encoder_funcs {
507 * @possible_crtcs: bitmask of potential CRTC bindings 508 * @possible_crtcs: bitmask of potential CRTC bindings
508 * @possible_clones: bitmask of potential sibling encoders for cloning 509 * @possible_clones: bitmask of potential sibling encoders for cloning
509 * @crtc: currently bound CRTC 510 * @crtc: currently bound CRTC
511 * @bridge: bridge associated to the encoder
510 * @funcs: control functions 512 * @funcs: control functions
511 * @helper_private: mid-layer private data 513 * @helper_private: mid-layer private data
512 * 514 *
@@ -523,6 +525,7 @@ struct drm_encoder {
523 uint32_t possible_clones; 525 uint32_t possible_clones;
524 526
525 struct drm_crtc *crtc; 527 struct drm_crtc *crtc;
528 struct drm_bridge *bridge;
526 const struct drm_encoder_funcs *funcs; 529 const struct drm_encoder_funcs *funcs;
527 void *helper_private; 530 void *helper_private;
528}; 531};
@@ -683,6 +686,48 @@ struct drm_plane {
683}; 686};
684 687
685/** 688/**
689 * drm_bridge_funcs - drm_bridge control functions
690 * @mode_fixup: Try to fixup (or reject entirely) proposed mode for this bridge
691 * @disable: Called right before encoder prepare, disables the bridge
692 * @post_disable: Called right after encoder prepare, for lockstepped disable
693 * @mode_set: Set this mode to the bridge
694 * @pre_enable: Called right before encoder commit, for lockstepped commit
695 * @enable: Called right after encoder commit, enables the bridge
696 * @destroy: make object go away
697 */
698struct drm_bridge_funcs {
699 bool (*mode_fixup)(struct drm_bridge *bridge,
700 const struct drm_display_mode *mode,
701 struct drm_display_mode *adjusted_mode);
702 void (*disable)(struct drm_bridge *bridge);
703 void (*post_disable)(struct drm_bridge *bridge);
704 void (*mode_set)(struct drm_bridge *bridge,
705 struct drm_display_mode *mode,
706 struct drm_display_mode *adjusted_mode);
707 void (*pre_enable)(struct drm_bridge *bridge);
708 void (*enable)(struct drm_bridge *bridge);
709 void (*destroy)(struct drm_bridge *bridge);
710};
711
712/**
713 * drm_bridge - central DRM bridge control structure
714 * @dev: DRM device this bridge belongs to
715 * @head: list management
716 * @base: base mode object
717 * @funcs: control functions
718 * @driver_private: pointer to the bridge driver's internal context
719 */
720struct drm_bridge {
721 struct drm_device *dev;
722 struct list_head head;
723
724 struct drm_mode_object base;
725
726 const struct drm_bridge_funcs *funcs;
727 void *driver_private;
728};
729
730/**
686 * drm_mode_set - new values for a CRTC config change 731 * drm_mode_set - new values for a CRTC config change
687 * @head: list management 732 * @head: list management
688 * @fb: framebuffer to use for new config 733 * @fb: framebuffer to use for new config
@@ -742,6 +787,7 @@ struct drm_mode_group {
742 uint32_t num_crtcs; 787 uint32_t num_crtcs;
743 uint32_t num_encoders; 788 uint32_t num_encoders;
744 uint32_t num_connectors; 789 uint32_t num_connectors;
790 uint32_t num_bridges;
745 791
746 /* list of object IDs for this group */ 792 /* list of object IDs for this group */
747 uint32_t *id_list; 793 uint32_t *id_list;
@@ -756,6 +802,8 @@ struct drm_mode_group {
756 * @fb_list: list of framebuffers available 802 * @fb_list: list of framebuffers available
757 * @num_connector: number of connectors on this device 803 * @num_connector: number of connectors on this device
758 * @connector_list: list of connector objects 804 * @connector_list: list of connector objects
805 * @num_bridge: number of bridges on this device
806 * @bridge_list: list of bridge objects
759 * @num_encoder: number of encoders on this device 807 * @num_encoder: number of encoders on this device
760 * @encoder_list: list of encoder objects 808 * @encoder_list: list of encoder objects
761 * @num_crtc: number of CRTCs on this device 809 * @num_crtc: number of CRTCs on this device
@@ -793,6 +841,8 @@ struct drm_mode_config {
793 841
794 int num_connector; 842 int num_connector;
795 struct list_head connector_list; 843 struct list_head connector_list;
844 int num_bridge;
845 struct list_head bridge_list;
796 int num_encoder; 846 int num_encoder;
797 struct list_head encoder_list; 847 struct list_head encoder_list;
798 int num_plane; 848 int num_plane;
@@ -839,11 +889,13 @@ struct drm_mode_config {
839 889
840 /* Optional properties */ 890 /* Optional properties */
841 struct drm_property *scaling_mode_property; 891 struct drm_property *scaling_mode_property;
842 struct drm_property *dithering_mode_property;
843 struct drm_property *dirty_info_property; 892 struct drm_property *dirty_info_property;
844 893
845 /* dumb ioctl parameters */ 894 /* dumb ioctl parameters */
846 uint32_t preferred_depth, prefer_shadow; 895 uint32_t preferred_depth, prefer_shadow;
896
897 /* whether async page flip is supported or not */
898 bool async_page_flip;
847}; 899};
848 900
849#define obj_to_crtc(x) container_of(x, struct drm_crtc, base) 901#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
@@ -869,6 +921,8 @@ extern int drm_crtc_init(struct drm_device *dev,
869 const struct drm_crtc_funcs *funcs); 921 const struct drm_crtc_funcs *funcs);
870extern void drm_crtc_cleanup(struct drm_crtc *crtc); 922extern void drm_crtc_cleanup(struct drm_crtc *crtc);
871 923
924extern void drm_connector_ida_init(void);
925extern void drm_connector_ida_destroy(void);
872extern int drm_connector_init(struct drm_device *dev, 926extern int drm_connector_init(struct drm_device *dev,
873 struct drm_connector *connector, 927 struct drm_connector *connector,
874 const struct drm_connector_funcs *funcs, 928 const struct drm_connector_funcs *funcs,
@@ -878,6 +932,10 @@ extern void drm_connector_cleanup(struct drm_connector *connector);
878/* helper to unplug all connectors from sysfs for device */ 932/* helper to unplug all connectors from sysfs for device */
879extern void drm_connector_unplug_all(struct drm_device *dev); 933extern void drm_connector_unplug_all(struct drm_device *dev);
880 934
935extern int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge,
936 const struct drm_bridge_funcs *funcs);
937extern void drm_bridge_cleanup(struct drm_bridge *bridge);
938
881extern int drm_encoder_init(struct drm_device *dev, 939extern int drm_encoder_init(struct drm_device *dev,
882 struct drm_encoder *encoder, 940 struct drm_encoder *encoder,
883 const struct drm_encoder_funcs *funcs, 941 const struct drm_encoder_funcs *funcs,
@@ -908,7 +966,6 @@ extern struct edid *drm_get_edid(struct drm_connector *connector,
908 struct i2c_adapter *adapter); 966 struct i2c_adapter *adapter);
909extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid); 967extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
910extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode); 968extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
911extern void drm_mode_remove(struct drm_connector *connector, struct drm_display_mode *mode);
912extern void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src); 969extern void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src);
913extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev, 970extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
914 const struct drm_display_mode *mode); 971 const struct drm_display_mode *mode);
@@ -925,14 +982,9 @@ extern int drm_mode_height(const struct drm_display_mode *mode);
925/* for us by fb module */ 982/* for us by fb module */
926extern struct drm_display_mode *drm_mode_create(struct drm_device *dev); 983extern struct drm_display_mode *drm_mode_create(struct drm_device *dev);
927extern void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode); 984extern void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode);
928extern void drm_mode_list_concat(struct list_head *head,
929 struct list_head *new);
930extern void drm_mode_validate_size(struct drm_device *dev, 985extern void drm_mode_validate_size(struct drm_device *dev,
931 struct list_head *mode_list, 986 struct list_head *mode_list,
932 int maxX, int maxY, int maxPitch); 987 int maxX, int maxY, int maxPitch);
933extern void drm_mode_validate_clocks(struct drm_device *dev,
934 struct list_head *mode_list,
935 int *min, int *max, int n_ranges);
936extern void drm_mode_prune_invalid(struct drm_device *dev, 988extern void drm_mode_prune_invalid(struct drm_device *dev,
937 struct list_head *mode_list, bool verbose); 989 struct list_head *mode_list, bool verbose);
938extern void drm_mode_sort(struct list_head *mode_list); 990extern void drm_mode_sort(struct list_head *mode_list);
@@ -949,9 +1001,6 @@ extern int drm_object_property_set_value(struct drm_mode_object *obj,
949extern int drm_object_property_get_value(struct drm_mode_object *obj, 1001extern int drm_object_property_get_value(struct drm_mode_object *obj,
950 struct drm_property *property, 1002 struct drm_property *property,
951 uint64_t *value); 1003 uint64_t *value);
952extern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev);
953extern void drm_framebuffer_set_object(struct drm_device *dev,
954 unsigned long handle);
955extern int drm_framebuffer_init(struct drm_device *dev, 1004extern int drm_framebuffer_init(struct drm_device *dev,
956 struct drm_framebuffer *fb, 1005 struct drm_framebuffer *fb,
957 const struct drm_framebuffer_funcs *funcs); 1006 const struct drm_framebuffer_funcs *funcs);
@@ -962,10 +1011,6 @@ extern void drm_framebuffer_reference(struct drm_framebuffer *fb);
962extern void drm_framebuffer_remove(struct drm_framebuffer *fb); 1011extern void drm_framebuffer_remove(struct drm_framebuffer *fb);
963extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb); 1012extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb);
964extern void drm_framebuffer_unregister_private(struct drm_framebuffer *fb); 1013extern void drm_framebuffer_unregister_private(struct drm_framebuffer *fb);
965extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc);
966extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
967extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY);
968extern bool drm_crtc_in_use(struct drm_crtc *crtc);
969 1014
970extern void drm_object_attach_property(struct drm_mode_object *obj, 1015extern void drm_object_attach_property(struct drm_mode_object *obj,
971 struct drm_property *property, 1016 struct drm_property *property,
@@ -990,7 +1035,6 @@ extern int drm_mode_create_dvi_i_properties(struct drm_device *dev);
990extern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats, 1035extern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats,
991 char *formats[]); 1036 char *formats[]);
992extern int drm_mode_create_scaling_mode_property(struct drm_device *dev); 1037extern int drm_mode_create_scaling_mode_property(struct drm_device *dev);
993extern int drm_mode_create_dithering_property(struct drm_device *dev);
994extern int drm_mode_create_dirty_info_property(struct drm_device *dev); 1038extern int drm_mode_create_dirty_info_property(struct drm_device *dev);
995extern const char *drm_get_encoder_name(const struct drm_encoder *encoder); 1039extern const char *drm_get_encoder_name(const struct drm_encoder *encoder);
996 1040
@@ -1040,17 +1084,12 @@ extern int drm_mode_getblob_ioctl(struct drm_device *dev,
1040 void *data, struct drm_file *file_priv); 1084 void *data, struct drm_file *file_priv);
1041extern int drm_mode_connector_property_set_ioctl(struct drm_device *dev, 1085extern int drm_mode_connector_property_set_ioctl(struct drm_device *dev,
1042 void *data, struct drm_file *file_priv); 1086 void *data, struct drm_file *file_priv);
1043extern int drm_mode_hotplug_ioctl(struct drm_device *dev,
1044 void *data, struct drm_file *file_priv);
1045extern int drm_mode_replacefb(struct drm_device *dev,
1046 void *data, struct drm_file *file_priv);
1047extern int drm_mode_getencoder(struct drm_device *dev, 1087extern int drm_mode_getencoder(struct drm_device *dev,
1048 void *data, struct drm_file *file_priv); 1088 void *data, struct drm_file *file_priv);
1049extern int drm_mode_gamma_get_ioctl(struct drm_device *dev, 1089extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
1050 void *data, struct drm_file *file_priv); 1090 void *data, struct drm_file *file_priv);
1051extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, 1091extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
1052 void *data, struct drm_file *file_priv); 1092 void *data, struct drm_file *file_priv);
1053extern u8 *drm_find_cea_extension(struct edid *edid);
1054extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match); 1093extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
1055extern bool drm_detect_hdmi_monitor(struct edid *edid); 1094extern bool drm_detect_hdmi_monitor(struct edid *edid);
1056extern bool drm_detect_monitor_audio(struct edid *edid); 1095extern bool drm_detect_monitor_audio(struct edid *edid);
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index e8e1417af3d9..ae8dbfb1207c 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -342,13 +342,42 @@ u8 drm_dp_get_adjust_request_voltage(u8 link_status[DP_LINK_STATUS_SIZE],
342u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE], 342u8 drm_dp_get_adjust_request_pre_emphasis(u8 link_status[DP_LINK_STATUS_SIZE],
343 int lane); 343 int lane);
344 344
345#define DP_RECEIVER_CAP_SIZE 0xf 345#define DP_RECEIVER_CAP_SIZE 0xf
346#define EDP_PSR_RECEIVER_CAP_SIZE 2
347
346void drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]); 348void drm_dp_link_train_clock_recovery_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]);
347void drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]); 349void drm_dp_link_train_channel_eq_delay(u8 dpcd[DP_RECEIVER_CAP_SIZE]);
348 350
349u8 drm_dp_link_rate_to_bw_code(int link_rate); 351u8 drm_dp_link_rate_to_bw_code(int link_rate);
350int drm_dp_bw_code_to_link_rate(u8 link_bw); 352int drm_dp_bw_code_to_link_rate(u8 link_bw);
351 353
354struct edp_sdp_header {
355 u8 HB0; /* Secondary Data Packet ID */
356 u8 HB1; /* Secondary Data Packet Type */
357 u8 HB2; /* 7:5 reserved, 4:0 revision number */
358 u8 HB3; /* 7:5 reserved, 4:0 number of valid data bytes */
359} __packed;
360
361#define EDP_SDP_HEADER_REVISION_MASK 0x1F
362#define EDP_SDP_HEADER_VALID_PAYLOAD_BYTES 0x1F
363
364struct edp_vsc_psr {
365 struct edp_sdp_header sdp_header;
366 u8 DB0; /* Stereo Interface */
367 u8 DB1; /* 0 - PSR State; 1 - Update RFB; 2 - CRC Valid */
368 u8 DB2; /* CRC value bits 7:0 of the R or Cr component */
369 u8 DB3; /* CRC value bits 15:8 of the R or Cr component */
370 u8 DB4; /* CRC value bits 7:0 of the G or Y component */
371 u8 DB5; /* CRC value bits 15:8 of the G or Y component */
372 u8 DB6; /* CRC value bits 7:0 of the B or Cb component */
373 u8 DB7; /* CRC value bits 15:8 of the B or Cb component */
374 u8 DB8_31[24]; /* Reserved */
375} __packed;
376
377#define EDP_VSC_PSR_STATE_ACTIVE (1<<0)
378#define EDP_VSC_PSR_UPDATE_RFB (1<<1)
379#define EDP_VSC_PSR_CRC_VALUES_VALID (1<<2)
380
352static inline int 381static inline int
353drm_dp_max_link_rate(u8 dpcd[DP_RECEIVER_CAP_SIZE]) 382drm_dp_max_link_rate(u8 dpcd[DP_RECEIVER_CAP_SIZE])
354{ 383{
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index fc481fc17085..a1441c5ac63d 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -256,9 +256,11 @@ struct drm_encoder;
256struct drm_connector; 256struct drm_connector;
257struct drm_display_mode; 257struct drm_display_mode;
258struct hdmi_avi_infoframe; 258struct hdmi_avi_infoframe;
259struct hdmi_vendor_infoframe;
259 260
260void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid); 261void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid);
261int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads); 262int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads);
263int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb);
262int drm_av_sync_delay(struct drm_connector *connector, 264int drm_av_sync_delay(struct drm_connector *connector,
263 struct drm_display_mode *mode); 265 struct drm_display_mode *mode);
264struct drm_connector *drm_select_eld(struct drm_encoder *encoder, 266struct drm_connector *drm_select_eld(struct drm_encoder *encoder,
@@ -268,5 +270,8 @@ int drm_load_edid_firmware(struct drm_connector *connector);
268int 270int
269drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, 271drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
270 const struct drm_display_mode *mode); 272 const struct drm_display_mode *mode);
273int
274drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
275 const struct drm_display_mode *mode);
271 276
272#endif /* __DRM_EDID_H__ */ 277#endif /* __DRM_EDID_H__ */
diff --git a/include/drm/drm_fb_cma_helper.h b/include/drm/drm_fb_cma_helper.h
index 4a3fc244301c..c54cf3d4a03f 100644
--- a/include/drm/drm_fb_cma_helper.h
+++ b/include/drm/drm_fb_cma_helper.h
@@ -24,7 +24,6 @@ struct drm_gem_cma_object *drm_fb_cma_get_gem_obj(struct drm_framebuffer *fb,
24 unsigned int plane); 24 unsigned int plane);
25 25
26#ifdef CONFIG_DEBUG_FS 26#ifdef CONFIG_DEBUG_FS
27void drm_fb_cma_describe(struct drm_framebuffer *fb, struct seq_file *m);
28int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg); 27int drm_fb_cma_debugfs_show(struct seq_file *m, void *arg);
29#endif 28#endif
30 29
diff --git a/include/drm/drm_flip_work.h b/include/drm/drm_flip_work.h
new file mode 100644
index 000000000000..35c776ae7d3b
--- /dev/null
+++ b/include/drm/drm_flip_work.h
@@ -0,0 +1,76 @@
1/*
2 * Copyright (C) 2013 Red Hat
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 */
23
24#ifndef DRM_FLIP_WORK_H
25#define DRM_FLIP_WORK_H
26
27#include <linux/kfifo.h>
28#include <linux/workqueue.h>
29
30/**
31 * DOC: flip utils
32 *
33 * Util to queue up work to run from work-queue context after flip/vblank.
34 * Typically this can be used to defer unref of framebuffer's, cursor
35 * bo's, etc until after vblank. The APIs are all safe (and lockless)
36 * for up to one producer and once consumer at a time. The single-consumer
37 * aspect is ensured by committing the queued work to a single work-queue.
38 */
39
40struct drm_flip_work;
41
42/*
43 * drm_flip_func_t - callback function
44 *
45 * @work: the flip work
46 * @val: value queued via drm_flip_work_queue()
47 *
48 * Callback function to be called for each of the queue'd work items after
49 * drm_flip_work_commit() is called.
50 */
51typedef void (*drm_flip_func_t)(struct drm_flip_work *work, void *val);
52
53/**
54 * struct drm_flip_work - flip work queue
55 * @name: debug name
56 * @pending: number of queued but not committed items
57 * @count: number of committed items
58 * @func: callback fxn called for each committed item
59 * @worker: worker which calls @func
60 */
61struct drm_flip_work {
62 const char *name;
63 atomic_t pending, count;
64 drm_flip_func_t func;
65 struct work_struct worker;
66 DECLARE_KFIFO_PTR(fifo, void *);
67};
68
69void drm_flip_work_queue(struct drm_flip_work *work, void *val);
70void drm_flip_work_commit(struct drm_flip_work *work,
71 struct workqueue_struct *wq);
72int drm_flip_work_init(struct drm_flip_work *work, int size,
73 const char *name, drm_flip_func_t func);
74void drm_flip_work_cleanup(struct drm_flip_work *work);
75
76#endif /* DRM_FLIP_WORK_H */
diff --git a/include/drm/drm_gem_cma_helper.h b/include/drm/drm_gem_cma_helper.h
index c34f27f80bcc..89b4d7db1ebd 100644
--- a/include/drm/drm_gem_cma_helper.h
+++ b/include/drm/drm_gem_cma_helper.h
@@ -30,14 +30,6 @@ int drm_gem_cma_dumb_map_offset(struct drm_file *file_priv,
30/* set vm_flags and we can change the vm attribute to other one at here. */ 30/* set vm_flags and we can change the vm attribute to other one at here. */
31int drm_gem_cma_mmap(struct file *filp, struct vm_area_struct *vma); 31int drm_gem_cma_mmap(struct file *filp, struct vm_area_struct *vma);
32 32
33/*
34 * destroy memory region allocated.
35 * - a gem handle and physical memory region pointed by a gem object
36 * would be released by drm_gem_handle_delete().
37 */
38int drm_gem_cma_dumb_destroy(struct drm_file *file_priv,
39 struct drm_device *drm, unsigned int handle);
40
41/* allocate physical memory. */ 33/* allocate physical memory. */
42struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm, 34struct drm_gem_cma_object *drm_gem_cma_create(struct drm_device *drm,
43 unsigned int size); 35 unsigned int size);
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h
index 4d06edb56d5f..cba67865d18f 100644
--- a/include/drm/drm_mm.h
+++ b/include/drm/drm_mm.h
@@ -36,11 +36,19 @@
36/* 36/*
37 * Generic range manager structs 37 * Generic range manager structs
38 */ 38 */
39#include <linux/bug.h>
40#include <linux/kernel.h>
39#include <linux/list.h> 41#include <linux/list.h>
42#include <linux/spinlock.h>
40#ifdef CONFIG_DEBUG_FS 43#ifdef CONFIG_DEBUG_FS
41#include <linux/seq_file.h> 44#include <linux/seq_file.h>
42#endif 45#endif
43 46
47enum drm_mm_search_flags {
48 DRM_MM_SEARCH_DEFAULT = 0,
49 DRM_MM_SEARCH_BEST = 1 << 0,
50};
51
44struct drm_mm_node { 52struct drm_mm_node {
45 struct list_head node_list; 53 struct list_head node_list;
46 struct list_head hole_stack; 54 struct list_head hole_stack;
@@ -62,9 +70,6 @@ struct drm_mm {
62 /* head_node.node_list is the list of all memory nodes, ordered 70 /* head_node.node_list is the list of all memory nodes, ordered
63 * according to the (increasing) start address of the memory node. */ 71 * according to the (increasing) start address of the memory node. */
64 struct drm_mm_node head_node; 72 struct drm_mm_node head_node;
65 struct list_head unused_nodes;
66 int num_unused;
67 spinlock_t unused_lock;
68 unsigned int scan_check_range : 1; 73 unsigned int scan_check_range : 1;
69 unsigned scan_alignment; 74 unsigned scan_alignment;
70 unsigned long scan_color; 75 unsigned long scan_color;
@@ -115,13 +120,6 @@ static inline unsigned long drm_mm_hole_node_end(struct drm_mm_node *hole_node)
115#define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \ 120#define drm_mm_for_each_node(entry, mm) list_for_each_entry(entry, \
116 &(mm)->head_node.node_list, \ 121 &(mm)->head_node.node_list, \
117 node_list) 122 node_list)
118#define drm_mm_for_each_scanned_node_reverse(entry, n, mm) \
119 for (entry = (mm)->prev_scanned_node, \
120 next = entry ? list_entry(entry->node_list.next, \
121 struct drm_mm_node, node_list) : NULL; \
122 entry != NULL; entry = next, \
123 next = entry ? list_entry(entry->node_list.next, \
124 struct drm_mm_node, node_list) : NULL) \
125 123
126/* Note that we need to unroll list_for_each_entry in order to inline 124/* Note that we need to unroll list_for_each_entry in order to inline
127 * setting hole_start and hole_end on each iteration and keep the 125 * setting hole_start and hole_end on each iteration and keep the
@@ -138,124 +136,50 @@ static inline unsigned long drm_mm_hole_node_end(struct drm_mm_node *hole_node)
138/* 136/*
139 * Basic range manager support (drm_mm.c) 137 * Basic range manager support (drm_mm.c)
140 */ 138 */
141extern struct drm_mm_node *drm_mm_create_block(struct drm_mm *mm, 139extern int drm_mm_reserve_node(struct drm_mm *mm, struct drm_mm_node *node);
142 unsigned long start,
143 unsigned long size,
144 bool atomic);
145extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node,
146 unsigned long size,
147 unsigned alignment,
148 unsigned long color,
149 int atomic);
150extern struct drm_mm_node *drm_mm_get_block_range_generic(
151 struct drm_mm_node *node,
152 unsigned long size,
153 unsigned alignment,
154 unsigned long color,
155 unsigned long start,
156 unsigned long end,
157 int atomic);
158static inline struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent,
159 unsigned long size,
160 unsigned alignment)
161{
162 return drm_mm_get_block_generic(parent, size, alignment, 0, 0);
163}
164static inline struct drm_mm_node *drm_mm_get_block_atomic(struct drm_mm_node *parent,
165 unsigned long size,
166 unsigned alignment)
167{
168 return drm_mm_get_block_generic(parent, size, alignment, 0, 1);
169}
170static inline struct drm_mm_node *drm_mm_get_block_range(
171 struct drm_mm_node *parent,
172 unsigned long size,
173 unsigned alignment,
174 unsigned long start,
175 unsigned long end)
176{
177 return drm_mm_get_block_range_generic(parent, size, alignment, 0,
178 start, end, 0);
179}
180static inline struct drm_mm_node *drm_mm_get_block_atomic_range(
181 struct drm_mm_node *parent,
182 unsigned long size,
183 unsigned alignment,
184 unsigned long start,
185 unsigned long end)
186{
187 return drm_mm_get_block_range_generic(parent, size, alignment, 0,
188 start, end, 1);
189}
190 140
191extern int drm_mm_insert_node(struct drm_mm *mm,
192 struct drm_mm_node *node,
193 unsigned long size,
194 unsigned alignment);
195extern int drm_mm_insert_node_in_range(struct drm_mm *mm,
196 struct drm_mm_node *node,
197 unsigned long size,
198 unsigned alignment,
199 unsigned long start,
200 unsigned long end);
201extern int drm_mm_insert_node_generic(struct drm_mm *mm, 141extern int drm_mm_insert_node_generic(struct drm_mm *mm,
202 struct drm_mm_node *node, 142 struct drm_mm_node *node,
203 unsigned long size, 143 unsigned long size,
204 unsigned alignment, 144 unsigned alignment,
205 unsigned long color); 145 unsigned long color,
146 enum drm_mm_search_flags flags);
147static inline int drm_mm_insert_node(struct drm_mm *mm,
148 struct drm_mm_node *node,
149 unsigned long size,
150 unsigned alignment,
151 enum drm_mm_search_flags flags)
152{
153 return drm_mm_insert_node_generic(mm, node, size, alignment, 0, flags);
154}
155
206extern int drm_mm_insert_node_in_range_generic(struct drm_mm *mm, 156extern int drm_mm_insert_node_in_range_generic(struct drm_mm *mm,
207 struct drm_mm_node *node, 157 struct drm_mm_node *node,
208 unsigned long size, 158 unsigned long size,
209 unsigned alignment, 159 unsigned alignment,
210 unsigned long color, 160 unsigned long color,
211 unsigned long start, 161 unsigned long start,
212 unsigned long end); 162 unsigned long end,
213extern void drm_mm_put_block(struct drm_mm_node *cur); 163 enum drm_mm_search_flags flags);
214extern void drm_mm_remove_node(struct drm_mm_node *node); 164static inline int drm_mm_insert_node_in_range(struct drm_mm *mm,
215extern void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new); 165 struct drm_mm_node *node,
216extern struct drm_mm_node *drm_mm_search_free_generic(const struct drm_mm *mm, 166 unsigned long size,
217 unsigned long size, 167 unsigned alignment,
218 unsigned alignment, 168 unsigned long start,
219 unsigned long color, 169 unsigned long end,
220 bool best_match); 170 enum drm_mm_search_flags flags)
221extern struct drm_mm_node *drm_mm_search_free_in_range_generic(
222 const struct drm_mm *mm,
223 unsigned long size,
224 unsigned alignment,
225 unsigned long color,
226 unsigned long start,
227 unsigned long end,
228 bool best_match);
229static inline struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm,
230 unsigned long size,
231 unsigned alignment,
232 bool best_match)
233{ 171{
234 return drm_mm_search_free_generic(mm,size, alignment, 0, best_match); 172 return drm_mm_insert_node_in_range_generic(mm, node, size, alignment,
235} 173 0, start, end, flags);
236static inline struct drm_mm_node *drm_mm_search_free_in_range(
237 const struct drm_mm *mm,
238 unsigned long size,
239 unsigned alignment,
240 unsigned long start,
241 unsigned long end,
242 bool best_match)
243{
244 return drm_mm_search_free_in_range_generic(mm, size, alignment, 0,
245 start, end, best_match);
246} 174}
247 175
176extern void drm_mm_remove_node(struct drm_mm_node *node);
177extern void drm_mm_replace_node(struct drm_mm_node *old, struct drm_mm_node *new);
248extern void drm_mm_init(struct drm_mm *mm, 178extern void drm_mm_init(struct drm_mm *mm,
249 unsigned long start, 179 unsigned long start,
250 unsigned long size); 180 unsigned long size);
251extern void drm_mm_takedown(struct drm_mm *mm); 181extern void drm_mm_takedown(struct drm_mm *mm);
252extern int drm_mm_clean(struct drm_mm *mm); 182extern int drm_mm_clean(struct drm_mm *mm);
253extern int drm_mm_pre_get(struct drm_mm *mm);
254
255static inline struct drm_mm *drm_get_mm(struct drm_mm_node *block)
256{
257 return block->mm;
258}
259 183
260void drm_mm_init_scan(struct drm_mm *mm, 184void drm_mm_init_scan(struct drm_mm *mm,
261 unsigned long size, 185 unsigned long size,
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index 34efaf64cc87..fd54a14a7c2a 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -1,4 +1,22 @@
1#define radeon_PCI_IDS \ 1#define radeon_PCI_IDS \
2 {0x1002, 0x1304, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
3 {0x1002, 0x1305, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
4 {0x1002, 0x1306, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
5 {0x1002, 0x1307, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
6 {0x1002, 0x1309, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
7 {0x1002, 0x130A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
8 {0x1002, 0x130B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
9 {0x1002, 0x130C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
10 {0x1002, 0x130D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
11 {0x1002, 0x130E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
12 {0x1002, 0x130F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
13 {0x1002, 0x1310, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
14 {0x1002, 0x1311, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
15 {0x1002, 0x1313, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
16 {0x1002, 0x1315, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
17 {0x1002, 0x1316, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
18 {0x1002, 0x131B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
19 {0x1002, 0x131C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_KAVERI|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
2 {0x1002, 0x3150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \ 20 {0x1002, 0x3150, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY}, \
3 {0x1002, 0x3151, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 21 {0x1002, 0x3151, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
4 {0x1002, 0x3152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 22 {0x1002, 0x3152, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV380|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
@@ -690,29 +708,6 @@
690 {0x102b, 0x2527, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MGA_CARD_TYPE_G550}, \ 708 {0x102b, 0x2527, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MGA_CARD_TYPE_G550}, \
691 {0, 0, 0} 709 {0, 0, 0}
692 710
693#define mach64_PCI_IDS \
694 {0x1002, 0x4749, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
695 {0x1002, 0x4750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
696 {0x1002, 0x4751, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
697 {0x1002, 0x4742, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
698 {0x1002, 0x4744, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
699 {0x1002, 0x4c49, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
700 {0x1002, 0x4c50, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
701 {0x1002, 0x4c51, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
702 {0x1002, 0x4c42, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
703 {0x1002, 0x4c44, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
704 {0x1002, 0x474c, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
705 {0x1002, 0x474f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
706 {0x1002, 0x4752, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
707 {0x1002, 0x4753, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
708 {0x1002, 0x474d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
709 {0x1002, 0x474e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
710 {0x1002, 0x4c52, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
711 {0x1002, 0x4c53, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
712 {0x1002, 0x4c4d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
713 {0x1002, 0x4c4e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
714 {0, 0, 0}
715
716#define sisdrv_PCI_IDS \ 711#define sisdrv_PCI_IDS \
717 {0x1039, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 712 {0x1039, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
718 {0x1039, 0x5300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 713 {0x1039, 0x5300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
@@ -752,10 +747,6 @@
752 {0x8086, 0x1132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \ 747 {0x8086, 0x1132, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
753 {0, 0, 0} 748 {0, 0, 0}
754 749
755#define gamma_PCI_IDS \
756 {0x3d3d, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, \
757 {0, 0, 0}
758
759#define savage_PCI_IDS \ 750#define savage_PCI_IDS \
760 {0x5333, 0x8a20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_SAVAGE3D}, \ 751 {0x5333, 0x8a20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_SAVAGE3D}, \
761 {0x5333, 0x8a21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_SAVAGE3D}, \ 752 {0x5333, 0x8a21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_SAVAGE3D}, \
@@ -781,6 +772,3 @@
781 {0x5333, 0x8d03, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_PROSAVAGEDDR}, \ 772 {0x5333, 0x8d03, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_PROSAVAGEDDR}, \
782 {0x5333, 0x8d04, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_PROSAVAGEDDR}, \ 773 {0x5333, 0x8d04, PCI_ANY_ID, PCI_ANY_ID, 0, 0, S3_PROSAVAGEDDR}, \
783 {0, 0, 0} 774 {0, 0, 0}
784
785#define ffb_PCI_IDS \
786 {0, 0, 0}
diff --git a/include/drm/drm_vma_manager.h b/include/drm/drm_vma_manager.h
new file mode 100644
index 000000000000..c18a593d1744
--- /dev/null
+++ b/include/drm/drm_vma_manager.h
@@ -0,0 +1,257 @@
1#ifndef __DRM_VMA_MANAGER_H__
2#define __DRM_VMA_MANAGER_H__
3
4/*
5 * Copyright (c) 2013 David Herrmann <dh.herrmann@gmail.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26#include <drm/drm_mm.h>
27#include <linux/fs.h>
28#include <linux/mm.h>
29#include <linux/module.h>
30#include <linux/rbtree.h>
31#include <linux/spinlock.h>
32#include <linux/types.h>
33
34struct drm_vma_offset_file {
35 struct rb_node vm_rb;
36 struct file *vm_filp;
37 unsigned long vm_count;
38};
39
40struct drm_vma_offset_node {
41 rwlock_t vm_lock;
42 struct drm_mm_node vm_node;
43 struct rb_node vm_rb;
44 struct rb_root vm_files;
45};
46
47struct drm_vma_offset_manager {
48 rwlock_t vm_lock;
49 struct rb_root vm_addr_space_rb;
50 struct drm_mm vm_addr_space_mm;
51};
52
53void drm_vma_offset_manager_init(struct drm_vma_offset_manager *mgr,
54 unsigned long page_offset, unsigned long size);
55void drm_vma_offset_manager_destroy(struct drm_vma_offset_manager *mgr);
56
57struct drm_vma_offset_node *drm_vma_offset_lookup(struct drm_vma_offset_manager *mgr,
58 unsigned long start,
59 unsigned long pages);
60struct drm_vma_offset_node *drm_vma_offset_lookup_locked(struct drm_vma_offset_manager *mgr,
61 unsigned long start,
62 unsigned long pages);
63int drm_vma_offset_add(struct drm_vma_offset_manager *mgr,
64 struct drm_vma_offset_node *node, unsigned long pages);
65void drm_vma_offset_remove(struct drm_vma_offset_manager *mgr,
66 struct drm_vma_offset_node *node);
67
68int drm_vma_node_allow(struct drm_vma_offset_node *node, struct file *filp);
69void drm_vma_node_revoke(struct drm_vma_offset_node *node, struct file *filp);
70bool drm_vma_node_is_allowed(struct drm_vma_offset_node *node,
71 struct file *filp);
72
73/**
74 * drm_vma_offset_exact_lookup() - Look up node by exact address
75 * @mgr: Manager object
76 * @start: Start address (page-based, not byte-based)
77 * @pages: Size of object (page-based)
78 *
79 * Same as drm_vma_offset_lookup() but does not allow any offset into the node.
80 * It only returns the exact object with the given start address.
81 *
82 * RETURNS:
83 * Node at exact start address @start.
84 */
85static inline struct drm_vma_offset_node *
86drm_vma_offset_exact_lookup(struct drm_vma_offset_manager *mgr,
87 unsigned long start,
88 unsigned long pages)
89{
90 struct drm_vma_offset_node *node;
91
92 node = drm_vma_offset_lookup(mgr, start, pages);
93 return (node && node->vm_node.start == start) ? node : NULL;
94}
95
96/**
97 * drm_vma_offset_lock_lookup() - Lock lookup for extended private use
98 * @mgr: Manager object
99 *
100 * Lock VMA manager for extended lookups. Only *_locked() VMA function calls
101 * are allowed while holding this lock. All other contexts are blocked from VMA
102 * until the lock is released via drm_vma_offset_unlock_lookup().
103 *
104 * Use this if you need to take a reference to the objects returned by
105 * drm_vma_offset_lookup_locked() before releasing this lock again.
106 *
107 * This lock must not be used for anything else than extended lookups. You must
108 * not call any other VMA helpers while holding this lock.
109 *
110 * Note: You're in atomic-context while holding this lock!
111 *
112 * Example:
113 * drm_vma_offset_lock_lookup(mgr);
114 * node = drm_vma_offset_lookup_locked(mgr);
115 * if (node)
116 * kref_get_unless_zero(container_of(node, sth, entr));
117 * drm_vma_offset_unlock_lookup(mgr);
118 */
119static inline void drm_vma_offset_lock_lookup(struct drm_vma_offset_manager *mgr)
120{
121 read_lock(&mgr->vm_lock);
122}
123
124/**
125 * drm_vma_offset_unlock_lookup() - Unlock lookup for extended private use
126 * @mgr: Manager object
127 *
128 * Release lookup-lock. See drm_vma_offset_lock_lookup() for more information.
129 */
130static inline void drm_vma_offset_unlock_lookup(struct drm_vma_offset_manager *mgr)
131{
132 read_unlock(&mgr->vm_lock);
133}
134
135/**
136 * drm_vma_node_reset() - Initialize or reset node object
137 * @node: Node to initialize or reset
138 *
139 * Reset a node to its initial state. This must be called before using it with
140 * any VMA offset manager.
141 *
142 * This must not be called on an already allocated node, or you will leak
143 * memory.
144 */
145static inline void drm_vma_node_reset(struct drm_vma_offset_node *node)
146{
147 memset(node, 0, sizeof(*node));
148 node->vm_files = RB_ROOT;
149 rwlock_init(&node->vm_lock);
150}
151
152/**
153 * drm_vma_node_start() - Return start address for page-based addressing
154 * @node: Node to inspect
155 *
156 * Return the start address of the given node. This can be used as offset into
157 * the linear VM space that is provided by the VMA offset manager. Note that
158 * this can only be used for page-based addressing. If you need a proper offset
159 * for user-space mappings, you must apply "<< PAGE_SHIFT" or use the
160 * drm_vma_node_offset_addr() helper instead.
161 *
162 * RETURNS:
163 * Start address of @node for page-based addressing. 0 if the node does not
164 * have an offset allocated.
165 */
166static inline unsigned long drm_vma_node_start(struct drm_vma_offset_node *node)
167{
168 return node->vm_node.start;
169}
170
171/**
172 * drm_vma_node_size() - Return size (page-based)
173 * @node: Node to inspect
174 *
175 * Return the size as number of pages for the given node. This is the same size
176 * that was passed to drm_vma_offset_add(). If no offset is allocated for the
177 * node, this is 0.
178 *
179 * RETURNS:
180 * Size of @node as number of pages. 0 if the node does not have an offset
181 * allocated.
182 */
183static inline unsigned long drm_vma_node_size(struct drm_vma_offset_node *node)
184{
185 return node->vm_node.size;
186}
187
188/**
189 * drm_vma_node_has_offset() - Check whether node is added to offset manager
190 * @node: Node to be checked
191 *
192 * RETURNS:
193 * true iff the node was previously allocated an offset and added to
194 * an vma offset manager.
195 */
196static inline bool drm_vma_node_has_offset(struct drm_vma_offset_node *node)
197{
198 return drm_mm_node_allocated(&node->vm_node);
199}
200
201/**
202 * drm_vma_node_offset_addr() - Return sanitized offset for user-space mmaps
203 * @node: Linked offset node
204 *
205 * Same as drm_vma_node_start() but returns the address as a valid offset that
206 * can be used for user-space mappings during mmap().
207 * This must not be called on unlinked nodes.
208 *
209 * RETURNS:
210 * Offset of @node for byte-based addressing. 0 if the node does not have an
211 * object allocated.
212 */
213static inline __u64 drm_vma_node_offset_addr(struct drm_vma_offset_node *node)
214{
215 return ((__u64)node->vm_node.start) << PAGE_SHIFT;
216}
217
218/**
219 * drm_vma_node_unmap() - Unmap offset node
220 * @node: Offset node
221 * @file_mapping: Address space to unmap @node from
222 *
223 * Unmap all userspace mappings for a given offset node. The mappings must be
224 * associated with the @file_mapping address-space. If no offset exists or
225 * the address-space is invalid, nothing is done.
226 *
227 * This call is unlocked. The caller must guarantee that drm_vma_offset_remove()
228 * is not called on this node concurrently.
229 */
230static inline void drm_vma_node_unmap(struct drm_vma_offset_node *node,
231 struct address_space *file_mapping)
232{
233 if (file_mapping && drm_vma_node_has_offset(node))
234 unmap_mapping_range(file_mapping,
235 drm_vma_node_offset_addr(node),
236 drm_vma_node_size(node) << PAGE_SHIFT, 1);
237}
238
239/**
240 * drm_vma_node_verify_access() - Access verification helper for TTM
241 * @node: Offset node
242 * @filp: Open-file
243 *
244 * This checks whether @filp is granted access to @node. It is the same as
245 * drm_vma_node_is_allowed() but suitable as drop-in helper for TTM
246 * verify_access() callbacks.
247 *
248 * RETURNS:
249 * 0 if access is granted, -EACCES otherwise.
250 */
251static inline int drm_vma_node_verify_access(struct drm_vma_offset_node *node,
252 struct file *filp)
253{
254 return drm_vma_node_is_allowed(node, filp) ? 0 : -EACCES;
255}
256
257#endif /* __DRM_VMA_MANAGER_H__ */
diff --git a/include/drm/exynos_drm.h b/include/drm/exynos_drm.h
index d6aeaf3c6d6c..cb65fa14acfc 100644
--- a/include/drm/exynos_drm.h
+++ b/include/drm/exynos_drm.h
@@ -15,6 +15,7 @@
15#define _EXYNOS_DRM_H_ 15#define _EXYNOS_DRM_H_
16 16
17#include <uapi/drm/exynos_drm.h> 17#include <uapi/drm/exynos_drm.h>
18#include <video/videomode.h>
18 19
19/** 20/**
20 * A structure for lcd panel information. 21 * A structure for lcd panel information.
@@ -24,7 +25,7 @@
24 * @height_mm: physical size of lcd height. 25 * @height_mm: physical size of lcd height.
25 */ 26 */
26struct exynos_drm_panel_info { 27struct exynos_drm_panel_info {
27 struct fb_videomode timing; 28 struct videomode vm;
28 u32 width_mm; 29 u32 width_mm;
29 u32 height_mm; 30 u32 height_mm;
30}; 31};
diff --git a/include/drm/i2c/tda998x.h b/include/drm/i2c/tda998x.h
new file mode 100644
index 000000000000..3e419d92cf5a
--- /dev/null
+++ b/include/drm/i2c/tda998x.h
@@ -0,0 +1,30 @@
1#ifndef __DRM_I2C_TDA998X_H__
2#define __DRM_I2C_TDA998X_H__
3
4struct tda998x_encoder_params {
5 u8 swap_b:3;
6 u8 mirr_b:1;
7 u8 swap_a:3;
8 u8 mirr_a:1;
9 u8 swap_d:3;
10 u8 mirr_d:1;
11 u8 swap_c:3;
12 u8 mirr_c:1;
13 u8 swap_f:3;
14 u8 mirr_f:1;
15 u8 swap_e:3;
16 u8 mirr_e:1;
17
18 u8 audio_cfg;
19 u8 audio_clk_cfg;
20 u8 audio_frame[6];
21
22 enum {
23 AFMT_SPDIF,
24 AFMT_I2S
25 } audio_format;
26
27 unsigned audio_sample_rate;
28};
29
30#endif
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 8a6aa56ece52..751eaffbf0d5 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -32,12 +32,12 @@
32#define _TTM_BO_API_H_ 32#define _TTM_BO_API_H_
33 33
34#include <drm/drm_hashtab.h> 34#include <drm/drm_hashtab.h>
35#include <drm/drm_vma_manager.h>
35#include <linux/kref.h> 36#include <linux/kref.h>
36#include <linux/list.h> 37#include <linux/list.h>
37#include <linux/wait.h> 38#include <linux/wait.h>
38#include <linux/mutex.h> 39#include <linux/mutex.h>
39#include <linux/mm.h> 40#include <linux/mm.h>
40#include <linux/rbtree.h>
41#include <linux/bitmap.h> 41#include <linux/bitmap.h>
42#include <linux/reservation.h> 42#include <linux/reservation.h>
43 43
@@ -145,7 +145,6 @@ struct ttm_tt;
145 * @type: The bo type. 145 * @type: The bo type.
146 * @destroy: Destruction function. If NULL, kfree is used. 146 * @destroy: Destruction function. If NULL, kfree is used.
147 * @num_pages: Actual number of pages. 147 * @num_pages: Actual number of pages.
148 * @addr_space_offset: Address space offset.
149 * @acc_size: Accounted size for this object. 148 * @acc_size: Accounted size for this object.
150 * @kref: Reference count of this buffer object. When this refcount reaches 149 * @kref: Reference count of this buffer object. When this refcount reaches
151 * zero, the object is put on the delayed delete list. 150 * zero, the object is put on the delayed delete list.
@@ -166,8 +165,7 @@ struct ttm_tt;
166 * @swap: List head for swap LRU list. 165 * @swap: List head for swap LRU list.
167 * @sync_obj: Pointer to a synchronization object. 166 * @sync_obj: Pointer to a synchronization object.
168 * @priv_flags: Flags describing buffer object internal state. 167 * @priv_flags: Flags describing buffer object internal state.
169 * @vm_rb: Rb node for the vm rb tree. 168 * @vma_node: Address space manager node.
170 * @vm_node: Address space manager node.
171 * @offset: The current GPU offset, which can have different meanings 169 * @offset: The current GPU offset, which can have different meanings
172 * depending on the memory type. For SYSTEM type memory, it should be 0. 170 * depending on the memory type. For SYSTEM type memory, it should be 0.
173 * @cur_placement: Hint of current placement. 171 * @cur_placement: Hint of current placement.
@@ -194,7 +192,6 @@ struct ttm_buffer_object {
194 enum ttm_bo_type type; 192 enum ttm_bo_type type;
195 void (*destroy) (struct ttm_buffer_object *); 193 void (*destroy) (struct ttm_buffer_object *);
196 unsigned long num_pages; 194 unsigned long num_pages;
197 uint64_t addr_space_offset;
198 size_t acc_size; 195 size_t acc_size;
199 196
200 /** 197 /**
@@ -238,13 +235,7 @@ struct ttm_buffer_object {
238 void *sync_obj; 235 void *sync_obj;
239 unsigned long priv_flags; 236 unsigned long priv_flags;
240 237
241 /** 238 struct drm_vma_offset_node vma_node;
242 * Members protected by the bdev::vm_lock
243 */
244
245 struct rb_node vm_rb;
246 struct drm_mm_node *vm_node;
247
248 239
249 /** 240 /**
250 * Special members that are protected by the reserve lock 241 * Special members that are protected by the reserve lock
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 984fc2d571a1..8639c85d61c4 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -36,6 +36,7 @@
36#include <ttm/ttm_placement.h> 36#include <ttm/ttm_placement.h>
37#include <drm/drm_mm.h> 37#include <drm/drm_mm.h>
38#include <drm/drm_global.h> 38#include <drm/drm_global.h>
39#include <drm/drm_vma_manager.h>
39#include <linux/workqueue.h> 40#include <linux/workqueue.h>
40#include <linux/fs.h> 41#include <linux/fs.h>
41#include <linux/spinlock.h> 42#include <linux/spinlock.h>
@@ -519,7 +520,7 @@ struct ttm_bo_global {
519 * @man: An array of mem_type_managers. 520 * @man: An array of mem_type_managers.
520 * @fence_lock: Protects the synchronizing members on *all* bos belonging 521 * @fence_lock: Protects the synchronizing members on *all* bos belonging
521 * to this device. 522 * to this device.
522 * @addr_space_mm: Range manager for the device address space. 523 * @vma_manager: Address space manager
523 * lru_lock: Spinlock that protects the buffer+device lru lists and 524 * lru_lock: Spinlock that protects the buffer+device lru lists and
524 * ddestroy lists. 525 * ddestroy lists.
525 * @val_seq: Current validation sequence. 526 * @val_seq: Current validation sequence.
@@ -537,14 +538,13 @@ struct ttm_bo_device {
537 struct list_head device_list; 538 struct list_head device_list;
538 struct ttm_bo_global *glob; 539 struct ttm_bo_global *glob;
539 struct ttm_bo_driver *driver; 540 struct ttm_bo_driver *driver;
540 rwlock_t vm_lock;
541 struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES]; 541 struct ttm_mem_type_manager man[TTM_NUM_MEM_TYPES];
542 spinlock_t fence_lock; 542 spinlock_t fence_lock;
543
543 /* 544 /*
544 * Protected by the vm lock. 545 * Protected by internal locks.
545 */ 546 */
546 struct rb_root addr_space_rb; 547 struct drm_vma_offset_manager vma_manager;
547 struct drm_mm addr_space_mm;
548 548
549 /* 549 /*
550 * Protected by the global:lru lock. 550 * Protected by the global:lru lock.
diff --git a/include/dt-bindings/pwm/pwm.h b/include/dt-bindings/pwm/pwm.h
new file mode 100644
index 000000000000..96f49e82253e
--- /dev/null
+++ b/include/dt-bindings/pwm/pwm.h
@@ -0,0 +1,14 @@
1/*
2 * This header provides constants for most PWM bindings.
3 *
4 * Most PWM bindings can include a flags cell as part of the PWM specifier.
5 * In most cases, the format of the flags cell uses the standard values
6 * defined in this header.
7 */
8
9#ifndef _DT_BINDINGS_PWM_PWM_H
10#define _DT_BINDINGS_PWM_PWM_H
11
12#define PWM_POLARITY_INVERTED (1 << 0)
13
14#endif
diff --git a/include/dt-bindings/sound/fsl-imx-audmux.h b/include/dt-bindings/sound/fsl-imx-audmux.h
new file mode 100644
index 000000000000..50b09e96f247
--- /dev/null
+++ b/include/dt-bindings/sound/fsl-imx-audmux.h
@@ -0,0 +1,56 @@
1#ifndef __DT_FSL_IMX_AUDMUX_H
2#define __DT_FSL_IMX_AUDMUX_H
3
4#define MX27_AUDMUX_HPCR1_SSI0 0
5#define MX27_AUDMUX_HPCR2_SSI1 1
6#define MX27_AUDMUX_HPCR3_SSI_PINS_4 2
7#define MX27_AUDMUX_PPCR1_SSI_PINS_1 3
8#define MX27_AUDMUX_PPCR2_SSI_PINS_2 4
9#define MX27_AUDMUX_PPCR3_SSI_PINS_3 5
10
11#define MX31_AUDMUX_PORT1_SSI0 0
12#define MX31_AUDMUX_PORT2_SSI1 1
13#define MX31_AUDMUX_PORT3_SSI_PINS_3 2
14#define MX31_AUDMUX_PORT4_SSI_PINS_4 3
15#define MX31_AUDMUX_PORT5_SSI_PINS_5 4
16#define MX31_AUDMUX_PORT6_SSI_PINS_6 5
17#define MX31_AUDMUX_PORT7_SSI_PINS_7 6
18
19#define MX51_AUDMUX_PORT1_SSI0 0
20#define MX51_AUDMUX_PORT2_SSI1 1
21#define MX51_AUDMUX_PORT3 2
22#define MX51_AUDMUX_PORT4 3
23#define MX51_AUDMUX_PORT5 4
24#define MX51_AUDMUX_PORT6 5
25#define MX51_AUDMUX_PORT7 6
26
27/* Register definitions for the i.MX21/27 Digital Audio Multiplexer */
28#define IMX_AUDMUX_V1_PCR_INMMASK(x) ((x) & 0xff)
29#define IMX_AUDMUX_V1_PCR_INMEN (1 << 8)
30#define IMX_AUDMUX_V1_PCR_TXRXEN (1 << 10)
31#define IMX_AUDMUX_V1_PCR_SYN (1 << 12)
32#define IMX_AUDMUX_V1_PCR_RXDSEL(x) (((x) & 0x7) << 13)
33#define IMX_AUDMUX_V1_PCR_RFCSEL(x) (((x) & 0xf) << 20)
34#define IMX_AUDMUX_V1_PCR_RCLKDIR (1 << 24)
35#define IMX_AUDMUX_V1_PCR_RFSDIR (1 << 25)
36#define IMX_AUDMUX_V1_PCR_TFCSEL(x) (((x) & 0xf) << 26)
37#define IMX_AUDMUX_V1_PCR_TCLKDIR (1 << 30)
38#define IMX_AUDMUX_V1_PCR_TFSDIR (1 << 31)
39
40/* Register definitions for the i.MX25/31/35/51 Digital Audio Multiplexer */
41#define IMX_AUDMUX_V2_PTCR_TFSDIR (1 << 31)
42#define IMX_AUDMUX_V2_PTCR_TFSEL(x) (((x) & 0xf) << 27)
43#define IMX_AUDMUX_V2_PTCR_TCLKDIR (1 << 26)
44#define IMX_AUDMUX_V2_PTCR_TCSEL(x) (((x) & 0xf) << 22)
45#define IMX_AUDMUX_V2_PTCR_RFSDIR (1 << 21)
46#define IMX_AUDMUX_V2_PTCR_RFSEL(x) (((x) & 0xf) << 17)
47#define IMX_AUDMUX_V2_PTCR_RCLKDIR (1 << 16)
48#define IMX_AUDMUX_V2_PTCR_RCSEL(x) (((x) & 0xf) << 12)
49#define IMX_AUDMUX_V2_PTCR_SYN (1 << 11)
50
51#define IMX_AUDMUX_V2_PDCR_RXDSEL(x) (((x) & 0x7) << 13)
52#define IMX_AUDMUX_V2_PDCR_TXRXEN (1 << 12)
53#define IMX_AUDMUX_V2_PDCR_MODE(x) (((x) & 0x3) << 8)
54#define IMX_AUDMUX_V2_PDCR_INMMASK(x) ((x) & 0xff)
55
56#endif /* __DT_FSL_IMX_AUDMUX_H */
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index 343744e4809c..7e2d15837b02 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -26,7 +26,7 @@
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/irqchip/arm-gic.h> 27#include <linux/irqchip/arm-gic.h>
28 28
29#define VGIC_NR_IRQS 128 29#define VGIC_NR_IRQS 256
30#define VGIC_NR_SGIS 16 30#define VGIC_NR_SGIS 16
31#define VGIC_NR_PPIS 16 31#define VGIC_NR_PPIS 16
32#define VGIC_NR_PRIVATE_IRQS (VGIC_NR_SGIS + VGIC_NR_PPIS) 32#define VGIC_NR_PRIVATE_IRQS (VGIC_NR_SGIS + VGIC_NR_PPIS)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 353ba256f368..a5db4aeefa36 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -481,6 +481,13 @@ void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state,
481 481
482acpi_status acpi_os_prepare_sleep(u8 sleep_state, 482acpi_status acpi_os_prepare_sleep(u8 sleep_state,
483 u32 pm1a_control, u32 pm1b_control); 483 u32 pm1a_control, u32 pm1b_control);
484
485void acpi_os_set_prepare_extended_sleep(int (*func)(u8 sleep_state,
486 u32 val_a, u32 val_b));
487
488acpi_status acpi_os_prepare_extended_sleep(u8 sleep_state,
489 u32 val_a, u32 val_b);
490
484#ifdef CONFIG_X86 491#ifdef CONFIG_X86
485void arch_reserve_mem_area(acpi_physical_address addr, size_t size); 492void arch_reserve_mem_area(acpi_physical_address addr, size_t size);
486#else 493#else
diff --git a/include/linux/ata.h b/include/linux/ata.h
index ee0bd9524055..bf4c69ca76df 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -239,6 +239,8 @@ enum {
239 ATA_CMD_WRITE_QUEUED_FUA_EXT = 0x3E, 239 ATA_CMD_WRITE_QUEUED_FUA_EXT = 0x3E,
240 ATA_CMD_FPDMA_READ = 0x60, 240 ATA_CMD_FPDMA_READ = 0x60,
241 ATA_CMD_FPDMA_WRITE = 0x61, 241 ATA_CMD_FPDMA_WRITE = 0x61,
242 ATA_CMD_FPDMA_SEND = 0x64,
243 ATA_CMD_FPDMA_RECV = 0x65,
242 ATA_CMD_PIO_READ = 0x20, 244 ATA_CMD_PIO_READ = 0x20,
243 ATA_CMD_PIO_READ_EXT = 0x24, 245 ATA_CMD_PIO_READ_EXT = 0x24,
244 ATA_CMD_PIO_WRITE = 0x30, 246 ATA_CMD_PIO_WRITE = 0x30,
@@ -293,8 +295,13 @@ enum {
293 /* marked obsolete in the ATA/ATAPI-7 spec */ 295 /* marked obsolete in the ATA/ATAPI-7 spec */
294 ATA_CMD_RESTORE = 0x10, 296 ATA_CMD_RESTORE = 0x10,
295 297
298 /* Subcmds for ATA_CMD_FPDMA_SEND */
299 ATA_SUBCMD_FPDMA_SEND_DSM = 0x00,
300 ATA_SUBCMD_FPDMA_SEND_WR_LOG_DMA_EXT = 0x02,
301
296 /* READ_LOG_EXT pages */ 302 /* READ_LOG_EXT pages */
297 ATA_LOG_SATA_NCQ = 0x10, 303 ATA_LOG_SATA_NCQ = 0x10,
304 ATA_LOG_NCQ_SEND_RECV = 0x13,
298 ATA_LOG_SATA_ID_DEV_DATA = 0x30, 305 ATA_LOG_SATA_ID_DEV_DATA = 0x30,
299 ATA_LOG_SATA_SETTINGS = 0x08, 306 ATA_LOG_SATA_SETTINGS = 0x08,
300 ATA_LOG_DEVSLP_OFFSET = 0x30, 307 ATA_LOG_DEVSLP_OFFSET = 0x30,
@@ -305,6 +312,15 @@ enum {
305 ATA_LOG_DEVSLP_VALID = 0x07, 312 ATA_LOG_DEVSLP_VALID = 0x07,
306 ATA_LOG_DEVSLP_VALID_MASK = 0x80, 313 ATA_LOG_DEVSLP_VALID_MASK = 0x80,
307 314
315 /* NCQ send and receive log */
316 ATA_LOG_NCQ_SEND_RECV_SUBCMDS_OFFSET = 0x00,
317 ATA_LOG_NCQ_SEND_RECV_SUBCMDS_DSM = (1 << 0),
318 ATA_LOG_NCQ_SEND_RECV_DSM_OFFSET = 0x04,
319 ATA_LOG_NCQ_SEND_RECV_DSM_TRIM = (1 << 0),
320 ATA_LOG_NCQ_SEND_RECV_RD_LOG_OFFSET = 0x08,
321 ATA_LOG_NCQ_SEND_RECV_WR_LOG_OFFSET = 0x0C,
322 ATA_LOG_NCQ_SEND_RECV_SIZE = 0x10,
323
308 /* READ/WRITE LONG (obsolete) */ 324 /* READ/WRITE LONG (obsolete) */
309 ATA_CMD_READ_LONG = 0x22, 325 ATA_CMD_READ_LONG = 0x22,
310 ATA_CMD_READ_LONG_ONCE = 0x23, 326 ATA_CMD_READ_LONG_ONCE = 0x23,
@@ -446,22 +462,6 @@ enum {
446 SERR_TRANS_ST_ERROR = (1 << 24), /* Transport state trans. error */ 462 SERR_TRANS_ST_ERROR = (1 << 24), /* Transport state trans. error */
447 SERR_UNRECOG_FIS = (1 << 25), /* Unrecognized FIS */ 463 SERR_UNRECOG_FIS = (1 << 25), /* Unrecognized FIS */
448 SERR_DEV_XCHG = (1 << 26), /* device exchanged */ 464 SERR_DEV_XCHG = (1 << 26), /* device exchanged */
449
450 /* struct ata_taskfile flags */
451 ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */
452 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
453 ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */
454 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
455 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
456 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
457 ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
458
459 /* protocol flags */
460 ATA_PROT_FLAG_PIO = (1 << 0), /* is PIO */
461 ATA_PROT_FLAG_DMA = (1 << 1), /* is DMA */
462 ATA_PROT_FLAG_DATA = ATA_PROT_FLAG_PIO | ATA_PROT_FLAG_DMA,
463 ATA_PROT_FLAG_NCQ = (1 << 2), /* is NCQ */
464 ATA_PROT_FLAG_ATAPI = (1 << 3), /* is ATAPI */
465}; 465};
466 466
467enum ata_tf_protocols { 467enum ata_tf_protocols {
@@ -488,83 +488,6 @@ struct ata_bmdma_prd {
488 __le32 flags_len; 488 __le32 flags_len;
489}; 489};
490 490
491struct ata_taskfile {
492 unsigned long flags; /* ATA_TFLAG_xxx */
493 u8 protocol; /* ATA_PROT_xxx */
494
495 u8 ctl; /* control reg */
496
497 u8 hob_feature; /* additional data */
498 u8 hob_nsect; /* to support LBA48 */
499 u8 hob_lbal;
500 u8 hob_lbam;
501 u8 hob_lbah;
502
503 u8 feature;
504 u8 nsect;
505 u8 lbal;
506 u8 lbam;
507 u8 lbah;
508
509 u8 device;
510
511 u8 command; /* IO operation */
512};
513
514/*
515 * protocol tests
516 */
517static inline unsigned int ata_prot_flags(u8 prot)
518{
519 switch (prot) {
520 case ATA_PROT_NODATA:
521 return 0;
522 case ATA_PROT_PIO:
523 return ATA_PROT_FLAG_PIO;
524 case ATA_PROT_DMA:
525 return ATA_PROT_FLAG_DMA;
526 case ATA_PROT_NCQ:
527 return ATA_PROT_FLAG_DMA | ATA_PROT_FLAG_NCQ;
528 case ATAPI_PROT_NODATA:
529 return ATA_PROT_FLAG_ATAPI;
530 case ATAPI_PROT_PIO:
531 return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_PIO;
532 case ATAPI_PROT_DMA:
533 return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_DMA;
534 }
535 return 0;
536}
537
538static inline int ata_is_atapi(u8 prot)
539{
540 return ata_prot_flags(prot) & ATA_PROT_FLAG_ATAPI;
541}
542
543static inline int ata_is_nodata(u8 prot)
544{
545 return !(ata_prot_flags(prot) & ATA_PROT_FLAG_DATA);
546}
547
548static inline int ata_is_pio(u8 prot)
549{
550 return ata_prot_flags(prot) & ATA_PROT_FLAG_PIO;
551}
552
553static inline int ata_is_dma(u8 prot)
554{
555 return ata_prot_flags(prot) & ATA_PROT_FLAG_DMA;
556}
557
558static inline int ata_is_ncq(u8 prot)
559{
560 return ata_prot_flags(prot) & ATA_PROT_FLAG_NCQ;
561}
562
563static inline int ata_is_data(u8 prot)
564{
565 return ata_prot_flags(prot) & ATA_PROT_FLAG_DATA;
566}
567
568/* 491/*
569 * id tests 492 * id tests
570 */ 493 */
@@ -865,6 +788,11 @@ static inline int ata_id_rotation_rate(const u16 *id)
865 return val; 788 return val;
866} 789}
867 790
791static inline bool ata_id_has_ncq_send_and_recv(const u16 *id)
792{
793 return id[ATA_ID_SATA_CAPABILITY_2] & BIT(6);
794}
795
868static inline bool ata_id_has_trim(const u16 *id) 796static inline bool ata_id_has_trim(const u16 *id)
869{ 797{
870 if (ata_id_major_version(id) >= 7 && 798 if (ata_id_major_version(id) >= 7 &&
@@ -1060,15 +988,6 @@ static inline unsigned ata_set_lba_range_entries(void *_buffer,
1060 return used_bytes; 988 return used_bytes;
1061} 989}
1062 990
1063static inline int is_multi_taskfile(struct ata_taskfile *tf)
1064{
1065 return (tf->command == ATA_CMD_READ_MULTI) ||
1066 (tf->command == ATA_CMD_WRITE_MULTI) ||
1067 (tf->command == ATA_CMD_READ_MULTI_EXT) ||
1068 (tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
1069 (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
1070}
1071
1072static inline bool ata_ok(u8 status) 991static inline bool ata_ok(u8 status)
1073{ 992{
1074 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) 993 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
diff --git a/include/linux/atmel-ssc.h b/include/linux/atmel-ssc.h
index deb0ae58b99b..66a0e5384edd 100644
--- a/include/linux/atmel-ssc.h
+++ b/include/linux/atmel-ssc.h
@@ -11,7 +11,7 @@ struct atmel_ssc_platform_data {
11 11
12struct ssc_device { 12struct ssc_device {
13 struct list_head list; 13 struct list_head list;
14 resource_size_t phybase; 14 dma_addr_t phybase;
15 void __iomem *regs; 15 void __iomem *regs;
16 struct platform_device *pdev; 16 struct platform_device *pdev;
17 struct atmel_ssc_platform_data *pdata; 17 struct atmel_ssc_platform_data *pdata;
diff --git a/include/linux/atmel_serial.h b/include/linux/atmel_serial.h
index fd6833764d72..be201ca2990c 100644
--- a/include/linux/atmel_serial.h
+++ b/include/linux/atmel_serial.h
@@ -124,4 +124,6 @@
124#define ATMEL_US_NER 0x44 /* Number of Errors Register */ 124#define ATMEL_US_NER 0x44 /* Number of Errors Register */
125#define ATMEL_US_IF 0x4c /* IrDA Filter Register */ 125#define ATMEL_US_IF 0x4c /* IrDA Filter Register */
126 126
127#define ATMEL_US_NAME 0xf0 /* Ip Name */
128
127#endif 129#endif
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 622fc505d3e1..4d043c30216f 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -72,7 +72,19 @@ struct bcma_host_ops {
72/* Core-ID values. */ 72/* Core-ID values. */
73#define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */ 73#define BCMA_CORE_OOB_ROUTER 0x367 /* Out of band */
74#define BCMA_CORE_4706_CHIPCOMMON 0x500 74#define BCMA_CORE_4706_CHIPCOMMON 0x500
75#define BCMA_CORE_PCIEG2 0x501
76#define BCMA_CORE_DMA 0x502
77#define BCMA_CORE_SDIO3 0x503
78#define BCMA_CORE_USB20 0x504
79#define BCMA_CORE_USB30 0x505
80#define BCMA_CORE_A9JTAG 0x506
81#define BCMA_CORE_DDR23 0x507
82#define BCMA_CORE_ROM 0x508
83#define BCMA_CORE_NAND 0x509
84#define BCMA_CORE_QSPI 0x50A
85#define BCMA_CORE_CHIPCOMMON_B 0x50B
75#define BCMA_CORE_4706_SOC_RAM 0x50E 86#define BCMA_CORE_4706_SOC_RAM 0x50E
87#define BCMA_CORE_ARMCA9 0x510
76#define BCMA_CORE_4706_MAC_GBIT 0x52D 88#define BCMA_CORE_4706_MAC_GBIT 0x52D
77#define BCMA_CORE_AMEMC 0x52E /* DDR1/2 memory controller core */ 89#define BCMA_CORE_AMEMC 0x52E /* DDR1/2 memory controller core */
78#define BCMA_CORE_ALTA 0x534 /* I2S core */ 90#define BCMA_CORE_ALTA 0x534 /* I2S core */
@@ -177,6 +189,11 @@ struct bcma_host_ops {
177#define BCMA_PKG_ID_BCM5357 11 189#define BCMA_PKG_ID_BCM5357 11
178#define BCMA_CHIP_ID_BCM53572 53572 190#define BCMA_CHIP_ID_BCM53572 53572
179#define BCMA_PKG_ID_BCM47188 9 191#define BCMA_PKG_ID_BCM47188 9
192#define BCMA_CHIP_ID_BCM4707 53010
193#define BCMA_PKG_ID_BCM4707 1
194#define BCMA_PKG_ID_BCM4708 2
195#define BCMA_PKG_ID_BCM4709 0
196#define BCMA_CHIP_ID_BCM53018 53018
180 197
181/* Board types (on PCI usually equals to the subsystem dev id) */ 198/* Board types (on PCI usually equals to the subsystem dev id) */
182/* BCM4313 */ 199/* BCM4313 */
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index 424760f01b9d..d66033f418c9 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -181,10 +181,31 @@ struct pci_dev;
181 181
182#define BCMA_CORE_PCI_CFG_DEVCTRL 0xd8 182#define BCMA_CORE_PCI_CFG_DEVCTRL 0xd8
183 183
184#define BCMA_CORE_PCI_
185
186/* MDIO devices (SERDES modules) */
187#define BCMA_CORE_PCI_MDIO_IEEE0 0x000
188#define BCMA_CORE_PCI_MDIO_IEEE1 0x001
189#define BCMA_CORE_PCI_MDIO_BLK0 0x800
190#define BCMA_CORE_PCI_MDIO_BLK1 0x801
191#define BCMA_CORE_PCI_MDIO_BLK1_MGMT0 0x16
192#define BCMA_CORE_PCI_MDIO_BLK1_MGMT1 0x17
193#define BCMA_CORE_PCI_MDIO_BLK1_MGMT2 0x18
194#define BCMA_CORE_PCI_MDIO_BLK1_MGMT3 0x19
195#define BCMA_CORE_PCI_MDIO_BLK1_MGMT4 0x1A
196#define BCMA_CORE_PCI_MDIO_BLK2 0x802
197#define BCMA_CORE_PCI_MDIO_BLK3 0x803
198#define BCMA_CORE_PCI_MDIO_BLK4 0x804
199#define BCMA_CORE_PCI_MDIO_TXPLL 0x808 /* TXPLL register block idx */
200#define BCMA_CORE_PCI_MDIO_TXCTRL0 0x820
201#define BCMA_CORE_PCI_MDIO_SERDESID 0x831
202#define BCMA_CORE_PCI_MDIO_RXCTRL0 0x840
203
184/* PCIE Root Capability Register bits (Host mode only) */ 204/* PCIE Root Capability Register bits (Host mode only) */
185#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001 205#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001
186 206
187struct bcma_drv_pci; 207struct bcma_drv_pci;
208struct bcma_bus;
188 209
189#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE 210#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
190struct bcma_drv_pci_host { 211struct bcma_drv_pci_host {
@@ -219,7 +240,8 @@ struct bcma_drv_pci {
219extern void bcma_core_pci_init(struct bcma_drv_pci *pc); 240extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
220extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, 241extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
221 struct bcma_device *core, bool enable); 242 struct bcma_device *core, bool enable);
222extern void bcma_core_pci_extend_L1timer(struct bcma_drv_pci *pc, bool extend); 243extern void bcma_core_pci_up(struct bcma_bus *bus);
244extern void bcma_core_pci_down(struct bcma_bus *bus);
223 245
224extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev); 246extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
225extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev); 247extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 91fa9a94ae92..d77797a52b7b 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -36,6 +36,7 @@ enum bh_state_bits {
36 BH_Quiet, /* Buffer Error Prinks to be quiet */ 36 BH_Quiet, /* Buffer Error Prinks to be quiet */
37 BH_Meta, /* Buffer contains metadata */ 37 BH_Meta, /* Buffer contains metadata */
38 BH_Prio, /* Buffer should be submitted with REQ_PRIO */ 38 BH_Prio, /* Buffer should be submitted with REQ_PRIO */
39 BH_Defer_Completion, /* Defer AIO completion to workqueue */
39 40
40 BH_PrivateStart,/* not a state bit, but the first bit available 41 BH_PrivateStart,/* not a state bit, but the first bit available
41 * for private allocation by other entities 42 * for private allocation by other entities
@@ -128,6 +129,7 @@ BUFFER_FNS(Write_EIO, write_io_error)
128BUFFER_FNS(Unwritten, unwritten) 129BUFFER_FNS(Unwritten, unwritten)
129BUFFER_FNS(Meta, meta) 130BUFFER_FNS(Meta, meta)
130BUFFER_FNS(Prio, prio) 131BUFFER_FNS(Prio, prio)
132BUFFER_FNS(Defer_Completion, defer_completion)
131 133
132#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK) 134#define bh_offset(bh) ((unsigned long)(bh)->b_data & ~PAGE_MASK)
133 135
diff --git a/include/linux/can/platform/mcp251x.h b/include/linux/can/platform/mcp251x.h
index 089fe43211a4..dc029dba7a03 100644
--- a/include/linux/can/platform/mcp251x.h
+++ b/include/linux/can/platform/mcp251x.h
@@ -9,26 +9,13 @@
9 9
10#include <linux/spi/spi.h> 10#include <linux/spi/spi.h>
11 11
12/** 12/*
13 * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data 13 * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data
14 * @oscillator_frequency: - oscillator frequency in Hz 14 * @oscillator_frequency: - oscillator frequency in Hz
15 * @irq_flags: - IRQF configuration flags
16 * @board_specific_setup: - called before probing the chip (power,reset)
17 * @transceiver_enable: - called to power on/off the transceiver
18 * @power_enable: - called to power on/off the mcp *and* the
19 * transceiver
20 *
21 * Please note that you should define power_enable or transceiver_enable or
22 * none of them. Defining both of them is no use.
23 *
24 */ 15 */
25 16
26struct mcp251x_platform_data { 17struct mcp251x_platform_data {
27 unsigned long oscillator_frequency; 18 unsigned long oscillator_frequency;
28 unsigned long irq_flags;
29 int (*board_specific_setup)(struct spi_device *spi);
30 int (*transceiver_enable)(int enable);
31 int (*power_enable) (int enable);
32}; 19};
33 20
34#endif /* __CAN_PLATFORM_MCP251X_H__ */ 21#endif /* __CAN_PLATFORM_MCP251X_H__ */
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index e9ac882868c0..3561d305b1e0 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -66,22 +66,25 @@ enum cgroup_subsys_id {
66 66
67/* Per-subsystem/per-cgroup state maintained by the system. */ 67/* Per-subsystem/per-cgroup state maintained by the system. */
68struct cgroup_subsys_state { 68struct cgroup_subsys_state {
69 /* 69 /* the cgroup that this css is attached to */
70 * The cgroup that this subsystem is attached to. Useful
71 * for subsystems that want to know about the cgroup
72 * hierarchy structure
73 */
74 struct cgroup *cgroup; 70 struct cgroup *cgroup;
75 71
72 /* the cgroup subsystem that this css is attached to */
73 struct cgroup_subsys *ss;
74
76 /* reference count - access via css_[try]get() and css_put() */ 75 /* reference count - access via css_[try]get() and css_put() */
77 struct percpu_ref refcnt; 76 struct percpu_ref refcnt;
78 77
78 /* the parent css */
79 struct cgroup_subsys_state *parent;
80
79 unsigned long flags; 81 unsigned long flags;
80 /* ID for this css, if possible */ 82 /* ID for this css, if possible */
81 struct css_id __rcu *id; 83 struct css_id __rcu *id;
82 84
83 /* Used to put @cgroup->dentry on the last css_put() */ 85 /* percpu_ref killing and RCU release */
84 struct work_struct dput_work; 86 struct rcu_head rcu_head;
87 struct work_struct destroy_work;
85}; 88};
86 89
87/* bits in struct cgroup_subsys_state flags field */ 90/* bits in struct cgroup_subsys_state flags field */
@@ -161,7 +164,16 @@ struct cgroup_name {
161struct cgroup { 164struct cgroup {
162 unsigned long flags; /* "unsigned long" so bitops work */ 165 unsigned long flags; /* "unsigned long" so bitops work */
163 166
164 int id; /* ida allocated in-hierarchy ID */ 167 /*
168 * idr allocated in-hierarchy ID.
169 *
170 * The ID of the root cgroup is always 0, and a new cgroup
171 * will be assigned with a smallest available ID.
172 */
173 int id;
174
175 /* the number of attached css's */
176 int nr_css;
165 177
166 /* 178 /*
167 * We link our 'sibling' struct into our parent's 'children'. 179 * We link our 'sibling' struct into our parent's 'children'.
@@ -196,7 +208,7 @@ struct cgroup {
196 struct cgroup_name __rcu *name; 208 struct cgroup_name __rcu *name;
197 209
198 /* Private pointers for each registered subsystem */ 210 /* Private pointers for each registered subsystem */
199 struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; 211 struct cgroup_subsys_state __rcu *subsys[CGROUP_SUBSYS_COUNT];
200 212
201 struct cgroupfs_root *root; 213 struct cgroupfs_root *root;
202 214
@@ -220,10 +232,12 @@ struct cgroup {
220 struct list_head pidlists; 232 struct list_head pidlists;
221 struct mutex pidlist_mutex; 233 struct mutex pidlist_mutex;
222 234
235 /* dummy css with NULL ->ss, points back to this cgroup */
236 struct cgroup_subsys_state dummy_css;
237
223 /* For css percpu_ref killing and RCU-protected deletion */ 238 /* For css percpu_ref killing and RCU-protected deletion */
224 struct rcu_head rcu_head; 239 struct rcu_head rcu_head;
225 struct work_struct destroy_work; 240 struct work_struct destroy_work;
226 atomic_t css_kill_cnt;
227 241
228 /* List of events which userspace want to receive */ 242 /* List of events which userspace want to receive */
229 struct list_head event_list; 243 struct list_head event_list;
@@ -322,7 +336,7 @@ struct cgroupfs_root {
322 unsigned long flags; 336 unsigned long flags;
323 337
324 /* IDs for cgroups in this hierarchy */ 338 /* IDs for cgroups in this hierarchy */
325 struct ida cgroup_ida; 339 struct idr cgroup_idr;
326 340
327 /* The path to use for release notifications. */ 341 /* The path to use for release notifications. */
328 char release_agent_path[PATH_MAX]; 342 char release_agent_path[PATH_MAX];
@@ -394,9 +408,10 @@ struct cgroup_map_cb {
394 408
395/* cftype->flags */ 409/* cftype->flags */
396enum { 410enum {
397 CFTYPE_ONLY_ON_ROOT = (1 << 0), /* only create on root cg */ 411 CFTYPE_ONLY_ON_ROOT = (1 << 0), /* only create on root cgrp */
398 CFTYPE_NOT_ON_ROOT = (1 << 1), /* don't create on root cg */ 412 CFTYPE_NOT_ON_ROOT = (1 << 1), /* don't create on root cgrp */
399 CFTYPE_INSANE = (1 << 2), /* don't create if sane_behavior */ 413 CFTYPE_INSANE = (1 << 2), /* don't create if sane_behavior */
414 CFTYPE_NO_PREFIX = (1 << 3), /* (DON'T USE FOR NEW FILES) no subsys prefix */
400}; 415};
401 416
402#define MAX_CFTYPE_NAME 64 417#define MAX_CFTYPE_NAME 64
@@ -424,35 +439,41 @@ struct cftype {
424 /* CFTYPE_* flags */ 439 /* CFTYPE_* flags */
425 unsigned int flags; 440 unsigned int flags;
426 441
442 /*
443 * The subsys this file belongs to. Initialized automatically
444 * during registration. NULL for cgroup core files.
445 */
446 struct cgroup_subsys *ss;
447
427 int (*open)(struct inode *inode, struct file *file); 448 int (*open)(struct inode *inode, struct file *file);
428 ssize_t (*read)(struct cgroup *cgrp, struct cftype *cft, 449 ssize_t (*read)(struct cgroup_subsys_state *css, struct cftype *cft,
429 struct file *file, 450 struct file *file,
430 char __user *buf, size_t nbytes, loff_t *ppos); 451 char __user *buf, size_t nbytes, loff_t *ppos);
431 /* 452 /*
432 * read_u64() is a shortcut for the common case of returning a 453 * read_u64() is a shortcut for the common case of returning a
433 * single integer. Use it in place of read() 454 * single integer. Use it in place of read()
434 */ 455 */
435 u64 (*read_u64)(struct cgroup *cgrp, struct cftype *cft); 456 u64 (*read_u64)(struct cgroup_subsys_state *css, struct cftype *cft);
436 /* 457 /*
437 * read_s64() is a signed version of read_u64() 458 * read_s64() is a signed version of read_u64()
438 */ 459 */
439 s64 (*read_s64)(struct cgroup *cgrp, struct cftype *cft); 460 s64 (*read_s64)(struct cgroup_subsys_state *css, struct cftype *cft);
440 /* 461 /*
441 * read_map() is used for defining a map of key/value 462 * read_map() is used for defining a map of key/value
442 * pairs. It should call cb->fill(cb, key, value) for each 463 * pairs. It should call cb->fill(cb, key, value) for each
443 * entry. The key/value pairs (and their ordering) should not 464 * entry. The key/value pairs (and their ordering) should not
444 * change between reboots. 465 * change between reboots.
445 */ 466 */
446 int (*read_map)(struct cgroup *cgrp, struct cftype *cft, 467 int (*read_map)(struct cgroup_subsys_state *css, struct cftype *cft,
447 struct cgroup_map_cb *cb); 468 struct cgroup_map_cb *cb);
448 /* 469 /*
449 * read_seq_string() is used for outputting a simple sequence 470 * read_seq_string() is used for outputting a simple sequence
450 * using seqfile. 471 * using seqfile.
451 */ 472 */
452 int (*read_seq_string)(struct cgroup *cgrp, struct cftype *cft, 473 int (*read_seq_string)(struct cgroup_subsys_state *css,
453 struct seq_file *m); 474 struct cftype *cft, struct seq_file *m);
454 475
455 ssize_t (*write)(struct cgroup *cgrp, struct cftype *cft, 476 ssize_t (*write)(struct cgroup_subsys_state *css, struct cftype *cft,
456 struct file *file, 477 struct file *file,
457 const char __user *buf, size_t nbytes, loff_t *ppos); 478 const char __user *buf, size_t nbytes, loff_t *ppos);
458 479
@@ -461,18 +482,20 @@ struct cftype {
461 * a single integer (as parsed by simple_strtoull) from 482 * a single integer (as parsed by simple_strtoull) from
462 * userspace. Use in place of write(); return 0 or error. 483 * userspace. Use in place of write(); return 0 or error.
463 */ 484 */
464 int (*write_u64)(struct cgroup *cgrp, struct cftype *cft, u64 val); 485 int (*write_u64)(struct cgroup_subsys_state *css, struct cftype *cft,
486 u64 val);
465 /* 487 /*
466 * write_s64() is a signed version of write_u64() 488 * write_s64() is a signed version of write_u64()
467 */ 489 */
468 int (*write_s64)(struct cgroup *cgrp, struct cftype *cft, s64 val); 490 int (*write_s64)(struct cgroup_subsys_state *css, struct cftype *cft,
491 s64 val);
469 492
470 /* 493 /*
471 * write_string() is passed a nul-terminated kernelspace 494 * write_string() is passed a nul-terminated kernelspace
472 * buffer of maximum length determined by max_write_len. 495 * buffer of maximum length determined by max_write_len.
473 * Returns 0 or -ve error code. 496 * Returns 0 or -ve error code.
474 */ 497 */
475 int (*write_string)(struct cgroup *cgrp, struct cftype *cft, 498 int (*write_string)(struct cgroup_subsys_state *css, struct cftype *cft,
476 const char *buffer); 499 const char *buffer);
477 /* 500 /*
478 * trigger() callback can be used to get some kick from the 501 * trigger() callback can be used to get some kick from the
@@ -480,7 +503,7 @@ struct cftype {
480 * at all. The private field can be used to determine the 503 * at all. The private field can be used to determine the
481 * kick type for multiplexing. 504 * kick type for multiplexing.
482 */ 505 */
483 int (*trigger)(struct cgroup *cgrp, unsigned int event); 506 int (*trigger)(struct cgroup_subsys_state *css, unsigned int event);
484 507
485 int (*release)(struct inode *inode, struct file *file); 508 int (*release)(struct inode *inode, struct file *file);
486 509
@@ -490,16 +513,18 @@ struct cftype {
490 * you want to provide this functionality. Use eventfd_signal() 513 * you want to provide this functionality. Use eventfd_signal()
491 * on eventfd to send notification to userspace. 514 * on eventfd to send notification to userspace.
492 */ 515 */
493 int (*register_event)(struct cgroup *cgrp, struct cftype *cft, 516 int (*register_event)(struct cgroup_subsys_state *css,
494 struct eventfd_ctx *eventfd, const char *args); 517 struct cftype *cft, struct eventfd_ctx *eventfd,
518 const char *args);
495 /* 519 /*
496 * unregister_event() callback will be called when userspace 520 * unregister_event() callback will be called when userspace
497 * closes the eventfd or on cgroup removing. 521 * closes the eventfd or on cgroup removing.
498 * This callback must be implemented, if you want provide 522 * This callback must be implemented, if you want provide
499 * notification functionality. 523 * notification functionality.
500 */ 524 */
501 void (*unregister_event)(struct cgroup *cgrp, struct cftype *cft, 525 void (*unregister_event)(struct cgroup_subsys_state *css,
502 struct eventfd_ctx *eventfd); 526 struct cftype *cft,
527 struct eventfd_ctx *eventfd);
503}; 528};
504 529
505/* 530/*
@@ -512,15 +537,6 @@ struct cftype_set {
512 struct cftype *cfts; 537 struct cftype *cfts;
513}; 538};
514 539
515struct cgroup_scanner {
516 struct cgroup *cg;
517 int (*test_task)(struct task_struct *p, struct cgroup_scanner *scan);
518 void (*process_task)(struct task_struct *p,
519 struct cgroup_scanner *scan);
520 struct ptr_heap *heap;
521 void *data;
522};
523
524/* 540/*
525 * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This 541 * See the comment above CGRP_ROOT_SANE_BEHAVIOR for details. This
526 * function can be called as long as @cgrp is accessible. 542 * function can be called as long as @cgrp is accessible.
@@ -537,7 +553,7 @@ static inline const char *cgroup_name(const struct cgroup *cgrp)
537} 553}
538 554
539int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); 555int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts);
540int cgroup_rm_cftypes(struct cgroup_subsys *ss, struct cftype *cfts); 556int cgroup_rm_cftypes(struct cftype *cfts);
541 557
542bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor); 558bool cgroup_is_descendant(struct cgroup *cgrp, struct cgroup *ancestor);
543 559
@@ -553,20 +569,22 @@ int cgroup_task_count(const struct cgroup *cgrp);
553struct cgroup_taskset; 569struct cgroup_taskset;
554struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset); 570struct task_struct *cgroup_taskset_first(struct cgroup_taskset *tset);
555struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset); 571struct task_struct *cgroup_taskset_next(struct cgroup_taskset *tset);
556struct cgroup *cgroup_taskset_cur_cgroup(struct cgroup_taskset *tset); 572struct cgroup_subsys_state *cgroup_taskset_cur_css(struct cgroup_taskset *tset,
573 int subsys_id);
557int cgroup_taskset_size(struct cgroup_taskset *tset); 574int cgroup_taskset_size(struct cgroup_taskset *tset);
558 575
559/** 576/**
560 * cgroup_taskset_for_each - iterate cgroup_taskset 577 * cgroup_taskset_for_each - iterate cgroup_taskset
561 * @task: the loop cursor 578 * @task: the loop cursor
562 * @skip_cgrp: skip if task's cgroup matches this, %NULL to iterate through all 579 * @skip_css: skip if task's css matches this, %NULL to iterate through all
563 * @tset: taskset to iterate 580 * @tset: taskset to iterate
564 */ 581 */
565#define cgroup_taskset_for_each(task, skip_cgrp, tset) \ 582#define cgroup_taskset_for_each(task, skip_css, tset) \
566 for ((task) = cgroup_taskset_first((tset)); (task); \ 583 for ((task) = cgroup_taskset_first((tset)); (task); \
567 (task) = cgroup_taskset_next((tset))) \ 584 (task) = cgroup_taskset_next((tset))) \
568 if (!(skip_cgrp) || \ 585 if (!(skip_css) || \
569 cgroup_taskset_cur_cgroup((tset)) != (skip_cgrp)) 586 cgroup_taskset_cur_css((tset), \
587 (skip_css)->ss->subsys_id) != (skip_css))
570 588
571/* 589/*
572 * Control Group subsystem type. 590 * Control Group subsystem type.
@@ -574,18 +592,22 @@ int cgroup_taskset_size(struct cgroup_taskset *tset);
574 */ 592 */
575 593
576struct cgroup_subsys { 594struct cgroup_subsys {
577 struct cgroup_subsys_state *(*css_alloc)(struct cgroup *cgrp); 595 struct cgroup_subsys_state *(*css_alloc)(struct cgroup_subsys_state *parent_css);
578 int (*css_online)(struct cgroup *cgrp); 596 int (*css_online)(struct cgroup_subsys_state *css);
579 void (*css_offline)(struct cgroup *cgrp); 597 void (*css_offline)(struct cgroup_subsys_state *css);
580 void (*css_free)(struct cgroup *cgrp); 598 void (*css_free)(struct cgroup_subsys_state *css);
581 599
582 int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 600 int (*can_attach)(struct cgroup_subsys_state *css,
583 void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 601 struct cgroup_taskset *tset);
584 void (*attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 602 void (*cancel_attach)(struct cgroup_subsys_state *css,
603 struct cgroup_taskset *tset);
604 void (*attach)(struct cgroup_subsys_state *css,
605 struct cgroup_taskset *tset);
585 void (*fork)(struct task_struct *task); 606 void (*fork)(struct task_struct *task);
586 void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp, 607 void (*exit)(struct cgroup_subsys_state *css,
608 struct cgroup_subsys_state *old_css,
587 struct task_struct *task); 609 struct task_struct *task);
588 void (*bind)(struct cgroup *root); 610 void (*bind)(struct cgroup_subsys_state *root_css);
589 611
590 int subsys_id; 612 int subsys_id;
591 int disabled; 613 int disabled;
@@ -641,10 +663,17 @@ struct cgroup_subsys {
641#undef IS_SUBSYS_ENABLED 663#undef IS_SUBSYS_ENABLED
642#undef SUBSYS 664#undef SUBSYS
643 665
644static inline struct cgroup_subsys_state *cgroup_subsys_state( 666/**
645 struct cgroup *cgrp, int subsys_id) 667 * css_parent - find the parent css
668 * @css: the target cgroup_subsys_state
669 *
670 * Return the parent css of @css. This function is guaranteed to return
671 * non-NULL parent as long as @css isn't the root.
672 */
673static inline
674struct cgroup_subsys_state *css_parent(struct cgroup_subsys_state *css)
646{ 675{
647 return cgrp->subsys[subsys_id]; 676 return css->parent;
648} 677}
649 678
650/** 679/**
@@ -672,7 +701,7 @@ extern struct mutex cgroup_mutex;
672#endif 701#endif
673 702
674/** 703/**
675 * task_subsys_state_check - obtain css for (task, subsys) w/ extra access conds 704 * task_css_check - obtain css for (task, subsys) w/ extra access conds
676 * @task: the target task 705 * @task: the target task
677 * @subsys_id: the target subsystem ID 706 * @subsys_id: the target subsystem ID
678 * @__c: extra condition expression to be passed to rcu_dereference_check() 707 * @__c: extra condition expression to be passed to rcu_dereference_check()
@@ -680,7 +709,7 @@ extern struct mutex cgroup_mutex;
680 * Return the cgroup_subsys_state for the (@task, @subsys_id) pair. The 709 * Return the cgroup_subsys_state for the (@task, @subsys_id) pair. The
681 * synchronization rules are the same as task_css_set_check(). 710 * synchronization rules are the same as task_css_set_check().
682 */ 711 */
683#define task_subsys_state_check(task, subsys_id, __c) \ 712#define task_css_check(task, subsys_id, __c) \
684 task_css_set_check((task), (__c))->subsys[(subsys_id)] 713 task_css_set_check((task), (__c))->subsys[(subsys_id)]
685 714
686/** 715/**
@@ -695,87 +724,92 @@ static inline struct css_set *task_css_set(struct task_struct *task)
695} 724}
696 725
697/** 726/**
698 * task_subsys_state - obtain css for (task, subsys) 727 * task_css - obtain css for (task, subsys)
699 * @task: the target task 728 * @task: the target task
700 * @subsys_id: the target subsystem ID 729 * @subsys_id: the target subsystem ID
701 * 730 *
702 * See task_subsys_state_check(). 731 * See task_css_check().
703 */ 732 */
704static inline struct cgroup_subsys_state * 733static inline struct cgroup_subsys_state *task_css(struct task_struct *task,
705task_subsys_state(struct task_struct *task, int subsys_id) 734 int subsys_id)
706{ 735{
707 return task_subsys_state_check(task, subsys_id, false); 736 return task_css_check(task, subsys_id, false);
708} 737}
709 738
710static inline struct cgroup* task_cgroup(struct task_struct *task, 739static inline struct cgroup *task_cgroup(struct task_struct *task,
711 int subsys_id) 740 int subsys_id)
712{ 741{
713 return task_subsys_state(task, subsys_id)->cgroup; 742 return task_css(task, subsys_id)->cgroup;
714} 743}
715 744
716struct cgroup *cgroup_next_sibling(struct cgroup *pos); 745struct cgroup_subsys_state *css_next_child(struct cgroup_subsys_state *pos,
746 struct cgroup_subsys_state *parent);
747
748struct cgroup_subsys_state *css_from_id(int id, struct cgroup_subsys *ss);
717 749
718/** 750/**
719 * cgroup_for_each_child - iterate through children of a cgroup 751 * css_for_each_child - iterate through children of a css
720 * @pos: the cgroup * to use as the loop cursor 752 * @pos: the css * to use as the loop cursor
721 * @cgrp: cgroup whose children to walk 753 * @parent: css whose children to walk
722 * 754 *
723 * Walk @cgrp's children. Must be called under rcu_read_lock(). A child 755 * Walk @parent's children. Must be called under rcu_read_lock(). A child
724 * cgroup which hasn't finished ->css_online() or already has finished 756 * css which hasn't finished ->css_online() or already has finished
725 * ->css_offline() may show up during traversal and it's each subsystem's 757 * ->css_offline() may show up during traversal and it's each subsystem's
726 * responsibility to verify that each @pos is alive. 758 * responsibility to verify that each @pos is alive.
727 * 759 *
728 * If a subsystem synchronizes against the parent in its ->css_online() and 760 * If a subsystem synchronizes against the parent in its ->css_online() and
729 * before starting iterating, a cgroup which finished ->css_online() is 761 * before starting iterating, a css which finished ->css_online() is
730 * guaranteed to be visible in the future iterations. 762 * guaranteed to be visible in the future iterations.
731 * 763 *
732 * It is allowed to temporarily drop RCU read lock during iteration. The 764 * It is allowed to temporarily drop RCU read lock during iteration. The
733 * caller is responsible for ensuring that @pos remains accessible until 765 * caller is responsible for ensuring that @pos remains accessible until
734 * the start of the next iteration by, for example, bumping the css refcnt. 766 * the start of the next iteration by, for example, bumping the css refcnt.
735 */ 767 */
736#define cgroup_for_each_child(pos, cgrp) \ 768#define css_for_each_child(pos, parent) \
737 for ((pos) = list_first_or_null_rcu(&(cgrp)->children, \ 769 for ((pos) = css_next_child(NULL, (parent)); (pos); \
738 struct cgroup, sibling); \ 770 (pos) = css_next_child((pos), (parent)))
739 (pos); (pos) = cgroup_next_sibling((pos))) 771
772struct cgroup_subsys_state *
773css_next_descendant_pre(struct cgroup_subsys_state *pos,
774 struct cgroup_subsys_state *css);
740 775
741struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos, 776struct cgroup_subsys_state *
742 struct cgroup *cgroup); 777css_rightmost_descendant(struct cgroup_subsys_state *pos);
743struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos);
744 778
745/** 779/**
746 * cgroup_for_each_descendant_pre - pre-order walk of a cgroup's descendants 780 * css_for_each_descendant_pre - pre-order walk of a css's descendants
747 * @pos: the cgroup * to use as the loop cursor 781 * @pos: the css * to use as the loop cursor
748 * @cgroup: cgroup whose descendants to walk 782 * @root: css whose descendants to walk
749 * 783 *
750 * Walk @cgroup's descendants. Must be called under rcu_read_lock(). A 784 * Walk @root's descendants. @root is included in the iteration and the
751 * descendant cgroup which hasn't finished ->css_online() or already has 785 * first node to be visited. Must be called under rcu_read_lock(). A
786 * descendant css which hasn't finished ->css_online() or already has
752 * finished ->css_offline() may show up during traversal and it's each 787 * finished ->css_offline() may show up during traversal and it's each
753 * subsystem's responsibility to verify that each @pos is alive. 788 * subsystem's responsibility to verify that each @pos is alive.
754 * 789 *
755 * If a subsystem synchronizes against the parent in its ->css_online() and 790 * If a subsystem synchronizes against the parent in its ->css_online() and
756 * before starting iterating, and synchronizes against @pos on each 791 * before starting iterating, and synchronizes against @pos on each
757 * iteration, any descendant cgroup which finished ->css_online() is 792 * iteration, any descendant css which finished ->css_online() is
758 * guaranteed to be visible in the future iterations. 793 * guaranteed to be visible in the future iterations.
759 * 794 *
760 * In other words, the following guarantees that a descendant can't escape 795 * In other words, the following guarantees that a descendant can't escape
761 * state updates of its ancestors. 796 * state updates of its ancestors.
762 * 797 *
763 * my_online(@cgrp) 798 * my_online(@css)
764 * { 799 * {
765 * Lock @cgrp->parent and @cgrp; 800 * Lock @css's parent and @css;
766 * Inherit state from @cgrp->parent; 801 * Inherit state from the parent;
767 * Unlock both. 802 * Unlock both.
768 * } 803 * }
769 * 804 *
770 * my_update_state(@cgrp) 805 * my_update_state(@css)
771 * { 806 * {
772 * Lock @cgrp; 807 * css_for_each_descendant_pre(@pos, @css) {
773 * Update @cgrp's state;
774 * Unlock @cgrp;
775 *
776 * cgroup_for_each_descendant_pre(@pos, @cgrp) {
777 * Lock @pos; 808 * Lock @pos;
778 * Verify @pos is alive and inherit state from @pos->parent; 809 * if (@pos == @css)
810 * Update @css's state;
811 * else
812 * Verify @pos is alive and inherit state from its parent;
779 * Unlock @pos; 813 * Unlock @pos;
780 * } 814 * }
781 * } 815 * }
@@ -786,8 +820,7 @@ struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos);
786 * visible by walking order and, as long as inheriting operations to the 820 * visible by walking order and, as long as inheriting operations to the
787 * same @pos are atomic to each other, multiple updates racing each other 821 * same @pos are atomic to each other, multiple updates racing each other
788 * still result in the correct state. It's guaranateed that at least one 822 * still result in the correct state. It's guaranateed that at least one
789 * inheritance happens for any cgroup after the latest update to its 823 * inheritance happens for any css after the latest update to its parent.
790 * parent.
791 * 824 *
792 * If checking parent's state requires locking the parent, each inheriting 825 * If checking parent's state requires locking the parent, each inheriting
793 * iteration should lock and unlock both @pos->parent and @pos. 826 * iteration should lock and unlock both @pos->parent and @pos.
@@ -800,52 +833,45 @@ struct cgroup *cgroup_rightmost_descendant(struct cgroup *pos);
800 * caller is responsible for ensuring that @pos remains accessible until 833 * caller is responsible for ensuring that @pos remains accessible until
801 * the start of the next iteration by, for example, bumping the css refcnt. 834 * the start of the next iteration by, for example, bumping the css refcnt.
802 */ 835 */
803#define cgroup_for_each_descendant_pre(pos, cgroup) \ 836#define css_for_each_descendant_pre(pos, css) \
804 for (pos = cgroup_next_descendant_pre(NULL, (cgroup)); (pos); \ 837 for ((pos) = css_next_descendant_pre(NULL, (css)); (pos); \
805 pos = cgroup_next_descendant_pre((pos), (cgroup))) 838 (pos) = css_next_descendant_pre((pos), (css)))
806 839
807struct cgroup *cgroup_next_descendant_post(struct cgroup *pos, 840struct cgroup_subsys_state *
808 struct cgroup *cgroup); 841css_next_descendant_post(struct cgroup_subsys_state *pos,
842 struct cgroup_subsys_state *css);
809 843
810/** 844/**
811 * cgroup_for_each_descendant_post - post-order walk of a cgroup's descendants 845 * css_for_each_descendant_post - post-order walk of a css's descendants
812 * @pos: the cgroup * to use as the loop cursor 846 * @pos: the css * to use as the loop cursor
813 * @cgroup: cgroup whose descendants to walk 847 * @css: css whose descendants to walk
814 * 848 *
815 * Similar to cgroup_for_each_descendant_pre() but performs post-order 849 * Similar to css_for_each_descendant_pre() but performs post-order
816 * traversal instead. Note that the walk visibility guarantee described in 850 * traversal instead. @root is included in the iteration and the last
817 * pre-order walk doesn't apply the same to post-order walks. 851 * node to be visited. Note that the walk visibility guarantee described
852 * in pre-order walk doesn't apply the same to post-order walks.
818 */ 853 */
819#define cgroup_for_each_descendant_post(pos, cgroup) \ 854#define css_for_each_descendant_post(pos, css) \
820 for (pos = cgroup_next_descendant_post(NULL, (cgroup)); (pos); \ 855 for ((pos) = css_next_descendant_post(NULL, (css)); (pos); \
821 pos = cgroup_next_descendant_post((pos), (cgroup))) 856 (pos) = css_next_descendant_post((pos), (css)))
822 857
823/* A cgroup_iter should be treated as an opaque object */ 858/* A css_task_iter should be treated as an opaque object */
824struct cgroup_iter { 859struct css_task_iter {
825 struct list_head *cset_link; 860 struct cgroup_subsys_state *origin_css;
826 struct list_head *task; 861 struct list_head *cset_link;
862 struct list_head *task;
827}; 863};
828 864
829/* 865void css_task_iter_start(struct cgroup_subsys_state *css,
830 * To iterate across the tasks in a cgroup: 866 struct css_task_iter *it);
831 * 867struct task_struct *css_task_iter_next(struct css_task_iter *it);
832 * 1) call cgroup_iter_start to initialize an iterator 868void css_task_iter_end(struct css_task_iter *it);
833 * 869
834 * 2) call cgroup_iter_next() to retrieve member tasks until it 870int css_scan_tasks(struct cgroup_subsys_state *css,
835 * returns NULL or until you want to end the iteration 871 bool (*test)(struct task_struct *, void *),
836 * 872 void (*process)(struct task_struct *, void *),
837 * 3) call cgroup_iter_end() to destroy the iterator. 873 void *data, struct ptr_heap *heap);
838 * 874
839 * Or, call cgroup_scan_tasks() to iterate through every task in a
840 * cgroup - cgroup_scan_tasks() holds the css_set_lock when calling
841 * the test_task() callback, but not while calling the process_task()
842 * callback.
843 */
844void cgroup_iter_start(struct cgroup *cgrp, struct cgroup_iter *it);
845struct task_struct *cgroup_iter_next(struct cgroup *cgrp,
846 struct cgroup_iter *it);
847void cgroup_iter_end(struct cgroup *cgrp, struct cgroup_iter *it);
848int cgroup_scan_tasks(struct cgroup_scanner *scan);
849int cgroup_attach_task_all(struct task_struct *from, struct task_struct *); 875int cgroup_attach_task_all(struct task_struct *from, struct task_struct *);
850int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from); 876int cgroup_transfer_tasks(struct cgroup *to, struct cgroup *from);
851 877
@@ -878,7 +904,8 @@ bool css_is_ancestor(struct cgroup_subsys_state *cg,
878 904
879/* Get id and depth of css */ 905/* Get id and depth of css */
880unsigned short css_id(struct cgroup_subsys_state *css); 906unsigned short css_id(struct cgroup_subsys_state *css);
881struct cgroup_subsys_state *cgroup_css_from_dir(struct file *f, int id); 907struct cgroup_subsys_state *css_from_dir(struct dentry *dentry,
908 struct cgroup_subsys *ss);
882 909
883#else /* !CONFIG_CGROUPS */ 910#else /* !CONFIG_CGROUPS */
884 911
diff --git a/include/linux/coda.h b/include/linux/coda.h
index cff544f81105..d30209b9cef8 100644
--- a/include/linux/coda.h
+++ b/include/linux/coda.h
@@ -60,7 +60,6 @@ Mellon the rights to redistribute these changes without encumbrance.
60 60
61#if defined(__linux__) 61#if defined(__linux__)
62typedef unsigned long long u_quad_t; 62typedef unsigned long long u_quad_t;
63#else
64#endif 63#endif
65#include <uapi/linux/coda.h> 64#include <uapi/linux/coda.h>
66#endif 65#endif
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 7f0c1dd09079..ec1aee4aec9c 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -669,6 +669,13 @@ asmlinkage long compat_sys_sigaltstack(const compat_stack_t __user *uss_ptr,
669 669
670int compat_restore_altstack(const compat_stack_t __user *uss); 670int compat_restore_altstack(const compat_stack_t __user *uss);
671int __compat_save_altstack(compat_stack_t __user *, unsigned long); 671int __compat_save_altstack(compat_stack_t __user *, unsigned long);
672#define compat_save_altstack_ex(uss, sp) do { \
673 compat_stack_t __user *__uss = uss; \
674 struct task_struct *t = current; \
675 put_user_ex(ptr_to_compat((void __user *)t->sas_ss_sp), &__uss->ss_sp); \
676 put_user_ex(sas_ss_flags(sp), &__uss->ss_flags); \
677 put_user_ex(t->sas_ss_size, &__uss->ss_size); \
678} while (0);
672 679
673asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, 680asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid,
674 struct compat_timespec __user *interval); 681 struct compat_timespec __user *interval);
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
index fc09d7b0dacf..158158704c30 100644
--- a/include/linux/context_tracking.h
+++ b/include/linux/context_tracking.h
@@ -2,100 +2,110 @@
2#define _LINUX_CONTEXT_TRACKING_H 2#define _LINUX_CONTEXT_TRACKING_H
3 3
4#include <linux/sched.h> 4#include <linux/sched.h>
5#include <linux/percpu.h>
6#include <linux/vtime.h> 5#include <linux/vtime.h>
6#include <linux/context_tracking_state.h>
7#include <asm/ptrace.h> 7#include <asm/ptrace.h>
8 8
9struct context_tracking {
10 /*
11 * When active is false, probes are unset in order
12 * to minimize overhead: TIF flags are cleared
13 * and calls to user_enter/exit are ignored. This
14 * may be further optimized using static keys.
15 */
16 bool active;
17 enum ctx_state {
18 IN_KERNEL = 0,
19 IN_USER,
20 } state;
21};
22
23static inline void __guest_enter(void)
24{
25 /*
26 * This is running in ioctl context so we can avoid
27 * the call to vtime_account() with its unnecessary idle check.
28 */
29 vtime_account_system(current);
30 current->flags |= PF_VCPU;
31}
32
33static inline void __guest_exit(void)
34{
35 /*
36 * This is running in ioctl context so we can avoid
37 * the call to vtime_account() with its unnecessary idle check.
38 */
39 vtime_account_system(current);
40 current->flags &= ~PF_VCPU;
41}
42 9
43#ifdef CONFIG_CONTEXT_TRACKING 10#ifdef CONFIG_CONTEXT_TRACKING
44DECLARE_PER_CPU(struct context_tracking, context_tracking); 11extern void context_tracking_cpu_set(int cpu);
45 12
46static inline bool context_tracking_in_user(void) 13extern void context_tracking_user_enter(void);
14extern void context_tracking_user_exit(void);
15extern void __context_tracking_task_switch(struct task_struct *prev,
16 struct task_struct *next);
17
18static inline void user_enter(void)
47{ 19{
48 return __this_cpu_read(context_tracking.state) == IN_USER; 20 if (static_key_false(&context_tracking_enabled))
49} 21 context_tracking_user_enter();
50 22
51static inline bool context_tracking_active(void) 23}
24static inline void user_exit(void)
52{ 25{
53 return __this_cpu_read(context_tracking.active); 26 if (static_key_false(&context_tracking_enabled))
27 context_tracking_user_exit();
54} 28}
55 29
56extern void user_enter(void);
57extern void user_exit(void);
58
59extern void guest_enter(void);
60extern void guest_exit(void);
61
62static inline enum ctx_state exception_enter(void) 30static inline enum ctx_state exception_enter(void)
63{ 31{
64 enum ctx_state prev_ctx; 32 enum ctx_state prev_ctx;
65 33
34 if (!static_key_false(&context_tracking_enabled))
35 return 0;
36
66 prev_ctx = this_cpu_read(context_tracking.state); 37 prev_ctx = this_cpu_read(context_tracking.state);
67 user_exit(); 38 context_tracking_user_exit();
68 39
69 return prev_ctx; 40 return prev_ctx;
70} 41}
71 42
72static inline void exception_exit(enum ctx_state prev_ctx) 43static inline void exception_exit(enum ctx_state prev_ctx)
73{ 44{
74 if (prev_ctx == IN_USER) 45 if (static_key_false(&context_tracking_enabled)) {
75 user_enter(); 46 if (prev_ctx == IN_USER)
47 context_tracking_user_enter();
48 }
76} 49}
77 50
78extern void context_tracking_task_switch(struct task_struct *prev, 51static inline void context_tracking_task_switch(struct task_struct *prev,
79 struct task_struct *next); 52 struct task_struct *next)
53{
54 if (static_key_false(&context_tracking_enabled))
55 __context_tracking_task_switch(prev, next);
56}
80#else 57#else
81static inline bool context_tracking_in_user(void) { return false; }
82static inline void user_enter(void) { } 58static inline void user_enter(void) { }
83static inline void user_exit(void) { } 59static inline void user_exit(void) { }
60static inline enum ctx_state exception_enter(void) { return 0; }
61static inline void exception_exit(enum ctx_state prev_ctx) { }
62static inline void context_tracking_task_switch(struct task_struct *prev,
63 struct task_struct *next) { }
64#endif /* !CONFIG_CONTEXT_TRACKING */
65
66
67#ifdef CONFIG_CONTEXT_TRACKING_FORCE
68extern void context_tracking_init(void);
69#else
70static inline void context_tracking_init(void) { }
71#endif /* CONFIG_CONTEXT_TRACKING_FORCE */
72
84 73
74#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
85static inline void guest_enter(void) 75static inline void guest_enter(void)
86{ 76{
87 __guest_enter(); 77 if (vtime_accounting_enabled())
78 vtime_guest_enter(current);
79 else
80 current->flags |= PF_VCPU;
88} 81}
89 82
90static inline void guest_exit(void) 83static inline void guest_exit(void)
91{ 84{
92 __guest_exit(); 85 if (vtime_accounting_enabled())
86 vtime_guest_exit(current);
87 else
88 current->flags &= ~PF_VCPU;
93} 89}
94 90
95static inline enum ctx_state exception_enter(void) { return 0; } 91#else
96static inline void exception_exit(enum ctx_state prev_ctx) { } 92static inline void guest_enter(void)
97static inline void context_tracking_task_switch(struct task_struct *prev, 93{
98 struct task_struct *next) { } 94 /*
99#endif /* !CONFIG_CONTEXT_TRACKING */ 95 * This is running in ioctl context so its safe
96 * to assume that it's the stime pending cputime
97 * to flush.
98 */
99 vtime_account_system(current);
100 current->flags |= PF_VCPU;
101}
102
103static inline void guest_exit(void)
104{
105 /* Flush the guest cputime we spent on the guest */
106 vtime_account_system(current);
107 current->flags &= ~PF_VCPU;
108}
109#endif /* CONFIG_VIRT_CPU_ACCOUNTING_GEN */
100 110
101#endif 111#endif
diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h
new file mode 100644
index 000000000000..0f1979d0674f
--- /dev/null
+++ b/include/linux/context_tracking_state.h
@@ -0,0 +1,39 @@
1#ifndef _LINUX_CONTEXT_TRACKING_STATE_H
2#define _LINUX_CONTEXT_TRACKING_STATE_H
3
4#include <linux/percpu.h>
5#include <linux/static_key.h>
6
7struct context_tracking {
8 /*
9 * When active is false, probes are unset in order
10 * to minimize overhead: TIF flags are cleared
11 * and calls to user_enter/exit are ignored. This
12 * may be further optimized using static keys.
13 */
14 bool active;
15 enum ctx_state {
16 IN_KERNEL = 0,
17 IN_USER,
18 } state;
19};
20
21#ifdef CONFIG_CONTEXT_TRACKING
22extern struct static_key context_tracking_enabled;
23DECLARE_PER_CPU(struct context_tracking, context_tracking);
24
25static inline bool context_tracking_in_user(void)
26{
27 return __this_cpu_read(context_tracking.state) == IN_USER;
28}
29
30static inline bool context_tracking_active(void)
31{
32 return __this_cpu_read(context_tracking.active);
33}
34#else
35static inline bool context_tracking_in_user(void) { return false; }
36static inline bool context_tracking_active(void) { return false; }
37#endif /* CONFIG_CONTEXT_TRACKING */
38
39#endif
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index ab0eade73039..801ff9e73679 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -28,6 +28,7 @@ struct cpu {
28extern int register_cpu(struct cpu *cpu, int num); 28extern int register_cpu(struct cpu *cpu, int num);
29extern struct device *get_cpu_device(unsigned cpu); 29extern struct device *get_cpu_device(unsigned cpu);
30extern bool cpu_is_hotpluggable(unsigned cpu); 30extern bool cpu_is_hotpluggable(unsigned cpu);
31extern bool arch_match_cpu_phys_id(int cpu, u64 phys_id);
31 32
32extern int cpu_add_dev_attr(struct device_attribute *attr); 33extern int cpu_add_dev_attr(struct device_attribute *attr);
33extern void cpu_remove_dev_attr(struct device_attribute *attr); 34extern void cpu_remove_dev_attr(struct device_attribute *attr);
@@ -172,6 +173,8 @@ extern struct bus_type cpu_subsys;
172#ifdef CONFIG_HOTPLUG_CPU 173#ifdef CONFIG_HOTPLUG_CPU
173/* Stop CPUs going up and down. */ 174/* Stop CPUs going up and down. */
174 175
176extern void cpu_hotplug_begin(void);
177extern void cpu_hotplug_done(void);
175extern void get_online_cpus(void); 178extern void get_online_cpus(void);
176extern void put_online_cpus(void); 179extern void put_online_cpus(void);
177extern void cpu_hotplug_disable(void); 180extern void cpu_hotplug_disable(void);
@@ -197,6 +200,8 @@ static inline void cpu_hotplug_driver_unlock(void)
197 200
198#else /* CONFIG_HOTPLUG_CPU */ 201#else /* CONFIG_HOTPLUG_CPU */
199 202
203static inline void cpu_hotplug_begin(void) {}
204static inline void cpu_hotplug_done(void) {}
200#define get_online_cpus() do { } while (0) 205#define get_online_cpus() do { } while (0)
201#define put_online_cpus() do { } while (0) 206#define put_online_cpus() do { } while (0)
202#define cpu_hotplug_disable() do { } while (0) 207#define cpu_hotplug_disable() do { } while (0)
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 90d5a15120d5..d568f3975eeb 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -11,71 +11,36 @@
11#ifndef _LINUX_CPUFREQ_H 11#ifndef _LINUX_CPUFREQ_H
12#define _LINUX_CPUFREQ_H 12#define _LINUX_CPUFREQ_H
13 13
14#include <asm/cputime.h> 14#include <linux/cpumask.h>
15#include <linux/mutex.h> 15#include <linux/completion.h>
16#include <linux/notifier.h>
17#include <linux/threads.h>
18#include <linux/kobject.h> 16#include <linux/kobject.h>
17#include <linux/notifier.h>
19#include <linux/sysfs.h> 18#include <linux/sysfs.h>
20#include <linux/completion.h>
21#include <linux/workqueue.h>
22#include <linux/cpumask.h>
23#include <asm/div64.h>
24
25#define CPUFREQ_NAME_LEN 16
26/* Print length for names. Extra 1 space for accomodating '\n' in prints */
27#define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1)
28 19
29/********************************************************************* 20/*********************************************************************
30 * CPUFREQ NOTIFIER INTERFACE * 21 * CPUFREQ INTERFACE *
31 *********************************************************************/ 22 *********************************************************************/
32 23/*
33#define CPUFREQ_TRANSITION_NOTIFIER (0) 24 * Frequency values here are CPU kHz
34#define CPUFREQ_POLICY_NOTIFIER (1) 25 *
35
36#ifdef CONFIG_CPU_FREQ
37int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);
38int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
39extern void disable_cpufreq(void);
40#else /* CONFIG_CPU_FREQ */
41static inline int cpufreq_register_notifier(struct notifier_block *nb,
42 unsigned int list)
43{
44 return 0;
45}
46static inline int cpufreq_unregister_notifier(struct notifier_block *nb,
47 unsigned int list)
48{
49 return 0;
50}
51static inline void disable_cpufreq(void) { }
52#endif /* CONFIG_CPU_FREQ */
53
54/* if (cpufreq_driver->target) exists, the ->governor decides what frequency
55 * within the limits is used. If (cpufreq_driver->setpolicy> exists, these
56 * two generic policies are available:
57 */
58
59#define CPUFREQ_POLICY_POWERSAVE (1)
60#define CPUFREQ_POLICY_PERFORMANCE (2)
61
62/* Frequency values here are CPU kHz so that hardware which doesn't run
63 * with some frequencies can complain without having to guess what per
64 * cent / per mille means.
65 * Maximum transition latency is in nanoseconds - if it's unknown, 26 * Maximum transition latency is in nanoseconds - if it's unknown,
66 * CPUFREQ_ETERNAL shall be used. 27 * CPUFREQ_ETERNAL shall be used.
67 */ 28 */
68 29
30#define CPUFREQ_ETERNAL (-1)
31#define CPUFREQ_NAME_LEN 16
32/* Print length for names. Extra 1 space for accomodating '\n' in prints */
33#define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1)
34
69struct cpufreq_governor; 35struct cpufreq_governor;
70 36
71/* /sys/devices/system/cpu/cpufreq: entry point for global variables */ 37struct cpufreq_freqs {
72extern struct kobject *cpufreq_global_kobject; 38 unsigned int cpu; /* cpu nr */
73int cpufreq_get_global_kobject(void); 39 unsigned int old;
74void cpufreq_put_global_kobject(void); 40 unsigned int new;
75int cpufreq_sysfs_create_file(const struct attribute *attr); 41 u8 flags; /* flags of cpufreq_driver, see below. */
76void cpufreq_sysfs_remove_file(const struct attribute *attr); 42};
77 43
78#define CPUFREQ_ETERNAL (-1)
79struct cpufreq_cpuinfo { 44struct cpufreq_cpuinfo {
80 unsigned int max_freq; 45 unsigned int max_freq;
81 unsigned int min_freq; 46 unsigned int min_freq;
@@ -117,123 +82,103 @@ struct cpufreq_policy {
117 82
118 struct cpufreq_real_policy user_policy; 83 struct cpufreq_real_policy user_policy;
119 84
85 struct list_head policy_list;
120 struct kobject kobj; 86 struct kobject kobj;
121 struct completion kobj_unregister; 87 struct completion kobj_unregister;
122 int transition_ongoing; /* Tracks transition status */ 88 int transition_ongoing; /* Tracks transition status */
123}; 89};
124 90
125#define CPUFREQ_ADJUST (0)
126#define CPUFREQ_INCOMPATIBLE (1)
127#define CPUFREQ_NOTIFY (2)
128#define CPUFREQ_START (3)
129#define CPUFREQ_UPDATE_POLICY_CPU (4)
130
131/* Only for ACPI */ 91/* Only for ACPI */
132#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ 92#define CPUFREQ_SHARED_TYPE_NONE (0) /* None */
133#define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ 93#define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */
134#define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */ 94#define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */
135#define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ 95#define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/
136 96
97struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu);
98void cpufreq_cpu_put(struct cpufreq_policy *policy);
99
137static inline bool policy_is_shared(struct cpufreq_policy *policy) 100static inline bool policy_is_shared(struct cpufreq_policy *policy)
138{ 101{
139 return cpumask_weight(policy->cpus) > 1; 102 return cpumask_weight(policy->cpus) > 1;
140} 103}
141 104
142/******************** cpufreq transition notifiers *******************/ 105/* /sys/devices/system/cpu/cpufreq: entry point for global variables */
143 106extern struct kobject *cpufreq_global_kobject;
144#define CPUFREQ_PRECHANGE (0) 107int cpufreq_get_global_kobject(void);
145#define CPUFREQ_POSTCHANGE (1) 108void cpufreq_put_global_kobject(void);
146#define CPUFREQ_RESUMECHANGE (8) 109int cpufreq_sysfs_create_file(const struct attribute *attr);
147#define CPUFREQ_SUSPENDCHANGE (9) 110void cpufreq_sysfs_remove_file(const struct attribute *attr);
148 111
149struct cpufreq_freqs { 112#ifdef CONFIG_CPU_FREQ
150 unsigned int cpu; /* cpu nr */ 113unsigned int cpufreq_get(unsigned int cpu);
151 unsigned int old; 114unsigned int cpufreq_quick_get(unsigned int cpu);
152 unsigned int new; 115unsigned int cpufreq_quick_get_max(unsigned int cpu);
153 u8 flags; /* flags of cpufreq_driver, see below. */ 116void disable_cpufreq(void);
154};
155 117
156/** 118u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy);
157 * cpufreq_scale - "old * mult / div" calculation for large values (32-bit-arch 119int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
158 * safe) 120int cpufreq_update_policy(unsigned int cpu);
159 * @old: old value 121bool have_governor_per_policy(void);
160 * @div: divisor 122struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);
161 * @mult: multiplier 123#else
162 * 124static inline unsigned int cpufreq_get(unsigned int cpu)
163 *
164 * new = old * mult / div
165 */
166static inline unsigned long cpufreq_scale(unsigned long old, u_int div,
167 u_int mult)
168{ 125{
169#if BITS_PER_LONG == 32 126 return 0;
170 127}
171 u64 result = ((u64) old) * ((u64) mult); 128static inline unsigned int cpufreq_quick_get(unsigned int cpu)
172 do_div(result, div); 129{
173 return (unsigned long) result; 130 return 0;
174 131}
175#elif BITS_PER_LONG == 64 132static inline unsigned int cpufreq_quick_get_max(unsigned int cpu)
176 133{
177 unsigned long result = old * ((u64) mult); 134 return 0;
178 result /= div; 135}
179 return result; 136static inline void disable_cpufreq(void) { }
180
181#endif 137#endif
182};
183 138
184/********************************************************************* 139/*********************************************************************
185 * CPUFREQ GOVERNORS * 140 * CPUFREQ DRIVER INTERFACE *
186 *********************************************************************/ 141 *********************************************************************/
187 142
188#define CPUFREQ_GOV_START 1 143#define CPUFREQ_RELATION_L 0 /* lowest frequency at or above target */
189#define CPUFREQ_GOV_STOP 2 144#define CPUFREQ_RELATION_H 1 /* highest frequency below or at target */
190#define CPUFREQ_GOV_LIMITS 3
191#define CPUFREQ_GOV_POLICY_INIT 4
192#define CPUFREQ_GOV_POLICY_EXIT 5
193 145
194struct cpufreq_governor { 146struct freq_attr {
195 char name[CPUFREQ_NAME_LEN]; 147 struct attribute attr;
196 int initialized; 148 ssize_t (*show)(struct cpufreq_policy *, char *);
197 int (*governor) (struct cpufreq_policy *policy, 149 ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count);
198 unsigned int event);
199 ssize_t (*show_setspeed) (struct cpufreq_policy *policy,
200 char *buf);
201 int (*store_setspeed) (struct cpufreq_policy *policy,
202 unsigned int freq);
203 unsigned int max_transition_latency; /* HW must be able to switch to
204 next freq faster than this value in nano secs or we
205 will fallback to performance governor */
206 struct list_head governor_list;
207 struct module *owner;
208}; 150};
209 151
210/* 152#define cpufreq_freq_attr_ro(_name) \
211 * Pass a target to the cpufreq driver. 153static struct freq_attr _name = \
212 */ 154__ATTR(_name, 0444, show_##_name, NULL)
213extern int cpufreq_driver_target(struct cpufreq_policy *policy,
214 unsigned int target_freq,
215 unsigned int relation);
216extern int __cpufreq_driver_target(struct cpufreq_policy *policy,
217 unsigned int target_freq,
218 unsigned int relation);
219 155
220extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy, 156#define cpufreq_freq_attr_ro_perm(_name, _perm) \
221 unsigned int cpu); 157static struct freq_attr _name = \
158__ATTR(_name, _perm, show_##_name, NULL)
222 159
223int cpufreq_register_governor(struct cpufreq_governor *governor); 160#define cpufreq_freq_attr_rw(_name) \
224void cpufreq_unregister_governor(struct cpufreq_governor *governor); 161static struct freq_attr _name = \
162__ATTR(_name, 0644, show_##_name, store_##_name)
225 163
226/********************************************************************* 164struct global_attr {
227 * CPUFREQ DRIVER INTERFACE * 165 struct attribute attr;
228 *********************************************************************/ 166 ssize_t (*show)(struct kobject *kobj,
167 struct attribute *attr, char *buf);
168 ssize_t (*store)(struct kobject *a, struct attribute *b,
169 const char *c, size_t count);
170};
229 171
230#define CPUFREQ_RELATION_L 0 /* lowest frequency at or above target */ 172#define define_one_global_ro(_name) \
231#define CPUFREQ_RELATION_H 1 /* highest frequency below or at target */ 173static struct global_attr _name = \
174__ATTR(_name, 0444, show_##_name, NULL)
175
176#define define_one_global_rw(_name) \
177static struct global_attr _name = \
178__ATTR(_name, 0644, show_##_name, store_##_name)
232 179
233struct freq_attr;
234 180
235struct cpufreq_driver { 181struct cpufreq_driver {
236 struct module *owner;
237 char name[CPUFREQ_NAME_LEN]; 182 char name[CPUFREQ_NAME_LEN];
238 u8 flags; 183 u8 flags;
239 /* 184 /*
@@ -258,8 +203,6 @@ struct cpufreq_driver {
258 unsigned int (*get) (unsigned int cpu); 203 unsigned int (*get) (unsigned int cpu);
259 204
260 /* optional */ 205 /* optional */
261 unsigned int (*getavg) (struct cpufreq_policy *policy,
262 unsigned int cpu);
263 int (*bios_limit) (int cpu, unsigned int *limit); 206 int (*bios_limit) (int cpu, unsigned int *limit);
264 207
265 int (*exit) (struct cpufreq_policy *policy); 208 int (*exit) (struct cpufreq_policy *policy);
@@ -269,7 +212,6 @@ struct cpufreq_driver {
269}; 212};
270 213
271/* flags */ 214/* flags */
272
273#define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if 215#define CPUFREQ_STICKY 0x01 /* the driver isn't removed even if
274 * all ->init() calls failed */ 216 * all ->init() calls failed */
275#define CPUFREQ_CONST_LOOPS 0x02 /* loops_per_jiffy or other kernel 217#define CPUFREQ_CONST_LOOPS 0x02 /* loops_per_jiffy or other kernel
@@ -281,8 +223,7 @@ struct cpufreq_driver {
281int cpufreq_register_driver(struct cpufreq_driver *driver_data); 223int cpufreq_register_driver(struct cpufreq_driver *driver_data);
282int cpufreq_unregister_driver(struct cpufreq_driver *driver_data); 224int cpufreq_unregister_driver(struct cpufreq_driver *driver_data);
283 225
284void cpufreq_notify_transition(struct cpufreq_policy *policy, 226const char *cpufreq_get_current_driver(void);
285 struct cpufreq_freqs *freqs, unsigned int state);
286 227
287static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy, 228static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
288 unsigned int min, unsigned int max) 229 unsigned int min, unsigned int max)
@@ -300,87 +241,118 @@ static inline void cpufreq_verify_within_limits(struct cpufreq_policy *policy,
300 return; 241 return;
301} 242}
302 243
303struct freq_attr { 244/*********************************************************************
304 struct attribute attr; 245 * CPUFREQ NOTIFIER INTERFACE *
305 ssize_t (*show)(struct cpufreq_policy *, char *); 246 *********************************************************************/
306 ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count);
307};
308
309#define cpufreq_freq_attr_ro(_name) \
310static struct freq_attr _name = \
311__ATTR(_name, 0444, show_##_name, NULL)
312
313#define cpufreq_freq_attr_ro_perm(_name, _perm) \
314static struct freq_attr _name = \
315__ATTR(_name, _perm, show_##_name, NULL)
316
317#define cpufreq_freq_attr_rw(_name) \
318static struct freq_attr _name = \
319__ATTR(_name, 0644, show_##_name, store_##_name)
320 247
321struct global_attr { 248#define CPUFREQ_TRANSITION_NOTIFIER (0)
322 struct attribute attr; 249#define CPUFREQ_POLICY_NOTIFIER (1)
323 ssize_t (*show)(struct kobject *kobj,
324 struct attribute *attr, char *buf);
325 ssize_t (*store)(struct kobject *a, struct attribute *b,
326 const char *c, size_t count);
327};
328 250
329#define define_one_global_ro(_name) \ 251/* Transition notifiers */
330static struct global_attr _name = \ 252#define CPUFREQ_PRECHANGE (0)
331__ATTR(_name, 0444, show_##_name, NULL) 253#define CPUFREQ_POSTCHANGE (1)
254#define CPUFREQ_RESUMECHANGE (8)
255#define CPUFREQ_SUSPENDCHANGE (9)
332 256
333#define define_one_global_rw(_name) \ 257/* Policy Notifiers */
334static struct global_attr _name = \ 258#define CPUFREQ_ADJUST (0)
335__ATTR(_name, 0644, show_##_name, store_##_name) 259#define CPUFREQ_INCOMPATIBLE (1)
260#define CPUFREQ_NOTIFY (2)
261#define CPUFREQ_START (3)
262#define CPUFREQ_UPDATE_POLICY_CPU (4)
336 263
337struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); 264#ifdef CONFIG_CPU_FREQ
338void cpufreq_cpu_put(struct cpufreq_policy *data); 265int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list);
339const char *cpufreq_get_current_driver(void); 266int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
340 267
341/********************************************************************* 268void cpufreq_notify_transition(struct cpufreq_policy *policy,
342 * CPUFREQ 2.6. INTERFACE * 269 struct cpufreq_freqs *freqs, unsigned int state);
343 *********************************************************************/
344u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy);
345int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
346int cpufreq_update_policy(unsigned int cpu);
347bool have_governor_per_policy(void);
348struct kobject *get_governor_parent_kobj(struct cpufreq_policy *policy);
349 270
350#ifdef CONFIG_CPU_FREQ 271#else /* CONFIG_CPU_FREQ */
351/* 272static inline int cpufreq_register_notifier(struct notifier_block *nb,
352 * query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it 273 unsigned int list)
353 */
354unsigned int cpufreq_get(unsigned int cpu);
355#else
356static inline unsigned int cpufreq_get(unsigned int cpu)
357{ 274{
358 return 0; 275 return 0;
359} 276}
360#endif 277static inline int cpufreq_unregister_notifier(struct notifier_block *nb,
361 278 unsigned int list)
362/*
363 * query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it
364 */
365#ifdef CONFIG_CPU_FREQ
366unsigned int cpufreq_quick_get(unsigned int cpu);
367unsigned int cpufreq_quick_get_max(unsigned int cpu);
368#else
369static inline unsigned int cpufreq_quick_get(unsigned int cpu)
370{ 279{
371 return 0; 280 return 0;
372} 281}
373static inline unsigned int cpufreq_quick_get_max(unsigned int cpu) 282#endif /* !CONFIG_CPU_FREQ */
283
284/**
285 * cpufreq_scale - "old * mult / div" calculation for large values (32-bit-arch
286 * safe)
287 * @old: old value
288 * @div: divisor
289 * @mult: multiplier
290 *
291 *
292 * new = old * mult / div
293 */
294static inline unsigned long cpufreq_scale(unsigned long old, u_int div,
295 u_int mult)
374{ 296{
375 return 0; 297#if BITS_PER_LONG == 32
376} 298 u64 result = ((u64) old) * ((u64) mult);
299 do_div(result, div);
300 return (unsigned long) result;
301
302#elif BITS_PER_LONG == 64
303 unsigned long result = old * ((u64) mult);
304 result /= div;
305 return result;
377#endif 306#endif
307}
378 308
379/********************************************************************* 309/*********************************************************************
380 * CPUFREQ DEFAULT GOVERNOR * 310 * CPUFREQ GOVERNORS *
381 *********************************************************************/ 311 *********************************************************************/
382 312
383/* 313/*
314 * If (cpufreq_driver->target) exists, the ->governor decides what frequency
315 * within the limits is used. If (cpufreq_driver->setpolicy> exists, these
316 * two generic policies are available:
317 */
318#define CPUFREQ_POLICY_POWERSAVE (1)
319#define CPUFREQ_POLICY_PERFORMANCE (2)
320
321/* Governor Events */
322#define CPUFREQ_GOV_START 1
323#define CPUFREQ_GOV_STOP 2
324#define CPUFREQ_GOV_LIMITS 3
325#define CPUFREQ_GOV_POLICY_INIT 4
326#define CPUFREQ_GOV_POLICY_EXIT 5
327
328struct cpufreq_governor {
329 char name[CPUFREQ_NAME_LEN];
330 int initialized;
331 int (*governor) (struct cpufreq_policy *policy,
332 unsigned int event);
333 ssize_t (*show_setspeed) (struct cpufreq_policy *policy,
334 char *buf);
335 int (*store_setspeed) (struct cpufreq_policy *policy,
336 unsigned int freq);
337 unsigned int max_transition_latency; /* HW must be able to switch to
338 next freq faster than this value in nano secs or we
339 will fallback to performance governor */
340 struct list_head governor_list;
341 struct module *owner;
342};
343
344/* Pass a target to the cpufreq driver */
345int cpufreq_driver_target(struct cpufreq_policy *policy,
346 unsigned int target_freq,
347 unsigned int relation);
348int __cpufreq_driver_target(struct cpufreq_policy *policy,
349 unsigned int target_freq,
350 unsigned int relation);
351int cpufreq_register_governor(struct cpufreq_governor *governor);
352void cpufreq_unregister_governor(struct cpufreq_governor *governor);
353
354/* CPUFREQ DEFAULT GOVERNOR */
355/*
384 * Performance governor is fallback governor if any other gov failed to auto 356 * Performance governor is fallback governor if any other gov failed to auto
385 * load due latency restrictions 357 * load due latency restrictions
386 */ 358 */
@@ -428,18 +400,16 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy,
428 unsigned int relation, 400 unsigned int relation,
429 unsigned int *index); 401 unsigned int *index);
430 402
431/* the following 3 funtions are for cpufreq core use only */ 403void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy);
404ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
405
406/* the following funtion is for cpufreq core use only */
432struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); 407struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu);
433 408
434/* the following are really really optional */ 409/* the following are really really optional */
435extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; 410extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs;
436
437void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, 411void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
438 unsigned int cpu); 412 unsigned int cpu);
439void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy);
440
441void cpufreq_frequency_table_put_attr(unsigned int cpu); 413void cpufreq_frequency_table_put_attr(unsigned int cpu);
442 414
443ssize_t cpufreq_show_cpus(const struct cpumask *mask, char *buf);
444
445#endif /* _LINUX_CPUFREQ_H */ 415#endif /* _LINUX_CPUFREQ_H */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 0bc4b74668e9..781addc66f03 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -13,8 +13,6 @@
13 13
14#include <linux/percpu.h> 14#include <linux/percpu.h>
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/kobject.h>
17#include <linux/completion.h>
18#include <linux/hrtimer.h> 16#include <linux/hrtimer.h>
19 17
20#define CPUIDLE_STATE_MAX 10 18#define CPUIDLE_STATE_MAX 10
@@ -61,6 +59,10 @@ struct cpuidle_state {
61 59
62#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) 60#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
63 61
62struct cpuidle_device_kobj;
63struct cpuidle_state_kobj;
64struct cpuidle_driver_kobj;
65
64struct cpuidle_device { 66struct cpuidle_device {
65 unsigned int registered:1; 67 unsigned int registered:1;
66 unsigned int enabled:1; 68 unsigned int enabled:1;
@@ -71,9 +73,8 @@ struct cpuidle_device {
71 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX]; 73 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
72 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; 74 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
73 struct cpuidle_driver_kobj *kobj_driver; 75 struct cpuidle_driver_kobj *kobj_driver;
76 struct cpuidle_device_kobj *kobj_dev;
74 struct list_head device_list; 77 struct list_head device_list;
75 struct kobject kobj;
76 struct completion kobj_unregister;
77 78
78#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED 79#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
79 int safe_state_index; 80 int safe_state_index;
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index b90337c9d468..9169b91ea2d2 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -9,6 +9,7 @@
9#include <linux/seqlock.h> 9#include <linux/seqlock.h>
10#include <linux/cache.h> 10#include <linux/cache.h>
11#include <linux/rcupdate.h> 11#include <linux/rcupdate.h>
12#include <linux/lockref.h>
12 13
13struct nameidata; 14struct nameidata;
14struct path; 15struct path;
@@ -100,6 +101,8 @@ extern unsigned int full_name_hash(const unsigned char *, unsigned int);
100# endif 101# endif
101#endif 102#endif
102 103
104#define d_lock d_lockref.lock
105
103struct dentry { 106struct dentry {
104 /* RCU lookup touched fields */ 107 /* RCU lookup touched fields */
105 unsigned int d_flags; /* protected by d_lock */ 108 unsigned int d_flags; /* protected by d_lock */
@@ -112,8 +115,7 @@ struct dentry {
112 unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */ 115 unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */
113 116
114 /* Ref lookup also touches following */ 117 /* Ref lookup also touches following */
115 unsigned int d_count; /* protected by d_lock */ 118 struct lockref d_lockref; /* per-dentry lock and refcount */
116 spinlock_t d_lock; /* per dentry lock */
117 const struct dentry_operations *d_op; 119 const struct dentry_operations *d_op;
118 struct super_block *d_sb; /* The root of the dentry tree */ 120 struct super_block *d_sb; /* The root of the dentry tree */
119 unsigned long d_time; /* used by d_revalidate */ 121 unsigned long d_time; /* used by d_revalidate */
@@ -302,31 +304,9 @@ extern struct dentry *__d_lookup(const struct dentry *, const struct qstr *);
302extern struct dentry *__d_lookup_rcu(const struct dentry *parent, 304extern struct dentry *__d_lookup_rcu(const struct dentry *parent,
303 const struct qstr *name, unsigned *seq); 305 const struct qstr *name, unsigned *seq);
304 306
305/**
306 * __d_rcu_to_refcount - take a refcount on dentry if sequence check is ok
307 * @dentry: dentry to take a ref on
308 * @seq: seqcount to verify against
309 * Returns: 0 on failure, else 1.
310 *
311 * __d_rcu_to_refcount operates on a dentry,seq pair that was returned
312 * by __d_lookup_rcu, to get a reference on an rcu-walk dentry.
313 */
314static inline int __d_rcu_to_refcount(struct dentry *dentry, unsigned seq)
315{
316 int ret = 0;
317
318 assert_spin_locked(&dentry->d_lock);
319 if (!read_seqcount_retry(&dentry->d_seq, seq)) {
320 ret = 1;
321 dentry->d_count++;
322 }
323
324 return ret;
325}
326
327static inline unsigned d_count(const struct dentry *dentry) 307static inline unsigned d_count(const struct dentry *dentry)
328{ 308{
329 return dentry->d_count; 309 return dentry->d_lockref.count;
330} 310}
331 311
332/* validate "insecure" dentry pointer */ 312/* validate "insecure" dentry pointer */
@@ -336,6 +316,7 @@ extern int d_validate(struct dentry *, struct dentry *);
336 * helper function for dentry_operations.d_dname() members 316 * helper function for dentry_operations.d_dname() members
337 */ 317 */
338extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...); 318extern char *dynamic_dname(struct dentry *, char *, int, const char *, ...);
319extern char *simple_dname(struct dentry *, char *, int);
339 320
340extern char *__d_path(const struct path *, const struct path *, char *, int); 321extern char *__d_path(const struct path *, const struct path *, char *, int);
341extern char *d_absolute_path(const struct path *, char *, int); 322extern char *d_absolute_path(const struct path *, char *, int);
@@ -356,17 +337,14 @@ extern char *dentry_path(struct dentry *, char *, int);
356static inline struct dentry *dget_dlock(struct dentry *dentry) 337static inline struct dentry *dget_dlock(struct dentry *dentry)
357{ 338{
358 if (dentry) 339 if (dentry)
359 dentry->d_count++; 340 dentry->d_lockref.count++;
360 return dentry; 341 return dentry;
361} 342}
362 343
363static inline struct dentry *dget(struct dentry *dentry) 344static inline struct dentry *dget(struct dentry *dentry)
364{ 345{
365 if (dentry) { 346 if (dentry)
366 spin_lock(&dentry->d_lock); 347 lockref_get(&dentry->d_lockref);
367 dget_dlock(dentry);
368 spin_unlock(&dentry->d_lock);
369 }
370 return dentry; 348 return dentry;
371} 349}
372 350
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index d68b4ea7343c..263489d0788d 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -192,6 +192,13 @@ static inline struct dentry *debugfs_create_x32(const char *name, umode_t mode,
192 return ERR_PTR(-ENODEV); 192 return ERR_PTR(-ENODEV);
193} 193}
194 194
195static inline struct dentry *debugfs_create_x64(const char *name, umode_t mode,
196 struct dentry *parent,
197 u64 *value)
198{
199 return ERR_PTR(-ENODEV);
200}
201
195static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode, 202static inline struct dentry *debugfs_create_size_t(const char *name, umode_t mode,
196 struct dentry *parent, 203 struct dentry *parent,
197 size_t *value) 204 size_t *value)
diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h
index 0e5f5785d9f2..98ffcbd4888e 100644
--- a/include/linux/debugobjects.h
+++ b/include/linux/debugobjects.h
@@ -63,7 +63,7 @@ struct debug_obj_descr {
63extern void debug_object_init (void *addr, struct debug_obj_descr *descr); 63extern void debug_object_init (void *addr, struct debug_obj_descr *descr);
64extern void 64extern void
65debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr); 65debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr);
66extern void debug_object_activate (void *addr, struct debug_obj_descr *descr); 66extern int debug_object_activate (void *addr, struct debug_obj_descr *descr);
67extern void debug_object_deactivate(void *addr, struct debug_obj_descr *descr); 67extern void debug_object_deactivate(void *addr, struct debug_obj_descr *descr);
68extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr); 68extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr);
69extern void debug_object_free (void *addr, struct debug_obj_descr *descr); 69extern void debug_object_free (void *addr, struct debug_obj_descr *descr);
@@ -85,8 +85,8 @@ static inline void
85debug_object_init (void *addr, struct debug_obj_descr *descr) { } 85debug_object_init (void *addr, struct debug_obj_descr *descr) { }
86static inline void 86static inline void
87debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr) { } 87debug_object_init_on_stack(void *addr, struct debug_obj_descr *descr) { }
88static inline void 88static inline int
89debug_object_activate (void *addr, struct debug_obj_descr *descr) { } 89debug_object_activate (void *addr, struct debug_obj_descr *descr) { return 0; }
90static inline void 90static inline void
91debug_object_deactivate(void *addr, struct debug_obj_descr *descr) { } 91debug_object_deactivate(void *addr, struct debug_obj_descr *descr) { }
92static inline void 92static inline void
diff --git a/include/linux/device.h b/include/linux/device.h
index 22b546a58591..f46646e49235 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -66,6 +66,9 @@ extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
66 * @bus_attrs: Default attributes of the bus. 66 * @bus_attrs: Default attributes of the bus.
67 * @dev_attrs: Default attributes of the devices on the bus. 67 * @dev_attrs: Default attributes of the devices on the bus.
68 * @drv_attrs: Default attributes of the device drivers on the bus. 68 * @drv_attrs: Default attributes of the device drivers on the bus.
69 * @bus_groups: Default attributes of the bus.
70 * @dev_groups: Default attributes of the devices on the bus.
71 * @drv_groups: Default attributes of the device drivers on the bus.
69 * @match: Called, perhaps multiple times, whenever a new device or driver 72 * @match: Called, perhaps multiple times, whenever a new device or driver
70 * is added for this bus. It should return a nonzero value if the 73 * is added for this bus. It should return a nonzero value if the
71 * given device can be handled by the given driver. 74 * given device can be handled by the given driver.
@@ -103,9 +106,12 @@ struct bus_type {
103 const char *name; 106 const char *name;
104 const char *dev_name; 107 const char *dev_name;
105 struct device *dev_root; 108 struct device *dev_root;
106 struct bus_attribute *bus_attrs; 109 struct bus_attribute *bus_attrs; /* use bus_groups instead */
107 struct device_attribute *dev_attrs; 110 struct device_attribute *dev_attrs; /* use dev_groups instead */
108 struct driver_attribute *drv_attrs; 111 struct driver_attribute *drv_attrs; /* use drv_groups instead */
112 const struct attribute_group **bus_groups;
113 const struct attribute_group **dev_groups;
114 const struct attribute_group **drv_groups;
109 115
110 int (*match)(struct device *dev, struct device_driver *drv); 116 int (*match)(struct device *dev, struct device_driver *drv);
111 int (*uevent)(struct device *dev, struct kobj_uevent_env *env); 117 int (*uevent)(struct device *dev, struct kobj_uevent_env *env);
@@ -271,6 +277,8 @@ struct driver_attribute {
271 struct driver_attribute driver_attr_##_name = __ATTR_RW(_name) 277 struct driver_attribute driver_attr_##_name = __ATTR_RW(_name)
272#define DRIVER_ATTR_RO(_name) \ 278#define DRIVER_ATTR_RO(_name) \
273 struct driver_attribute driver_attr_##_name = __ATTR_RO(_name) 279 struct driver_attribute driver_attr_##_name = __ATTR_RO(_name)
280#define DRIVER_ATTR_WO(_name) \
281 struct driver_attribute driver_attr_##_name = __ATTR_WO(_name)
274 282
275extern int __must_check driver_create_file(struct device_driver *driver, 283extern int __must_check driver_create_file(struct device_driver *driver,
276 const struct driver_attribute *attr); 284 const struct driver_attribute *attr);
@@ -528,6 +536,8 @@ ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
528 struct device_attribute dev_attr_##_name = __ATTR_RW(_name) 536 struct device_attribute dev_attr_##_name = __ATTR_RW(_name)
529#define DEVICE_ATTR_RO(_name) \ 537#define DEVICE_ATTR_RO(_name) \
530 struct device_attribute dev_attr_##_name = __ATTR_RO(_name) 538 struct device_attribute dev_attr_##_name = __ATTR_RO(_name)
539#define DEVICE_ATTR_WO(_name) \
540 struct device_attribute dev_attr_##_name = __ATTR_WO(_name)
531#define DEVICE_ULONG_ATTR(_name, _mode, _var) \ 541#define DEVICE_ULONG_ATTR(_name, _mode, _var) \
532 struct dev_ext_attribute dev_attr_##_name = \ 542 struct dev_ext_attribute dev_attr_##_name = \
533 { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) } 543 { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }
@@ -895,6 +905,7 @@ static inline bool device_supports_offline(struct device *dev)
895 905
896extern void lock_device_hotplug(void); 906extern void lock_device_hotplug(void);
897extern void unlock_device_hotplug(void); 907extern void unlock_device_hotplug(void);
908extern int lock_device_hotplug_sysfs(void);
898extern int device_offline(struct device *dev); 909extern int device_offline(struct device *dev);
899extern int device_online(struct device *dev); 910extern int device_online(struct device *dev);
900/* 911/*
@@ -1099,7 +1110,8 @@ do { \
1099 dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__) 1110 dev_level_ratelimited(dev_notice, dev, fmt, ##__VA_ARGS__)
1100#define dev_info_ratelimited(dev, fmt, ...) \ 1111#define dev_info_ratelimited(dev, fmt, ...) \
1101 dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__) 1112 dev_level_ratelimited(dev_info, dev, fmt, ##__VA_ARGS__)
1102#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG) 1113#if defined(CONFIG_DYNAMIC_DEBUG)
1114/* descriptor check is first to prevent flooding with "callbacks suppressed" */
1103#define dev_dbg_ratelimited(dev, fmt, ...) \ 1115#define dev_dbg_ratelimited(dev, fmt, ...) \
1104do { \ 1116do { \
1105 static DEFINE_RATELIMIT_STATE(_rs, \ 1117 static DEFINE_RATELIMIT_STATE(_rs, \
@@ -1108,8 +1120,17 @@ do { \
1108 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 1120 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
1109 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \ 1121 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) && \
1110 __ratelimit(&_rs)) \ 1122 __ratelimit(&_rs)) \
1111 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \ 1123 __dynamic_dev_dbg(&descriptor, dev, fmt, \
1112 ##__VA_ARGS__); \ 1124 ##__VA_ARGS__); \
1125} while (0)
1126#elif defined(DEBUG)
1127#define dev_dbg_ratelimited(dev, fmt, ...) \
1128do { \
1129 static DEFINE_RATELIMIT_STATE(_rs, \
1130 DEFAULT_RATELIMIT_INTERVAL, \
1131 DEFAULT_RATELIMIT_BURST); \
1132 if (__ratelimit(&_rs)) \
1133 dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \
1113} while (0) 1134} while (0)
1114#else 1135#else
1115#define dev_dbg_ratelimited(dev, fmt, ...) \ 1136#define dev_dbg_ratelimited(dev, fmt, ...) \
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
index 96e87693d933..841925fbfe8a 100644
--- a/include/linux/dm9000.h
+++ b/include/linux/dm9000.h
@@ -14,6 +14,8 @@
14#ifndef __DM9000_PLATFORM_DATA 14#ifndef __DM9000_PLATFORM_DATA
15#define __DM9000_PLATFORM_DATA __FILE__ 15#define __DM9000_PLATFORM_DATA __FILE__
16 16
17#include <linux/if_ether.h>
18
17/* IO control flags */ 19/* IO control flags */
18 20
19#define DM9000_PLATF_8BITONLY (0x0001) 21#define DM9000_PLATF_8BITONLY (0x0001)
@@ -27,7 +29,7 @@
27 29
28struct dm9000_plat_data { 30struct dm9000_plat_data {
29 unsigned int flags; 31 unsigned int flags;
30 unsigned char dev_addr[6]; 32 unsigned char dev_addr[ETH_ALEN];
31 33
32 /* allow replacement IO routines */ 34 /* allow replacement IO routines */
33 35
diff --git a/include/linux/dma-contiguous.h b/include/linux/dma-contiguous.h
index 01b5c84be828..00141d3325fe 100644
--- a/include/linux/dma-contiguous.h
+++ b/include/linux/dma-contiguous.h
@@ -57,7 +57,7 @@ struct cma;
57struct page; 57struct page;
58struct device; 58struct device;
59 59
60#ifdef CONFIG_CMA 60#ifdef CONFIG_DMA_CMA
61 61
62/* 62/*
63 * There is always at least global CMA area and a few optional device 63 * There is always at least global CMA area and a few optional device
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 94af41858513..3a8d0a2af607 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -132,9 +132,8 @@ static inline int dma_set_seg_boundary(struct device *dev, unsigned long mask)
132static inline void *dma_zalloc_coherent(struct device *dev, size_t size, 132static inline void *dma_zalloc_coherent(struct device *dev, size_t size,
133 dma_addr_t *dma_handle, gfp_t flag) 133 dma_addr_t *dma_handle, gfp_t flag)
134{ 134{
135 void *ret = dma_alloc_coherent(dev, size, dma_handle, flag); 135 void *ret = dma_alloc_coherent(dev, size, dma_handle,
136 if (ret) 136 flag | __GFP_ZERO);
137 memset(ret, 0, size);
138 return ret; 137 return ret;
139} 138}
140 139
diff --git a/include/linux/err.h b/include/linux/err.h
index 221fcfb676c4..15f92e072450 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -52,7 +52,7 @@ static inline void * __must_check ERR_CAST(__force const void *ptr)
52 return (void *) ptr; 52 return (void *) ptr;
53} 53}
54 54
55static inline int __must_check PTR_RET(__force const void *ptr) 55static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr)
56{ 56{
57 if (IS_ERR(ptr)) 57 if (IS_ERR(ptr))
58 return PTR_ERR(ptr); 58 return PTR_ERR(ptr);
@@ -60,6 +60,9 @@ static inline int __must_check PTR_RET(__force const void *ptr)
60 return 0; 60 return 0;
61} 61}
62 62
63/* Deprecated */
64#define PTR_RET(p) PTR_ERR_OR_ZERO(p)
65
63#endif 66#endif
64 67
65#endif /* _LINUX_ERR_H */ 68#endif /* _LINUX_ERR_H */
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index c623861964e4..d8b512496e50 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -199,6 +199,21 @@ static inline void eth_hw_addr_random(struct net_device *dev)
199} 199}
200 200
201/** 201/**
202 * eth_hw_addr_inherit - Copy dev_addr from another net_device
203 * @dst: pointer to net_device to copy dev_addr to
204 * @src: pointer to net_device to copy dev_addr from
205 *
206 * Copy the Ethernet address from one net_device to another along with
207 * the address attributes (addr_assign_type).
208 */
209static inline void eth_hw_addr_inherit(struct net_device *dst,
210 struct net_device *src)
211{
212 dst->addr_assign_type = src->addr_assign_type;
213 memcpy(dst->dev_addr, src->dev_addr, ETH_ALEN);
214}
215
216/**
202 * compare_ether_addr - Compare two Ethernet addresses 217 * compare_ether_addr - Compare two Ethernet addresses
203 * @addr1: Pointer to a six-byte array containing the Ethernet address 218 * @addr1: Pointer to a six-byte array containing the Ethernet address
204 * @addr2: Pointer other six-byte array containing the Ethernet address 219 * @addr2: Pointer other six-byte array containing the Ethernet address
diff --git a/include/linux/extcon/of_extcon.h b/include/linux/extcon/of_extcon.h
new file mode 100644
index 000000000000..0ebfeff1b55d
--- /dev/null
+++ b/include/linux/extcon/of_extcon.h
@@ -0,0 +1,31 @@
1/*
2 * OF helpers for External connector (extcon) framework
3 *
4 * Copyright (C) 2013 Texas Instruments, Inc.
5 * Kishon Vijay Abraham I <kishon@ti.com>
6 *
7 * Copyright (C) 2013 Samsung Electronics
8 * Chanwoo Choi <cw00.choi@samsung.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 */
15
16#ifndef __LINUX_OF_EXTCON_H
17#define __LINUX_OF_EXTCON_H
18
19#include <linux/err.h>
20
21#if IS_ENABLED(CONFIG_OF_EXTCON)
22extern struct extcon_dev
23 *of_extcon_get_extcon_dev(struct device *dev, int index);
24#else
25static inline struct extcon_dev
26 *of_extcon_get_extcon_dev(struct device *dev, int index)
27{
28 return ERR_PTR(-ENOSYS);
29}
30#endif /* CONFIG_OF_EXTCON */
31#endif /* __LINUX_OF_EXTCON_H */
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index 383d5e39b280..bb942f6d5702 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -140,14 +140,24 @@ struct f2fs_extent {
140} __packed; 140} __packed;
141 141
142#define F2FS_NAME_LEN 255 142#define F2FS_NAME_LEN 255
143#define ADDRS_PER_INODE 923 /* Address Pointers in an Inode */ 143#define F2FS_INLINE_XATTR_ADDRS 50 /* 200 bytes for inline xattrs */
144#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */ 144#define DEF_ADDRS_PER_INODE 923 /* Address Pointers in an Inode */
145#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */ 145#define ADDRS_PER_INODE(fi) addrs_per_inode(fi)
146#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */
147#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */
148
149#define NODE_DIR1_BLOCK (DEF_ADDRS_PER_INODE + 1)
150#define NODE_DIR2_BLOCK (DEF_ADDRS_PER_INODE + 2)
151#define NODE_IND1_BLOCK (DEF_ADDRS_PER_INODE + 3)
152#define NODE_IND2_BLOCK (DEF_ADDRS_PER_INODE + 4)
153#define NODE_DIND_BLOCK (DEF_ADDRS_PER_INODE + 5)
154
155#define F2FS_INLINE_XATTR 0x01 /* file inline xattr flag */
146 156
147struct f2fs_inode { 157struct f2fs_inode {
148 __le16 i_mode; /* file mode */ 158 __le16 i_mode; /* file mode */
149 __u8 i_advise; /* file hints */ 159 __u8 i_advise; /* file hints */
150 __u8 i_reserved; /* reserved */ 160 __u8 i_inline; /* file inline flags */
151 __le32 i_uid; /* user ID */ 161 __le32 i_uid; /* user ID */
152 __le32 i_gid; /* group ID */ 162 __le32 i_gid; /* group ID */
153 __le32 i_links; /* links count */ 163 __le32 i_links; /* links count */
@@ -170,7 +180,7 @@ struct f2fs_inode {
170 180
171 struct f2fs_extent i_ext; /* caching a largest extent */ 181 struct f2fs_extent i_ext; /* caching a largest extent */
172 182
173 __le32 i_addr[ADDRS_PER_INODE]; /* Pointers to data blocks */ 183 __le32 i_addr[DEF_ADDRS_PER_INODE]; /* Pointers to data blocks */
174 184
175 __le32 i_nid[5]; /* direct(2), indirect(2), 185 __le32 i_nid[5]; /* direct(2), indirect(2),
176 double_indirect(1) node id */ 186 double_indirect(1) node id */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 981874773e85..3b4cd8296e41 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -46,6 +46,7 @@ struct vfsmount;
46struct cred; 46struct cred;
47struct swap_info_struct; 47struct swap_info_struct;
48struct seq_file; 48struct seq_file;
49struct workqueue_struct;
49 50
50extern void __init inode_init(void); 51extern void __init inode_init(void);
51extern void __init inode_init_early(void); 52extern void __init inode_init_early(void);
@@ -63,8 +64,7 @@ struct buffer_head;
63typedef int (get_block_t)(struct inode *inode, sector_t iblock, 64typedef int (get_block_t)(struct inode *inode, sector_t iblock,
64 struct buffer_head *bh_result, int create); 65 struct buffer_head *bh_result, int create);
65typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, 66typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
66 ssize_t bytes, void *private, int ret, 67 ssize_t bytes, void *private);
67 bool is_async);
68 68
69#define MAY_EXEC 0x00000001 69#define MAY_EXEC 0x00000001
70#define MAY_WRITE 0x00000002 70#define MAY_WRITE 0x00000002
@@ -1328,6 +1328,9 @@ struct super_block {
1328 1328
1329 /* Being remounted read-only */ 1329 /* Being remounted read-only */
1330 int s_readonly_remount; 1330 int s_readonly_remount;
1331
1332 /* AIO completions deferred from interrupt context */
1333 struct workqueue_struct *s_dio_done_wq;
1331}; 1334};
1332 1335
1333/* superblock cache pruning functions */ 1336/* superblock cache pruning functions */
@@ -1804,7 +1807,7 @@ enum file_time_flags {
1804 S_VERSION = 8, 1807 S_VERSION = 8,
1805}; 1808};
1806 1809
1807extern void touch_atime(struct path *); 1810extern void touch_atime(const struct path *);
1808static inline void file_accessed(struct file *file) 1811static inline void file_accessed(struct file *file)
1809{ 1812{
1810 if (!(file->f_flags & O_NOATIME)) 1813 if (!(file->f_flags & O_NOATIME))
@@ -2503,6 +2506,7 @@ extern void generic_fillattr(struct inode *, struct kstat *);
2503extern int vfs_getattr(struct path *, struct kstat *); 2506extern int vfs_getattr(struct path *, struct kstat *);
2504void __inode_add_bytes(struct inode *inode, loff_t bytes); 2507void __inode_add_bytes(struct inode *inode, loff_t bytes);
2505void inode_add_bytes(struct inode *inode, loff_t bytes); 2508void inode_add_bytes(struct inode *inode, loff_t bytes);
2509void __inode_sub_bytes(struct inode *inode, loff_t bytes);
2506void inode_sub_bytes(struct inode *inode, loff_t bytes); 2510void inode_sub_bytes(struct inode *inode, loff_t bytes);
2507loff_t inode_get_bytes(struct inode *inode); 2511loff_t inode_get_bytes(struct inode *inode);
2508void inode_set_bytes(struct inode *inode, loff_t bytes); 2512void inode_set_bytes(struct inode *inode, loff_t bytes);
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h
index 51b793466ff3..efb05961bdd8 100644
--- a/include/linux/fs_enet_pd.h
+++ b/include/linux/fs_enet_pd.h
@@ -16,8 +16,10 @@
16#ifndef FS_ENET_PD_H 16#ifndef FS_ENET_PD_H
17#define FS_ENET_PD_H 17#define FS_ENET_PD_H
18 18
19#include <linux/clk.h>
19#include <linux/string.h> 20#include <linux/string.h>
20#include <linux/of_mdio.h> 21#include <linux/of_mdio.h>
22#include <linux/if_ether.h>
21#include <asm/types.h> 23#include <asm/types.h>
22 24
23#define FS_ENET_NAME "fs_enet" 25#define FS_ENET_NAME "fs_enet"
@@ -135,13 +137,15 @@ struct fs_platform_info {
135 const struct fs_mii_bus_info *bus_info; 137 const struct fs_mii_bus_info *bus_info;
136 138
137 int rx_ring, tx_ring; /* number of buffers on rx */ 139 int rx_ring, tx_ring; /* number of buffers on rx */
138 __u8 macaddr[6]; /* mac address */ 140 __u8 macaddr[ETH_ALEN]; /* mac address */
139 int rx_copybreak; /* limit we copy small frames */ 141 int rx_copybreak; /* limit we copy small frames */
140 int use_napi; /* use NAPI */ 142 int use_napi; /* use NAPI */
141 int napi_weight; /* NAPI weight */ 143 int napi_weight; /* NAPI weight */
142 144
143 int use_rmii; /* use RMII mode */ 145 int use_rmii; /* use RMII mode */
144 int has_phy; /* if the network is phy container as well...*/ 146 int has_phy; /* if the network is phy container as well...*/
147
148 struct clk *clk_per; /* 'per' clock for register access */
145}; 149};
146struct fs_mii_fec_platform_info { 150struct fs_mii_fec_platform_info {
147 u32 irq[32]; 151 u32 irq[32];
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 4372658c73ae..5eaa746735ff 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -78,6 +78,11 @@ struct trace_iterator {
78 /* trace_seq for __print_flags() and __print_symbolic() etc. */ 78 /* trace_seq for __print_flags() and __print_symbolic() etc. */
79 struct trace_seq tmp_seq; 79 struct trace_seq tmp_seq;
80 80
81 cpumask_var_t started;
82
83 /* it's true when current open file is snapshot */
84 bool snapshot;
85
81 /* The below is zeroed out in pipe_read */ 86 /* The below is zeroed out in pipe_read */
82 struct trace_seq seq; 87 struct trace_seq seq;
83 struct trace_entry *ent; 88 struct trace_entry *ent;
@@ -90,10 +95,7 @@ struct trace_iterator {
90 loff_t pos; 95 loff_t pos;
91 long idx; 96 long idx;
92 97
93 cpumask_var_t started; 98 /* All new field here will be zeroed out in pipe_read */
94
95 /* it's true when current open file is snapshot */
96 bool snapshot;
97}; 99};
98 100
99enum trace_iter_flags { 101enum trace_iter_flags {
@@ -332,7 +334,7 @@ extern int trace_define_field(struct ftrace_event_call *call, const char *type,
332 const char *name, int offset, int size, 334 const char *name, int offset, int size,
333 int is_signed, int filter_type); 335 int is_signed, int filter_type);
334extern int trace_add_event_call(struct ftrace_event_call *call); 336extern int trace_add_event_call(struct ftrace_event_call *call);
335extern void trace_remove_event_call(struct ftrace_event_call *call); 337extern int trace_remove_event_call(struct ftrace_event_call *call);
336 338
337#define is_signed_type(type) (((type)(-1)) < (type)1) 339#define is_signed_type(type) (((type)(-1)) < (type)1)
338 340
@@ -357,6 +359,40 @@ do { \
357 __trace_printk(ip, fmt, ##args); \ 359 __trace_printk(ip, fmt, ##args); \
358} while (0) 360} while (0)
359 361
362/**
363 * tracepoint_string - register constant persistent string to trace system
364 * @str - a constant persistent string that will be referenced in tracepoints
365 *
366 * If constant strings are being used in tracepoints, it is faster and
367 * more efficient to just save the pointer to the string and reference
368 * that with a printf "%s" instead of saving the string in the ring buffer
369 * and wasting space and time.
370 *
371 * The problem with the above approach is that userspace tools that read
372 * the binary output of the trace buffers do not have access to the string.
373 * Instead they just show the address of the string which is not very
374 * useful to users.
375 *
376 * With tracepoint_string(), the string will be registered to the tracing
377 * system and exported to userspace via the debugfs/tracing/printk_formats
378 * file that maps the string address to the string text. This way userspace
379 * tools that read the binary buffers have a way to map the pointers to
380 * the ASCII strings they represent.
381 *
382 * The @str used must be a constant string and persistent as it would not
383 * make sense to show a string that no longer exists. But it is still fine
384 * to be used with modules, because when modules are unloaded, if they
385 * had tracepoints, the ring buffers are cleared too. As long as the string
386 * does not change during the life of the module, it is fine to use
387 * tracepoint_string() within a module.
388 */
389#define tracepoint_string(str) \
390 ({ \
391 static const char *___tp_str __tracepoint_string = str; \
392 ___tp_str; \
393 })
394#define __tracepoint_string __attribute__((section("__tracepoint_str")))
395
360#ifdef CONFIG_PERF_EVENTS 396#ifdef CONFIG_PERF_EVENTS
361struct perf_event; 397struct perf_event;
362 398
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 05bcc0903766..ccfe17c5c8da 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -1,126 +1,11 @@
1#ifndef LINUX_HARDIRQ_H 1#ifndef LINUX_HARDIRQ_H
2#define LINUX_HARDIRQ_H 2#define LINUX_HARDIRQ_H
3 3
4#include <linux/preempt.h> 4#include <linux/preempt_mask.h>
5#include <linux/lockdep.h> 5#include <linux/lockdep.h>
6#include <linux/ftrace_irq.h> 6#include <linux/ftrace_irq.h>
7#include <linux/vtime.h> 7#include <linux/vtime.h>
8#include <asm/hardirq.h>
9 8
10/*
11 * We put the hardirq and softirq counter into the preemption
12 * counter. The bitmask has the following meaning:
13 *
14 * - bits 0-7 are the preemption count (max preemption depth: 256)
15 * - bits 8-15 are the softirq count (max # of softirqs: 256)
16 *
17 * The hardirq count can in theory reach the same as NR_IRQS.
18 * In reality, the number of nested IRQS is limited to the stack
19 * size as well. For archs with over 1000 IRQS it is not practical
20 * to expect that they will all nest. We give a max of 10 bits for
21 * hardirq nesting. An arch may choose to give less than 10 bits.
22 * m68k expects it to be 8.
23 *
24 * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
25 * - bit 26 is the NMI_MASK
26 * - bit 27 is the PREEMPT_ACTIVE flag
27 *
28 * PREEMPT_MASK: 0x000000ff
29 * SOFTIRQ_MASK: 0x0000ff00
30 * HARDIRQ_MASK: 0x03ff0000
31 * NMI_MASK: 0x04000000
32 */
33#define PREEMPT_BITS 8
34#define SOFTIRQ_BITS 8
35#define NMI_BITS 1
36
37#define MAX_HARDIRQ_BITS 10
38
39#ifndef HARDIRQ_BITS
40# define HARDIRQ_BITS MAX_HARDIRQ_BITS
41#endif
42
43#if HARDIRQ_BITS > MAX_HARDIRQ_BITS
44#error HARDIRQ_BITS too high!
45#endif
46
47#define PREEMPT_SHIFT 0
48#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
49#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
50#define NMI_SHIFT (HARDIRQ_SHIFT + HARDIRQ_BITS)
51
52#define __IRQ_MASK(x) ((1UL << (x))-1)
53
54#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
55#define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
56#define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
57#define NMI_MASK (__IRQ_MASK(NMI_BITS) << NMI_SHIFT)
58
59#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
60#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
61#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
62#define NMI_OFFSET (1UL << NMI_SHIFT)
63
64#define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET)
65
66#ifndef PREEMPT_ACTIVE
67#define PREEMPT_ACTIVE_BITS 1
68#define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS)
69#define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
70#endif
71
72#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS))
73#error PREEMPT_ACTIVE is too low!
74#endif
75
76#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
77#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
78#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK \
79 | NMI_MASK))
80
81/*
82 * Are we doing bottom half or hardware interrupt processing?
83 * Are we in a softirq context? Interrupt context?
84 * in_softirq - Are we currently processing softirq or have bh disabled?
85 * in_serving_softirq - Are we currently processing softirq?
86 */
87#define in_irq() (hardirq_count())
88#define in_softirq() (softirq_count())
89#define in_interrupt() (irq_count())
90#define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET)
91
92/*
93 * Are we in NMI context?
94 */
95#define in_nmi() (preempt_count() & NMI_MASK)
96
97#if defined(CONFIG_PREEMPT_COUNT)
98# define PREEMPT_CHECK_OFFSET 1
99#else
100# define PREEMPT_CHECK_OFFSET 0
101#endif
102
103/*
104 * Are we running in atomic context? WARNING: this macro cannot
105 * always detect atomic context; in particular, it cannot know about
106 * held spinlocks in non-preemptible kernels. Thus it should not be
107 * used in the general case to determine whether sleeping is possible.
108 * Do not use in_atomic() in driver code.
109 */
110#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
111
112/*
113 * Check whether we were atomic before we did preempt_disable():
114 * (used by the scheduler, *after* releasing the kernel lock)
115 */
116#define in_atomic_preempt_off() \
117 ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)
118
119#ifdef CONFIG_PREEMPT_COUNT
120# define preemptible() (preempt_count() == 0 && !irqs_disabled())
121#else
122# define preemptible() 0
123#endif
124 9
125#if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS) 10#if defined(CONFIG_SMP) || defined(CONFIG_GENERIC_HARDIRQS)
126extern void synchronize_irq(unsigned int irq); 11extern void synchronize_irq(unsigned int irq);
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index 3b589440ecfe..9231be9e90a2 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -18,11 +18,21 @@ enum hdmi_infoframe_type {
18 HDMI_INFOFRAME_TYPE_AUDIO = 0x84, 18 HDMI_INFOFRAME_TYPE_AUDIO = 0x84,
19}; 19};
20 20
21#define HDMI_IEEE_OUI 0x000c03
21#define HDMI_INFOFRAME_HEADER_SIZE 4 22#define HDMI_INFOFRAME_HEADER_SIZE 4
22#define HDMI_AVI_INFOFRAME_SIZE 13 23#define HDMI_AVI_INFOFRAME_SIZE 13
23#define HDMI_SPD_INFOFRAME_SIZE 25 24#define HDMI_SPD_INFOFRAME_SIZE 25
24#define HDMI_AUDIO_INFOFRAME_SIZE 10 25#define HDMI_AUDIO_INFOFRAME_SIZE 10
25 26
27#define HDMI_INFOFRAME_SIZE(type) \
28 (HDMI_INFOFRAME_HEADER_SIZE + HDMI_ ## type ## _INFOFRAME_SIZE)
29
30struct hdmi_any_infoframe {
31 enum hdmi_infoframe_type type;
32 unsigned char version;
33 unsigned char length;
34};
35
26enum hdmi_colorspace { 36enum hdmi_colorspace {
27 HDMI_COLORSPACE_RGB, 37 HDMI_COLORSPACE_RGB,
28 HDMI_COLORSPACE_YUV422, 38 HDMI_COLORSPACE_YUV422,
@@ -100,9 +110,6 @@ struct hdmi_avi_infoframe {
100 unsigned char version; 110 unsigned char version;
101 unsigned char length; 111 unsigned char length;
102 enum hdmi_colorspace colorspace; 112 enum hdmi_colorspace colorspace;
103 bool active_info_valid;
104 bool horizontal_bar_valid;
105 bool vertical_bar_valid;
106 enum hdmi_scan_mode scan_mode; 113 enum hdmi_scan_mode scan_mode;
107 enum hdmi_colorimetry colorimetry; 114 enum hdmi_colorimetry colorimetry;
108 enum hdmi_picture_aspect picture_aspect; 115 enum hdmi_picture_aspect picture_aspect;
@@ -218,14 +225,52 @@ int hdmi_audio_infoframe_init(struct hdmi_audio_infoframe *frame);
218ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame, 225ssize_t hdmi_audio_infoframe_pack(struct hdmi_audio_infoframe *frame,
219 void *buffer, size_t size); 226 void *buffer, size_t size);
220 227
228enum hdmi_3d_structure {
229 HDMI_3D_STRUCTURE_INVALID = -1,
230 HDMI_3D_STRUCTURE_FRAME_PACKING = 0,
231 HDMI_3D_STRUCTURE_FIELD_ALTERNATIVE,
232 HDMI_3D_STRUCTURE_LINE_ALTERNATIVE,
233 HDMI_3D_STRUCTURE_SIDE_BY_SIDE_FULL,
234 HDMI_3D_STRUCTURE_L_DEPTH,
235 HDMI_3D_STRUCTURE_L_DEPTH_GFX_GFX_DEPTH,
236 HDMI_3D_STRUCTURE_TOP_AND_BOTTOM,
237 HDMI_3D_STRUCTURE_SIDE_BY_SIDE_HALF = 8,
238};
239
240
221struct hdmi_vendor_infoframe { 241struct hdmi_vendor_infoframe {
222 enum hdmi_infoframe_type type; 242 enum hdmi_infoframe_type type;
223 unsigned char version; 243 unsigned char version;
224 unsigned char length; 244 unsigned char length;
225 u8 data[27]; 245 unsigned int oui;
246 u8 vic;
247 enum hdmi_3d_structure s3d_struct;
248 unsigned int s3d_ext_data;
226}; 249};
227 250
251int hdmi_vendor_infoframe_init(struct hdmi_vendor_infoframe *frame);
228ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame, 252ssize_t hdmi_vendor_infoframe_pack(struct hdmi_vendor_infoframe *frame,
229 void *buffer, size_t size); 253 void *buffer, size_t size);
230 254
255union hdmi_vendor_any_infoframe {
256 struct {
257 enum hdmi_infoframe_type type;
258 unsigned char version;
259 unsigned char length;
260 unsigned int oui;
261 } any;
262 struct hdmi_vendor_infoframe hdmi;
263};
264
265union hdmi_infoframe {
266 struct hdmi_any_infoframe any;
267 struct hdmi_avi_infoframe avi;
268 struct hdmi_spd_infoframe spd;
269 union hdmi_vendor_any_infoframe vendor;
270 struct hdmi_audio_infoframe audio;
271};
272
273ssize_t
274hdmi_infoframe_pack(union hdmi_infoframe *frame, void *buffer, size_t size);
275
231#endif /* _DRM_HDMI_H */ 276#endif /* _DRM_HDMI_H */
diff --git a/include/linux/hid-sensor-hub.h b/include/linux/hid-sensor-hub.h
index ecefb7311dd6..32ba45158d39 100644
--- a/include/linux/hid-sensor-hub.h
+++ b/include/linux/hid-sensor-hub.h
@@ -172,7 +172,7 @@ struct hid_sensor_common {
172 struct hid_sensor_hub_attribute_info sensitivity; 172 struct hid_sensor_hub_attribute_info sensitivity;
173}; 173};
174 174
175/*Convert from hid unit expo to regular exponent*/ 175/* Convert from hid unit expo to regular exponent */
176static inline int hid_sensor_convert_exponent(int unit_expo) 176static inline int hid_sensor_convert_exponent(int unit_expo)
177{ 177{
178 if (unit_expo < 0x08) 178 if (unit_expo < 0x08)
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h
index 6f24446e7669..4f945d3ed49f 100644
--- a/include/linux/hid-sensor-ids.h
+++ b/include/linux/hid-sensor-ids.h
@@ -37,7 +37,7 @@
37#define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458 37#define HID_USAGE_SENSOR_ANGL_VELOCITY_Y_AXIS 0x200458
38#define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459 38#define HID_USAGE_SENSOR_ANGL_VELOCITY_Z_AXIS 0x200459
39 39
40/*ORIENTATION: Compass 3D: (200083) */ 40/* ORIENTATION: Compass 3D: (200083) */
41#define HID_USAGE_SENSOR_COMPASS_3D 0x200083 41#define HID_USAGE_SENSOR_COMPASS_3D 0x200083
42#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471 42#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING 0x200471
43#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472 43#define HID_USAGE_SENSOR_ORIENT_MAGN_HEADING_X 0x200472
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 0c48991b0402..ee1ffc5e19c9 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -252,6 +252,8 @@ struct hid_item {
252#define HID_OUTPUT_REPORT 1 252#define HID_OUTPUT_REPORT 1
253#define HID_FEATURE_REPORT 2 253#define HID_FEATURE_REPORT 2
254 254
255#define HID_REPORT_TYPES 3
256
255/* 257/*
256 * HID connect requests 258 * HID connect requests
257 */ 259 */
@@ -283,6 +285,7 @@ struct hid_item {
283#define HID_QUIRK_MULTI_INPUT 0x00000040 285#define HID_QUIRK_MULTI_INPUT 0x00000040
284#define HID_QUIRK_HIDINPUT_FORCE 0x00000080 286#define HID_QUIRK_HIDINPUT_FORCE 0x00000080
285#define HID_QUIRK_NO_EMPTY_INPUT 0x00000100 287#define HID_QUIRK_NO_EMPTY_INPUT 0x00000100
288#define HID_QUIRK_NO_INIT_INPUT_REPORTS 0x00000200
286#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 289#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
287#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 290#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
288#define HID_QUIRK_NO_INIT_REPORTS 0x20000000 291#define HID_QUIRK_NO_INIT_REPORTS 0x20000000
@@ -295,6 +298,7 @@ struct hid_item {
295#define HID_GROUP_GENERIC 0x0001 298#define HID_GROUP_GENERIC 0x0001
296#define HID_GROUP_MULTITOUCH 0x0002 299#define HID_GROUP_MULTITOUCH 0x0002
297#define HID_GROUP_SENSOR_HUB 0x0003 300#define HID_GROUP_SENSOR_HUB 0x0003
301#define HID_GROUP_MULTITOUCH_WIN_8 0x0004
298 302
299/* 303/*
300 * This is the global environment of the parser. This information is 304 * This is the global environment of the parser. This information is
@@ -393,14 +397,14 @@ struct hid_report {
393 struct hid_device *device; /* associated device */ 397 struct hid_device *device; /* associated device */
394}; 398};
395 399
400#define HID_MAX_IDS 256
401
396struct hid_report_enum { 402struct hid_report_enum {
397 unsigned numbered; 403 unsigned numbered;
398 struct list_head report_list; 404 struct list_head report_list;
399 struct hid_report *report_id_hash[256]; 405 struct hid_report *report_id_hash[HID_MAX_IDS];
400}; 406};
401 407
402#define HID_REPORT_TYPES 3
403
404#define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */ 408#define HID_MIN_BUFFER_SIZE 64 /* make sure there is at least a packet size of space */
405#define HID_MAX_BUFFER_SIZE 4096 /* 4kb */ 409#define HID_MAX_BUFFER_SIZE 4096 /* 4kb */
406#define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */ 410#define HID_CONTROL_FIFO_SIZE 256 /* to init devices with >100 reports */
@@ -456,6 +460,7 @@ struct hid_device { /* device report descriptor */
456 enum hid_type type; /* device type (mouse, kbd, ...) */ 460 enum hid_type type; /* device type (mouse, kbd, ...) */
457 unsigned country; /* HID country */ 461 unsigned country; /* HID country */
458 struct hid_report_enum report_enum[HID_REPORT_TYPES]; 462 struct hid_report_enum report_enum[HID_REPORT_TYPES];
463 struct work_struct led_work; /* delayed LED worker */
459 464
460 struct semaphore driver_lock; /* protects the current driver, except during input */ 465 struct semaphore driver_lock; /* protects the current driver, except during input */
461 struct semaphore driver_input_lock; /* protects the current driver */ 466 struct semaphore driver_input_lock; /* protects the current driver */
@@ -532,6 +537,8 @@ static inline void hid_set_drvdata(struct hid_device *hdev, void *data)
532#define HID_GLOBAL_STACK_SIZE 4 537#define HID_GLOBAL_STACK_SIZE 4
533#define HID_COLLECTION_STACK_SIZE 4 538#define HID_COLLECTION_STACK_SIZE 4
534 539
540#define HID_SCAN_FLAG_MT_WIN_8 0x00000001
541
535struct hid_parser { 542struct hid_parser {
536 struct hid_global global; 543 struct hid_global global;
537 struct hid_global global_stack[HID_GLOBAL_STACK_SIZE]; 544 struct hid_global global_stack[HID_GLOBAL_STACK_SIZE];
@@ -540,6 +547,7 @@ struct hid_parser {
540 unsigned collection_stack[HID_COLLECTION_STACK_SIZE]; 547 unsigned collection_stack[HID_COLLECTION_STACK_SIZE];
541 unsigned collection_stack_ptr; 548 unsigned collection_stack_ptr;
542 struct hid_device *device; 549 struct hid_device *device;
550 unsigned scan_flags;
543}; 551};
544 552
545struct hid_class_descriptor { 553struct hid_class_descriptor {
@@ -744,6 +752,7 @@ struct hid_field *hidinput_get_led_field(struct hid_device *hid);
744unsigned int hidinput_count_leds(struct hid_device *hid); 752unsigned int hidinput_count_leds(struct hid_device *hid);
745__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code); 753__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code);
746void hid_output_report(struct hid_report *report, __u8 *data); 754void hid_output_report(struct hid_report *report, __u8 *data);
755u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags);
747struct hid_device *hid_allocate_device(void); 756struct hid_device *hid_allocate_device(void);
748struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); 757struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id);
749int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); 758int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size);
@@ -989,7 +998,6 @@ int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size,
989u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); 998u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct);
990int usbhid_quirks_init(char **quirks_param); 999int usbhid_quirks_init(char **quirks_param);
991void usbhid_quirks_exit(void); 1000void usbhid_quirks_exit(void);
992void usbhid_set_leds(struct hid_device *hid);
993 1001
994#ifdef CONFIG_HID_PID 1002#ifdef CONFIG_HID_PID
995int hid_pidff_init(struct hid_device *hid); 1003int hid_pidff_init(struct hid_device *hid);
diff --git a/include/linux/hidraw.h b/include/linux/hidraw.h
index 2451662c728a..ddf52612eed8 100644
--- a/include/linux/hidraw.h
+++ b/include/linux/hidraw.h
@@ -23,6 +23,7 @@ struct hidraw {
23 wait_queue_head_t wait; 23 wait_queue_head_t wait;
24 struct hid_device *hid; 24 struct hid_device *hid;
25 struct device *dev; 25 struct device *dev;
26 spinlock_t list_lock;
26 struct list_head list; 27 struct list_head list;
27}; 28};
28 29
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index fae8bac907ef..a3b8b2e2d244 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -27,6 +27,14 @@
27 27
28#include <linux/types.h> 28#include <linux/types.h>
29 29
30/*
31 * Framework version for util services.
32 */
33
34#define UTIL_FW_MAJOR 3
35#define UTIL_FW_MINOR 0
36#define UTIL_FW_MAJOR_MINOR (UTIL_FW_MAJOR << 16 | UTIL_FW_MINOR)
37
30 38
31/* 39/*
32 * Implementation of host controlled snapshot of the guest. 40 * Implementation of host controlled snapshot of the guest.
@@ -455,27 +463,6 @@ hv_get_ringbuffer_availbytes(struct hv_ring_buffer_info *rbi,
455 *read = dsize - *write; 463 *read = dsize - *write;
456} 464}
457 465
458
459/*
460 * We use the same version numbering for all Hyper-V modules.
461 *
462 * Definition of versioning is as follows;
463 *
464 * Major Number Changes for these scenarios;
465 * 1. When a new version of Windows Hyper-V
466 * is released.
467 * 2. A Major change has occurred in the
468 * Linux IC's.
469 * (For example the merge for the first time
470 * into the kernel) Every time the Major Number
471 * changes, the Revision number is reset to 0.
472 * Minor Number Changes when new functionality is added
473 * to the Linux IC's that is not a bug fix.
474 *
475 * 3.1 - Added completed hv_utils driver. Shutdown/Heartbeat/Timesync
476 */
477#define HV_DRV_VERSION "3.1"
478
479/* 466/*
480 * VMBUS version is 32 bit entity broken up into 467 * VMBUS version is 32 bit entity broken up into
481 * two 16 bit quantities: major_number. minor_number. 468 * two 16 bit quantities: major_number. minor_number.
@@ -1494,7 +1481,7 @@ struct hyperv_service_callback {
1494}; 1481};
1495 1482
1496#define MAX_SRV_VER 0x7ffffff 1483#define MAX_SRV_VER 0x7ffffff
1497extern void vmbus_prep_negotiate_resp(struct icmsg_hdr *, 1484extern bool vmbus_prep_negotiate_resp(struct icmsg_hdr *,
1498 struct icmsg_negotiate *, u8 *, int, 1485 struct icmsg_negotiate *, u8 *, int,
1499 int); 1486 int);
1500 1487
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index e988fa935b3c..2ab11dc38077 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -447,11 +447,13 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data)
447static inline struct i2c_adapter * 447static inline struct i2c_adapter *
448i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) 448i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter)
449{ 449{
450#if IS_ENABLED(I2C_MUX)
450 struct device *parent = adapter->dev.parent; 451 struct device *parent = adapter->dev.parent;
451 452
452 if (parent != NULL && parent->type == &i2c_adapter_type) 453 if (parent != NULL && parent->type == &i2c_adapter_type)
453 return to_i2c_adapter(parent); 454 return to_i2c_adapter(parent);
454 else 455 else
456#endif
455 return NULL; 457 return NULL;
456} 458}
457 459
@@ -542,10 +544,24 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
542 544
543#endif /* I2C */ 545#endif /* I2C */
544 546
545#if IS_ENABLED(CONFIG_ACPI_I2C) 547#if IS_ENABLED(CONFIG_OF)
546extern void acpi_i2c_register_devices(struct i2c_adapter *adap); 548/* must call put_device() when done with returned i2c_client device */
549extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
550
551/* must call put_device() when done with returned i2c_adapter device */
552extern struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node);
553
547#else 554#else
548static inline void acpi_i2c_register_devices(struct i2c_adapter *adap) {} 555
549#endif 556static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
557{
558 return NULL;
559}
560
561static inline struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node)
562{
563 return NULL;
564}
565#endif /* CONFIG_OF */
550 566
551#endif /* _LINUX_I2C_H */ 567#endif /* _LINUX_I2C_H */
diff --git a/include/linux/i2c/i2c-hid.h b/include/linux/i2c/i2c-hid.h
index 60e411d764d4..7aa901d92058 100644
--- a/include/linux/i2c/i2c-hid.h
+++ b/include/linux/i2c/i2c-hid.h
@@ -19,7 +19,8 @@
19 * @hid_descriptor_address: i2c register where the HID descriptor is stored. 19 * @hid_descriptor_address: i2c register where the HID descriptor is stored.
20 * 20 *
21 * Note that it is the responsibility of the platform driver (or the acpi 5.0 21 * Note that it is the responsibility of the platform driver (or the acpi 5.0
22 * driver) to setup the irq related to the gpio in the struct i2c_board_info. 22 * driver, or the flattened device tree) to setup the irq related to the gpio in
23 * the struct i2c_board_info.
23 * The platform driver should also setup the gpio according to the device: 24 * The platform driver should also setup the gpio according to the device:
24 * 25 *
25 * A typical example is the following: 26 * A typical example is the following:
diff --git a/include/linux/i2c/pxa-i2c.h b/include/linux/i2c/pxa-i2c.h
index 1a9f65e6ec0f..53aab243cbd8 100644
--- a/include/linux/i2c/pxa-i2c.h
+++ b/include/linux/i2c/pxa-i2c.h
@@ -67,6 +67,9 @@ struct i2c_pxa_platform_data {
67 unsigned int class; 67 unsigned int class;
68 unsigned int use_pio :1; 68 unsigned int use_pio :1;
69 unsigned int fast_mode :1; 69 unsigned int fast_mode :1;
70 unsigned int high_mode:1;
71 unsigned char master_code;
72 unsigned long rate;
70}; 73};
71 74
72extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info); 75extern void pxa_set_i2c_info(struct i2c_pxa_platform_data *info);
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index b0dc87a2a376..a5b598a79bec 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -16,6 +16,7 @@
16#define LINUX_IEEE80211_H 16#define LINUX_IEEE80211_H
17 17
18#include <linux/types.h> 18#include <linux/types.h>
19#include <linux/if_ether.h>
19#include <asm/byteorder.h> 20#include <asm/byteorder.h>
20 21
21/* 22/*
@@ -209,28 +210,28 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
209struct ieee80211_hdr { 210struct ieee80211_hdr {
210 __le16 frame_control; 211 __le16 frame_control;
211 __le16 duration_id; 212 __le16 duration_id;
212 u8 addr1[6]; 213 u8 addr1[ETH_ALEN];
213 u8 addr2[6]; 214 u8 addr2[ETH_ALEN];
214 u8 addr3[6]; 215 u8 addr3[ETH_ALEN];
215 __le16 seq_ctrl; 216 __le16 seq_ctrl;
216 u8 addr4[6]; 217 u8 addr4[ETH_ALEN];
217} __packed __aligned(2); 218} __packed __aligned(2);
218 219
219struct ieee80211_hdr_3addr { 220struct ieee80211_hdr_3addr {
220 __le16 frame_control; 221 __le16 frame_control;
221 __le16 duration_id; 222 __le16 duration_id;
222 u8 addr1[6]; 223 u8 addr1[ETH_ALEN];
223 u8 addr2[6]; 224 u8 addr2[ETH_ALEN];
224 u8 addr3[6]; 225 u8 addr3[ETH_ALEN];
225 __le16 seq_ctrl; 226 __le16 seq_ctrl;
226} __packed __aligned(2); 227} __packed __aligned(2);
227 228
228struct ieee80211_qos_hdr { 229struct ieee80211_qos_hdr {
229 __le16 frame_control; 230 __le16 frame_control;
230 __le16 duration_id; 231 __le16 duration_id;
231 u8 addr1[6]; 232 u8 addr1[ETH_ALEN];
232 u8 addr2[6]; 233 u8 addr2[ETH_ALEN];
233 u8 addr3[6]; 234 u8 addr3[ETH_ALEN];
234 __le16 seq_ctrl; 235 __le16 seq_ctrl;
235 __le16 qos_ctrl; 236 __le16 qos_ctrl;
236} __packed __aligned(2); 237} __packed __aligned(2);
@@ -608,8 +609,8 @@ struct ieee80211s_hdr {
608 u8 flags; 609 u8 flags;
609 u8 ttl; 610 u8 ttl;
610 __le32 seqnum; 611 __le32 seqnum;
611 u8 eaddr1[6]; 612 u8 eaddr1[ETH_ALEN];
612 u8 eaddr2[6]; 613 u8 eaddr2[ETH_ALEN];
613} __packed __aligned(2); 614} __packed __aligned(2);
614 615
615/* Mesh flags */ 616/* Mesh flags */
@@ -758,7 +759,7 @@ struct ieee80211_rann_ie {
758 u8 rann_flags; 759 u8 rann_flags;
759 u8 rann_hopcount; 760 u8 rann_hopcount;
760 u8 rann_ttl; 761 u8 rann_ttl;
761 u8 rann_addr[6]; 762 u8 rann_addr[ETH_ALEN];
762 __le32 rann_seq; 763 __le32 rann_seq;
763 __le32 rann_interval; 764 __le32 rann_interval;
764 __le32 rann_metric; 765 __le32 rann_metric;
@@ -802,9 +803,9 @@ enum ieee80211_vht_opmode_bits {
802struct ieee80211_mgmt { 803struct ieee80211_mgmt {
803 __le16 frame_control; 804 __le16 frame_control;
804 __le16 duration; 805 __le16 duration;
805 u8 da[6]; 806 u8 da[ETH_ALEN];
806 u8 sa[6]; 807 u8 sa[ETH_ALEN];
807 u8 bssid[6]; 808 u8 bssid[ETH_ALEN];
808 __le16 seq_ctrl; 809 __le16 seq_ctrl;
809 union { 810 union {
810 struct { 811 struct {
@@ -833,7 +834,7 @@ struct ieee80211_mgmt {
833 struct { 834 struct {
834 __le16 capab_info; 835 __le16 capab_info;
835 __le16 listen_interval; 836 __le16 listen_interval;
836 u8 current_ap[6]; 837 u8 current_ap[ETH_ALEN];
837 /* followed by SSID and Supported rates */ 838 /* followed by SSID and Supported rates */
838 u8 variable[0]; 839 u8 variable[0];
839 } __packed reassoc_req; 840 } __packed reassoc_req;
@@ -966,21 +967,21 @@ struct ieee80211_vendor_ie {
966struct ieee80211_rts { 967struct ieee80211_rts {
967 __le16 frame_control; 968 __le16 frame_control;
968 __le16 duration; 969 __le16 duration;
969 u8 ra[6]; 970 u8 ra[ETH_ALEN];
970 u8 ta[6]; 971 u8 ta[ETH_ALEN];
971} __packed __aligned(2); 972} __packed __aligned(2);
972 973
973struct ieee80211_cts { 974struct ieee80211_cts {
974 __le16 frame_control; 975 __le16 frame_control;
975 __le16 duration; 976 __le16 duration;
976 u8 ra[6]; 977 u8 ra[ETH_ALEN];
977} __packed __aligned(2); 978} __packed __aligned(2);
978 979
979struct ieee80211_pspoll { 980struct ieee80211_pspoll {
980 __le16 frame_control; 981 __le16 frame_control;
981 __le16 aid; 982 __le16 aid;
982 u8 bssid[6]; 983 u8 bssid[ETH_ALEN];
983 u8 ta[6]; 984 u8 ta[ETH_ALEN];
984} __packed __aligned(2); 985} __packed __aligned(2);
985 986
986/* TDLS */ 987/* TDLS */
@@ -989,14 +990,14 @@ struct ieee80211_pspoll {
989struct ieee80211_tdls_lnkie { 990struct ieee80211_tdls_lnkie {
990 u8 ie_type; /* Link Identifier IE */ 991 u8 ie_type; /* Link Identifier IE */
991 u8 ie_len; 992 u8 ie_len;
992 u8 bssid[6]; 993 u8 bssid[ETH_ALEN];
993 u8 init_sta[6]; 994 u8 init_sta[ETH_ALEN];
994 u8 resp_sta[6]; 995 u8 resp_sta[ETH_ALEN];
995} __packed; 996} __packed;
996 997
997struct ieee80211_tdls_data { 998struct ieee80211_tdls_data {
998 u8 da[6]; 999 u8 da[ETH_ALEN];
999 u8 sa[6]; 1000 u8 sa[ETH_ALEN];
1000 __be16 ether_type; 1001 __be16 ether_type;
1001 u8 payload_type; 1002 u8 payload_type;
1002 u8 category; 1003 u8 category;
@@ -1090,8 +1091,8 @@ struct ieee80211_p2p_noa_attr {
1090struct ieee80211_bar { 1091struct ieee80211_bar {
1091 __le16 frame_control; 1092 __le16 frame_control;
1092 __le16 duration; 1093 __le16 duration;
1093 __u8 ra[6]; 1094 __u8 ra[ETH_ALEN];
1094 __u8 ta[6]; 1095 __u8 ta[ETH_ALEN];
1095 __le16 control; 1096 __le16 control;
1096 __le16 start_seq_num; 1097 __le16 start_seq_num;
1097} __packed; 1098} __packed;
@@ -1709,6 +1710,10 @@ enum ieee80211_eid {
1709 WLAN_EID_OPMODE_NOTIF = 199, 1710 WLAN_EID_OPMODE_NOTIF = 199,
1710 WLAN_EID_WIDE_BW_CHANNEL_SWITCH = 194, 1711 WLAN_EID_WIDE_BW_CHANNEL_SWITCH = 194,
1711 WLAN_EID_CHANNEL_SWITCH_WRAPPER = 196, 1712 WLAN_EID_CHANNEL_SWITCH_WRAPPER = 196,
1713 WLAN_EID_EXTENDED_BSS_LOAD = 193,
1714 WLAN_EID_VHT_TX_POWER_ENVELOPE = 195,
1715 WLAN_EID_AID = 197,
1716 WLAN_EID_QUIET_CHANNEL = 198,
1712 1717
1713 /* 802.11ad */ 1718 /* 802.11ad */
1714 WLAN_EID_NON_TX_BSSID_CAP = 83, 1719 WLAN_EID_NON_TX_BSSID_CAP = 83,
@@ -1860,6 +1865,11 @@ enum ieee80211_tdls_actioncode {
1860 WLAN_TDLS_DISCOVERY_REQUEST = 10, 1865 WLAN_TDLS_DISCOVERY_REQUEST = 10,
1861}; 1866};
1862 1867
1868/* Interworking capabilities are set in 7th bit of 4th byte of the
1869 * @WLAN_EID_EXT_CAPABILITY information element
1870 */
1871#define WLAN_EXT_CAPA4_INTERWORKING_ENABLED BIT(7)
1872
1863/* 1873/*
1864 * TDLS capabililites to be enabled in the 5th byte of the 1874 * TDLS capabililites to be enabled in the 5th byte of the
1865 * @WLAN_EID_EXT_CAPABILITY information element 1875 * @WLAN_EID_EXT_CAPABILITY information element
@@ -2279,4 +2289,8 @@ static inline bool ieee80211_check_tim(const struct ieee80211_tim_ie *tim,
2279 return !!(tim->virtual_map[index] & mask); 2289 return !!(tim->virtual_map[index] & mask);
2280} 2290}
2281 2291
2292/* convert time units */
2293#define TU_TO_JIFFIES(x) (usecs_to_jiffies((x) * 1024))
2294#define TU_TO_EXP_TIME(x) (jiffies + TU_TO_JIFFIES(x))
2295
2282#endif /* LINUX_IEEE80211_H */ 2296#endif /* LINUX_IEEE80211_H */
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index f6156f91eb1c..a899dc24be15 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -10,9 +10,9 @@
10#ifndef _LINUX_IF_TEAM_H_ 10#ifndef _LINUX_IF_TEAM_H_
11#define _LINUX_IF_TEAM_H_ 11#define _LINUX_IF_TEAM_H_
12 12
13
14#include <linux/netpoll.h> 13#include <linux/netpoll.h>
15#include <net/sch_generic.h> 14#include <net/sch_generic.h>
15#include <linux/types.h>
16#include <uapi/linux/if_team.h> 16#include <uapi/linux/if_team.h>
17 17
18struct team_pcpu_stats { 18struct team_pcpu_stats {
@@ -194,6 +194,18 @@ struct team {
194 bool user_carrier_enabled; 194 bool user_carrier_enabled;
195 bool queue_override_enabled; 195 bool queue_override_enabled;
196 struct list_head *qom_lists; /* array of queue override mapping lists */ 196 struct list_head *qom_lists; /* array of queue override mapping lists */
197 struct {
198 unsigned int count;
199 unsigned int interval; /* in ms */
200 atomic_t count_pending;
201 struct delayed_work dw;
202 } notify_peers;
203 struct {
204 unsigned int count;
205 unsigned int interval; /* in ms */
206 atomic_t count_pending;
207 struct delayed_work dw;
208 } mcast_rejoin;
197 long mode_priv[TEAM_MODE_PRIV_LONGS]; 209 long mode_priv[TEAM_MODE_PRIV_LONGS];
198}; 210};
199 211
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index e3362b5f13e8..f47550d75f85 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -129,6 +129,5 @@ extern void ip_mc_unmap(struct in_device *);
129extern void ip_mc_remap(struct in_device *); 129extern void ip_mc_remap(struct in_device *);
130extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); 130extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr);
131extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); 131extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
132extern void ip_mc_rejoin_groups(struct in_device *in_dev);
133 132
134#endif 133#endif
diff --git a/include/linux/iio/common/st_sensors.h b/include/linux/iio/common/st_sensors.h
index 72b26940730d..e51f65480ea5 100644
--- a/include/linux/iio/common/st_sensors.h
+++ b/include/linux/iio/common/st_sensors.h
@@ -17,6 +17,8 @@
17#include <linux/iio/trigger.h> 17#include <linux/iio/trigger.h>
18#include <linux/bitops.h> 18#include <linux/bitops.h>
19 19
20#include <linux/platform_data/st_sensors_pdata.h>
21
20#define ST_SENSORS_TX_MAX_LENGTH 2 22#define ST_SENSORS_TX_MAX_LENGTH 2
21#define ST_SENSORS_RX_MAX_LENGTH 6 23#define ST_SENSORS_RX_MAX_LENGTH 6
22 24
@@ -118,14 +120,16 @@ struct st_sensor_bdu {
118/** 120/**
119 * struct st_sensor_data_ready_irq - ST sensor device data-ready interrupt 121 * struct st_sensor_data_ready_irq - ST sensor device data-ready interrupt
120 * @addr: address of the register. 122 * @addr: address of the register.
121 * @mask: mask to write the on/off value. 123 * @mask_int1: mask to enable/disable IRQ on INT1 pin.
124 * @mask_int2: mask to enable/disable IRQ on INT2 pin.
122 * struct ig1 - represents the Interrupt Generator 1 of sensors. 125 * struct ig1 - represents the Interrupt Generator 1 of sensors.
123 * @en_addr: address of the enable ig1 register. 126 * @en_addr: address of the enable ig1 register.
124 * @en_mask: mask to write the on/off value for enable. 127 * @en_mask: mask to write the on/off value for enable.
125 */ 128 */
126struct st_sensor_data_ready_irq { 129struct st_sensor_data_ready_irq {
127 u8 addr; 130 u8 addr;
128 u8 mask; 131 u8 mask_int1;
132 u8 mask_int2;
129 struct { 133 struct {
130 u8 en_addr; 134 u8 en_addr;
131 u8 en_mask; 135 u8 en_mask;
@@ -201,6 +205,7 @@ struct st_sensors {
201 * @buffer_data: Data used by buffer part. 205 * @buffer_data: Data used by buffer part.
202 * @odr: Output data rate of the sensor [Hz]. 206 * @odr: Output data rate of the sensor [Hz].
203 * num_data_channels: Number of data channels used in buffer. 207 * num_data_channels: Number of data channels used in buffer.
208 * @drdy_int_pin: Redirect DRDY on pin 1 (1) or pin 2 (2).
204 * @get_irq_data_ready: Function to get the IRQ used for data ready signal. 209 * @get_irq_data_ready: Function to get the IRQ used for data ready signal.
205 * @tf: Transfer function structure used by I/O operations. 210 * @tf: Transfer function structure used by I/O operations.
206 * @tb: Transfer buffers and mutex used by I/O operations. 211 * @tb: Transfer buffers and mutex used by I/O operations.
@@ -219,6 +224,8 @@ struct st_sensor_data {
219 unsigned int odr; 224 unsigned int odr;
220 unsigned int num_data_channels; 225 unsigned int num_data_channels;
221 226
227 u8 drdy_int_pin;
228
222 unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev); 229 unsigned int (*get_irq_data_ready) (struct iio_dev *indio_dev);
223 230
224 const struct st_sensor_transfer_function *tf; 231 const struct st_sensor_transfer_function *tf;
@@ -249,7 +256,8 @@ static inline void st_sensors_deallocate_trigger(struct iio_dev *indio_dev)
249} 256}
250#endif 257#endif
251 258
252int st_sensors_init_sensor(struct iio_dev *indio_dev); 259int st_sensors_init_sensor(struct iio_dev *indio_dev,
260 struct st_sensors_platform_data *pdata);
253 261
254int st_sensors_set_enable(struct iio_dev *indio_dev, bool enable); 262int st_sensors_set_enable(struct iio_dev *indio_dev, bool enable);
255 263
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 3d35b7023591..2103cc32a5fb 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -532,6 +532,60 @@ static inline struct iio_dev *iio_priv_to_dev(void *priv)
532void iio_device_free(struct iio_dev *indio_dev); 532void iio_device_free(struct iio_dev *indio_dev);
533 533
534/** 534/**
535 * devm_iio_device_alloc - Resource-managed iio_device_alloc()
536 * @dev: Device to allocate iio_dev for
537 * @sizeof_priv: Space to allocate for private structure.
538 *
539 * Managed iio_device_alloc. iio_dev allocated with this function is
540 * automatically freed on driver detach.
541 *
542 * If an iio_dev allocated with this function needs to be freed separately,
543 * devm_iio_device_free() must be used.
544 *
545 * RETURNS:
546 * Pointer to allocated iio_dev on success, NULL on failure.
547 */
548struct iio_dev *devm_iio_device_alloc(struct device *dev, int sizeof_priv);
549
550/**
551 * devm_iio_device_free - Resource-managed iio_device_free()
552 * @dev: Device this iio_dev belongs to
553 * @indio_dev: the iio_dev associated with the device
554 *
555 * Free iio_dev allocated with devm_iio_device_alloc().
556 */
557void devm_iio_device_free(struct device *dev, struct iio_dev *indio_dev);
558
559/**
560 * devm_iio_trigger_alloc - Resource-managed iio_trigger_alloc()
561 * @dev: Device to allocate iio_trigger for
562 * @fmt: trigger name format. If it includes format
563 * specifiers, the additional arguments following
564 * format are formatted and inserted in the resulting
565 * string replacing their respective specifiers.
566 *
567 * Managed iio_trigger_alloc. iio_trigger allocated with this function is
568 * automatically freed on driver detach.
569 *
570 * If an iio_trigger allocated with this function needs to be freed separately,
571 * devm_iio_trigger_free() must be used.
572 *
573 * RETURNS:
574 * Pointer to allocated iio_trigger on success, NULL on failure.
575 */
576struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
577 const char *fmt, ...);
578
579/**
580 * devm_iio_trigger_free - Resource-managed iio_trigger_free()
581 * @dev: Device this iio_dev belongs to
582 * @iio_trig: the iio_trigger associated with the device
583 *
584 * Free iio_trigger allocated with devm_iio_trigger_alloc().
585 */
586void devm_iio_trigger_free(struct device *dev, struct iio_trigger *iio_trig);
587
588/**
535 * iio_buffer_enabled() - helper function to test if the buffer is enabled 589 * iio_buffer_enabled() - helper function to test if the buffer is enabled
536 * @indio_dev: IIO device structure for device 590 * @indio_dev: IIO device structure for device
537 **/ 591 **/
diff --git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h
index b7a934b9431b..2958c960003a 100644
--- a/include/linux/iio/sysfs.h
+++ b/include/linux/iio/sysfs.h
@@ -73,11 +73,6 @@ struct iio_const_attr {
73 .dev_attr = __ATTR(_name, S_IRUGO, iio_read_const_attr, NULL)} 73 .dev_attr = __ATTR(_name, S_IRUGO, iio_read_const_attr, NULL)}
74 74
75/* Generic attributes of onetype or another */ 75/* Generic attributes of onetype or another */
76/**
77 * IIO_DEV_ATTR_RESET: resets the device
78 **/
79#define IIO_DEV_ATTR_RESET(_store) \
80 IIO_DEVICE_ATTR(reset, S_IWUSR, NULL, _store, 0)
81 76
82/** 77/**
83 * IIO_DEV_ATTR_SAMP_FREQ - sets any internal clock frequency 78 * IIO_DEV_ATTR_SAMP_FREQ - sets any internal clock frequency
diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h
index 3869c525b052..369cf2cd5144 100644
--- a/include/linux/iio/trigger.h
+++ b/include/linux/iio/trigger.h
@@ -8,6 +8,7 @@
8 */ 8 */
9#include <linux/irq.h> 9#include <linux/irq.h>
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/atomic.h>
11 12
12#ifndef _IIO_TRIGGER_H_ 13#ifndef _IIO_TRIGGER_H_
13#define _IIO_TRIGGER_H_ 14#define _IIO_TRIGGER_H_
@@ -61,7 +62,7 @@ struct iio_trigger {
61 62
62 struct list_head list; 63 struct list_head list;
63 struct list_head alloc_list; 64 struct list_head alloc_list;
64 int use_count; 65 atomic_t use_count;
65 66
66 struct irq_chip subirq_chip; 67 struct irq_chip subirq_chip;
67 int subirq_base; 68 int subirq_base;
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index b99cd23f3474..79640e015a86 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -5,45 +5,13 @@
5 5
6#include <linux/bitmap.h> 6#include <linux/bitmap.h>
7#include <linux/if.h> 7#include <linux/if.h>
8#include <linux/ip.h>
8#include <linux/netdevice.h> 9#include <linux/netdevice.h>
9#include <linux/rcupdate.h> 10#include <linux/rcupdate.h>
10#include <linux/timer.h> 11#include <linux/timer.h>
11#include <linux/sysctl.h> 12#include <linux/sysctl.h>
12#include <linux/rtnetlink.h> 13#include <linux/rtnetlink.h>
13 14
14enum
15{
16 IPV4_DEVCONF_FORWARDING=1,
17 IPV4_DEVCONF_MC_FORWARDING,
18 IPV4_DEVCONF_PROXY_ARP,
19 IPV4_DEVCONF_ACCEPT_REDIRECTS,
20 IPV4_DEVCONF_SECURE_REDIRECTS,
21 IPV4_DEVCONF_SEND_REDIRECTS,
22 IPV4_DEVCONF_SHARED_MEDIA,
23 IPV4_DEVCONF_RP_FILTER,
24 IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE,
25 IPV4_DEVCONF_BOOTP_RELAY,
26 IPV4_DEVCONF_LOG_MARTIANS,
27 IPV4_DEVCONF_TAG,
28 IPV4_DEVCONF_ARPFILTER,
29 IPV4_DEVCONF_MEDIUM_ID,
30 IPV4_DEVCONF_NOXFRM,
31 IPV4_DEVCONF_NOPOLICY,
32 IPV4_DEVCONF_FORCE_IGMP_VERSION,
33 IPV4_DEVCONF_ARP_ANNOUNCE,
34 IPV4_DEVCONF_ARP_IGNORE,
35 IPV4_DEVCONF_PROMOTE_SECONDARIES,
36 IPV4_DEVCONF_ARP_ACCEPT,
37 IPV4_DEVCONF_ARP_NOTIFY,
38 IPV4_DEVCONF_ACCEPT_LOCAL,
39 IPV4_DEVCONF_SRC_VMARK,
40 IPV4_DEVCONF_PROXY_ARP_PVLAN,
41 IPV4_DEVCONF_ROUTE_LOCALNET,
42 __IPV4_DEVCONF_MAX
43};
44
45#define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1)
46
47struct ipv4_devconf { 15struct ipv4_devconf {
48 void *sysctl; 16 void *sysctl;
49 int data[IPV4_DEVCONF_MAX]; 17 int data[IPV4_DEVCONF_MAX];
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 850e95bc766c..28ea38439313 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -19,6 +19,8 @@ struct ipv6_devconf {
19 __s32 rtr_solicit_interval; 19 __s32 rtr_solicit_interval;
20 __s32 rtr_solicit_delay; 20 __s32 rtr_solicit_delay;
21 __s32 force_mld_version; 21 __s32 force_mld_version;
22 __s32 mldv1_unsolicited_report_interval;
23 __s32 mldv2_unsolicited_report_interval;
22#ifdef CONFIG_IPV6_PRIVACY 24#ifdef CONFIG_IPV6_PRIVACY
23 __s32 use_tempaddr; 25 __s32 use_tempaddr;
24 __s32 temp_valid_lft; 26 __s32 temp_valid_lft;
@@ -48,6 +50,7 @@ struct ipv6_devconf {
48 __s32 accept_dad; 50 __s32 accept_dad;
49 __s32 force_tllao; 51 __s32 force_tllao;
50 __s32 ndisc_notify; 52 __s32 ndisc_notify;
53 __s32 suppress_frag_ndisc;
51 void *sysctl; 54 void *sysctl;
52}; 55};
53 56
@@ -101,6 +104,7 @@ struct inet6_skb_parm {
101#define IP6SKB_FORWARDED 2 104#define IP6SKB_FORWARDED 2
102#define IP6SKB_REROUTED 4 105#define IP6SKB_REROUTED 4
103#define IP6SKB_ROUTERALERT 8 106#define IP6SKB_ROUTERALERT 8
107#define IP6SKB_FRAGMENTED 16
104}; 108};
105 109
106#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) 110#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb))
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 8685d1be12c7..31229e0be90b 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -57,16 +57,13 @@
57#define JBD_EXPENSIVE_CHECKING 57#define JBD_EXPENSIVE_CHECKING
58extern u8 journal_enable_debug; 58extern u8 journal_enable_debug;
59 59
60#define jbd_debug(n, f, a...) \ 60void __jbd_debug(int level, const char *file, const char *func,
61 do { \ 61 unsigned int line, const char *fmt, ...);
62 if ((n) <= journal_enable_debug) { \ 62
63 printk (KERN_DEBUG "(%s, %d): %s: ", \ 63#define jbd_debug(n, fmt, a...) \
64 __FILE__, __LINE__, __func__); \ 64 __jbd_debug((n), __FILE__, __func__, __LINE__, (fmt), ##a)
65 printk (f, ## a); \
66 } \
67 } while (0)
68#else 65#else
69#define jbd_debug(f, a...) /**/ 66#define jbd_debug(n, fmt, a...) /**/
70#endif 67#endif
71 68
72static inline void *jbd_alloc(size_t size, gfp_t flags) 69static inline void *jbd_alloc(size_t size, gfp_t flags)
@@ -77,7 +74,7 @@ static inline void *jbd_alloc(size_t size, gfp_t flags)
77static inline void jbd_free(void *ptr, size_t size) 74static inline void jbd_free(void *ptr, size_t size)
78{ 75{
79 free_pages((unsigned long)ptr, get_order(size)); 76 free_pages((unsigned long)ptr, get_order(size));
80}; 77}
81 78
82#define JFS_MIN_JOURNAL_BLOCKS 1024 79#define JFS_MIN_JOURNAL_BLOCKS 1024
83 80
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 97ba4e78a37e..d235e88cfd7c 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -101,13 +101,13 @@ static inline u64 get_jiffies_64(void)
101#define time_after(a,b) \ 101#define time_after(a,b) \
102 (typecheck(unsigned long, a) && \ 102 (typecheck(unsigned long, a) && \
103 typecheck(unsigned long, b) && \ 103 typecheck(unsigned long, b) && \
104 ((long)(b) - (long)(a) < 0)) 104 ((long)((b) - (a)) < 0))
105#define time_before(a,b) time_after(b,a) 105#define time_before(a,b) time_after(b,a)
106 106
107#define time_after_eq(a,b) \ 107#define time_after_eq(a,b) \
108 (typecheck(unsigned long, a) && \ 108 (typecheck(unsigned long, a) && \
109 typecheck(unsigned long, b) && \ 109 typecheck(unsigned long, b) && \
110 ((long)(a) - (long)(b) >= 0)) 110 ((long)((a) - (b)) >= 0))
111#define time_before_eq(a,b) time_after_eq(b,a) 111#define time_before_eq(a,b) time_after_eq(b,a)
112 112
113/* 113/*
@@ -130,13 +130,13 @@ static inline u64 get_jiffies_64(void)
130#define time_after64(a,b) \ 130#define time_after64(a,b) \
131 (typecheck(__u64, a) && \ 131 (typecheck(__u64, a) && \
132 typecheck(__u64, b) && \ 132 typecheck(__u64, b) && \
133 ((__s64)(b) - (__s64)(a) < 0)) 133 ((__s64)((b) - (a)) < 0))
134#define time_before64(a,b) time_after64(b,a) 134#define time_before64(a,b) time_after64(b,a)
135 135
136#define time_after_eq64(a,b) \ 136#define time_after_eq64(a,b) \
137 (typecheck(__u64, a) && \ 137 (typecheck(__u64, a) && \
138 typecheck(__u64, b) && \ 138 typecheck(__u64, b) && \
139 ((__s64)(a) - (__s64)(b) >= 0)) 139 ((__s64)((a) - (b)) >= 0))
140#define time_before_eq64(a,b) time_after_eq64(b,a) 140#define time_before_eq64(a,b) time_after_eq64(b,a)
141 141
142#define time_in_range64(a, b, c) \ 142#define time_in_range64(a, b, c) \
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 0976fc46d1e0..a5079072da66 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -48,7 +48,6 @@
48 48
49#include <linux/types.h> 49#include <linux/types.h>
50#include <linux/compiler.h> 50#include <linux/compiler.h>
51#include <linux/workqueue.h>
52 51
53#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL) 52#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
54 53
@@ -61,12 +60,6 @@ struct static_key {
61#endif 60#endif
62}; 61};
63 62
64struct static_key_deferred {
65 struct static_key key;
66 unsigned long timeout;
67 struct delayed_work work;
68};
69
70# include <asm/jump_label.h> 63# include <asm/jump_label.h>
71# define HAVE_JUMP_LABEL 64# define HAVE_JUMP_LABEL
72#endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */ 65#endif /* CC_HAVE_ASM_GOTO && CONFIG_JUMP_LABEL */
@@ -78,6 +71,7 @@ enum jump_label_type {
78 71
79struct module; 72struct module;
80 73
74#include <linux/atomic.h>
81#ifdef HAVE_JUMP_LABEL 75#ifdef HAVE_JUMP_LABEL
82 76
83#define JUMP_LABEL_TRUE_BRANCH 1UL 77#define JUMP_LABEL_TRUE_BRANCH 1UL
@@ -119,10 +113,7 @@ extern void arch_jump_label_transform_static(struct jump_entry *entry,
119extern int jump_label_text_reserved(void *start, void *end); 113extern int jump_label_text_reserved(void *start, void *end);
120extern void static_key_slow_inc(struct static_key *key); 114extern void static_key_slow_inc(struct static_key *key);
121extern void static_key_slow_dec(struct static_key *key); 115extern void static_key_slow_dec(struct static_key *key);
122extern void static_key_slow_dec_deferred(struct static_key_deferred *key);
123extern void jump_label_apply_nops(struct module *mod); 116extern void jump_label_apply_nops(struct module *mod);
124extern void
125jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
126 117
127#define STATIC_KEY_INIT_TRUE ((struct static_key) \ 118#define STATIC_KEY_INIT_TRUE ((struct static_key) \
128 { .enabled = ATOMIC_INIT(1), .entries = (void *)1 }) 119 { .enabled = ATOMIC_INIT(1), .entries = (void *)1 })
@@ -131,8 +122,6 @@ jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
131 122
132#else /* !HAVE_JUMP_LABEL */ 123#else /* !HAVE_JUMP_LABEL */
133 124
134#include <linux/atomic.h>
135
136struct static_key { 125struct static_key {
137 atomic_t enabled; 126 atomic_t enabled;
138}; 127};
@@ -141,10 +130,6 @@ static __always_inline void jump_label_init(void)
141{ 130{
142} 131}
143 132
144struct static_key_deferred {
145 struct static_key key;
146};
147
148static __always_inline bool static_key_false(struct static_key *key) 133static __always_inline bool static_key_false(struct static_key *key)
149{ 134{
150 if (unlikely(atomic_read(&key->enabled)) > 0) 135 if (unlikely(atomic_read(&key->enabled)) > 0)
@@ -169,11 +154,6 @@ static inline void static_key_slow_dec(struct static_key *key)
169 atomic_dec(&key->enabled); 154 atomic_dec(&key->enabled);
170} 155}
171 156
172static inline void static_key_slow_dec_deferred(struct static_key_deferred *key)
173{
174 static_key_slow_dec(&key->key);
175}
176
177static inline int jump_label_text_reserved(void *start, void *end) 157static inline int jump_label_text_reserved(void *start, void *end)
178{ 158{
179 return 0; 159 return 0;
@@ -187,12 +167,6 @@ static inline int jump_label_apply_nops(struct module *mod)
187 return 0; 167 return 0;
188} 168}
189 169
190static inline void
191jump_label_rate_limit(struct static_key_deferred *key,
192 unsigned long rl)
193{
194}
195
196#define STATIC_KEY_INIT_TRUE ((struct static_key) \ 170#define STATIC_KEY_INIT_TRUE ((struct static_key) \
197 { .enabled = ATOMIC_INIT(1) }) 171 { .enabled = ATOMIC_INIT(1) })
198#define STATIC_KEY_INIT_FALSE ((struct static_key) \ 172#define STATIC_KEY_INIT_FALSE ((struct static_key) \
diff --git a/include/linux/jump_label_ratelimit.h b/include/linux/jump_label_ratelimit.h
new file mode 100644
index 000000000000..113788389b3d
--- /dev/null
+++ b/include/linux/jump_label_ratelimit.h
@@ -0,0 +1,34 @@
1#ifndef _LINUX_JUMP_LABEL_RATELIMIT_H
2#define _LINUX_JUMP_LABEL_RATELIMIT_H
3
4#include <linux/jump_label.h>
5#include <linux/workqueue.h>
6
7#if defined(CC_HAVE_ASM_GOTO) && defined(CONFIG_JUMP_LABEL)
8struct static_key_deferred {
9 struct static_key key;
10 unsigned long timeout;
11 struct delayed_work work;
12};
13#endif
14
15#ifdef HAVE_JUMP_LABEL
16extern void static_key_slow_dec_deferred(struct static_key_deferred *key);
17extern void
18jump_label_rate_limit(struct static_key_deferred *key, unsigned long rl);
19
20#else /* !HAVE_JUMP_LABEL */
21struct static_key_deferred {
22 struct static_key key;
23};
24static inline void static_key_slow_dec_deferred(struct static_key_deferred *key)
25{
26 static_key_slow_dec(&key->key);
27}
28static inline void
29jump_label_rate_limit(struct static_key_deferred *key,
30 unsigned long rl)
31{
32}
33#endif /* HAVE_JUMP_LABEL */
34#endif /* _LINUX_JUMP_LABEL_RATELIMIT_H */
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h
index b7c8cdc1d422..cbfb171bbcba 100644
--- a/include/linux/kbd_kern.h
+++ b/include/linux/kbd_kern.h
@@ -36,10 +36,9 @@ struct kbd_struct {
36#define VC_CTRLRLOCK KG_CTRLR /* ctrlr lock mode */ 36#define VC_CTRLRLOCK KG_CTRLR /* ctrlr lock mode */
37 unsigned char slockstate; /* for `sticky' Shift, Ctrl, etc. */ 37 unsigned char slockstate; /* for `sticky' Shift, Ctrl, etc. */
38 38
39 unsigned char ledmode:2; /* one 2-bit value */ 39 unsigned char ledmode:1;
40#define LED_SHOW_FLAGS 0 /* traditional state */ 40#define LED_SHOW_FLAGS 0 /* traditional state */
41#define LED_SHOW_IOCTL 1 /* only change leds upon ioctl */ 41#define LED_SHOW_IOCTL 1 /* only change leds upon ioctl */
42#define LED_SHOW_MEM 2 /* `heartbeat': peek into memory */
43 42
44 unsigned char ledflagstate:4; /* flags, not lights */ 43 unsigned char ledflagstate:4; /* flags, not lights */
45 unsigned char default_ledflagstate:4; 44 unsigned char default_ledflagstate:4;
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 3bef14c6586b..482ad2d84a32 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -629,7 +629,7 @@ extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
629static inline void tracing_start(void) { } 629static inline void tracing_start(void) { }
630static inline void tracing_stop(void) { } 630static inline void tracing_stop(void) { }
631static inline void ftrace_off_permanent(void) { } 631static inline void ftrace_off_permanent(void) { }
632static inline void trace_dump_stack(void) { } 632static inline void trace_dump_stack(int skip) { }
633 633
634static inline void tracing_on(void) { } 634static inline void tracing_on(void) { }
635static inline void tracing_off(void) { } 635static inline void tracing_off(void) { }
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 939b11268c86..de6dcbcc6ef7 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -26,6 +26,7 @@
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/wait.h> 27#include <linux/wait.h>
28#include <linux/atomic.h> 28#include <linux/atomic.h>
29#include <linux/workqueue.h>
29 30
30#define UEVENT_HELPER_PATH_LEN 256 31#define UEVENT_HELPER_PATH_LEN 256
31#define UEVENT_NUM_ENVP 32 /* number of env pointers */ 32#define UEVENT_NUM_ENVP 32 /* number of env pointers */
@@ -65,6 +66,9 @@ struct kobject {
65 struct kobj_type *ktype; 66 struct kobj_type *ktype;
66 struct sysfs_dirent *sd; 67 struct sysfs_dirent *sd;
67 struct kref kref; 68 struct kref kref;
69#ifdef CONFIG_DEBUG_KOBJECT_RELEASE
70 struct delayed_work release;
71#endif
68 unsigned int state_initialized:1; 72 unsigned int state_initialized:1;
69 unsigned int state_in_sysfs:1; 73 unsigned int state_in_sysfs:1;
70 unsigned int state_add_uevent_sent:1; 74 unsigned int state_add_uevent_sent:1;
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index debf208b7611..31c0cd1c941a 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -69,7 +69,7 @@ typedef union ktime ktime_t; /* Kill this */
69 * @secs: seconds to set 69 * @secs: seconds to set
70 * @nsecs: nanoseconds to set 70 * @nsecs: nanoseconds to set
71 * 71 *
72 * Return the ktime_t representation of the value 72 * Return: The ktime_t representation of the value.
73 */ 73 */
74static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) 74static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
75{ 75{
@@ -151,7 +151,7 @@ static inline ktime_t ktime_set(const long secs, const unsigned long nsecs)
151 * @lhs: minuend 151 * @lhs: minuend
152 * @rhs: subtrahend 152 * @rhs: subtrahend
153 * 153 *
154 * Returns the remainder of the subtraction 154 * Return: The remainder of the subtraction.
155 */ 155 */
156static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs) 156static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs)
157{ 157{
@@ -169,7 +169,7 @@ static inline ktime_t ktime_sub(const ktime_t lhs, const ktime_t rhs)
169 * @add1: addend1 169 * @add1: addend1
170 * @add2: addend2 170 * @add2: addend2
171 * 171 *
172 * Returns the sum of @add1 and @add2. 172 * Return: The sum of @add1 and @add2.
173 */ 173 */
174static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2) 174static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2)
175{ 175{
@@ -195,7 +195,7 @@ static inline ktime_t ktime_add(const ktime_t add1, const ktime_t add2)
195 * @kt: addend 195 * @kt: addend
196 * @nsec: the scalar nsec value to add 196 * @nsec: the scalar nsec value to add
197 * 197 *
198 * Returns the sum of @kt and @nsec in ktime_t format 198 * Return: The sum of @kt and @nsec in ktime_t format.
199 */ 199 */
200extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec); 200extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec);
201 201
@@ -204,7 +204,7 @@ extern ktime_t ktime_add_ns(const ktime_t kt, u64 nsec);
204 * @kt: minuend 204 * @kt: minuend
205 * @nsec: the scalar nsec value to subtract 205 * @nsec: the scalar nsec value to subtract
206 * 206 *
207 * Returns the subtraction of @nsec from @kt in ktime_t format 207 * Return: The subtraction of @nsec from @kt in ktime_t format.
208 */ 208 */
209extern ktime_t ktime_sub_ns(const ktime_t kt, u64 nsec); 209extern ktime_t ktime_sub_ns(const ktime_t kt, u64 nsec);
210 210
@@ -212,7 +212,7 @@ extern ktime_t ktime_sub_ns(const ktime_t kt, u64 nsec);
212 * timespec_to_ktime - convert a timespec to ktime_t format 212 * timespec_to_ktime - convert a timespec to ktime_t format
213 * @ts: the timespec variable to convert 213 * @ts: the timespec variable to convert
214 * 214 *
215 * Returns a ktime_t variable with the converted timespec value 215 * Return: A ktime_t variable with the converted timespec value.
216 */ 216 */
217static inline ktime_t timespec_to_ktime(const struct timespec ts) 217static inline ktime_t timespec_to_ktime(const struct timespec ts)
218{ 218{
@@ -224,7 +224,7 @@ static inline ktime_t timespec_to_ktime(const struct timespec ts)
224 * timeval_to_ktime - convert a timeval to ktime_t format 224 * timeval_to_ktime - convert a timeval to ktime_t format
225 * @tv: the timeval variable to convert 225 * @tv: the timeval variable to convert
226 * 226 *
227 * Returns a ktime_t variable with the converted timeval value 227 * Return: A ktime_t variable with the converted timeval value.
228 */ 228 */
229static inline ktime_t timeval_to_ktime(const struct timeval tv) 229static inline ktime_t timeval_to_ktime(const struct timeval tv)
230{ 230{
@@ -237,7 +237,7 @@ static inline ktime_t timeval_to_ktime(const struct timeval tv)
237 * ktime_to_timespec - convert a ktime_t variable to timespec format 237 * ktime_to_timespec - convert a ktime_t variable to timespec format
238 * @kt: the ktime_t variable to convert 238 * @kt: the ktime_t variable to convert
239 * 239 *
240 * Returns the timespec representation of the ktime value 240 * Return: The timespec representation of the ktime value.
241 */ 241 */
242static inline struct timespec ktime_to_timespec(const ktime_t kt) 242static inline struct timespec ktime_to_timespec(const ktime_t kt)
243{ 243{
@@ -249,7 +249,7 @@ static inline struct timespec ktime_to_timespec(const ktime_t kt)
249 * ktime_to_timeval - convert a ktime_t variable to timeval format 249 * ktime_to_timeval - convert a ktime_t variable to timeval format
250 * @kt: the ktime_t variable to convert 250 * @kt: the ktime_t variable to convert
251 * 251 *
252 * Returns the timeval representation of the ktime value 252 * Return: The timeval representation of the ktime value.
253 */ 253 */
254static inline struct timeval ktime_to_timeval(const ktime_t kt) 254static inline struct timeval ktime_to_timeval(const ktime_t kt)
255{ 255{
@@ -262,7 +262,7 @@ static inline struct timeval ktime_to_timeval(const ktime_t kt)
262 * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds 262 * ktime_to_ns - convert a ktime_t variable to scalar nanoseconds
263 * @kt: the ktime_t variable to convert 263 * @kt: the ktime_t variable to convert
264 * 264 *
265 * Returns the scalar nanoseconds representation of @kt 265 * Return: The scalar nanoseconds representation of @kt.
266 */ 266 */
267static inline s64 ktime_to_ns(const ktime_t kt) 267static inline s64 ktime_to_ns(const ktime_t kt)
268{ 268{
@@ -276,7 +276,9 @@ static inline s64 ktime_to_ns(const ktime_t kt)
276 * @cmp1: comparable1 276 * @cmp1: comparable1
277 * @cmp2: comparable2 277 * @cmp2: comparable2
278 * 278 *
279 * Compare two ktime_t variables, returns 1 if equal 279 * Compare two ktime_t variables.
280 *
281 * Return: 1 if equal.
280 */ 282 */
281static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2) 283static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
282{ 284{
@@ -288,7 +290,7 @@ static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
288 * @cmp1: comparable1 290 * @cmp1: comparable1
289 * @cmp2: comparable2 291 * @cmp2: comparable2
290 * 292 *
291 * Returns ... 293 * Return: ...
292 * cmp1 < cmp2: return <0 294 * cmp1 < cmp2: return <0
293 * cmp1 == cmp2: return 0 295 * cmp1 == cmp2: return 0
294 * cmp1 > cmp2: return >0 296 * cmp1 > cmp2: return >0
@@ -342,7 +344,7 @@ extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
342 * @kt: the ktime_t variable to convert 344 * @kt: the ktime_t variable to convert
343 * @ts: the timespec variable to store the result in 345 * @ts: the timespec variable to store the result in
344 * 346 *
345 * Returns true if there was a successful conversion, false if kt was 0. 347 * Return: %true if there was a successful conversion, %false if kt was 0.
346 */ 348 */
347static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt, 349static inline __must_check bool ktime_to_timespec_cond(const ktime_t kt,
348 struct timespec *ts) 350 struct timespec *ts)
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index a63d83ebd151..ca645a01d37a 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -85,6 +85,12 @@ static inline bool is_noslot_pfn(pfn_t pfn)
85 return pfn == KVM_PFN_NOSLOT; 85 return pfn == KVM_PFN_NOSLOT;
86} 86}
87 87
88/*
89 * architectures with KVM_HVA_ERR_BAD other than PAGE_OFFSET (e.g. s390)
90 * provide own defines and kvm_is_error_hva
91 */
92#ifndef KVM_HVA_ERR_BAD
93
88#define KVM_HVA_ERR_BAD (PAGE_OFFSET) 94#define KVM_HVA_ERR_BAD (PAGE_OFFSET)
89#define KVM_HVA_ERR_RO_BAD (PAGE_OFFSET + PAGE_SIZE) 95#define KVM_HVA_ERR_RO_BAD (PAGE_OFFSET + PAGE_SIZE)
90 96
@@ -93,6 +99,8 @@ static inline bool kvm_is_error_hva(unsigned long addr)
93 return addr >= PAGE_OFFSET; 99 return addr >= PAGE_OFFSET;
94} 100}
95 101
102#endif
103
96#define KVM_ERR_PTR_BAD_PAGE (ERR_PTR(-ENOENT)) 104#define KVM_ERR_PTR_BAD_PAGE (ERR_PTR(-ENOENT))
97 105
98static inline bool is_error_page(struct page *page) 106static inline bool is_error_page(struct page *page)
@@ -160,8 +168,12 @@ enum kvm_bus {
160 168
161int kvm_io_bus_write(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, 169int kvm_io_bus_write(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
162 int len, const void *val); 170 int len, const void *val);
171int kvm_io_bus_write_cookie(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
172 int len, const void *val, long cookie);
163int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len, 173int kvm_io_bus_read(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, int len,
164 void *val); 174 void *val);
175int kvm_io_bus_read_cookie(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
176 int len, void *val, long cookie);
165int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr, 177int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
166 int len, struct kvm_io_device *dev); 178 int len, struct kvm_io_device *dev);
167int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx, 179int kvm_io_bus_unregister_dev(struct kvm *kvm, enum kvm_bus bus_idx,
@@ -499,6 +511,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
499void kvm_arch_free_memslot(struct kvm_memory_slot *free, 511void kvm_arch_free_memslot(struct kvm_memory_slot *free,
500 struct kvm_memory_slot *dont); 512 struct kvm_memory_slot *dont);
501int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages); 513int kvm_arch_create_memslot(struct kvm_memory_slot *slot, unsigned long npages);
514void kvm_arch_memslots_updated(struct kvm *kvm);
502int kvm_arch_prepare_memory_region(struct kvm *kvm, 515int kvm_arch_prepare_memory_region(struct kvm *kvm,
503 struct kvm_memory_slot *memslot, 516 struct kvm_memory_slot *memslot,
504 struct kvm_userspace_memory_region *mem, 517 struct kvm_userspace_memory_region *mem,
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 4ea55bb45deb..0e23c26485f4 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -138,6 +138,22 @@ enum {
138 ATA_SHT_THIS_ID = -1, 138 ATA_SHT_THIS_ID = -1,
139 ATA_SHT_USE_CLUSTERING = 1, 139 ATA_SHT_USE_CLUSTERING = 1,
140 140
141 /* struct ata_taskfile flags */
142 ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */
143 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
144 ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */
145 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
146 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
147 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
148 ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
149
150 /* protocol flags */
151 ATA_PROT_FLAG_PIO = (1 << 0), /* is PIO */
152 ATA_PROT_FLAG_DMA = (1 << 1), /* is DMA */
153 ATA_PROT_FLAG_DATA = ATA_PROT_FLAG_PIO | ATA_PROT_FLAG_DMA,
154 ATA_PROT_FLAG_NCQ = (1 << 2), /* is NCQ */
155 ATA_PROT_FLAG_ATAPI = (1 << 3), /* is ATAPI */
156
141 /* struct ata_device stuff */ 157 /* struct ata_device stuff */
142 ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */ 158 ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */
143 ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */ 159 ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */
@@ -156,6 +172,7 @@ enum {
156 ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ 172 ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */
157 ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */ 173 ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */
158 ATA_DFLAG_UNLOCK_HPA = (1 << 18), /* unlock HPA */ 174 ATA_DFLAG_UNLOCK_HPA = (1 << 18), /* unlock HPA */
175 ATA_DFLAG_NCQ_SEND_RECV = (1 << 19), /* device supports NCQ SEND and RECV */
159 ATA_DFLAG_INIT_MASK = (1 << 24) - 1, 176 ATA_DFLAG_INIT_MASK = (1 << 24) - 1,
160 177
161 ATA_DFLAG_DETACH = (1 << 24), 178 ATA_DFLAG_DETACH = (1 << 24),
@@ -207,6 +224,7 @@ enum {
207 ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ 224 ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */
208 ATA_FLAG_AN = (1 << 18), /* controller supports AN */ 225 ATA_FLAG_AN = (1 << 18), /* controller supports AN */
209 ATA_FLAG_PMP = (1 << 19), /* controller supports PMP */ 226 ATA_FLAG_PMP = (1 << 19), /* controller supports PMP */
227 ATA_FLAG_FPDMA_AUX = (1 << 20), /* controller supports H2DFIS aux field */
210 ATA_FLAG_EM = (1 << 21), /* driver supports enclosure 228 ATA_FLAG_EM = (1 << 21), /* driver supports enclosure
211 * management */ 229 * management */
212 ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity 230 ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity
@@ -518,6 +536,33 @@ enum sw_activity {
518 BLINK_OFF, 536 BLINK_OFF,
519}; 537};
520 538
539struct ata_taskfile {
540 unsigned long flags; /* ATA_TFLAG_xxx */
541 u8 protocol; /* ATA_PROT_xxx */
542
543 u8 ctl; /* control reg */
544
545 u8 hob_feature; /* additional data */
546 u8 hob_nsect; /* to support LBA48 */
547 u8 hob_lbal;
548 u8 hob_lbam;
549 u8 hob_lbah;
550
551 u8 feature;
552 u8 nsect;
553 u8 lbal;
554 u8 lbam;
555 u8 lbah;
556
557 u8 device;
558
559 u8 command; /* IO operation */
560
561 u32 auxiliary; /* auxiliary field */
562 /* from SATA 3.1 and */
563 /* ATA-8 ACS-3 */
564};
565
521#ifdef CONFIG_ATA_SFF 566#ifdef CONFIG_ATA_SFF
522struct ata_ioports { 567struct ata_ioports {
523 void __iomem *cmd_addr; 568 void __iomem *cmd_addr;
@@ -660,6 +705,9 @@ struct ata_device {
660 /* DEVSLP Timing Variables from Identify Device Data Log */ 705 /* DEVSLP Timing Variables from Identify Device Data Log */
661 u8 devslp_timing[ATA_LOG_DEVSLP_SIZE]; 706 u8 devslp_timing[ATA_LOG_DEVSLP_SIZE];
662 707
708 /* NCQ send and receive log subcommand support */
709 u8 ncq_send_recv_cmds[ATA_LOG_NCQ_SEND_RECV_SIZE];
710
663 /* error history */ 711 /* error history */
664 int spdn_cnt; 712 int spdn_cnt;
665 /* ering is CLEAR_END, read comment above CLEAR_END */ 713 /* ering is CLEAR_END, read comment above CLEAR_END */
@@ -959,6 +1007,69 @@ extern const unsigned long sata_deb_timing_long[];
959extern struct ata_port_operations ata_dummy_port_ops; 1007extern struct ata_port_operations ata_dummy_port_ops;
960extern const struct ata_port_info ata_dummy_port_info; 1008extern const struct ata_port_info ata_dummy_port_info;
961 1009
1010/*
1011 * protocol tests
1012 */
1013static inline unsigned int ata_prot_flags(u8 prot)
1014{
1015 switch (prot) {
1016 case ATA_PROT_NODATA:
1017 return 0;
1018 case ATA_PROT_PIO:
1019 return ATA_PROT_FLAG_PIO;
1020 case ATA_PROT_DMA:
1021 return ATA_PROT_FLAG_DMA;
1022 case ATA_PROT_NCQ:
1023 return ATA_PROT_FLAG_DMA | ATA_PROT_FLAG_NCQ;
1024 case ATAPI_PROT_NODATA:
1025 return ATA_PROT_FLAG_ATAPI;
1026 case ATAPI_PROT_PIO:
1027 return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_PIO;
1028 case ATAPI_PROT_DMA:
1029 return ATA_PROT_FLAG_ATAPI | ATA_PROT_FLAG_DMA;
1030 }
1031 return 0;
1032}
1033
1034static inline int ata_is_atapi(u8 prot)
1035{
1036 return ata_prot_flags(prot) & ATA_PROT_FLAG_ATAPI;
1037}
1038
1039static inline int ata_is_nodata(u8 prot)
1040{
1041 return !(ata_prot_flags(prot) & ATA_PROT_FLAG_DATA);
1042}
1043
1044static inline int ata_is_pio(u8 prot)
1045{
1046 return ata_prot_flags(prot) & ATA_PROT_FLAG_PIO;
1047}
1048
1049static inline int ata_is_dma(u8 prot)
1050{
1051 return ata_prot_flags(prot) & ATA_PROT_FLAG_DMA;
1052}
1053
1054static inline int ata_is_ncq(u8 prot)
1055{
1056 return ata_prot_flags(prot) & ATA_PROT_FLAG_NCQ;
1057}
1058
1059static inline int ata_is_data(u8 prot)
1060{
1061 return ata_prot_flags(prot) & ATA_PROT_FLAG_DATA;
1062}
1063
1064static inline int is_multi_taskfile(struct ata_taskfile *tf)
1065{
1066 return (tf->command == ATA_CMD_READ_MULTI) ||
1067 (tf->command == ATA_CMD_WRITE_MULTI) ||
1068 (tf->command == ATA_CMD_READ_MULTI_EXT) ||
1069 (tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
1070 (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
1071}
1072
962static inline const unsigned long * 1073static inline const unsigned long *
963sata_ehc_deb_timing(struct ata_eh_context *ehc) 1074sata_ehc_deb_timing(struct ata_eh_context *ehc)
964{ 1075{
@@ -1142,8 +1253,6 @@ int ata_acpi_stm(struct ata_port *ap, const struct ata_acpi_gtm *stm);
1142int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *stm); 1253int ata_acpi_gtm(struct ata_port *ap, struct ata_acpi_gtm *stm);
1143unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev, 1254unsigned long ata_acpi_gtm_xfermask(struct ata_device *dev,
1144 const struct ata_acpi_gtm *gtm); 1255 const struct ata_acpi_gtm *gtm);
1145acpi_handle ata_ap_acpi_handle(struct ata_port *ap);
1146acpi_handle ata_dev_acpi_handle(struct ata_device *dev);
1147int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm); 1256int ata_acpi_cbl_80wire(struct ata_port *ap, const struct ata_acpi_gtm *gtm);
1148#else 1257#else
1149static inline const struct ata_acpi_gtm *ata_acpi_init_gtm(struct ata_port *ap) 1258static inline const struct ata_acpi_gtm *ata_acpi_init_gtm(struct ata_port *ap)
@@ -1497,6 +1606,13 @@ static inline int ata_ncq_enabled(struct ata_device *dev)
1497 ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ; 1606 ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ;
1498} 1607}
1499 1608
1609static inline bool ata_fpdma_dsm_supported(struct ata_device *dev)
1610{
1611 return (dev->flags & ATA_DFLAG_NCQ_SEND_RECV) &&
1612 (dev->ncq_send_recv_cmds[ATA_LOG_NCQ_SEND_RECV_DSM_OFFSET] &
1613 ATA_LOG_NCQ_SEND_RECV_DSM_TRIM);
1614}
1615
1500static inline void ata_qc_set_polling(struct ata_queued_cmd *qc) 1616static inline void ata_qc_set_polling(struct ata_queued_cmd *qc)
1501{ 1617{
1502 qc->tf.ctl |= ATA_NIEN; 1618 qc->tf.ctl |= ATA_NIEN;
diff --git a/include/linux/llist.h b/include/linux/llist.h
index cdaa7f023899..8828a78dec9a 100644
--- a/include/linux/llist.h
+++ b/include/linux/llist.h
@@ -125,6 +125,29 @@ static inline void init_llist_head(struct llist_head *list)
125 (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member)) 125 (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member))
126 126
127/** 127/**
128 * llist_for_each_entry_safe - iterate over some deleted entries of lock-less list of given type
129 * safe against removal of list entry
130 * @pos: the type * to use as a loop cursor.
131 * @n: another type * to use as temporary storage
132 * @node: the first entry of deleted list entries.
133 * @member: the name of the llist_node with the struct.
134 *
135 * In general, some entries of the lock-less list can be traversed
136 * safely only after being removed from list, so start with an entry
137 * instead of list head.
138 *
139 * If being used on entries deleted from lock-less list directly, the
140 * traverse order is from the newest to the oldest added entry. If
141 * you want to traverse from the oldest to the newest, you must
142 * reverse the order by yourself before traversing.
143 */
144#define llist_for_each_entry_safe(pos, n, node, member) \
145 for (pos = llist_entry((node), typeof(*pos), member); \
146 &pos->member != NULL && \
147 (n = llist_entry(pos->member.next, typeof(*n), member), true); \
148 pos = n)
149
150/**
128 * llist_empty - tests whether a lock-less list is empty 151 * llist_empty - tests whether a lock-less list is empty
129 * @head: the list to test 152 * @head: the list to test
130 * 153 *
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index f1e877b79ed8..cfc2f119779a 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -365,7 +365,7 @@ extern void lockdep_trace_alloc(gfp_t mask);
365 365
366#define lockdep_recursing(tsk) ((tsk)->lockdep_recursion) 366#define lockdep_recursing(tsk) ((tsk)->lockdep_recursion)
367 367
368#else /* !LOCKDEP */ 368#else /* !CONFIG_LOCKDEP */
369 369
370static inline void lockdep_off(void) 370static inline void lockdep_off(void)
371{ 371{
@@ -479,82 +479,36 @@ static inline void print_irqtrace_events(struct task_struct *curr)
479 * on the per lock-class debug mode: 479 * on the per lock-class debug mode:
480 */ 480 */
481 481
482#ifdef CONFIG_DEBUG_LOCK_ALLOC 482#ifdef CONFIG_PROVE_LOCKING
483# ifdef CONFIG_PROVE_LOCKING 483 #define lock_acquire_exclusive(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i)
484# define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) 484 #define lock_acquire_shared(l, s, t, n, i) lock_acquire(l, s, t, 1, 2, n, i)
485# define spin_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i) 485 #define lock_acquire_shared_recursive(l, s, t, n, i) lock_acquire(l, s, t, 2, 2, n, i)
486# else
487# define spin_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i)
488# define spin_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, NULL, i)
489# endif
490# define spin_release(l, n, i) lock_release(l, n, i)
491#else 486#else
492# define spin_acquire(l, s, t, i) do { } while (0) 487 #define lock_acquire_exclusive(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i)
493# define spin_release(l, n, i) do { } while (0) 488 #define lock_acquire_shared(l, s, t, n, i) lock_acquire(l, s, t, 1, 1, n, i)
489 #define lock_acquire_shared_recursive(l, s, t, n, i) lock_acquire(l, s, t, 2, 1, n, i)
494#endif 490#endif
495 491
496#ifdef CONFIG_DEBUG_LOCK_ALLOC 492#define spin_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
497# ifdef CONFIG_PROVE_LOCKING 493#define spin_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i)
498# define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) 494#define spin_release(l, n, i) lock_release(l, n, i)
499# define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 2, NULL, i)
500# else
501# define rwlock_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i)
502# define rwlock_acquire_read(l, s, t, i) lock_acquire(l, s, t, 2, 1, NULL, i)
503# endif
504# define rwlock_release(l, n, i) lock_release(l, n, i)
505#else
506# define rwlock_acquire(l, s, t, i) do { } while (0)
507# define rwlock_acquire_read(l, s, t, i) do { } while (0)
508# define rwlock_release(l, n, i) do { } while (0)
509#endif
510 495
511#ifdef CONFIG_DEBUG_LOCK_ALLOC 496#define rwlock_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
512# ifdef CONFIG_PROVE_LOCKING 497#define rwlock_acquire_read(l, s, t, i) lock_acquire_shared_recursive(l, s, t, NULL, i)
513# define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) 498#define rwlock_release(l, n, i) lock_release(l, n, i)
514# define mutex_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i)
515# else
516# define mutex_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i)
517# define mutex_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i)
518# endif
519# define mutex_release(l, n, i) lock_release(l, n, i)
520#else
521# define mutex_acquire(l, s, t, i) do { } while (0)
522# define mutex_acquire_nest(l, s, t, n, i) do { } while (0)
523# define mutex_release(l, n, i) do { } while (0)
524#endif
525 499
526#ifdef CONFIG_DEBUG_LOCK_ALLOC 500#define mutex_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
527# ifdef CONFIG_PROVE_LOCKING 501#define mutex_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i)
528# define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 2, NULL, i) 502#define mutex_release(l, n, i) lock_release(l, n, i)
529# define rwsem_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 2, n, i) 503
530# define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 2, NULL, i) 504#define rwsem_acquire(l, s, t, i) lock_acquire_exclusive(l, s, t, NULL, i)
531# else 505#define rwsem_acquire_nest(l, s, t, n, i) lock_acquire_exclusive(l, s, t, n, i)
532# define rwsem_acquire(l, s, t, i) lock_acquire(l, s, t, 0, 1, NULL, i) 506#define rwsem_acquire_read(l, s, t, i) lock_acquire_shared(l, s, t, NULL, i)
533# define rwsem_acquire_nest(l, s, t, n, i) lock_acquire(l, s, t, 0, 1, n, i)
534# define rwsem_acquire_read(l, s, t, i) lock_acquire(l, s, t, 1, 1, NULL, i)
535# endif
536# define rwsem_release(l, n, i) lock_release(l, n, i) 507# define rwsem_release(l, n, i) lock_release(l, n, i)
537#else
538# define rwsem_acquire(l, s, t, i) do { } while (0)
539# define rwsem_acquire_nest(l, s, t, n, i) do { } while (0)
540# define rwsem_acquire_read(l, s, t, i) do { } while (0)
541# define rwsem_release(l, n, i) do { } while (0)
542#endif
543 508
544#ifdef CONFIG_DEBUG_LOCK_ALLOC 509#define lock_map_acquire(l) lock_acquire_exclusive(l, 0, 0, NULL, _THIS_IP_)
545# ifdef CONFIG_PROVE_LOCKING 510#define lock_map_acquire_read(l) lock_acquire_shared_recursive(l, 0, 0, NULL, _THIS_IP_)
546# define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 2, NULL, _THIS_IP_)
547# define lock_map_acquire_read(l) lock_acquire(l, 0, 0, 2, 2, NULL, _THIS_IP_)
548# else
549# define lock_map_acquire(l) lock_acquire(l, 0, 0, 0, 1, NULL, _THIS_IP_)
550# define lock_map_acquire_read(l) lock_acquire(l, 0, 0, 2, 1, NULL, _THIS_IP_)
551# endif
552# define lock_map_release(l) lock_release(l, 1, _THIS_IP_) 511# define lock_map_release(l) lock_release(l, 1, _THIS_IP_)
553#else
554# define lock_map_acquire(l) do { } while (0)
555# define lock_map_acquire_read(l) do { } while (0)
556# define lock_map_release(l) do { } while (0)
557#endif
558 512
559#ifdef CONFIG_PROVE_LOCKING 513#ifdef CONFIG_PROVE_LOCKING
560# define might_lock(lock) \ 514# define might_lock(lock) \
diff --git a/include/linux/lockref.h b/include/linux/lockref.h
new file mode 100644
index 000000000000..ca07b5028b01
--- /dev/null
+++ b/include/linux/lockref.h
@@ -0,0 +1,36 @@
1#ifndef __LINUX_LOCKREF_H
2#define __LINUX_LOCKREF_H
3
4/*
5 * Locked reference counts.
6 *
7 * These are different from just plain atomic refcounts in that they
8 * are atomic with respect to the spinlock that goes with them. In
9 * particular, there can be implementations that don't actually get
10 * the spinlock for the common decrement/increment operations, but they
11 * still have to check that the operation is done semantically as if
12 * the spinlock had been taken (using a cmpxchg operation that covers
13 * both the lock and the count word, or using memory transactions, for
14 * example).
15 */
16
17#include <linux/spinlock.h>
18
19struct lockref {
20 union {
21#ifdef CONFIG_CMPXCHG_LOCKREF
22 aligned_u64 lock_count;
23#endif
24 struct {
25 spinlock_t lock;
26 unsigned int count;
27 };
28 };
29};
30
31extern void lockref_get(struct lockref *);
32extern int lockref_get_not_zero(struct lockref *);
33extern int lockref_get_or_lock(struct lockref *);
34extern int lockref_put_or_lock(struct lockref *);
35
36#endif /* __LINUX_LOCKREF_H */
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 7b4d9d79570b..6c416092e324 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -85,7 +85,7 @@ extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
85extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm); 85extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm);
86 86
87extern struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg); 87extern struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *memcg);
88extern struct mem_cgroup *mem_cgroup_from_cont(struct cgroup *cont); 88extern struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *css);
89 89
90static inline 90static inline
91bool mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *memcg) 91bool mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *memcg)
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 85c31a8e2904..9a6bbf76452d 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -25,16 +25,9 @@
25struct memory_block { 25struct memory_block {
26 unsigned long start_section_nr; 26 unsigned long start_section_nr;
27 unsigned long end_section_nr; 27 unsigned long end_section_nr;
28 unsigned long state; 28 unsigned long state; /* serialized by the dev->lock */
29 int section_count; 29 int section_count; /* serialized by mem_sysfs_mutex */
30 30 int online_type; /* for passing data to online routine */
31 /*
32 * This serializes all state change requests. It isn't
33 * held during creation because the control files are
34 * created long after the critical areas during
35 * initialization.
36 */
37 struct mutex state_mutex;
38 int phys_device; /* to which fru does this belong? */ 31 int phys_device; /* to which fru does this belong? */
39 void *hw; /* optional pointer to fw/hw data */ 32 void *hw; /* optional pointer to fw/hw data */
40 int (*phys_callback)(struct memory_block *); 33 int (*phys_callback)(struct memory_block *);
@@ -125,7 +118,6 @@ extern struct memory_block *find_memory_block_hinted(struct mem_section *,
125 struct memory_block *); 118 struct memory_block *);
126extern struct memory_block *find_memory_block(struct mem_section *); 119extern struct memory_block *find_memory_block(struct mem_section *);
127#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) 120#define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT)
128enum mem_add_context { BOOT, HOTPLUG };
129#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ 121#endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */
130 122
131#ifdef CONFIG_MEMORY_HOTPLUG 123#ifdef CONFIG_MEMORY_HOTPLUG
diff --git a/include/linux/mfd/arizona/gpio.h b/include/linux/mfd/arizona/gpio.h
new file mode 100644
index 000000000000..d2146bb74f89
--- /dev/null
+++ b/include/linux/mfd/arizona/gpio.h
@@ -0,0 +1,96 @@
1/*
2 * GPIO configuration for Arizona devices
3 *
4 * Copyright 2013 Wolfson Microelectronics. PLC.
5 *
6 * Author: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef _ARIZONA_GPIO_H
14#define _ARIZONA_GPIO_H
15
16#define ARIZONA_GP_FN_TXLRCLK 0x00
17#define ARIZONA_GP_FN_GPIO 0x01
18#define ARIZONA_GP_FN_IRQ1 0x02
19#define ARIZONA_GP_FN_IRQ2 0x03
20#define ARIZONA_GP_FN_OPCLK 0x04
21#define ARIZONA_GP_FN_FLL1_OUT 0x05
22#define ARIZONA_GP_FN_FLL2_OUT 0x06
23#define ARIZONA_GP_FN_PWM1 0x08
24#define ARIZONA_GP_FN_PWM2 0x09
25#define ARIZONA_GP_FN_SYSCLK_UNDERCLOCKED 0x0A
26#define ARIZONA_GP_FN_ASYNCCLK_UNDERCLOCKED 0x0B
27#define ARIZONA_GP_FN_FLL1_LOCK 0x0C
28#define ARIZONA_GP_FN_FLL2_LOCK 0x0D
29#define ARIZONA_GP_FN_FLL1_CLOCK_OK 0x0F
30#define ARIZONA_GP_FN_FLL2_CLOCK_OK 0x10
31#define ARIZONA_GP_FN_HEADPHONE_DET 0x12
32#define ARIZONA_GP_FN_MIC_DET 0x13
33#define ARIZONA_GP_FN_WSEQ_STATUS 0x15
34#define ARIZONA_GP_FN_CIF_ADDRESS_ERROR 0x16
35#define ARIZONA_GP_FN_ASRC1_LOCK 0x1A
36#define ARIZONA_GP_FN_ASRC2_LOCK 0x1B
37#define ARIZONA_GP_FN_ASRC_CONFIG_ERROR 0x1C
38#define ARIZONA_GP_FN_DRC1_SIGNAL_DETECT 0x1D
39#define ARIZONA_GP_FN_DRC1_ANTICLIP 0x1E
40#define ARIZONA_GP_FN_DRC1_DECAY 0x1F
41#define ARIZONA_GP_FN_DRC1_NOISE 0x20
42#define ARIZONA_GP_FN_DRC1_QUICK_RELEASE 0x21
43#define ARIZONA_GP_FN_DRC2_SIGNAL_DETECT 0x22
44#define ARIZONA_GP_FN_DRC2_ANTICLIP 0x23
45#define ARIZONA_GP_FN_DRC2_DECAY 0x24
46#define ARIZONA_GP_FN_DRC2_NOISE 0x25
47#define ARIZONA_GP_FN_DRC2_QUICK_RELEASE 0x26
48#define ARIZONA_GP_FN_MIXER_DROPPED_SAMPLE 0x27
49#define ARIZONA_GP_FN_AIF1_CONFIG_ERROR 0x28
50#define ARIZONA_GP_FN_AIF2_CONFIG_ERROR 0x29
51#define ARIZONA_GP_FN_AIF3_CONFIG_ERROR 0x2A
52#define ARIZONA_GP_FN_SPK_TEMP_SHUTDOWN 0x2B
53#define ARIZONA_GP_FN_SPK_TEMP_WARNING 0x2C
54#define ARIZONA_GP_FN_UNDERCLOCKED 0x2D
55#define ARIZONA_GP_FN_OVERCLOCKED 0x2E
56#define ARIZONA_GP_FN_DSP_IRQ1 0x35
57#define ARIZONA_GP_FN_DSP_IRQ2 0x36
58#define ARIZONA_GP_FN_ASYNC_OPCLK 0x3D
59#define ARIZONA_GP_FN_BOOT_DONE 0x44
60#define ARIZONA_GP_FN_DSP1_RAM_READY 0x45
61#define ARIZONA_GP_FN_SYSCLK_ENA_STATUS 0x4B
62#define ARIZONA_GP_FN_ASYNCCLK_ENA_STATUS 0x4C
63
64#define ARIZONA_GPN_DIR 0x8000 /* GPN_DIR */
65#define ARIZONA_GPN_DIR_MASK 0x8000 /* GPN_DIR */
66#define ARIZONA_GPN_DIR_SHIFT 15 /* GPN_DIR */
67#define ARIZONA_GPN_DIR_WIDTH 1 /* GPN_DIR */
68#define ARIZONA_GPN_PU 0x4000 /* GPN_PU */
69#define ARIZONA_GPN_PU_MASK 0x4000 /* GPN_PU */
70#define ARIZONA_GPN_PU_SHIFT 14 /* GPN_PU */
71#define ARIZONA_GPN_PU_WIDTH 1 /* GPN_PU */
72#define ARIZONA_GPN_PD 0x2000 /* GPN_PD */
73#define ARIZONA_GPN_PD_MASK 0x2000 /* GPN_PD */
74#define ARIZONA_GPN_PD_SHIFT 13 /* GPN_PD */
75#define ARIZONA_GPN_PD_WIDTH 1 /* GPN_PD */
76#define ARIZONA_GPN_LVL 0x0800 /* GPN_LVL */
77#define ARIZONA_GPN_LVL_MASK 0x0800 /* GPN_LVL */
78#define ARIZONA_GPN_LVL_SHIFT 11 /* GPN_LVL */
79#define ARIZONA_GPN_LVL_WIDTH 1 /* GPN_LVL */
80#define ARIZONA_GPN_POL 0x0400 /* GPN_POL */
81#define ARIZONA_GPN_POL_MASK 0x0400 /* GPN_POL */
82#define ARIZONA_GPN_POL_SHIFT 10 /* GPN_POL */
83#define ARIZONA_GPN_POL_WIDTH 1 /* GPN_POL */
84#define ARIZONA_GPN_OP_CFG 0x0200 /* GPN_OP_CFG */
85#define ARIZONA_GPN_OP_CFG_MASK 0x0200 /* GPN_OP_CFG */
86#define ARIZONA_GPN_OP_CFG_SHIFT 9 /* GPN_OP_CFG */
87#define ARIZONA_GPN_OP_CFG_WIDTH 1 /* GPN_OP_CFG */
88#define ARIZONA_GPN_DB 0x0100 /* GPN_DB */
89#define ARIZONA_GPN_DB_MASK 0x0100 /* GPN_DB */
90#define ARIZONA_GPN_DB_SHIFT 8 /* GPN_DB */
91#define ARIZONA_GPN_DB_WIDTH 1 /* GPN_DB */
92#define ARIZONA_GPN_FN_MASK 0x007F /* GPN_DB */
93#define ARIZONA_GPN_FN_SHIFT 0 /* GPN_DB */
94#define ARIZONA_GPN_FN_WIDTH 7 /* GPN_DB */
95
96#endif
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h
index 1a8dd7afe084..37e48c957791 100644
--- a/include/linux/mfd/palmas.h
+++ b/include/linux/mfd/palmas.h
@@ -160,7 +160,8 @@ enum palmas_regulators {
160 PALMAS_REG_SMPS7, 160 PALMAS_REG_SMPS7,
161 PALMAS_REG_SMPS8, 161 PALMAS_REG_SMPS8,
162 PALMAS_REG_SMPS9, 162 PALMAS_REG_SMPS9,
163 PALMAS_REG_SMPS10, 163 PALMAS_REG_SMPS10_OUT2,
164 PALMAS_REG_SMPS10_OUT1,
164 /* LDO regulators */ 165 /* LDO regulators */
165 PALMAS_REG_LDO1, 166 PALMAS_REG_LDO1,
166 PALMAS_REG_LDO2, 167 PALMAS_REG_LDO2,
@@ -355,9 +356,9 @@ struct palmas_pmic {
355 int smps123; 356 int smps123;
356 int smps457; 357 int smps457;
357 358
358 int range[PALMAS_REG_SMPS10]; 359 int range[PALMAS_REG_SMPS10_OUT1];
359 unsigned int ramp_delay[PALMAS_REG_SMPS10]; 360 unsigned int ramp_delay[PALMAS_REG_SMPS10_OUT1];
360 unsigned int current_reg_mode[PALMAS_REG_SMPS10]; 361 unsigned int current_reg_mode[PALMAS_REG_SMPS10_OUT1];
361}; 362};
362 363
363struct palmas_resource { 364struct palmas_resource {
@@ -371,17 +372,15 @@ struct palmas_usb {
371 372
372 struct extcon_dev edev; 373 struct extcon_dev edev;
373 374
374 /* used to set vbus, in atomic path */
375 struct work_struct set_vbus_work;
376
377 int id_otg_irq; 375 int id_otg_irq;
378 int id_irq; 376 int id_irq;
379 int vbus_otg_irq; 377 int vbus_otg_irq;
380 int vbus_irq; 378 int vbus_irq;
381 379
382 int vbus_enable;
383
384 enum palmas_usb_state linkstat; 380 enum palmas_usb_state linkstat;
381 int wakeup;
382 bool enable_vbus_detection;
383 bool enable_id_detection;
385}; 384};
386 385
387#define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator) 386#define comparator_to_palmas(x) container_of((x), struct palmas_usb, comparator)
@@ -449,7 +448,7 @@ enum usb_irq_events {
449#define PALMAS_DVFS_BASE 0x180 448#define PALMAS_DVFS_BASE 0x180
450#define PALMAS_PMU_CONTROL_BASE 0x1A0 449#define PALMAS_PMU_CONTROL_BASE 0x1A0
451#define PALMAS_RESOURCE_BASE 0x1D4 450#define PALMAS_RESOURCE_BASE 0x1D4
452#define PALMAS_PU_PD_OD_BASE 0x1F4 451#define PALMAS_PU_PD_OD_BASE 0x1F0
453#define PALMAS_LED_BASE 0x200 452#define PALMAS_LED_BASE 0x200
454#define PALMAS_INTERRUPT_BASE 0x210 453#define PALMAS_INTERRUPT_BASE 0x210
455#define PALMAS_USB_OTG_BASE 0x250 454#define PALMAS_USB_OTG_BASE 0x250
@@ -1734,16 +1733,20 @@ enum usb_irq_events {
1734#define PALMAS_REGEN3_CTRL_MODE_ACTIVE_SHIFT 0 1733#define PALMAS_REGEN3_CTRL_MODE_ACTIVE_SHIFT 0
1735 1734
1736/* Registers for function PAD_CONTROL */ 1735/* Registers for function PAD_CONTROL */
1737#define PALMAS_PU_PD_INPUT_CTRL1 0x0 1736#define PALMAS_OD_OUTPUT_CTRL2 0x2
1738#define PALMAS_PU_PD_INPUT_CTRL2 0x1 1737#define PALMAS_POLARITY_CTRL2 0x3
1739#define PALMAS_PU_PD_INPUT_CTRL3 0x2 1738#define PALMAS_PU_PD_INPUT_CTRL1 0x4
1740#define PALMAS_OD_OUTPUT_CTRL 0x4 1739#define PALMAS_PU_PD_INPUT_CTRL2 0x5
1741#define PALMAS_POLARITY_CTRL 0x5 1740#define PALMAS_PU_PD_INPUT_CTRL3 0x6
1742#define PALMAS_PRIMARY_SECONDARY_PAD1 0x6 1741#define PALMAS_PU_PD_INPUT_CTRL5 0x7
1743#define PALMAS_PRIMARY_SECONDARY_PAD2 0x7 1742#define PALMAS_OD_OUTPUT_CTRL 0x8
1744#define PALMAS_I2C_SPI 0x8 1743#define PALMAS_POLARITY_CTRL 0x9
1745#define PALMAS_PU_PD_INPUT_CTRL4 0x9 1744#define PALMAS_PRIMARY_SECONDARY_PAD1 0xA
1746#define PALMAS_PRIMARY_SECONDARY_PAD3 0xA 1745#define PALMAS_PRIMARY_SECONDARY_PAD2 0xB
1746#define PALMAS_I2C_SPI 0xC
1747#define PALMAS_PU_PD_INPUT_CTRL4 0xD
1748#define PALMAS_PRIMARY_SECONDARY_PAD3 0xE
1749#define PALMAS_PRIMARY_SECONDARY_PAD4 0xF
1747 1750
1748/* Bit definitions for PU_PD_INPUT_CTRL1 */ 1751/* Bit definitions for PU_PD_INPUT_CTRL1 */
1749#define PALMAS_PU_PD_INPUT_CTRL1_RESET_IN_PD 0x40 1752#define PALMAS_PU_PD_INPUT_CTRL1_RESET_IN_PD 0x40
@@ -2501,6 +2504,15 @@ enum usb_irq_events {
2501#define PALMAS_PU_PD_GPIO_CTRL1 0x6 2504#define PALMAS_PU_PD_GPIO_CTRL1 0x6
2502#define PALMAS_PU_PD_GPIO_CTRL2 0x7 2505#define PALMAS_PU_PD_GPIO_CTRL2 0x7
2503#define PALMAS_OD_OUTPUT_GPIO_CTRL 0x8 2506#define PALMAS_OD_OUTPUT_GPIO_CTRL 0x8
2507#define PALMAS_GPIO_DATA_IN2 0x9
2508#define PALMAS_GPIO_DATA_DIR2 0x0A
2509#define PALMAS_GPIO_DATA_OUT2 0x0B
2510#define PALMAS_GPIO_DEBOUNCE_EN2 0x0C
2511#define PALMAS_GPIO_CLEAR_DATA_OUT2 0x0D
2512#define PALMAS_GPIO_SET_DATA_OUT2 0x0E
2513#define PALMAS_PU_PD_GPIO_CTRL3 0x0F
2514#define PALMAS_PU_PD_GPIO_CTRL4 0x10
2515#define PALMAS_OD_OUTPUT_GPIO_CTRL2 0x11
2504 2516
2505/* Bit definitions for GPIO_DATA_IN */ 2517/* Bit definitions for GPIO_DATA_IN */
2506#define PALMAS_GPIO_DATA_IN_GPIO_7_IN 0x80 2518#define PALMAS_GPIO_DATA_IN_GPIO_7_IN 0x80
diff --git a/include/linux/mfd/samsung/s2mps11.h b/include/linux/mfd/samsung/s2mps11.h
index 4e94dc65f987..d0d52ea60074 100644
--- a/include/linux/mfd/samsung/s2mps11.h
+++ b/include/linux/mfd/samsung/s2mps11.h
@@ -191,6 +191,17 @@ enum s2mps11_regulators {
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#define S2MPS11_RAMP_DELAY 25000 /* uV/us */
193 193
194
195#define S2MPS11_BUCK2_RAMP_SHIFT 6
196#define S2MPS11_BUCK34_RAMP_SHIFT 4
197#define S2MPS11_BUCK5_RAMP_SHIFT 6
198#define S2MPS11_BUCK16_RAMP_SHIFT 4
199#define S2MPS11_BUCK7810_RAMP_SHIFT 2
200#define S2MPS11_BUCK9_RAMP_SHIFT 0
201#define S2MPS11_BUCK2_RAMP_EN_SHIFT 3
202#define S2MPS11_BUCK3_RAMP_EN_SHIFT 2
203#define S2MPS11_BUCK4_RAMP_EN_SHIFT 1
204#define S2MPS11_BUCK6_RAMP_EN_SHIFT 0
194#define S2MPS11_PMIC_EN_SHIFT 6 205#define S2MPS11_PMIC_EN_SHIFT 6
195#define S2MPS11_REGULATOR_MAX (S2MPS11_REG_MAX - 3) 206#define S2MPS11_REGULATOR_MAX (S2MPS11_REG_MAX - 3)
196 207
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
index 8d73fe29796a..db1791bb997a 100644
--- a/include/linux/mfd/ti_am335x_tscadc.h
+++ b/include/linux/mfd/ti_am335x_tscadc.h
@@ -113,11 +113,27 @@
113#define CNTRLREG_8WIRE CNTRLREG_AFE_CTRL(3) 113#define CNTRLREG_8WIRE CNTRLREG_AFE_CTRL(3)
114#define CNTRLREG_TSCENB BIT(7) 114#define CNTRLREG_TSCENB BIT(7)
115 115
116/* FIFO READ Register */
117#define FIFOREAD_DATA_MASK (0xfff << 0)
118#define FIFOREAD_CHNLID_MASK (0xf << 16)
119
120/* Sequencer Status */
121#define SEQ_STATUS BIT(5)
122
116#define ADC_CLK 3000000 123#define ADC_CLK 3000000
117#define MAX_CLK_DIV 7 124#define MAX_CLK_DIV 7
118#define TOTAL_STEPS 16 125#define TOTAL_STEPS 16
119#define TOTAL_CHANNELS 8 126#define TOTAL_CHANNELS 8
120 127
128/*
129* ADC runs at 3MHz, and it takes
130* 15 cycles to latch one data output.
131* Hence the idle time for ADC to
132* process one sample data would be
133* around 5 micro seconds.
134*/
135#define IDLE_TIMEOUT 5 /* microsec */
136
121#define TSCADC_CELLS 2 137#define TSCADC_CELLS 2
122 138
123struct ti_tscadc_dev { 139struct ti_tscadc_dev {
diff --git a/include/linux/mfd/tps65217.h b/include/linux/mfd/tps65217.h
index 29eab2bd3dfa..a5a7f0130e96 100644
--- a/include/linux/mfd/tps65217.h
+++ b/include/linux/mfd/tps65217.h
@@ -244,24 +244,6 @@ struct tps65217_board {
244}; 244};
245 245
246/** 246/**
247 * struct tps_info - packages regulator constraints
248 * @name: Voltage regulator name
249 * @min_uV: minimum micro volts
250 * @max_uV: minimum micro volts
251 * @vsel_to_uv: Function pointer to get voltage from selector
252 * @uv_to_vsel: Function pointer to get selector from voltage
253 *
254 * This data is used to check the regualtor voltage limits while setting.
255 */
256struct tps_info {
257 const char *name;
258 int min_uV;
259 int max_uV;
260 int (*vsel_to_uv)(unsigned int vsel);
261 int (*uv_to_vsel)(int uV, unsigned int *vsel);
262};
263
264/**
265 * struct tps65217 - tps65217 sub-driver chip access routines 247 * struct tps65217 - tps65217 sub-driver chip access routines
266 * 248 *
267 * Device data may be used to access the TPS65217 chip 249 * Device data may be used to access the TPS65217 chip
@@ -273,7 +255,6 @@ struct tps65217 {
273 unsigned int id; 255 unsigned int id;
274 struct regulator_desc desc[TPS65217_NUM_REGULATOR]; 256 struct regulator_desc desc[TPS65217_NUM_REGULATOR];
275 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR]; 257 struct regulator_dev *rdev[TPS65217_NUM_REGULATOR];
276 struct tps_info *info[TPS65217_NUM_REGULATOR];
277 struct regmap *regmap; 258 struct regmap *regmap;
278}; 259};
279 260
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index bb1c8096a7eb..cd1fdf75103b 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -69,6 +69,7 @@ enum {
69 MLX4_CMD_SET_ICM_SIZE = 0xffd, 69 MLX4_CMD_SET_ICM_SIZE = 0xffd,
70 /*master notify fw on finish for slave's flr*/ 70 /*master notify fw on finish for slave's flr*/
71 MLX4_CMD_INFORM_FLR_DONE = 0x5b, 71 MLX4_CMD_INFORM_FLR_DONE = 0x5b,
72 MLX4_CMD_GET_OP_REQ = 0x59,
72 73
73 /* TPT commands */ 74 /* TPT commands */
74 MLX4_CMD_SW2HW_MPT = 0xd, 75 MLX4_CMD_SW2HW_MPT = 0xd,
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 52c23a892bab..24ce6bdd540e 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -33,6 +33,7 @@
33#ifndef MLX4_DEVICE_H 33#ifndef MLX4_DEVICE_H
34#define MLX4_DEVICE_H 34#define MLX4_DEVICE_H
35 35
36#include <linux/if_ether.h>
36#include <linux/pci.h> 37#include <linux/pci.h>
37#include <linux/completion.h> 38#include <linux/completion.h>
38#include <linux/radix-tree.h> 39#include <linux/radix-tree.h>
@@ -207,6 +208,7 @@ enum mlx4_event {
207 MLX4_EVENT_TYPE_CMD = 0x0a, 208 MLX4_EVENT_TYPE_CMD = 0x0a,
208 MLX4_EVENT_TYPE_VEP_UPDATE = 0x19, 209 MLX4_EVENT_TYPE_VEP_UPDATE = 0x19,
209 MLX4_EVENT_TYPE_COMM_CHANNEL = 0x18, 210 MLX4_EVENT_TYPE_COMM_CHANNEL = 0x18,
211 MLX4_EVENT_TYPE_OP_REQUIRED = 0x1a,
210 MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b, 212 MLX4_EVENT_TYPE_FATAL_WARNING = 0x1b,
211 MLX4_EVENT_TYPE_FLR_EVENT = 0x1c, 213 MLX4_EVENT_TYPE_FLR_EVENT = 0x1c,
212 MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d, 214 MLX4_EVENT_TYPE_PORT_MNG_CHG_EVENT = 0x1d,
@@ -619,7 +621,7 @@ struct mlx4_eth_av {
619 u8 dgid[16]; 621 u8 dgid[16];
620 u32 reserved4[2]; 622 u32 reserved4[2];
621 __be16 vlan; 623 __be16 vlan;
622 u8 mac[6]; 624 u8 mac[ETH_ALEN];
623}; 625};
624 626
625union mlx4_ext_av { 627union mlx4_ext_av {
@@ -913,10 +915,10 @@ enum mlx4_net_trans_promisc_mode {
913}; 915};
914 916
915struct mlx4_spec_eth { 917struct mlx4_spec_eth {
916 u8 dst_mac[6]; 918 u8 dst_mac[ETH_ALEN];
917 u8 dst_mac_msk[6]; 919 u8 dst_mac_msk[ETH_ALEN];
918 u8 src_mac[6]; 920 u8 src_mac[ETH_ALEN];
919 u8 src_mac_msk[6]; 921 u8 src_mac_msk[ETH_ALEN];
920 u8 ether_type_enable; 922 u8 ether_type_enable;
921 __be16 ether_type; 923 __be16 ether_type;
922 __be16 vlan_id_msk; 924 __be16 vlan_id_msk;
@@ -1052,11 +1054,6 @@ struct _rule_hw {
1052 }; 1054 };
1053}; 1055};
1054 1056
1055/* translating DMFS verbs sniffer rule to the FW API would need two reg IDs */
1056struct mlx4_flow_handle {
1057 u64 reg_id[2];
1058};
1059
1060int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn, 1057int mlx4_flow_steer_promisc_add(struct mlx4_dev *dev, u8 port, u32 qpn,
1061 enum mlx4_net_trans_promisc_mode mode); 1058 enum mlx4_net_trans_promisc_mode mode);
1062int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port, 1059int mlx4_flow_steer_promisc_remove(struct mlx4_dev *dev, u8 port,
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 262deac02c9e..6d351473c292 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -34,6 +34,7 @@
34#define MLX4_QP_H 34#define MLX4_QP_H
35 35
36#include <linux/types.h> 36#include <linux/types.h>
37#include <linux/if_ether.h>
37 38
38#include <linux/mlx4/device.h> 39#include <linux/mlx4/device.h>
39 40
@@ -143,7 +144,7 @@ struct mlx4_qp_path {
143 u8 feup; 144 u8 feup;
144 u8 fvl_rx; 145 u8 fvl_rx;
145 u8 reserved4[2]; 146 u8 reserved4[2];
146 u8 dmac[6]; 147 u8 dmac[ETH_ALEN];
147}; 148};
148 149
149enum { /* fl */ 150enum { /* fl */
@@ -318,7 +319,7 @@ struct mlx4_wqe_datagram_seg {
318 __be32 dqpn; 319 __be32 dqpn;
319 __be32 qkey; 320 __be32 qkey;
320 __be16 vlan; 321 __be16 vlan;
321 u8 mac[6]; 322 u8 mac[ETH_ALEN];
322}; 323};
323 324
324struct mlx4_wqe_lso_seg { 325struct mlx4_wqe_lso_seg {
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 737685e9e852..68029b30c3dc 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -309,21 +309,20 @@ struct mlx5_hca_cap {
309 __be16 max_desc_sz_rq; 309 __be16 max_desc_sz_rq;
310 u8 rsvd21[2]; 310 u8 rsvd21[2];
311 __be16 max_desc_sz_sq_dc; 311 __be16 max_desc_sz_sq_dc;
312 u8 rsvd22[4]; 312 __be32 max_qp_mcg;
313 __be16 max_qp_mcg; 313 u8 rsvd22[3];
314 u8 rsvd23;
315 u8 log_max_mcg; 314 u8 log_max_mcg;
316 u8 rsvd24; 315 u8 rsvd23;
317 u8 log_max_pd; 316 u8 log_max_pd;
318 u8 rsvd25; 317 u8 rsvd24;
319 u8 log_max_xrcd; 318 u8 log_max_xrcd;
320 u8 rsvd26[42]; 319 u8 rsvd25[42];
321 __be16 log_uar_page_sz; 320 __be16 log_uar_page_sz;
322 u8 rsvd27[28]; 321 u8 rsvd26[28];
323 u8 log_msx_atomic_size_qp; 322 u8 log_msx_atomic_size_qp;
324 u8 rsvd28[2]; 323 u8 rsvd27[2];
325 u8 log_msx_atomic_size_dc; 324 u8 log_msx_atomic_size_dc;
326 u8 rsvd29[76]; 325 u8 rsvd28[76];
327}; 326};
328 327
329 328
@@ -472,9 +471,8 @@ struct mlx5_eqe_cmd {
472struct mlx5_eqe_page_req { 471struct mlx5_eqe_page_req {
473 u8 rsvd0[2]; 472 u8 rsvd0[2];
474 __be16 func_id; 473 __be16 func_id;
475 u8 rsvd1[2]; 474 __be32 num_pages;
476 __be16 num_pages; 475 __be32 rsvd1[5];
477 __be32 rsvd2[5];
478}; 476};
479 477
480union ev_data { 478union ev_data {
diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
index 2aa258b0ced1..8888381fc150 100644
--- a/include/linux/mlx5/driver.h
+++ b/include/linux/mlx5/driver.h
@@ -358,7 +358,7 @@ struct mlx5_caps {
358 u32 reserved_lkey; 358 u32 reserved_lkey;
359 u8 local_ca_ack_delay; 359 u8 local_ca_ack_delay;
360 u8 log_max_mcg; 360 u8 log_max_mcg;
361 u16 max_qp_mcg; 361 u32 max_qp_mcg;
362 int min_page_sz; 362 int min_page_sz;
363}; 363};
364 364
@@ -691,7 +691,7 @@ void mlx5_pagealloc_cleanup(struct mlx5_core_dev *dev);
691int mlx5_pagealloc_start(struct mlx5_core_dev *dev); 691int mlx5_pagealloc_start(struct mlx5_core_dev *dev);
692void mlx5_pagealloc_stop(struct mlx5_core_dev *dev); 692void mlx5_pagealloc_stop(struct mlx5_core_dev *dev);
693void mlx5_core_req_pages_handler(struct mlx5_core_dev *dev, u16 func_id, 693void mlx5_core_req_pages_handler(struct mlx5_core_dev *dev, u16 func_id,
694 s16 npages); 694 s32 npages);
695int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot); 695int mlx5_satisfy_startup_pages(struct mlx5_core_dev *dev, int boot);
696int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev); 696int mlx5_reclaim_startup_pages(struct mlx5_core_dev *dev);
697void mlx5_register_debugfs(void); 697void mlx5_register_debugfs(void);
@@ -731,9 +731,6 @@ void mlx5_cq_debugfs_cleanup(struct mlx5_core_dev *dev);
731int mlx5_db_alloc(struct mlx5_core_dev *dev, struct mlx5_db *db); 731int mlx5_db_alloc(struct mlx5_core_dev *dev, struct mlx5_db *db);
732void mlx5_db_free(struct mlx5_core_dev *dev, struct mlx5_db *db); 732void mlx5_db_free(struct mlx5_core_dev *dev, struct mlx5_db *db);
733 733
734typedef void (*health_handler_t)(struct pci_dev *pdev, struct health_buffer __iomem *buf, int size);
735int mlx5_register_health_report_handler(health_handler_t handler);
736void mlx5_unregister_health_report_handler(void);
737const char *mlx5_command_str(int command); 734const char *mlx5_command_str(int command);
738int mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev); 735int mlx5_cmdif_debugfs_init(struct mlx5_core_dev *dev);
739void mlx5_cmdif_debugfs_cleanup(struct mlx5_core_dev *dev); 736void mlx5_cmdif_debugfs_cleanup(struct mlx5_core_dev *dev);
diff --git a/include/linux/mm.h b/include/linux/mm.h
index f0224608d15e..d2d59b4149d0 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1798,6 +1798,7 @@ enum mf_flags {
1798 MF_COUNT_INCREASED = 1 << 0, 1798 MF_COUNT_INCREASED = 1 << 0,
1799 MF_ACTION_REQUIRED = 1 << 1, 1799 MF_ACTION_REQUIRED = 1 << 1,
1800 MF_MUST_KILL = 1 << 2, 1800 MF_MUST_KILL = 1 << 2,
1801 MF_SOFT_OFFLINE = 1 << 3,
1801}; 1802};
1802extern int memory_failure(unsigned long pfn, int trapno, int flags); 1803extern int memory_failure(unsigned long pfn, int trapno, int flags);
1803extern void memory_failure_queue(unsigned long pfn, int trapno, int flags); 1804extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index fb425aa16c01..faf4b7c1ad12 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -332,6 +332,7 @@ struct mm_struct {
332 unsigned long pgoff, unsigned long flags); 332 unsigned long pgoff, unsigned long flags);
333#endif 333#endif
334 unsigned long mmap_base; /* base of mmap area */ 334 unsigned long mmap_base; /* base of mmap area */
335 unsigned long mmap_legacy_base; /* base of mmap area in bottom-up allocations */
335 unsigned long task_size; /* size of task vm space */ 336 unsigned long task_size; /* size of task vm space */
336 unsigned long highest_vm_end; /* highest vma end address */ 337 unsigned long highest_vm_end; /* highest vma end address */
337 pgd_t * pgd; 338 pgd_t * pgd;
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 45e921401b06..329aa307cb77 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -277,7 +277,7 @@ struct pcmcia_device_id {
277#define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 277#define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71
278#define INPUT_DEVICE_ID_KEY_MAX 0x2ff 278#define INPUT_DEVICE_ID_KEY_MAX 0x2ff
279#define INPUT_DEVICE_ID_REL_MAX 0x0f 279#define INPUT_DEVICE_ID_REL_MAX 0x0f
280#define INPUT_DEVICE_ID_ABS_MAX 0x3f 280#define INPUT_DEVICE_ID_ABS_MAX 0x4f
281#define INPUT_DEVICE_ID_MSC_MAX 0x07 281#define INPUT_DEVICE_ID_MSC_MAX 0x07
282#define INPUT_DEVICE_ID_LED_MAX 0x0f 282#define INPUT_DEVICE_ID_LED_MAX 0x0f
283#define INPUT_DEVICE_ID_SND_MAX 0x07 283#define INPUT_DEVICE_ID_SND_MAX 0x07
diff --git a/include/linux/module.h b/include/linux/module.h
index 46f1ea01e6f6..05f2447f8c15 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -42,6 +42,7 @@ struct module_kobject {
42 struct module *mod; 42 struct module *mod;
43 struct kobject *drivers_dir; 43 struct kobject *drivers_dir;
44 struct module_param_attrs *mp; 44 struct module_param_attrs *mp;
45 struct completion *kobj_completion;
45}; 46};
46 47
47struct module_attribute { 48struct module_attribute {
@@ -97,6 +98,11 @@ extern const struct gtype##_id __mod_##gtype##_table \
97/* For userspace: you can also call me... */ 98/* For userspace: you can also call me... */
98#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) 99#define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)
99 100
101/* Soft module dependencies. See man modprobe.d for details.
102 * Example: MODULE_SOFTDEP("pre: module-foo module-bar post: module-baz")
103 */
104#define MODULE_SOFTDEP(_softdep) MODULE_INFO(softdep, _softdep)
105
100/* 106/*
101 * The following license idents are currently accepted as indicating free 107 * The following license idents are currently accepted as indicating free
102 * software modules 108 * software modules
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 27d9da3f86ff..c3eb102a9cc8 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -36,7 +36,18 @@ static const char __UNIQUE_ID(name)[] \
36 36
37struct kernel_param; 37struct kernel_param;
38 38
39/*
40 * Flags available for kernel_param_ops
41 *
42 * NOARG - the parameter allows for no argument (foo instead of foo=1)
43 */
44enum {
45 KERNEL_PARAM_FL_NOARG = (1 << 0)
46};
47
39struct kernel_param_ops { 48struct kernel_param_ops {
49 /* How the ops should behave */
50 unsigned int flags;
40 /* Returns 0, or -errno. arg is in kp->arg. */ 51 /* Returns 0, or -errno. arg is in kp->arg. */
41 int (*set)(const char *val, const struct kernel_param *kp); 52 int (*set)(const char *val, const struct kernel_param *kp);
42 /* Returns length written or -errno. Buffer is 4k (ie. be short!) */ 53 /* Returns length written or -errno. Buffer is 4k (ie. be short!) */
@@ -187,7 +198,7 @@ struct kparam_array
187/* Obsolete - use module_param_cb() */ 198/* Obsolete - use module_param_cb() */
188#define module_param_call(name, set, get, arg, perm) \ 199#define module_param_call(name, set, get, arg, perm) \
189 static struct kernel_param_ops __param_ops_##name = \ 200 static struct kernel_param_ops __param_ops_##name = \
190 { (void *)set, (void *)get }; \ 201 { 0, (void *)set, (void *)get }; \
191 __module_param_call(MODULE_PARAM_PREFIX, \ 202 __module_param_call(MODULE_PARAM_PREFIX, \
192 name, &__param_ops_##name, arg, \ 203 name, &__param_ops_##name, arg, \
193 (perm) + sizeof(__check_old_set_param(set))*0, -1) 204 (perm) + sizeof(__check_old_set_param(set))*0, -1)
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index 6e8215b15998..61a0da38d0cb 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -6,6 +6,7 @@
6#define __LINUX_MV643XX_ETH_H 6#define __LINUX_MV643XX_ETH_H
7 7
8#include <linux/mbus.h> 8#include <linux/mbus.h>
9#include <linux/if_ether.h>
9 10
10#define MV643XX_ETH_SHARED_NAME "mv643xx_eth" 11#define MV643XX_ETH_SHARED_NAME "mv643xx_eth"
11#define MV643XX_ETH_NAME "mv643xx_eth_port" 12#define MV643XX_ETH_NAME "mv643xx_eth_port"
@@ -48,7 +49,7 @@ struct mv643xx_eth_platform_data {
48 * Use this MAC address if it is valid, overriding the 49 * Use this MAC address if it is valid, overriding the
49 * address that is already in the hardware. 50 * address that is already in the hardware.
50 */ 51 */
51 u8 mac_addr[6]; 52 u8 mac_addr[ETH_ALEN];
52 53
53 /* 54 /*
54 * If speed is 0, autonegotiation is enabled. 55 * If speed is 0, autonegotiation is enabled.
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 5a5ff57ceed4..cd09751c71a0 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -58,6 +58,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
58 58
59extern int user_path_at(int, const char __user *, unsigned, struct path *); 59extern int user_path_at(int, const char __user *, unsigned, struct path *);
60extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty); 60extern int user_path_at_empty(int, const char __user *, unsigned, struct path *, int *empty);
61extern int user_path_umountat(int, const char __user *, unsigned int, struct path *);
61 62
62#define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path) 63#define user_path(name, path) user_path_at(AT_FDCWD, name, LOOKUP_FOLLOW, path)
63#define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path) 64#define user_lpath(name, path) user_path_at(AT_FDCWD, name, 0, path)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9a4156845e93..8ed4ae943053 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -728,6 +728,16 @@ struct netdev_fcoe_hbainfo {
728}; 728};
729#endif 729#endif
730 730
731#define MAX_PHYS_PORT_ID_LEN 32
732
733/* This structure holds a unique identifier to identify the
734 * physical port used by a netdevice.
735 */
736struct netdev_phys_port_id {
737 unsigned char id[MAX_PHYS_PORT_ID_LEN];
738 unsigned char id_len;
739};
740
731/* 741/*
732 * This structure defines the management hooks for network devices. 742 * This structure defines the management hooks for network devices.
733 * The following hooks can be defined; unless noted otherwise, they are 743 * The following hooks can be defined; unless noted otherwise, they are
@@ -932,6 +942,25 @@ struct netdev_fcoe_hbainfo {
932 * that determine carrier state from physical hardware properties (eg 942 * that determine carrier state from physical hardware properties (eg
933 * network cables) or protocol-dependent mechanisms (eg 943 * network cables) or protocol-dependent mechanisms (eg
934 * USB_CDC_NOTIFY_NETWORK_CONNECTION) should NOT implement this function. 944 * USB_CDC_NOTIFY_NETWORK_CONNECTION) should NOT implement this function.
945 *
946 * int (*ndo_get_phys_port_id)(struct net_device *dev,
947 * struct netdev_phys_port_id *ppid);
948 * Called to get ID of physical port of this device. If driver does
949 * not implement this, it is assumed that the hw is not able to have
950 * multiple net devices on single physical port.
951 *
952 * void (*ndo_add_vxlan_port)(struct net_device *dev,
953 * sa_family_t sa_family, __u16 port);
954 * Called by vxlan to notiy a driver about the UDP port and socket
955 * address family that vxlan is listnening to. It is called only when
956 * a new port starts listening. The operation is protected by the
957 * vxlan_net->sock_lock.
958 *
959 * void (*ndo_del_vxlan_port)(struct net_device *dev,
960 * sa_family_t sa_family, __u16 port);
961 * Called by vxlan to notify the driver about a UDP port and socket
962 * address family that vxlan is not listening to anymore. The operation
963 * is protected by the vxlan_net->sock_lock.
935 */ 964 */
936struct net_device_ops { 965struct net_device_ops {
937 int (*ndo_init)(struct net_device *dev); 966 int (*ndo_init)(struct net_device *dev);
@@ -1060,6 +1089,14 @@ struct net_device_ops {
1060 struct nlmsghdr *nlh); 1089 struct nlmsghdr *nlh);
1061 int (*ndo_change_carrier)(struct net_device *dev, 1090 int (*ndo_change_carrier)(struct net_device *dev,
1062 bool new_carrier); 1091 bool new_carrier);
1092 int (*ndo_get_phys_port_id)(struct net_device *dev,
1093 struct netdev_phys_port_id *ppid);
1094 void (*ndo_add_vxlan_port)(struct net_device *dev,
1095 sa_family_t sa_family,
1096 __u16 port);
1097 void (*ndo_del_vxlan_port)(struct net_device *dev,
1098 sa_family_t sa_family,
1099 __u16 port);
1063}; 1100};
1064 1101
1065/* 1102/*
@@ -1107,6 +1144,7 @@ struct net_device {
1107 struct list_head napi_list; 1144 struct list_head napi_list;
1108 struct list_head unreg_list; 1145 struct list_head unreg_list;
1109 struct list_head upper_dev_list; /* List of upper devices */ 1146 struct list_head upper_dev_list; /* List of upper devices */
1147 struct list_head lower_dev_list;
1110 1148
1111 1149
1112 /* currently active device features */ 1150 /* currently active device features */
@@ -1633,6 +1671,7 @@ struct packet_offload {
1633#define NETDEV_NOTIFY_PEERS 0x0013 1671#define NETDEV_NOTIFY_PEERS 0x0013
1634#define NETDEV_JOIN 0x0014 1672#define NETDEV_JOIN 0x0014
1635#define NETDEV_CHANGEUPPER 0x0015 1673#define NETDEV_CHANGEUPPER 0x0015
1674#define NETDEV_RESEND_IGMP 0x0016
1636 1675
1637extern int register_netdevice_notifier(struct notifier_block *nb); 1676extern int register_netdevice_notifier(struct notifier_block *nb);
1638extern int unregister_netdevice_notifier(struct notifier_block *nb); 1677extern int unregister_netdevice_notifier(struct notifier_block *nb);
@@ -1665,9 +1704,6 @@ extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1665 1704
1666extern rwlock_t dev_base_lock; /* Device list lock */ 1705extern rwlock_t dev_base_lock; /* Device list lock */
1667 1706
1668extern seqcount_t devnet_rename_seq; /* Device rename seq */
1669
1670
1671#define for_each_netdev(net, d) \ 1707#define for_each_netdev(net, d) \
1672 list_for_each_entry(d, &(net)->dev_base_head, dev_list) 1708 list_for_each_entry(d, &(net)->dev_base_head, dev_list)
1673#define for_each_netdev_reverse(net, d) \ 1709#define for_each_netdev_reverse(net, d) \
@@ -2317,6 +2353,8 @@ extern int dev_set_mac_address(struct net_device *,
2317 struct sockaddr *); 2353 struct sockaddr *);
2318extern int dev_change_carrier(struct net_device *, 2354extern int dev_change_carrier(struct net_device *,
2319 bool new_carrier); 2355 bool new_carrier);
2356extern int dev_get_phys_port_id(struct net_device *dev,
2357 struct netdev_phys_port_id *ppid);
2320extern int dev_hard_start_xmit(struct sk_buff *skb, 2358extern int dev_hard_start_xmit(struct sk_buff *skb,
2321 struct net_device *dev, 2359 struct net_device *dev,
2322 struct netdev_queue *txq); 2360 struct netdev_queue *txq);
@@ -2749,6 +2787,16 @@ extern int bpf_jit_enable;
2749extern bool netdev_has_upper_dev(struct net_device *dev, 2787extern bool netdev_has_upper_dev(struct net_device *dev,
2750 struct net_device *upper_dev); 2788 struct net_device *upper_dev);
2751extern bool netdev_has_any_upper_dev(struct net_device *dev); 2789extern bool netdev_has_any_upper_dev(struct net_device *dev);
2790extern struct net_device *netdev_upper_get_next_dev_rcu(struct net_device *dev,
2791 struct list_head **iter);
2792
2793/* iterate through upper list, must be called under RCU read lock */
2794#define netdev_for_each_upper_dev_rcu(dev, upper, iter) \
2795 for (iter = &(dev)->upper_dev_list, \
2796 upper = netdev_upper_get_next_dev_rcu(dev, &(iter)); \
2797 upper; \
2798 upper = netdev_upper_get_next_dev_rcu(dev, &(iter)))
2799
2752extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev); 2800extern struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
2753extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); 2801extern struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
2754extern int netdev_upper_dev_link(struct net_device *dev, 2802extern int netdev_upper_dev_link(struct net_device *dev,
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index de70f7b45b68..708fe72ab913 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -314,25 +314,24 @@ nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family)
314#endif /*CONFIG_NETFILTER*/ 314#endif /*CONFIG_NETFILTER*/
315 315
316#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 316#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
317extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *) __rcu; 317extern void (*ip_ct_attach)(struct sk_buff *, const struct sk_buff *) __rcu;
318extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); 318extern void nf_ct_attach(struct sk_buff *, const struct sk_buff *);
319extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu; 319extern void (*nf_ct_destroy)(struct nf_conntrack *) __rcu;
320 320
321struct nf_conn; 321struct nf_conn;
322enum ip_conntrack_info;
322struct nlattr; 323struct nlattr;
323 324
324struct nfq_ct_hook { 325struct nfq_ct_hook {
325 size_t (*build_size)(const struct nf_conn *ct); 326 size_t (*build_size)(const struct nf_conn *ct);
326 int (*build)(struct sk_buff *skb, struct nf_conn *ct); 327 int (*build)(struct sk_buff *skb, struct nf_conn *ct);
327 int (*parse)(const struct nlattr *attr, struct nf_conn *ct); 328 int (*parse)(const struct nlattr *attr, struct nf_conn *ct);
328}; 329 int (*attach_expect)(const struct nlattr *attr, struct nf_conn *ct,
329extern struct nfq_ct_hook __rcu *nfq_ct_hook; 330 u32 portid, u32 report);
330
331struct nfq_ct_nat_hook {
332 void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct, 331 void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct,
333 u32 ctinfo, int off); 332 enum ip_conntrack_info ctinfo, s32 off);
334}; 333};
335extern struct nfq_ct_nat_hook __rcu *nfq_ct_nat_hook; 334extern struct nfq_ct_hook __rcu *nfq_ct_hook;
336#else 335#else
337static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} 336static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {}
338#endif 337#endif
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 4e2cbfa640b7..58b9a02c38d2 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -98,8 +98,17 @@
98typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t; 98typedef struct { DECLARE_BITMAP(bits, MAX_NUMNODES); } nodemask_t;
99extern nodemask_t _unused_nodemask_arg_; 99extern nodemask_t _unused_nodemask_arg_;
100 100
101/*
102 * The inline keyword gives the compiler room to decide to inline, or
103 * not inline a function as it sees best. However, as these functions
104 * are called in both __init and non-__init functions, if they are not
105 * inlined we will end up with a section mis-match error (of the type of
106 * freeable items not being freed). So we must use __always_inline here
107 * to fix the problem. If other functions in the future also end up in
108 * this situation they will also need to be annotated as __always_inline
109 */
101#define node_set(node, dst) __node_set((node), &(dst)) 110#define node_set(node, dst) __node_set((node), &(dst))
102static inline void __node_set(int node, volatile nodemask_t *dstp) 111static __always_inline void __node_set(int node, volatile nodemask_t *dstp)
103{ 112{
104 set_bit(node, dstp->bits); 113 set_bit(node, dstp->bits);
105} 114}
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index 10e5947491c7..b4ec59d159ac 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -14,6 +14,10 @@ struct fs_struct;
14 * A structure to contain pointers to all per-process 14 * A structure to contain pointers to all per-process
15 * namespaces - fs (mount), uts, network, sysvipc, etc. 15 * namespaces - fs (mount), uts, network, sysvipc, etc.
16 * 16 *
17 * The pid namespace is an exception -- it's accessed using
18 * task_active_pid_ns. The pid namespace here is the
19 * namespace that children will use.
20 *
17 * 'count' is the number of tasks holding a reference. 21 * 'count' is the number of tasks holding a reference.
18 * The count for each namespace, then, will be the number 22 * The count for each namespace, then, will be the number
19 * of nsproxies pointing to it, not the number of tasks. 23 * of nsproxies pointing to it, not the number of tasks.
@@ -27,7 +31,7 @@ struct nsproxy {
27 struct uts_namespace *uts_ns; 31 struct uts_namespace *uts_ns;
28 struct ipc_namespace *ipc_ns; 32 struct ipc_namespace *ipc_ns;
29 struct mnt_namespace *mnt_ns; 33 struct mnt_namespace *mnt_ns;
30 struct pid_namespace *pid_ns; 34 struct pid_namespace *pid_ns_for_children;
31 struct net *net_ns; 35 struct net *net_ns;
32}; 36};
33extern struct nsproxy init_nsproxy; 37extern struct nsproxy init_nsproxy;
diff --git a/include/linux/of.h b/include/linux/of.h
index 1fd08ca23106..3a45c4f593ad 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -266,6 +266,7 @@ extern int of_device_is_available(const struct device_node *device);
266extern const void *of_get_property(const struct device_node *node, 266extern const void *of_get_property(const struct device_node *node,
267 const char *name, 267 const char *name,
268 int *lenp); 268 int *lenp);
269extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
269#define for_each_property_of_node(dn, pp) \ 270#define for_each_property_of_node(dn, pp) \
270 for (pp = dn->properties; pp != NULL; pp = pp->next) 271 for (pp = dn->properties; pp != NULL; pp = pp->next)
271 272
@@ -343,6 +344,8 @@ const char *of_prop_next_string(struct property *prop, const char *cur);
343 s; \ 344 s; \
344 s = of_prop_next_string(prop, s)) 345 s = of_prop_next_string(prop, s))
345 346
347int of_device_is_stdout_path(struct device_node *dn);
348
346#else /* CONFIG_OF */ 349#else /* CONFIG_OF */
347 350
348static inline const char* of_node_full_name(struct device_node *np) 351static inline const char* of_node_full_name(struct device_node *np)
@@ -459,6 +462,12 @@ static inline const void *of_get_property(const struct device_node *node,
459 return NULL; 462 return NULL;
460} 463}
461 464
465static inline struct device_node *of_get_cpu_node(int cpu,
466 unsigned int *thread)
467{
468 return NULL;
469}
470
462static inline int of_property_read_u64(const struct device_node *np, 471static inline int of_property_read_u64(const struct device_node *np,
463 const char *propname, u64 *out_value) 472 const char *propname, u64 *out_value)
464{ 473{
@@ -505,6 +514,11 @@ static inline int of_machine_is_compatible(const char *compat)
505 return 0; 514 return 0;
506} 515}
507 516
517static inline int of_device_is_stdout_path(struct device_node *dn)
518{
519 return 0;
520}
521
508#define of_match_ptr(_ptr) NULL 522#define of_match_ptr(_ptr) NULL
509#define of_match_node(_matches, _node) NULL 523#define of_match_node(_matches, _node) NULL
510#define of_property_for_each_u32(np, propname, prop, p, u) \ 524#define of_property_for_each_u32(np, propname, prop, p, u) \
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index 9d27475feec1..82ce324fdce7 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_OF_DEVICE_H 1#ifndef _LINUX_OF_DEVICE_H
2#define _LINUX_OF_DEVICE_H 2#define _LINUX_OF_DEVICE_H
3 3
4#include <linux/cpu.h>
4#include <linux/platform_device.h> 5#include <linux/platform_device.h>
5#include <linux/of_platform.h> /* temporary until merge */ 6#include <linux/of_platform.h> /* temporary until merge */
6 7
@@ -43,6 +44,15 @@ static inline void of_device_node_put(struct device *dev)
43 of_node_put(dev->of_node); 44 of_node_put(dev->of_node);
44} 45}
45 46
47static inline struct device_node *of_cpu_device_node_get(int cpu)
48{
49 struct device *cpu_dev;
50 cpu_dev = get_cpu_device(cpu);
51 if (!cpu_dev)
52 return NULL;
53 return of_node_get(cpu_dev->of_node);
54}
55
46#else /* CONFIG_OF */ 56#else /* CONFIG_OF */
47 57
48static inline int of_driver_match_device(struct device *dev, 58static inline int of_driver_match_device(struct device *dev,
@@ -67,6 +77,11 @@ static inline const struct of_device_id *of_match_device(
67{ 77{
68 return NULL; 78 return NULL;
69} 79}
80
81static inline struct device_node *of_cpu_device_node_get(int cpu)
82{
83 return NULL;
84}
70#endif /* CONFIG_OF */ 85#endif /* CONFIG_OF */
71 86
72#endif /* _LINUX_OF_DEVICE_H */ 87#endif /* _LINUX_OF_DEVICE_H */
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h
deleted file mode 100644
index cfb545cd86b5..000000000000
--- a/include/linux/of_i2c.h
+++ /dev/null
@@ -1,46 +0,0 @@
1/*
2 * Generic I2C API implementation for PowerPC.
3 *
4 * Copyright (c) 2008 Jochen Friedrich <jochen@scram.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __LINUX_OF_I2C_H
13#define __LINUX_OF_I2C_H
14
15#if defined(CONFIG_OF_I2C) || defined(CONFIG_OF_I2C_MODULE)
16#include <linux/i2c.h>
17
18extern void of_i2c_register_devices(struct i2c_adapter *adap);
19
20/* must call put_device() when done with returned i2c_client device */
21extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
22
23/* must call put_device() when done with returned i2c_adapter device */
24extern struct i2c_adapter *of_find_i2c_adapter_by_node(
25 struct device_node *node);
26
27#else
28static inline void of_i2c_register_devices(struct i2c_adapter *adap)
29{
30 return;
31}
32
33static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
34{
35 return NULL;
36}
37
38/* must call put_device() when done with returned i2c_adapter device */
39static inline struct i2c_adapter *of_find_i2c_adapter_by_node(
40 struct device_node *node)
41{
42 return NULL;
43}
44#endif /* CONFIG_OF_I2C */
45
46#endif /* __LINUX_OF_I2C_H */
diff --git a/include/linux/olpc-ec.h b/include/linux/olpc-ec.h
index 5bb6e760aa61..2925df3ce78a 100644
--- a/include/linux/olpc-ec.h
+++ b/include/linux/olpc-ec.h
@@ -6,6 +6,7 @@
6#define EC_WRITE_SCI_MASK 0x1b 6#define EC_WRITE_SCI_MASK 0x1b
7#define EC_WAKE_UP_WLAN 0x24 7#define EC_WAKE_UP_WLAN 0x24
8#define EC_WLAN_LEAVE_RESET 0x25 8#define EC_WLAN_LEAVE_RESET 0x25
9#define EC_DCON_POWER_MODE 0x26
9#define EC_READ_EB_MODE 0x2a 10#define EC_READ_EB_MODE 0x2a
10#define EC_SET_SCI_INHIBIT 0x32 11#define EC_SET_SCI_INHIBIT 0x32
11#define EC_SET_SCI_INHIBIT_RELEASE 0x34 12#define EC_SET_SCI_INHIBIT_RELEASE 0x34
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index a4c562453f6b..b2a0f15f11fe 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -42,7 +42,6 @@
42#define IBS_FETCH_CODE 13 42#define IBS_FETCH_CODE 13
43#define IBS_OP_CODE 14 43#define IBS_OP_CODE 14
44 44
45struct super_block;
46struct dentry; 45struct dentry;
47struct file_operations; 46struct file_operations;
48struct pt_regs; 47struct pt_regs;
@@ -51,7 +50,7 @@ struct pt_regs;
51struct oprofile_operations { 50struct oprofile_operations {
52 /* create any necessary configuration files in the oprofile fs. 51 /* create any necessary configuration files in the oprofile fs.
53 * Optional. */ 52 * Optional. */
54 int (*create_files)(struct super_block * sb, struct dentry * root); 53 int (*create_files)(struct dentry * root);
55 /* Do any necessary interrupt setup. Optional. */ 54 /* Do any necessary interrupt setup. Optional. */
56 int (*setup)(void); 55 int (*setup)(void);
57 /* Do any necessary interrupt shutdown. Optional. */ 56 /* Do any necessary interrupt shutdown. Optional. */
@@ -125,27 +124,26 @@ void oprofile_add_trace(unsigned long eip);
125 * Create a file of the given name as a child of the given root, with 124 * Create a file of the given name as a child of the given root, with
126 * the specified file operations. 125 * the specified file operations.
127 */ 126 */
128int oprofilefs_create_file(struct super_block * sb, struct dentry * root, 127int oprofilefs_create_file(struct dentry * root,
129 char const * name, const struct file_operations * fops); 128 char const * name, const struct file_operations * fops);
130 129
131int oprofilefs_create_file_perm(struct super_block * sb, struct dentry * root, 130int oprofilefs_create_file_perm(struct dentry * root,
132 char const * name, const struct file_operations * fops, int perm); 131 char const * name, const struct file_operations * fops, int perm);
133 132
134/** Create a file for read/write access to an unsigned long. */ 133/** Create a file for read/write access to an unsigned long. */
135int oprofilefs_create_ulong(struct super_block * sb, struct dentry * root, 134int oprofilefs_create_ulong(struct dentry * root,
136 char const * name, ulong * val); 135 char const * name, ulong * val);
137 136
138/** Create a file for read-only access to an unsigned long. */ 137/** Create a file for read-only access to an unsigned long. */
139int oprofilefs_create_ro_ulong(struct super_block * sb, struct dentry * root, 138int oprofilefs_create_ro_ulong(struct dentry * root,
140 char const * name, ulong * val); 139 char const * name, ulong * val);
141 140
142/** Create a file for read-only access to an atomic_t. */ 141/** Create a file for read-only access to an atomic_t. */
143int oprofilefs_create_ro_atomic(struct super_block * sb, struct dentry * root, 142int oprofilefs_create_ro_atomic(struct dentry * root,
144 char const * name, atomic_t * val); 143 char const * name, atomic_t * val);
145 144
146/** create a directory */ 145/** create a directory */
147struct dentry * oprofilefs_mkdir(struct super_block * sb, struct dentry * root, 146struct dentry *oprofilefs_mkdir(struct dentry *parent, char const *name);
148 char const * name);
149 147
150/** 148/**
151 * Write the given asciz string to the given user buffer @buf, updating *offset 149 * Write the given asciz string to the given user buffer @buf, updating *offset
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 170447977278..d006f0ca60f4 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -47,24 +47,22 @@ void acpi_pci_remove_bus(struct pci_bus *bus);
47 47
48#ifdef CONFIG_ACPI_PCI_SLOT 48#ifdef CONFIG_ACPI_PCI_SLOT
49void acpi_pci_slot_init(void); 49void acpi_pci_slot_init(void);
50void acpi_pci_slot_enumerate(struct pci_bus *bus, acpi_handle handle); 50void acpi_pci_slot_enumerate(struct pci_bus *bus);
51void acpi_pci_slot_remove(struct pci_bus *bus); 51void acpi_pci_slot_remove(struct pci_bus *bus);
52#else 52#else
53static inline void acpi_pci_slot_init(void) { } 53static inline void acpi_pci_slot_init(void) { }
54static inline void acpi_pci_slot_enumerate(struct pci_bus *bus, 54static inline void acpi_pci_slot_enumerate(struct pci_bus *bus) { }
55 acpi_handle handle) { }
56static inline void acpi_pci_slot_remove(struct pci_bus *bus) { } 55static inline void acpi_pci_slot_remove(struct pci_bus *bus) { }
57#endif 56#endif
58 57
59#ifdef CONFIG_HOTPLUG_PCI_ACPI 58#ifdef CONFIG_HOTPLUG_PCI_ACPI
60void acpiphp_init(void); 59void acpiphp_init(void);
61void acpiphp_enumerate_slots(struct pci_bus *bus, acpi_handle handle); 60void acpiphp_enumerate_slots(struct pci_bus *bus);
62void acpiphp_remove_slots(struct pci_bus *bus); 61void acpiphp_remove_slots(struct pci_bus *bus);
63void acpiphp_check_host_bridge(acpi_handle handle); 62void acpiphp_check_host_bridge(acpi_handle handle);
64#else 63#else
65static inline void acpiphp_init(void) { } 64static inline void acpiphp_init(void) { }
66static inline void acpiphp_enumerate_slots(struct pci_bus *bus, 65static inline void acpiphp_enumerate_slots(struct pci_bus *bus) { }
67 acpi_handle handle) { }
68static inline void acpiphp_remove_slots(struct pci_bus *bus) { } 66static inline void acpiphp_remove_slots(struct pci_bus *bus) { }
69static inline void acpiphp_check_host_bridge(acpi_handle handle) { } 67static inline void acpiphp_check_host_bridge(acpi_handle handle) { }
70#endif 68#endif
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 0fd1f1582fa1..20888589c09e 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -183,6 +183,19 @@ enum pci_bus_flags {
183 PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2, 183 PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2,
184}; 184};
185 185
186/* These values come from the PCI Express Spec */
187enum pcie_link_width {
188 PCIE_LNK_WIDTH_RESRV = 0x00,
189 PCIE_LNK_X1 = 0x01,
190 PCIE_LNK_X2 = 0x02,
191 PCIE_LNK_X4 = 0x04,
192 PCIE_LNK_X8 = 0x08,
193 PCIE_LNK_X12 = 0x0C,
194 PCIE_LNK_X16 = 0x10,
195 PCIE_LNK_X32 = 0x20,
196 PCIE_LNK_WIDTH_UNKNOWN = 0xFF,
197};
198
186/* Based on the PCI Hotplug Spec, but some values are made up by us */ 199/* Based on the PCI Hotplug Spec, but some values are made up by us */
187enum pci_bus_speed { 200enum pci_bus_speed {
188 PCI_SPEED_33MHz = 0x00, 201 PCI_SPEED_33MHz = 0x00,
@@ -675,7 +688,7 @@ struct pci_driver {
675/* these external functions are only available when PCI support is enabled */ 688/* these external functions are only available when PCI support is enabled */
676#ifdef CONFIG_PCI 689#ifdef CONFIG_PCI
677 690
678void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss); 691void pcie_bus_configure_settings(struct pci_bus *bus);
679 692
680enum pcie_bus_config_types { 693enum pcie_bus_config_types {
681 PCIE_BUS_TUNE_OFF, 694 PCIE_BUS_TUNE_OFF,
@@ -914,6 +927,7 @@ bool pci_check_and_unmask_intx(struct pci_dev *dev);
914void pci_msi_off(struct pci_dev *dev); 927void pci_msi_off(struct pci_dev *dev);
915int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size); 928int pci_set_dma_max_seg_size(struct pci_dev *dev, unsigned int size);
916int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask); 929int pci_set_dma_seg_boundary(struct pci_dev *dev, unsigned long mask);
930int pci_wait_for_pending_transaction(struct pci_dev *dev);
917int pcix_get_max_mmrbc(struct pci_dev *dev); 931int pcix_get_max_mmrbc(struct pci_dev *dev);
918int pcix_get_mmrbc(struct pci_dev *dev); 932int pcix_get_mmrbc(struct pci_dev *dev);
919int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); 933int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
@@ -921,9 +935,16 @@ int pcie_get_readrq(struct pci_dev *dev);
921int pcie_set_readrq(struct pci_dev *dev, int rq); 935int pcie_set_readrq(struct pci_dev *dev, int rq);
922int pcie_get_mps(struct pci_dev *dev); 936int pcie_get_mps(struct pci_dev *dev);
923int pcie_set_mps(struct pci_dev *dev, int mps); 937int pcie_set_mps(struct pci_dev *dev, int mps);
938int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
939 enum pcie_link_width *width);
924int __pci_reset_function(struct pci_dev *dev); 940int __pci_reset_function(struct pci_dev *dev);
925int __pci_reset_function_locked(struct pci_dev *dev); 941int __pci_reset_function_locked(struct pci_dev *dev);
926int pci_reset_function(struct pci_dev *dev); 942int pci_reset_function(struct pci_dev *dev);
943int pci_probe_reset_slot(struct pci_slot *slot);
944int pci_reset_slot(struct pci_slot *slot);
945int pci_probe_reset_bus(struct pci_bus *bus);
946int pci_reset_bus(struct pci_bus *bus);
947void pci_reset_bridge_secondary_bus(struct pci_dev *dev);
927void pci_update_resource(struct pci_dev *dev, int resno); 948void pci_update_resource(struct pci_dev *dev, int resno);
928int __must_check pci_assign_resource(struct pci_dev *dev, int i); 949int __must_check pci_assign_resource(struct pci_dev *dev, int i);
929int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align); 950int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align);
@@ -1003,6 +1024,7 @@ int pci_claim_resource(struct pci_dev *, int);
1003void pci_assign_unassigned_resources(void); 1024void pci_assign_unassigned_resources(void);
1004void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); 1025void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge);
1005void pci_assign_unassigned_bus_resources(struct pci_bus *bus); 1026void pci_assign_unassigned_bus_resources(struct pci_bus *bus);
1027void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus);
1006void pdev_enable_device(struct pci_dev *); 1028void pdev_enable_device(struct pci_dev *);
1007int pci_enable_resources(struct pci_dev *, int mask); 1029int pci_enable_resources(struct pci_dev *, int mask);
1008void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), 1030void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
@@ -1043,7 +1065,6 @@ int __must_check pci_bus_alloc_resource(struct pci_bus *bus,
1043 resource_size_t, 1065 resource_size_t,
1044 resource_size_t), 1066 resource_size_t),
1045 void *alignf_data); 1067 void *alignf_data);
1046void pci_enable_bridges(struct pci_bus *bus);
1047 1068
1048/* Proper probing supporting hot-pluggable devices */ 1069/* Proper probing supporting hot-pluggable devices */
1049int __must_check __pci_register_driver(struct pci_driver *, struct module *, 1070int __must_check __pci_register_driver(struct pci_driver *, struct module *,
@@ -1648,6 +1669,10 @@ int pcibios_set_pcie_reset_state(struct pci_dev *dev,
1648int pcibios_add_device(struct pci_dev *dev); 1669int pcibios_add_device(struct pci_dev *dev);
1649void pcibios_release_device(struct pci_dev *dev); 1670void pcibios_release_device(struct pci_dev *dev);
1650 1671
1672#ifdef CONFIG_HIBERNATE_CALLBACKS
1673extern struct dev_pm_ops pcibios_pm_ops;
1674#endif
1675
1651#ifdef CONFIG_PCI_MMCONFIG 1676#ifdef CONFIG_PCI_MMCONFIG
1652void __init pci_mmcfg_early_init(void); 1677void __init pci_mmcfg_early_init(void);
1653void __init pci_mmcfg_late_init(void); 1678void __init pci_mmcfg_late_init(void);
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
index 8db71dcd6337..430dd963707b 100644
--- a/include/linux/pci_hotplug.h
+++ b/include/linux/pci_hotplug.h
@@ -28,19 +28,6 @@
28#ifndef _PCI_HOTPLUG_H 28#ifndef _PCI_HOTPLUG_H
29#define _PCI_HOTPLUG_H 29#define _PCI_HOTPLUG_H
30 30
31/* These values come from the PCI Express Spec */
32enum pcie_link_width {
33 PCIE_LNK_WIDTH_RESRV = 0x00,
34 PCIE_LNK_X1 = 0x01,
35 PCIE_LNK_X2 = 0x02,
36 PCIE_LNK_X4 = 0x04,
37 PCIE_LNK_X8 = 0x08,
38 PCIE_LNK_X12 = 0x0C,
39 PCIE_LNK_X16 = 0x10,
40 PCIE_LNK_X32 = 0x20,
41 PCIE_LNK_WIDTH_UNKNOWN = 0xFF,
42};
43
44/** 31/**
45 * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use 32 * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use
46 * @owner: The module owner of this structure 33 * @owner: The module owner of this structure
@@ -63,6 +50,9 @@ enum pcie_link_width {
63 * @get_adapter_status: Called to get see if an adapter is present in the slot or not. 50 * @get_adapter_status: Called to get see if an adapter is present in the slot or not.
64 * If this field is NULL, the value passed in the struct hotplug_slot_info 51 * If this field is NULL, the value passed in the struct hotplug_slot_info
65 * will be used when this value is requested by a user. 52 * will be used when this value is requested by a user.
53 * @reset_slot: Optional interface to allow override of a bus reset for the
54 * slot for cases where a secondary bus reset can result in spurious
55 * hotplug events or where a slot can be reset independent of the bus.
66 * 56 *
67 * The table of function pointers that is passed to the hotplug pci core by a 57 * The table of function pointers that is passed to the hotplug pci core by a
68 * hotplug pci driver. These functions are called by the hotplug pci core when 58 * hotplug pci driver. These functions are called by the hotplug pci core when
@@ -80,6 +70,7 @@ struct hotplug_slot_ops {
80 int (*get_attention_status) (struct hotplug_slot *slot, u8 *value); 70 int (*get_attention_status) (struct hotplug_slot *slot, u8 *value);
81 int (*get_latch_status) (struct hotplug_slot *slot, u8 *value); 71 int (*get_latch_status) (struct hotplug_slot *slot, u8 *value);
82 int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value); 72 int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value);
73 int (*reset_slot) (struct hotplug_slot *slot, int probe);
83}; 74};
84 75
85/** 76/**
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 3bed2e89611b..bc95b2b391bf 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -518,6 +518,8 @@
518#define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303 518#define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303
519#define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304 519#define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304
520#define PCI_DEVICE_ID_AMD_15H_M10H_F3 0x1403 520#define PCI_DEVICE_ID_AMD_15H_M10H_F3 0x1403
521#define PCI_DEVICE_ID_AMD_15H_M30H_NB_F3 0x141d
522#define PCI_DEVICE_ID_AMD_15H_M30H_NB_F4 0x141e
521#define PCI_DEVICE_ID_AMD_15H_NB_F0 0x1600 523#define PCI_DEVICE_ID_AMD_15H_NB_F0 0x1600
522#define PCI_DEVICE_ID_AMD_15H_NB_F1 0x1601 524#define PCI_DEVICE_ID_AMD_15H_NB_F1 0x1601
523#define PCI_DEVICE_ID_AMD_15H_NB_F2 0x1602 525#define PCI_DEVICE_ID_AMD_15H_NB_F2 0x1602
@@ -1311,6 +1313,8 @@
1311#define PCI_DEVICE_ID_IMS_TT128 0x9128 1313#define PCI_DEVICE_ID_IMS_TT128 0x9128
1312#define PCI_DEVICE_ID_IMS_TT3D 0x9135 1314#define PCI_DEVICE_ID_IMS_TT3D 0x9135
1313 1315
1316#define PCI_VENDOR_ID_AMCC 0x10e8
1317
1314#define PCI_VENDOR_ID_INTERG 0x10ea 1318#define PCI_VENDOR_ID_INTERG 0x10ea
1315#define PCI_DEVICE_ID_INTERG_1682 0x1682 1319#define PCI_DEVICE_ID_INTERG_1682 0x1682
1316#define PCI_DEVICE_ID_INTERG_2000 0x2000 1320#define PCI_DEVICE_ID_INTERG_2000 0x2000
@@ -2256,12 +2260,10 @@
2256/* 2260/*
2257 * ADDI-DATA GmbH communication cards <info@addi-data.com> 2261 * ADDI-DATA GmbH communication cards <info@addi-data.com>
2258 */ 2262 */
2259#define PCI_VENDOR_ID_ADDIDATA_OLD 0x10E8
2260#define PCI_VENDOR_ID_ADDIDATA 0x15B8 2263#define PCI_VENDOR_ID_ADDIDATA 0x15B8
2261#define PCI_DEVICE_ID_ADDIDATA_APCI7500 0x7000 2264#define PCI_DEVICE_ID_ADDIDATA_APCI7500 0x7000
2262#define PCI_DEVICE_ID_ADDIDATA_APCI7420 0x7001 2265#define PCI_DEVICE_ID_ADDIDATA_APCI7420 0x7001
2263#define PCI_DEVICE_ID_ADDIDATA_APCI7300 0x7002 2266#define PCI_DEVICE_ID_ADDIDATA_APCI7300 0x7002
2264#define PCI_DEVICE_ID_ADDIDATA_APCI7800 0x818E
2265#define PCI_DEVICE_ID_ADDIDATA_APCI7500_2 0x7009 2267#define PCI_DEVICE_ID_ADDIDATA_APCI7500_2 0x7009
2266#define PCI_DEVICE_ID_ADDIDATA_APCI7420_2 0x700A 2268#define PCI_DEVICE_ID_ADDIDATA_APCI7420_2 0x700A
2267#define PCI_DEVICE_ID_ADDIDATA_APCI7300_2 0x700B 2269#define PCI_DEVICE_ID_ADDIDATA_APCI7300_2 0x700B
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h
index 27ef6b190ea6..57e890abe1f0 100644
--- a/include/linux/percpu-defs.h
+++ b/include/linux/percpu-defs.h
@@ -22,9 +22,12 @@
22 * Macro which verifies @ptr is a percpu pointer without evaluating 22 * Macro which verifies @ptr is a percpu pointer without evaluating
23 * @ptr. This is to be used in percpu accessors to verify that the 23 * @ptr. This is to be used in percpu accessors to verify that the
24 * input parameter is a percpu pointer. 24 * input parameter is a percpu pointer.
25 *
26 * + 0 is required in order to convert the pointer type from a
27 * potential array type to a pointer to a single item of the array.
25 */ 28 */
26#define __verify_pcpu_ptr(ptr) do { \ 29#define __verify_pcpu_ptr(ptr) do { \
27 const void __percpu *__vpp_verify = (typeof(ptr))NULL; \ 30 const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
28 (void)__vpp_verify; \ 31 (void)__vpp_verify; \
29} while (0) 32} while (0)
30 33
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index c43f6eabad5b..866e85c5eb94 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -48,6 +48,7 @@ struct perf_guest_info_callbacks {
48#include <linux/cpu.h> 48#include <linux/cpu.h>
49#include <linux/irq_work.h> 49#include <linux/irq_work.h>
50#include <linux/static_key.h> 50#include <linux/static_key.h>
51#include <linux/jump_label_ratelimit.h>
51#include <linux/atomic.h> 52#include <linux/atomic.h>
52#include <linux/sysfs.h> 53#include <linux/sysfs.h>
53#include <linux/perf_regs.h> 54#include <linux/perf_regs.h>
@@ -64,30 +65,6 @@ struct perf_raw_record {
64}; 65};
65 66
66/* 67/*
67 * single taken branch record layout:
68 *
69 * from: source instruction (may not always be a branch insn)
70 * to: branch target
71 * mispred: branch target was mispredicted
72 * predicted: branch target was predicted
73 *
74 * support for mispred, predicted is optional. In case it
75 * is not supported mispred = predicted = 0.
76 *
77 * in_tx: running in a hardware transaction
78 * abort: aborting a hardware transaction
79 */
80struct perf_branch_entry {
81 __u64 from;
82 __u64 to;
83 __u64 mispred:1, /* target mispredicted */
84 predicted:1,/* target predicted */
85 in_tx:1, /* in transaction */
86 abort:1, /* transaction abort */
87 reserved:60;
88};
89
90/*
91 * branch stack layout: 68 * branch stack layout:
92 * nr: number of taken branches stored in entries[] 69 * nr: number of taken branches stored in entries[]
93 * 70 *
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index bf7e989abcb5..fb90ef5eb038 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -137,6 +137,39 @@ static inline unsigned long pinconf_to_config_packed(enum pin_config_param param
137 return PIN_CONF_PACKED(param, argument); 137 return PIN_CONF_PACKED(param, argument);
138} 138}
139 139
140#ifdef CONFIG_OF
141
142#include <linux/device.h>
143#include <linux/pinctrl/machine.h>
144struct pinctrl_dev;
145struct pinctrl_map;
146
147int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev,
148 struct device_node *np, struct pinctrl_map **map,
149 unsigned *reserved_maps, unsigned *num_maps,
150 enum pinctrl_map_type type);
151int pinconf_generic_dt_node_to_map(struct pinctrl_dev *pctldev,
152 struct device_node *np_config, struct pinctrl_map **map,
153 unsigned *num_maps, enum pinctrl_map_type type);
154
155static inline int pinconf_generic_dt_node_to_map_group(
156 struct pinctrl_dev *pctldev, struct device_node *np_config,
157 struct pinctrl_map **map, unsigned *num_maps)
158{
159 return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps,
160 PIN_MAP_TYPE_CONFIGS_GROUP);
161}
162
163static inline int pinconf_generic_dt_node_to_map_pin(
164 struct pinctrl_dev *pctldev, struct device_node *np_config,
165 struct pinctrl_map **map, unsigned *num_maps)
166{
167 return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps,
168 PIN_MAP_TYPE_CONFIGS_PIN);
169}
170
171#endif
172
140#endif /* CONFIG_GENERIC_PINCONF */ 173#endif /* CONFIG_GENERIC_PINCONF */
141 174
142#endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */ 175#endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */
diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h
index f6998692bdc9..09eb80f2574a 100644
--- a/include/linux/pinctrl/pinconf.h
+++ b/include/linux/pinctrl/pinconf.h
@@ -47,13 +47,15 @@ struct pinconf_ops {
47 unsigned long *config); 47 unsigned long *config);
48 int (*pin_config_set) (struct pinctrl_dev *pctldev, 48 int (*pin_config_set) (struct pinctrl_dev *pctldev,
49 unsigned pin, 49 unsigned pin,
50 unsigned long config); 50 unsigned long *configs,
51 unsigned num_configs);
51 int (*pin_config_group_get) (struct pinctrl_dev *pctldev, 52 int (*pin_config_group_get) (struct pinctrl_dev *pctldev,
52 unsigned selector, 53 unsigned selector,
53 unsigned long *config); 54 unsigned long *config);
54 int (*pin_config_group_set) (struct pinctrl_dev *pctldev, 55 int (*pin_config_group_set) (struct pinctrl_dev *pctldev,
55 unsigned selector, 56 unsigned selector,
56 unsigned long config); 57 unsigned long *configs,
58 unsigned num_configs);
57 int (*pin_config_dbg_parse_modify) (struct pinctrl_dev *pctldev, 59 int (*pin_config_dbg_parse_modify) (struct pinctrl_dev *pctldev,
58 const char *arg, 60 const char *arg,
59 unsigned long *config); 61 unsigned long *config);
diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h
index 88272591a895..9efc04dd255a 100644
--- a/include/linux/platform_data/asoc-s3c.h
+++ b/include/linux/platform_data/asoc-s3c.h
@@ -36,6 +36,7 @@ struct samsung_i2s {
36 */ 36 */
37#define QUIRK_NO_MUXPSR (1 << 2) 37#define QUIRK_NO_MUXPSR (1 << 2)
38#define QUIRK_NEED_RSTCLR (1 << 3) 38#define QUIRK_NEED_RSTCLR (1 << 3)
39#define QUIRK_SUPPORTS_TDM (1 << 4)
39 /* Quirks of the I2S controller */ 40 /* Quirks of the I2S controller */
40 u32 quirks; 41 u32 quirks;
41 dma_addr_t idma_addr; 42 dma_addr_t idma_addr;
diff --git a/include/linux/platform_data/at91_adc.h b/include/linux/platform_data/at91_adc.h
index e15745b4f3a5..b3ca1e94e0c8 100644
--- a/include/linux/platform_data/at91_adc.h
+++ b/include/linux/platform_data/at91_adc.h
@@ -14,12 +14,16 @@
14 (Interruptions registers mostly) 14 (Interruptions registers mostly)
15 * @status_register: Offset of the Interrupt Status Register 15 * @status_register: Offset of the Interrupt Status Register
16 * @trigger_register: Offset of the Trigger setup register 16 * @trigger_register: Offset of the Trigger setup register
17 * @mr_prescal_mask: Mask of the PRESCAL field in the adc MR register
18 * @mr_startup_mask: Mask of the STARTUP field in the adc MR register
17 */ 19 */
18struct at91_adc_reg_desc { 20struct at91_adc_reg_desc {
19 u8 channel_base; 21 u8 channel_base;
20 u32 drdy_mask; 22 u32 drdy_mask;
21 u8 status_register; 23 u8 status_register;
22 u8 trigger_register; 24 u8 trigger_register;
25 u32 mr_prescal_mask;
26 u32 mr_startup_mask;
23}; 27};
24 28
25/** 29/**
diff --git a/include/linux/platform_data/brcmfmac-sdio.h b/include/linux/platform_data/brcmfmac-sdio.h
index b7174998c24a..e75dcbf2b230 100644
--- a/include/linux/platform_data/brcmfmac-sdio.h
+++ b/include/linux/platform_data/brcmfmac-sdio.h
@@ -94,6 +94,10 @@ void __init brcmfmac_init_pdata(void)
94 * Set this to true if the SDIO host controller has higher align requirement 94 * Set this to true if the SDIO host controller has higher align requirement
95 * than 32 bytes for each scatterlist item. 95 * than 32 bytes for each scatterlist item.
96 * 96 *
97 * sd_head_align: alignment requirement for start of data buffer
98 *
99 * sd_sgentry_align: length alignment requirement for each sg entry
100 *
97 * power_on: This function is called by the brcmfmac when the module gets 101 * power_on: This function is called by the brcmfmac when the module gets
98 * loaded. This can be particularly useful for low power devices. The platform 102 * loaded. This can be particularly useful for low power devices. The platform
99 * spcific routine may for example decide to power up the complete device. 103 * spcific routine may for example decide to power up the complete device.
@@ -121,6 +125,8 @@ struct brcmfmac_sdio_platform_data {
121 unsigned int oob_irq_nr; 125 unsigned int oob_irq_nr;
122 unsigned long oob_irq_flags; 126 unsigned long oob_irq_flags;
123 bool broken_sg_support; 127 bool broken_sg_support;
128 unsigned short sd_head_align;
129 unsigned short sd_sgentry_align;
124 void (*power_on)(void); 130 void (*power_on)(void);
125 void (*power_off)(void); 131 void (*power_off)(void);
126 void (*reset)(void); 132 void (*reset)(void);
diff --git a/include/linux/platform_data/camera-mx3.h b/include/linux/platform_data/camera-mx3.h
index f226ee3777e1..a910dadc8258 100644
--- a/include/linux/platform_data/camera-mx3.h
+++ b/include/linux/platform_data/camera-mx3.h
@@ -33,6 +33,8 @@
33#define MX3_CAMERA_DATAWIDTH_MASK (MX3_CAMERA_DATAWIDTH_4 | MX3_CAMERA_DATAWIDTH_8 | \ 33#define MX3_CAMERA_DATAWIDTH_MASK (MX3_CAMERA_DATAWIDTH_4 | MX3_CAMERA_DATAWIDTH_8 | \
34 MX3_CAMERA_DATAWIDTH_10 | MX3_CAMERA_DATAWIDTH_15) 34 MX3_CAMERA_DATAWIDTH_10 | MX3_CAMERA_DATAWIDTH_15)
35 35
36struct v4l2_async_subdev;
37
36/** 38/**
37 * struct mx3_camera_pdata - i.MX3x camera platform data 39 * struct mx3_camera_pdata - i.MX3x camera platform data
38 * @flags: MX3_CAMERA_* flags 40 * @flags: MX3_CAMERA_* flags
@@ -43,6 +45,8 @@ struct mx3_camera_pdata {
43 unsigned long flags; 45 unsigned long flags;
44 unsigned long mclk_10khz; 46 unsigned long mclk_10khz;
45 struct device *dma_dev; 47 struct device *dma_dev;
48 struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
49 int *asd_sizes; /* 0-terminated array of asd group sizes */
46}; 50};
47 51
48#endif 52#endif
diff --git a/include/linux/platform_data/camera-rcar.h b/include/linux/platform_data/camera-rcar.h
new file mode 100644
index 000000000000..dfc83c581593
--- /dev/null
+++ b/include/linux/platform_data/camera-rcar.h
@@ -0,0 +1,25 @@
1/*
2 * Platform data for Renesas R-Car VIN soc-camera driver
3 *
4 * Copyright (C) 2011-2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Cogent Embedded, Inc., <source@cogentembedded.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
11 */
12
13#ifndef __CAMERA_RCAR_H_
14#define __CAMERA_RCAR_H_
15
16#define RCAR_VIN_HSYNC_ACTIVE_LOW (1 << 0)
17#define RCAR_VIN_VSYNC_ACTIVE_LOW (1 << 1)
18#define RCAR_VIN_BT601 (1 << 2)
19#define RCAR_VIN_BT656 (1 << 3)
20
21struct rcar_vin_platform_data {
22 unsigned int flags;
23};
24
25#endif /* __CAMERA_RCAR_H_ */
diff --git a/include/linux/platform_data/cpsw.h b/include/linux/platform_data/cpsw.h
deleted file mode 100644
index bb3cd58d71e3..000000000000
--- a/include/linux/platform_data/cpsw.h
+++ /dev/null
@@ -1,44 +0,0 @@
1/*
2 * Texas Instruments Ethernet Switch Driver
3 *
4 * Copyright (C) 2012 Texas Instruments
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15#ifndef __CPSW_H__
16#define __CPSW_H__
17
18#include <linux/if_ether.h>
19
20struct cpsw_slave_data {
21 char phy_id[MII_BUS_ID_SIZE];
22 int phy_if;
23 u8 mac_addr[ETH_ALEN];
24 u16 dual_emac_res_vlan; /* Reserved VLAN for DualEMAC */
25
26};
27
28struct cpsw_platform_data {
29 u32 ss_reg_ofs; /* Subsystem control register offset */
30 u32 channels; /* number of cpdma channels (symmetric) */
31 u32 slaves; /* number of slave cpgmac ports */
32 struct cpsw_slave_data *slave_data;
33 u32 active_slave; /* time stamping, ethtool and SIOCGMIIPHY slave */
34 u32 cpts_clock_mult; /* convert input clock ticks to nanoseconds */
35 u32 cpts_clock_shift; /* convert input clock ticks to nanoseconds */
36 u32 ale_entries; /* ale table size */
37 u32 bd_ram_size; /*buffer descriptor ram size */
38 u32 rx_descs; /* Number of Rx Descriptios */
39 u32 mac_control; /* Mac control register */
40 u16 default_vlan; /* Def VLAN for ALE lookup in VLAN aware mode*/
41 bool dual_emac; /* Enable Dual EMAC mode */
42};
43
44#endif /* __CPSW_H__ */
diff --git a/include/linux/platform_data/efm32-spi.h b/include/linux/platform_data/efm32-spi.h
new file mode 100644
index 000000000000..31b19ca1d73a
--- /dev/null
+++ b/include/linux/platform_data/efm32-spi.h
@@ -0,0 +1,14 @@
1#ifndef __LINUX_PLATFORM_DATA_EFM32_SPI_H__
2#define __LINUX_PLATFORM_DATA_EFM32_SPI_H__
3
4#include <linux/types.h>
5
6/**
7 * struct efm32_spi_pdata
8 * @location: pinmux location for the I/O pins (to be written to the ROUTE
9 * register)
10 */
11struct efm32_spi_pdata {
12 u8 location;
13};
14#endif /* ifndef __LINUX_PLATFORM_DATA_EFM32_SPI_H__ */
diff --git a/include/linux/platform_data/max310x.h b/include/linux/platform_data/max310x.h
index 91648bf5fc5c..dd11dcd1a184 100644
--- a/include/linux/platform_data/max310x.h
+++ b/include/linux/platform_data/max310x.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Maxim (Dallas) MAX3107/8 serial driver 2 * Maxim (Dallas) MAX3107/8/9, MAX14830 serial driver
3 * 3 *
4 * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru> 4 * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru>
5 * 5 *
@@ -37,14 +37,13 @@
37 * }; 37 * };
38 */ 38 */
39 39
40#define MAX310X_MAX_UARTS 1 40#define MAX310X_MAX_UARTS 4
41 41
42/* MAX310X platform data structure */ 42/* MAX310X platform data structure */
43struct max310x_pdata { 43struct max310x_pdata {
44 /* Flags global to driver */ 44 /* Flags global to driver */
45 const u8 driver_flags:2; 45 const u8 driver_flags;
46#define MAX310X_EXT_CLK (0x00000001) /* External clock enable */ 46#define MAX310X_EXT_CLK (0x00000001) /* External clock enable */
47#define MAX310X_AUTOSLEEP (0x00000002) /* Enable AutoSleep mode */
48 /* Flags global to UART port */ 47 /* Flags global to UART port */
49 const u8 uart_flags[MAX310X_MAX_UARTS]; 48 const u8 uart_flags[MAX310X_MAX_UARTS];
50#define MAX310X_LOOPBACK (0x00000001) /* Loopback mode enable */ 49#define MAX310X_LOOPBACK (0x00000001) /* Loopback mode enable */
@@ -60,8 +59,6 @@ struct max310x_pdata {
60 void (*init)(void); 59 void (*init)(void);
61 /* Called before finish */ 60 /* Called before finish */
62 void (*exit)(void); 61 void (*exit)(void);
63 /* Suspend callback */
64 void (*suspend)(int do_suspend);
65}; 62};
66 63
67#endif 64#endif
diff --git a/include/linux/platform_data/omap-abe-twl6040.h b/include/linux/platform_data/omap-abe-twl6040.h
deleted file mode 100644
index 5d298ac10fc2..000000000000
--- a/include/linux/platform_data/omap-abe-twl6040.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/**
2 * omap-abe-twl6040.h - ASoC machine driver OMAP4+ devices, header.
3 *
4 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com
5 * All rights reserved.
6 *
7 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 */
23
24#ifndef _OMAP_ABE_TWL6040_H_
25#define _OMAP_ABE_TWL6040_H_
26
27/* To select if only one channel is connected in a stereo port */
28#define ABE_TWL6040_LEFT (1 << 0)
29#define ABE_TWL6040_RIGHT (1 << 1)
30
31struct omap_abe_twl6040_data {
32 char *card_name;
33 /* Feature flags for connected audio pins */
34 u8 has_hs;
35 u8 has_hf;
36 bool has_ep;
37 u8 has_aux;
38 u8 has_vibra;
39 bool has_dmic;
40 bool has_hsmic;
41 bool has_mainmic;
42 bool has_submic;
43 u8 has_afm;
44 /* Other features */
45 bool jack_detection; /* board can detect jack events */
46 int mclk_freq; /* MCLK frequency speed for twl6040 */
47};
48
49#endif /* _OMAP_ABE_TWL6040_H_ */
diff --git a/include/linux/platform_data/pinctrl-nomadik.h b/include/linux/platform_data/pinctrl-nomadik.h
index f73b2f0c55b7..abf5bed84df3 100644
--- a/include/linux/platform_data/pinctrl-nomadik.h
+++ b/include/linux/platform_data/pinctrl-nomadik.h
@@ -226,30 +226,6 @@ enum nmk_gpio_slpm {
226 NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE, 226 NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE,
227}; 227};
228 228
229/* Older deprecated pin config API that should go away soon */
230extern int nmk_config_pin(pin_cfg_t cfg, bool sleep);
231extern int nmk_config_pins(pin_cfg_t *cfgs, int num);
232extern int nmk_config_pins_sleep(pin_cfg_t *cfgs, int num);
233extern int nmk_gpio_set_slpm(int gpio, enum nmk_gpio_slpm mode);
234extern int nmk_gpio_set_pull(int gpio, enum nmk_gpio_pull pull);
235#ifdef CONFIG_PINCTRL_NOMADIK
236extern int nmk_gpio_set_mode(int gpio, int gpio_mode);
237#else
238static inline int nmk_gpio_set_mode(int gpio, int gpio_mode)
239{
240 return -ENODEV;
241}
242#endif
243extern int nmk_gpio_get_mode(int gpio);
244
245extern void nmk_gpio_wakeups_suspend(void);
246extern void nmk_gpio_wakeups_resume(void);
247
248extern void nmk_gpio_clocks_enable(void);
249extern void nmk_gpio_clocks_disable(void);
250
251extern void nmk_gpio_read_pull(int gpio_bank, u32 *pull_up);
252
253/* 229/*
254 * Platform data to register a block: only the initial gpio/irq number. 230 * Platform data to register a block: only the initial gpio/irq number.
255 */ 231 */
diff --git a/include/linux/platform_data/rcar-du.h b/include/linux/platform_data/rcar-du.h
index 80587fdbba3e..1a2e9901a22e 100644
--- a/include/linux/platform_data/rcar-du.h
+++ b/include/linux/platform_data/rcar-du.h
@@ -16,8 +16,18 @@
16 16
17#include <drm/drm_mode.h> 17#include <drm/drm_mode.h>
18 18
19enum rcar_du_output {
20 RCAR_DU_OUTPUT_DPAD0,
21 RCAR_DU_OUTPUT_DPAD1,
22 RCAR_DU_OUTPUT_LVDS0,
23 RCAR_DU_OUTPUT_LVDS1,
24 RCAR_DU_OUTPUT_TCON,
25 RCAR_DU_OUTPUT_MAX,
26};
27
19enum rcar_du_encoder_type { 28enum rcar_du_encoder_type {
20 RCAR_DU_ENCODER_UNUSED = 0, 29 RCAR_DU_ENCODER_UNUSED = 0,
30 RCAR_DU_ENCODER_NONE,
21 RCAR_DU_ENCODER_VGA, 31 RCAR_DU_ENCODER_VGA,
22 RCAR_DU_ENCODER_LVDS, 32 RCAR_DU_ENCODER_LVDS,
23}; 33};
@@ -28,22 +38,32 @@ struct rcar_du_panel_data {
28 struct drm_mode_modeinfo mode; 38 struct drm_mode_modeinfo mode;
29}; 39};
30 40
31struct rcar_du_encoder_lvds_data { 41struct rcar_du_connector_lvds_data {
32 struct rcar_du_panel_data panel; 42 struct rcar_du_panel_data panel;
33}; 43};
34 44
35struct rcar_du_encoder_vga_data { 45struct rcar_du_connector_vga_data {
36 /* TODO: Add DDC information for EDID retrieval */ 46 /* TODO: Add DDC information for EDID retrieval */
37}; 47};
38 48
49/*
50 * struct rcar_du_encoder_data - Encoder platform data
51 * @type: the encoder type (RCAR_DU_ENCODER_*)
52 * @output: the DU output the connector is connected to (RCAR_DU_OUTPUT_*)
53 * @connector.lvds: platform data for LVDS connectors
54 * @connector.vga: platform data for VGA connectors
55 *
56 * Encoder platform data describes an on-board encoder, its associated DU SoC
57 * output, and the connector.
58 */
39struct rcar_du_encoder_data { 59struct rcar_du_encoder_data {
40 enum rcar_du_encoder_type encoder; 60 enum rcar_du_encoder_type type;
41 unsigned int output; 61 enum rcar_du_output output;
42 62
43 union { 63 union {
44 struct rcar_du_encoder_lvds_data lvds; 64 struct rcar_du_connector_lvds_data lvds;
45 struct rcar_du_encoder_vga_data vga; 65 struct rcar_du_connector_vga_data vga;
46 } u; 66 } connector;
47}; 67};
48 68
49struct rcar_du_platform_data { 69struct rcar_du_platform_data {
diff --git a/include/linux/platform_data/serial-sccnxp.h b/include/linux/platform_data/serial-sccnxp.h
index bdc510d03245..af0c8c3b89ae 100644
--- a/include/linux/platform_data/serial-sccnxp.h
+++ b/include/linux/platform_data/serial-sccnxp.h
@@ -60,7 +60,6 @@
60 * }; 60 * };
61 * 61 *
62 * static struct sccnxp_pdata sc2892_info = { 62 * static struct sccnxp_pdata sc2892_info = {
63 * .frequency = 3686400,
64 * .mctrl_cfg[0] = MCTRL_SIG(DIR_OP, LINE_OP0), 63 * .mctrl_cfg[0] = MCTRL_SIG(DIR_OP, LINE_OP0),
65 * .mctrl_cfg[1] = MCTRL_SIG(DIR_OP, LINE_OP1), 64 * .mctrl_cfg[1] = MCTRL_SIG(DIR_OP, LINE_OP1),
66 * }; 65 * };
@@ -78,8 +77,6 @@
78 77
79/* SCCNXP platform data structure */ 78/* SCCNXP platform data structure */
80struct sccnxp_pdata { 79struct sccnxp_pdata {
81 /* Frequency (extrenal clock or crystal) */
82 int frequency;
83 /* Shift for A0 line */ 80 /* Shift for A0 line */
84 const u8 reg_shift; 81 const u8 reg_shift;
85 /* Modem control lines configuration */ 82 /* Modem control lines configuration */
diff --git a/include/linux/platform_data/simplefb.h b/include/linux/platform_data/simplefb.h
new file mode 100644
index 000000000000..077303cedbf4
--- /dev/null
+++ b/include/linux/platform_data/simplefb.h
@@ -0,0 +1,64 @@
1/*
2 * simplefb.h - Simple Framebuffer Device
3 *
4 * Copyright (C) 2013 David Herrmann <dh.herrmann@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __PLATFORM_DATA_SIMPLEFB_H__
13#define __PLATFORM_DATA_SIMPLEFB_H__
14
15#include <drm/drm_fourcc.h>
16#include <linux/fb.h>
17#include <linux/kernel.h>
18
19/* format array, use it to initialize a "struct simplefb_format" array */
20#define SIMPLEFB_FORMATS \
21{ \
22 { "r5g6b5", 16, {11, 5}, {5, 6}, {0, 5}, {0, 0}, DRM_FORMAT_RGB565 }, \
23 { "x1r5g5b5", 16, {10, 5}, {5, 5}, {0, 5}, {0, 0}, DRM_FORMAT_XRGB1555 }, \
24 { "a1r5g5b5", 16, {10, 5}, {5, 5}, {0, 5}, {15, 1}, DRM_FORMAT_ARGB1555 }, \
25 { "r8g8b8", 24, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_RGB888 }, \
26 { "x8r8g8b8", 32, {16, 8}, {8, 8}, {0, 8}, {0, 0}, DRM_FORMAT_XRGB8888 }, \
27 { "a8r8g8b8", 32, {16, 8}, {8, 8}, {0, 8}, {24, 8}, DRM_FORMAT_ARGB8888 }, \
28 { "a8b8g8r8", 32, {0, 8}, {8, 8}, {16, 8}, {24, 8}, DRM_FORMAT_ABGR8888 }, \
29 { "x2r10g10b10", 32, {20, 10}, {10, 10}, {0, 10}, {0, 0}, DRM_FORMAT_XRGB2101010 }, \
30 { "a2r10g10b10", 32, {20, 10}, {10, 10}, {0, 10}, {30, 2}, DRM_FORMAT_ARGB2101010 }, \
31}
32
33/*
34 * Data-Format for Simple-Framebuffers
35 * @name: unique 0-terminated name that can be used to identify the mode
36 * @red,green,blue: Offsets and sizes of the single RGB parts
37 * @transp: Offset and size of the alpha bits. length=0 means no alpha
38 * @fourcc: 32bit DRM four-CC code (see drm_fourcc.h)
39 */
40struct simplefb_format {
41 const char *name;
42 u32 bits_per_pixel;
43 struct fb_bitfield red;
44 struct fb_bitfield green;
45 struct fb_bitfield blue;
46 struct fb_bitfield transp;
47 u32 fourcc;
48};
49
50/*
51 * Simple-Framebuffer description
52 * If the arch-boot code creates simple-framebuffers without DT support, it
53 * can pass the width, height, stride and format via this platform-data object.
54 * The framebuffer location must be given as IORESOURCE_MEM resource.
55 * @format must be a format as described in "struct simplefb_format" above.
56 */
57struct simplefb_platform_data {
58 u32 width;
59 u32 height;
60 u32 stride;
61 const char *format;
62};
63
64#endif /* __PLATFORM_DATA_SIMPLEFB_H__ */
diff --git a/include/linux/platform_data/st_sensors_pdata.h b/include/linux/platform_data/st_sensors_pdata.h
new file mode 100644
index 000000000000..753839187ba0
--- /dev/null
+++ b/include/linux/platform_data/st_sensors_pdata.h
@@ -0,0 +1,24 @@
1/*
2 * STMicroelectronics sensors platform-data driver
3 *
4 * Copyright 2013 STMicroelectronics Inc.
5 *
6 * Denis Ciocca <denis.ciocca@st.com>
7 *
8 * Licensed under the GPL-2.
9 */
10
11#ifndef ST_SENSORS_PDATA_H
12#define ST_SENSORS_PDATA_H
13
14/**
15 * struct st_sensors_platform_data - Platform data for the ST sensors
16 * @drdy_int_pin: Redirect DRDY on pin 1 (1) or pin 2 (2).
17 * Available only for accelerometer and pressure sensors.
18 * Accelerometer DRDY on LSM330 available only on pin 1 (see datasheet).
19 */
20struct st_sensors_platform_data {
21 u8 drdy_int_pin;
22};
23
24#endif /* ST_SENSORS_PDATA_H */
diff --git a/include/linux/platform_data/tegra_usb.h b/include/linux/platform_data/tegra_usb.h
deleted file mode 100644
index 66c673fef408..000000000000
--- a/include/linux/platform_data/tegra_usb.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * Copyright (C) 2010 Google, Inc.
3 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef _TEGRA_USB_H_
16#define _TEGRA_USB_H_
17
18enum tegra_usb_operating_modes {
19 TEGRA_USB_DEVICE,
20 TEGRA_USB_HOST,
21 TEGRA_USB_OTG,
22};
23
24struct tegra_ehci_platform_data {
25 enum tegra_usb_operating_modes operating_mode;
26 /* power down the phy on bus suspend */
27 int power_down_on_bus_suspend;
28 void *phy_config;
29 int vbus_gpio;
30};
31
32#endif /* _TEGRA_USB_H_ */
diff --git a/include/linux/platform_data/vsp1.h b/include/linux/platform_data/vsp1.h
new file mode 100644
index 000000000000..a73a456d7f11
--- /dev/null
+++ b/include/linux/platform_data/vsp1.h
@@ -0,0 +1,25 @@
1/*
2 * vsp1.h -- R-Car VSP1 Platform Data
3 *
4 * Copyright (C) 2013 Renesas Corporation
5 *
6 * Contact: Laurent Pinchart (laurent.pinchart@ideasonboard.com)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 */
13#ifndef __PLATFORM_VSP1_H__
14#define __PLATFORM_VSP1_H__
15
16#define VSP1_HAS_LIF (1 << 0)
17
18struct vsp1_platform_data {
19 unsigned int features;
20 unsigned int rpf_count;
21 unsigned int uds_count;
22 unsigned int wpf_count;
23};
24
25#endif /* __PLATFORM_VSP1_H__ */
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h
index 7db3eb93a079..1d2cd21242e8 100644
--- a/include/linux/pps_kernel.h
+++ b/include/linux/pps_kernel.h
@@ -80,7 +80,7 @@ struct pps_device {
80 * Global variables 80 * Global variables
81 */ 81 */
82 82
83extern struct device_attribute pps_attrs[]; 83extern const struct attribute_group *pps_groups[];
84 84
85/* 85/*
86 * Internal functions. 86 * Internal functions.
diff --git a/include/linux/preempt_mask.h b/include/linux/preempt_mask.h
new file mode 100644
index 000000000000..931bc616219f
--- /dev/null
+++ b/include/linux/preempt_mask.h
@@ -0,0 +1,122 @@
1#ifndef LINUX_PREEMPT_MASK_H
2#define LINUX_PREEMPT_MASK_H
3
4#include <linux/preempt.h>
5#include <asm/hardirq.h>
6
7/*
8 * We put the hardirq and softirq counter into the preemption
9 * counter. The bitmask has the following meaning:
10 *
11 * - bits 0-7 are the preemption count (max preemption depth: 256)
12 * - bits 8-15 are the softirq count (max # of softirqs: 256)
13 *
14 * The hardirq count can in theory reach the same as NR_IRQS.
15 * In reality, the number of nested IRQS is limited to the stack
16 * size as well. For archs with over 1000 IRQS it is not practical
17 * to expect that they will all nest. We give a max of 10 bits for
18 * hardirq nesting. An arch may choose to give less than 10 bits.
19 * m68k expects it to be 8.
20 *
21 * - bits 16-25 are the hardirq count (max # of nested hardirqs: 1024)
22 * - bit 26 is the NMI_MASK
23 * - bit 27 is the PREEMPT_ACTIVE flag
24 *
25 * PREEMPT_MASK: 0x000000ff
26 * SOFTIRQ_MASK: 0x0000ff00
27 * HARDIRQ_MASK: 0x03ff0000
28 * NMI_MASK: 0x04000000
29 */
30#define PREEMPT_BITS 8
31#define SOFTIRQ_BITS 8
32#define NMI_BITS 1
33
34#define MAX_HARDIRQ_BITS 10
35
36#ifndef HARDIRQ_BITS
37# define HARDIRQ_BITS MAX_HARDIRQ_BITS
38#endif
39
40#if HARDIRQ_BITS > MAX_HARDIRQ_BITS
41#error HARDIRQ_BITS too high!
42#endif
43
44#define PREEMPT_SHIFT 0
45#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
46#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
47#define NMI_SHIFT (HARDIRQ_SHIFT + HARDIRQ_BITS)
48
49#define __IRQ_MASK(x) ((1UL << (x))-1)
50
51#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
52#define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
53#define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
54#define NMI_MASK (__IRQ_MASK(NMI_BITS) << NMI_SHIFT)
55
56#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
57#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
58#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
59#define NMI_OFFSET (1UL << NMI_SHIFT)
60
61#define SOFTIRQ_DISABLE_OFFSET (2 * SOFTIRQ_OFFSET)
62
63#ifndef PREEMPT_ACTIVE
64#define PREEMPT_ACTIVE_BITS 1
65#define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS)
66#define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT)
67#endif
68
69#if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS))
70#error PREEMPT_ACTIVE is too low!
71#endif
72
73#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
74#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
75#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK \
76 | NMI_MASK))
77
78/*
79 * Are we doing bottom half or hardware interrupt processing?
80 * Are we in a softirq context? Interrupt context?
81 * in_softirq - Are we currently processing softirq or have bh disabled?
82 * in_serving_softirq - Are we currently processing softirq?
83 */
84#define in_irq() (hardirq_count())
85#define in_softirq() (softirq_count())
86#define in_interrupt() (irq_count())
87#define in_serving_softirq() (softirq_count() & SOFTIRQ_OFFSET)
88
89/*
90 * Are we in NMI context?
91 */
92#define in_nmi() (preempt_count() & NMI_MASK)
93
94#if defined(CONFIG_PREEMPT_COUNT)
95# define PREEMPT_CHECK_OFFSET 1
96#else
97# define PREEMPT_CHECK_OFFSET 0
98#endif
99
100/*
101 * Are we running in atomic context? WARNING: this macro cannot
102 * always detect atomic context; in particular, it cannot know about
103 * held spinlocks in non-preemptible kernels. Thus it should not be
104 * used in the general case to determine whether sleeping is possible.
105 * Do not use in_atomic() in driver code.
106 */
107#define in_atomic() ((preempt_count() & ~PREEMPT_ACTIVE) != 0)
108
109/*
110 * Check whether we were atomic before we did preempt_disable():
111 * (used by the scheduler, *after* releasing the kernel lock)
112 */
113#define in_atomic_preempt_off() \
114 ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)
115
116#ifdef CONFIG_PREEMPT_COUNT
117# define preemptible() (preempt_count() == 0 && !irqs_disabled())
118#else
119# define preemptible() 0
120#endif
121
122#endif /* LINUX_PREEMPT_MASK_H */
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 22c7052e9372..e6131a782481 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -200,7 +200,7 @@ static inline void show_regs_print_info(const char *log_lvl)
200} 200}
201#endif 201#endif
202 202
203extern void dump_stack(void) __cold; 203extern asmlinkage void dump_stack(void) __cold;
204 204
205#ifndef pr_fmt 205#ifndef pr_fmt
206#define pr_fmt(fmt) fmt 206#define pr_fmt(fmt) fmt
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index 4aa80ba830a2..abd437d0a8a7 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -55,14 +55,14 @@ struct pstore_info {
55 int (*close)(struct pstore_info *psi); 55 int (*close)(struct pstore_info *psi);
56 ssize_t (*read)(u64 *id, enum pstore_type_id *type, 56 ssize_t (*read)(u64 *id, enum pstore_type_id *type,
57 int *count, struct timespec *time, char **buf, 57 int *count, struct timespec *time, char **buf,
58 struct pstore_info *psi); 58 bool *compressed, struct pstore_info *psi);
59 int (*write)(enum pstore_type_id type, 59 int (*write)(enum pstore_type_id type,
60 enum kmsg_dump_reason reason, u64 *id, 60 enum kmsg_dump_reason reason, u64 *id,
61 unsigned int part, int count, size_t hsize, 61 unsigned int part, int count, bool compressed,
62 size_t size, struct pstore_info *psi); 62 size_t size, struct pstore_info *psi);
63 int (*write_buf)(enum pstore_type_id type, 63 int (*write_buf)(enum pstore_type_id type,
64 enum kmsg_dump_reason reason, u64 *id, 64 enum kmsg_dump_reason reason, u64 *id,
65 unsigned int part, const char *buf, size_t hsize, 65 unsigned int part, const char *buf, bool compressed,
66 size_t size, struct pstore_info *psi); 66 size_t size, struct pstore_info *psi);
67 int (*erase)(enum pstore_type_id type, u64 id, 67 int (*erase)(enum pstore_type_id type, u64 id,
68 int count, struct timespec time, 68 int count, struct timespec time,
diff --git a/include/linux/pxa2xx_ssp.h b/include/linux/pxa2xx_ssp.h
index 467cc6307b62..49444203328a 100644
--- a/include/linux/pxa2xx_ssp.h
+++ b/include/linux/pxa2xx_ssp.h
@@ -21,6 +21,8 @@
21 21
22#include <linux/list.h> 22#include <linux/list.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/of.h>
25
24 26
25/* 27/*
26 * SSP Serial Port Registers 28 * SSP Serial Port Registers
@@ -190,6 +192,8 @@ struct ssp_device {
190 int irq; 192 int irq;
191 int drcmr_rx; 193 int drcmr_rx;
192 int drcmr_tx; 194 int drcmr_tx;
195
196 struct device_node *of_node;
193}; 197};
194 198
195/** 199/**
@@ -218,11 +222,18 @@ static inline u32 pxa_ssp_read_reg(struct ssp_device *dev, u32 reg)
218#ifdef CONFIG_ARCH_PXA 222#ifdef CONFIG_ARCH_PXA
219struct ssp_device *pxa_ssp_request(int port, const char *label); 223struct ssp_device *pxa_ssp_request(int port, const char *label);
220void pxa_ssp_free(struct ssp_device *); 224void pxa_ssp_free(struct ssp_device *);
225struct ssp_device *pxa_ssp_request_of(const struct device_node *of_node,
226 const char *label);
221#else 227#else
222static inline struct ssp_device *pxa_ssp_request(int port, const char *label) 228static inline struct ssp_device *pxa_ssp_request(int port, const char *label)
223{ 229{
224 return NULL; 230 return NULL;
225} 231}
232static inline struct ssp_device *pxa_ssp_request_of(const struct device_node *n,
233 const char *name)
234{
235 return NULL;
236}
226static inline void pxa_ssp_free(struct ssp_device *ssp) {} 237static inline void pxa_ssp_free(struct ssp_device *ssp) {}
227#endif 238#endif
228 239
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 1c50093ae656..6965fe394c3b 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -41,6 +41,7 @@ void __quota_error(struct super_block *sb, const char *func,
41void inode_add_rsv_space(struct inode *inode, qsize_t number); 41void inode_add_rsv_space(struct inode *inode, qsize_t number);
42void inode_claim_rsv_space(struct inode *inode, qsize_t number); 42void inode_claim_rsv_space(struct inode *inode, qsize_t number);
43void inode_sub_rsv_space(struct inode *inode, qsize_t number); 43void inode_sub_rsv_space(struct inode *inode, qsize_t number);
44void inode_reclaim_rsv_space(struct inode *inode, qsize_t number);
44 45
45void dquot_initialize(struct inode *inode); 46void dquot_initialize(struct inode *inode);
46void dquot_drop(struct inode *inode); 47void dquot_drop(struct inode *inode);
@@ -59,6 +60,7 @@ int dquot_alloc_inode(const struct inode *inode);
59 60
60int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); 61int dquot_claim_space_nodirty(struct inode *inode, qsize_t number);
61void dquot_free_inode(const struct inode *inode); 62void dquot_free_inode(const struct inode *inode);
63void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number);
62 64
63int dquot_disable(struct super_block *sb, int type, unsigned int flags); 65int dquot_disable(struct super_block *sb, int type, unsigned int flags);
64/* Suspend quotas on remount RO */ 66/* Suspend quotas on remount RO */
@@ -238,6 +240,13 @@ static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
238 return 0; 240 return 0;
239} 241}
240 242
243static inline int dquot_reclaim_space_nodirty(struct inode *inode,
244 qsize_t number)
245{
246 inode_sub_bytes(inode, number);
247 return 0;
248}
249
241static inline int dquot_disable(struct super_block *sb, int type, 250static inline int dquot_disable(struct super_block *sb, int type,
242 unsigned int flags) 251 unsigned int flags)
243{ 252{
@@ -336,6 +345,12 @@ static inline int dquot_claim_block(struct inode *inode, qsize_t nr)
336 return ret; 345 return ret;
337} 346}
338 347
348static inline void dquot_reclaim_block(struct inode *inode, qsize_t nr)
349{
350 dquot_reclaim_space_nodirty(inode, nr << inode->i_blkbits);
351 mark_inode_dirty_sync(inode);
352}
353
339static inline void dquot_free_space_nodirty(struct inode *inode, qsize_t nr) 354static inline void dquot_free_space_nodirty(struct inode *inode, qsize_t nr)
340{ 355{
341 __dquot_free_space(inode, nr, 0); 356 __dquot_free_space(inode, nr, 0);
diff --git a/include/linux/raid/pq.h b/include/linux/raid/pq.h
index 8dfaa2ce2e95..0f424698064f 100644
--- a/include/linux/raid/pq.h
+++ b/include/linux/raid/pq.h
@@ -114,6 +114,11 @@ extern const struct raid6_recov_calls raid6_recov_intx1;
114extern const struct raid6_recov_calls raid6_recov_ssse3; 114extern const struct raid6_recov_calls raid6_recov_ssse3;
115extern const struct raid6_recov_calls raid6_recov_avx2; 115extern const struct raid6_recov_calls raid6_recov_avx2;
116 116
117extern const struct raid6_calls raid6_neonx1;
118extern const struct raid6_calls raid6_neonx2;
119extern const struct raid6_calls raid6_neonx4;
120extern const struct raid6_calls raid6_neonx8;
121
117/* Algorithm list */ 122/* Algorithm list */
118extern const struct raid6_calls * const raid6_algos[]; 123extern const struct raid6_calls * const raid6_algos[];
119extern const struct raid6_recov_calls *const raid6_recov_algos[]; 124extern const struct raid6_recov_calls *const raid6_recov_algos[];
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index f4b1001a4676..4106721c4e5e 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -267,8 +267,9 @@ static inline void list_splice_init_rcu(struct list_head *list,
267 */ 267 */
268#define list_first_or_null_rcu(ptr, type, member) \ 268#define list_first_or_null_rcu(ptr, type, member) \
269 ({struct list_head *__ptr = (ptr); \ 269 ({struct list_head *__ptr = (ptr); \
270 struct list_head __rcu *__next = list_next_rcu(__ptr); \ 270 struct list_head *__next = ACCESS_ONCE(__ptr->next); \
271 likely(__ptr != __next) ? container_of(__next, type, member) : NULL; \ 271 likely(__ptr != __next) ? \
272 list_entry_rcu(__next, type, member) : NULL; \
272 }) 273 })
273 274
274/** 275/**
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 4b14bdc911d7..f1f1bc39346b 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -52,7 +52,7 @@ extern int rcutorture_runnable; /* for sysctl */
52#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 52#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
53extern void rcutorture_record_test_transition(void); 53extern void rcutorture_record_test_transition(void);
54extern void rcutorture_record_progress(unsigned long vernum); 54extern void rcutorture_record_progress(unsigned long vernum);
55extern void do_trace_rcu_torture_read(char *rcutorturename, 55extern void do_trace_rcu_torture_read(const char *rcutorturename,
56 struct rcu_head *rhp, 56 struct rcu_head *rhp,
57 unsigned long secs, 57 unsigned long secs,
58 unsigned long c_old, 58 unsigned long c_old,
@@ -65,7 +65,7 @@ static inline void rcutorture_record_progress(unsigned long vernum)
65{ 65{
66} 66}
67#ifdef CONFIG_RCU_TRACE 67#ifdef CONFIG_RCU_TRACE
68extern void do_trace_rcu_torture_read(char *rcutorturename, 68extern void do_trace_rcu_torture_read(const char *rcutorturename,
69 struct rcu_head *rhp, 69 struct rcu_head *rhp,
70 unsigned long secs, 70 unsigned long secs,
71 unsigned long c_old, 71 unsigned long c_old,
@@ -229,13 +229,9 @@ extern void rcu_irq_exit(void);
229#ifdef CONFIG_RCU_USER_QS 229#ifdef CONFIG_RCU_USER_QS
230extern void rcu_user_enter(void); 230extern void rcu_user_enter(void);
231extern void rcu_user_exit(void); 231extern void rcu_user_exit(void);
232extern void rcu_user_enter_after_irq(void);
233extern void rcu_user_exit_after_irq(void);
234#else 232#else
235static inline void rcu_user_enter(void) { } 233static inline void rcu_user_enter(void) { }
236static inline void rcu_user_exit(void) { } 234static inline void rcu_user_exit(void) { }
237static inline void rcu_user_enter_after_irq(void) { }
238static inline void rcu_user_exit_after_irq(void) { }
239static inline void rcu_user_hooks_switch(struct task_struct *prev, 235static inline void rcu_user_hooks_switch(struct task_struct *prev,
240 struct task_struct *next) { } 236 struct task_struct *next) { }
241#endif /* CONFIG_RCU_USER_QS */ 237#endif /* CONFIG_RCU_USER_QS */
@@ -1015,4 +1011,22 @@ static inline bool rcu_is_nocb_cpu(int cpu) { return false; }
1015#endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */ 1011#endif /* #else #ifdef CONFIG_RCU_NOCB_CPU */
1016 1012
1017 1013
1014/* Only for use by adaptive-ticks code. */
1015#ifdef CONFIG_NO_HZ_FULL_SYSIDLE
1016extern bool rcu_sys_is_idle(void);
1017extern void rcu_sysidle_force_exit(void);
1018#else /* #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */
1019
1020static inline bool rcu_sys_is_idle(void)
1021{
1022 return false;
1023}
1024
1025static inline void rcu_sysidle_force_exit(void)
1026{
1027}
1028
1029#endif /* #else #ifdef CONFIG_NO_HZ_FULL_SYSIDLE */
1030
1031
1018#endif /* __LINUX_RCUPDATE_H */ 1032#endif /* __LINUX_RCUPDATE_H */
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 75981d0b57dc..a10380bfbeac 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -15,6 +15,8 @@
15 15
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/rbtree.h> 17#include <linux/rbtree.h>
18#include <linux/err.h>
19#include <linux/bug.h>
18 20
19struct module; 21struct module;
20struct device; 22struct device;
@@ -470,6 +472,9 @@ struct regmap_irq {
470 * @ack_base: Base ack address. If zero then the chip is clear on read. 472 * @ack_base: Base ack address. If zero then the chip is clear on read.
471 * @wake_base: Base address for wake enables. If zero unsupported. 473 * @wake_base: Base address for wake enables. If zero unsupported.
472 * @irq_reg_stride: Stride to use for chips where registers are not contiguous. 474 * @irq_reg_stride: Stride to use for chips where registers are not contiguous.
475 * @init_ack_masked: Ack all masked interrupts once during initalization.
476 * @mask_invert: Inverted mask register: cleared bits are masked out.
477 * @wake_invert: Inverted wake register: cleared bits are wake enabled.
473 * @runtime_pm: Hold a runtime PM lock on the device when accessing it. 478 * @runtime_pm: Hold a runtime PM lock on the device when accessing it.
474 * 479 *
475 * @num_regs: Number of registers in each control bank. 480 * @num_regs: Number of registers in each control bank.
@@ -485,9 +490,10 @@ struct regmap_irq_chip {
485 unsigned int ack_base; 490 unsigned int ack_base;
486 unsigned int wake_base; 491 unsigned int wake_base;
487 unsigned int irq_reg_stride; 492 unsigned int irq_reg_stride;
488 unsigned int mask_invert; 493 bool init_ack_masked:1;
489 unsigned int wake_invert; 494 bool mask_invert:1;
490 bool runtime_pm; 495 bool wake_invert:1;
496 bool runtime_pm:1;
491 497
492 int num_regs; 498 int num_regs;
493 499
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 3a76389c6aaa..27be915caa96 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -137,6 +137,12 @@ struct regulator *__must_check devm_regulator_get(struct device *dev,
137 const char *id); 137 const char *id);
138struct regulator *__must_check regulator_get_exclusive(struct device *dev, 138struct regulator *__must_check regulator_get_exclusive(struct device *dev,
139 const char *id); 139 const char *id);
140struct regulator *__must_check devm_regulator_get_exclusive(struct device *dev,
141 const char *id);
142struct regulator *__must_check regulator_get_optional(struct device *dev,
143 const char *id);
144struct regulator *__must_check devm_regulator_get_optional(struct device *dev,
145 const char *id);
140void regulator_put(struct regulator *regulator); 146void regulator_put(struct regulator *regulator);
141void devm_regulator_put(struct regulator *regulator); 147void devm_regulator_put(struct regulator *regulator);
142 148
@@ -217,6 +223,25 @@ devm_regulator_get(struct device *dev, const char *id)
217 return NULL; 223 return NULL;
218} 224}
219 225
226static inline struct regulator *__must_check
227regulator_get_exclusive(struct device *dev, const char *id)
228{
229 return NULL;
230}
231
232static inline struct regulator *__must_check
233regulator_get_optional(struct device *dev, const char *id)
234{
235 return NULL;
236}
237
238
239static inline struct regulator *__must_check
240devm_regulator_get_optional(struct device *dev, const char *id)
241{
242 return NULL;
243}
244
220static inline void regulator_put(struct regulator *regulator) 245static inline void regulator_put(struct regulator *regulator)
221{ 246{
222} 247}
@@ -369,8 +394,11 @@ static inline int regulator_count_voltages(struct regulator *regulator)
369static inline int regulator_set_voltage_tol(struct regulator *regulator, 394static inline int regulator_set_voltage_tol(struct regulator *regulator,
370 int new_uV, int tol_uV) 395 int new_uV, int tol_uV)
371{ 396{
372 return regulator_set_voltage(regulator, 397 if (regulator_set_voltage(regulator, new_uV, new_uV + tol_uV) == 0)
373 new_uV - tol_uV, new_uV + tol_uV); 398 return 0;
399 else
400 return regulator_set_voltage(regulator,
401 new_uV - tol_uV, new_uV + tol_uV);
374} 402}
375 403
376static inline int regulator_is_supported_voltage_tol(struct regulator *regulator, 404static inline int regulator_is_supported_voltage_tol(struct regulator *regulator,
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 6700cc94bdd1..67e13aa5a478 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -40,6 +40,24 @@ enum regulator_status {
40}; 40};
41 41
42/** 42/**
43 * Specify a range of voltages for regulator_map_linar_range() and
44 * regulator_list_linear_range().
45 *
46 * @min_uV: Lowest voltage in range
47 * @max_uV: Highest voltage in range
48 * @min_sel: Lowest selector for range
49 * @max_sel: Highest selector for range
50 * @uV_step: Step size
51 */
52struct regulator_linear_range {
53 unsigned int min_uV;
54 unsigned int max_uV;
55 unsigned int min_sel;
56 unsigned int max_sel;
57 unsigned int uV_step;
58};
59
60/**
43 * struct regulator_ops - regulator operations. 61 * struct regulator_ops - regulator operations.
44 * 62 *
45 * @enable: Configure the regulator as enabled. 63 * @enable: Configure the regulator as enabled.
@@ -223,6 +241,9 @@ struct regulator_desc {
223 unsigned int linear_min_sel; 241 unsigned int linear_min_sel;
224 unsigned int ramp_delay; 242 unsigned int ramp_delay;
225 243
244 const struct regulator_linear_range *linear_ranges;
245 int n_linear_ranges;
246
226 const unsigned int *volt_table; 247 const unsigned int *volt_table;
227 248
228 unsigned int vsel_reg; 249 unsigned int vsel_reg;
@@ -326,10 +347,14 @@ int regulator_mode_to_status(unsigned int);
326 347
327int regulator_list_voltage_linear(struct regulator_dev *rdev, 348int regulator_list_voltage_linear(struct regulator_dev *rdev,
328 unsigned int selector); 349 unsigned int selector);
350int regulator_list_voltage_linear_range(struct regulator_dev *rdev,
351 unsigned int selector);
329int regulator_list_voltage_table(struct regulator_dev *rdev, 352int regulator_list_voltage_table(struct regulator_dev *rdev,
330 unsigned int selector); 353 unsigned int selector);
331int regulator_map_voltage_linear(struct regulator_dev *rdev, 354int regulator_map_voltage_linear(struct regulator_dev *rdev,
332 int min_uV, int max_uV); 355 int min_uV, int max_uV);
356int regulator_map_voltage_linear_range(struct regulator_dev *rdev,
357 int min_uV, int max_uV);
333int regulator_map_voltage_iterate(struct regulator_dev *rdev, 358int regulator_map_voltage_iterate(struct regulator_dev *rdev,
334 int min_uV, int max_uV); 359 int min_uV, int max_uV);
335int regulator_map_voltage_ascend(struct regulator_dev *rdev, 360int regulator_map_voltage_ascend(struct regulator_dev *rdev,
diff --git a/include/linux/regulator/fan53555.h b/include/linux/regulator/fan53555.h
index 5c45c85d52ca..f13880e84d85 100644
--- a/include/linux/regulator/fan53555.h
+++ b/include/linux/regulator/fan53555.h
@@ -11,6 +11,7 @@
11 */ 11 */
12 12
13#ifndef __FAN53555_H__ 13#ifndef __FAN53555_H__
14#define __FAN53555_H__
14 15
15/* VSEL ID */ 16/* VSEL ID */
16enum { 17enum {
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 36adbc82de6a..999b20ce06cf 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -134,6 +134,7 @@ struct regulation_constraints {
134 unsigned always_on:1; /* regulator never off when system is on */ 134 unsigned always_on:1; /* regulator never off when system is on */
135 unsigned boot_on:1; /* bootloader/firmware enabled regulator */ 135 unsigned boot_on:1; /* bootloader/firmware enabled regulator */
136 unsigned apply_uV:1; /* apply uV constraint if min == max */ 136 unsigned apply_uV:1; /* apply uV constraint if min == max */
137 unsigned ramp_disable:1; /* disable ramp delay */
137}; 138};
138 139
139/** 140/**
diff --git a/include/linux/regulator/max8660.h b/include/linux/regulator/max8660.h
index 9936763621c7..f8a6a4844864 100644
--- a/include/linux/regulator/max8660.h
+++ b/include/linux/regulator/max8660.h
@@ -39,7 +39,7 @@ enum {
39 */ 39 */
40struct max8660_subdev_data { 40struct max8660_subdev_data {
41 int id; 41 int id;
42 char *name; 42 const char *name;
43 struct regulator_init_data *platform_data; 43 struct regulator_init_data *platform_data;
44}; 44};
45 45
diff --git a/include/linux/regulator/pfuze100.h b/include/linux/regulator/pfuze100.h
new file mode 100644
index 000000000000..65d550bf3954
--- /dev/null
+++ b/include/linux/regulator/pfuze100.h
@@ -0,0 +1,44 @@
1/*
2 * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18#ifndef __LINUX_REG_PFUZE100_H
19#define __LINUX_REG_PFUZE100_H
20
21#define PFUZE100_SW1AB 0
22#define PFUZE100_SW1C 1
23#define PFUZE100_SW2 2
24#define PFUZE100_SW3A 3
25#define PFUZE100_SW3B 4
26#define PFUZE100_SW4 5
27#define PFUZE100_SWBST 6
28#define PFUZE100_VSNVS 7
29#define PFUZE100_VREFDDR 8
30#define PFUZE100_VGEN1 9
31#define PFUZE100_VGEN2 10
32#define PFUZE100_VGEN3 11
33#define PFUZE100_VGEN4 12
34#define PFUZE100_VGEN5 13
35#define PFUZE100_VGEN6 14
36#define PFUZE100_MAX_REGULATOR 15
37
38struct regulator_init_data;
39
40struct pfuze_regulator_platform_data {
41 struct regulator_init_data *init_data[PFUZE100_MAX_REGULATOR];
42};
43
44#endif /* __LINUX_REG_PFUZE100_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d722490da030..ce1e1c0aaa33 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -107,14 +107,6 @@ extern unsigned long this_cpu_load(void);
107extern void calc_global_load(unsigned long ticks); 107extern void calc_global_load(unsigned long ticks);
108extern void update_cpu_load_nohz(void); 108extern void update_cpu_load_nohz(void);
109 109
110/* Notifier for when a task gets migrated to a new CPU */
111struct task_migration_notifier {
112 struct task_struct *task;
113 int from_cpu;
114 int to_cpu;
115};
116extern void register_task_migration_notifier(struct notifier_block *n);
117
118extern unsigned long get_parent_ip(unsigned long addr); 110extern unsigned long get_parent_ip(unsigned long addr);
119 111
120extern void dump_cpu_task(int cpu); 112extern void dump_cpu_task(int cpu);
@@ -1034,6 +1026,9 @@ struct task_struct {
1034#ifdef CONFIG_SMP 1026#ifdef CONFIG_SMP
1035 struct llist_node wake_entry; 1027 struct llist_node wake_entry;
1036 int on_cpu; 1028 int on_cpu;
1029 struct task_struct *last_wakee;
1030 unsigned long wakee_flips;
1031 unsigned long wakee_flip_decay_ts;
1037#endif 1032#endif
1038 int on_rq; 1033 int on_rq;
1039 1034
@@ -1532,6 +1527,8 @@ static inline pid_t task_pgrp_nr(struct task_struct *tsk)
1532 * Test if a process is not yet dead (at most zombie state) 1527 * Test if a process is not yet dead (at most zombie state)
1533 * If pid_alive fails, then pointers within the task structure 1528 * If pid_alive fails, then pointers within the task structure
1534 * can be stale and must not be dereferenced. 1529 * can be stale and must not be dereferenced.
1530 *
1531 * Return: 1 if the process is alive. 0 otherwise.
1535 */ 1532 */
1536static inline int pid_alive(struct task_struct *p) 1533static inline int pid_alive(struct task_struct *p)
1537{ 1534{
@@ -1543,6 +1540,8 @@ static inline int pid_alive(struct task_struct *p)
1543 * @tsk: Task structure to be checked. 1540 * @tsk: Task structure to be checked.
1544 * 1541 *
1545 * Check if a task structure is the first user space task the kernel created. 1542 * Check if a task structure is the first user space task the kernel created.
1543 *
1544 * Return: 1 if the task structure is init. 0 otherwise.
1546 */ 1545 */
1547static inline int is_global_init(struct task_struct *tsk) 1546static inline int is_global_init(struct task_struct *tsk)
1548{ 1547{
@@ -1894,6 +1893,8 @@ extern struct task_struct *idle_task(int cpu);
1894/** 1893/**
1895 * is_idle_task - is the specified task an idle task? 1894 * is_idle_task - is the specified task an idle task?
1896 * @p: the task in question. 1895 * @p: the task in question.
1896 *
1897 * Return: 1 if @p is an idle task. 0 otherwise.
1897 */ 1898 */
1898static inline bool is_idle_task(const struct task_struct *p) 1899static inline bool is_idle_task(const struct task_struct *p)
1899{ 1900{
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
index fc305713fc6d..90b5e30c2f22 100644
--- a/include/linux/sh_eth.h
+++ b/include/linux/sh_eth.h
@@ -2,23 +2,17 @@
2#define __ASM_SH_ETH_H__ 2#define __ASM_SH_ETH_H__
3 3
4#include <linux/phy.h> 4#include <linux/phy.h>
5#include <linux/if_ether.h>
5 6
6enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN}; 7enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
7enum {
8 SH_ETH_REG_GIGABIT,
9 SH_ETH_REG_FAST_RCAR,
10 SH_ETH_REG_FAST_SH4,
11 SH_ETH_REG_FAST_SH3_SH2
12};
13 8
14struct sh_eth_plat_data { 9struct sh_eth_plat_data {
15 int phy; 10 int phy;
16 int edmac_endian; 11 int edmac_endian;
17 int register_type;
18 phy_interface_t phy_interface; 12 phy_interface_t phy_interface;
19 void (*set_mdio_gate)(void *addr); 13 void (*set_mdio_gate)(void *addr);
20 14
21 unsigned char mac_addr[6]; 15 unsigned char mac_addr[ETH_ALEN];
22 unsigned no_ether_link:1; 16 unsigned no_ether_link:1;
23 unsigned ether_link_active_low:1; 17 unsigned ether_link_active_low:1;
24 unsigned needs_init:1; 18 unsigned needs_init:1;
diff --git a/include/linux/signal.h b/include/linux/signal.h
index d897484730c0..2ac423bdb676 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -434,6 +434,14 @@ void signals_init(void);
434int restore_altstack(const stack_t __user *); 434int restore_altstack(const stack_t __user *);
435int __save_altstack(stack_t __user *, unsigned long); 435int __save_altstack(stack_t __user *, unsigned long);
436 436
437#define save_altstack_ex(uss, sp) do { \
438 stack_t __user *__uss = uss; \
439 struct task_struct *t = current; \
440 put_user_ex((void __user *)t->sas_ss_sp, &__uss->ss_sp); \
441 put_user_ex(sas_ss_flags(sp), &__uss->ss_flags); \
442 put_user_ex(t->sas_ss_size, &__uss->ss_size); \
443} while (0);
444
437#ifdef CONFIG_PROC_FS 445#ifdef CONFIG_PROC_FS
438struct seq_file; 446struct seq_file;
439extern void render_sigset_t(struct seq_file *, const char *, sigset_t *); 447extern void render_sigset_t(struct seq_file *, const char *, sigset_t *);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 3b71a4e83642..2ddb48d9312c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1805,10 +1805,13 @@ static inline void pskb_trim_unique(struct sk_buff *skb, unsigned int len)
1805 */ 1805 */
1806static inline void skb_orphan(struct sk_buff *skb) 1806static inline void skb_orphan(struct sk_buff *skb)
1807{ 1807{
1808 if (skb->destructor) 1808 if (skb->destructor) {
1809 skb->destructor(skb); 1809 skb->destructor(skb);
1810 skb->destructor = NULL; 1810 skb->destructor = NULL;
1811 skb->sk = NULL; 1811 skb->sk = NULL;
1812 } else {
1813 BUG_ON(skb->sk);
1814 }
1812} 1815}
1813 1816
1814/** 1817/**
@@ -1902,8 +1905,8 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
1902 return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC); 1905 return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC);
1903} 1906}
1904 1907
1905/* 1908/**
1906 * __skb_alloc_page - allocate pages for ps-rx on a skb and preserve pfmemalloc data 1909 * __skb_alloc_pages - allocate pages for ps-rx on a skb and preserve pfmemalloc data
1907 * @gfp_mask: alloc_pages_node mask. Set __GFP_NOMEMALLOC if not for network packet RX 1910 * @gfp_mask: alloc_pages_node mask. Set __GFP_NOMEMALLOC if not for network packet RX
1908 * @skb: skb to set pfmemalloc on if __GFP_MEMALLOC is used 1911 * @skb: skb to set pfmemalloc on if __GFP_MEMALLOC is used
1909 * @order: size of the allocation 1912 * @order: size of the allocation
@@ -2356,6 +2359,10 @@ extern int skb_copy_datagram_from_iovec(struct sk_buff *skb,
2356 const struct iovec *from, 2359 const struct iovec *from,
2357 int from_offset, 2360 int from_offset,
2358 int len); 2361 int len);
2362extern int zerocopy_sg_from_iovec(struct sk_buff *skb,
2363 const struct iovec *frm,
2364 int offset,
2365 size_t count);
2359extern int skb_copy_datagram_const_iovec(const struct sk_buff *from, 2366extern int skb_copy_datagram_const_iovec(const struct sk_buff *from,
2360 int offset, 2367 int offset,
2361 const struct iovec *to, 2368 const struct iovec *to,
@@ -2385,7 +2392,7 @@ extern void skb_split(struct sk_buff *skb,
2385 struct sk_buff *skb1, const u32 len); 2392 struct sk_buff *skb1, const u32 len);
2386extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, 2393extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb,
2387 int shiftlen); 2394 int shiftlen);
2388extern void skb_scrub_packet(struct sk_buff *skb); 2395extern void skb_scrub_packet(struct sk_buff *skb, bool xnet);
2389 2396
2390extern struct sk_buff *skb_segment(struct sk_buff *skb, 2397extern struct sk_buff *skb_segment(struct sk_buff *skb,
2391 netdev_features_t features); 2398 netdev_features_t features);
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h
index 4dde70e74822..eec3efd19beb 100644
--- a/include/linux/smsc911x.h
+++ b/include/linux/smsc911x.h
@@ -22,6 +22,7 @@
22#define __LINUX_SMSC911X_H__ 22#define __LINUX_SMSC911X_H__
23 23
24#include <linux/phy.h> 24#include <linux/phy.h>
25#include <linux/if_ether.h>
25 26
26/* platform_device configuration data, should be assigned to 27/* platform_device configuration data, should be assigned to
27 * the platform_device's dev.platform_data */ 28 * the platform_device's dev.platform_data */
@@ -31,7 +32,7 @@ struct smsc911x_platform_config {
31 unsigned int flags; 32 unsigned int flags;
32 unsigned int shift; 33 unsigned int shift;
33 phy_interface_t phy_interface; 34 phy_interface_t phy_interface;
34 unsigned char mac[6]; 35 unsigned char mac[ETH_ALEN];
35}; 36};
36 37
37/* Constants for platform_device irq polarity configuration */ 38/* Constants for platform_device irq polarity configuration */
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 230c04bda3e2..445ef7519dc2 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -313,6 +313,8 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
313 struct iovec *iov, 313 struct iovec *iov,
314 int offset, 314 int offset,
315 unsigned int len, __wsum *csump); 315 unsigned int len, __wsum *csump);
316extern unsigned long iov_pages(const struct iovec *iov, int offset,
317 unsigned long nr_segs);
316 318
317extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *address, int mode); 319extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr_storage *address, int mode);
318extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, 320extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata,
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 28e440be1c07..887116dbce2c 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -74,7 +74,7 @@ struct spi_device {
74 struct spi_master *master; 74 struct spi_master *master;
75 u32 max_speed_hz; 75 u32 max_speed_hz;
76 u8 chip_select; 76 u8 chip_select;
77 u8 mode; 77 u16 mode;
78#define SPI_CPHA 0x01 /* clock phase */ 78#define SPI_CPHA 0x01 /* clock phase */
79#define SPI_CPOL 0x02 /* clock polarity */ 79#define SPI_CPOL 0x02 /* clock polarity */
80#define SPI_MODE_0 (0|0) /* (original MicroWire) */ 80#define SPI_MODE_0 (0|0) /* (original MicroWire) */
@@ -87,6 +87,10 @@ struct spi_device {
87#define SPI_LOOP 0x20 /* loopback mode */ 87#define SPI_LOOP 0x20 /* loopback mode */
88#define SPI_NO_CS 0x40 /* 1 dev/bus, no chipselect */ 88#define SPI_NO_CS 0x40 /* 1 dev/bus, no chipselect */
89#define SPI_READY 0x80 /* slave pulls low to pause */ 89#define SPI_READY 0x80 /* slave pulls low to pause */
90#define SPI_TX_DUAL 0x100 /* transmit with 2 wires */
91#define SPI_TX_QUAD 0x200 /* transmit with 4 wires */
92#define SPI_RX_DUAL 0x400 /* receive with 2 wires */
93#define SPI_RX_QUAD 0x800 /* receive with 4 wires */
90 u8 bits_per_word; 94 u8 bits_per_word;
91 int irq; 95 int irq;
92 void *controller_state; 96 void *controller_state;
@@ -233,6 +237,8 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
233 * suported. If set, the SPI core will reject any transfer with an 237 * suported. If set, the SPI core will reject any transfer with an
234 * unsupported bits_per_word. If not set, this value is simply ignored, 238 * unsupported bits_per_word. If not set, this value is simply ignored,
235 * and it's up to the individual driver to perform any validation. 239 * and it's up to the individual driver to perform any validation.
240 * @min_speed_hz: Lowest supported transfer speed
241 * @max_speed_hz: Highest supported transfer speed
236 * @flags: other constraints relevant to this driver 242 * @flags: other constraints relevant to this driver
237 * @bus_lock_spinlock: spinlock for SPI bus locking 243 * @bus_lock_spinlock: spinlock for SPI bus locking
238 * @bus_lock_mutex: mutex for SPI bus locking 244 * @bus_lock_mutex: mutex for SPI bus locking
@@ -254,6 +260,9 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv)
254 * @busy: message pump is busy 260 * @busy: message pump is busy
255 * @running: message pump is running 261 * @running: message pump is running
256 * @rt: whether this queue is set to run as a realtime task 262 * @rt: whether this queue is set to run as a realtime task
263 * @auto_runtime_pm: the core should ensure a runtime PM reference is held
264 * while the hardware is prepared, using the parent
265 * device for the spidev
257 * @prepare_transfer_hardware: a message will soon arrive from the queue 266 * @prepare_transfer_hardware: a message will soon arrive from the queue
258 * so the subsystem requests the driver to prepare the transfer hardware 267 * so the subsystem requests the driver to prepare the transfer hardware
259 * by issuing this call 268 * by issuing this call
@@ -309,9 +318,13 @@ struct spi_master {
309 /* bitmask of supported bits_per_word for transfers */ 318 /* bitmask of supported bits_per_word for transfers */
310 u32 bits_per_word_mask; 319 u32 bits_per_word_mask;
311#define SPI_BPW_MASK(bits) BIT((bits) - 1) 320#define SPI_BPW_MASK(bits) BIT((bits) - 1)
312#define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0UL : (BIT(bits) - 1)) 321#define SPI_BIT_MASK(bits) (((bits) == 32) ? ~0U : (BIT(bits) - 1))
313#define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - SPI_BIT_MASK(min - 1)) 322#define SPI_BPW_RANGE_MASK(min, max) (SPI_BIT_MASK(max) - SPI_BIT_MASK(min - 1))
314 323
324 /* limits on transfer speed */
325 u32 min_speed_hz;
326 u32 max_speed_hz;
327
315 /* other constraints relevant to this driver */ 328 /* other constraints relevant to this driver */
316 u16 flags; 329 u16 flags;
317#define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ 330#define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */
@@ -374,11 +387,13 @@ struct spi_master {
374 bool busy; 387 bool busy;
375 bool running; 388 bool running;
376 bool rt; 389 bool rt;
390 bool auto_runtime_pm;
377 391
378 int (*prepare_transfer_hardware)(struct spi_master *master); 392 int (*prepare_transfer_hardware)(struct spi_master *master);
379 int (*transfer_one_message)(struct spi_master *master, 393 int (*transfer_one_message)(struct spi_master *master,
380 struct spi_message *mesg); 394 struct spi_message *mesg);
381 int (*unprepare_transfer_hardware)(struct spi_master *master); 395 int (*unprepare_transfer_hardware)(struct spi_master *master);
396
382 /* gpio chip select */ 397 /* gpio chip select */
383 int *cs_gpios; 398 int *cs_gpios;
384}; 399};
@@ -448,6 +463,10 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
448 * @rx_buf: data to be read (dma-safe memory), or NULL 463 * @rx_buf: data to be read (dma-safe memory), or NULL
449 * @tx_dma: DMA address of tx_buf, if @spi_message.is_dma_mapped 464 * @tx_dma: DMA address of tx_buf, if @spi_message.is_dma_mapped
450 * @rx_dma: DMA address of rx_buf, if @spi_message.is_dma_mapped 465 * @rx_dma: DMA address of rx_buf, if @spi_message.is_dma_mapped
466 * @tx_nbits: number of bits used for writting. If 0 the default
467 * (SPI_NBITS_SINGLE) is used.
468 * @rx_nbits: number of bits used for reading. If 0 the default
469 * (SPI_NBITS_SINGLE) is used.
451 * @len: size of rx and tx buffers (in bytes) 470 * @len: size of rx and tx buffers (in bytes)
452 * @speed_hz: Select a speed other than the device default for this 471 * @speed_hz: Select a speed other than the device default for this
453 * transfer. If 0 the default (from @spi_device) is used. 472 * transfer. If 0 the default (from @spi_device) is used.
@@ -502,6 +521,11 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum);
502 * by the results of previous messages and where the whole transaction 521 * by the results of previous messages and where the whole transaction
503 * ends when the chipselect goes intactive. 522 * ends when the chipselect goes intactive.
504 * 523 *
524 * When SPI can transfer in 1x,2x or 4x. It can get this tranfer information
525 * from device through @tx_nbits and @rx_nbits. In Bi-direction, these
526 * two should both be set. User can set transfer mode with SPI_NBITS_SINGLE(1x)
527 * SPI_NBITS_DUAL(2x) and SPI_NBITS_QUAD(4x) to support these three transfer.
528 *
505 * The code that submits an spi_message (and its spi_transfers) 529 * The code that submits an spi_message (and its spi_transfers)
506 * to the lower layers is responsible for managing its memory. 530 * to the lower layers is responsible for managing its memory.
507 * Zero-initialize every field you don't set up explicitly, to 531 * Zero-initialize every field you don't set up explicitly, to
@@ -522,6 +546,11 @@ struct spi_transfer {
522 dma_addr_t rx_dma; 546 dma_addr_t rx_dma;
523 547
524 unsigned cs_change:1; 548 unsigned cs_change:1;
549 u8 tx_nbits;
550 u8 rx_nbits;
551#define SPI_NBITS_SINGLE 0x01 /* 1bit transfer */
552#define SPI_NBITS_DUAL 0x02 /* 2bits transfer */
553#define SPI_NBITS_QUAD 0x04 /* 4bits transfer */
525 u8 bits_per_word; 554 u8 bits_per_word;
526 u16 delay_usecs; 555 u16 delay_usecs;
527 u32 speed_hz; 556 u32 speed_hz;
@@ -578,6 +607,7 @@ struct spi_message {
578 /* completion is reported through a callback */ 607 /* completion is reported through a callback */
579 void (*complete)(void *context); 608 void (*complete)(void *context);
580 void *context; 609 void *context;
610 unsigned frame_length;
581 unsigned actual_length; 611 unsigned actual_length;
582 int status; 612 int status;
583 613
@@ -869,7 +899,7 @@ struct spi_board_info {
869 /* mode becomes spi_device.mode, and is essential for chips 899 /* mode becomes spi_device.mode, and is essential for chips
870 * where the default of SPI_CS_HIGH = 0 is wrong. 900 * where the default of SPI_CS_HIGH = 0 is wrong.
871 */ 901 */
872 u8 mode; 902 u16 mode;
873 903
874 /* ... may need additional spi_device chip config data here. 904 /* ... may need additional spi_device chip config data here.
875 * avoid stuff protocol drivers can set; but include stuff 905 * avoid stuff protocol drivers can set; but include stuff
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h
index f987a2bee16a..daebaba886aa 100644
--- a/include/linux/spi/spi_bitbang.h
+++ b/include/linux/spi/spi_bitbang.h
@@ -4,11 +4,7 @@
4#include <linux/workqueue.h> 4#include <linux/workqueue.h>
5 5
6struct spi_bitbang { 6struct spi_bitbang {
7 struct workqueue_struct *workqueue;
8 struct work_struct work;
9
10 spinlock_t lock; 7 spinlock_t lock;
11 struct list_head queue;
12 u8 busy; 8 u8 busy;
13 u8 use_dma; 9 u8 use_dma;
14 u8 flags; /* extra spi->mode support */ 10 u8 flags; /* extra spi->mode support */
@@ -41,7 +37,6 @@ struct spi_bitbang {
41 */ 37 */
42extern int spi_bitbang_setup(struct spi_device *spi); 38extern int spi_bitbang_setup(struct spi_device *spi);
43extern void spi_bitbang_cleanup(struct spi_device *spi); 39extern void spi_bitbang_cleanup(struct spi_device *spi);
44extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m);
45extern int spi_bitbang_setup_transfer(struct spi_device *spi, 40extern int spi_bitbang_setup_transfer(struct spi_device *spi,
46 struct spi_transfer *t); 41 struct spi_transfer *t);
47 42
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 7d537ced949a..75f34949d9ab 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -117,9 +117,17 @@ do { \
117#endif /*arch_spin_is_contended*/ 117#endif /*arch_spin_is_contended*/
118#endif 118#endif
119 119
120/* The lock does not imply full memory barrier. */ 120/*
121#ifndef ARCH_HAS_SMP_MB_AFTER_LOCK 121 * Despite its name it doesn't necessarily has to be a full barrier.
122static inline void smp_mb__after_lock(void) { smp_mb(); } 122 * It should only guarantee that a STORE before the critical section
123 * can not be reordered with a LOAD inside this section.
124 * spin_lock() is the one-way barrier, this LOAD can not escape out
125 * of the region. So the default implementation simply ensures that
126 * a STORE can not move into the critical section, smp_wmb() should
127 * serialize it with another STORE done by spin_lock().
128 */
129#ifndef smp_mb__before_spinlock
130#define smp_mb__before_spinlock() smp_wmb()
123#endif 131#endif
124 132
125/** 133/**
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 9e495d31516e..bb5deb0feb6b 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -108,6 +108,7 @@ struct plat_stmmacenet_data {
108 int bugged_jumbo; 108 int bugged_jumbo;
109 int pmt; 109 int pmt;
110 int force_sf_dma_mode; 110 int force_sf_dma_mode;
111 int force_thresh_dma_mode;
111 int riwt_off; 112 int riwt_off;
112 void (*fix_mac_speed)(void *priv, unsigned int speed); 113 void (*fix_mac_speed)(void *priv, unsigned int speed);
113 void (*bus_setup)(void __iomem *ioaddr); 114 void (*bus_setup)(void __iomem *ioaddr);
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 6d870353674a..1821445708d6 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -121,6 +121,7 @@ struct rpc_task_setup {
121#define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */ 121#define RPC_TASK_SOFTCONN 0x0400 /* Fail if can't connect */
122#define RPC_TASK_SENT 0x0800 /* message was sent */ 122#define RPC_TASK_SENT 0x0800 /* message was sent */
123#define RPC_TASK_TIMEOUT 0x1000 /* fail with ETIMEDOUT on timeout */ 123#define RPC_TASK_TIMEOUT 0x1000 /* fail with ETIMEDOUT on timeout */
124#define RPC_TASK_NOCONNECT 0x2000 /* return ENOTCONN if not connected */
124 125
125#define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) 126#define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC)
126#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) 127#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER)
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index c5fd30d2a415..8d4fa82bfb91 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -67,6 +67,8 @@ static inline swp_entry_t pte_to_swp_entry(pte_t pte)
67 swp_entry_t arch_entry; 67 swp_entry_t arch_entry;
68 68
69 BUG_ON(pte_file(pte)); 69 BUG_ON(pte_file(pte));
70 if (pte_swp_soft_dirty(pte))
71 pte = pte_swp_clear_soft_dirty(pte);
70 arch_entry = __pte_to_swp_entry(pte); 72 arch_entry = __pte_to_swp_entry(pte);
71 return swp_entry(__swp_type(arch_entry), __swp_offset(arch_entry)); 73 return swp_entry(__swp_type(arch_entry), __swp_offset(arch_entry));
72} 74}
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 4147d700a293..84662ecc7b51 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -802,9 +802,14 @@ asmlinkage long sys_vfork(void);
802asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, int, 802asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, int,
803 int __user *); 803 int __user *);
804#else 804#else
805#ifdef CONFIG_CLONE_BACKWARDS3
806asmlinkage long sys_clone(unsigned long, unsigned long, int, int __user *,
807 int __user *, int);
808#else
805asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, 809asmlinkage long sys_clone(unsigned long, unsigned long, int __user *,
806 int __user *, int); 810 int __user *, int);
807#endif 811#endif
812#endif
808 813
809asmlinkage long sys_execve(const char __user *filename, 814asmlinkage long sys_execve(const char __user *filename,
810 const char __user *const __user *argv, 815 const char __user *const __user *argv,
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 9e8a9b555ad6..11baec7c9b26 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -51,9 +51,9 @@ do { \
51 static struct lock_class_key __key; \ 51 static struct lock_class_key __key; \
52 \ 52 \
53 (attr)->key = &__key; \ 53 (attr)->key = &__key; \
54} while(0) 54} while (0)
55#else 55#else
56#define sysfs_attr_init(attr) do {} while(0) 56#define sysfs_attr_init(attr) do {} while (0)
57#endif 57#endif
58 58
59struct attribute_group { 59struct attribute_group {
@@ -69,7 +69,7 @@ struct attribute_group {
69 * for examples.. 69 * for examples..
70 */ 70 */
71 71
72#define __ATTR(_name,_mode,_show,_store) { \ 72#define __ATTR(_name, _mode, _show, _store) { \
73 .attr = {.name = __stringify(_name), .mode = _mode }, \ 73 .attr = {.name = __stringify(_name), .mode = _mode }, \
74 .show = _show, \ 74 .show = _show, \
75 .store = _store, \ 75 .store = _store, \
@@ -80,6 +80,11 @@ struct attribute_group {
80 .show = _name##_show, \ 80 .show = _name##_show, \
81} 81}
82 82
83#define __ATTR_WO(_name) { \
84 .attr = { .name = __stringify(_name), .mode = S_IWUSR }, \
85 .store = _name##_store, \
86}
87
83#define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO), \ 88#define __ATTR_RW(_name) __ATTR(_name, (S_IWUSR | S_IRUGO), \
84 _name##_show, _name##_store) 89 _name##_show, _name##_store)
85 90
@@ -108,8 +113,6 @@ static const struct attribute_group _name##_group = { \
108}; \ 113}; \
109__ATTRIBUTE_GROUPS(_name) 114__ATTRIBUTE_GROUPS(_name)
110 115
111#define attr_name(_attr) (_attr).attr.name
112
113struct file; 116struct file;
114struct vm_area_struct; 117struct vm_area_struct;
115 118
@@ -119,7 +122,7 @@ struct bin_attribute {
119 void *private; 122 void *private;
120 ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *, 123 ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *,
121 char *, loff_t, size_t); 124 char *, loff_t, size_t);
122 ssize_t (*write)(struct file *,struct kobject *, struct bin_attribute *, 125 ssize_t (*write)(struct file *, struct kobject *, struct bin_attribute *,
123 char *, loff_t, size_t); 126 char *, loff_t, size_t);
124 int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr, 127 int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr,
125 struct vm_area_struct *vma); 128 struct vm_area_struct *vma);
@@ -153,7 +156,7 @@ struct bin_attribute {
153 156
154#define __BIN_ATTR_RW(_name, _size) __BIN_ATTR(_name, \ 157#define __BIN_ATTR_RW(_name, _size) __BIN_ATTR(_name, \
155 (S_IWUSR | S_IRUGO), _name##_read, \ 158 (S_IWUSR | S_IRUGO), _name##_read, \
156 _name##_write) 159 _name##_write, _size)
157 160
158#define __BIN_ATTR_NULL __ATTR_NULL 161#define __BIN_ATTR_NULL __ATTR_NULL
159 162
@@ -168,8 +171,8 @@ struct bin_attribute bin_attr_##_name = __BIN_ATTR_RO(_name, _size)
168struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size) 171struct bin_attribute bin_attr_##_name = __BIN_ATTR_RW(_name, _size)
169 172
170struct sysfs_ops { 173struct sysfs_ops {
171 ssize_t (*show)(struct kobject *, struct attribute *,char *); 174 ssize_t (*show)(struct kobject *, struct attribute *, char *);
172 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); 175 ssize_t (*store)(struct kobject *, struct attribute *, const char *, size_t);
173 const void *(*namespace)(struct kobject *, const struct attribute *); 176 const void *(*namespace)(struct kobject *, const struct attribute *);
174}; 177};
175 178
@@ -215,10 +218,14 @@ void sysfs_delete_link(struct kobject *dir, struct kobject *targ,
215 218
216int __must_check sysfs_create_group(struct kobject *kobj, 219int __must_check sysfs_create_group(struct kobject *kobj,
217 const struct attribute_group *grp); 220 const struct attribute_group *grp);
221int __must_check sysfs_create_groups(struct kobject *kobj,
222 const struct attribute_group **groups);
218int sysfs_update_group(struct kobject *kobj, 223int sysfs_update_group(struct kobject *kobj,
219 const struct attribute_group *grp); 224 const struct attribute_group *grp);
220void sysfs_remove_group(struct kobject *kobj, 225void sysfs_remove_group(struct kobject *kobj,
221 const struct attribute_group *grp); 226 const struct attribute_group *grp);
227void sysfs_remove_groups(struct kobject *kobj,
228 const struct attribute_group **groups);
222int sysfs_add_file_to_group(struct kobject *kobj, 229int sysfs_add_file_to_group(struct kobject *kobj,
223 const struct attribute *attr, const char *group); 230 const struct attribute *attr, const char *group);
224void sysfs_remove_file_from_group(struct kobject *kobj, 231void sysfs_remove_file_from_group(struct kobject *kobj,
@@ -343,6 +350,12 @@ static inline int sysfs_create_group(struct kobject *kobj,
343 return 0; 350 return 0;
344} 351}
345 352
353static inline int sysfs_create_groups(struct kobject *kobj,
354 const struct attribute_group **groups)
355{
356 return 0;
357}
358
346static inline int sysfs_update_group(struct kobject *kobj, 359static inline int sysfs_update_group(struct kobject *kobj,
347 const struct attribute_group *grp) 360 const struct attribute_group *grp)
348{ 361{
@@ -354,6 +367,11 @@ static inline void sysfs_remove_group(struct kobject *kobj,
354{ 367{
355} 368}
356 369
370static inline void sysfs_remove_groups(struct kobject *kobj,
371 const struct attribute_group **groups)
372{
373}
374
357static inline int sysfs_add_file_to_group(struct kobject *kobj, 375static inline int sysfs_add_file_to_group(struct kobject *kobj,
358 const struct attribute *attr, const char *group) 376 const struct attribute *attr, const char *group)
359{ 377{
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 472120b4fac5..d68633452d9b 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -107,7 +107,6 @@ static inline void tcp_clear_options(struct tcp_options_received *rx_opt)
107 * only four options will fit in a standard TCP header */ 107 * only four options will fit in a standard TCP header */
108#define TCP_NUM_SACKS 4 108#define TCP_NUM_SACKS 4
109 109
110struct tcp_cookie_values;
111struct tcp_request_sock_ops; 110struct tcp_request_sock_ops;
112 111
113struct tcp_request_sock { 112struct tcp_request_sock {
@@ -238,6 +237,7 @@ struct tcp_sock {
238 237
239 u32 rcv_wnd; /* Current receiver window */ 238 u32 rcv_wnd; /* Current receiver window */
240 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ 239 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */
240 u32 notsent_lowat; /* TCP_NOTSENT_LOWAT */
241 u32 pushed_seq; /* Last pushed seq, required to talk to windows */ 241 u32 pushed_seq; /* Last pushed seq, required to talk to windows */
242 u32 lost_out; /* Lost packets */ 242 u32 lost_out; /* Lost packets */
243 u32 sacked_out; /* SACK'd packets */ 243 u32 sacked_out; /* SACK'd packets */
diff --git a/include/linux/tick.h b/include/linux/tick.h
index 62bd8b72873c..5128d33bbb39 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -10,6 +10,8 @@
10#include <linux/irqflags.h> 10#include <linux/irqflags.h>
11#include <linux/percpu.h> 11#include <linux/percpu.h>
12#include <linux/hrtimer.h> 12#include <linux/hrtimer.h>
13#include <linux/context_tracking_state.h>
14#include <linux/cpumask.h>
13 15
14#ifdef CONFIG_GENERIC_CLOCKEVENTS 16#ifdef CONFIG_GENERIC_CLOCKEVENTS
15 17
@@ -158,20 +160,51 @@ static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; }
158# endif /* !CONFIG_NO_HZ_COMMON */ 160# endif /* !CONFIG_NO_HZ_COMMON */
159 161
160#ifdef CONFIG_NO_HZ_FULL 162#ifdef CONFIG_NO_HZ_FULL
163extern bool tick_nohz_full_running;
164extern cpumask_var_t tick_nohz_full_mask;
165
166static inline bool tick_nohz_full_enabled(void)
167{
168 if (!static_key_false(&context_tracking_enabled))
169 return false;
170
171 return tick_nohz_full_running;
172}
173
174static inline bool tick_nohz_full_cpu(int cpu)
175{
176 if (!tick_nohz_full_enabled())
177 return false;
178
179 return cpumask_test_cpu(cpu, tick_nohz_full_mask);
180}
181
161extern void tick_nohz_init(void); 182extern void tick_nohz_init(void);
162extern int tick_nohz_full_cpu(int cpu); 183extern void __tick_nohz_full_check(void);
163extern void tick_nohz_full_check(void);
164extern void tick_nohz_full_kick(void); 184extern void tick_nohz_full_kick(void);
165extern void tick_nohz_full_kick_all(void); 185extern void tick_nohz_full_kick_all(void);
166extern void tick_nohz_task_switch(struct task_struct *tsk); 186extern void __tick_nohz_task_switch(struct task_struct *tsk);
167#else 187#else
168static inline void tick_nohz_init(void) { } 188static inline void tick_nohz_init(void) { }
169static inline int tick_nohz_full_cpu(int cpu) { return 0; } 189static inline bool tick_nohz_full_enabled(void) { return false; }
170static inline void tick_nohz_full_check(void) { } 190static inline bool tick_nohz_full_cpu(int cpu) { return false; }
191static inline void __tick_nohz_full_check(void) { }
171static inline void tick_nohz_full_kick(void) { } 192static inline void tick_nohz_full_kick(void) { }
172static inline void tick_nohz_full_kick_all(void) { } 193static inline void tick_nohz_full_kick_all(void) { }
173static inline void tick_nohz_task_switch(struct task_struct *tsk) { } 194static inline void __tick_nohz_task_switch(struct task_struct *tsk) { }
174#endif 195#endif
175 196
197static inline void tick_nohz_full_check(void)
198{
199 if (tick_nohz_full_enabled())
200 __tick_nohz_full_check();
201}
202
203static inline void tick_nohz_task_switch(struct task_struct *tsk)
204{
205 if (tick_nohz_full_enabled())
206 __tick_nohz_task_switch(tsk);
207}
208
176 209
177#endif 210#endif
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 01ac30efd6a6..64f864651d86 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -10,6 +10,8 @@
10#include <linux/mutex.h> 10#include <linux/mutex.h>
11#include <linux/tty_flags.h> 11#include <linux/tty_flags.h>
12#include <uapi/linux/tty.h> 12#include <uapi/linux/tty.h>
13#include <linux/rwsem.h>
14#include <linux/llist.h>
13 15
14 16
15 17
@@ -29,9 +31,10 @@
29#define __DISABLED_CHAR '\0' 31#define __DISABLED_CHAR '\0'
30 32
31struct tty_buffer { 33struct tty_buffer {
32 struct tty_buffer *next; 34 union {
33 char *char_buf_ptr; 35 struct tty_buffer *next;
34 unsigned char *flag_buf_ptr; 36 struct llist_node free;
37 };
35 int used; 38 int used;
36 int size; 39 int size;
37 int commit; 40 int commit;
@@ -40,25 +43,25 @@ struct tty_buffer {
40 unsigned long data[0]; 43 unsigned long data[0];
41}; 44};
42 45
43/* 46static inline unsigned char *char_buf_ptr(struct tty_buffer *b, int ofs)
44 * We default to dicing tty buffer allocations to this many characters 47{
45 * in order to avoid multiple page allocations. We know the size of 48 return ((unsigned char *)b->data) + ofs;
46 * tty_buffer itself but it must also be taken into account that the 49}
47 * the buffer is 256 byte aligned. See tty_buffer_find for the allocation
48 * logic this must match
49 */
50
51#define TTY_BUFFER_PAGE (((PAGE_SIZE - sizeof(struct tty_buffer)) / 2) & ~0xFF)
52 50
51static inline char *flag_buf_ptr(struct tty_buffer *b, int ofs)
52{
53 return (char *)char_buf_ptr(b, ofs) + b->size;
54}
53 55
54struct tty_bufhead { 56struct tty_bufhead {
55 struct work_struct work;
56 spinlock_t lock;
57 struct tty_buffer *head; /* Queue head */ 57 struct tty_buffer *head; /* Queue head */
58 struct work_struct work;
59 struct mutex lock;
60 atomic_t priority;
61 struct tty_buffer sentinel;
62 struct llist_head free; /* Free queue head */
63 atomic_t memory_used; /* In-use buffers excluding free list */
58 struct tty_buffer *tail; /* Active buffer */ 64 struct tty_buffer *tail; /* Active buffer */
59 struct tty_buffer *free; /* Free queue head */
60 int memory_used; /* Buffer space used excluding
61 free queue */
62}; 65};
63/* 66/*
64 * When a break, frame error, or parity error happens, these codes are 67 * When a break, frame error, or parity error happens, these codes are
@@ -199,9 +202,6 @@ struct tty_port {
199 wait_queue_head_t close_wait; /* Close waiters */ 202 wait_queue_head_t close_wait; /* Close waiters */
200 wait_queue_head_t delta_msr_wait; /* Modem status change */ 203 wait_queue_head_t delta_msr_wait; /* Modem status change */
201 unsigned long flags; /* TTY flags ASY_*/ 204 unsigned long flags; /* TTY flags ASY_*/
202 unsigned long iflags; /* TTYP_ internal flags */
203#define TTYP_FLUSHING 1 /* Flushing to ldisc in progress */
204#define TTYP_FLUSHPENDING 2 /* Queued buffer flush pending */
205 unsigned char console:1, /* port is a console */ 205 unsigned char console:1, /* port is a console */
206 low_latency:1; /* direct buffer flush */ 206 low_latency:1; /* direct buffer flush */
207 struct mutex mutex; /* Locking */ 207 struct mutex mutex; /* Locking */
@@ -238,14 +238,16 @@ struct tty_struct {
238 int index; 238 int index;
239 239
240 /* Protects ldisc changes: Lock tty not pty */ 240 /* Protects ldisc changes: Lock tty not pty */
241 struct mutex ldisc_mutex; 241 struct ld_semaphore ldisc_sem;
242 struct tty_ldisc *ldisc; 242 struct tty_ldisc *ldisc;
243 243
244 struct mutex atomic_write_lock; 244 struct mutex atomic_write_lock;
245 struct mutex legacy_mutex; 245 struct mutex legacy_mutex;
246 struct mutex termios_mutex; 246 struct mutex throttle_mutex;
247 struct rw_semaphore termios_rwsem;
248 struct mutex winsize_mutex;
247 spinlock_t ctrl_lock; 249 spinlock_t ctrl_lock;
248 /* Termios values are protected by the termios mutex */ 250 /* Termios values are protected by the termios rwsem */
249 struct ktermios termios, termios_locked; 251 struct ktermios termios, termios_locked;
250 struct termiox *termiox; /* May be NULL for unsupported */ 252 struct termiox *termiox; /* May be NULL for unsupported */
251 char name[64]; 253 char name[64];
@@ -253,7 +255,7 @@ struct tty_struct {
253 struct pid *session; 255 struct pid *session;
254 unsigned long flags; 256 unsigned long flags;
255 int count; 257 int count;
256 struct winsize winsize; /* termios mutex */ 258 struct winsize winsize; /* winsize_mutex */
257 unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1; 259 unsigned char stopped:1, hw_stopped:1, flow_stopped:1, packet:1;
258 unsigned char ctrl_status; /* ctrl_lock */ 260 unsigned char ctrl_status; /* ctrl_lock */
259 unsigned int receive_room; /* Bytes free for queue */ 261 unsigned int receive_room; /* Bytes free for queue */
@@ -303,10 +305,7 @@ struct tty_file_private {
303#define TTY_EXCLUSIVE 3 /* Exclusive open mode */ 305#define TTY_EXCLUSIVE 3 /* Exclusive open mode */
304#define TTY_DEBUG 4 /* Debugging */ 306#define TTY_DEBUG 4 /* Debugging */
305#define TTY_DO_WRITE_WAKEUP 5 /* Call write_wakeup after queuing new */ 307#define TTY_DO_WRITE_WAKEUP 5 /* Call write_wakeup after queuing new */
306#define TTY_PUSH 6 /* n_tty private */
307#define TTY_CLOSING 7 /* ->close() in progress */ 308#define TTY_CLOSING 7 /* ->close() in progress */
308#define TTY_LDISC 9 /* Line discipline attached */
309#define TTY_LDISC_CHANGING 10 /* Line discipline changing */
310#define TTY_LDISC_OPEN 11 /* Line discipline is open */ 309#define TTY_LDISC_OPEN 11 /* Line discipline is open */
311#define TTY_PTY_LOCK 16 /* pty private */ 310#define TTY_PTY_LOCK 16 /* pty private */
312#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ 311#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */
@@ -559,6 +558,19 @@ extern void tty_ldisc_init(struct tty_struct *tty);
559extern void tty_ldisc_deinit(struct tty_struct *tty); 558extern void tty_ldisc_deinit(struct tty_struct *tty);
560extern void tty_ldisc_begin(void); 559extern void tty_ldisc_begin(void);
561 560
561static inline int tty_ldisc_receive_buf(struct tty_ldisc *ld, unsigned char *p,
562 char *f, int count)
563{
564 if (ld->ops->receive_buf2)
565 count = ld->ops->receive_buf2(ld->tty, p, f, count);
566 else {
567 count = min_t(int, count, ld->tty->receive_room);
568 if (count)
569 ld->ops->receive_buf(ld->tty, p, f, count);
570 }
571 return count;
572}
573
562 574
563/* n_tty.c */ 575/* n_tty.c */
564extern struct tty_ldisc_ops tty_ldisc_N_TTY; 576extern struct tty_ldisc_ops tty_ldisc_N_TTY;
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index e0f252633b47..21ddd7d9ea1f 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_TTY_FLIP_H 1#ifndef _LINUX_TTY_FLIP_H
2#define _LINUX_TTY_FLIP_H 2#define _LINUX_TTY_FLIP_H
3 3
4extern int tty_buffer_space_avail(struct tty_port *port);
4extern int tty_buffer_request_room(struct tty_port *port, size_t size); 5extern int tty_buffer_request_room(struct tty_port *port, size_t size);
5extern int tty_insert_flip_string_flags(struct tty_port *port, 6extern int tty_insert_flip_string_flags(struct tty_port *port,
6 const unsigned char *chars, const char *flags, size_t size); 7 const unsigned char *chars, const char *flags, size_t size);
@@ -18,8 +19,8 @@ static inline int tty_insert_flip_char(struct tty_port *port,
18{ 19{
19 struct tty_buffer *tb = port->buf.tail; 20 struct tty_buffer *tb = port->buf.tail;
20 if (tb && tb->used < tb->size) { 21 if (tb && tb->used < tb->size) {
21 tb->flag_buf_ptr[tb->used] = flag; 22 *flag_buf_ptr(tb, tb->used) = flag;
22 tb->char_buf_ptr[tb->used++] = ch; 23 *char_buf_ptr(tb, tb->used++) = ch;
23 return 1; 24 return 1;
24 } 25 }
25 return tty_insert_flip_string_flags(port, &ch, &flag, 1); 26 return tty_insert_flip_string_flags(port, &ch, &flag, 1);
@@ -31,4 +32,7 @@ static inline int tty_insert_flip_string(struct tty_port *port,
31 return tty_insert_flip_string_fixed_flag(port, chars, TTY_NORMAL, size); 32 return tty_insert_flip_string_fixed_flag(port, chars, TTY_NORMAL, size);
32} 33}
33 34
35extern void tty_buffer_lock_exclusive(struct tty_port *port);
36extern void tty_buffer_unlock_exclusive(struct tty_port *port);
37
34#endif /* _LINUX_TTY_FLIP_H */ 38#endif /* _LINUX_TTY_FLIP_H */
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index a1b048999821..f15c898ff462 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -109,6 +109,17 @@
109 * 109 *
110 * Tells the discipline that the DCD pin has changed its status. 110 * Tells the discipline that the DCD pin has changed its status.
111 * Used exclusively by the N_PPS (Pulse-Per-Second) line discipline. 111 * Used exclusively by the N_PPS (Pulse-Per-Second) line discipline.
112 *
113 * int (*receive_buf2)(struct tty_struct *, const unsigned char *cp,
114 * char *fp, int count);
115 *
116 * This function is called by the low-level tty driver to send
117 * characters received by the hardware to the line discpline for
118 * processing. <cp> is a pointer to the buffer of input
119 * character received by the device. <fp> is a pointer to a
120 * pointer of flag bytes which indicate whether a character was
121 * received with a parity error, etc.
122 * If assigned, prefer this function for automatic flow control.
112 */ 123 */
113 124
114#include <linux/fs.h> 125#include <linux/fs.h>
@@ -195,6 +206,8 @@ struct tty_ldisc_ops {
195 void (*write_wakeup)(struct tty_struct *); 206 void (*write_wakeup)(struct tty_struct *);
196 void (*dcd_change)(struct tty_struct *, unsigned int); 207 void (*dcd_change)(struct tty_struct *, unsigned int);
197 void (*fasync)(struct tty_struct *tty, int on); 208 void (*fasync)(struct tty_struct *tty, int on);
209 int (*receive_buf2)(struct tty_struct *, const unsigned char *cp,
210 char *fp, int count);
198 211
199 struct module *owner; 212 struct module *owner;
200 213
@@ -203,8 +216,7 @@ struct tty_ldisc_ops {
203 216
204struct tty_ldisc { 217struct tty_ldisc {
205 struct tty_ldisc_ops *ops; 218 struct tty_ldisc_ops *ops;
206 atomic_t users; 219 struct tty_struct *tty;
207 wait_queue_head_t wq_idle;
208}; 220};
209 221
210#define TTY_LDISC_MAGIC 0x5403 222#define TTY_LDISC_MAGIC 0x5403
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 0eec2689b955..001629cd1a97 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -337,6 +337,7 @@ struct usb_bus {
337 * the ep queue on a short transfer 337 * the ep queue on a short transfer
338 * with the URB_SHORT_NOT_OK flag set. 338 * with the URB_SHORT_NOT_OK flag set.
339 */ 339 */
340 unsigned no_sg_constraint:1; /* no sg constraint */
340 unsigned sg_tablesize; /* 0 or largest number of sg list entries */ 341 unsigned sg_tablesize; /* 0 or largest number of sg list entries */
341 342
342 int devnum_next; /* Next open device number in 343 int devnum_next; /* Next open device number in
@@ -684,6 +685,11 @@ static inline bool usb_device_supports_ltm(struct usb_device *udev)
684 return udev->bos->ss_cap->bmAttributes & USB_LTM_SUPPORT; 685 return udev->bos->ss_cap->bmAttributes & USB_LTM_SUPPORT;
685} 686}
686 687
688static inline bool usb_device_no_sg_constraint(struct usb_device *udev)
689{
690 return udev && udev->bus && udev->bus->no_sg_constraint;
691}
692
687 693
688/*-------------------------------------------------------------------------*/ 694/*-------------------------------------------------------------------------*/
689 695
@@ -708,7 +714,10 @@ extern int usb_driver_claim_interface(struct usb_driver *driver,
708 * usb_interface_claimed - returns true iff an interface is claimed 714 * usb_interface_claimed - returns true iff an interface is claimed
709 * @iface: the interface being checked 715 * @iface: the interface being checked
710 * 716 *
711 * Returns true (nonzero) iff the interface is claimed, else false (zero). 717 * Return: %true (nonzero) iff the interface is claimed, else %false
718 * (zero).
719 *
720 * Note:
712 * Callers must own the driver model's usb bus readlock. So driver 721 * Callers must own the driver model's usb bus readlock. So driver
713 * probe() entries don't need extra locking, but other call contexts 722 * probe() entries don't need extra locking, but other call contexts
714 * may need to explicitly claim that lock. 723 * may need to explicitly claim that lock.
@@ -745,8 +754,9 @@ extern struct usb_host_interface *usb_find_alt_setting(
745 * @buf: where to put the string 754 * @buf: where to put the string
746 * @size: how big is "buf"? 755 * @size: how big is "buf"?
747 * 756 *
748 * Returns length of the string (> 0) or negative if size was too small. 757 * Return: Length of the string (> 0) or negative if size was too small.
749 * 758 *
759 * Note:
750 * This identifier is intended to be "stable", reflecting physical paths in 760 * This identifier is intended to be "stable", reflecting physical paths in
751 * hardware such as physical bus addresses for host controllers or ports on 761 * hardware such as physical bus addresses for host controllers or ports on
752 * USB hubs. That makes it stay the same until systems are physically 762 * USB hubs. That makes it stay the same until systems are physically
@@ -1247,7 +1257,9 @@ typedef void (*usb_complete_t)(struct urb *);
1247 * the device driver is saying that it provided this DMA address, 1257 * the device driver is saying that it provided this DMA address,
1248 * which the host controller driver should use in preference to the 1258 * which the host controller driver should use in preference to the
1249 * transfer_buffer. 1259 * transfer_buffer.
1250 * @sg: scatter gather buffer list 1260 * @sg: scatter gather buffer list, the buffer size of each element in
1261 * the list (except the last) must be divisible by the endpoint's
1262 * max packet size if no_sg_constraint isn't set in 'struct usb_bus'
1251 * @num_mapped_sgs: (internal) number of mapped sg entries 1263 * @num_mapped_sgs: (internal) number of mapped sg entries
1252 * @num_sgs: number of entries in the sg list 1264 * @num_sgs: number of entries in the sg list
1253 * @transfer_buffer_length: How big is transfer_buffer. The transfer may 1265 * @transfer_buffer_length: How big is transfer_buffer. The transfer may
@@ -1534,10 +1546,16 @@ static inline void usb_fill_int_urb(struct urb *urb,
1534 urb->transfer_buffer_length = buffer_length; 1546 urb->transfer_buffer_length = buffer_length;
1535 urb->complete = complete_fn; 1547 urb->complete = complete_fn;
1536 urb->context = context; 1548 urb->context = context;
1537 if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) 1549
1550 if (dev->speed == USB_SPEED_HIGH || dev->speed == USB_SPEED_SUPER) {
1551 /* make sure interval is within allowed range */
1552 interval = clamp(interval, 1, 16);
1553
1538 urb->interval = 1 << (interval - 1); 1554 urb->interval = 1 << (interval - 1);
1539 else 1555 } else {
1540 urb->interval = interval; 1556 urb->interval = interval;
1557 }
1558
1541 urb->start_frame = -1; 1559 urb->start_frame = -1;
1542} 1560}
1543 1561
@@ -1570,7 +1588,7 @@ extern int usb_anchor_empty(struct usb_anchor *anchor);
1570 * usb_urb_dir_in - check if an URB describes an IN transfer 1588 * usb_urb_dir_in - check if an URB describes an IN transfer
1571 * @urb: URB to be checked 1589 * @urb: URB to be checked
1572 * 1590 *
1573 * Returns 1 if @urb describes an IN transfer (device-to-host), 1591 * Return: 1 if @urb describes an IN transfer (device-to-host),
1574 * otherwise 0. 1592 * otherwise 0.
1575 */ 1593 */
1576static inline int usb_urb_dir_in(struct urb *urb) 1594static inline int usb_urb_dir_in(struct urb *urb)
@@ -1582,7 +1600,7 @@ static inline int usb_urb_dir_in(struct urb *urb)
1582 * usb_urb_dir_out - check if an URB describes an OUT transfer 1600 * usb_urb_dir_out - check if an URB describes an OUT transfer
1583 * @urb: URB to be checked 1601 * @urb: URB to be checked
1584 * 1602 *
1585 * Returns 1 if @urb describes an OUT transfer (host-to-device), 1603 * Return: 1 if @urb describes an OUT transfer (host-to-device),
1586 * otherwise 0. 1604 * otherwise 0.
1587 */ 1605 */
1588static inline int usb_urb_dir_out(struct urb *urb) 1606static inline int usb_urb_dir_out(struct urb *urb)
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index 25629948c842..7d399671a566 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -18,12 +18,17 @@ struct ci_hdrc_platform_data {
18 unsigned long flags; 18 unsigned long flags;
19#define CI_HDRC_REGS_SHARED BIT(0) 19#define CI_HDRC_REGS_SHARED BIT(0)
20#define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1) 20#define CI_HDRC_REQUIRE_TRANSCEIVER BIT(1)
21#define CI_HDRC_PULLUP_ON_VBUS BIT(2)
22#define CI_HDRC_DISABLE_STREAMING BIT(3) 21#define CI_HDRC_DISABLE_STREAMING BIT(3)
22 /*
23 * Only set it when DCCPARAMS.DC==1 and DCCPARAMS.HC==1,
24 * but otg is not supported (no register otgsc).
25 */
26#define CI_HDRC_DUAL_ROLE_NOT_OTG BIT(4)
23 enum usb_dr_mode dr_mode; 27 enum usb_dr_mode dr_mode;
24#define CI_HDRC_CONTROLLER_RESET_EVENT 0 28#define CI_HDRC_CONTROLLER_RESET_EVENT 0
25#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1 29#define CI_HDRC_CONTROLLER_STOPPED_EVENT 1
26 void (*notify_event) (struct ci_hdrc *ci, unsigned event); 30 void (*notify_event) (struct ci_hdrc *ci, unsigned event);
31 struct regulator *reg_vbus;
27}; 32};
28 33
29/* Default offset of capability registers */ 34/* Default offset of capability registers */
diff --git a/include/linux/usb/dwc3-omap.h b/include/linux/usb/dwc3-omap.h
deleted file mode 100644
index 5615f4d82724..000000000000
--- a/include/linux/usb/dwc3-omap.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Copyright (C) 2013 by Texas Instruments
3 *
4 * The Inventra Controller Driver for Linux is free software; you
5 * can redistribute it and/or modify it under the terms of the GNU
6 * General Public License version 2 as published by the Free Software
7 * Foundation.
8 */
9
10#ifndef __DWC3_OMAP_H__
11#define __DWC3_OMAP_H__
12
13enum omap_dwc3_vbus_id_status {
14 OMAP_DWC3_UNKNOWN = 0,
15 OMAP_DWC3_ID_GROUND,
16 OMAP_DWC3_ID_FLOAT,
17 OMAP_DWC3_VBUS_VALID,
18 OMAP_DWC3_VBUS_OFF,
19};
20
21#if (defined(CONFIG_USB_DWC3) || defined(CONFIG_USB_DWC3_MODULE))
22extern int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status);
23#else
24static inline int dwc3_omap_mailbox(enum omap_dwc3_vbus_id_status status)
25{
26 return -ENODEV;
27}
28#endif
29
30#endif /* __DWC3_OMAP_H__ */
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index f1b0dca60f12..942ef5e053bf 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -22,6 +22,7 @@
22#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/scatterlist.h> 23#include <linux/scatterlist.h>
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/workqueue.h>
25#include <linux/usb/ch9.h> 26#include <linux/usb/ch9.h>
26 27
27struct usb_ep; 28struct usb_ep;
@@ -475,6 +476,7 @@ struct usb_gadget_ops {
475 476
476/** 477/**
477 * struct usb_gadget - represents a usb slave device 478 * struct usb_gadget - represents a usb slave device
479 * @work: (internal use) Workqueue to be used for sysfs_notify()
478 * @ops: Function pointers used to access hardware-specific operations. 480 * @ops: Function pointers used to access hardware-specific operations.
479 * @ep0: Endpoint zero, used when reading or writing responses to 481 * @ep0: Endpoint zero, used when reading or writing responses to
480 * driver setup() requests 482 * driver setup() requests
@@ -520,6 +522,7 @@ struct usb_gadget_ops {
520 * device is acting as a B-Peripheral (so is_a_peripheral is false). 522 * device is acting as a B-Peripheral (so is_a_peripheral is false).
521 */ 523 */
522struct usb_gadget { 524struct usb_gadget {
525 struct work_struct work;
523 /* readonly to gadget driver */ 526 /* readonly to gadget driver */
524 const struct usb_gadget_ops *ops; 527 const struct usb_gadget_ops *ops;
525 struct usb_ep *ep0; 528 struct usb_ep *ep0;
@@ -538,6 +541,7 @@ struct usb_gadget {
538 unsigned out_epnum; 541 unsigned out_epnum;
539 unsigned in_epnum; 542 unsigned in_epnum;
540}; 543};
544#define work_to_gadget(w) (container_of((w), struct usb_gadget, work))
541 545
542static inline void set_gadget_data(struct usb_gadget *gadget, void *data) 546static inline void set_gadget_data(struct usb_gadget *gadget, void *data)
543 { dev_set_drvdata(&gadget->dev, data); } 547 { dev_set_drvdata(&gadget->dev, data); }
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 1e88377e22f4..75efc45eaa2f 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -22,6 +22,7 @@
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23 23
24#include <linux/rwsem.h> 24#include <linux/rwsem.h>
25#include <linux/interrupt.h>
25 26
26#define MAX_TOPO_LEVEL 6 27#define MAX_TOPO_LEVEL 6
27 28
@@ -67,6 +68,13 @@
67 68
68/*-------------------------------------------------------------------------*/ 69/*-------------------------------------------------------------------------*/
69 70
71struct giveback_urb_bh {
72 bool running;
73 spinlock_t lock;
74 struct list_head head;
75 struct tasklet_struct bh;
76};
77
70struct usb_hcd { 78struct usb_hcd {
71 79
72 /* 80 /*
@@ -139,6 +147,9 @@ struct usb_hcd {
139 resource_size_t rsrc_len; /* memory/io resource length */ 147 resource_size_t rsrc_len; /* memory/io resource length */
140 unsigned power_budget; /* in mA, 0 = no limit */ 148 unsigned power_budget; /* in mA, 0 = no limit */
141 149
150 struct giveback_urb_bh high_prio_bh;
151 struct giveback_urb_bh low_prio_bh;
152
142 /* bandwidth_mutex should be taken before adding or removing 153 /* bandwidth_mutex should be taken before adding or removing
143 * any new bus bandwidth constraints: 154 * any new bus bandwidth constraints:
144 * 1. Before adding a configuration for a new device. 155 * 1. Before adding a configuration for a new device.
@@ -221,6 +232,7 @@ struct hc_driver {
221#define HCD_USB25 0x0030 /* Wireless USB 1.0 (USB 2.5)*/ 232#define HCD_USB25 0x0030 /* Wireless USB 1.0 (USB 2.5)*/
222#define HCD_USB3 0x0040 /* USB 3.0 */ 233#define HCD_USB3 0x0040 /* USB 3.0 */
223#define HCD_MASK 0x0070 234#define HCD_MASK 0x0070
235#define HCD_BH 0x0100 /* URB complete in BH context */
224 236
225 /* called to init HCD and root hub */ 237 /* called to init HCD and root hub */
226 int (*reset) (struct usb_hcd *hcd); 238 int (*reset) (struct usb_hcd *hcd);
@@ -361,6 +373,11 @@ struct hc_driver {
361 int (*find_raw_port_number)(struct usb_hcd *, int); 373 int (*find_raw_port_number)(struct usb_hcd *, int);
362}; 374};
363 375
376static inline int hcd_giveback_urb_in_bh(struct usb_hcd *hcd)
377{
378 return hcd->driver->flags & HCD_BH;
379}
380
364extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); 381extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
365extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb, 382extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb,
366 int status); 383 int status);
@@ -411,7 +428,7 @@ extern int usb_hcd_pci_probe(struct pci_dev *dev,
411extern void usb_hcd_pci_remove(struct pci_dev *dev); 428extern void usb_hcd_pci_remove(struct pci_dev *dev);
412extern void usb_hcd_pci_shutdown(struct pci_dev *dev); 429extern void usb_hcd_pci_shutdown(struct pci_dev *dev);
413 430
414#ifdef CONFIG_PM_SLEEP 431#ifdef CONFIG_PM
415extern const struct dev_pm_ops usb_hcd_pci_pm_ops; 432extern const struct dev_pm_ops usb_hcd_pci_pm_ops;
416#endif 433#endif
417#endif /* CONFIG_PCI */ 434#endif /* CONFIG_PCI */
diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h
index a0ef405368b8..8c38aa26b3bb 100644
--- a/include/linux/usb/of.h
+++ b/include/linux/usb/of.h
@@ -7,19 +7,27 @@
7#ifndef __LINUX_USB_OF_H 7#ifndef __LINUX_USB_OF_H
8#define __LINUX_USB_OF_H 8#define __LINUX_USB_OF_H
9 9
10#include <linux/usb/ch9.h>
10#include <linux/usb/otg.h> 11#include <linux/usb/otg.h>
11#include <linux/usb/phy.h> 12#include <linux/usb/phy.h>
12 13
13#if IS_ENABLED(CONFIG_OF) 14#if IS_ENABLED(CONFIG_OF)
14enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np); 15enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np);
16enum usb_device_speed of_usb_get_maximum_speed(struct device_node *np);
15#else 17#else
16static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np) 18static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np)
17{ 19{
18 return USB_DR_MODE_UNKNOWN; 20 return USB_DR_MODE_UNKNOWN;
19} 21}
22
23static inline enum usb_device_speed
24of_usb_get_maximum_speed(struct device_node *np)
25{
26 return USB_SPEED_UNKNOWN;
27}
20#endif 28#endif
21 29
22#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_PHY) 30#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_USB_SUPPORT)
23enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np); 31enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np);
24#else 32#else
25static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np) 33static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np)
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 44036808bf0f..6c0b1c513db7 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -142,7 +142,7 @@ extern void usb_remove_phy(struct usb_phy *);
142/* helpers for direct access thru low-level io interface */ 142/* helpers for direct access thru low-level io interface */
143static inline int usb_phy_io_read(struct usb_phy *x, u32 reg) 143static inline int usb_phy_io_read(struct usb_phy *x, u32 reg)
144{ 144{
145 if (x->io_ops && x->io_ops->read) 145 if (x && x->io_ops && x->io_ops->read)
146 return x->io_ops->read(x, reg); 146 return x->io_ops->read(x, reg);
147 147
148 return -EINVAL; 148 return -EINVAL;
@@ -150,7 +150,7 @@ static inline int usb_phy_io_read(struct usb_phy *x, u32 reg)
150 150
151static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg) 151static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg)
152{ 152{
153 if (x->io_ops && x->io_ops->write) 153 if (x && x->io_ops && x->io_ops->write)
154 return x->io_ops->write(x, val, reg); 154 return x->io_ops->write(x, val, reg);
155 155
156 return -EINVAL; 156 return -EINVAL;
@@ -159,7 +159,7 @@ static inline int usb_phy_io_write(struct usb_phy *x, u32 val, u32 reg)
159static inline int 159static inline int
160usb_phy_init(struct usb_phy *x) 160usb_phy_init(struct usb_phy *x)
161{ 161{
162 if (x->init) 162 if (x && x->init)
163 return x->init(x); 163 return x->init(x);
164 164
165 return 0; 165 return 0;
@@ -168,14 +168,14 @@ usb_phy_init(struct usb_phy *x)
168static inline void 168static inline void
169usb_phy_shutdown(struct usb_phy *x) 169usb_phy_shutdown(struct usb_phy *x)
170{ 170{
171 if (x->shutdown) 171 if (x && x->shutdown)
172 x->shutdown(x); 172 x->shutdown(x);
173} 173}
174 174
175static inline int 175static inline int
176usb_phy_vbus_on(struct usb_phy *x) 176usb_phy_vbus_on(struct usb_phy *x)
177{ 177{
178 if (!x->set_vbus) 178 if (!x || !x->set_vbus)
179 return 0; 179 return 0;
180 180
181 return x->set_vbus(x, true); 181 return x->set_vbus(x, true);
@@ -184,7 +184,7 @@ usb_phy_vbus_on(struct usb_phy *x)
184static inline int 184static inline int
185usb_phy_vbus_off(struct usb_phy *x) 185usb_phy_vbus_off(struct usb_phy *x)
186{ 186{
187 if (!x->set_vbus) 187 if (!x || !x->set_vbus)
188 return 0; 188 return 0;
189 189
190 return x->set_vbus(x, false); 190 return x->set_vbus(x, false);
@@ -258,7 +258,7 @@ usb_phy_set_power(struct usb_phy *x, unsigned mA)
258static inline int 258static inline int
259usb_phy_set_suspend(struct usb_phy *x, int suspend) 259usb_phy_set_suspend(struct usb_phy *x, int suspend)
260{ 260{
261 if (x->set_suspend != NULL) 261 if (x && x->set_suspend != NULL)
262 return x->set_suspend(x, suspend); 262 return x->set_suspend(x, suspend);
263 else 263 else
264 return 0; 264 return 0;
@@ -267,7 +267,7 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
267static inline int 267static inline int
268usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed) 268usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
269{ 269{
270 if (x->notify_connect) 270 if (x && x->notify_connect)
271 return x->notify_connect(x, speed); 271 return x->notify_connect(x, speed);
272 else 272 else
273 return 0; 273 return 0;
@@ -276,7 +276,7 @@ usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
276static inline int 276static inline int
277usb_phy_notify_disconnect(struct usb_phy *x, enum usb_device_speed speed) 277usb_phy_notify_disconnect(struct usb_phy *x, enum usb_device_speed speed)
278{ 278{
279 if (x->notify_disconnect) 279 if (x && x->notify_disconnect)
280 return x->notify_disconnect(x, speed); 280 return x->notify_disconnect(x, speed);
281 else 281 else
282 return 0; 282 return 0;
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h
index d2ca919a5b73..1de16c324ec8 100644
--- a/include/linux/usb/tegra_usb_phy.h
+++ b/include/linux/usb/tegra_usb_phy.h
@@ -18,19 +18,36 @@
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/usb/otg.h> 19#include <linux/usb/otg.h>
20 20
21/*
22 * utmi_pll_config_in_car_module: true if the UTMI PLL configuration registers
23 * should be set up by clk-tegra, false if by the PHY code
24 * has_hostpc: true if the USB controller has the HOSTPC extension, which
25 * changes the location of the PHCD and PTS fields
26 * requires_usbmode_setup: true if the USBMODE register needs to be set to
27 * enter host mode
28 * requires_extra_tuning_parameters: true if xcvr_hsslew, hssquelch_level
29 * and hsdiscon_level should be set for adequate signal quality
30 */
31
32struct tegra_phy_soc_config {
33 bool utmi_pll_config_in_car_module;
34 bool has_hostpc;
35 bool requires_usbmode_setup;
36 bool requires_extra_tuning_parameters;
37};
38
21struct tegra_utmip_config { 39struct tegra_utmip_config {
22 u8 hssync_start_delay; 40 u8 hssync_start_delay;
23 u8 elastic_limit; 41 u8 elastic_limit;
24 u8 idle_wait_delay; 42 u8 idle_wait_delay;
25 u8 term_range_adj; 43 u8 term_range_adj;
44 bool xcvr_setup_use_fuses;
26 u8 xcvr_setup; 45 u8 xcvr_setup;
27 u8 xcvr_lsfslew; 46 u8 xcvr_lsfslew;
28 u8 xcvr_lsrslew; 47 u8 xcvr_lsrslew;
29}; 48 u8 xcvr_hsslew;
30 49 u8 hssquelch_level;
31struct tegra_ulpi_config { 50 u8 hsdiscon_level;
32 int reset_gpio;
33 const char *clk;
34}; 51};
35 52
36enum tegra_usb_phy_port_speed { 53enum tegra_usb_phy_port_speed {
@@ -39,12 +56,6 @@ enum tegra_usb_phy_port_speed {
39 TEGRA_USB_PHY_PORT_SPEED_HIGH, 56 TEGRA_USB_PHY_PORT_SPEED_HIGH,
40}; 57};
41 58
42enum tegra_usb_phy_mode {
43 TEGRA_USB_PHY_MODE_DEVICE,
44 TEGRA_USB_PHY_MODE_HOST,
45 TEGRA_USB_PHY_MODE_OTG,
46};
47
48struct tegra_xtal_freq; 59struct tegra_xtal_freq;
49 60
50struct tegra_usb_phy { 61struct tegra_usb_phy {
@@ -55,18 +66,17 @@ struct tegra_usb_phy {
55 struct clk *clk; 66 struct clk *clk;
56 struct clk *pll_u; 67 struct clk *pll_u;
57 struct clk *pad_clk; 68 struct clk *pad_clk;
58 enum tegra_usb_phy_mode mode; 69 struct regulator *vbus;
70 enum usb_dr_mode mode;
59 void *config; 71 void *config;
72 const struct tegra_phy_soc_config *soc_config;
60 struct usb_phy *ulpi; 73 struct usb_phy *ulpi;
61 struct usb_phy u_phy; 74 struct usb_phy u_phy;
62 struct device *dev;
63 bool is_legacy_phy; 75 bool is_legacy_phy;
64 bool is_ulpi_phy; 76 bool is_ulpi_phy;
65 int reset_gpio; 77 int reset_gpio;
66}; 78};
67 79
68struct usb_phy *tegra_usb_get_phy(struct device_node *dn);
69
70void tegra_usb_phy_preresume(struct usb_phy *phy); 80void tegra_usb_phy_preresume(struct usb_phy *phy);
71 81
72void tegra_usb_phy_postresume(struct usb_phy *phy); 82void tegra_usb_phy_postresume(struct usb_phy *phy);
diff --git a/include/linux/usb/nop-usb-xceiv.h b/include/linux/usb/usb_phy_gen_xceiv.h
index 148d35171aac..f9a7e7bc925b 100644
--- a/include/linux/usb/nop-usb-xceiv.h
+++ b/include/linux/usb/usb_phy_gen_xceiv.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/usb/otg.h> 4#include <linux/usb/otg.h>
5 5
6struct nop_usb_xceiv_platform_data { 6struct usb_phy_gen_xceiv_platform_data {
7 enum usb_phy_type type; 7 enum usb_phy_type type;
8 unsigned long clk_rate; 8 unsigned long clk_rate;
9 9
@@ -12,7 +12,7 @@ struct nop_usb_xceiv_platform_data {
12 unsigned int needs_reset:1; 12 unsigned int needs_reset:1;
13}; 13};
14 14
15#if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) 15#if IS_ENABLED(CONFIG_NOP_USB_XCEIV)
16/* sometimes transceivers are accessed only through e.g. ULPI */ 16/* sometimes transceivers are accessed only through e.g. ULPI */
17extern void usb_nop_xceiv_register(void); 17extern void usb_nop_xceiv_register(void);
18extern void usb_nop_xceiv_unregister(void); 18extern void usb_nop_xceiv_unregister(void);
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index f18d64129f99..9cb2fe8ca944 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -34,6 +34,8 @@ struct usbnet {
34 struct mutex phy_mutex; 34 struct mutex phy_mutex;
35 unsigned char suspend_count; 35 unsigned char suspend_count;
36 unsigned char pkt_cnt, pkt_err; 36 unsigned char pkt_cnt, pkt_err;
37 unsigned short rx_qlen, tx_qlen;
38 unsigned can_dma_sg:1;
37 39
38 /* i/o info: pipes etc */ 40 /* i/o info: pipes etc */
39 unsigned in, out; 41 unsigned in, out;
@@ -253,4 +255,6 @@ extern void usbnet_link_change(struct usbnet *, bool, bool);
253extern int usbnet_status_start(struct usbnet *dev, gfp_t mem_flags); 255extern int usbnet_status_start(struct usbnet *dev, gfp_t mem_flags);
254extern void usbnet_status_stop(struct usbnet *dev); 256extern void usbnet_status_stop(struct usbnet *dev);
255 257
258extern void usbnet_update_max_qlen(struct usbnet *dev);
259
256#endif /* __LINUX_USB_USBNET_H */ 260#endif /* __LINUX_USB_USBNET_H */
diff --git a/include/linux/usb/wusb-wa.h b/include/linux/usb/wusb-wa.h
index 6be985b2a434..4ff744e2b678 100644
--- a/include/linux/usb/wusb-wa.h
+++ b/include/linux/usb/wusb-wa.h
@@ -66,6 +66,7 @@ enum {
66 WA_ENABLE = 0x01, 66 WA_ENABLE = 0x01,
67 WA_RESET = 0x02, 67 WA_RESET = 0x02,
68 RPIPE_PAUSE = 0x1, 68 RPIPE_PAUSE = 0x1,
69 RPIPE_STALL = 0x2,
69}; 70};
70 71
71/* Responses from Get Status request ([WUSB] section 8.3.1.6) */ 72/* Responses from Get Status request ([WUSB] section 8.3.1.6) */
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
index b6b215f13b45..14105c26a836 100644
--- a/include/linux/user_namespace.h
+++ b/include/linux/user_namespace.h
@@ -23,6 +23,7 @@ struct user_namespace {
23 struct uid_gid_map projid_map; 23 struct uid_gid_map projid_map;
24 atomic_t count; 24 atomic_t count;
25 struct user_namespace *parent; 25 struct user_namespace *parent;
26 int level;
26 kuid_t owner; 27 kuid_t owner;
27 kgid_t group; 28 kgid_t group;
28 unsigned int proc_inum; 29 unsigned int proc_inum;
diff --git a/include/linux/uwb/spec.h b/include/linux/uwb/spec.h
index b52e44f1bd33..0df24bfcdb38 100644
--- a/include/linux/uwb/spec.h
+++ b/include/linux/uwb/spec.h
@@ -32,6 +32,7 @@
32 32
33#include <linux/types.h> 33#include <linux/types.h>
34#include <linux/bitmap.h> 34#include <linux/bitmap.h>
35#include <linux/if_ether.h>
35 36
36#define i1480_FW 0x00000303 37#define i1480_FW 0x00000303
37/* #define i1480_FW 0x00000302 */ 38/* #define i1480_FW 0x00000302 */
@@ -130,7 +131,7 @@ enum { UWB_DRP_BACKOFF_WIN_MAX = 16 };
130 * it is also used to define headers sent down and up the wire/radio). 131 * it is also used to define headers sent down and up the wire/radio).
131 */ 132 */
132struct uwb_mac_addr { 133struct uwb_mac_addr {
133 u8 data[6]; 134 u8 data[ETH_ALEN];
134} __attribute__((packed)); 135} __attribute__((packed));
135 136
136 137
@@ -568,7 +569,7 @@ struct uwb_rc_evt_confirm {
568/* Device Address Management event. [WHCI] section 3.1.3.2. */ 569/* Device Address Management event. [WHCI] section 3.1.3.2. */
569struct uwb_rc_evt_dev_addr_mgmt { 570struct uwb_rc_evt_dev_addr_mgmt {
570 struct uwb_rceb rceb; 571 struct uwb_rceb rceb;
571 u8 baAddr[6]; 572 u8 baAddr[ETH_ALEN];
572 u8 bResultCode; 573 u8 bResultCode;
573} __attribute__((packed)); 574} __attribute__((packed));
574 575
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h
index ddb419cf4530..502073a53dd3 100644
--- a/include/linux/vga_switcheroo.h
+++ b/include/linux/vga_switcheroo.h
@@ -45,7 +45,8 @@ struct vga_switcheroo_client_ops {
45#if defined(CONFIG_VGA_SWITCHEROO) 45#if defined(CONFIG_VGA_SWITCHEROO)
46void vga_switcheroo_unregister_client(struct pci_dev *dev); 46void vga_switcheroo_unregister_client(struct pci_dev *dev);
47int vga_switcheroo_register_client(struct pci_dev *dev, 47int vga_switcheroo_register_client(struct pci_dev *dev,
48 const struct vga_switcheroo_client_ops *ops); 48 const struct vga_switcheroo_client_ops *ops,
49 bool driver_power_control);
49int vga_switcheroo_register_audio_client(struct pci_dev *pdev, 50int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
50 const struct vga_switcheroo_client_ops *ops, 51 const struct vga_switcheroo_client_ops *ops,
51 int id, bool active); 52 int id, bool active);
@@ -60,11 +61,15 @@ int vga_switcheroo_process_delayed_switch(void);
60 61
61int vga_switcheroo_get_client_state(struct pci_dev *dev); 62int vga_switcheroo_get_client_state(struct pci_dev *dev);
62 63
64void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic);
65
66int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain);
67int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain);
63#else 68#else
64 69
65static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {} 70static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {}
66static inline int vga_switcheroo_register_client(struct pci_dev *dev, 71static inline int vga_switcheroo_register_client(struct pci_dev *dev,
67 const struct vga_switcheroo_client_ops *ops) { return 0; } 72 const struct vga_switcheroo_client_ops *ops, bool driver_power_control) { return 0; }
68static inline void vga_switcheroo_client_fb_set(struct pci_dev *dev, struct fb_info *info) {} 73static inline void vga_switcheroo_client_fb_set(struct pci_dev *dev, struct fb_info *info) {}
69static inline int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler) { return 0; } 74static inline int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler) { return 0; }
70static inline int vga_switcheroo_register_audio_client(struct pci_dev *pdev, 75static inline int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
@@ -74,6 +79,10 @@ static inline void vga_switcheroo_unregister_handler(void) {}
74static inline int vga_switcheroo_process_delayed_switch(void) { return 0; } 79static inline int vga_switcheroo_process_delayed_switch(void) { return 0; }
75static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return VGA_SWITCHEROO_ON; } 80static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return VGA_SWITCHEROO_ON; }
76 81
82static inline void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic) {}
83
84static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
85static inline int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
77 86
78#endif 87#endif
79#endif /* _LINUX_VGA_SWITCHEROO_H_ */ 88#endif /* _LINUX_VGA_SWITCHEROO_H_ */
diff --git a/include/linux/vmpressure.h b/include/linux/vmpressure.h
index 7dc17e2456de..3f3788d49362 100644
--- a/include/linux/vmpressure.h
+++ b/include/linux/vmpressure.h
@@ -34,10 +34,12 @@ extern void vmpressure_cleanup(struct vmpressure *vmpr);
34extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg); 34extern struct vmpressure *memcg_to_vmpressure(struct mem_cgroup *memcg);
35extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr); 35extern struct cgroup_subsys_state *vmpressure_to_css(struct vmpressure *vmpr);
36extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css); 36extern struct vmpressure *css_to_vmpressure(struct cgroup_subsys_state *css);
37extern int vmpressure_register_event(struct cgroup *cg, struct cftype *cft, 37extern int vmpressure_register_event(struct cgroup_subsys_state *css,
38 struct cftype *cft,
38 struct eventfd_ctx *eventfd, 39 struct eventfd_ctx *eventfd,
39 const char *args); 40 const char *args);
40extern void vmpressure_unregister_event(struct cgroup *cg, struct cftype *cft, 41extern void vmpressure_unregister_event(struct cgroup_subsys_state *css,
42 struct cftype *cft,
41 struct eventfd_ctx *eventfd); 43 struct eventfd_ctx *eventfd);
42#else 44#else
43static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg, 45static inline void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
diff --git a/include/linux/vtime.h b/include/linux/vtime.h
index b1dd2db80076..f5b72b364bda 100644
--- a/include/linux/vtime.h
+++ b/include/linux/vtime.h
@@ -1,18 +1,68 @@
1#ifndef _LINUX_KERNEL_VTIME_H 1#ifndef _LINUX_KERNEL_VTIME_H
2#define _LINUX_KERNEL_VTIME_H 2#define _LINUX_KERNEL_VTIME_H
3 3
4#include <linux/context_tracking_state.h>
5#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
6#include <asm/vtime.h>
7#endif
8
9
4struct task_struct; 10struct task_struct;
5 11
12/*
13 * vtime_accounting_enabled() definitions/declarations
14 */
15#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
16static inline bool vtime_accounting_enabled(void) { return true; }
17#endif /* CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
18
19#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
20static inline bool vtime_accounting_enabled(void)
21{
22 if (static_key_false(&context_tracking_enabled)) {
23 if (context_tracking_active())
24 return true;
25 }
26
27 return false;
28}
29#endif /* CONFIG_VIRT_CPU_ACCOUNTING_GEN */
30
31#ifndef CONFIG_VIRT_CPU_ACCOUNTING
32static inline bool vtime_accounting_enabled(void) { return false; }
33#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
34
35
36/*
37 * Common vtime APIs
38 */
6#ifdef CONFIG_VIRT_CPU_ACCOUNTING 39#ifdef CONFIG_VIRT_CPU_ACCOUNTING
40
41#ifdef __ARCH_HAS_VTIME_TASK_SWITCH
7extern void vtime_task_switch(struct task_struct *prev); 42extern void vtime_task_switch(struct task_struct *prev);
43#else
44extern void vtime_common_task_switch(struct task_struct *prev);
45static inline void vtime_task_switch(struct task_struct *prev)
46{
47 if (vtime_accounting_enabled())
48 vtime_common_task_switch(prev);
49}
50#endif /* __ARCH_HAS_VTIME_TASK_SWITCH */
51
8extern void vtime_account_system(struct task_struct *tsk); 52extern void vtime_account_system(struct task_struct *tsk);
9extern void vtime_account_idle(struct task_struct *tsk); 53extern void vtime_account_idle(struct task_struct *tsk);
10extern void vtime_account_user(struct task_struct *tsk); 54extern void vtime_account_user(struct task_struct *tsk);
11extern void vtime_account_irq_enter(struct task_struct *tsk);
12 55
13#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE 56#ifdef __ARCH_HAS_VTIME_ACCOUNT
14static inline bool vtime_accounting_enabled(void) { return true; } 57extern void vtime_account_irq_enter(struct task_struct *tsk);
15#endif 58#else
59extern void vtime_common_account_irq_enter(struct task_struct *tsk);
60static inline void vtime_account_irq_enter(struct task_struct *tsk)
61{
62 if (vtime_accounting_enabled())
63 vtime_common_account_irq_enter(tsk);
64}
65#endif /* __ARCH_HAS_VTIME_ACCOUNT */
16 66
17#else /* !CONFIG_VIRT_CPU_ACCOUNTING */ 67#else /* !CONFIG_VIRT_CPU_ACCOUNTING */
18 68
@@ -20,14 +70,20 @@ static inline void vtime_task_switch(struct task_struct *prev) { }
20static inline void vtime_account_system(struct task_struct *tsk) { } 70static inline void vtime_account_system(struct task_struct *tsk) { }
21static inline void vtime_account_user(struct task_struct *tsk) { } 71static inline void vtime_account_user(struct task_struct *tsk) { }
22static inline void vtime_account_irq_enter(struct task_struct *tsk) { } 72static inline void vtime_account_irq_enter(struct task_struct *tsk) { }
23static inline bool vtime_accounting_enabled(void) { return false; } 73#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
24#endif
25 74
26#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN 75#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
27extern void arch_vtime_task_switch(struct task_struct *tsk); 76extern void arch_vtime_task_switch(struct task_struct *tsk);
28extern void vtime_account_irq_exit(struct task_struct *tsk); 77extern void vtime_gen_account_irq_exit(struct task_struct *tsk);
29extern bool vtime_accounting_enabled(void); 78
79static inline void vtime_account_irq_exit(struct task_struct *tsk)
80{
81 if (vtime_accounting_enabled())
82 vtime_gen_account_irq_exit(tsk);
83}
84
30extern void vtime_user_enter(struct task_struct *tsk); 85extern void vtime_user_enter(struct task_struct *tsk);
86
31static inline void vtime_user_exit(struct task_struct *tsk) 87static inline void vtime_user_exit(struct task_struct *tsk)
32{ 88{
33 vtime_account_user(tsk); 89 vtime_account_user(tsk);
@@ -35,7 +91,7 @@ static inline void vtime_user_exit(struct task_struct *tsk)
35extern void vtime_guest_enter(struct task_struct *tsk); 91extern void vtime_guest_enter(struct task_struct *tsk);
36extern void vtime_guest_exit(struct task_struct *tsk); 92extern void vtime_guest_exit(struct task_struct *tsk);
37extern void vtime_init_idle(struct task_struct *tsk, int cpu); 93extern void vtime_init_idle(struct task_struct *tsk, int cpu);
38#else 94#else /* !CONFIG_VIRT_CPU_ACCOUNTING_GEN */
39static inline void vtime_account_irq_exit(struct task_struct *tsk) 95static inline void vtime_account_irq_exit(struct task_struct *tsk)
40{ 96{
41 /* On hard|softirq exit we always account to hard|softirq cputime */ 97 /* On hard|softirq exit we always account to hard|softirq cputime */
diff --git a/include/linux/wait.h b/include/linux/wait.h
index f487a4750b7f..a67fc1635592 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -811,6 +811,63 @@ do { \
811 __ret; \ 811 __ret; \
812}) 812})
813 813
814#define __wait_event_interruptible_lock_irq_timeout(wq, condition, \
815 lock, ret) \
816do { \
817 DEFINE_WAIT(__wait); \
818 \
819 for (;;) { \
820 prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \
821 if (condition) \
822 break; \
823 if (signal_pending(current)) { \
824 ret = -ERESTARTSYS; \
825 break; \
826 } \
827 spin_unlock_irq(&lock); \
828 ret = schedule_timeout(ret); \
829 spin_lock_irq(&lock); \
830 if (!ret) \
831 break; \
832 } \
833 finish_wait(&wq, &__wait); \
834} while (0)
835
836/**
837 * wait_event_interruptible_lock_irq_timeout - sleep until a condition gets true or a timeout elapses.
838 * The condition is checked under the lock. This is expected
839 * to be called with the lock taken.
840 * @wq: the waitqueue to wait on
841 * @condition: a C expression for the event to wait for
842 * @lock: a locked spinlock_t, which will be released before schedule()
843 * and reacquired afterwards.
844 * @timeout: timeout, in jiffies
845 *
846 * The process is put to sleep (TASK_INTERRUPTIBLE) until the
847 * @condition evaluates to true or signal is received. The @condition is
848 * checked each time the waitqueue @wq is woken up.
849 *
850 * wake_up() has to be called after changing any variable that could
851 * change the result of the wait condition.
852 *
853 * This is supposed to be called while holding the lock. The lock is
854 * dropped before going to sleep and is reacquired afterwards.
855 *
856 * The function returns 0 if the @timeout elapsed, -ERESTARTSYS if it
857 * was interrupted by a signal, and the remaining jiffies otherwise
858 * if the condition evaluated to true before the timeout elapsed.
859 */
860#define wait_event_interruptible_lock_irq_timeout(wq, condition, lock, \
861 timeout) \
862({ \
863 int __ret = timeout; \
864 \
865 if (!(condition)) \
866 __wait_event_interruptible_lock_irq_timeout( \
867 wq, condition, lock, __ret); \
868 __ret; \
869})
870
814 871
815/* 872/*
816 * These are the old interfaces to sleep waiting for an event. 873 * These are the old interfaces to sleep waiting for an event.
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index a0ed78ab54d7..594521ba0d43 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -295,7 +295,12 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
295 * Documentation/workqueue.txt. 295 * Documentation/workqueue.txt.
296 */ 296 */
297enum { 297enum {
298 WQ_NON_REENTRANT = 1 << 0, /* guarantee non-reentrance */ 298 /*
299 * All wqs are now non-reentrant making the following flag
300 * meaningless. Will be removed.
301 */
302 WQ_NON_REENTRANT = 1 << 0, /* DEPRECATED */
303
299 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */ 304 WQ_UNBOUND = 1 << 1, /* not bound to any cpu */
300 WQ_FREEZABLE = 1 << 2, /* freeze during suspend */ 305 WQ_FREEZABLE = 1 << 2, /* freeze during suspend */
301 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */ 306 WQ_MEM_RECLAIM = 1 << 3, /* may be used for memory reclaim */
diff --git a/include/media/adv7343.h b/include/media/adv7343.h
index 944757be49bb..e4142b1ef8cd 100644
--- a/include/media/adv7343.h
+++ b/include/media/adv7343.h
@@ -28,12 +28,7 @@
28 * @pll_control: PLL and oversampling control. This control allows internal 28 * @pll_control: PLL and oversampling control. This control allows internal
29 * PLL 1 circuit to be powered down and the oversampling to be 29 * PLL 1 circuit to be powered down and the oversampling to be
30 * switched off. 30 * switched off.
31 * @dac_1: power on/off DAC 1. 31 * @dac: array to configure power on/off DAC's 1..6
32 * @dac_2: power on/off DAC 2.
33 * @dac_3: power on/off DAC 3.
34 * @dac_4: power on/off DAC 4.
35 * @dac_5: power on/off DAC 5.
36 * @dac_6: power on/off DAC 6.
37 * 32 *
38 * Power mode register (Register 0x0), for more info refer REGISTER MAP ACCESS 33 * Power mode register (Register 0x0), for more info refer REGISTER MAP ACCESS
39 * section of datasheet[1], table 17 page no 30. 34 * section of datasheet[1], table 17 page no 30.
@@ -43,23 +38,16 @@
43struct adv7343_power_mode { 38struct adv7343_power_mode {
44 bool sleep_mode; 39 bool sleep_mode;
45 bool pll_control; 40 bool pll_control;
46 bool dac_1; 41 u32 dac[6];
47 bool dac_2;
48 bool dac_3;
49 bool dac_4;
50 bool dac_5;
51 bool dac_6;
52}; 42};
53 43
54/** 44/**
55 * struct adv7343_sd_config - SD Only Output Configuration. 45 * struct adv7343_sd_config - SD Only Output Configuration.
56 * @sd_dac_out1: Configure SD DAC Output 1. 46 * @sd_dac_out: array configuring SD DAC Outputs 1 and 2
57 * @sd_dac_out2: Configure SD DAC Output 2.
58 */ 47 */
59struct adv7343_sd_config { 48struct adv7343_sd_config {
60 /* SD only Output Configuration */ 49 /* SD only Output Configuration */
61 bool sd_dac_out1; 50 u32 sd_dac_out[2];
62 bool sd_dac_out2;
63}; 51};
64 52
65/** 53/**
diff --git a/include/media/adv7511.h b/include/media/adv7511.h
new file mode 100644
index 000000000000..bb78bed9a5b8
--- /dev/null
+++ b/include/media/adv7511.h
@@ -0,0 +1,48 @@
1/*
2 * Analog Devices ADV7511 HDMI Transmitter Device Driver
3 *
4 * Copyright 2013 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
5 *
6 * This program is free software; you may redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
12 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
13 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
14 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
15 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17 * SOFTWARE.
18 */
19
20#ifndef ADV7511_H
21#define ADV7511_H
22
23/* notify events */
24#define ADV7511_MONITOR_DETECT 0
25#define ADV7511_EDID_DETECT 1
26
27
28struct adv7511_monitor_detect {
29 int present;
30};
31
32struct adv7511_edid_detect {
33 int present;
34 int segment;
35};
36
37struct adv7511_cec_arg {
38 void *arg;
39 u32 f_flags;
40};
41
42struct adv7511_platform_data {
43 uint8_t i2c_edid;
44 uint8_t i2c_cec;
45 uint32_t cec_clk;
46};
47
48#endif
diff --git a/include/media/adv7842.h b/include/media/adv7842.h
new file mode 100644
index 000000000000..c02201d1c092
--- /dev/null
+++ b/include/media/adv7842.h
@@ -0,0 +1,226 @@
1/*
2 * adv7842 - Analog Devices ADV7842 video decoder driver
3 *
4 * Copyright 2013 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
5 *
6 * This program is free software; you may redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
12 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
13 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
14 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
15 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17 * SOFTWARE.
18 *
19 */
20
21#ifndef _ADV7842_
22#define _ADV7842_
23
24/* Analog input muxing modes (AFE register 0x02, [2:0]) */
25enum adv7842_ain_sel {
26 ADV7842_AIN1_2_3_NC_SYNC_1_2 = 0,
27 ADV7842_AIN4_5_6_NC_SYNC_2_1 = 1,
28 ADV7842_AIN7_8_9_NC_SYNC_3_1 = 2,
29 ADV7842_AIN10_11_12_NC_SYNC_4_1 = 3,
30 ADV7842_AIN9_4_5_6_SYNC_2_1 = 4,
31};
32
33/* Bus rotation and reordering (IO register 0x04, [7:5]) */
34enum adv7842_op_ch_sel {
35 ADV7842_OP_CH_SEL_GBR = 0,
36 ADV7842_OP_CH_SEL_GRB = 1,
37 ADV7842_OP_CH_SEL_BGR = 2,
38 ADV7842_OP_CH_SEL_RGB = 3,
39 ADV7842_OP_CH_SEL_BRG = 4,
40 ADV7842_OP_CH_SEL_RBG = 5,
41};
42
43/* Mode of operation */
44enum adv7842_mode {
45 ADV7842_MODE_SDP,
46 ADV7842_MODE_COMP,
47 ADV7842_MODE_RGB,
48 ADV7842_MODE_HDMI
49};
50
51/* Video standard select (IO register 0x00, [5:0]) */
52enum adv7842_vid_std_select {
53 /* SDP */
54 ADV7842_SDP_VID_STD_CVBS_SD_4x1 = 0x01,
55 ADV7842_SDP_VID_STD_YC_SD4_x1 = 0x09,
56 /* RGB */
57 ADV7842_RGB_VID_STD_AUTO_GRAPH_MODE = 0x07,
58 /* HDMI GR */
59 ADV7842_HDMI_GR_VID_STD_AUTO_GRAPH_MODE = 0x02,
60 /* HDMI COMP */
61 ADV7842_HDMI_COMP_VID_STD_HD_1250P = 0x1e,
62};
63
64/* Input Color Space (IO register 0x02, [7:4]) */
65enum adv7842_inp_color_space {
66 ADV7842_INP_COLOR_SPACE_LIM_RGB = 0,
67 ADV7842_INP_COLOR_SPACE_FULL_RGB = 1,
68 ADV7842_INP_COLOR_SPACE_LIM_YCbCr_601 = 2,
69 ADV7842_INP_COLOR_SPACE_LIM_YCbCr_709 = 3,
70 ADV7842_INP_COLOR_SPACE_XVYCC_601 = 4,
71 ADV7842_INP_COLOR_SPACE_XVYCC_709 = 5,
72 ADV7842_INP_COLOR_SPACE_FULL_YCbCr_601 = 6,
73 ADV7842_INP_COLOR_SPACE_FULL_YCbCr_709 = 7,
74 ADV7842_INP_COLOR_SPACE_AUTO = 0xf,
75};
76
77/* Select output format (IO register 0x03, [7:0]) */
78enum adv7842_op_format_sel {
79 ADV7842_OP_FORMAT_SEL_SDR_ITU656_8 = 0x00,
80 ADV7842_OP_FORMAT_SEL_SDR_ITU656_10 = 0x01,
81 ADV7842_OP_FORMAT_SEL_SDR_ITU656_12_MODE0 = 0x02,
82 ADV7842_OP_FORMAT_SEL_SDR_ITU656_12_MODE1 = 0x06,
83 ADV7842_OP_FORMAT_SEL_SDR_ITU656_12_MODE2 = 0x0a,
84 ADV7842_OP_FORMAT_SEL_DDR_422_8 = 0x20,
85 ADV7842_OP_FORMAT_SEL_DDR_422_10 = 0x21,
86 ADV7842_OP_FORMAT_SEL_DDR_422_12_MODE0 = 0x22,
87 ADV7842_OP_FORMAT_SEL_DDR_422_12_MODE1 = 0x23,
88 ADV7842_OP_FORMAT_SEL_DDR_422_12_MODE2 = 0x24,
89 ADV7842_OP_FORMAT_SEL_SDR_444_24 = 0x40,
90 ADV7842_OP_FORMAT_SEL_SDR_444_30 = 0x41,
91 ADV7842_OP_FORMAT_SEL_SDR_444_36_MODE0 = 0x42,
92 ADV7842_OP_FORMAT_SEL_DDR_444_24 = 0x60,
93 ADV7842_OP_FORMAT_SEL_DDR_444_30 = 0x61,
94 ADV7842_OP_FORMAT_SEL_DDR_444_36 = 0x62,
95 ADV7842_OP_FORMAT_SEL_SDR_ITU656_16 = 0x80,
96 ADV7842_OP_FORMAT_SEL_SDR_ITU656_20 = 0x81,
97 ADV7842_OP_FORMAT_SEL_SDR_ITU656_24_MODE0 = 0x82,
98 ADV7842_OP_FORMAT_SEL_SDR_ITU656_24_MODE1 = 0x86,
99 ADV7842_OP_FORMAT_SEL_SDR_ITU656_24_MODE2 = 0x8a,
100};
101
102enum adv7842_select_input {
103 ADV7842_SELECT_HDMI_PORT_A,
104 ADV7842_SELECT_HDMI_PORT_B,
105 ADV7842_SELECT_VGA_RGB,
106 ADV7842_SELECT_VGA_COMP,
107 ADV7842_SELECT_SDP_CVBS,
108 ADV7842_SELECT_SDP_YC,
109};
110
111struct adv7842_sdp_csc_coeff {
112 bool manual;
113 uint16_t scaling;
114 uint16_t A1;
115 uint16_t A2;
116 uint16_t A3;
117 uint16_t A4;
118 uint16_t B1;
119 uint16_t B2;
120 uint16_t B3;
121 uint16_t B4;
122 uint16_t C1;
123 uint16_t C2;
124 uint16_t C3;
125 uint16_t C4;
126};
127
128struct adv7842_sdp_io_sync_adjustment {
129 bool adjust;
130 uint16_t hs_beg;
131 uint16_t hs_width;
132 uint16_t de_beg;
133 uint16_t de_end;
134};
135
136/* Platform dependent definition */
137struct adv7842_platform_data {
138 /* connector - HDMI or DVI? */
139 unsigned connector_hdmi:1;
140
141 /* chip reset during probe */
142 unsigned chip_reset:1;
143
144 /* DIS_PWRDNB: 1 if the PWRDNB pin is unused and unconnected */
145 unsigned disable_pwrdnb:1;
146
147 /* DIS_CABLE_DET_RST: 1 if the 5V pins are unused and unconnected */
148 unsigned disable_cable_det_rst:1;
149
150 /* Analog input muxing mode */
151 enum adv7842_ain_sel ain_sel;
152
153 /* Bus rotation and reordering */
154 enum adv7842_op_ch_sel op_ch_sel;
155
156 /* Default mode */
157 enum adv7842_mode mode;
158
159 /* Video standard */
160 enum adv7842_vid_std_select vid_std_select;
161
162 /* Input Color Space */
163 enum adv7842_inp_color_space inp_color_space;
164
165 /* Select output format */
166 enum adv7842_op_format_sel op_format_sel;
167
168 /* IO register 0x02 */
169 unsigned alt_gamma:1;
170 unsigned op_656_range:1;
171 unsigned rgb_out:1;
172 unsigned alt_data_sat:1;
173
174 /* IO register 0x05 */
175 unsigned blank_data:1;
176 unsigned insert_av_codes:1;
177 unsigned replicate_av_codes:1;
178 unsigned invert_cbcr:1;
179
180 /* IO register 0x30 */
181 unsigned output_bus_lsb_to_msb:1;
182
183 /* IO register 0x14 */
184 struct {
185 unsigned data:2;
186 unsigned clock:2;
187 unsigned sync:2;
188 } drive_strength;
189
190 /* External RAM for 3-D comb or frame synchronizer */
191 unsigned sd_ram_size; /* ram size in MB */
192 unsigned sd_ram_ddr:1; /* ddr or sdr sdram */
193
194 /* Free run */
195 unsigned hdmi_free_run_mode;
196
197 struct adv7842_sdp_csc_coeff sdp_csc_coeff;
198
199 struct adv7842_sdp_io_sync_adjustment sdp_io_sync;
200
201 /* i2c addresses */
202 u8 i2c_sdp_io;
203 u8 i2c_sdp;
204 u8 i2c_cp;
205 u8 i2c_vdp;
206 u8 i2c_afe;
207 u8 i2c_hdmi;
208 u8 i2c_repeater;
209 u8 i2c_edid;
210 u8 i2c_infoframe;
211 u8 i2c_cec;
212 u8 i2c_avlink;
213};
214
215#define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000)
216#define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001)
217#define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002)
218
219/* notify events */
220#define ADV7842_FMT_CHANGE 1
221
222/* custom ioctl, used to test the external RAM that's used by the
223 * deinterlacer. */
224#define ADV7842_CMD_RAM_TEST _IO('V', BASE_VIDIOC_PRIVATE)
225
226#endif
diff --git a/include/media/davinci/vpif_types.h b/include/media/davinci/vpif_types.h
index 3882e0675ccf..3cb1704a0650 100644
--- a/include/media/davinci/vpif_types.h
+++ b/include/media/davinci/vpif_types.h
@@ -59,6 +59,8 @@ struct vpif_display_config {
59 int subdev_count; 59 int subdev_count;
60 struct vpif_display_chan_config chan_config[VPIF_DISPLAY_MAX_CHANNELS]; 60 struct vpif_display_chan_config chan_config[VPIF_DISPLAY_MAX_CHANNELS];
61 const char *card_name; 61 const char *card_name;
62 struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
63 int *asd_sizes; /* 0-terminated array of asd group sizes */
62}; 64};
63 65
64struct vpif_input { 66struct vpif_input {
@@ -81,5 +83,7 @@ struct vpif_capture_config {
81 struct vpif_subdev_info *subdev_info; 83 struct vpif_subdev_info *subdev_info;
82 int subdev_count; 84 int subdev_count;
83 const char *card_name; 85 const char *card_name;
86 struct v4l2_async_subdev **asd; /* Flat array, arranged in groups */
87 int *asd_sizes; /* 0-terminated array of asd group sizes */
84}; 88};
85#endif /* _VPIF_TYPES_H */ 89#endif /* _VPIF_TYPES_H */
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
index 168dd0b1bae2..78f0637ca68d 100644
--- a/include/media/lirc_dev.h
+++ b/include/media/lirc_dev.h
@@ -139,6 +139,7 @@ struct lirc_driver {
139 struct lirc_buffer *rbuf; 139 struct lirc_buffer *rbuf;
140 int (*set_use_inc) (void *data); 140 int (*set_use_inc) (void *data);
141 void (*set_use_dec) (void *data); 141 void (*set_use_dec) (void *data);
142 struct rc_dev *rdev;
142 const struct file_operations *fops; 143 const struct file_operations *fops;
143 struct device *dev; 144 struct device *dev;
144 struct module *owner; 145 struct module *owner;
diff --git a/include/media/media-entity.h b/include/media/media-entity.h
index 06bacf937d61..10df55187981 100644
--- a/include/media/media-entity.h
+++ b/include/media/media-entity.h
@@ -23,6 +23,7 @@
23#ifndef _MEDIA_ENTITY_H 23#ifndef _MEDIA_ENTITY_H
24#define _MEDIA_ENTITY_H 24#define _MEDIA_ENTITY_H
25 25
26#include <linux/bitops.h>
26#include <linux/list.h> 27#include <linux/list.h>
27#include <linux/media.h> 28#include <linux/media.h>
28 29
@@ -113,12 +114,15 @@ static inline u32 media_entity_subtype(struct media_entity *entity)
113} 114}
114 115
115#define MEDIA_ENTITY_ENUM_MAX_DEPTH 16 116#define MEDIA_ENTITY_ENUM_MAX_DEPTH 16
117#define MEDIA_ENTITY_ENUM_MAX_ID 64
116 118
117struct media_entity_graph { 119struct media_entity_graph {
118 struct { 120 struct {
119 struct media_entity *entity; 121 struct media_entity *entity;
120 int link; 122 int link;
121 } stack[MEDIA_ENTITY_ENUM_MAX_DEPTH]; 123 } stack[MEDIA_ENTITY_ENUM_MAX_DEPTH];
124
125 DECLARE_BITMAP(entities, MEDIA_ENTITY_ENUM_MAX_ID);
122 int top; 126 int top;
123}; 127};
124 128
diff --git a/include/media/mt9v032.h b/include/media/mt9v032.h
index 78fd39eac219..12175a63c5b2 100644
--- a/include/media/mt9v032.h
+++ b/include/media/mt9v032.h
@@ -1,13 +1,9 @@
1#ifndef _MEDIA_MT9V032_H 1#ifndef _MEDIA_MT9V032_H
2#define _MEDIA_MT9V032_H 2#define _MEDIA_MT9V032_H
3 3
4struct v4l2_subdev;
5
6struct mt9v032_platform_data { 4struct mt9v032_platform_data {
7 unsigned int clk_pol:1; 5 unsigned int clk_pol:1;
8 6
9 void (*set_clock)(struct v4l2_subdev *subdev, unsigned int rate);
10
11 const s64 *link_freqs; 7 const s64 *link_freqs;
12 s64 link_def_freq; 8 s64 link_def_freq;
13}; 9};
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index 06a75deff553..2f6f1f78d958 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -101,6 +101,7 @@ struct rc_dev {
101 bool idle; 101 bool idle;
102 u64 allowed_protos; 102 u64 allowed_protos;
103 u64 enabled_protocols; 103 u64 enabled_protocols;
104 u32 users;
104 u32 scanmask; 105 u32 scanmask;
105 void *priv; 106 void *priv;
106 spinlock_t keylock; 107 spinlock_t keylock;
@@ -142,6 +143,9 @@ void rc_free_device(struct rc_dev *dev);
142int rc_register_device(struct rc_dev *dev); 143int rc_register_device(struct rc_dev *dev);
143void rc_unregister_device(struct rc_dev *dev); 144void rc_unregister_device(struct rc_dev *dev);
144 145
146int rc_open(struct rc_dev *rdev);
147void rc_close(struct rc_dev *rdev);
148
145void rc_repeat(struct rc_dev *dev); 149void rc_repeat(struct rc_dev *dev);
146void rc_keydown(struct rc_dev *dev, int scancode, u8 toggle); 150void rc_keydown(struct rc_dev *dev, int scancode, u8 toggle);
147void rc_keydown_notimeout(struct rc_dev *dev, int scancode, u8 toggle); 151void rc_keydown_notimeout(struct rc_dev *dev, int scancode, u8 toggle);
diff --git a/include/media/saa7115.h b/include/media/saa7115.h
index 407918625c80..76911e71de17 100644
--- a/include/media/saa7115.h
+++ b/include/media/saa7115.h
@@ -47,9 +47,11 @@
47#define SAA7111_FMT_YUV411 0xc0 47#define SAA7111_FMT_YUV411 0xc0
48 48
49/* config flags */ 49/* config flags */
50/* Register 0x85 should set bit 0 to 0 (it's 1 by default). This bit 50/*
51 * Register 0x85 should set bit 0 to 0 (it's 1 by default). This bit
51 * controls the IDQ signal polarity which is set to 'inverted' if the bit 52 * controls the IDQ signal polarity which is set to 'inverted' if the bit
52 * it 1 and to 'default' if it is 0. */ 53 * it 1 and to 'default' if it is 0.
54 */
53#define SAA7115_IDQ_IS_DEFAULT (1 << 0) 55#define SAA7115_IDQ_IS_DEFAULT (1 << 0)
54 56
55/* s_crystal_freq values and flags */ 57/* s_crystal_freq values and flags */
@@ -64,5 +66,76 @@
64#define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */ 66#define SAA7115_FREQ_FL_APLL (1 << 2) /* SA 3A[3], APLL, SAA7114/5 only */
65#define SAA7115_FREQ_FL_DOUBLE_ASCLK (1 << 3) /* SA 39, LRDIV, SAA7114/5 only */ 67#define SAA7115_FREQ_FL_DOUBLE_ASCLK (1 << 3) /* SA 39, LRDIV, SAA7114/5 only */
66 68
69/* ===== SAA7113 Config enums ===== */
70
71/* Register 0x08 "Horizontal time constant" [Bit 3..4]:
72 * Should be set to "Fast Locking Mode" according to the datasheet,
73 * and that is the default setting in the gm7113c_init table.
74 * saa7113_init sets this value to "VTR Mode". */
75enum saa7113_r08_htc {
76 SAA7113_HTC_TV_MODE = 0x00,
77 SAA7113_HTC_VTR_MODE, /* Default for saa7113_init */
78 SAA7113_HTC_FAST_LOCKING_MODE = 0x03 /* Default for gm7113c_init */
79};
80
81/* Register 0x10 "Output format selection" [Bit 6..7]:
82 * Defaults to ITU_656 as specified in datasheet. */
83enum saa7113_r10_ofts {
84 SAA7113_OFTS_ITU_656 = 0x0, /* Default */
85 SAA7113_OFTS_VFLAG_BY_VREF,
86 SAA7113_OFTS_VFLAG_BY_DATA_TYPE
87};
88
89/*
90 * Register 0x12 "Output control" [Bit 0..3 Or Bit 4..7]:
91 * This is used to select what data is output on the RTS0 and RTS1 pins.
92 * RTS1 [Bit 4..7] Defaults to DOT_IN. (This value can not be set for RTS0)
93 * RTS0 [Bit 0..3] Defaults to VIPB in gm7113c_init as specified
94 * in the datasheet, but is set to HREF_HS in the saa7113_init table.
95 */
96enum saa7113_r12_rts {
97 SAA7113_RTS_DOT_IN = 0, /* OBS: Only for RTS1 (Default RTS1) */
98 SAA7113_RTS_VIPB, /* Default RTS0 For gm7113c_init */
99 SAA7113_RTS_GPSW,
100 SAA7115_RTS_HL,
101 SAA7113_RTS_VL,
102 SAA7113_RTS_DL,
103 SAA7113_RTS_PLIN,
104 SAA7113_RTS_HREF_HS, /* Default RTS0 For saa7113_init */
105 SAA7113_RTS_HS,
106 SAA7113_RTS_HQ,
107 SAA7113_RTS_ODD,
108 SAA7113_RTS_VS,
109 SAA7113_RTS_V123,
110 SAA7113_RTS_VGATE,
111 SAA7113_RTS_VREF,
112 SAA7113_RTS_FID
113};
114
115/**
116 * struct saa7115_platform_data - Allow overriding default initialization
117 *
118 * @saa7113_force_gm7113c_init: Force the use of the gm7113c_init table
119 * instead of saa7113_init table
120 * (saa7113 only)
121 * @saa7113_r08_htc: [R_08 - Bit 3..4]
122 * @saa7113_r10_vrln: [R_10 - Bit 3]
123 * default: Disabled for gm7113c_init
124 * Enabled for saa7113c_init
125 * @saa7113_r10_ofts: [R_10 - Bit 6..7]
126 * @saa7113_r12_rts0: [R_12 - Bit 0..3]
127 * @saa7113_r12_rts1: [R_12 - Bit 4..7]
128 * @saa7113_r13_adlsb: [R_13 - Bit 7] - default: disabled
129 */
130struct saa7115_platform_data {
131 bool saa7113_force_gm7113c_init;
132 enum saa7113_r08_htc *saa7113_r08_htc;
133 bool *saa7113_r10_vrln;
134 enum saa7113_r10_ofts *saa7113_r10_ofts;
135 enum saa7113_r12_rts *saa7113_r12_rts0;
136 enum saa7113_r12_rts *saa7113_r12_rts1;
137 bool *saa7113_r13_adlsb;
138};
139
67#endif 140#endif
68 141
diff --git a/include/media/smiapp.h b/include/media/smiapp.h
index 07f96a89e189..0b8f124a630c 100644
--- a/include/media/smiapp.h
+++ b/include/media/smiapp.h
@@ -77,7 +77,6 @@ struct smiapp_platform_data {
77 struct smiapp_flash_strobe_parms *strobe_setup; 77 struct smiapp_flash_strobe_parms *strobe_setup;
78 78
79 int (*set_xclk)(struct v4l2_subdev *sd, int hz); 79 int (*set_xclk)(struct v4l2_subdev *sd, int hz);
80 char *ext_clk_name;
81 int xshutdown; /* gpio or SMIAPP_NO_XSHUTDOWN */ 80 int xshutdown; /* gpio or SMIAPP_NO_XSHUTDOWN */
82}; 81};
83 82
diff --git a/include/sound/tea575x-tuner.h b/include/media/tea575x.h
index 098c4de44945..2d4fa59db902 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/media/tea575x.h
@@ -71,6 +71,7 @@ struct snd_tea575x {
71 int (*ext_init)(struct snd_tea575x *tea); 71 int (*ext_init)(struct snd_tea575x *tea);
72}; 72};
73 73
74int snd_tea575x_hw_init(struct snd_tea575x *tea);
74int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner); 75int snd_tea575x_init(struct snd_tea575x *tea, struct module *owner);
75void snd_tea575x_exit(struct snd_tea575x *tea); 76void snd_tea575x_exit(struct snd_tea575x *tea);
76void snd_tea575x_set_freq(struct snd_tea575x *tea); 77void snd_tea575x_set_freq(struct snd_tea575x *tea);
diff --git a/include/media/tveeprom.h b/include/media/tveeprom.h
index 4a1191abd936..f7119ee3977b 100644
--- a/include/media/tveeprom.h
+++ b/include/media/tveeprom.h
@@ -12,6 +12,8 @@ enum tveeprom_audio_processor {
12 TVEEPROM_AUDPROC_OTHER, 12 TVEEPROM_AUDPROC_OTHER,
13}; 13};
14 14
15#include <linux/if_ether.h>
16
15struct tveeprom { 17struct tveeprom {
16 u32 has_radio; 18 u32 has_radio;
17 /* If has_ir == 0, then it is unknown what the IR capabilities are, 19 /* If has_ir == 0, then it is unknown what the IR capabilities are,
@@ -40,7 +42,7 @@ struct tveeprom {
40 u32 revision; 42 u32 revision;
41 u32 serial_number; 43 u32 serial_number;
42 char rev_str[5]; 44 char rev_str[5];
43 u8 MAC_address[6]; 45 u8 MAC_address[ETH_ALEN];
44}; 46};
45 47
46void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, 48void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
diff --git a/include/media/v4l2-async.h b/include/media/v4l2-async.h
index c3ec6ac75f7e..768356917bea 100644
--- a/include/media/v4l2-async.h
+++ b/include/media/v4l2-async.h
@@ -15,6 +15,7 @@
15#include <linux/mutex.h> 15#include <linux/mutex.h>
16 16
17struct device; 17struct device;
18struct device_node;
18struct v4l2_device; 19struct v4l2_device;
19struct v4l2_subdev; 20struct v4l2_subdev;
20struct v4l2_async_notifier; 21struct v4l2_async_notifier;
@@ -22,10 +23,11 @@ struct v4l2_async_notifier;
22/* A random max subdevice number, used to allocate an array on stack */ 23/* A random max subdevice number, used to allocate an array on stack */
23#define V4L2_MAX_SUBDEVS 128U 24#define V4L2_MAX_SUBDEVS 128U
24 25
25enum v4l2_async_bus_type { 26enum v4l2_async_match_type {
26 V4L2_ASYNC_BUS_CUSTOM, 27 V4L2_ASYNC_MATCH_CUSTOM,
27 V4L2_ASYNC_BUS_PLATFORM, 28 V4L2_ASYNC_MATCH_DEVNAME,
28 V4L2_ASYNC_BUS_I2C, 29 V4L2_ASYNC_MATCH_I2C,
30 V4L2_ASYNC_MATCH_OF,
29}; 31};
30 32
31/** 33/**
@@ -36,11 +38,14 @@ enum v4l2_async_bus_type {
36 * probed, to a notifier->waiting list 38 * probed, to a notifier->waiting list
37 */ 39 */
38struct v4l2_async_subdev { 40struct v4l2_async_subdev {
39 enum v4l2_async_bus_type bus_type; 41 enum v4l2_async_match_type match_type;
40 union { 42 union {
41 struct { 43 struct {
44 const struct device_node *node;
45 } of;
46 struct {
42 const char *name; 47 const char *name;
43 } platform; 48 } device_name;
44 struct { 49 struct {
45 int adapter_id; 50 int adapter_id;
46 unsigned short address; 51 unsigned short address;
@@ -57,25 +62,12 @@ struct v4l2_async_subdev {
57}; 62};
58 63
59/** 64/**
60 * v4l2_async_subdev_list - provided by subdevices
61 * @list: links struct v4l2_async_subdev_list objects to a global list
62 * before probing, and onto notifier->done after probing
63 * @asd: pointer to respective struct v4l2_async_subdev
64 * @notifier: pointer to managing notifier
65 */
66struct v4l2_async_subdev_list {
67 struct list_head list;
68 struct v4l2_async_subdev *asd;
69 struct v4l2_async_notifier *notifier;
70};
71
72/**
73 * v4l2_async_notifier - v4l2_device notifier data 65 * v4l2_async_notifier - v4l2_device notifier data
74 * @num_subdevs:number of subdevices 66 * @num_subdevs:number of subdevices
75 * @subdev: array of pointers to subdevice descriptors 67 * @subdevs: array of pointers to subdevice descriptors
76 * @v4l2_dev: pointer to struct v4l2_device 68 * @v4l2_dev: pointer to struct v4l2_device
77 * @waiting: list of struct v4l2_async_subdev, waiting for their drivers 69 * @waiting: list of struct v4l2_async_subdev, waiting for their drivers
78 * @done: list of struct v4l2_async_subdev_list, already probed 70 * @done: list of struct v4l2_subdev, already probed
79 * @list: member in a global list of notifiers 71 * @list: member in a global list of notifiers
80 * @bound: a subdevice driver has successfully probed one of subdevices 72 * @bound: a subdevice driver has successfully probed one of subdevices
81 * @complete: all subdevices have been probed successfully 73 * @complete: all subdevices have been probed successfully
@@ -83,7 +75,7 @@ struct v4l2_async_subdev_list {
83 */ 75 */
84struct v4l2_async_notifier { 76struct v4l2_async_notifier {
85 unsigned int num_subdevs; 77 unsigned int num_subdevs;
86 struct v4l2_async_subdev **subdev; 78 struct v4l2_async_subdev **subdevs;
87 struct v4l2_device *v4l2_dev; 79 struct v4l2_device *v4l2_dev;
88 struct list_head waiting; 80 struct list_head waiting;
89 struct list_head done; 81 struct list_head done;
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 015ff82da73c..16550c439008 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -86,6 +86,7 @@ int v4l2_ctrl_check(struct v4l2_ext_control *ctrl, struct v4l2_queryctrl *qctrl,
86 const char * const *menu_items); 86 const char * const *menu_items);
87const char *v4l2_ctrl_get_name(u32 id); 87const char *v4l2_ctrl_get_name(u32 id);
88const char * const *v4l2_ctrl_get_menu(u32 id); 88const char * const *v4l2_ctrl_get_menu(u32 id);
89const s64 const *v4l2_ctrl_get_int_menu(u32 id, u32 *len);
89int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def); 90int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 step, s32 def);
90int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, 91int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu,
91 struct v4l2_queryctrl *qctrl, const char * const *menu_items); 92 struct v4l2_queryctrl *qctrl, const char * const *menu_items);
@@ -201,19 +202,6 @@ const struct v4l2_frmsize_discrete *v4l2_find_nearest_format(
201 const struct v4l2_discrete_probe *probe, 202 const struct v4l2_discrete_probe *probe,
202 s32 width, s32 height); 203 s32 width, s32 height);
203 204
204bool v4l_match_dv_timings(const struct v4l2_dv_timings *t1,
205 const struct v4l2_dv_timings *t2,
206 unsigned pclock_delta);
207
208bool v4l2_detect_cvt(unsigned frame_height, unsigned hfreq, unsigned vsync,
209 u32 polarities, struct v4l2_dv_timings *fmt);
210
211bool v4l2_detect_gtf(unsigned frame_height, unsigned hfreq, unsigned vsync,
212 u32 polarities, struct v4l2_fract aspect,
213 struct v4l2_dv_timings *fmt);
214
215struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait);
216
217void v4l2_get_timestamp(struct timeval *tv); 205void v4l2_get_timestamp(struct timeval *tv);
218 206
219#endif /* V4L2_COMMON_H_ */ 207#endif /* V4L2_COMMON_H_ */
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 7343a27fe819..47ada23345a1 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -22,6 +22,7 @@
22#define _V4L2_CTRLS_H 22#define _V4L2_CTRLS_H
23 23
24#include <linux/list.h> 24#include <linux/list.h>
25#include <linux/mutex.h>
25#include <linux/videodev2.h> 26#include <linux/videodev2.h>
26 27
27/* forward references */ 28/* forward references */
diff --git a/include/media/v4l2-dv-timings.h b/include/media/v4l2-dv-timings.h
new file mode 100644
index 000000000000..4becc6716393
--- /dev/null
+++ b/include/media/v4l2-dv-timings.h
@@ -0,0 +1,161 @@
1/*
2 * v4l2-dv-timings - Internal header with dv-timings helper functions
3 *
4 * Copyright 2013 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
5 *
6 * This program is free software; you may redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
11 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
12 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
13 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
14 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
15 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17 * SOFTWARE.
18 *
19 */
20
21#ifndef __V4L2_DV_TIMINGS_H
22#define __V4L2_DV_TIMINGS_H
23
24#include <linux/videodev2.h>
25
26/** v4l2_dv_timings_presets: list of all dv_timings presets.
27 */
28extern const struct v4l2_dv_timings v4l2_dv_timings_presets[];
29
30/** v4l2_check_dv_timings_fnc - timings check callback
31 * @t: the v4l2_dv_timings struct.
32 * @handle: a handle from the driver.
33 *
34 * Returns true if the given timings are valid.
35 */
36typedef bool v4l2_check_dv_timings_fnc(const struct v4l2_dv_timings *t, void *handle);
37
38/** v4l2_valid_dv_timings() - are these timings valid?
39 * @t: the v4l2_dv_timings struct.
40 * @cap: the v4l2_dv_timings_cap capabilities.
41 * @fnc: callback to check if this timing is OK. May be NULL.
42 * @fnc_handle: a handle that is passed on to @fnc.
43 *
44 * Returns true if the given dv_timings struct is supported by the
45 * hardware capabilities and the callback function (if non-NULL), returns
46 * false otherwise.
47 */
48bool v4l2_valid_dv_timings(const struct v4l2_dv_timings *t,
49 const struct v4l2_dv_timings_cap *cap,
50 v4l2_check_dv_timings_fnc fnc,
51 void *fnc_handle);
52
53/** v4l2_enum_dv_timings_cap() - Helper function to enumerate possible DV timings based on capabilities
54 * @t: the v4l2_enum_dv_timings struct.
55 * @cap: the v4l2_dv_timings_cap capabilities.
56 * @fnc: callback to check if this timing is OK. May be NULL.
57 * @fnc_handle: a handle that is passed on to @fnc.
58 *
59 * This enumerates dv_timings using the full list of possible CEA-861 and DMT
60 * timings, filtering out any timings that are not supported based on the
61 * hardware capabilities and the callback function (if non-NULL).
62 *
63 * If a valid timing for the given index is found, it will fill in @t and
64 * return 0, otherwise it returns -EINVAL.
65 */
66int v4l2_enum_dv_timings_cap(struct v4l2_enum_dv_timings *t,
67 const struct v4l2_dv_timings_cap *cap,
68 v4l2_check_dv_timings_fnc fnc,
69 void *fnc_handle);
70
71/** v4l2_find_dv_timings_cap() - Find the closest timings struct
72 * @t: the v4l2_enum_dv_timings struct.
73 * @cap: the v4l2_dv_timings_cap capabilities.
74 * @pclock_delta: maximum delta between t->pixelclock and the timing struct
75 * under consideration.
76 * @fnc: callback to check if a given timings struct is OK. May be NULL.
77 * @fnc_handle: a handle that is passed on to @fnc.
78 *
79 * This function tries to map the given timings to an entry in the
80 * full list of possible CEA-861 and DMT timings, filtering out any timings
81 * that are not supported based on the hardware capabilities and the callback
82 * function (if non-NULL).
83 *
84 * On success it will fill in @t with the found timings and it returns true.
85 * On failure it will return false.
86 */
87bool v4l2_find_dv_timings_cap(struct v4l2_dv_timings *t,
88 const struct v4l2_dv_timings_cap *cap,
89 unsigned pclock_delta,
90 v4l2_check_dv_timings_fnc fnc,
91 void *fnc_handle);
92
93/** v4l2_match_dv_timings() - do two timings match?
94 * @measured: the measured timings data.
95 * @standard: the timings according to the standard.
96 * @pclock_delta: maximum delta in Hz between standard->pixelclock and
97 * the measured timings.
98 *
99 * Returns true if the two timings match, returns false otherwise.
100 */
101bool v4l2_match_dv_timings(const struct v4l2_dv_timings *measured,
102 const struct v4l2_dv_timings *standard,
103 unsigned pclock_delta);
104
105/** v4l2_print_dv_timings() - log the contents of a dv_timings struct
106 * @dev_prefix:device prefix for each log line.
107 * @prefix: additional prefix for each log line, may be NULL.
108 * @t: the timings data.
109 * @detailed: if true, give a detailed log.
110 */
111void v4l2_print_dv_timings(const char *dev_prefix, const char *prefix,
112 const struct v4l2_dv_timings *t, bool detailed);
113
114/** v4l2_detect_cvt - detect if the given timings follow the CVT standard
115 * @frame_height - the total height of the frame (including blanking) in lines.
116 * @hfreq - the horizontal frequency in Hz.
117 * @vsync - the height of the vertical sync in lines.
118 * @polarities - the horizontal and vertical polarities (same as struct
119 * v4l2_bt_timings polarities).
120 * @fmt - the resulting timings.
121 *
122 * This function will attempt to detect if the given values correspond to a
123 * valid CVT format. If so, then it will return true, and fmt will be filled
124 * in with the found CVT timings.
125 */
126bool v4l2_detect_cvt(unsigned frame_height, unsigned hfreq, unsigned vsync,
127 u32 polarities, struct v4l2_dv_timings *fmt);
128
129/** v4l2_detect_gtf - detect if the given timings follow the GTF standard
130 * @frame_height - the total height of the frame (including blanking) in lines.
131 * @hfreq - the horizontal frequency in Hz.
132 * @vsync - the height of the vertical sync in lines.
133 * @polarities - the horizontal and vertical polarities (same as struct
134 * v4l2_bt_timings polarities).
135 * @aspect - preferred aspect ratio. GTF has no method of determining the
136 * aspect ratio in order to derive the image width from the
137 * image height, so it has to be passed explicitly. Usually
138 * the native screen aspect ratio is used for this. If it
139 * is not filled in correctly, then 16:9 will be assumed.
140 * @fmt - the resulting timings.
141 *
142 * This function will attempt to detect if the given values correspond to a
143 * valid GTF format. If so, then it will return true, and fmt will be filled
144 * in with the found GTF timings.
145 */
146bool v4l2_detect_gtf(unsigned frame_height, unsigned hfreq, unsigned vsync,
147 u32 polarities, struct v4l2_fract aspect,
148 struct v4l2_dv_timings *fmt);
149
150/** v4l2_calc_aspect_ratio - calculate the aspect ratio based on bytes
151 * 0x15 and 0x16 from the EDID.
152 * @hor_landscape - byte 0x15 from the EDID.
153 * @vert_portrait - byte 0x16 from the EDID.
154 *
155 * Determines the aspect ratio from the EDID.
156 * See VESA Enhanced EDID standard, release A, rev 2, section 3.6.2:
157 * "Horizontal and Vertical Screen Size or Aspect Ratio"
158 */
159struct v4l2_fract v4l2_calc_aspect_ratio(u8 hor_landscape, u8 vert_portrait);
160
161#endif
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 83ae07e53350..395c4a95a42a 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -40,6 +40,9 @@
40#define V4L2_MBUS_FIELD_EVEN_HIGH (1 << 10) 40#define V4L2_MBUS_FIELD_EVEN_HIGH (1 << 10)
41/* FIELD = 1/0 - Field1 (odd)/Field2 (even) */ 41/* FIELD = 1/0 - Field1 (odd)/Field2 (even) */
42#define V4L2_MBUS_FIELD_EVEN_LOW (1 << 11) 42#define V4L2_MBUS_FIELD_EVEN_LOW (1 << 11)
43/* Active state of Sync-on-green (SoG) signal, 0/1 for LOW/HIGH respectively. */
44#define V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH (1 << 12)
45#define V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW (1 << 13)
43 46
44/* Serial flags */ 47/* Serial flags */
45/* How many lanes the client can use */ 48/* How many lanes the client can use */
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h
index 0f4555b2a31b..44542a20ab81 100644
--- a/include/media/v4l2-mem2mem.h
+++ b/include/media/v4l2-mem2mem.h
@@ -60,6 +60,7 @@ struct v4l2_m2m_queue_ctx {
60 struct list_head rdy_queue; 60 struct list_head rdy_queue;
61 spinlock_t rdy_spinlock; 61 spinlock_t rdy_spinlock;
62 u8 num_rdy; 62 u8 num_rdy;
63 bool buffered;
63}; 64};
64 65
65struct v4l2_m2m_ctx { 66struct v4l2_m2m_ctx {
@@ -134,6 +135,18 @@ struct v4l2_m2m_ctx *v4l2_m2m_ctx_init(struct v4l2_m2m_dev *m2m_dev,
134 void *drv_priv, 135 void *drv_priv,
135 int (*queue_init)(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq)); 136 int (*queue_init)(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq));
136 137
138static inline void v4l2_m2m_set_src_buffered(struct v4l2_m2m_ctx *m2m_ctx,
139 bool buffered)
140{
141 m2m_ctx->out_q_ctx.buffered = buffered;
142}
143
144static inline void v4l2_m2m_set_dst_buffered(struct v4l2_m2m_ctx *m2m_ctx,
145 bool buffered)
146{
147 m2m_ctx->cap_q_ctx.buffered = buffered;
148}
149
137void v4l2_m2m_ctx_release(struct v4l2_m2m_ctx *m2m_ctx); 150void v4l2_m2m_ctx_release(struct v4l2_m2m_ctx *m2m_ctx);
138 151
139void v4l2_m2m_buf_queue(struct v4l2_m2m_ctx *m2m_ctx, struct vb2_buffer *vb); 152void v4l2_m2m_buf_queue(struct v4l2_m2m_ctx *m2m_ctx, struct vb2_buffer *vb);
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 3250cc5e7925..bfda0fe9aeb0 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -586,15 +586,14 @@ struct v4l2_subdev {
586 struct video_device *devnode; 586 struct video_device *devnode;
587 /* pointer to the physical device, if any */ 587 /* pointer to the physical device, if any */
588 struct device *dev; 588 struct device *dev;
589 struct v4l2_async_subdev_list asdl; 589 /* Links this subdev to a global subdev_list or @notifier->done list. */
590 struct list_head async_list;
591 /* Pointer to respective struct v4l2_async_subdev. */
592 struct v4l2_async_subdev *asd;
593 /* Pointer to the managing notifier. */
594 struct v4l2_async_notifier *notifier;
590}; 595};
591 596
592static inline struct v4l2_subdev *v4l2_async_to_subdev(
593 struct v4l2_async_subdev_list *asdl)
594{
595 return container_of(asdl, struct v4l2_subdev, asdl);
596}
597
598#define media_entity_to_v4l2_subdev(ent) \ 597#define media_entity_to_v4l2_subdev(ent) \
599 container_of(ent, struct v4l2_subdev, entity) 598 container_of(ent, struct v4l2_subdev, entity)
600#define vdev_to_v4l2_subdev(vdev) \ 599#define vdev_to_v4l2_subdev(vdev) \
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index d88a098d1aff..6781258d0b67 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -219,8 +219,9 @@ struct vb2_buffer {
219 * configured format and *num_buffers is the total number 219 * configured format and *num_buffers is the total number
220 * of buffers, that are being allocated. When called from 220 * of buffers, that are being allocated. When called from
221 * VIDIOC_CREATE_BUFS, fmt != NULL and it describes the 221 * VIDIOC_CREATE_BUFS, fmt != NULL and it describes the
222 * target frame format. In this case *num_buffers are being 222 * target frame format (if the format isn't valid the
223 * allocated additionally to q->num_buffers. 223 * callback must return -EINVAL). In this case *num_buffers
224 * are being allocated additionally to q->num_buffers.
224 * @wait_prepare: release any locks taken while calling vb2 functions; 225 * @wait_prepare: release any locks taken while calling vb2 functions;
225 * it is called before an ioctl needs to wait for a new 226 * it is called before an ioctl needs to wait for a new
226 * buffer to arrive; required to avoid a deadlock in 227 * buffer to arrive; required to avoid a deadlock in
@@ -236,8 +237,10 @@ struct vb2_buffer {
236 * @buf_prepare: called every time the buffer is queued from userspace 237 * @buf_prepare: called every time the buffer is queued from userspace
237 * and from the VIDIOC_PREPARE_BUF ioctl; drivers may 238 * and from the VIDIOC_PREPARE_BUF ioctl; drivers may
238 * perform any initialization required before each hardware 239 * perform any initialization required before each hardware
239 * operation in this callback; if an error is returned, the 240 * operation in this callback; drivers that support
240 * buffer will not be queued in driver; optional 241 * VIDIOC_CREATE_BUFS must also validate the buffer size;
242 * if an error is returned, the buffer will not be queued
243 * in driver; optional
241 * @buf_finish: called before every dequeue of the buffer back to 244 * @buf_finish: called before every dequeue of the buffer back to
242 * userspace; drivers may perform any operations required 245 * userspace; drivers may perform any operations required
243 * before userspace accesses the buffer; optional 246 * before userspace accesses the buffer; optional
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index d9fa68f26c41..9a36d9297114 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -40,8 +40,6 @@
40 * @close: member function to discard a connection on this transport 40 * @close: member function to discard a connection on this transport
41 * @request: member function to issue a request to the transport 41 * @request: member function to issue a request to the transport
42 * @cancel: member function to cancel a request (if it hasn't been sent) 42 * @cancel: member function to cancel a request (if it hasn't been sent)
43 * @cancelled: member function to notify that a cancelled request will not
44 * not receive a reply
45 * 43 *
46 * This is the basic API for a transport module which is registered by the 44 * This is the basic API for a transport module which is registered by the
47 * transport module with the 9P core network module and used by the client 45 * transport module with the 9P core network module and used by the client
@@ -60,7 +58,6 @@ struct p9_trans_module {
60 void (*close) (struct p9_client *); 58 void (*close) (struct p9_client *);
61 int (*request) (struct p9_client *, struct p9_req_t *req); 59 int (*request) (struct p9_client *, struct p9_req_t *req);
62 int (*cancel) (struct p9_client *, struct p9_req_t *req); 60 int (*cancel) (struct p9_client *, struct p9_req_t *req);
63 int (*cancelled)(struct p9_client *, struct p9_req_t *req);
64 int (*zc_request)(struct p9_client *, struct p9_req_t *, 61 int (*zc_request)(struct p9_client *, struct p9_req_t *,
65 char *, char *, int , int, int, int); 62 char *, char *, int , int, int, int);
66}; 63};
diff --git a/include/net/act_api.h b/include/net/act_api.h
index b8ffac7b6bab..9e90fdff470d 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -82,36 +82,36 @@ struct tc_action_ops {
82 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *); 82 int (*walk)(struct sk_buff *, struct netlink_callback *, int, struct tc_action *);
83}; 83};
84 84
85extern struct tcf_common *tcf_hash_lookup(u32 index, 85struct tcf_common *tcf_hash_lookup(u32 index, struct tcf_hashinfo *hinfo);
86 struct tcf_hashinfo *hinfo); 86void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo);
87extern void tcf_hash_destroy(struct tcf_common *p, struct tcf_hashinfo *hinfo); 87int tcf_hash_release(struct tcf_common *p, int bind,
88extern int tcf_hash_release(struct tcf_common *p, int bind, 88 struct tcf_hashinfo *hinfo);
89 struct tcf_hashinfo *hinfo); 89int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb,
90extern int tcf_generic_walker(struct sk_buff *skb, struct netlink_callback *cb, 90 int type, struct tc_action *a);
91 int type, struct tc_action *a); 91u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo);
92extern u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo); 92int tcf_hash_search(struct tc_action *a, u32 index);
93extern int tcf_hash_search(struct tc_action *a, u32 index); 93struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a,
94extern struct tcf_common *tcf_hash_check(u32 index, struct tc_action *a, 94 int bind, struct tcf_hashinfo *hinfo);
95 int bind, struct tcf_hashinfo *hinfo); 95struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est,
96extern struct tcf_common *tcf_hash_create(u32 index, struct nlattr *est, 96 struct tc_action *a, int size,
97 struct tc_action *a, int size, 97 int bind, u32 *idx_gen,
98 int bind, u32 *idx_gen, 98 struct tcf_hashinfo *hinfo);
99 struct tcf_hashinfo *hinfo); 99void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
100extern void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
101 100
102extern int tcf_register_action(struct tc_action_ops *a); 101int tcf_register_action(struct tc_action_ops *a);
103extern int tcf_unregister_action(struct tc_action_ops *a); 102int tcf_unregister_action(struct tc_action_ops *a);
104extern void tcf_action_destroy(struct tc_action *a, int bind); 103void tcf_action_destroy(struct tc_action *a, int bind);
105extern int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res); 104int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a,
106extern struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla, 105 struct tcf_result *res);
107 struct nlattr *est, char *n, int ovr, 106struct tc_action *tcf_action_init(struct net *net, struct nlattr *nla,
108 int bind); 107 struct nlattr *est, char *n, int ovr,
109extern struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla, 108 int bind);
110 struct nlattr *est, char *n, int ovr, 109struct tc_action *tcf_action_init_1(struct net *net, struct nlattr *nla,
111 int bind); 110 struct nlattr *est, char *n, int ovr,
112extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); 111 int bind);
113extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); 112int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int);
114extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); 113int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
115extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *, int); 114int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
115int tcf_action_copy_stats(struct sk_buff *, struct tc_action *, int);
116#endif /* CONFIG_NET_CLS_ACT */ 116#endif /* CONFIG_NET_CLS_ACT */
117#endif 117#endif
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index c7b181cb47a6..fb314de2b61b 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -53,51 +53,36 @@ struct prefix_info {
53#define IN6_ADDR_HSIZE_SHIFT 4 53#define IN6_ADDR_HSIZE_SHIFT 4
54#define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT) 54#define IN6_ADDR_HSIZE (1 << IN6_ADDR_HSIZE_SHIFT)
55 55
56extern int addrconf_init(void); 56int addrconf_init(void);
57extern void addrconf_cleanup(void); 57void addrconf_cleanup(void);
58 58
59extern int addrconf_add_ifaddr(struct net *net, 59int addrconf_add_ifaddr(struct net *net, void __user *arg);
60 void __user *arg); 60int addrconf_del_ifaddr(struct net *net, void __user *arg);
61extern int addrconf_del_ifaddr(struct net *net, 61int addrconf_set_dstaddr(struct net *net, void __user *arg);
62 void __user *arg);
63extern int addrconf_set_dstaddr(struct net *net,
64 void __user *arg);
65 62
66extern int ipv6_chk_addr(struct net *net, 63int ipv6_chk_addr(struct net *net, const struct in6_addr *addr,
67 const struct in6_addr *addr, 64 const struct net_device *dev, int strict);
68 const struct net_device *dev,
69 int strict);
70 65
71#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE) 66#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
72extern int ipv6_chk_home_addr(struct net *net, 67int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr);
73 const struct in6_addr *addr);
74#endif 68#endif
75 69
76extern int ipv6_chk_prefix(const struct in6_addr *addr, 70int ipv6_chk_prefix(const struct in6_addr *addr, struct net_device *dev);
77 struct net_device *dev); 71
78 72struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
79extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, 73 const struct in6_addr *addr,
80 const struct in6_addr *addr, 74 struct net_device *dev, int strict);
81 struct net_device *dev, 75
82 int strict); 76int ipv6_dev_get_saddr(struct net *net, const struct net_device *dev,
83 77 const struct in6_addr *daddr, unsigned int srcprefs,
84extern int ipv6_dev_get_saddr(struct net *net, 78 struct in6_addr *saddr);
85 const struct net_device *dev, 79int __ipv6_get_lladdr(struct inet6_dev *idev, struct in6_addr *addr,
86 const struct in6_addr *daddr, 80 unsigned char banned_flags);
87 unsigned int srcprefs, 81int ipv6_get_lladdr(struct net_device *dev, struct in6_addr *addr,
88 struct in6_addr *saddr); 82 unsigned char banned_flags);
89extern int __ipv6_get_lladdr(struct inet6_dev *idev, 83int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2);
90 struct in6_addr *addr, 84void addrconf_join_solict(struct net_device *dev, const struct in6_addr *addr);
91 unsigned char banned_flags); 85void addrconf_leave_solict(struct inet6_dev *idev, const struct in6_addr *addr);
92extern int ipv6_get_lladdr(struct net_device *dev,
93 struct in6_addr *addr,
94 unsigned char banned_flags);
95extern int ipv6_rcv_saddr_equal(const struct sock *sk,
96 const struct sock *sk2);
97extern void addrconf_join_solict(struct net_device *dev,
98 const struct in6_addr *addr);
99extern void addrconf_leave_solict(struct inet6_dev *idev,
100 const struct in6_addr *addr);
101 86
102static inline unsigned long addrconf_timeout_fixup(u32 timeout, 87static inline unsigned long addrconf_timeout_fixup(u32 timeout,
103 unsigned int unit) 88 unsigned int unit)
@@ -124,41 +109,58 @@ static inline int addrconf_finite_timeout(unsigned long timeout)
124/* 109/*
125 * IPv6 Address Label subsystem (addrlabel.c) 110 * IPv6 Address Label subsystem (addrlabel.c)
126 */ 111 */
127extern int ipv6_addr_label_init(void); 112int ipv6_addr_label_init(void);
128extern void ipv6_addr_label_cleanup(void); 113void ipv6_addr_label_cleanup(void);
129extern void ipv6_addr_label_rtnl_register(void); 114void ipv6_addr_label_rtnl_register(void);
130extern u32 ipv6_addr_label(struct net *net, 115u32 ipv6_addr_label(struct net *net, const struct in6_addr *addr,
131 const struct in6_addr *addr, 116 int type, int ifindex);
132 int type, int ifindex);
133 117
134/* 118/*
135 * multicast prototypes (mcast.c) 119 * multicast prototypes (mcast.c)
136 */ 120 */
137extern int ipv6_sock_mc_join(struct sock *sk, int ifindex, 121int ipv6_sock_mc_join(struct sock *sk, int ifindex,
138 const struct in6_addr *addr); 122 const struct in6_addr *addr);
139extern int ipv6_sock_mc_drop(struct sock *sk, int ifindex, 123int ipv6_sock_mc_drop(struct sock *sk, int ifindex,
140 const struct in6_addr *addr); 124 const struct in6_addr *addr);
141extern void ipv6_sock_mc_close(struct sock *sk); 125void ipv6_sock_mc_close(struct sock *sk);
142extern bool inet6_mc_check(struct sock *sk, 126bool inet6_mc_check(struct sock *sk, const struct in6_addr *mc_addr,
143 const struct in6_addr *mc_addr, 127 const struct in6_addr *src_addr);
144 const struct in6_addr *src_addr); 128
145 129int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr);
146extern int ipv6_dev_mc_inc(struct net_device *dev, const struct in6_addr *addr); 130int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr);
147extern int __ipv6_dev_mc_dec(struct inet6_dev *idev, const struct in6_addr *addr); 131int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr);
148extern int ipv6_dev_mc_dec(struct net_device *dev, const struct in6_addr *addr); 132void ipv6_mc_up(struct inet6_dev *idev);
149extern void ipv6_mc_up(struct inet6_dev *idev); 133void ipv6_mc_down(struct inet6_dev *idev);
150extern void ipv6_mc_down(struct inet6_dev *idev); 134void ipv6_mc_unmap(struct inet6_dev *idev);
151extern void ipv6_mc_unmap(struct inet6_dev *idev); 135void ipv6_mc_remap(struct inet6_dev *idev);
152extern void ipv6_mc_remap(struct inet6_dev *idev); 136void ipv6_mc_init_dev(struct inet6_dev *idev);
153extern void ipv6_mc_init_dev(struct inet6_dev *idev); 137void ipv6_mc_destroy_dev(struct inet6_dev *idev);
154extern void ipv6_mc_destroy_dev(struct inet6_dev *idev); 138void addrconf_dad_failure(struct inet6_ifaddr *ifp);
155extern void addrconf_dad_failure(struct inet6_ifaddr *ifp); 139
156 140bool ipv6_chk_mcast_addr(struct net_device *dev, const struct in6_addr *group,
157extern bool ipv6_chk_mcast_addr(struct net_device *dev, 141 const struct in6_addr *src_addr);
158 const struct in6_addr *group, 142
159 const struct in6_addr *src_addr); 143void ipv6_mc_dad_complete(struct inet6_dev *idev);
160 144
161extern void ipv6_mc_dad_complete(struct inet6_dev *idev); 145/* A stub used by vxlan module. This is ugly, ideally these
146 * symbols should be built into the core kernel.
147 */
148struct ipv6_stub {
149 int (*ipv6_sock_mc_join)(struct sock *sk, int ifindex,
150 const struct in6_addr *addr);
151 int (*ipv6_sock_mc_drop)(struct sock *sk, int ifindex,
152 const struct in6_addr *addr);
153 int (*ipv6_dst_lookup)(struct sock *sk, struct dst_entry **dst,
154 struct flowi6 *fl6);
155 void (*udpv6_encap_enable)(void);
156 void (*ndisc_send_na)(struct net_device *dev, struct neighbour *neigh,
157 const struct in6_addr *daddr,
158 const struct in6_addr *solicited_addr,
159 bool router, bool solicited, bool override, bool inc_opt);
160 struct neigh_table *nd_tbl;
161};
162extern const struct ipv6_stub *ipv6_stub __read_mostly;
163
162/* 164/*
163 * identify MLD packets for MLD filter exceptions 165 * identify MLD packets for MLD filter exceptions
164 */ 166 */
@@ -184,29 +186,31 @@ static inline bool ipv6_is_mld(struct sk_buff *skb, int nexthdr, int offset)
184 return false; 186 return false;
185} 187}
186 188
187extern void addrconf_prefix_rcv(struct net_device *dev, 189void addrconf_prefix_rcv(struct net_device *dev,
188 u8 *opt, int len, bool sllao); 190 u8 *opt, int len, bool sllao);
189 191
190/* 192/*
191 * anycast prototypes (anycast.c) 193 * anycast prototypes (anycast.c)
192 */ 194 */
193extern int ipv6_sock_ac_join(struct sock *sk,int ifindex, const struct in6_addr *addr); 195int ipv6_sock_ac_join(struct sock *sk, int ifindex,
194extern int ipv6_sock_ac_drop(struct sock *sk,int ifindex, const struct in6_addr *addr); 196 const struct in6_addr *addr);
195extern void ipv6_sock_ac_close(struct sock *sk); 197int ipv6_sock_ac_drop(struct sock *sk, int ifindex,
196 198 const struct in6_addr *addr);
197extern int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr); 199void ipv6_sock_ac_close(struct sock *sk);
198extern int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr); 200
199extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev, 201int ipv6_dev_ac_inc(struct net_device *dev, const struct in6_addr *addr);
202int __ipv6_dev_ac_dec(struct inet6_dev *idev, const struct in6_addr *addr);
203bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
200 const struct in6_addr *addr); 204 const struct in6_addr *addr);
201 205
202 206
203/* Device notifier */ 207/* Device notifier */
204extern int register_inet6addr_notifier(struct notifier_block *nb); 208int register_inet6addr_notifier(struct notifier_block *nb);
205extern int unregister_inet6addr_notifier(struct notifier_block *nb); 209int unregister_inet6addr_notifier(struct notifier_block *nb);
206extern int inet6addr_notifier_call_chain(unsigned long val, void *v); 210int inet6addr_notifier_call_chain(unsigned long val, void *v);
207 211
208extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex, 212void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex,
209 struct ipv6_devconf *devconf); 213 struct ipv6_devconf *devconf);
210 214
211/** 215/**
212 * __in6_dev_get - get inet6_dev pointer from netdevice 216 * __in6_dev_get - get inet6_dev pointer from netdevice
@@ -240,7 +244,7 @@ static inline struct inet6_dev *in6_dev_get(const struct net_device *dev)
240 return idev; 244 return idev;
241} 245}
242 246
243extern void in6_dev_finish_destroy(struct inet6_dev *idev); 247void in6_dev_finish_destroy(struct inet6_dev *idev);
244 248
245static inline void in6_dev_put(struct inet6_dev *idev) 249static inline void in6_dev_put(struct inet6_dev *idev)
246{ 250{
@@ -258,7 +262,7 @@ static inline void in6_dev_hold(struct inet6_dev *idev)
258 atomic_inc(&idev->refcnt); 262 atomic_inc(&idev->refcnt);
259} 263}
260 264
261extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); 265void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp);
262 266
263static inline void in6_ifa_put(struct inet6_ifaddr *ifp) 267static inline void in6_ifa_put(struct inet6_ifaddr *ifp)
264{ 268{
@@ -340,8 +344,8 @@ static inline bool ipv6_addr_is_solict_mult(const struct in6_addr *addr)
340} 344}
341 345
342#ifdef CONFIG_PROC_FS 346#ifdef CONFIG_PROC_FS
343extern int if6_proc_init(void); 347int if6_proc_init(void);
344extern void if6_proc_exit(void); 348void if6_proc_exit(void);
345#endif 349#endif
346 350
347#endif 351#endif
diff --git a/include/net/af_rxrpc.h b/include/net/af_rxrpc.h
index 03e6e9453623..e797d45a5ae6 100644
--- a/include/net/af_rxrpc.h
+++ b/include/net/af_rxrpc.h
@@ -31,24 +31,21 @@ enum {
31 31
32typedef void (*rxrpc_interceptor_t)(struct sock *, unsigned long, 32typedef void (*rxrpc_interceptor_t)(struct sock *, unsigned long,
33 struct sk_buff *); 33 struct sk_buff *);
34extern void rxrpc_kernel_intercept_rx_messages(struct socket *, 34void rxrpc_kernel_intercept_rx_messages(struct socket *, rxrpc_interceptor_t);
35 rxrpc_interceptor_t); 35struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *,
36extern struct rxrpc_call *rxrpc_kernel_begin_call(struct socket *, 36 struct sockaddr_rxrpc *,
37 struct sockaddr_rxrpc *, 37 struct key *,
38 struct key *, 38 unsigned long,
39 unsigned long, 39 gfp_t);
40 gfp_t); 40int rxrpc_kernel_send_data(struct rxrpc_call *, struct msghdr *, size_t);
41extern int rxrpc_kernel_send_data(struct rxrpc_call *, struct msghdr *, 41void rxrpc_kernel_abort_call(struct rxrpc_call *, u32);
42 size_t); 42void rxrpc_kernel_end_call(struct rxrpc_call *);
43extern void rxrpc_kernel_abort_call(struct rxrpc_call *, u32); 43bool rxrpc_kernel_is_data_last(struct sk_buff *);
44extern void rxrpc_kernel_end_call(struct rxrpc_call *); 44u32 rxrpc_kernel_get_abort_code(struct sk_buff *);
45extern bool rxrpc_kernel_is_data_last(struct sk_buff *); 45int rxrpc_kernel_get_error_number(struct sk_buff *);
46extern u32 rxrpc_kernel_get_abort_code(struct sk_buff *); 46void rxrpc_kernel_data_delivered(struct sk_buff *);
47extern int rxrpc_kernel_get_error_number(struct sk_buff *); 47void rxrpc_kernel_free_skb(struct sk_buff *);
48extern void rxrpc_kernel_data_delivered(struct sk_buff *); 48struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *, unsigned long);
49extern void rxrpc_kernel_free_skb(struct sk_buff *); 49int rxrpc_kernel_reject_call(struct socket *);
50extern struct rxrpc_call *rxrpc_kernel_accept_call(struct socket *,
51 unsigned long);
52extern int rxrpc_kernel_reject_call(struct socket *);
53 50
54#endif /* _NET_RXRPC_H */ 51#endif /* _NET_RXRPC_H */
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index dbdfd2b0f3b3..a175ba4a7adb 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -6,12 +6,12 @@
6#include <linux/mutex.h> 6#include <linux/mutex.h>
7#include <net/sock.h> 7#include <net/sock.h>
8 8
9extern void unix_inflight(struct file *fp); 9void unix_inflight(struct file *fp);
10extern void unix_notinflight(struct file *fp); 10void unix_notinflight(struct file *fp);
11extern void unix_gc(void); 11void unix_gc(void);
12extern void wait_for_unix_gc(void); 12void wait_for_unix_gc(void);
13extern struct sock *unix_get_socket(struct file *filp); 13struct sock *unix_get_socket(struct file *filp);
14extern struct sock *unix_peer_get(struct sock *); 14struct sock *unix_peer_get(struct sock *);
15 15
16#define UNIX_HASH_SIZE 256 16#define UNIX_HASH_SIZE 256
17#define UNIX_HASH_BITS 8 17#define UNIX_HASH_BITS 8
@@ -35,6 +35,7 @@ struct unix_skb_parms {
35#ifdef CONFIG_SECURITY_NETWORK 35#ifdef CONFIG_SECURITY_NETWORK
36 u32 secid; /* Security ID */ 36 u32 secid; /* Security ID */
37#endif 37#endif
38 u32 consumed;
38}; 39};
39 40
40#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb)) 41#define UNIXCB(skb) (*(struct unix_skb_parms *)&((skb)->cb))
@@ -71,8 +72,8 @@ long unix_inq_len(struct sock *sk);
71long unix_outq_len(struct sock *sk); 72long unix_outq_len(struct sock *sk);
72 73
73#ifdef CONFIG_SYSCTL 74#ifdef CONFIG_SYSCTL
74extern int unix_sysctl_register(struct net *net); 75int unix_sysctl_register(struct net *net);
75extern void unix_sysctl_unregister(struct net *net); 76void unix_sysctl_unregister(struct net *net);
76#else 77#else
77static inline int unix_sysctl_register(struct net *net) { return 0; } 78static inline int unix_sysctl_register(struct net *net) { return 0; }
78static inline void unix_sysctl_unregister(struct net *net) {} 79static inline void unix_sysctl_unregister(struct net *net) {}
diff --git a/include/net/af_vsock.h b/include/net/af_vsock.h
new file mode 100644
index 000000000000..7d64d3609ec9
--- /dev/null
+++ b/include/net/af_vsock.h
@@ -0,0 +1,175 @@
1/*
2 * VMware vSockets Driver
3 *
4 * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation version 2 and no later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef __AF_VSOCK_H__
17#define __AF_VSOCK_H__
18
19#include <linux/kernel.h>
20#include <linux/workqueue.h>
21#include <linux/vm_sockets.h>
22
23#include "vsock_addr.h"
24
25#define LAST_RESERVED_PORT 1023
26
27#define vsock_sk(__sk) ((struct vsock_sock *)__sk)
28#define sk_vsock(__vsk) (&(__vsk)->sk)
29
30struct vsock_sock {
31 /* sk must be the first member. */
32 struct sock sk;
33 struct sockaddr_vm local_addr;
34 struct sockaddr_vm remote_addr;
35 /* Links for the global tables of bound and connected sockets. */
36 struct list_head bound_table;
37 struct list_head connected_table;
38 /* Accessed without the socket lock held. This means it can never be
39 * modified outsided of socket create or destruct.
40 */
41 bool trusted;
42 bool cached_peer_allow_dgram; /* Dgram communication allowed to
43 * cached peer?
44 */
45 u32 cached_peer; /* Context ID of last dgram destination check. */
46 const struct cred *owner;
47 /* Rest are SOCK_STREAM only. */
48 long connect_timeout;
49 /* Listening socket that this came from. */
50 struct sock *listener;
51 /* Used for pending list and accept queue during connection handshake.
52 * The listening socket is the head for both lists. Sockets created
53 * for connection requests are placed in the pending list until they
54 * are connected, at which point they are put in the accept queue list
55 * so they can be accepted in accept(). If accept() cannot accept the
56 * connection, it is marked as rejected so the cleanup function knows
57 * to clean up the socket.
58 */
59 struct list_head pending_links;
60 struct list_head accept_queue;
61 bool rejected;
62 struct delayed_work dwork;
63 u32 peer_shutdown;
64 bool sent_request;
65 bool ignore_connecting_rst;
66
67 /* Private to transport. */
68 void *trans;
69};
70
71s64 vsock_stream_has_data(struct vsock_sock *vsk);
72s64 vsock_stream_has_space(struct vsock_sock *vsk);
73void vsock_pending_work(struct work_struct *work);
74struct sock *__vsock_create(struct net *net,
75 struct socket *sock,
76 struct sock *parent,
77 gfp_t priority, unsigned short type);
78
79/**** TRANSPORT ****/
80
81struct vsock_transport_recv_notify_data {
82 u64 data1; /* Transport-defined. */
83 u64 data2; /* Transport-defined. */
84 bool notify_on_block;
85};
86
87struct vsock_transport_send_notify_data {
88 u64 data1; /* Transport-defined. */
89 u64 data2; /* Transport-defined. */
90};
91
92struct vsock_transport {
93 /* Initialize/tear-down socket. */
94 int (*init)(struct vsock_sock *, struct vsock_sock *);
95 void (*destruct)(struct vsock_sock *);
96 void (*release)(struct vsock_sock *);
97
98 /* Connections. */
99 int (*connect)(struct vsock_sock *);
100
101 /* DGRAM. */
102 int (*dgram_bind)(struct vsock_sock *, struct sockaddr_vm *);
103 int (*dgram_dequeue)(struct kiocb *kiocb, struct vsock_sock *vsk,
104 struct msghdr *msg, size_t len, int flags);
105 int (*dgram_enqueue)(struct vsock_sock *, struct sockaddr_vm *,
106 struct iovec *, size_t len);
107 bool (*dgram_allow)(u32 cid, u32 port);
108
109 /* STREAM. */
110 /* TODO: stream_bind() */
111 ssize_t (*stream_dequeue)(struct vsock_sock *, struct iovec *,
112 size_t len, int flags);
113 ssize_t (*stream_enqueue)(struct vsock_sock *, struct iovec *,
114 size_t len);
115 s64 (*stream_has_data)(struct vsock_sock *);
116 s64 (*stream_has_space)(struct vsock_sock *);
117 u64 (*stream_rcvhiwat)(struct vsock_sock *);
118 bool (*stream_is_active)(struct vsock_sock *);
119 bool (*stream_allow)(u32 cid, u32 port);
120
121 /* Notification. */
122 int (*notify_poll_in)(struct vsock_sock *, size_t, bool *);
123 int (*notify_poll_out)(struct vsock_sock *, size_t, bool *);
124 int (*notify_recv_init)(struct vsock_sock *, size_t,
125 struct vsock_transport_recv_notify_data *);
126 int (*notify_recv_pre_block)(struct vsock_sock *, size_t,
127 struct vsock_transport_recv_notify_data *);
128 int (*notify_recv_pre_dequeue)(struct vsock_sock *, size_t,
129 struct vsock_transport_recv_notify_data *);
130 int (*notify_recv_post_dequeue)(struct vsock_sock *, size_t,
131 ssize_t, bool, struct vsock_transport_recv_notify_data *);
132 int (*notify_send_init)(struct vsock_sock *,
133 struct vsock_transport_send_notify_data *);
134 int (*notify_send_pre_block)(struct vsock_sock *,
135 struct vsock_transport_send_notify_data *);
136 int (*notify_send_pre_enqueue)(struct vsock_sock *,
137 struct vsock_transport_send_notify_data *);
138 int (*notify_send_post_enqueue)(struct vsock_sock *, ssize_t,
139 struct vsock_transport_send_notify_data *);
140
141 /* Shutdown. */
142 int (*shutdown)(struct vsock_sock *, int);
143
144 /* Buffer sizes. */
145 void (*set_buffer_size)(struct vsock_sock *, u64);
146 void (*set_min_buffer_size)(struct vsock_sock *, u64);
147 void (*set_max_buffer_size)(struct vsock_sock *, u64);
148 u64 (*get_buffer_size)(struct vsock_sock *);
149 u64 (*get_min_buffer_size)(struct vsock_sock *);
150 u64 (*get_max_buffer_size)(struct vsock_sock *);
151
152 /* Addressing. */
153 u32 (*get_local_cid)(void);
154};
155
156/**** CORE ****/
157
158int vsock_core_init(const struct vsock_transport *t);
159void vsock_core_exit(void);
160
161/**** UTILS ****/
162
163void vsock_release_pending(struct sock *pending);
164void vsock_add_pending(struct sock *listener, struct sock *pending);
165void vsock_remove_pending(struct sock *listener, struct sock *pending);
166void vsock_enqueue_accept(struct sock *listener, struct sock *connected);
167void vsock_insert_connected(struct vsock_sock *vsk);
168void vsock_remove_bound(struct vsock_sock *vsk);
169void vsock_remove_connected(struct vsock_sock *vsk);
170struct sock *vsock_find_bound_socket(struct sockaddr_vm *addr);
171struct sock *vsock_find_connected_socket(struct sockaddr_vm *src,
172 struct sockaddr_vm *dst);
173void vsock_for_each_connected_socket(void (*fn)(struct sock *sk));
174
175#endif /* __AF_VSOCK_H__ */
diff --git a/include/net/arp.h b/include/net/arp.h
index b630dae03411..7509d9da4e36 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -46,22 +46,22 @@ static inline struct neighbour *__ipv4_neigh_lookup(struct net_device *dev, u32
46 return n; 46 return n;
47} 47}
48 48
49extern void arp_init(void); 49void arp_init(void);
50extern int arp_find(unsigned char *haddr, struct sk_buff *skb); 50int arp_find(unsigned char *haddr, struct sk_buff *skb);
51extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg); 51int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg);
52extern void arp_send(int type, int ptype, __be32 dest_ip, 52void arp_send(int type, int ptype, __be32 dest_ip,
53 struct net_device *dev, __be32 src_ip, 53 struct net_device *dev, __be32 src_ip,
54 const unsigned char *dest_hw, 54 const unsigned char *dest_hw,
55 const unsigned char *src_hw, const unsigned char *th); 55 const unsigned char *src_hw, const unsigned char *th);
56extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir); 56int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir);
57extern void arp_ifdown(struct net_device *dev); 57void arp_ifdown(struct net_device *dev);
58 58
59extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, 59struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
60 struct net_device *dev, __be32 src_ip, 60 struct net_device *dev, __be32 src_ip,
61 const unsigned char *dest_hw, 61 const unsigned char *dest_hw,
62 const unsigned char *src_hw, 62 const unsigned char *src_hw,
63 const unsigned char *target_hw); 63 const unsigned char *target_hw);
64extern void arp_xmit(struct sk_buff *skb); 64void arp_xmit(struct sk_buff *skb);
65int arp_invalidate(struct net_device *dev, __be32 ip); 65int arp_invalidate(struct net_device *dev, __be32 ip);
66 66
67#endif /* _ARP_H */ 67#endif /* _ARP_H */
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 89ed9ac5701f..bf0396e9a5d3 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -195,7 +195,7 @@ static inline void ax25_hold_route(ax25_route *ax25_rt)
195 atomic_inc(&ax25_rt->refcount); 195 atomic_inc(&ax25_rt->refcount);
196} 196}
197 197
198extern void __ax25_put_route(ax25_route *ax25_rt); 198void __ax25_put_route(ax25_route *ax25_rt);
199 199
200static inline void ax25_put_route(ax25_route *ax25_rt) 200static inline void ax25_put_route(ax25_route *ax25_rt)
201{ 201{
@@ -272,30 +272,31 @@ static inline __be16 ax25_type_trans(struct sk_buff *skb, struct net_device *dev
272/* af_ax25.c */ 272/* af_ax25.c */
273extern struct hlist_head ax25_list; 273extern struct hlist_head ax25_list;
274extern spinlock_t ax25_list_lock; 274extern spinlock_t ax25_list_lock;
275extern void ax25_cb_add(ax25_cb *); 275void ax25_cb_add(ax25_cb *);
276struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int); 276struct sock *ax25_find_listener(ax25_address *, int, struct net_device *, int);
277struct sock *ax25_get_socket(ax25_address *, ax25_address *, int); 277struct sock *ax25_get_socket(ax25_address *, ax25_address *, int);
278extern ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *, struct net_device *); 278ax25_cb *ax25_find_cb(ax25_address *, ax25_address *, ax25_digi *,
279extern void ax25_send_to_raw(ax25_address *, struct sk_buff *, int); 279 struct net_device *);
280extern void ax25_destroy_socket(ax25_cb *); 280void ax25_send_to_raw(ax25_address *, struct sk_buff *, int);
281extern ax25_cb * __must_check ax25_create_cb(void); 281void ax25_destroy_socket(ax25_cb *);
282extern void ax25_fillin_cb(ax25_cb *, ax25_dev *); 282ax25_cb * __must_check ax25_create_cb(void);
283extern struct sock *ax25_make_new(struct sock *, struct ax25_dev *); 283void ax25_fillin_cb(ax25_cb *, ax25_dev *);
284struct sock *ax25_make_new(struct sock *, struct ax25_dev *);
284 285
285/* ax25_addr.c */ 286/* ax25_addr.c */
286extern const ax25_address ax25_bcast; 287extern const ax25_address ax25_bcast;
287extern const ax25_address ax25_defaddr; 288extern const ax25_address ax25_defaddr;
288extern const ax25_address null_ax25_address; 289extern const ax25_address null_ax25_address;
289extern char *ax2asc(char *buf, const ax25_address *); 290char *ax2asc(char *buf, const ax25_address *);
290extern void asc2ax(ax25_address *addr, const char *callsign); 291void asc2ax(ax25_address *addr, const char *callsign);
291extern int ax25cmp(const ax25_address *, const ax25_address *); 292int ax25cmp(const ax25_address *, const ax25_address *);
292extern int ax25digicmp(const ax25_digi *, const ax25_digi *); 293int ax25digicmp(const ax25_digi *, const ax25_digi *);
293extern const unsigned char *ax25_addr_parse(const unsigned char *, int, 294const unsigned char *ax25_addr_parse(const unsigned char *, int,
294 ax25_address *, ax25_address *, ax25_digi *, int *, int *); 295 ax25_address *, ax25_address *, ax25_digi *, int *, int *);
295extern int ax25_addr_build(unsigned char *, const ax25_address *, 296int ax25_addr_build(unsigned char *, const ax25_address *,
296 const ax25_address *, const ax25_digi *, int, int); 297 const ax25_address *, const ax25_digi *, int, int);
297extern int ax25_addr_size(const ax25_digi *); 298int ax25_addr_size(const ax25_digi *);
298extern void ax25_digi_invert(const ax25_digi *, ax25_digi *); 299void ax25_digi_invert(const ax25_digi *, ax25_digi *);
299 300
300/* ax25_dev.c */ 301/* ax25_dev.c */
301extern ax25_dev *ax25_dev_list; 302extern ax25_dev *ax25_dev_list;
@@ -306,33 +307,33 @@ static inline ax25_dev *ax25_dev_ax25dev(struct net_device *dev)
306 return dev->ax25_ptr; 307 return dev->ax25_ptr;
307} 308}
308 309
309extern ax25_dev *ax25_addr_ax25dev(ax25_address *); 310ax25_dev *ax25_addr_ax25dev(ax25_address *);
310extern void ax25_dev_device_up(struct net_device *); 311void ax25_dev_device_up(struct net_device *);
311extern void ax25_dev_device_down(struct net_device *); 312void ax25_dev_device_down(struct net_device *);
312extern int ax25_fwd_ioctl(unsigned int, struct ax25_fwd_struct *); 313int ax25_fwd_ioctl(unsigned int, struct ax25_fwd_struct *);
313extern struct net_device *ax25_fwd_dev(struct net_device *); 314struct net_device *ax25_fwd_dev(struct net_device *);
314extern void ax25_dev_free(void); 315void ax25_dev_free(void);
315 316
316/* ax25_ds_in.c */ 317/* ax25_ds_in.c */
317extern int ax25_ds_frame_in(ax25_cb *, struct sk_buff *, int); 318int ax25_ds_frame_in(ax25_cb *, struct sk_buff *, int);
318 319
319/* ax25_ds_subr.c */ 320/* ax25_ds_subr.c */
320extern void ax25_ds_nr_error_recovery(ax25_cb *); 321void ax25_ds_nr_error_recovery(ax25_cb *);
321extern void ax25_ds_enquiry_response(ax25_cb *); 322void ax25_ds_enquiry_response(ax25_cb *);
322extern void ax25_ds_establish_data_link(ax25_cb *); 323void ax25_ds_establish_data_link(ax25_cb *);
323extern void ax25_dev_dama_off(ax25_dev *); 324void ax25_dev_dama_off(ax25_dev *);
324extern void ax25_dama_on(ax25_cb *); 325void ax25_dama_on(ax25_cb *);
325extern void ax25_dama_off(ax25_cb *); 326void ax25_dama_off(ax25_cb *);
326 327
327/* ax25_ds_timer.c */ 328/* ax25_ds_timer.c */
328extern void ax25_ds_setup_timer(ax25_dev *); 329void ax25_ds_setup_timer(ax25_dev *);
329extern void ax25_ds_set_timer(ax25_dev *); 330void ax25_ds_set_timer(ax25_dev *);
330extern void ax25_ds_del_timer(ax25_dev *); 331void ax25_ds_del_timer(ax25_dev *);
331extern void ax25_ds_timer(ax25_cb *); 332void ax25_ds_timer(ax25_cb *);
332extern void ax25_ds_t1_timeout(ax25_cb *); 333void ax25_ds_t1_timeout(ax25_cb *);
333extern void ax25_ds_heartbeat_expiry(ax25_cb *); 334void ax25_ds_heartbeat_expiry(ax25_cb *);
334extern void ax25_ds_t3timer_expiry(ax25_cb *); 335void ax25_ds_t3timer_expiry(ax25_cb *);
335extern void ax25_ds_idletimer_expiry(ax25_cb *); 336void ax25_ds_idletimer_expiry(ax25_cb *);
336 337
337/* ax25_iface.c */ 338/* ax25_iface.c */
338 339
@@ -342,107 +343,109 @@ struct ax25_protocol {
342 int (*func)(struct sk_buff *, ax25_cb *); 343 int (*func)(struct sk_buff *, ax25_cb *);
343}; 344};
344 345
345extern void ax25_register_pid(struct ax25_protocol *ap); 346void ax25_register_pid(struct ax25_protocol *ap);
346extern void ax25_protocol_release(unsigned int); 347void ax25_protocol_release(unsigned int);
347 348
348struct ax25_linkfail { 349struct ax25_linkfail {
349 struct hlist_node lf_node; 350 struct hlist_node lf_node;
350 void (*func)(ax25_cb *, int); 351 void (*func)(ax25_cb *, int);
351}; 352};
352 353
353extern void ax25_linkfail_register(struct ax25_linkfail *lf); 354void ax25_linkfail_register(struct ax25_linkfail *lf);
354extern void ax25_linkfail_release(struct ax25_linkfail *lf); 355void ax25_linkfail_release(struct ax25_linkfail *lf);
355extern int __must_check ax25_listen_register(ax25_address *, 356int __must_check ax25_listen_register(ax25_address *, struct net_device *);
356 struct net_device *); 357void ax25_listen_release(ax25_address *, struct net_device *);
357extern void ax25_listen_release(ax25_address *, struct net_device *); 358int(*ax25_protocol_function(unsigned int))(struct sk_buff *, ax25_cb *);
358extern int (*ax25_protocol_function(unsigned int))(struct sk_buff *, ax25_cb *); 359int ax25_listen_mine(ax25_address *, struct net_device *);
359extern int ax25_listen_mine(ax25_address *, struct net_device *); 360void ax25_link_failed(ax25_cb *, int);
360extern void ax25_link_failed(ax25_cb *, int); 361int ax25_protocol_is_registered(unsigned int);
361extern int ax25_protocol_is_registered(unsigned int);
362 362
363/* ax25_in.c */ 363/* ax25_in.c */
364extern int ax25_rx_iframe(ax25_cb *, struct sk_buff *); 364int ax25_rx_iframe(ax25_cb *, struct sk_buff *);
365extern int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *); 365int ax25_kiss_rcv(struct sk_buff *, struct net_device *, struct packet_type *,
366 struct net_device *);
366 367
367/* ax25_ip.c */ 368/* ax25_ip.c */
368extern int ax25_hard_header(struct sk_buff *, struct net_device *, 369int ax25_hard_header(struct sk_buff *, struct net_device *, unsigned short,
369 unsigned short, const void *, 370 const void *, const void *, unsigned int);
370 const void *, unsigned int); 371int ax25_rebuild_header(struct sk_buff *);
371extern int ax25_rebuild_header(struct sk_buff *);
372extern const struct header_ops ax25_header_ops; 372extern const struct header_ops ax25_header_ops;
373 373
374/* ax25_out.c */ 374/* ax25_out.c */
375extern ax25_cb *ax25_send_frame(struct sk_buff *, int, ax25_address *, ax25_address *, ax25_digi *, struct net_device *); 375ax25_cb *ax25_send_frame(struct sk_buff *, int, ax25_address *, ax25_address *,
376extern void ax25_output(ax25_cb *, int, struct sk_buff *); 376 ax25_digi *, struct net_device *);
377extern void ax25_kick(ax25_cb *); 377void ax25_output(ax25_cb *, int, struct sk_buff *);
378extern void ax25_transmit_buffer(ax25_cb *, struct sk_buff *, int); 378void ax25_kick(ax25_cb *);
379extern void ax25_queue_xmit(struct sk_buff *skb, struct net_device *dev); 379void ax25_transmit_buffer(ax25_cb *, struct sk_buff *, int);
380extern int ax25_check_iframes_acked(ax25_cb *, unsigned short); 380void ax25_queue_xmit(struct sk_buff *skb, struct net_device *dev);
381int ax25_check_iframes_acked(ax25_cb *, unsigned short);
381 382
382/* ax25_route.c */ 383/* ax25_route.c */
383extern void ax25_rt_device_down(struct net_device *); 384void ax25_rt_device_down(struct net_device *);
384extern int ax25_rt_ioctl(unsigned int, void __user *); 385int ax25_rt_ioctl(unsigned int, void __user *);
385extern const struct file_operations ax25_route_fops; 386extern const struct file_operations ax25_route_fops;
386extern ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev); 387ax25_route *ax25_get_route(ax25_address *addr, struct net_device *dev);
387extern int ax25_rt_autobind(ax25_cb *, ax25_address *); 388int ax25_rt_autobind(ax25_cb *, ax25_address *);
388extern struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *, ax25_address *, ax25_digi *); 389struct sk_buff *ax25_rt_build_path(struct sk_buff *, ax25_address *,
389extern void ax25_rt_free(void); 390 ax25_address *, ax25_digi *);
391void ax25_rt_free(void);
390 392
391/* ax25_std_in.c */ 393/* ax25_std_in.c */
392extern int ax25_std_frame_in(ax25_cb *, struct sk_buff *, int); 394int ax25_std_frame_in(ax25_cb *, struct sk_buff *, int);
393 395
394/* ax25_std_subr.c */ 396/* ax25_std_subr.c */
395extern void ax25_std_nr_error_recovery(ax25_cb *); 397void ax25_std_nr_error_recovery(ax25_cb *);
396extern void ax25_std_establish_data_link(ax25_cb *); 398void ax25_std_establish_data_link(ax25_cb *);
397extern void ax25_std_transmit_enquiry(ax25_cb *); 399void ax25_std_transmit_enquiry(ax25_cb *);
398extern void ax25_std_enquiry_response(ax25_cb *); 400void ax25_std_enquiry_response(ax25_cb *);
399extern void ax25_std_timeout_response(ax25_cb *); 401void ax25_std_timeout_response(ax25_cb *);
400 402
401/* ax25_std_timer.c */ 403/* ax25_std_timer.c */
402extern void ax25_std_heartbeat_expiry(ax25_cb *); 404void ax25_std_heartbeat_expiry(ax25_cb *);
403extern void ax25_std_t1timer_expiry(ax25_cb *); 405void ax25_std_t1timer_expiry(ax25_cb *);
404extern void ax25_std_t2timer_expiry(ax25_cb *); 406void ax25_std_t2timer_expiry(ax25_cb *);
405extern void ax25_std_t3timer_expiry(ax25_cb *); 407void ax25_std_t3timer_expiry(ax25_cb *);
406extern void ax25_std_idletimer_expiry(ax25_cb *); 408void ax25_std_idletimer_expiry(ax25_cb *);
407 409
408/* ax25_subr.c */ 410/* ax25_subr.c */
409extern void ax25_clear_queues(ax25_cb *); 411void ax25_clear_queues(ax25_cb *);
410extern void ax25_frames_acked(ax25_cb *, unsigned short); 412void ax25_frames_acked(ax25_cb *, unsigned short);
411extern void ax25_requeue_frames(ax25_cb *); 413void ax25_requeue_frames(ax25_cb *);
412extern int ax25_validate_nr(ax25_cb *, unsigned short); 414int ax25_validate_nr(ax25_cb *, unsigned short);
413extern int ax25_decode(ax25_cb *, struct sk_buff *, int *, int *, int *); 415int ax25_decode(ax25_cb *, struct sk_buff *, int *, int *, int *);
414extern void ax25_send_control(ax25_cb *, int, int, int); 416void ax25_send_control(ax25_cb *, int, int, int);
415extern void ax25_return_dm(struct net_device *, ax25_address *, ax25_address *, ax25_digi *); 417void ax25_return_dm(struct net_device *, ax25_address *, ax25_address *,
416extern void ax25_calculate_t1(ax25_cb *); 418 ax25_digi *);
417extern void ax25_calculate_rtt(ax25_cb *); 419void ax25_calculate_t1(ax25_cb *);
418extern void ax25_disconnect(ax25_cb *, int); 420void ax25_calculate_rtt(ax25_cb *);
421void ax25_disconnect(ax25_cb *, int);
419 422
420/* ax25_timer.c */ 423/* ax25_timer.c */
421extern void ax25_setup_timers(ax25_cb *); 424void ax25_setup_timers(ax25_cb *);
422extern void ax25_start_heartbeat(ax25_cb *); 425void ax25_start_heartbeat(ax25_cb *);
423extern void ax25_start_t1timer(ax25_cb *); 426void ax25_start_t1timer(ax25_cb *);
424extern void ax25_start_t2timer(ax25_cb *); 427void ax25_start_t2timer(ax25_cb *);
425extern void ax25_start_t3timer(ax25_cb *); 428void ax25_start_t3timer(ax25_cb *);
426extern void ax25_start_idletimer(ax25_cb *); 429void ax25_start_idletimer(ax25_cb *);
427extern void ax25_stop_heartbeat(ax25_cb *); 430void ax25_stop_heartbeat(ax25_cb *);
428extern void ax25_stop_t1timer(ax25_cb *); 431void ax25_stop_t1timer(ax25_cb *);
429extern void ax25_stop_t2timer(ax25_cb *); 432void ax25_stop_t2timer(ax25_cb *);
430extern void ax25_stop_t3timer(ax25_cb *); 433void ax25_stop_t3timer(ax25_cb *);
431extern void ax25_stop_idletimer(ax25_cb *); 434void ax25_stop_idletimer(ax25_cb *);
432extern int ax25_t1timer_running(ax25_cb *); 435int ax25_t1timer_running(ax25_cb *);
433extern unsigned long ax25_display_timer(struct timer_list *); 436unsigned long ax25_display_timer(struct timer_list *);
434 437
435/* ax25_uid.c */ 438/* ax25_uid.c */
436extern int ax25_uid_policy; 439extern int ax25_uid_policy;
437extern ax25_uid_assoc *ax25_findbyuid(kuid_t); 440ax25_uid_assoc *ax25_findbyuid(kuid_t);
438extern int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *); 441int __must_check ax25_uid_ioctl(int, struct sockaddr_ax25 *);
439extern const struct file_operations ax25_uid_fops; 442extern const struct file_operations ax25_uid_fops;
440extern void ax25_uid_free(void); 443void ax25_uid_free(void);
441 444
442/* sysctl_net_ax25.c */ 445/* sysctl_net_ax25.c */
443#ifdef CONFIG_SYSCTL 446#ifdef CONFIG_SYSCTL
444extern int ax25_register_dev_sysctl(ax25_dev *ax25_dev); 447int ax25_register_dev_sysctl(ax25_dev *ax25_dev);
445extern void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev); 448void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev);
446#else 449#else
447static inline int ax25_register_dev_sysctl(ax25_dev *ax25_dev) { return 0; } 450static inline int ax25_register_dev_sysctl(ax25_dev *ax25_dev) { return 0; }
448static inline void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev) {} 451static inline void ax25_unregister_dev_sysctl(ax25_dev *ax25_dev) {}
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 10eb9b389014..10d43d8c7037 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -107,6 +107,14 @@ struct bt_power {
107 */ 107 */
108#define BT_CHANNEL_POLICY_AMP_PREFERRED 2 108#define BT_CHANNEL_POLICY_AMP_PREFERRED 2
109 109
110#define BT_VOICE 11
111struct bt_voice {
112 __u16 setting;
113};
114
115#define BT_VOICE_TRANSPARENT 0x0003
116#define BT_VOICE_CVSD_16BIT 0x0060
117
110__printf(1, 2) 118__printf(1, 2)
111int bt_info(const char *fmt, ...); 119int bt_info(const char *fmt, ...);
112__printf(1, 2) 120__printf(1, 2)
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 3c592cf473da..aaeaf0938ec0 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -238,6 +238,7 @@ enum {
238#define LMP_CVSD 0x01 238#define LMP_CVSD 0x01
239#define LMP_PSCHEME 0x02 239#define LMP_PSCHEME 0x02
240#define LMP_PCONTROL 0x04 240#define LMP_PCONTROL 0x04
241#define LMP_TRANSPARENT 0x08
241 242
242#define LMP_RSSI_INQ 0x40 243#define LMP_RSSI_INQ 0x40
243#define LMP_ESCO 0x80 244#define LMP_ESCO 0x80
@@ -296,6 +297,12 @@ enum {
296#define HCI_AT_GENERAL_BONDING 0x04 297#define HCI_AT_GENERAL_BONDING 0x04
297#define HCI_AT_GENERAL_BONDING_MITM 0x05 298#define HCI_AT_GENERAL_BONDING_MITM 0x05
298 299
300/* I/O capabilities */
301#define HCI_IO_DISPLAY_ONLY 0x00
302#define HCI_IO_DISPLAY_YESNO 0x01
303#define HCI_IO_KEYBOARD_ONLY 0x02
304#define HCI_IO_NO_INPUT_OUTPUT 0x03
305
299/* Link Key types */ 306/* Link Key types */
300#define HCI_LK_COMBINATION 0x00 307#define HCI_LK_COMBINATION 0x00
301#define HCI_LK_LOCAL_UNIT 0x01 308#define HCI_LK_LOCAL_UNIT 0x01
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index f77885ea78c2..3ede820d328f 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -320,6 +320,7 @@ struct hci_conn {
320 __u32 passkey_notify; 320 __u32 passkey_notify;
321 __u8 passkey_entered; 321 __u8 passkey_entered;
322 __u16 disc_timeout; 322 __u16 disc_timeout;
323 __u16 setting;
323 unsigned long flags; 324 unsigned long flags;
324 325
325 __u8 remote_cap; 326 __u8 remote_cap;
@@ -569,7 +570,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_state(struct hci_dev *hdev,
569} 570}
570 571
571void hci_disconnect(struct hci_conn *conn, __u8 reason); 572void hci_disconnect(struct hci_conn *conn, __u8 reason);
572void hci_setup_sync(struct hci_conn *conn, __u16 handle); 573bool hci_setup_sync(struct hci_conn *conn, __u16 handle);
573void hci_sco_setup(struct hci_conn *conn, __u8 status); 574void hci_sco_setup(struct hci_conn *conn, __u8 status);
574 575
575struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst); 576struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst);
@@ -584,6 +585,8 @@ struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle);
584 585
585struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, 586struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
586 __u8 dst_type, __u8 sec_level, __u8 auth_type); 587 __u8 dst_type, __u8 sec_level, __u8 auth_type);
588struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst,
589 __u16 setting);
587int hci_conn_check_link_mode(struct hci_conn *conn); 590int hci_conn_check_link_mode(struct hci_conn *conn);
588int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); 591int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level);
589int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type); 592int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type);
@@ -797,6 +800,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
797#define lmp_lsto_capable(dev) ((dev)->features[0][7] & LMP_LSTO) 800#define lmp_lsto_capable(dev) ((dev)->features[0][7] & LMP_LSTO)
798#define lmp_inq_tx_pwr_capable(dev) ((dev)->features[0][7] & LMP_INQ_TX_PWR) 801#define lmp_inq_tx_pwr_capable(dev) ((dev)->features[0][7] & LMP_INQ_TX_PWR)
799#define lmp_ext_feat_capable(dev) ((dev)->features[0][7] & LMP_EXTFEATURES) 802#define lmp_ext_feat_capable(dev) ((dev)->features[0][7] & LMP_EXTFEATURES)
803#define lmp_transp_capable(dev) ((dev)->features[0][2] & LMP_TRANSPARENT)
800 804
801/* ----- Extended LMP capabilities ----- */ 805/* ----- Extended LMP capabilities ----- */
802#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP) 806#define lmp_host_ssp_capable(dev) ((dev)->features[1][0] & LMP_HOST_SSP)
@@ -1213,4 +1217,8 @@ void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],
1213 1217
1214u8 bdaddr_to_le(u8 bdaddr_type); 1218u8 bdaddr_to_le(u8 bdaddr_type);
1215 1219
1220#define SCO_AIRMODE_MASK 0x0003
1221#define SCO_AIRMODE_CVSD 0x0000
1222#define SCO_AIRMODE_TRANSP 0x0003
1223
1216#endif /* __HCI_CORE_H */ 1224#endif /* __HCI_CORE_H */
diff --git a/include/net/bluetooth/sco.h b/include/net/bluetooth/sco.h
index 1e35c43657c8..e252a31ee6b6 100644
--- a/include/net/bluetooth/sco.h
+++ b/include/net/bluetooth/sco.h
@@ -73,6 +73,7 @@ struct sco_conn {
73struct sco_pinfo { 73struct sco_pinfo {
74 struct bt_sock bt; 74 struct bt_sock bt;
75 __u32 flags; 75 __u32 flags;
76 __u16 setting;
76 struct sco_conn *conn; 77 struct sco_conn *conn;
77}; 78};
78 79
diff --git a/include/net/busy_poll.h b/include/net/busy_poll.h
index f18b91966d3d..829627d7b846 100644
--- a/include/net/busy_poll.h
+++ b/include/net/busy_poll.h
@@ -122,7 +122,8 @@ static inline bool sk_busy_loop(struct sock *sk, int nonblock)
122 if (rc > 0) 122 if (rc > 0)
123 /* local bh are disabled so it is ok to use _BH */ 123 /* local bh are disabled so it is ok to use _BH */
124 NET_ADD_STATS_BH(sock_net(sk), 124 NET_ADD_STATS_BH(sock_net(sk),
125 LINUX_MIB_LOWLATENCYRXPACKETS, rc); 125 LINUX_MIB_BUSYPOLLRXPACKETS, rc);
126 cpu_relax();
126 127
127 } while (!nonblock && skb_queue_empty(&sk->sk_receive_queue) && 128 } while (!nonblock && skb_queue_empty(&sk->sk_receive_queue) &&
128 !need_resched() && !busy_loop_timeout(end_time)); 129 !need_resched() && !busy_loop_timeout(end_time));
@@ -162,11 +163,6 @@ static inline bool sk_can_busy_loop(struct sock *sk)
162 return false; 163 return false;
163} 164}
164 165
165static inline bool sk_busy_poll(struct sock *sk, int nonblock)
166{
167 return false;
168}
169
170static inline void skb_mark_napi_id(struct sk_buff *skb, 166static inline void skb_mark_napi_id(struct sk_buff *skb,
171 struct napi_struct *napi) 167 struct napi_struct *napi)
172{ 168{
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 7b0730aeb892..cb710913d5c8 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -461,6 +461,33 @@ ieee80211_chandef_rate_flags(struct cfg80211_chan_def *chandef)
461} 461}
462 462
463/** 463/**
464 * ieee80211_chandef_max_power - maximum transmission power for the chandef
465 *
466 * In some regulations, the transmit power may depend on the configured channel
467 * bandwidth which may be defined as dBm/MHz. This function returns the actual
468 * max_power for non-standard (20 MHz) channels.
469 *
470 * @chandef: channel definition for the channel
471 *
472 * Returns: maximum allowed transmission power in dBm for the chandef
473 */
474static inline int
475ieee80211_chandef_max_power(struct cfg80211_chan_def *chandef)
476{
477 switch (chandef->width) {
478 case NL80211_CHAN_WIDTH_5:
479 return min(chandef->chan->max_reg_power - 6,
480 chandef->chan->max_power);
481 case NL80211_CHAN_WIDTH_10:
482 return min(chandef->chan->max_reg_power - 3,
483 chandef->chan->max_power);
484 default:
485 break;
486 }
487 return chandef->chan->max_power;
488}
489
490/**
464 * enum survey_info_flags - survey information flags 491 * enum survey_info_flags - survey information flags
465 * 492 *
466 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in 493 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in
@@ -490,7 +517,7 @@ enum survey_info_flags {
490 * @channel: the channel this survey record reports, mandatory 517 * @channel: the channel this survey record reports, mandatory
491 * @filled: bitflag of flags from &enum survey_info_flags 518 * @filled: bitflag of flags from &enum survey_info_flags
492 * @noise: channel noise in dBm. This and all following fields are 519 * @noise: channel noise in dBm. This and all following fields are
493 * optional 520 * optional
494 * @channel_time: amount of time in ms the radio spent on the channel 521 * @channel_time: amount of time in ms the radio spent on the channel
495 * @channel_time_busy: amount of time the primary channel was sensed busy 522 * @channel_time_busy: amount of time the primary channel was sensed busy
496 * @channel_time_ext_busy: amount of time the extension channel was sensed busy 523 * @channel_time_ext_busy: amount of time the extension channel was sensed busy
@@ -546,9 +573,9 @@ struct cfg80211_crypto_settings {
546/** 573/**
547 * struct cfg80211_beacon_data - beacon data 574 * struct cfg80211_beacon_data - beacon data
548 * @head: head portion of beacon (before TIM IE) 575 * @head: head portion of beacon (before TIM IE)
549 * or %NULL if not changed 576 * or %NULL if not changed
550 * @tail: tail portion of beacon (after TIM IE) 577 * @tail: tail portion of beacon (after TIM IE)
551 * or %NULL if not changed 578 * or %NULL if not changed
552 * @head_len: length of @head 579 * @head_len: length of @head
553 * @tail_len: length of @tail 580 * @tail_len: length of @tail
554 * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL 581 * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL
@@ -639,6 +666,30 @@ struct cfg80211_ap_settings {
639}; 666};
640 667
641/** 668/**
669 * struct cfg80211_csa_settings - channel switch settings
670 *
671 * Used for channel switch
672 *
673 * @chandef: defines the channel to use after the switch
674 * @beacon_csa: beacon data while performing the switch
675 * @counter_offset_beacon: offset for the counter within the beacon (tail)
676 * @counter_offset_presp: offset for the counter within the probe response
677 * @beacon_after: beacon data to be used on the new channel
678 * @radar_required: whether radar detection is required on the new channel
679 * @block_tx: whether transmissions should be blocked while changing
680 * @count: number of beacons until switch
681 */
682struct cfg80211_csa_settings {
683 struct cfg80211_chan_def chandef;
684 struct cfg80211_beacon_data beacon_csa;
685 u16 counter_offset_beacon, counter_offset_presp;
686 struct cfg80211_beacon_data beacon_after;
687 bool radar_required;
688 bool block_tx;
689 u8 count;
690};
691
692/**
642 * enum station_parameters_apply_mask - station parameter values to apply 693 * enum station_parameters_apply_mask - station parameter values to apply
643 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp) 694 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
644 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability 695 * @STATION_PARAM_APPLY_CAPABILITY: apply new capability
@@ -764,7 +815,7 @@ int cfg80211_check_station_change(struct wiphy *wiphy,
764 * @STATION_INFO_PLINK_STATE: @plink_state filled 815 * @STATION_INFO_PLINK_STATE: @plink_state filled
765 * @STATION_INFO_SIGNAL: @signal filled 816 * @STATION_INFO_SIGNAL: @signal filled
766 * @STATION_INFO_TX_BITRATE: @txrate fields are filled 817 * @STATION_INFO_TX_BITRATE: @txrate fields are filled
767 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) 818 * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs)
768 * @STATION_INFO_RX_PACKETS: @rx_packets filled with 32-bit value 819 * @STATION_INFO_RX_PACKETS: @rx_packets filled with 32-bit value
769 * @STATION_INFO_TX_PACKETS: @tx_packets filled with 32-bit value 820 * @STATION_INFO_TX_PACKETS: @tx_packets filled with 32-bit value
770 * @STATION_INFO_TX_RETRIES: @tx_retries filled 821 * @STATION_INFO_TX_RETRIES: @tx_retries filled
@@ -1285,6 +1336,7 @@ struct cfg80211_ssid {
1285 * @n_ssids: number of SSIDs 1336 * @n_ssids: number of SSIDs
1286 * @channels: channels to scan on. 1337 * @channels: channels to scan on.
1287 * @n_channels: total number of channels to scan 1338 * @n_channels: total number of channels to scan
1339 * @scan_width: channel width for scanning
1288 * @ie: optional information element(s) to add into Probe Request or %NULL 1340 * @ie: optional information element(s) to add into Probe Request or %NULL
1289 * @ie_len: length of ie in octets 1341 * @ie_len: length of ie in octets
1290 * @flags: bit field of flags controlling operation 1342 * @flags: bit field of flags controlling operation
@@ -1300,6 +1352,7 @@ struct cfg80211_scan_request {
1300 struct cfg80211_ssid *ssids; 1352 struct cfg80211_ssid *ssids;
1301 int n_ssids; 1353 int n_ssids;
1302 u32 n_channels; 1354 u32 n_channels;
1355 enum nl80211_bss_scan_width scan_width;
1303 const u8 *ie; 1356 const u8 *ie;
1304 size_t ie_len; 1357 size_t ie_len;
1305 u32 flags; 1358 u32 flags;
@@ -1333,6 +1386,7 @@ struct cfg80211_match_set {
1333 * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans) 1386 * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans)
1334 * @n_ssids: number of SSIDs 1387 * @n_ssids: number of SSIDs
1335 * @n_channels: total number of channels to scan 1388 * @n_channels: total number of channels to scan
1389 * @scan_width: channel width for scanning
1336 * @interval: interval between each scheduled scan cycle 1390 * @interval: interval between each scheduled scan cycle
1337 * @ie: optional information element(s) to add into Probe Request or %NULL 1391 * @ie: optional information element(s) to add into Probe Request or %NULL
1338 * @ie_len: length of ie in octets 1392 * @ie_len: length of ie in octets
@@ -1352,6 +1406,7 @@ struct cfg80211_sched_scan_request {
1352 struct cfg80211_ssid *ssids; 1406 struct cfg80211_ssid *ssids;
1353 int n_ssids; 1407 int n_ssids;
1354 u32 n_channels; 1408 u32 n_channels;
1409 enum nl80211_bss_scan_width scan_width;
1355 u32 interval; 1410 u32 interval;
1356 const u8 *ie; 1411 const u8 *ie;
1357 size_t ie_len; 1412 size_t ie_len;
@@ -1403,6 +1458,7 @@ struct cfg80211_bss_ies {
1403 * for use in scan results and similar. 1458 * for use in scan results and similar.
1404 * 1459 *
1405 * @channel: channel this BSS is on 1460 * @channel: channel this BSS is on
1461 * @scan_width: width of the control channel
1406 * @bssid: BSSID of the BSS 1462 * @bssid: BSSID of the BSS
1407 * @beacon_interval: the beacon interval as from the frame 1463 * @beacon_interval: the beacon interval as from the frame
1408 * @capability: the capability field in host byte order 1464 * @capability: the capability field in host byte order
@@ -1424,6 +1480,7 @@ struct cfg80211_bss_ies {
1424 */ 1480 */
1425struct cfg80211_bss { 1481struct cfg80211_bss {
1426 struct ieee80211_channel *channel; 1482 struct ieee80211_channel *channel;
1483 enum nl80211_bss_scan_width scan_width;
1427 1484
1428 const struct cfg80211_bss_ies __rcu *ies; 1485 const struct cfg80211_bss_ies __rcu *ies;
1429 const struct cfg80211_bss_ies __rcu *beacon_ies; 1486 const struct cfg80211_bss_ies __rcu *beacon_ies;
@@ -1509,7 +1566,7 @@ enum cfg80211_assoc_req_flags {
1509 * @prev_bssid: previous BSSID, if not %NULL use reassociate frame 1566 * @prev_bssid: previous BSSID, if not %NULL use reassociate frame
1510 * @flags: See &enum cfg80211_assoc_req_flags 1567 * @flags: See &enum cfg80211_assoc_req_flags
1511 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask 1568 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1512 * will be used in ht_capa. Un-supported values will be ignored. 1569 * will be used in ht_capa. Un-supported values will be ignored.
1513 * @ht_capa_mask: The bits of ht_capa which are to be used. 1570 * @ht_capa_mask: The bits of ht_capa which are to be used.
1514 * @vht_capa: VHT capability override 1571 * @vht_capa: VHT capability override
1515 * @vht_capa_mask: VHT capability mask indicating which fields to use 1572 * @vht_capa_mask: VHT capability mask indicating which fields to use
@@ -1592,6 +1649,9 @@ struct cfg80211_disassoc_request {
1592 * user space. Otherwise, port is marked authorized by default. 1649 * user space. Otherwise, port is marked authorized by default.
1593 * @basic_rates: bitmap of basic rates to use when creating the IBSS 1650 * @basic_rates: bitmap of basic rates to use when creating the IBSS
1594 * @mcast_rate: per-band multicast rate index + 1 (0: disabled) 1651 * @mcast_rate: per-band multicast rate index + 1 (0: disabled)
1652 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1653 * will be used in ht_capa. Un-supported values will be ignored.
1654 * @ht_capa_mask: The bits of ht_capa which are to be used.
1595 */ 1655 */
1596struct cfg80211_ibss_params { 1656struct cfg80211_ibss_params {
1597 u8 *ssid; 1657 u8 *ssid;
@@ -1605,6 +1665,8 @@ struct cfg80211_ibss_params {
1605 bool privacy; 1665 bool privacy;
1606 bool control_port; 1666 bool control_port;
1607 int mcast_rate[IEEE80211_NUM_BANDS]; 1667 int mcast_rate[IEEE80211_NUM_BANDS];
1668 struct ieee80211_ht_cap ht_capa;
1669 struct ieee80211_ht_cap ht_capa_mask;
1608}; 1670};
1609 1671
1610/** 1672/**
@@ -1630,9 +1692,9 @@ struct cfg80211_ibss_params {
1630 * @key: WEP key for shared key authentication 1692 * @key: WEP key for shared key authentication
1631 * @flags: See &enum cfg80211_assoc_req_flags 1693 * @flags: See &enum cfg80211_assoc_req_flags
1632 * @bg_scan_period: Background scan period in seconds 1694 * @bg_scan_period: Background scan period in seconds
1633 * or -1 to indicate that default value is to be used. 1695 * or -1 to indicate that default value is to be used.
1634 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask 1696 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
1635 * will be used in ht_capa. Un-supported values will be ignored. 1697 * will be used in ht_capa. Un-supported values will be ignored.
1636 * @ht_capa_mask: The bits of ht_capa which are to be used. 1698 * @ht_capa_mask: The bits of ht_capa which are to be used.
1637 * @vht_capa: VHT Capability overrides 1699 * @vht_capa: VHT Capability overrides
1638 * @vht_capa_mask: The bits of vht_capa which are to be used. 1700 * @vht_capa_mask: The bits of vht_capa which are to be used.
@@ -1698,7 +1760,7 @@ struct cfg80211_pmksa {
1698}; 1760};
1699 1761
1700/** 1762/**
1701 * struct cfg80211_wowlan_trig_pkt_pattern - packet pattern 1763 * struct cfg80211_pkt_pattern - packet pattern
1702 * @mask: bitmask where to match pattern and where to ignore bytes, 1764 * @mask: bitmask where to match pattern and where to ignore bytes,
1703 * one bit per byte, in same format as nl80211 1765 * one bit per byte, in same format as nl80211
1704 * @pattern: bytes to match where bitmask is 1 1766 * @pattern: bytes to match where bitmask is 1
@@ -1708,7 +1770,7 @@ struct cfg80211_pmksa {
1708 * Internal note: @mask and @pattern are allocated in one chunk of 1770 * Internal note: @mask and @pattern are allocated in one chunk of
1709 * memory, free @mask only! 1771 * memory, free @mask only!
1710 */ 1772 */
1711struct cfg80211_wowlan_trig_pkt_pattern { 1773struct cfg80211_pkt_pattern {
1712 u8 *mask, *pattern; 1774 u8 *mask, *pattern;
1713 int pattern_len; 1775 int pattern_len;
1714 int pkt_offset; 1776 int pkt_offset;
@@ -1770,12 +1832,41 @@ struct cfg80211_wowlan {
1770 bool any, disconnect, magic_pkt, gtk_rekey_failure, 1832 bool any, disconnect, magic_pkt, gtk_rekey_failure,
1771 eap_identity_req, four_way_handshake, 1833 eap_identity_req, four_way_handshake,
1772 rfkill_release; 1834 rfkill_release;
1773 struct cfg80211_wowlan_trig_pkt_pattern *patterns; 1835 struct cfg80211_pkt_pattern *patterns;
1774 struct cfg80211_wowlan_tcp *tcp; 1836 struct cfg80211_wowlan_tcp *tcp;
1775 int n_patterns; 1837 int n_patterns;
1776}; 1838};
1777 1839
1778/** 1840/**
1841 * struct cfg80211_coalesce_rules - Coalesce rule parameters
1842 *
1843 * This structure defines coalesce rule for the device.
1844 * @delay: maximum coalescing delay in msecs.
1845 * @condition: condition for packet coalescence.
1846 * see &enum nl80211_coalesce_condition.
1847 * @patterns: array of packet patterns
1848 * @n_patterns: number of patterns
1849 */
1850struct cfg80211_coalesce_rules {
1851 int delay;
1852 enum nl80211_coalesce_condition condition;
1853 struct cfg80211_pkt_pattern *patterns;
1854 int n_patterns;
1855};
1856
1857/**
1858 * struct cfg80211_coalesce - Packet coalescing settings
1859 *
1860 * This structure defines coalescing settings.
1861 * @rules: array of coalesce rules
1862 * @n_rules: number of rules
1863 */
1864struct cfg80211_coalesce {
1865 struct cfg80211_coalesce_rules *rules;
1866 int n_rules;
1867};
1868
1869/**
1779 * struct cfg80211_wowlan_wakeup - wakeup report 1870 * struct cfg80211_wowlan_wakeup - wakeup report
1780 * @disconnect: woke up by getting disconnected 1871 * @disconnect: woke up by getting disconnected
1781 * @magic_pkt: woke up by receiving magic packet 1872 * @magic_pkt: woke up by receiving magic packet
@@ -1990,7 +2081,7 @@ struct cfg80211_update_ft_ies_params {
1990 * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management 2081 * @mgmt_tx_cancel_wait: Cancel the wait time from transmitting a management
1991 * frame on another channel 2082 * frame on another channel
1992 * 2083 *
1993 * @testmode_cmd: run a test mode command 2084 * @testmode_cmd: run a test mode command; @wdev may be %NULL
1994 * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be 2085 * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be
1995 * used by the function, but 0 and 1 must not be touched. Additionally, 2086 * used by the function, but 0 and 1 must not be touched. Additionally,
1996 * return error codes other than -ENOBUFS and -ENOENT will terminate the 2087 * return error codes other than -ENOBUFS and -ENOENT will terminate the
@@ -2071,6 +2162,9 @@ struct cfg80211_update_ft_ies_params {
2071 * driver can take the most appropriate actions. 2162 * driver can take the most appropriate actions.
2072 * @crit_proto_stop: Indicates critical protocol no longer needs increased link 2163 * @crit_proto_stop: Indicates critical protocol no longer needs increased link
2073 * reliability. This operation can not fail. 2164 * reliability. This operation can not fail.
2165 * @set_coalesce: Set coalesce parameters.
2166 *
2167 * @channel_switch: initiate channel-switch procedure (with CSA)
2074 */ 2168 */
2075struct cfg80211_ops { 2169struct cfg80211_ops {
2076 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 2170 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -2196,7 +2290,8 @@ struct cfg80211_ops {
2196 void (*rfkill_poll)(struct wiphy *wiphy); 2290 void (*rfkill_poll)(struct wiphy *wiphy);
2197 2291
2198#ifdef CONFIG_NL80211_TESTMODE 2292#ifdef CONFIG_NL80211_TESTMODE
2199 int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len); 2293 int (*testmode_cmd)(struct wiphy *wiphy, struct wireless_dev *wdev,
2294 void *data, int len);
2200 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb, 2295 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb,
2201 struct netlink_callback *cb, 2296 struct netlink_callback *cb,
2202 void *data, int len); 2297 void *data, int len);
@@ -2306,6 +2401,12 @@ struct cfg80211_ops {
2306 u16 duration); 2401 u16 duration);
2307 void (*crit_proto_stop)(struct wiphy *wiphy, 2402 void (*crit_proto_stop)(struct wiphy *wiphy,
2308 struct wireless_dev *wdev); 2403 struct wireless_dev *wdev);
2404 int (*set_coalesce)(struct wiphy *wiphy,
2405 struct cfg80211_coalesce *coalesce);
2406
2407 int (*channel_switch)(struct wiphy *wiphy,
2408 struct net_device *dev,
2409 struct cfg80211_csa_settings *params);
2309}; 2410};
2310 2411
2311/* 2412/*
@@ -2371,6 +2472,8 @@ struct cfg80211_ops {
2371 * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX. 2472 * @WIPHY_FLAG_OFFCHAN_TX: Device supports direct off-channel TX.
2372 * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call. 2473 * @WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL: Device supports remain-on-channel call.
2373 * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels. 2474 * @WIPHY_FLAG_SUPPORTS_5_10_MHZ: Device supports 5 MHz and 10 MHz channels.
2475 * @WIPHY_FLAG_HAS_CHANNEL_SWITCH: Device supports channel switch in
2476 * beaconing mode (AP, IBSS, Mesh, ...).
2374 */ 2477 */
2375enum wiphy_flags { 2478enum wiphy_flags {
2376 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 2479 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -2395,6 +2498,7 @@ enum wiphy_flags {
2395 WIPHY_FLAG_OFFCHAN_TX = BIT(20), 2498 WIPHY_FLAG_OFFCHAN_TX = BIT(20),
2396 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21), 2499 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL = BIT(21),
2397 WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22), 2500 WIPHY_FLAG_SUPPORTS_5_10_MHZ = BIT(22),
2501 WIPHY_FLAG_HAS_CHANNEL_SWITCH = BIT(23),
2398}; 2502};
2399 2503
2400/** 2504/**
@@ -2532,6 +2636,25 @@ struct wiphy_wowlan_support {
2532}; 2636};
2533 2637
2534/** 2638/**
2639 * struct wiphy_coalesce_support - coalesce support data
2640 * @n_rules: maximum number of coalesce rules
2641 * @max_delay: maximum supported coalescing delay in msecs
2642 * @n_patterns: number of supported patterns in a rule
2643 * (see nl80211.h for the pattern definition)
2644 * @pattern_max_len: maximum length of each pattern
2645 * @pattern_min_len: minimum length of each pattern
2646 * @max_pkt_offset: maximum Rx packet offset
2647 */
2648struct wiphy_coalesce_support {
2649 int n_rules;
2650 int max_delay;
2651 int n_patterns;
2652 int pattern_max_len;
2653 int pattern_min_len;
2654 int max_pkt_offset;
2655};
2656
2657/**
2535 * struct wiphy - wireless hardware description 2658 * struct wiphy - wireless hardware description
2536 * @reg_notifier: the driver's regulatory notification callback, 2659 * @reg_notifier: the driver's regulatory notification callback,
2537 * note that if your driver uses wiphy_apply_custom_regulatory() 2660 * note that if your driver uses wiphy_apply_custom_regulatory()
@@ -2641,6 +2764,7 @@ struct wiphy_wowlan_support {
2641 * 802.11-2012 8.4.2.29 for the defined fields. 2764 * 802.11-2012 8.4.2.29 for the defined fields.
2642 * @extended_capabilities_mask: mask of the valid values 2765 * @extended_capabilities_mask: mask of the valid values
2643 * @extended_capabilities_len: length of the extended capabilities 2766 * @extended_capabilities_len: length of the extended capabilities
2767 * @coalesce: packet coalescing support information
2644 */ 2768 */
2645struct wiphy { 2769struct wiphy {
2646 /* assign these fields before you register the wiphy */ 2770 /* assign these fields before you register the wiphy */
@@ -2750,6 +2874,8 @@ struct wiphy {
2750 const struct iw_handler_def *wext; 2874 const struct iw_handler_def *wext;
2751#endif 2875#endif
2752 2876
2877 const struct wiphy_coalesce_support *coalesce;
2878
2753 char priv[0] __aligned(NETDEV_ALIGN); 2879 char priv[0] __aligned(NETDEV_ALIGN);
2754}; 2880};
2755 2881
@@ -2841,7 +2967,7 @@ struct wiphy *wiphy_new(const struct cfg80211_ops *ops, int sizeof_priv);
2841 * 2967 *
2842 * Return: A non-negative wiphy index or a negative error code. 2968 * Return: A non-negative wiphy index or a negative error code.
2843 */ 2969 */
2844extern int wiphy_register(struct wiphy *wiphy); 2970int wiphy_register(struct wiphy *wiphy);
2845 2971
2846/** 2972/**
2847 * wiphy_unregister - deregister a wiphy from cfg80211 2973 * wiphy_unregister - deregister a wiphy from cfg80211
@@ -2852,14 +2978,14 @@ extern int wiphy_register(struct wiphy *wiphy);
2852 * pointer, but the call may sleep to wait for an outstanding 2978 * pointer, but the call may sleep to wait for an outstanding
2853 * request that is being handled. 2979 * request that is being handled.
2854 */ 2980 */
2855extern void wiphy_unregister(struct wiphy *wiphy); 2981void wiphy_unregister(struct wiphy *wiphy);
2856 2982
2857/** 2983/**
2858 * wiphy_free - free wiphy 2984 * wiphy_free - free wiphy
2859 * 2985 *
2860 * @wiphy: The wiphy to free 2986 * @wiphy: The wiphy to free
2861 */ 2987 */
2862extern void wiphy_free(struct wiphy *wiphy); 2988void wiphy_free(struct wiphy *wiphy);
2863 2989
2864/* internal structs */ 2990/* internal structs */
2865struct cfg80211_conn; 2991struct cfg80211_conn;
@@ -3014,14 +3140,14 @@ static inline void *wdev_priv(struct wireless_dev *wdev)
3014 * @band: band, necessary due to channel number overlap 3140 * @band: band, necessary due to channel number overlap
3015 * Return: The corresponding frequency (in MHz), or 0 if the conversion failed. 3141 * Return: The corresponding frequency (in MHz), or 0 if the conversion failed.
3016 */ 3142 */
3017extern int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band); 3143int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band);
3018 3144
3019/** 3145/**
3020 * ieee80211_frequency_to_channel - convert frequency to channel number 3146 * ieee80211_frequency_to_channel - convert frequency to channel number
3021 * @freq: center frequency 3147 * @freq: center frequency
3022 * Return: The corresponding channel, or 0 if the conversion failed. 3148 * Return: The corresponding channel, or 0 if the conversion failed.
3023 */ 3149 */
3024extern int ieee80211_frequency_to_channel(int freq); 3150int ieee80211_frequency_to_channel(int freq);
3025 3151
3026/* 3152/*
3027 * Name indirection necessary because the ieee80211 code also has 3153 * Name indirection necessary because the ieee80211 code also has
@@ -3030,8 +3156,8 @@ extern int ieee80211_frequency_to_channel(int freq);
3030 * to include both header files you'll (rightfully!) get a symbol 3156 * to include both header files you'll (rightfully!) get a symbol
3031 * clash. 3157 * clash.
3032 */ 3158 */
3033extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, 3159struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy,
3034 int freq); 3160 int freq);
3035/** 3161/**
3036 * ieee80211_get_channel - get channel struct from wiphy for specified frequency 3162 * ieee80211_get_channel - get channel struct from wiphy for specified frequency
3037 * @wiphy: the struct wiphy to get the channel for 3163 * @wiphy: the struct wiphy to get the channel for
@@ -3063,11 +3189,13 @@ ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
3063/** 3189/**
3064 * ieee80211_mandatory_rates - get mandatory rates for a given band 3190 * ieee80211_mandatory_rates - get mandatory rates for a given band
3065 * @sband: the band to look for rates in 3191 * @sband: the band to look for rates in
3192 * @scan_width: width of the control channel
3066 * 3193 *
3067 * This function returns a bitmap of the mandatory rates for the given 3194 * This function returns a bitmap of the mandatory rates for the given
3068 * band, bits are set according to the rate position in the bitrates array. 3195 * band, bits are set according to the rate position in the bitrates array.
3069 */ 3196 */
3070u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband); 3197u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband,
3198 enum nl80211_bss_scan_width scan_width);
3071 3199
3072/* 3200/*
3073 * Radiotap parsing functions -- for controlled injection support 3201 * Radiotap parsing functions -- for controlled injection support
@@ -3141,13 +3269,14 @@ struct ieee80211_radiotap_iterator {
3141 int _reset_on_ext; 3269 int _reset_on_ext;
3142}; 3270};
3143 3271
3144extern int ieee80211_radiotap_iterator_init( 3272int
3145 struct ieee80211_radiotap_iterator *iterator, 3273ieee80211_radiotap_iterator_init(struct ieee80211_radiotap_iterator *iterator,
3146 struct ieee80211_radiotap_header *radiotap_header, 3274 struct ieee80211_radiotap_header *radiotap_header,
3147 int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns); 3275 int max_length,
3276 const struct ieee80211_radiotap_vendor_namespaces *vns);
3148 3277
3149extern int ieee80211_radiotap_iterator_next( 3278int
3150 struct ieee80211_radiotap_iterator *iterator); 3279ieee80211_radiotap_iterator_next(struct ieee80211_radiotap_iterator *iterator);
3151 3280
3152 3281
3153extern const unsigned char rfc1042_header[6]; 3282extern const unsigned char rfc1042_header[6];
@@ -3307,7 +3436,7 @@ const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type,
3307 * 3436 *
3308 * Return: 0 on success. -ENOMEM. 3437 * Return: 0 on success. -ENOMEM.
3309 */ 3438 */
3310extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2); 3439int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3311 3440
3312/** 3441/**
3313 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain 3442 * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain
@@ -3321,9 +3450,8 @@ extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2);
3321 * default channel settings will be disregarded. If no rule is found for a 3450 * default channel settings will be disregarded. If no rule is found for a
3322 * channel on the regulatory domain the channel will be disabled. 3451 * channel on the regulatory domain the channel will be disabled.
3323 */ 3452 */
3324extern void wiphy_apply_custom_regulatory( 3453void wiphy_apply_custom_regulatory(struct wiphy *wiphy,
3325 struct wiphy *wiphy, 3454 const struct ieee80211_regdomain *regd);
3326 const struct ieee80211_regdomain *regd);
3327 3455
3328/** 3456/**
3329 * freq_reg_info - get regulatory information for the given frequency 3457 * freq_reg_info - get regulatory information for the given frequency
@@ -3379,10 +3507,11 @@ void cfg80211_sched_scan_results(struct wiphy *wiphy);
3379void cfg80211_sched_scan_stopped(struct wiphy *wiphy); 3507void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
3380 3508
3381/** 3509/**
3382 * cfg80211_inform_bss_frame - inform cfg80211 of a received BSS frame 3510 * cfg80211_inform_bss_width_frame - inform cfg80211 of a received BSS frame
3383 * 3511 *
3384 * @wiphy: the wiphy reporting the BSS 3512 * @wiphy: the wiphy reporting the BSS
3385 * @channel: The channel the frame was received on 3513 * @channel: The channel the frame was received on
3514 * @scan_width: width of the control channel
3386 * @mgmt: the management frame (probe response or beacon) 3515 * @mgmt: the management frame (probe response or beacon)
3387 * @len: length of the management frame 3516 * @len: length of the management frame
3388 * @signal: the signal strength, type depends on the wiphy's signal_type 3517 * @signal: the signal strength, type depends on the wiphy's signal_type
@@ -3395,16 +3524,29 @@ void cfg80211_sched_scan_stopped(struct wiphy *wiphy);
3395 * Or %NULL on error. 3524 * Or %NULL on error.
3396 */ 3525 */
3397struct cfg80211_bss * __must_check 3526struct cfg80211_bss * __must_check
3527cfg80211_inform_bss_width_frame(struct wiphy *wiphy,
3528 struct ieee80211_channel *channel,
3529 enum nl80211_bss_scan_width scan_width,
3530 struct ieee80211_mgmt *mgmt, size_t len,
3531 s32 signal, gfp_t gfp);
3532
3533static inline struct cfg80211_bss * __must_check
3398cfg80211_inform_bss_frame(struct wiphy *wiphy, 3534cfg80211_inform_bss_frame(struct wiphy *wiphy,
3399 struct ieee80211_channel *channel, 3535 struct ieee80211_channel *channel,
3400 struct ieee80211_mgmt *mgmt, size_t len, 3536 struct ieee80211_mgmt *mgmt, size_t len,
3401 s32 signal, gfp_t gfp); 3537 s32 signal, gfp_t gfp)
3538{
3539 return cfg80211_inform_bss_width_frame(wiphy, channel,
3540 NL80211_BSS_CHAN_WIDTH_20,
3541 mgmt, len, signal, gfp);
3542}
3402 3543
3403/** 3544/**
3404 * cfg80211_inform_bss - inform cfg80211 of a new BSS 3545 * cfg80211_inform_bss - inform cfg80211 of a new BSS
3405 * 3546 *
3406 * @wiphy: the wiphy reporting the BSS 3547 * @wiphy: the wiphy reporting the BSS
3407 * @channel: The channel the frame was received on 3548 * @channel: The channel the frame was received on
3549 * @scan_width: width of the control channel
3408 * @bssid: the BSSID of the BSS 3550 * @bssid: the BSSID of the BSS
3409 * @tsf: the TSF sent by the peer in the beacon/probe response (or 0) 3551 * @tsf: the TSF sent by the peer in the beacon/probe response (or 0)
3410 * @capability: the capability field sent by the peer 3552 * @capability: the capability field sent by the peer
@@ -3421,11 +3563,26 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy,
3421 * Or %NULL on error. 3563 * Or %NULL on error.
3422 */ 3564 */
3423struct cfg80211_bss * __must_check 3565struct cfg80211_bss * __must_check
3566cfg80211_inform_bss_width(struct wiphy *wiphy,
3567 struct ieee80211_channel *channel,
3568 enum nl80211_bss_scan_width scan_width,
3569 const u8 *bssid, u64 tsf, u16 capability,
3570 u16 beacon_interval, const u8 *ie, size_t ielen,
3571 s32 signal, gfp_t gfp);
3572
3573static inline struct cfg80211_bss * __must_check
3424cfg80211_inform_bss(struct wiphy *wiphy, 3574cfg80211_inform_bss(struct wiphy *wiphy,
3425 struct ieee80211_channel *channel, 3575 struct ieee80211_channel *channel,
3426 const u8 *bssid, u64 tsf, u16 capability, 3576 const u8 *bssid, u64 tsf, u16 capability,
3427 u16 beacon_interval, const u8 *ie, size_t ielen, 3577 u16 beacon_interval, const u8 *ie, size_t ielen,
3428 s32 signal, gfp_t gfp); 3578 s32 signal, gfp_t gfp)
3579{
3580 return cfg80211_inform_bss_width(wiphy, channel,
3581 NL80211_BSS_CHAN_WIDTH_20,
3582 bssid, tsf, capability,
3583 beacon_interval, ie, ielen, signal,
3584 gfp);
3585}
3429 3586
3430struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, 3587struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
3431 struct ieee80211_channel *channel, 3588 struct ieee80211_channel *channel,
@@ -3471,6 +3628,19 @@ void cfg80211_put_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3471 */ 3628 */
3472void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); 3629void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
3473 3630
3631static inline enum nl80211_bss_scan_width
3632cfg80211_chandef_to_scan_width(const struct cfg80211_chan_def *chandef)
3633{
3634 switch (chandef->width) {
3635 case NL80211_CHAN_WIDTH_5:
3636 return NL80211_BSS_CHAN_WIDTH_5;
3637 case NL80211_CHAN_WIDTH_10:
3638 return NL80211_BSS_CHAN_WIDTH_10;
3639 default:
3640 return NL80211_BSS_CHAN_WIDTH_20;
3641 }
3642}
3643
3474/** 3644/**
3475 * cfg80211_rx_mlme_mgmt - notification of processed MLME management frame 3645 * cfg80211_rx_mlme_mgmt - notification of processed MLME management frame
3476 * @dev: network device 3646 * @dev: network device
@@ -3886,6 +4056,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
3886 * @sig_dbm: signal strength in mBm, or 0 if unknown 4056 * @sig_dbm: signal strength in mBm, or 0 if unknown
3887 * @buf: Management frame (header + body) 4057 * @buf: Management frame (header + body)
3888 * @len: length of the frame data 4058 * @len: length of the frame data
4059 * @flags: flags, as defined in enum nl80211_rxmgmt_flags
3889 * @gfp: context flags 4060 * @gfp: context flags
3890 * 4061 *
3891 * This function is called whenever an Action frame is received for a station 4062 * This function is called whenever an Action frame is received for a station
@@ -3897,7 +4068,7 @@ void cfg80211_conn_failed(struct net_device *dev, const u8 *mac_addr,
3897 * driver is responsible for rejecting the frame. 4068 * driver is responsible for rejecting the frame.
3898 */ 4069 */
3899bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm, 4070bool cfg80211_rx_mgmt(struct wireless_dev *wdev, int freq, int sig_dbm,
3900 const u8 *buf, size_t len, gfp_t gfp); 4071 const u8 *buf, size_t len, u32 flags, gfp_t gfp);
3901 4072
3902/** 4073/**
3903 * cfg80211_mgmt_tx_status - notification of TX status for management frame 4074 * cfg80211_mgmt_tx_status - notification of TX status for management frame
diff --git a/include/net/checksum.h b/include/net/checksum.h
index 600d1d705bb8..8f59ca50477c 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -107,11 +107,11 @@ static inline void csum_replace2(__sum16 *sum, __be16 from, __be16 to)
107} 107}
108 108
109struct sk_buff; 109struct sk_buff;
110extern void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb, 110void inet_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb,
111 __be32 from, __be32 to, int pseudohdr); 111 __be32 from, __be32 to, int pseudohdr);
112extern void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb, 112void inet_proto_csum_replace16(__sum16 *sum, struct sk_buff *skb,
113 const __be32 *from, const __be32 *to, 113 const __be32 *from, const __be32 *to,
114 int pseudohdr); 114 int pseudohdr);
115 115
116static inline void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb, 116static inline void inet_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb,
117 __be16 from, __be16 to, 117 __be16 from, __be16 to,
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index 0fee0617fb7d..33d03b648646 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -24,7 +24,7 @@ struct cgroup_cls_state
24 u32 classid; 24 u32 classid;
25}; 25};
26 26
27extern void sock_update_classid(struct sock *sk); 27void sock_update_classid(struct sock *sk);
28 28
29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) 29#if IS_BUILTIN(CONFIG_NET_CLS_CGROUP)
30static inline u32 task_cls_classid(struct task_struct *p) 30static inline u32 task_cls_classid(struct task_struct *p)
@@ -35,7 +35,7 @@ static inline u32 task_cls_classid(struct task_struct *p)
35 return 0; 35 return 0;
36 36
37 rcu_read_lock(); 37 rcu_read_lock();
38 classid = container_of(task_subsys_state(p, net_cls_subsys_id), 38 classid = container_of(task_css(p, net_cls_subsys_id),
39 struct cgroup_cls_state, css)->classid; 39 struct cgroup_cls_state, css)->classid;
40 rcu_read_unlock(); 40 rcu_read_unlock();
41 41
@@ -51,7 +51,7 @@ static inline u32 task_cls_classid(struct task_struct *p)
51 return 0; 51 return 0;
52 52
53 rcu_read_lock(); 53 rcu_read_lock();
54 css = task_subsys_state(p, net_cls_subsys_id); 54 css = task_css(p, net_cls_subsys_id);
55 if (css) 55 if (css)
56 classid = container_of(css, 56 classid = container_of(css,
57 struct cgroup_cls_state, css)->classid; 57 struct cgroup_cls_state, css)->classid;
diff --git a/include/net/dst.h b/include/net/dst.h
index 1f8fd109e225..3bc4865f8267 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -311,11 +311,13 @@ static inline void skb_dst_force(struct sk_buff *skb)
311 * __skb_tunnel_rx - prepare skb for rx reinsert 311 * __skb_tunnel_rx - prepare skb for rx reinsert
312 * @skb: buffer 312 * @skb: buffer
313 * @dev: tunnel device 313 * @dev: tunnel device
314 * @net: netns for packet i/o
314 * 315 *
315 * After decapsulation, packet is going to re-enter (netif_rx()) our stack, 316 * After decapsulation, packet is going to re-enter (netif_rx()) our stack,
316 * so make some cleanups. (no accounting done) 317 * so make some cleanups. (no accounting done)
317 */ 318 */
318static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) 319static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
320 struct net *net)
319{ 321{
320 skb->dev = dev; 322 skb->dev = dev;
321 323
@@ -327,8 +329,7 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
327 if (!skb->l4_rxhash) 329 if (!skb->l4_rxhash)
328 skb->rxhash = 0; 330 skb->rxhash = 0;
329 skb_set_queue_mapping(skb, 0); 331 skb_set_queue_mapping(skb, 0);
330 skb_dst_drop(skb); 332 skb_scrub_packet(skb, !net_eq(net, dev_net(dev)));
331 nf_reset(skb);
332} 333}
333 334
334/** 335/**
@@ -340,12 +341,13 @@ static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
340 * so make some cleanups, and perform accounting. 341 * so make some cleanups, and perform accounting.
341 * Note: this accounting is not SMP safe. 342 * Note: this accounting is not SMP safe.
342 */ 343 */
343static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) 344static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev,
345 struct net *net)
344{ 346{
345 /* TODO : stats should be SMP safe */ 347 /* TODO : stats should be SMP safe */
346 dev->stats.rx_packets++; 348 dev->stats.rx_packets++;
347 dev->stats.rx_bytes += skb->len; 349 dev->stats.rx_bytes += skb->len;
348 __skb_tunnel_rx(skb, dev); 350 __skb_tunnel_rx(skb, dev, net);
349} 351}
350 352
351/* Children define the path of the packet through the 353/* Children define the path of the packet through the
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index e361f4882426..4b2b557fb0e8 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -10,21 +10,25 @@
10 10
11struct fib_rule { 11struct fib_rule {
12 struct list_head list; 12 struct list_head list;
13 atomic_t refcnt;
14 int iifindex; 13 int iifindex;
15 int oifindex; 14 int oifindex;
16 u32 mark; 15 u32 mark;
17 u32 mark_mask; 16 u32 mark_mask;
18 u32 pref;
19 u32 flags; 17 u32 flags;
20 u32 table; 18 u32 table;
21 u8 action; 19 u8 action;
20 /* 3 bytes hole, try to use */
22 u32 target; 21 u32 target;
23 struct fib_rule __rcu *ctarget; 22 struct fib_rule __rcu *ctarget;
23 struct net *fr_net;
24
25 atomic_t refcnt;
26 u32 pref;
27 int suppress_ifgroup;
28 int suppress_prefixlen;
24 char iifname[IFNAMSIZ]; 29 char iifname[IFNAMSIZ];
25 char oifname[IFNAMSIZ]; 30 char oifname[IFNAMSIZ];
26 struct rcu_head rcu; 31 struct rcu_head rcu;
27 struct net * fr_net;
28}; 32};
29 33
30struct fib_lookup_arg { 34struct fib_lookup_arg {
@@ -46,6 +50,8 @@ struct fib_rules_ops {
46 int (*action)(struct fib_rule *, 50 int (*action)(struct fib_rule *,
47 struct flowi *, int, 51 struct flowi *, int,
48 struct fib_lookup_arg *); 52 struct fib_lookup_arg *);
53 bool (*suppress)(struct fib_rule *,
54 struct fib_lookup_arg *);
49 int (*match)(struct fib_rule *, 55 int (*match)(struct fib_rule *,
50 struct flowi *, int); 56 struct flowi *, int);
51 int (*configure)(struct fib_rule *, 57 int (*configure)(struct fib_rule *,
@@ -80,6 +86,8 @@ struct fib_rules_ops {
80 [FRA_FWMARK] = { .type = NLA_U32 }, \ 86 [FRA_FWMARK] = { .type = NLA_U32 }, \
81 [FRA_FWMASK] = { .type = NLA_U32 }, \ 87 [FRA_FWMASK] = { .type = NLA_U32 }, \
82 [FRA_TABLE] = { .type = NLA_U32 }, \ 88 [FRA_TABLE] = { .type = NLA_U32 }, \
89 [FRA_SUPPRESS_PREFIXLEN] = { .type = NLA_U32 }, \
90 [FRA_SUPPRESS_IFGROUP] = { .type = NLA_U32 }, \
83 [FRA_GOTO] = { .type = NLA_U32 } 91 [FRA_GOTO] = { .type = NLA_U32 }
84 92
85static inline void fib_rule_get(struct fib_rule *rule) 93static inline void fib_rule_get(struct fib_rule *rule)
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index 93024a47e0e2..8e0b6c856a13 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -61,6 +61,7 @@ struct genl_family {
61 struct list_head ops_list; /* private */ 61 struct list_head ops_list; /* private */
62 struct list_head family_list; /* private */ 62 struct list_head family_list; /* private */
63 struct list_head mcast_groups; /* private */ 63 struct list_head mcast_groups; /* private */
64 struct module *module;
64}; 65};
65 66
66/** 67/**
@@ -121,9 +122,24 @@ struct genl_ops {
121 struct list_head ops_list; 122 struct list_head ops_list;
122}; 123};
123 124
124extern int genl_register_family(struct genl_family *family); 125extern int __genl_register_family(struct genl_family *family);
125extern int genl_register_family_with_ops(struct genl_family *family, 126
127static inline int genl_register_family(struct genl_family *family)
128{
129 family->module = THIS_MODULE;
130 return __genl_register_family(family);
131}
132
133extern int __genl_register_family_with_ops(struct genl_family *family,
126 struct genl_ops *ops, size_t n_ops); 134 struct genl_ops *ops, size_t n_ops);
135
136static inline int genl_register_family_with_ops(struct genl_family *family,
137 struct genl_ops *ops, size_t n_ops)
138{
139 family->module = THIS_MODULE;
140 return __genl_register_family_with_ops(family, ops, n_ops);
141}
142
127extern int genl_unregister_family(struct genl_family *family); 143extern int genl_unregister_family(struct genl_family *family);
128extern int genl_register_ops(struct genl_family *, struct genl_ops *ops); 144extern int genl_register_ops(struct genl_family *, struct genl_ops *ops);
129extern int genl_unregister_ops(struct genl_family *, struct genl_ops *ops); 145extern int genl_unregister_ops(struct genl_family *, struct genl_ops *ops);
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index c6d07cb074bc..8b5b71433297 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -230,6 +230,10 @@ enum ieee80211_radiotap_type {
230#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ 230#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */
231#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ 231#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */
232#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ 232#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */
233#define IEEE80211_CHAN_GSM 0x1000 /* GSM (900 MHz) */
234#define IEEE80211_CHAN_STURBO 0x2000 /* Static Turbo */
235#define IEEE80211_CHAN_HALF 0x4000 /* Half channel (10 MHz wide) */
236#define IEEE80211_CHAN_QUARTER 0x8000 /* Quarter channel (5 MHz wide) */
233 237
234/* For IEEE80211_RADIOTAP_FLAGS */ 238/* For IEEE80211_RADIOTAP_FLAGS */
235#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received 239#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 736b5fb95474..02ef7727bb55 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -171,12 +171,17 @@ struct inet6_dev {
171 struct ifmcaddr6 *mc_list; 171 struct ifmcaddr6 *mc_list;
172 struct ifmcaddr6 *mc_tomb; 172 struct ifmcaddr6 *mc_tomb;
173 spinlock_t mc_lock; 173 spinlock_t mc_lock;
174 unsigned char mc_qrv; 174
175 unsigned char mc_qrv; /* Query Robustness Variable */
175 unsigned char mc_gq_running; 176 unsigned char mc_gq_running;
176 unsigned char mc_ifc_count; 177 unsigned char mc_ifc_count;
177 unsigned char mc_dad_count; 178 unsigned char mc_dad_count;
178 unsigned long mc_v1_seen; 179
180 unsigned long mc_v1_seen; /* Max time we stay in MLDv1 mode */
181 unsigned long mc_qi; /* Query Interval */
182 unsigned long mc_qri; /* Query Response Interval */
179 unsigned long mc_maxdelay; 183 unsigned long mc_maxdelay;
184
180 struct timer_list mc_gq_timer; /* general query timer */ 185 struct timer_list mc_gq_timer; /* general query timer */
181 struct timer_list mc_ifc_timer; /* interface change timer */ 186 struct timer_list mc_ifc_timer; /* interface change timer */
182 struct timer_list mc_dad_timer; /* dad complete mc timer */ 187 struct timer_list mc_dad_timer; /* dad complete mc timer */
diff --git a/include/net/ip.h b/include/net/ip.h
index a68f838a132c..48f55979d842 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -194,7 +194,17 @@ static inline u64 snmp_fold_field64(void __percpu *mib[], int offt, size_t syncp
194} 194}
195#endif 195#endif
196extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align); 196extern int snmp_mib_init(void __percpu *ptr[2], size_t mibsize, size_t align);
197extern void snmp_mib_free(void __percpu *ptr[2]); 197
198static inline void snmp_mib_free(void __percpu *ptr[SNMP_ARRAY_SZ])
199{
200 int i;
201
202 BUG_ON(ptr == NULL);
203 for (i = 0; i < SNMP_ARRAY_SZ; i++) {
204 free_percpu(ptr[i]);
205 ptr[i] = NULL;
206 }
207}
198 208
199extern struct local_ports { 209extern struct local_ports {
200 seqlock_t lock; 210 seqlock_t lock;
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 260f83f16bcf..f525e7038cca 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -112,8 +112,6 @@ extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
112 const struct in6_addr *addr, 112 const struct in6_addr *addr,
113 bool anycast); 113 bool anycast);
114 114
115extern int ip6_dst_hoplimit(struct dst_entry *dst);
116
117/* 115/*
118 * support functions for ND 116 * support functions for ND
119 * 117 *
@@ -135,6 +133,8 @@ extern void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu,
135extern void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, 133extern void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk,
136 __be32 mtu); 134 __be32 mtu);
137extern void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark); 135extern void ip6_redirect(struct sk_buff *skb, struct net *net, int oif, u32 mark);
136extern void ip6_redirect_no_header(struct sk_buff *skb, struct net *net, int oif,
137 u32 mark);
138extern void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk); 138extern void ip6_sk_redirect(struct sk_buff *skb, struct sock *sk);
139 139
140struct netlink_callback; 140struct netlink_callback;
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 4da5de10d1d4..6d1549c4893c 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -36,6 +36,7 @@ struct __ip6_tnl_parm {
36struct ip6_tnl { 36struct ip6_tnl {
37 struct ip6_tnl __rcu *next; /* next tunnel in list */ 37 struct ip6_tnl __rcu *next; /* next tunnel in list */
38 struct net_device *dev; /* virtual device associated with tunnel */ 38 struct net_device *dev; /* virtual device associated with tunnel */
39 struct net *net; /* netns for packet i/o */
39 struct __ip6_tnl_parm parms; /* tunnel configuration parameters */ 40 struct __ip6_tnl_parm parms; /* tunnel configuration parameters */
40 struct flowi fl; /* flowi template for xmit */ 41 struct flowi fl; /* flowi template for xmit */
41 struct dst_entry *dst_cache; /* cached dst */ 42 struct dst_entry *dst_cache; /* cached dst */
@@ -74,7 +75,6 @@ static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
74 struct net_device_stats *stats = &dev->stats; 75 struct net_device_stats *stats = &dev->stats;
75 int pkt_len, err; 76 int pkt_len, err;
76 77
77 nf_reset(skb);
78 pkt_len = skb->len; 78 pkt_len = skb->len;
79 err = ip6_local_out(skb); 79 err = ip6_local_out(skb);
80 80
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index 781b3cf86a2f..a0a4a100f5c9 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -86,12 +86,12 @@ struct tnl_ptk_info {
86#define PACKET_RCVD 0 86#define PACKET_RCVD 0
87#define PACKET_REJECT 1 87#define PACKET_REJECT 1
88 88
89#define IP_TNL_HASH_BITS 10 89#define IP_TNL_HASH_BITS 7
90#define IP_TNL_HASH_SIZE (1 << IP_TNL_HASH_BITS) 90#define IP_TNL_HASH_SIZE (1 << IP_TNL_HASH_BITS)
91 91
92struct ip_tunnel_net { 92struct ip_tunnel_net {
93 struct hlist_head *tunnels;
94 struct net_device *fb_tunnel_dev; 93 struct net_device *fb_tunnel_dev;
94 struct hlist_head tunnels[IP_TNL_HASH_SIZE];
95}; 95};
96 96
97#ifdef CONFIG_INET 97#ifdef CONFIG_INET
@@ -102,7 +102,7 @@ void ip_tunnel_dellink(struct net_device *dev, struct list_head *head);
102int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, 102int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id,
103 struct rtnl_link_ops *ops, char *devname); 103 struct rtnl_link_ops *ops, char *devname);
104 104
105void ip_tunnel_delete_net(struct ip_tunnel_net *itn); 105void ip_tunnel_delete_net(struct ip_tunnel_net *itn, struct rtnl_link_ops *ops);
106 106
107void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, 107void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev,
108 const struct iphdr *tnl_params, const u8 protocol); 108 const struct iphdr *tnl_params, const u8 protocol);
@@ -145,25 +145,10 @@ static inline u8 ip_tunnel_ecn_encap(u8 tos, const struct iphdr *iph,
145 return INET_ECN_encapsulate(tos, inner); 145 return INET_ECN_encapsulate(tos, inner);
146} 146}
147 147
148static inline void tunnel_ip_select_ident(struct sk_buff *skb,
149 const struct iphdr *old_iph,
150 struct dst_entry *dst)
151{
152 struct iphdr *iph = ip_hdr(skb);
153
154 /* Use inner packet iph-id if possible. */
155 if (skb->protocol == htons(ETH_P_IP) && old_iph->id)
156 iph->id = old_iph->id;
157 else
158 __ip_select_ident(iph, dst,
159 (skb_shinfo(skb)->gso_segs ?: 1) - 1);
160}
161
162int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto); 148int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto);
163int iptunnel_xmit(struct net *net, struct rtable *rt, 149int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb,
164 struct sk_buff *skb,
165 __be32 src, __be32 dst, __u8 proto, 150 __be32 src, __be32 dst, __u8 proto,
166 __u8 tos, __u8 ttl, __be16 df); 151 __u8 tos, __u8 ttl, __be16 df, bool xnet);
167 152
168static inline void iptunnel_xmit_stats(int err, 153static inline void iptunnel_xmit_stats(int err,
169 struct net_device_stats *err_stats, 154 struct net_device_stats *err_stats,
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 5fe564985171..bbf1c8fb8511 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -41,6 +41,7 @@
41#define NEXTHDR_ICMP 58 /* ICMP for IPv6. */ 41#define NEXTHDR_ICMP 58 /* ICMP for IPv6. */
42#define NEXTHDR_NONE 59 /* No next header */ 42#define NEXTHDR_NONE 59 /* No next header */
43#define NEXTHDR_DEST 60 /* Destination options header. */ 43#define NEXTHDR_DEST 60 /* Destination options header. */
44#define NEXTHDR_SCTP 132 /* SCTP message. */
44#define NEXTHDR_MOBILITY 135 /* Mobility header. */ 45#define NEXTHDR_MOBILITY 135 /* Mobility header. */
45 46
46#define NEXTHDR_MAX 255 47#define NEXTHDR_MAX 255
@@ -657,6 +658,8 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
657 658
658extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt); 659extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
659 660
661extern int ip6_dst_hoplimit(struct dst_entry *dst);
662
660/* 663/*
661 * Header manipulation 664 * Header manipulation
662 */ 665 */
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h
index 0af8b8dfbc22..550c2d6ec7ff 100644
--- a/include/net/irda/irlan_common.h
+++ b/include/net/irda/irlan_common.h
@@ -32,6 +32,7 @@
32#include <linux/types.h> 32#include <linux/types.h>
33#include <linux/skbuff.h> 33#include <linux/skbuff.h>
34#include <linux/netdevice.h> 34#include <linux/netdevice.h>
35#include <linux/if_ether.h>
35 36
36#include <net/irda/irttp.h> 37#include <net/irda/irttp.h>
37 38
@@ -161,7 +162,7 @@ struct irlan_provider_cb {
161 int access_type; /* Access type */ 162 int access_type; /* Access type */
162 __u16 send_arb_val; 163 __u16 send_arb_val;
163 164
164 __u8 mac_address[6]; /* Generated MAC address for peer device */ 165 __u8 mac_address[ETH_ALEN]; /* Generated MAC address for peer device */
165}; 166};
166 167
167/* 168/*
diff --git a/include/net/llc_if.h b/include/net/llc_if.h
index b595a004d31b..f0cb909b60eb 100644
--- a/include/net/llc_if.h
+++ b/include/net/llc_if.h
@@ -62,36 +62,6 @@
62#define LLC_STATUS_CONFLICT 7 /* disconnect conn */ 62#define LLC_STATUS_CONFLICT 7 /* disconnect conn */
63#define LLC_STATUS_RESET_DONE 8 /* */ 63#define LLC_STATUS_RESET_DONE 8 /* */
64 64
65/**
66 * llc_mac_null - determines if a address is a null mac address
67 * @mac: Mac address to test if null.
68 *
69 * Determines if a given address is a null mac address. Returns 0 if the
70 * address is not a null mac, 1 if the address is a null mac.
71 */
72static inline int llc_mac_null(const u8 *mac)
73{
74 return is_zero_ether_addr(mac);
75}
76
77static inline int llc_mac_multicast(const u8 *mac)
78{
79 return is_multicast_ether_addr(mac);
80}
81/**
82 * llc_mac_match - determines if two mac addresses are the same
83 * @mac1: First mac address to compare.
84 * @mac2: Second mac address to compare.
85 *
86 * Determines if two given mac address are the same. Returns 0 if there
87 * is not a complete match up to len, 1 if a complete match up to len is
88 * found.
89 */
90static inline int llc_mac_match(const u8 *mac1, const u8 *mac2)
91{
92 return !compare_ether_addr(mac1, mac2);
93}
94
95extern int llc_establish_connection(struct sock *sk, u8 *lmac, 65extern int llc_establish_connection(struct sock *sk, u8 *lmac,
96 u8 *dmac, u8 dsap); 66 u8 *dmac, u8 dsap);
97extern int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb); 67extern int llc_build_and_send_pkt(struct sock *sk, struct sk_buff *skb);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5b7a3dadadde..cc6035f1a2f1 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -152,11 +152,14 @@ struct ieee80211_low_level_stats {
152 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed 152 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed
153 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed 153 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed
154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed 154 * @IEEE80211_CHANCTX_CHANGE_RADAR: radar detection flag changed
155 * @IEEE80211_CHANCTX_CHANGE_CHANNEL: switched to another operating channel,
156 * this is used only with channel switching with CSA
155 */ 157 */
156enum ieee80211_chanctx_change { 158enum ieee80211_chanctx_change {
157 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), 159 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
158 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), 160 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
159 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2), 161 IEEE80211_CHANCTX_CHANGE_RADAR = BIT(2),
162 IEEE80211_CHANCTX_CHANGE_CHANNEL = BIT(3),
160}; 163};
161 164
162/** 165/**
@@ -372,7 +375,7 @@ struct ieee80211_bss_conf {
372}; 375};
373 376
374/** 377/**
375 * enum mac80211_tx_control_flags - flags to describe transmission information/status 378 * enum mac80211_tx_info_flags - flags to describe transmission information/status
376 * 379 *
377 * These flags are used with the @flags member of &ieee80211_tx_info. 380 * These flags are used with the @flags member of &ieee80211_tx_info.
378 * 381 *
@@ -468,7 +471,7 @@ struct ieee80211_bss_conf {
468 * Note: If you have to add new flags to the enumeration, then don't 471 * Note: If you have to add new flags to the enumeration, then don't
469 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. 472 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
470 */ 473 */
471enum mac80211_tx_control_flags { 474enum mac80211_tx_info_flags {
472 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 475 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
473 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(1), 476 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(1),
474 IEEE80211_TX_CTL_NO_ACK = BIT(2), 477 IEEE80211_TX_CTL_NO_ACK = BIT(2),
@@ -504,6 +507,18 @@ enum mac80211_tx_control_flags {
504 507
505#define IEEE80211_TX_CTL_STBC_SHIFT 23 508#define IEEE80211_TX_CTL_STBC_SHIFT 23
506 509
510/**
511 * enum mac80211_tx_control_flags - flags to describe transmit control
512 *
513 * @IEEE80211_TX_CTRL_PORT_CTRL_PROTO: this frame is a port control
514 * protocol frame (e.g. EAP)
515 *
516 * These flags are used in tx_info->control.flags.
517 */
518enum mac80211_tx_control_flags {
519 IEEE80211_TX_CTRL_PORT_CTRL_PROTO = BIT(0),
520};
521
507/* 522/*
508 * This definition is used as a mask to clear all temporary flags, which are 523 * This definition is used as a mask to clear all temporary flags, which are
509 * set by the tx handlers for each transmission attempt by the mac80211 stack. 524 * set by the tx handlers for each transmission attempt by the mac80211 stack.
@@ -677,7 +692,8 @@ struct ieee80211_tx_info {
677 /* NB: vif can be NULL for injected frames */ 692 /* NB: vif can be NULL for injected frames */
678 struct ieee80211_vif *vif; 693 struct ieee80211_vif *vif;
679 struct ieee80211_key_conf *hw_key; 694 struct ieee80211_key_conf *hw_key;
680 /* 8 bytes free */ 695 u32 flags;
696 /* 4 bytes free */
681 } control; 697 } control;
682 struct { 698 struct {
683 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES]; 699 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES];
@@ -811,6 +827,8 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
811 * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC 827 * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC
812 * is stored in the @ampdu_delimiter_crc field) 828 * is stored in the @ampdu_delimiter_crc field)
813 * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3 829 * @RX_FLAG_STBC_MASK: STBC 2 bit bitmask. 1 - Nss=1, 2 - Nss=2, 3 - Nss=3
830 * @RX_FLAG_10MHZ: 10 MHz (half channel) was used
831 * @RX_FLAG_5MHZ: 5 MHz (quarter channel) was used
814 */ 832 */
815enum mac80211_rx_flags { 833enum mac80211_rx_flags {
816 RX_FLAG_MMIC_ERROR = BIT(0), 834 RX_FLAG_MMIC_ERROR = BIT(0),
@@ -839,6 +857,8 @@ enum mac80211_rx_flags {
839 RX_FLAG_80P80MHZ = BIT(24), 857 RX_FLAG_80P80MHZ = BIT(24),
840 RX_FLAG_160MHZ = BIT(25), 858 RX_FLAG_160MHZ = BIT(25),
841 RX_FLAG_STBC_MASK = BIT(26) | BIT(27), 859 RX_FLAG_STBC_MASK = BIT(26) | BIT(27),
860 RX_FLAG_10MHZ = BIT(28),
861 RX_FLAG_5MHZ = BIT(29),
842}; 862};
843 863
844#define RX_FLAG_STBC_SHIFT 26 864#define RX_FLAG_STBC_SHIFT 26
@@ -1004,11 +1024,11 @@ enum ieee80211_smps_mode {
1004 * @radar_enabled: whether radar detection is enabled 1024 * @radar_enabled: whether radar detection is enabled
1005 * 1025 *
1006 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame 1026 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
1007 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11, 1027 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
1008 * but actually means the number of transmissions not the number of retries 1028 * but actually means the number of transmissions not the number of retries
1009 * @short_frame_max_tx_count: Maximum number of transmissions for a "short" 1029 * @short_frame_max_tx_count: Maximum number of transmissions for a "short"
1010 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the 1030 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the
1011 * number of transmissions not the number of retries 1031 * number of transmissions not the number of retries
1012 * 1032 *
1013 * @smps_mode: spatial multiplexing powersave mode; note that 1033 * @smps_mode: spatial multiplexing powersave mode; note that
1014 * %IEEE80211_SMPS_STATIC is used when the device is not 1034 * %IEEE80211_SMPS_STATIC is used when the device is not
@@ -1080,6 +1100,7 @@ enum ieee80211_vif_flags {
1080 * @addr: address of this interface 1100 * @addr: address of this interface
1081 * @p2p: indicates whether this AP or STA interface is a p2p 1101 * @p2p: indicates whether this AP or STA interface is a p2p
1082 * interface, i.e. a GO or p2p-sta respectively 1102 * interface, i.e. a GO or p2p-sta respectively
1103 * @csa_active: marks whether a channel switch is going on
1083 * @driver_flags: flags/capabilities the driver has for this interface, 1104 * @driver_flags: flags/capabilities the driver has for this interface,
1084 * these need to be set (or cleared) when the interface is added 1105 * these need to be set (or cleared) when the interface is added
1085 * or, if supported by the driver, the interface type is changed 1106 * or, if supported by the driver, the interface type is changed
@@ -1092,7 +1113,7 @@ enum ieee80211_vif_flags {
1092 * be off when it is %NULL there can still be races and packets could be 1113 * be off when it is %NULL there can still be races and packets could be
1093 * processed after it switches back to %NULL. 1114 * processed after it switches back to %NULL.
1094 * @debugfs_dir: debugfs dentry, can be used by drivers to create own per 1115 * @debugfs_dir: debugfs dentry, can be used by drivers to create own per
1095 * interface debug files. Note that it will be NULL for the virtual 1116 * interface debug files. Note that it will be NULL for the virtual
1096 * monitor interface (if that is requested.) 1117 * monitor interface (if that is requested.)
1097 * @drv_priv: data area for driver use, will always be aligned to 1118 * @drv_priv: data area for driver use, will always be aligned to
1098 * sizeof(void *). 1119 * sizeof(void *).
@@ -1102,6 +1123,7 @@ struct ieee80211_vif {
1102 struct ieee80211_bss_conf bss_conf; 1123 struct ieee80211_bss_conf bss_conf;
1103 u8 addr[ETH_ALEN]; 1124 u8 addr[ETH_ALEN];
1104 bool p2p; 1125 bool p2p;
1126 bool csa_active;
1105 1127
1106 u8 cab_queue; 1128 u8 cab_queue;
1107 u8 hw_queue[IEEE80211_NUM_ACS]; 1129 u8 hw_queue[IEEE80211_NUM_ACS];
@@ -1425,10 +1447,10 @@ struct ieee80211_tx_control {
1425 * the stack. 1447 * the stack.
1426 * 1448 *
1427 * @IEEE80211_HW_CONNECTION_MONITOR: 1449 * @IEEE80211_HW_CONNECTION_MONITOR:
1428 * The hardware performs its own connection monitoring, including 1450 * The hardware performs its own connection monitoring, including
1429 * periodic keep-alives to the AP and probing the AP on beacon loss. 1451 * periodic keep-alives to the AP and probing the AP on beacon loss.
1430 * When this flag is set, signaling beacon-loss will cause an immediate 1452 * When this flag is set, signaling beacon-loss will cause an immediate
1431 * change to disassociated state. 1453 * change to disassociated state.
1432 * 1454 *
1433 * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC: 1455 * @IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC:
1434 * This device needs to get data from beacon before association (i.e. 1456 * This device needs to get data from beacon before association (i.e.
@@ -1499,6 +1521,7 @@ enum ieee80211_hw_flags {
1499 IEEE80211_HW_SUPPORTS_RC_TABLE = 1<<24, 1521 IEEE80211_HW_SUPPORTS_RC_TABLE = 1<<24,
1500 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, 1522 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25,
1501 IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26, 1523 IEEE80211_HW_TIMING_BEACON_ONLY = 1<<26,
1524 IEEE80211_HW_SUPPORTS_HT_CCK_RATES = 1<<27,
1502}; 1525};
1503 1526
1504/** 1527/**
@@ -1526,10 +1549,10 @@ enum ieee80211_hw_flags {
1526 * @channel_change_time: time (in microseconds) it takes to change channels. 1549 * @channel_change_time: time (in microseconds) it takes to change channels.
1527 * 1550 *
1528 * @max_signal: Maximum value for signal (rssi) in RX information, used 1551 * @max_signal: Maximum value for signal (rssi) in RX information, used
1529 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB 1552 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB
1530 * 1553 *
1531 * @max_listen_interval: max listen interval in units of beacon interval 1554 * @max_listen_interval: max listen interval in units of beacon interval
1532 * that HW supports 1555 * that HW supports
1533 * 1556 *
1534 * @queues: number of available hardware transmit queues for 1557 * @queues: number of available hardware transmit queues for
1535 * data packets. WMM/QoS requires at least four, these 1558 * data packets. WMM/QoS requires at least four, these
@@ -2443,7 +2466,7 @@ enum ieee80211_roc_type {
2443 * The callback can sleep. 2466 * The callback can sleep.
2444 * 2467 *
2445 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware. 2468 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware.
2446 * Currently, this is only used for IBSS mode debugging. Is not a 2469 * Currently, this is only used for IBSS mode debugging. Is not a
2447 * required function. 2470 * required function.
2448 * The callback can sleep. 2471 * The callback can sleep.
2449 * 2472 *
@@ -2494,8 +2517,8 @@ enum ieee80211_roc_type {
2494 * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout 2517 * in IEEE 802.11-2007 section 17.3.8.6 and modify ACK timeout
2495 * accordingly. This callback is not required and may sleep. 2518 * accordingly. This callback is not required and may sleep.
2496 * 2519 *
2497 * @testmode_cmd: Implement a cfg80211 test mode command. 2520 * @testmode_cmd: Implement a cfg80211 test mode command. The passed @vif may
2498 * The callback can sleep. 2521 * be %NULL. The callback can sleep.
2499 * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep. 2522 * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep.
2500 * 2523 *
2501 * @flush: Flush all pending frames from the hardware queue, making sure 2524 * @flush: Flush all pending frames from the hardware queue, making sure
@@ -2633,6 +2656,16 @@ enum ieee80211_roc_type {
2633 * @ipv6_addr_change: IPv6 address assignment on the given interface changed. 2656 * @ipv6_addr_change: IPv6 address assignment on the given interface changed.
2634 * Currently, this is only called for managed or P2P client interfaces. 2657 * Currently, this is only called for managed or P2P client interfaces.
2635 * This callback is optional; it must not sleep. 2658 * This callback is optional; it must not sleep.
2659 *
2660 * @channel_switch_beacon: Starts a channel switch to a new channel.
2661 * Beacons are modified to include CSA or ECSA IEs before calling this
2662 * function. The corresponding count fields in these IEs must be
2663 * decremented, and when they reach zero the driver must call
2664 * ieee80211_csa_finish(). Drivers which use ieee80211_beacon_get()
2665 * get the csa counter decremented by mac80211, but must check if it is
2666 * zero using ieee80211_csa_is_complete() after the beacon has been
2667 * transmitted and then call ieee80211_csa_finish().
2668 *
2636 */ 2669 */
2637struct ieee80211_ops { 2670struct ieee80211_ops {
2638 void (*tx)(struct ieee80211_hw *hw, 2671 void (*tx)(struct ieee80211_hw *hw,
@@ -2746,7 +2779,8 @@ struct ieee80211_ops {
2746 void (*rfkill_poll)(struct ieee80211_hw *hw); 2779 void (*rfkill_poll)(struct ieee80211_hw *hw);
2747 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); 2780 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class);
2748#ifdef CONFIG_NL80211_TESTMODE 2781#ifdef CONFIG_NL80211_TESTMODE
2749 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); 2782 int (*testmode_cmd)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2783 void *data, int len);
2750 int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb, 2784 int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb,
2751 struct netlink_callback *cb, 2785 struct netlink_callback *cb,
2752 void *data, int len); 2786 void *data, int len);
@@ -2820,6 +2854,9 @@ struct ieee80211_ops {
2820 struct ieee80211_vif *vif, 2854 struct ieee80211_vif *vif,
2821 struct inet6_dev *idev); 2855 struct inet6_dev *idev);
2822#endif 2856#endif
2857 void (*channel_switch_beacon)(struct ieee80211_hw *hw,
2858 struct ieee80211_vif *vif,
2859 struct cfg80211_chan_def *chandef);
2823}; 2860};
2824 2861
2825/** 2862/**
@@ -2877,14 +2914,14 @@ enum ieee80211_tpt_led_trigger_flags {
2877}; 2914};
2878 2915
2879#ifdef CONFIG_MAC80211_LEDS 2916#ifdef CONFIG_MAC80211_LEDS
2880extern char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw); 2917char *__ieee80211_get_tx_led_name(struct ieee80211_hw *hw);
2881extern char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw); 2918char *__ieee80211_get_rx_led_name(struct ieee80211_hw *hw);
2882extern char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw); 2919char *__ieee80211_get_assoc_led_name(struct ieee80211_hw *hw);
2883extern char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw); 2920char *__ieee80211_get_radio_led_name(struct ieee80211_hw *hw);
2884extern char *__ieee80211_create_tpt_led_trigger( 2921char *__ieee80211_create_tpt_led_trigger(struct ieee80211_hw *hw,
2885 struct ieee80211_hw *hw, unsigned int flags, 2922 unsigned int flags,
2886 const struct ieee80211_tpt_blink *blink_table, 2923 const struct ieee80211_tpt_blink *blink_table,
2887 unsigned int blink_table_len); 2924 unsigned int blink_table_len);
2888#endif 2925#endif
2889/** 2926/**
2890 * ieee80211_get_tx_led_name - get name of TX LED 2927 * ieee80211_get_tx_led_name - get name of TX LED
@@ -3315,6 +3352,25 @@ static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
3315} 3352}
3316 3353
3317/** 3354/**
3355 * ieee80211_csa_finish - notify mac80211 about channel switch
3356 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3357 *
3358 * After a channel switch announcement was scheduled and the counter in this
3359 * announcement hit zero, this function must be called by the driver to
3360 * notify mac80211 that the channel can be changed.
3361 */
3362void ieee80211_csa_finish(struct ieee80211_vif *vif);
3363
3364/**
3365 * ieee80211_csa_is_complete - find out if counters reached zero
3366 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3367 *
3368 * This function returns whether the channel switch counters reached zero.
3369 */
3370bool ieee80211_csa_is_complete(struct ieee80211_vif *vif);
3371
3372
3373/**
3318 * ieee80211_proberesp_get - retrieve a Probe Response template 3374 * ieee80211_proberesp_get - retrieve a Probe Response template
3319 * @hw: pointer obtained from ieee80211_alloc_hw(). 3375 * @hw: pointer obtained from ieee80211_alloc_hw().
3320 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3376 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
@@ -3633,6 +3689,89 @@ void ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf,
3633 int tid, struct ieee80211_key_seq *seq); 3689 int tid, struct ieee80211_key_seq *seq);
3634 3690
3635/** 3691/**
3692 * ieee80211_set_key_tx_seq - set key TX sequence counter
3693 *
3694 * @keyconf: the parameter passed with the set key
3695 * @seq: new sequence data
3696 *
3697 * This function allows a driver to set the current TX IV/PNs for the
3698 * given key. This is useful when resuming from WoWLAN sleep and the
3699 * device may have transmitted frames using the PTK, e.g. replies to
3700 * ARP requests.
3701 *
3702 * Note that this function may only be called when no TX processing
3703 * can be done concurrently.
3704 */
3705void ieee80211_set_key_tx_seq(struct ieee80211_key_conf *keyconf,
3706 struct ieee80211_key_seq *seq);
3707
3708/**
3709 * ieee80211_set_key_rx_seq - set key RX sequence counter
3710 *
3711 * @keyconf: the parameter passed with the set key
3712 * @tid: The TID, or -1 for the management frame value (CCMP only);
3713 * the value on TID 0 is also used for non-QoS frames. For
3714 * CMAC, only TID 0 is valid.
3715 * @seq: new sequence data
3716 *
3717 * This function allows a driver to set the current RX IV/PNs for the
3718 * given key. This is useful when resuming from WoWLAN sleep and GTK
3719 * rekey may have been done while suspended. It should not be called
3720 * if IV checking is done by the device and not by mac80211.
3721 *
3722 * Note that this function may only be called when no RX processing
3723 * can be done concurrently.
3724 */
3725void ieee80211_set_key_rx_seq(struct ieee80211_key_conf *keyconf,
3726 int tid, struct ieee80211_key_seq *seq);
3727
3728/**
3729 * ieee80211_remove_key - remove the given key
3730 * @keyconf: the parameter passed with the set key
3731 *
3732 * Remove the given key. If the key was uploaded to the hardware at the
3733 * time this function is called, it is not deleted in the hardware but
3734 * instead assumed to have been removed already.
3735 *
3736 * Note that due to locking considerations this function can (currently)
3737 * only be called during key iteration (ieee80211_iter_keys().)
3738 */
3739void ieee80211_remove_key(struct ieee80211_key_conf *keyconf);
3740
3741/**
3742 * ieee80211_gtk_rekey_add - add a GTK key from rekeying during WoWLAN
3743 * @vif: the virtual interface to add the key on
3744 * @keyconf: new key data
3745 *
3746 * When GTK rekeying was done while the system was suspended, (a) new
3747 * key(s) will be available. These will be needed by mac80211 for proper
3748 * RX processing, so this function allows setting them.
3749 *
3750 * The function returns the newly allocated key structure, which will
3751 * have similar contents to the passed key configuration but point to
3752 * mac80211-owned memory. In case of errors, the function returns an
3753 * ERR_PTR(), use IS_ERR() etc.
3754 *
3755 * Note that this function assumes the key isn't added to hardware
3756 * acceleration, so no TX will be done with the key. Since it's a GTK
3757 * on managed (station) networks, this is true anyway. If the driver
3758 * calls this function from the resume callback and subsequently uses
3759 * the return code 1 to reconfigure the device, this key will be part
3760 * of the reconfiguration.
3761 *
3762 * Note that the driver should also call ieee80211_set_key_rx_seq()
3763 * for the new key for each TID to set up sequence counters properly.
3764 *
3765 * IMPORTANT: If this replaces a key that is present in the hardware,
3766 * then it will attempt to remove it during this call. In many cases
3767 * this isn't what you want, so call ieee80211_remove_key() first for
3768 * the key that's being replaced.
3769 */
3770struct ieee80211_key_conf *
3771ieee80211_gtk_rekey_add(struct ieee80211_vif *vif,
3772 struct ieee80211_key_conf *keyconf);
3773
3774/**
3636 * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying 3775 * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying
3637 * @vif: virtual interface the rekeying was done on 3776 * @vif: virtual interface the rekeying was done on
3638 * @bssid: The BSSID of the AP, for checking association 3777 * @bssid: The BSSID of the AP, for checking association
@@ -4204,8 +4343,10 @@ struct rate_control_ops {
4204 4343
4205 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp); 4344 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp);
4206 void (*rate_init)(void *priv, struct ieee80211_supported_band *sband, 4345 void (*rate_init)(void *priv, struct ieee80211_supported_band *sband,
4346 struct cfg80211_chan_def *chandef,
4207 struct ieee80211_sta *sta, void *priv_sta); 4347 struct ieee80211_sta *sta, void *priv_sta);
4208 void (*rate_update)(void *priv, struct ieee80211_supported_band *sband, 4348 void (*rate_update)(void *priv, struct ieee80211_supported_band *sband,
4349 struct cfg80211_chan_def *chandef,
4209 struct ieee80211_sta *sta, void *priv_sta, 4350 struct ieee80211_sta *sta, void *priv_sta,
4210 u32 changed); 4351 u32 changed);
4211 void (*free_sta)(void *priv, struct ieee80211_sta *sta, 4352 void (*free_sta)(void *priv, struct ieee80211_sta *sta,
diff --git a/include/net/mld.h b/include/net/mld.h
index 467143cd4e2f..faa1d161bf24 100644
--- a/include/net/mld.h
+++ b/include/net/mld.h
@@ -63,13 +63,48 @@ struct mld2_query {
63#define mld2q_mrc mld2q_hdr.icmp6_maxdelay 63#define mld2q_mrc mld2q_hdr.icmp6_maxdelay
64#define mld2q_resv1 mld2q_hdr.icmp6_dataun.un_data16[1] 64#define mld2q_resv1 mld2q_hdr.icmp6_dataun.un_data16[1]
65 65
66/* Max Response Code */ 66/* RFC3810, 5.1.3. Maximum Response Code:
67#define MLDV2_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) 67 *
68#define MLDV2_EXP(thresh, nbmant, nbexp, value) \ 68 * If Maximum Response Code >= 32768, Maximum Response Code represents a
69 ((value) < (thresh) ? (value) : \ 69 * floating-point value as follows:
70 ((MLDV2_MASK(value, nbmant) | (1<<(nbmant))) << \ 70 *
71 (MLDV2_MASK((value) >> (nbmant), nbexp) + (nbexp)))) 71 * 0 1 2 3 4 5 6 7 8 9 A B C D E F
72 72 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
73#define MLDV2_MRC(value) MLDV2_EXP(0x8000, 12, 3, value) 73 * |1| exp | mant |
74 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
75 */
76#define MLDV2_MRC_EXP(value) (((value) >> 12) & 0x0007)
77#define MLDV2_MRC_MAN(value) ((value) & 0x0fff)
78
79/* RFC3810, 5.1.9. QQIC (Querier's Query Interval Code):
80 *
81 * If QQIC >= 128, QQIC represents a floating-point value as follows:
82 *
83 * 0 1 2 3 4 5 6 7
84 * +-+-+-+-+-+-+-+-+
85 * |1| exp | mant |
86 * +-+-+-+-+-+-+-+-+
87 */
88#define MLDV2_QQIC_EXP(value) (((value) >> 4) & 0x07)
89#define MLDV2_QQIC_MAN(value) ((value) & 0x0f)
90
91static inline unsigned long mldv2_mrc(const struct mld2_query *mlh2)
92{
93 /* RFC3810, 5.1.3. Maximum Response Code */
94 unsigned long ret, mc_mrc = ntohs(mlh2->mld2q_mrc);
95
96 if (mc_mrc < 32768) {
97 ret = mc_mrc;
98 } else {
99 unsigned long mc_man, mc_exp;
100
101 mc_exp = MLDV2_MRC_EXP(mc_mrc);
102 mc_man = MLDV2_MRC_MAN(mc_mrc);
103
104 ret = (mc_man | 0x1000) << (mc_exp + 3);
105 }
106
107 return ret;
108}
74 109
75#endif 110#endif
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 6fea32340ae8..3c4211f0bed6 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -204,6 +204,11 @@ extern void ndisc_send_ns(struct net_device *dev,
204extern void ndisc_send_rs(struct net_device *dev, 204extern void ndisc_send_rs(struct net_device *dev,
205 const struct in6_addr *saddr, 205 const struct in6_addr *saddr,
206 const struct in6_addr *daddr); 206 const struct in6_addr *daddr);
207extern void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
208 const struct in6_addr *daddr,
209 const struct in6_addr *solicited_addr,
210 bool router, bool solicited, bool override,
211 bool inc_opt);
207 212
208extern void ndisc_send_redirect(struct sk_buff *skb, 213extern void ndisc_send_redirect(struct sk_buff *skb,
209 const struct in6_addr *target); 214 const struct in6_addr *target);
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 7e748ad8b50c..536501a3e58d 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -195,68 +195,67 @@ static inline void *neighbour_priv(const struct neighbour *n)
195#define NEIGH_UPDATE_F_ISROUTER 0x40000000 195#define NEIGH_UPDATE_F_ISROUTER 0x40000000
196#define NEIGH_UPDATE_F_ADMIN 0x80000000 196#define NEIGH_UPDATE_F_ADMIN 0x80000000
197 197
198extern void neigh_table_init(struct neigh_table *tbl); 198void neigh_table_init(struct neigh_table *tbl);
199extern int neigh_table_clear(struct neigh_table *tbl); 199int neigh_table_clear(struct neigh_table *tbl);
200extern struct neighbour * neigh_lookup(struct neigh_table *tbl, 200struct neighbour *neigh_lookup(struct neigh_table *tbl, const void *pkey,
201 const void *pkey, 201 struct net_device *dev);
202 struct net_device *dev); 202struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, struct net *net,
203extern struct neighbour * neigh_lookup_nodev(struct neigh_table *tbl, 203 const void *pkey);
204 struct net *net, 204struct neighbour *__neigh_create(struct neigh_table *tbl, const void *pkey,
205 const void *pkey); 205 struct net_device *dev, bool want_ref);
206extern struct neighbour * __neigh_create(struct neigh_table *tbl,
207 const void *pkey,
208 struct net_device *dev,
209 bool want_ref);
210static inline struct neighbour *neigh_create(struct neigh_table *tbl, 206static inline struct neighbour *neigh_create(struct neigh_table *tbl,
211 const void *pkey, 207 const void *pkey,
212 struct net_device *dev) 208 struct net_device *dev)
213{ 209{
214 return __neigh_create(tbl, pkey, dev, true); 210 return __neigh_create(tbl, pkey, dev, true);
215} 211}
216extern void neigh_destroy(struct neighbour *neigh); 212void neigh_destroy(struct neighbour *neigh);
217extern int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb); 213int __neigh_event_send(struct neighbour *neigh, struct sk_buff *skb);
218extern int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, 214int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags);
219 u32 flags); 215void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
220extern void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); 216int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
221extern int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); 217int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb);
222extern int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb); 218int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb);
223extern int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb); 219int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb);
224extern int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb); 220int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb);
225extern int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb); 221struct neighbour *neigh_event_ns(struct neigh_table *tbl,
226extern struct neighbour *neigh_event_ns(struct neigh_table *tbl,
227 u8 *lladdr, void *saddr, 222 u8 *lladdr, void *saddr,
228 struct net_device *dev); 223 struct net_device *dev);
229 224
230extern struct neigh_parms *neigh_parms_alloc(struct net_device *dev, struct neigh_table *tbl); 225struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
231extern void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms); 226 struct neigh_table *tbl);
227void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms);
232 228
233static inline 229static inline
234struct net *neigh_parms_net(const struct neigh_parms *parms) 230struct net *neigh_parms_net(const struct neigh_parms *parms)
235{ 231{
236 return read_pnet(&parms->net); 232 return read_pnet(&parms->net);
237} 233}
238 234
239extern unsigned long neigh_rand_reach_time(unsigned long base); 235unsigned long neigh_rand_reach_time(unsigned long base);
240 236
241extern void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p, 237void pneigh_enqueue(struct neigh_table *tbl, struct neigh_parms *p,
242 struct sk_buff *skb); 238 struct sk_buff *skb);
243extern struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev, int creat); 239struct pneigh_entry *pneigh_lookup(struct neigh_table *tbl, struct net *net,
244extern struct pneigh_entry *__pneigh_lookup(struct neigh_table *tbl, 240 const void *key, struct net_device *dev,
245 struct net *net, 241 int creat);
246 const void *key, 242struct pneigh_entry *__pneigh_lookup(struct neigh_table *tbl, struct net *net,
247 struct net_device *dev); 243 const void *key, struct net_device *dev);
248extern int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key, struct net_device *dev); 244int pneigh_delete(struct neigh_table *tbl, struct net *net, const void *key,
245 struct net_device *dev);
249 246
250static inline 247static inline struct net *pneigh_net(const struct pneigh_entry *pneigh)
251struct net *pneigh_net(const struct pneigh_entry *pneigh)
252{ 248{
253 return read_pnet(&pneigh->net); 249 return read_pnet(&pneigh->net);
254} 250}
255 251
256extern void neigh_app_ns(struct neighbour *n); 252void neigh_app_ns(struct neighbour *n);
257extern void neigh_for_each(struct neigh_table *tbl, void (*cb)(struct neighbour *, void *), void *cookie); 253void neigh_for_each(struct neigh_table *tbl,
258extern void __neigh_for_each_release(struct neigh_table *tbl, int (*cb)(struct neighbour *)); 254 void (*cb)(struct neighbour *, void *), void *cookie);
259extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_entry *)); 255void __neigh_for_each_release(struct neigh_table *tbl,
256 int (*cb)(struct neighbour *));
257void pneigh_for_each(struct neigh_table *tbl,
258 void (*cb)(struct pneigh_entry *));
260 259
261struct neigh_seq_state { 260struct neigh_seq_state {
262 struct seq_net_private p; 261 struct seq_net_private p;
@@ -270,15 +269,14 @@ struct neigh_seq_state {
270#define NEIGH_SEQ_IS_PNEIGH 0x00000002 269#define NEIGH_SEQ_IS_PNEIGH 0x00000002
271#define NEIGH_SEQ_SKIP_NOARP 0x00000004 270#define NEIGH_SEQ_SKIP_NOARP 0x00000004
272}; 271};
273extern void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *, unsigned int); 272void *neigh_seq_start(struct seq_file *, loff_t *, struct neigh_table *,
274extern void *neigh_seq_next(struct seq_file *, void *, loff_t *); 273 unsigned int);
275extern void neigh_seq_stop(struct seq_file *, void *); 274void *neigh_seq_next(struct seq_file *, void *, loff_t *);
276 275void neigh_seq_stop(struct seq_file *, void *);
277extern int neigh_sysctl_register(struct net_device *dev, 276
278 struct neigh_parms *p, 277int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
279 char *p_name, 278 char *p_name, proc_handler *proc_handler);
280 proc_handler *proc_handler); 279void neigh_sysctl_unregister(struct neigh_parms *p);
281extern void neigh_sysctl_unregister(struct neigh_parms *p);
282 280
283static inline void __neigh_parms_put(struct neigh_parms *parms) 281static inline void __neigh_parms_put(struct neigh_parms *parms)
284{ 282{
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 84e37b1ca9e1..1313456a0994 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -119,7 +119,6 @@ struct net {
119 struct netns_ipvs *ipvs; 119 struct netns_ipvs *ipvs;
120#endif 120#endif
121 struct sock *diag_nlsk; 121 struct sock *diag_nlsk;
122 atomic_t rt_genid;
123 atomic_t fnhe_genid; 122 atomic_t fnhe_genid;
124}; 123};
125 124
@@ -333,14 +332,42 @@ static inline void unregister_net_sysctl_table(struct ctl_table_header *header)
333} 332}
334#endif 333#endif
335 334
336static inline int rt_genid(struct net *net) 335static inline int rt_genid_ipv4(struct net *net)
337{ 336{
338 return atomic_read(&net->rt_genid); 337 return atomic_read(&net->ipv4.rt_genid);
339} 338}
340 339
341static inline void rt_genid_bump(struct net *net) 340static inline void rt_genid_bump_ipv4(struct net *net)
342{ 341{
343 atomic_inc(&net->rt_genid); 342 atomic_inc(&net->ipv4.rt_genid);
343}
344
345#if IS_ENABLED(CONFIG_IPV6)
346static inline int rt_genid_ipv6(struct net *net)
347{
348 return atomic_read(&net->ipv6.rt_genid);
349}
350
351static inline void rt_genid_bump_ipv6(struct net *net)
352{
353 atomic_inc(&net->ipv6.rt_genid);
354}
355#else
356static inline int rt_genid_ipv6(struct net *net)
357{
358 return 0;
359}
360
361static inline void rt_genid_bump_ipv6(struct net *net)
362{
363}
364#endif
365
366/* For callers who don't really care about whether it's IPv4 or IPv6 */
367static inline void rt_genid_bump_all(struct net *net)
368{
369 rt_genid_bump_ipv4(net);
370 rt_genid_bump_ipv6(net);
344} 371}
345 372
346static inline int fnhe_genid(struct net *net) 373static inline int fnhe_genid(struct net *net)
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 644d9c223d24..0c1288a50e8b 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -181,8 +181,7 @@ __nf_conntrack_find(struct net *net, u16 zone,
181 const struct nf_conntrack_tuple *tuple); 181 const struct nf_conntrack_tuple *tuple);
182 182
183extern int nf_conntrack_hash_check_insert(struct nf_conn *ct); 183extern int nf_conntrack_hash_check_insert(struct nf_conn *ct);
184extern void nf_ct_delete_from_lists(struct nf_conn *ct); 184bool nf_ct_delete(struct nf_conn *ct, u32 pid, int report);
185extern void nf_ct_dying_timeout(struct nf_conn *ct);
186 185
187extern void nf_conntrack_flush_report(struct net *net, u32 portid, int report); 186extern void nf_conntrack_flush_report(struct net *net, u32 portid, int report);
188 187
@@ -235,7 +234,7 @@ static inline bool nf_ct_kill(struct nf_conn *ct)
235} 234}
236 235
237/* These are for NAT. Icky. */ 236/* These are for NAT. Icky. */
238extern s16 (*nf_ct_nat_offset)(const struct nf_conn *ct, 237extern s32 (*nf_ct_nat_offset)(const struct nf_conn *ct,
239 enum ip_conntrack_dir dir, 238 enum ip_conntrack_dir dir,
240 u32 seq); 239 u32 seq);
241 240
@@ -249,7 +248,9 @@ extern void nf_ct_untracked_status_or(unsigned long bits);
249 248
250/* Iterate over all conntracks: if iter returns true, it's deleted. */ 249/* Iterate over all conntracks: if iter returns true, it's deleted. */
251extern void 250extern void
252nf_ct_iterate_cleanup(struct net *net, int (*iter)(struct nf_conn *i, void *data), void *data); 251nf_ct_iterate_cleanup(struct net *net,
252 int (*iter)(struct nf_conn *i, void *data),
253 void *data, u32 portid, int report);
253extern void nf_conntrack_free(struct nf_conn *ct); 254extern void nf_conntrack_free(struct nf_conn *ct);
254extern struct nf_conn * 255extern struct nf_conn *
255nf_conntrack_alloc(struct net *net, u16 zone, 256nf_conntrack_alloc(struct net *net, u16 zone,
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h
index 977bc8a46444..ff95434e50ca 100644
--- a/include/net/netfilter/nf_conntrack_extend.h
+++ b/include/net/netfilter/nf_conntrack_extend.h
@@ -10,6 +10,7 @@ enum nf_ct_ext_id {
10#if defined(CONFIG_NF_NAT) || defined(CONFIG_NF_NAT_MODULE) 10#if defined(CONFIG_NF_NAT) || defined(CONFIG_NF_NAT_MODULE)
11 NF_CT_EXT_NAT, 11 NF_CT_EXT_NAT,
12#endif 12#endif
13 NF_CT_EXT_SEQADJ,
13 NF_CT_EXT_ACCT, 14 NF_CT_EXT_ACCT,
14#ifdef CONFIG_NF_CONNTRACK_EVENTS 15#ifdef CONFIG_NF_CONNTRACK_EVENTS
15 NF_CT_EXT_ECACHE, 16 NF_CT_EXT_ECACHE,
@@ -26,17 +27,22 @@ enum nf_ct_ext_id {
26#ifdef CONFIG_NF_CONNTRACK_LABELS 27#ifdef CONFIG_NF_CONNTRACK_LABELS
27 NF_CT_EXT_LABELS, 28 NF_CT_EXT_LABELS,
28#endif 29#endif
30#if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY)
31 NF_CT_EXT_SYNPROXY,
32#endif
29 NF_CT_EXT_NUM, 33 NF_CT_EXT_NUM,
30}; 34};
31 35
32#define NF_CT_EXT_HELPER_TYPE struct nf_conn_help 36#define NF_CT_EXT_HELPER_TYPE struct nf_conn_help
33#define NF_CT_EXT_NAT_TYPE struct nf_conn_nat 37#define NF_CT_EXT_NAT_TYPE struct nf_conn_nat
38#define NF_CT_EXT_SEQADJ_TYPE struct nf_conn_seqadj
34#define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter 39#define NF_CT_EXT_ACCT_TYPE struct nf_conn_counter
35#define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache 40#define NF_CT_EXT_ECACHE_TYPE struct nf_conntrack_ecache
36#define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone 41#define NF_CT_EXT_ZONE_TYPE struct nf_conntrack_zone
37#define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp 42#define NF_CT_EXT_TSTAMP_TYPE struct nf_conn_tstamp
38#define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout 43#define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout
39#define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels 44#define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels
45#define NF_CT_EXT_SYNPROXY_TYPE struct nf_conn_synproxy
40 46
41/* Extensions: optional stuff which isn't permanently in struct. */ 47/* Extensions: optional stuff which isn't permanently in struct. */
42struct nf_ct_ext { 48struct nf_ct_ext {
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h
index 914d8d900798..b411d7b17dec 100644
--- a/include/net/netfilter/nf_conntrack_l4proto.h
+++ b/include/net/netfilter/nf_conntrack_l4proto.h
@@ -148,17 +148,10 @@ extern int nf_ct_port_nlattr_tuple_size(void);
148extern const struct nla_policy nf_ct_port_nla_policy[]; 148extern const struct nla_policy nf_ct_port_nla_policy[];
149 149
150#ifdef CONFIG_SYSCTL 150#ifdef CONFIG_SYSCTL
151#ifdef DEBUG_INVALID_PACKETS
152#define LOG_INVALID(net, proto) \ 151#define LOG_INVALID(net, proto) \
153 ((net)->ct.sysctl_log_invalid == (proto) || \ 152 ((net)->ct.sysctl_log_invalid == (proto) || \
154 (net)->ct.sysctl_log_invalid == IPPROTO_RAW) 153 (net)->ct.sysctl_log_invalid == IPPROTO_RAW)
155#else 154#else
156#define LOG_INVALID(net, proto) \
157 (((net)->ct.sysctl_log_invalid == (proto) || \
158 (net)->ct.sysctl_log_invalid == IPPROTO_RAW) \
159 && net_ratelimit())
160#endif
161#else
162static inline int LOG_INVALID(struct net *net, int proto) { return 0; } 155static inline int LOG_INVALID(struct net *net, int proto) { return 0; }
163#endif /* CONFIG_SYSCTL */ 156#endif /* CONFIG_SYSCTL */
164 157
diff --git a/include/net/netfilter/nf_conntrack_seqadj.h b/include/net/netfilter/nf_conntrack_seqadj.h
new file mode 100644
index 000000000000..f6177a5fe0ca
--- /dev/null
+++ b/include/net/netfilter/nf_conntrack_seqadj.h
@@ -0,0 +1,51 @@
1#ifndef _NF_CONNTRACK_SEQADJ_H
2#define _NF_CONNTRACK_SEQADJ_H
3
4#include <net/netfilter/nf_conntrack_extend.h>
5
6/**
7 * struct nf_ct_seqadj - sequence number adjustment information
8 *
9 * @correction_pos: position of the last TCP sequence number modification
10 * @offset_before: sequence number offset before last modification
11 * @offset_after: sequence number offset after last modification
12 */
13struct nf_ct_seqadj {
14 u32 correction_pos;
15 s32 offset_before;
16 s32 offset_after;
17};
18
19struct nf_conn_seqadj {
20 struct nf_ct_seqadj seq[IP_CT_DIR_MAX];
21};
22
23static inline struct nf_conn_seqadj *nfct_seqadj(const struct nf_conn *ct)
24{
25 return nf_ct_ext_find(ct, NF_CT_EXT_SEQADJ);
26}
27
28static inline struct nf_conn_seqadj *nfct_seqadj_ext_add(struct nf_conn *ct)
29{
30 return nf_ct_ext_add(ct, NF_CT_EXT_SEQADJ, GFP_ATOMIC);
31}
32
33extern int nf_ct_seqadj_init(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
34 s32 off);
35extern int nf_ct_seqadj_set(struct nf_conn *ct, enum ip_conntrack_info ctinfo,
36 __be32 seq, s32 off);
37extern void nf_ct_tcp_seqadj_set(struct sk_buff *skb,
38 struct nf_conn *ct,
39 enum ip_conntrack_info ctinfo,
40 s32 off);
41
42extern int nf_ct_seq_adjust(struct sk_buff *skb,
43 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
44 unsigned int protoff);
45extern s32 nf_ct_seq_offset(const struct nf_conn *ct, enum ip_conntrack_dir,
46 u32 seq);
47
48extern int nf_conntrack_seqadj_init(void);
49extern void nf_conntrack_seqadj_fini(void);
50
51#endif /* _NF_CONNTRACK_SEQADJ_H */
diff --git a/include/net/netfilter/nf_conntrack_synproxy.h b/include/net/netfilter/nf_conntrack_synproxy.h
new file mode 100644
index 000000000000..806f54a290d6
--- /dev/null
+++ b/include/net/netfilter/nf_conntrack_synproxy.h
@@ -0,0 +1,77 @@
1#ifndef _NF_CONNTRACK_SYNPROXY_H
2#define _NF_CONNTRACK_SYNPROXY_H
3
4#include <net/netns/generic.h>
5
6struct nf_conn_synproxy {
7 u32 isn;
8 u32 its;
9 u32 tsoff;
10};
11
12static inline struct nf_conn_synproxy *nfct_synproxy(const struct nf_conn *ct)
13{
14#if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY)
15 return nf_ct_ext_find(ct, NF_CT_EXT_SYNPROXY);
16#else
17 return NULL;
18#endif
19}
20
21static inline struct nf_conn_synproxy *nfct_synproxy_ext_add(struct nf_conn *ct)
22{
23#if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY)
24 return nf_ct_ext_add(ct, NF_CT_EXT_SYNPROXY, GFP_ATOMIC);
25#else
26 return NULL;
27#endif
28}
29
30struct synproxy_stats {
31 unsigned int syn_received;
32 unsigned int cookie_invalid;
33 unsigned int cookie_valid;
34 unsigned int cookie_retrans;
35 unsigned int conn_reopened;
36};
37
38struct synproxy_net {
39 struct nf_conn *tmpl;
40 struct synproxy_stats __percpu *stats;
41};
42
43extern int synproxy_net_id;
44static inline struct synproxy_net *synproxy_pernet(struct net *net)
45{
46 return net_generic(net, synproxy_net_id);
47}
48
49struct synproxy_options {
50 u8 options;
51 u8 wscale;
52 u16 mss;
53 u32 tsval;
54 u32 tsecr;
55};
56
57struct tcphdr;
58struct xt_synproxy_info;
59extern void synproxy_parse_options(const struct sk_buff *skb, unsigned int doff,
60 const struct tcphdr *th,
61 struct synproxy_options *opts);
62extern unsigned int synproxy_options_size(const struct synproxy_options *opts);
63extern void synproxy_build_options(struct tcphdr *th,
64 const struct synproxy_options *opts);
65
66extern void synproxy_init_timestamp_cookie(const struct xt_synproxy_info *info,
67 struct synproxy_options *opts);
68extern void synproxy_check_timestamp_cookie(struct synproxy_options *opts);
69
70extern unsigned int synproxy_tstamp_adjust(struct sk_buff *skb,
71 unsigned int protoff,
72 struct tcphdr *th,
73 struct nf_conn *ct,
74 enum ip_conntrack_info ctinfo,
75 const struct nf_conn_synproxy *synproxy);
76
77#endif /* _NF_CONNTRACK_SYNPROXY_H */
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index ad14a799fd2e..59a192420053 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -13,15 +13,6 @@ enum nf_nat_manip_type {
13#define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \ 13#define HOOK2MANIP(hooknum) ((hooknum) != NF_INET_POST_ROUTING && \
14 (hooknum) != NF_INET_LOCAL_IN) 14 (hooknum) != NF_INET_LOCAL_IN)
15 15
16/* NAT sequence number modifications */
17struct nf_nat_seq {
18 /* position of the last TCP sequence number modification (if any) */
19 u_int32_t correction_pos;
20
21 /* sequence number offset before and after last modification */
22 int16_t offset_before, offset_after;
23};
24
25#include <linux/list.h> 16#include <linux/list.h>
26#include <linux/netfilter/nf_conntrack_pptp.h> 17#include <linux/netfilter/nf_conntrack_pptp.h>
27#include <net/netfilter/nf_conntrack_extend.h> 18#include <net/netfilter/nf_conntrack_extend.h>
@@ -39,7 +30,6 @@ struct nf_conn;
39/* The structure embedded in the conntrack structure. */ 30/* The structure embedded in the conntrack structure. */
40struct nf_conn_nat { 31struct nf_conn_nat {
41 struct hlist_node bysource; 32 struct hlist_node bysource;
42 struct nf_nat_seq seq[IP_CT_DIR_MAX];
43 struct nf_conn *ct; 33 struct nf_conn *ct;
44 union nf_conntrack_nat_help help; 34 union nf_conntrack_nat_help help;
45#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ 35#if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \
diff --git a/include/net/netfilter/nf_nat_helper.h b/include/net/netfilter/nf_nat_helper.h
index b4d6bfc2af03..404324d1d0c4 100644
--- a/include/net/netfilter/nf_nat_helper.h
+++ b/include/net/netfilter/nf_nat_helper.h
@@ -39,28 +39,9 @@ extern int nf_nat_mangle_udp_packet(struct sk_buff *skb,
39 const char *rep_buffer, 39 const char *rep_buffer,
40 unsigned int rep_len); 40 unsigned int rep_len);
41 41
42extern void nf_nat_set_seq_adjust(struct nf_conn *ct,
43 enum ip_conntrack_info ctinfo,
44 __be32 seq, s16 off);
45extern int nf_nat_seq_adjust(struct sk_buff *skb,
46 struct nf_conn *ct,
47 enum ip_conntrack_info ctinfo,
48 unsigned int protoff);
49extern int (*nf_nat_seq_adjust_hook)(struct sk_buff *skb,
50 struct nf_conn *ct,
51 enum ip_conntrack_info ctinfo,
52 unsigned int protoff);
53
54/* Setup NAT on this expected conntrack so it follows master, but goes 42/* Setup NAT on this expected conntrack so it follows master, but goes
55 * to port ct->master->saved_proto. */ 43 * to port ct->master->saved_proto. */
56extern void nf_nat_follow_master(struct nf_conn *ct, 44extern void nf_nat_follow_master(struct nf_conn *ct,
57 struct nf_conntrack_expect *this); 45 struct nf_conntrack_expect *this);
58 46
59extern s16 nf_nat_get_offset(const struct nf_conn *ct,
60 enum ip_conntrack_dir dir,
61 u32 seq);
62
63extern void nf_nat_tcp_seq_adjust(struct sk_buff *skb, struct nf_conn *ct,
64 u32 dir, int off);
65
66#endif 47#endif
diff --git a/include/net/netfilter/nf_tproxy_core.h b/include/net/netfilter/nf_tproxy_core.h
deleted file mode 100644
index 36d9379d4c4b..000000000000
--- a/include/net/netfilter/nf_tproxy_core.h
+++ /dev/null
@@ -1,210 +0,0 @@
1#ifndef _NF_TPROXY_CORE_H
2#define _NF_TPROXY_CORE_H
3
4#include <linux/types.h>
5#include <linux/in.h>
6#include <linux/skbuff.h>
7#include <net/sock.h>
8#include <net/inet_hashtables.h>
9#include <net/inet6_hashtables.h>
10#include <net/tcp.h>
11
12#define NFT_LOOKUP_ANY 0
13#define NFT_LOOKUP_LISTENER 1
14#define NFT_LOOKUP_ESTABLISHED 2
15
16/* look up and get a reference to a matching socket */
17
18
19/* This function is used by the 'TPROXY' target and the 'socket'
20 * match. The following lookups are supported:
21 *
22 * Explicit TProxy target rule
23 * ===========================
24 *
25 * This is used when the user wants to intercept a connection matching
26 * an explicit iptables rule. In this case the sockets are assumed
27 * matching in preference order:
28 *
29 * - match: if there's a fully established connection matching the
30 * _packet_ tuple, it is returned, assuming the redirection
31 * already took place and we process a packet belonging to an
32 * established connection
33 *
34 * - match: if there's a listening socket matching the redirection
35 * (e.g. on-port & on-ip of the connection), it is returned,
36 * regardless if it was bound to 0.0.0.0 or an explicit
37 * address. The reasoning is that if there's an explicit rule, it
38 * does not really matter if the listener is bound to an interface
39 * or to 0. The user already stated that he wants redirection
40 * (since he added the rule).
41 *
42 * "socket" match based redirection (no specific rule)
43 * ===================================================
44 *
45 * There are connections with dynamic endpoints (e.g. FTP data
46 * connection) that the user is unable to add explicit rules
47 * for. These are taken care of by a generic "socket" rule. It is
48 * assumed that the proxy application is trusted to open such
49 * connections without explicit iptables rule (except of course the
50 * generic 'socket' rule). In this case the following sockets are
51 * matched in preference order:
52 *
53 * - match: if there's a fully established connection matching the
54 * _packet_ tuple
55 *
56 * - match: if there's a non-zero bound listener (possibly with a
57 * non-local address) We don't accept zero-bound listeners, since
58 * then local services could intercept traffic going through the
59 * box.
60 *
61 * Please note that there's an overlap between what a TPROXY target
62 * and a socket match will match. Normally if you have both rules the
63 * "socket" match will be the first one, effectively all packets
64 * belonging to established connections going through that one.
65 */
66static inline struct sock *
67nf_tproxy_get_sock_v4(struct net *net, const u8 protocol,
68 const __be32 saddr, const __be32 daddr,
69 const __be16 sport, const __be16 dport,
70 const struct net_device *in, int lookup_type)
71{
72 struct sock *sk;
73
74 /* look up socket */
75 switch (protocol) {
76 case IPPROTO_TCP:
77 switch (lookup_type) {
78 case NFT_LOOKUP_ANY:
79 sk = __inet_lookup(net, &tcp_hashinfo,
80 saddr, sport, daddr, dport,
81 in->ifindex);
82 break;
83 case NFT_LOOKUP_LISTENER:
84 sk = inet_lookup_listener(net, &tcp_hashinfo,
85 saddr, sport,
86 daddr, dport,
87 in->ifindex);
88
89 /* NOTE: we return listeners even if bound to
90 * 0.0.0.0, those are filtered out in
91 * xt_socket, since xt_TPROXY needs 0 bound
92 * listeners too */
93
94 break;
95 case NFT_LOOKUP_ESTABLISHED:
96 sk = inet_lookup_established(net, &tcp_hashinfo,
97 saddr, sport, daddr, dport,
98 in->ifindex);
99 break;
100 default:
101 WARN_ON(1);
102 sk = NULL;
103 break;
104 }
105 break;
106 case IPPROTO_UDP:
107 sk = udp4_lib_lookup(net, saddr, sport, daddr, dport,
108 in->ifindex);
109 if (sk && lookup_type != NFT_LOOKUP_ANY) {
110 int connected = (sk->sk_state == TCP_ESTABLISHED);
111 int wildcard = (inet_sk(sk)->inet_rcv_saddr == 0);
112
113 /* NOTE: we return listeners even if bound to
114 * 0.0.0.0, those are filtered out in
115 * xt_socket, since xt_TPROXY needs 0 bound
116 * listeners too */
117 if ((lookup_type == NFT_LOOKUP_ESTABLISHED && (!connected || wildcard)) ||
118 (lookup_type == NFT_LOOKUP_LISTENER && connected)) {
119 sock_put(sk);
120 sk = NULL;
121 }
122 }
123 break;
124 default:
125 WARN_ON(1);
126 sk = NULL;
127 }
128
129 pr_debug("tproxy socket lookup: proto %u %08x:%u -> %08x:%u, lookup type: %d, sock %p\n",
130 protocol, ntohl(saddr), ntohs(sport), ntohl(daddr), ntohs(dport), lookup_type, sk);
131
132 return sk;
133}
134
135#if IS_ENABLED(CONFIG_IPV6)
136static inline struct sock *
137nf_tproxy_get_sock_v6(struct net *net, const u8 protocol,
138 const struct in6_addr *saddr, const struct in6_addr *daddr,
139 const __be16 sport, const __be16 dport,
140 const struct net_device *in, int lookup_type)
141{
142 struct sock *sk;
143
144 /* look up socket */
145 switch (protocol) {
146 case IPPROTO_TCP:
147 switch (lookup_type) {
148 case NFT_LOOKUP_ANY:
149 sk = inet6_lookup(net, &tcp_hashinfo,
150 saddr, sport, daddr, dport,
151 in->ifindex);
152 break;
153 case NFT_LOOKUP_LISTENER:
154 sk = inet6_lookup_listener(net, &tcp_hashinfo,
155 saddr, sport,
156 daddr, ntohs(dport),
157 in->ifindex);
158
159 /* NOTE: we return listeners even if bound to
160 * 0.0.0.0, those are filtered out in
161 * xt_socket, since xt_TPROXY needs 0 bound
162 * listeners too */
163
164 break;
165 case NFT_LOOKUP_ESTABLISHED:
166 sk = __inet6_lookup_established(net, &tcp_hashinfo,
167 saddr, sport, daddr, ntohs(dport),
168 in->ifindex);
169 break;
170 default:
171 WARN_ON(1);
172 sk = NULL;
173 break;
174 }
175 break;
176 case IPPROTO_UDP:
177 sk = udp6_lib_lookup(net, saddr, sport, daddr, dport,
178 in->ifindex);
179 if (sk && lookup_type != NFT_LOOKUP_ANY) {
180 int connected = (sk->sk_state == TCP_ESTABLISHED);
181 int wildcard = ipv6_addr_any(&inet6_sk(sk)->rcv_saddr);
182
183 /* NOTE: we return listeners even if bound to
184 * 0.0.0.0, those are filtered out in
185 * xt_socket, since xt_TPROXY needs 0 bound
186 * listeners too */
187 if ((lookup_type == NFT_LOOKUP_ESTABLISHED && (!connected || wildcard)) ||
188 (lookup_type == NFT_LOOKUP_LISTENER && connected)) {
189 sock_put(sk);
190 sk = NULL;
191 }
192 }
193 break;
194 default:
195 WARN_ON(1);
196 sk = NULL;
197 }
198
199 pr_debug("tproxy socket lookup: proto %u %pI6:%u -> %pI6:%u, lookup type: %d, sock %p\n",
200 protocol, saddr, ntohs(sport), daddr, ntohs(dport), lookup_type, sk);
201
202 return sk;
203}
204#endif
205
206/* assign a socket to the skb -- consumes sk */
207void
208nf_tproxy_assign_sock(struct sk_buff *skb, struct sock *sk);
209
210#endif
diff --git a/include/net/netfilter/nfnetlink_queue.h b/include/net/netfilter/nfnetlink_queue.h
index 86267a529514..aff88ba91391 100644
--- a/include/net/netfilter/nfnetlink_queue.h
+++ b/include/net/netfilter/nfnetlink_queue.h
@@ -15,6 +15,8 @@ int nfqnl_ct_put(struct sk_buff *skb, struct nf_conn *ct,
15 enum ip_conntrack_info ctinfo); 15 enum ip_conntrack_info ctinfo);
16void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct, 16void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct,
17 enum ip_conntrack_info ctinfo, int diff); 17 enum ip_conntrack_info ctinfo, int diff);
18int nfqnl_attach_expect(struct nf_conn *ct, const struct nlattr *attr,
19 u32 portid, u32 report);
18#else 20#else
19inline struct nf_conn * 21inline struct nf_conn *
20nfqnl_ct_get(struct sk_buff *entskb, size_t *size, enum ip_conntrack_info *ctinfo) 22nfqnl_ct_get(struct sk_buff *entskb, size_t *size, enum ip_conntrack_info *ctinfo)
@@ -39,5 +41,11 @@ inline void nfqnl_ct_seq_adjust(struct sk_buff *skb, struct nf_conn *ct,
39 enum ip_conntrack_info ctinfo, int diff) 41 enum ip_conntrack_info ctinfo, int diff)
40{ 42{
41} 43}
44
45inline int nfqnl_attach_expect(struct nf_conn *ct, const struct nlattr *attr,
46 u32 portid, u32 report)
47{
48 return 0;
49}
42#endif /* NF_CONNTRACK */ 50#endif /* NF_CONNTRACK */
43#endif 51#endif
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 2ba9de89e8ec..bf2ec2202c56 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -77,5 +77,6 @@ struct netns_ipv4 {
77 struct fib_rules_ops *mr_rules_ops; 77 struct fib_rules_ops *mr_rules_ops;
78#endif 78#endif
79#endif 79#endif
80 atomic_t rt_genid;
80}; 81};
81#endif 82#endif
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 005e2c2e39a9..0fb2401197c5 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -72,6 +72,7 @@ struct netns_ipv6 {
72#endif 72#endif
73#endif 73#endif
74 atomic_t dev_addr_genid; 74 atomic_t dev_addr_genid;
75 atomic_t rt_genid;
75}; 76};
76 77
77#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) 78#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index 50ab8c26ab59..099d02782e22 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -25,11 +25,7 @@ struct netprio_map {
25 u32 priomap[]; 25 u32 priomap[];
26}; 26};
27 27
28struct cgroup_netprio_state { 28void sock_update_netprioidx(struct sock *sk);
29 struct cgroup_subsys_state css;
30};
31
32extern void sock_update_netprioidx(struct sock *sk);
33 29
34#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP) 30#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP)
35 31
@@ -39,7 +35,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
39 u32 idx; 35 u32 idx;
40 36
41 rcu_read_lock(); 37 rcu_read_lock();
42 css = task_subsys_state(p, net_prio_subsys_id); 38 css = task_css(p, net_prio_subsys_id);
43 idx = css->cgroup->id; 39 idx = css->cgroup->id;
44 rcu_read_unlock(); 40 rcu_read_unlock();
45 return idx; 41 return idx;
@@ -53,7 +49,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
53 u32 idx = 0; 49 u32 idx = 0;
54 50
55 rcu_read_lock(); 51 rcu_read_lock();
56 css = task_subsys_state(p, net_prio_subsys_id); 52 css = task_css(p, net_prio_subsys_id);
57 if (css) 53 if (css)
58 idx = css->cgroup->id; 54 idx = css->cgroup->id;
59 rcu_read_unlock(); 55 rcu_read_unlock();
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index 5f286b726bb6..f68ee68e4e3e 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -224,6 +224,9 @@ int nfc_set_remote_general_bytes(struct nfc_dev *dev,
224 u8 *gt, u8 gt_len); 224 u8 *gt, u8 gt_len);
225u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, size_t *gb_len); 225u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, size_t *gb_len);
226 226
227int nfc_fw_download_done(struct nfc_dev *dev, const char *firmware_name,
228 u32 result);
229
227int nfc_targets_found(struct nfc_dev *dev, 230int nfc_targets_found(struct nfc_dev *dev,
228 struct nfc_target *targets, int ntargets); 231 struct nfc_target *targets, int ntargets);
229int nfc_target_lost(struct nfc_dev *dev, u32 target_idx); 232int nfc_target_lost(struct nfc_dev *dev, u32 target_idx);
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 13174509cdfd..2ebef77a2f9a 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -14,8 +14,8 @@ struct tcf_walker {
14 int (*fn)(struct tcf_proto *, unsigned long node, struct tcf_walker *); 14 int (*fn)(struct tcf_proto *, unsigned long node, struct tcf_walker *);
15}; 15};
16 16
17extern int register_tcf_proto_ops(struct tcf_proto_ops *ops); 17int register_tcf_proto_ops(struct tcf_proto_ops *ops);
18extern int unregister_tcf_proto_ops(struct tcf_proto_ops *ops); 18int unregister_tcf_proto_ops(struct tcf_proto_ops *ops);
19 19
20static inline unsigned long 20static inline unsigned long
21__cls_set_class(unsigned long *clp, unsigned long cl) 21__cls_set_class(unsigned long *clp, unsigned long cl)
@@ -126,17 +126,17 @@ tcf_exts_exec(struct sk_buff *skb, struct tcf_exts *exts,
126 return 0; 126 return 0;
127} 127}
128 128
129extern int tcf_exts_validate(struct net *net, struct tcf_proto *tp, 129int tcf_exts_validate(struct net *net, struct tcf_proto *tp,
130 struct nlattr **tb, struct nlattr *rate_tlv, 130 struct nlattr **tb, struct nlattr *rate_tlv,
131 struct tcf_exts *exts, 131 struct tcf_exts *exts,
132 const struct tcf_ext_map *map); 132 const struct tcf_ext_map *map);
133extern void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts); 133void tcf_exts_destroy(struct tcf_proto *tp, struct tcf_exts *exts);
134extern void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst, 134void tcf_exts_change(struct tcf_proto *tp, struct tcf_exts *dst,
135 struct tcf_exts *src); 135 struct tcf_exts *src);
136extern int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts, 136int tcf_exts_dump(struct sk_buff *skb, struct tcf_exts *exts,
137 const struct tcf_ext_map *map); 137 const struct tcf_ext_map *map);
138extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, 138int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts,
139 const struct tcf_ext_map *map); 139 const struct tcf_ext_map *map);
140 140
141/** 141/**
142 * struct tcf_pkt_info - packet information 142 * struct tcf_pkt_info - packet information
@@ -239,14 +239,14 @@ struct tcf_ematch_ops {
239 struct list_head link; 239 struct list_head link;
240}; 240};
241 241
242extern int tcf_em_register(struct tcf_ematch_ops *); 242int tcf_em_register(struct tcf_ematch_ops *);
243extern void tcf_em_unregister(struct tcf_ematch_ops *); 243void tcf_em_unregister(struct tcf_ematch_ops *);
244extern int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *, 244int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *,
245 struct tcf_ematch_tree *); 245 struct tcf_ematch_tree *);
246extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *); 246void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *);
247extern int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int); 247int tcf_em_tree_dump(struct sk_buff *, struct tcf_ematch_tree *, int);
248extern int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *, 248int __tcf_em_tree_match(struct sk_buff *, struct tcf_ematch_tree *,
249 struct tcf_pkt_info *); 249 struct tcf_pkt_info *);
250 250
251/** 251/**
252 * tcf_em_tree_change - replace ematch tree of a running classifier 252 * tcf_em_tree_change - replace ematch tree of a running classifier
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 388bf8b6d060..59ec3cd15d68 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -64,8 +64,8 @@ struct qdisc_watchdog {
64 struct Qdisc *qdisc; 64 struct Qdisc *qdisc;
65}; 65};
66 66
67extern void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc); 67void qdisc_watchdog_init(struct qdisc_watchdog *wd, struct Qdisc *qdisc);
68extern void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires); 68void qdisc_watchdog_schedule_ns(struct qdisc_watchdog *wd, u64 expires);
69 69
70static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd, 70static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
71 psched_time_t expires) 71 psched_time_t expires)
@@ -73,31 +73,34 @@ static inline void qdisc_watchdog_schedule(struct qdisc_watchdog *wd,
73 qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires)); 73 qdisc_watchdog_schedule_ns(wd, PSCHED_TICKS2NS(expires));
74} 74}
75 75
76extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd); 76void qdisc_watchdog_cancel(struct qdisc_watchdog *wd);
77 77
78extern struct Qdisc_ops pfifo_qdisc_ops; 78extern struct Qdisc_ops pfifo_qdisc_ops;
79extern struct Qdisc_ops bfifo_qdisc_ops; 79extern struct Qdisc_ops bfifo_qdisc_ops;
80extern struct Qdisc_ops pfifo_head_drop_qdisc_ops; 80extern struct Qdisc_ops pfifo_head_drop_qdisc_ops;
81 81
82extern int fifo_set_limit(struct Qdisc *q, unsigned int limit); 82int fifo_set_limit(struct Qdisc *q, unsigned int limit);
83extern struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops, 83struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,
84 unsigned int limit); 84 unsigned int limit);
85 85
86extern int register_qdisc(struct Qdisc_ops *qops); 86int register_qdisc(struct Qdisc_ops *qops);
87extern int unregister_qdisc(struct Qdisc_ops *qops); 87int unregister_qdisc(struct Qdisc_ops *qops);
88extern void qdisc_list_del(struct Qdisc *q); 88void qdisc_get_default(char *id, size_t len);
89extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); 89int qdisc_set_default(const char *id);
90extern struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); 90
91extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, 91void qdisc_list_del(struct Qdisc *q);
92 struct nlattr *tab); 92struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle);
93extern void qdisc_put_rtab(struct qdisc_rate_table *tab); 93struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle);
94extern void qdisc_put_stab(struct qdisc_size_table *tab); 94struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
95extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); 95 struct nlattr *tab);
96extern int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q, 96void qdisc_put_rtab(struct qdisc_rate_table *tab);
97 struct net_device *dev, struct netdev_queue *txq, 97void qdisc_put_stab(struct qdisc_size_table *tab);
98 spinlock_t *root_lock); 98void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc);
99 99int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,
100extern void __qdisc_run(struct Qdisc *q); 100 struct net_device *dev, struct netdev_queue *txq,
101 spinlock_t *root_lock);
102
103void __qdisc_run(struct Qdisc *q);
101 104
102static inline void qdisc_run(struct Qdisc *q) 105static inline void qdisc_run(struct Qdisc *q)
103{ 106{
@@ -105,10 +108,10 @@ static inline void qdisc_run(struct Qdisc *q)
105 __qdisc_run(q); 108 __qdisc_run(q);
106} 109}
107 110
108extern int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp, 111int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp,
109 struct tcf_result *res);
110extern int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
111 struct tcf_result *res); 112 struct tcf_result *res);
113int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
114 struct tcf_result *res);
112 115
113/* Calculate maximal size of packet seen by hard_start_xmit 116/* Calculate maximal size of packet seen by hard_start_xmit
114 routine of this device. 117 routine of this device.
diff --git a/include/net/route.h b/include/net/route.h
index 2ea40c1b5e00..afdeeb5bec25 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -317,4 +317,12 @@ static inline int ip4_dst_hoplimit(const struct dst_entry *dst)
317 return hoplimit; 317 return hoplimit;
318} 318}
319 319
320static inline int ip_skb_dst_mtu(struct sk_buff *skb)
321{
322 struct inet_sock *inet = skb->sk ? inet_sk(skb->sk) : NULL;
323
324 return (inet && inet->pmtudisc == IP_PMTUDISC_PROBE) ?
325 skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb));
326}
327
320#endif /* _ROUTE_H */ 328#endif /* _ROUTE_H */
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 6eab63363e59..f4eb365f7dcd 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -316,6 +316,7 @@ extern struct Qdisc noop_qdisc;
316extern struct Qdisc_ops noop_qdisc_ops; 316extern struct Qdisc_ops noop_qdisc_ops;
317extern struct Qdisc_ops pfifo_fast_ops; 317extern struct Qdisc_ops pfifo_fast_ops;
318extern struct Qdisc_ops mq_qdisc_ops; 318extern struct Qdisc_ops mq_qdisc_ops;
319extern const struct Qdisc_ops *default_qdisc_ops;
319 320
320struct Qdisc_class_common { 321struct Qdisc_class_common {
321 u32 classid; 322 u32 classid;
@@ -350,30 +351,32 @@ qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id)
350 return NULL; 351 return NULL;
351} 352}
352 353
353extern int qdisc_class_hash_init(struct Qdisc_class_hash *); 354int qdisc_class_hash_init(struct Qdisc_class_hash *);
354extern void qdisc_class_hash_insert(struct Qdisc_class_hash *, struct Qdisc_class_common *); 355void qdisc_class_hash_insert(struct Qdisc_class_hash *,
355extern void qdisc_class_hash_remove(struct Qdisc_class_hash *, struct Qdisc_class_common *); 356 struct Qdisc_class_common *);
356extern void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *); 357void qdisc_class_hash_remove(struct Qdisc_class_hash *,
357extern void qdisc_class_hash_destroy(struct Qdisc_class_hash *); 358 struct Qdisc_class_common *);
358 359void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *);
359extern void dev_init_scheduler(struct net_device *dev); 360void qdisc_class_hash_destroy(struct Qdisc_class_hash *);
360extern void dev_shutdown(struct net_device *dev); 361
361extern void dev_activate(struct net_device *dev); 362void dev_init_scheduler(struct net_device *dev);
362extern void dev_deactivate(struct net_device *dev); 363void dev_shutdown(struct net_device *dev);
363extern void dev_deactivate_many(struct list_head *head); 364void dev_activate(struct net_device *dev);
364extern struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, 365void dev_deactivate(struct net_device *dev);
365 struct Qdisc *qdisc); 366void dev_deactivate_many(struct list_head *head);
366extern void qdisc_reset(struct Qdisc *qdisc); 367struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
367extern void qdisc_destroy(struct Qdisc *qdisc); 368 struct Qdisc *qdisc);
368extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); 369void qdisc_reset(struct Qdisc *qdisc);
369extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, 370void qdisc_destroy(struct Qdisc *qdisc);
370 struct Qdisc_ops *ops); 371void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
371extern struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue, 372struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
372 struct Qdisc_ops *ops, u32 parentid); 373 const struct Qdisc_ops *ops);
373extern void __qdisc_calculate_pkt_len(struct sk_buff *skb, 374struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue,
374 const struct qdisc_size_table *stab); 375 const struct Qdisc_ops *ops, u32 parentid);
375extern void tcf_destroy(struct tcf_proto *tp); 376void __qdisc_calculate_pkt_len(struct sk_buff *skb,
376extern void tcf_destroy_chain(struct tcf_proto **fl); 377 const struct qdisc_size_table *stab);
378void tcf_destroy(struct tcf_proto *tp);
379void tcf_destroy_chain(struct tcf_proto **fl);
377 380
378/* Reset all TX qdiscs greater then index of a device. */ 381/* Reset all TX qdiscs greater then index of a device. */
379static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i) 382static inline void qdisc_reset_all_tx_gt(struct net_device *dev, unsigned int i)
@@ -683,16 +686,23 @@ struct psched_ratecfg {
683 u64 rate_bytes_ps; /* bytes per second */ 686 u64 rate_bytes_ps; /* bytes per second */
684 u32 mult; 687 u32 mult;
685 u16 overhead; 688 u16 overhead;
689 u8 linklayer;
686 u8 shift; 690 u8 shift;
687}; 691};
688 692
689static inline u64 psched_l2t_ns(const struct psched_ratecfg *r, 693static inline u64 psched_l2t_ns(const struct psched_ratecfg *r,
690 unsigned int len) 694 unsigned int len)
691{ 695{
692 return ((u64)(len + r->overhead) * r->mult) >> r->shift; 696 len += r->overhead;
697
698 if (unlikely(r->linklayer == TC_LINKLAYER_ATM))
699 return ((u64)(DIV_ROUND_UP(len,48)*53) * r->mult) >> r->shift;
700
701 return ((u64)len * r->mult) >> r->shift;
693} 702}
694 703
695extern void psched_ratecfg_precompute(struct psched_ratecfg *r, const struct tc_ratespec *conf); 704void psched_ratecfg_precompute(struct psched_ratecfg *r,
705 const struct tc_ratespec *conf);
696 706
697static inline void psched_ratecfg_getrate(struct tc_ratespec *res, 707static inline void psched_ratecfg_getrate(struct tc_ratespec *res,
698 const struct psched_ratecfg *r) 708 const struct psched_ratecfg *r)
@@ -700,6 +710,7 @@ static inline void psched_ratecfg_getrate(struct tc_ratespec *res,
700 memset(res, 0, sizeof(*res)); 710 memset(res, 0, sizeof(*res));
701 res->rate = r->rate_bytes_ps; 711 res->rate = r->rate_bytes_ps;
702 res->overhead = r->overhead; 712 res->overhead = r->overhead;
713 res->linklayer = (r->linklayer & TC_LINKLAYER_MASK);
703} 714}
704 715
705#endif 716#endif
diff --git a/include/net/sctp/auth.h b/include/net/sctp/auth.h
index 49bc9577c61e..aa80bef3c9d5 100644
--- a/include/net/sctp/auth.h
+++ b/include/net/sctp/auth.h
@@ -22,16 +22,10 @@
22 * 22 *
23 * Please send any bug reports or fixes you make to the 23 * Please send any bug reports or fixes you make to the
24 * email address(es): 24 * email address(es):
25 * lksctp developers <lksctp-developers@lists.sourceforge.net> 25 * lksctp developers <linux-sctp@vger.kernel.org>
26 *
27 * Or submit a bug report through the following website:
28 * http://www.sf.net/projects/lksctp
29 * 26 *
30 * Written or modified by: 27 * Written or modified by:
31 * Vlad Yasevich <vladislav.yasevich@hp.com> 28 * Vlad Yasevich <vladislav.yasevich@hp.com>
32 *
33 * Any bugs reported given to us we will try to fix... any fixes shared will
34 * be incorporated into the next SCTP release.
35 */ 29 */
36 30
37#ifndef __sctp_auth_h__ 31#ifndef __sctp_auth_h__
diff --git a/include/net/sctp/checksum.h b/include/net/sctp/checksum.h
index 0cb08e6fb6df..259924d63ba6 100644
--- a/include/net/sctp/checksum.h
+++ b/include/net/sctp/checksum.h
@@ -25,10 +25,7 @@
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email address(es): 27 * email address(es):
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <linux-sctp@vger.kernel.org>
29 *
30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp
32 * 29 *
33 * Written or modified by: 30 * Written or modified by:
34 * Dinakaran Joseph 31 * Dinakaran Joseph
@@ -37,9 +34,6 @@
37 * 34 *
38 * Rewritten to use libcrc32c by: 35 * Rewritten to use libcrc32c by:
39 * Vlad Yasevich <vladislav.yasevich@hp.com> 36 * Vlad Yasevich <vladislav.yasevich@hp.com>
40 *
41 * Any bugs reported given to us we will try to fix... any fixes shared will
42 * be incorporated into the next SCTP release.
43 */ 37 */
44 38
45#ifndef __sctp_checksum_h__ 39#ifndef __sctp_checksum_h__
@@ -85,4 +79,19 @@ static inline __le32 sctp_end_cksum(__u32 crc32)
85 return cpu_to_le32(~crc32); 79 return cpu_to_le32(~crc32);
86} 80}
87 81
82/* Calculate the CRC32C checksum of an SCTP packet. */
83static inline __le32 sctp_compute_cksum(const struct sk_buff *skb,
84 unsigned int offset)
85{
86 const struct sk_buff *iter;
87
88 __u32 crc32 = sctp_start_cksum(skb->data + offset,
89 skb_headlen(skb) - offset);
90 skb_walk_frags(skb, iter)
91 crc32 = sctp_update_cksum((__u8 *) iter->data,
92 skb_headlen(iter), crc32);
93
94 return sctp_end_cksum(crc32);
95}
96
88#endif /* __sctp_checksum_h__ */ 97#endif /* __sctp_checksum_h__ */
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 35247271e557..832f2191489c 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -23,19 +23,17 @@
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * the Free Software Foundation, 59 Temple Place - Suite 330,
24 * Boston, MA 02111-1307, USA. 24 * Boston, MA 02111-1307, USA.
25 * 25 *
26 * Please send any bug reports or fixes you make to one of the 26 * Please send any bug reports or fixes you make to the
27 * following email addresses: 27 * email address(es):
28 * lksctp developers <linux-sctp@vger.kernel.org>
28 * 29 *
29 * La Monte H.P. Yarroll <piggy@acm.org> 30 * Written or modified by:
30 * Karl Knutson <karl@athena.chicago.il.us> 31 * La Monte H.P. Yarroll <piggy@acm.org>
31 * Ardelle Fan <ardelle.fan@intel.com> 32 * Karl Knutson <karl@athena.chicago.il.us>
32 * Sridhar Samudrala <sri@us.ibm.com> 33 * Ardelle Fan <ardelle.fan@intel.com>
33 * 34 * Sridhar Samudrala <sri@us.ibm.com>
34 * Any bugs reported given to us we will try to fix... any fixes shared will
35 * be incorporated into the next SCTP release.
36 */ 35 */
37 36
38
39#ifndef __net_sctp_command_h__ 37#ifndef __net_sctp_command_h__
40#define __net_sctp_command_h__ 38#define __net_sctp_command_h__
41 39
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index ca50e0751e47..2f0a565a0fd5 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -25,10 +25,7 @@
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email address(es): 27 * email address(es):
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <linux-sctp@vger.kernel.org>
29 *
30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp
32 * 29 *
33 * Written or modified by: 30 * Written or modified by:
34 * La Monte H.P. Yarroll <piggy@acm.org> 31 * La Monte H.P. Yarroll <piggy@acm.org>
@@ -39,9 +36,6 @@
39 * Xingang Guo <xingang.guo@intel.com> 36 * Xingang Guo <xingang.guo@intel.com>
40 * Sridhar Samudrala <samudrala@us.ibm.com> 37 * Sridhar Samudrala <samudrala@us.ibm.com>
41 * Daisy Chang <daisyc@us.ibm.com> 38 * Daisy Chang <daisyc@us.ibm.com>
42 *
43 * Any bugs reported given to us we will try to fix... any fixes shared will
44 * be incorporated into the next SCTP release.
45 */ 39 */
46 40
47#ifndef __sctp_constants_h__ 41#ifndef __sctp_constants_h__
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index d8e37ecea691..3794c5ad20fe 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -27,10 +27,7 @@
27 * 27 *
28 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
29 * email address(es): 29 * email address(es):
30 * lksctp developers <lksctp-developers@lists.sourceforge.net> 30 * lksctp developers <linux-sctp@vger.kernel.org>
31 *
32 * Or submit a bug report through the following website:
33 * http://www.sf.net/projects/lksctp
34 * 31 *
35 * Written or modified by: 32 * Written or modified by:
36 * La Monte H.P. Yarroll <piggy@acm.org> 33 * La Monte H.P. Yarroll <piggy@acm.org>
@@ -41,9 +38,6 @@
41 * Ardelle Fan <ardelle.fan@intel.com> 38 * Ardelle Fan <ardelle.fan@intel.com>
42 * Ryan Layer <rmlayer@us.ibm.com> 39 * Ryan Layer <rmlayer@us.ibm.com>
43 * Kevin Gao <kevin.gao@intel.com> 40 * Kevin Gao <kevin.gao@intel.com>
44 *
45 * Any bugs reported given to us we will try to fix... any fixes shared will
46 * be incorporated into the next SCTP release.
47 */ 41 */
48 42
49#ifndef __net_sctp_h__ 43#ifndef __net_sctp_h__
@@ -613,7 +607,7 @@ static inline void sctp_v4_map_v6(union sctp_addr *addr)
613 */ 607 */
614static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t) 608static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
615{ 609{
616 if (t->dst && !dst_check(t->dst, 0)) { 610 if (t->dst && !dst_check(t->dst, t->dst_cookie)) {
617 dst_release(t->dst); 611 dst_release(t->dst);
618 t->dst = NULL; 612 t->dst = NULL;
619 } 613 }
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 2a82d1384706..4ef75af340b6 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -27,10 +27,7 @@
27 * 27 *
28 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
29 * email addresses: 29 * email addresses:
30 * lksctp developers <lksctp-developers@lists.sourceforge.net> 30 * lksctp developers <linux-sctp@vger.kernel.org>
31 *
32 * Or submit a bug report through the following website:
33 * http://www.sf.net/projects/lksctp
34 * 31 *
35 * Written or modified by: 32 * Written or modified by:
36 * La Monte H.P. Yarroll <piggy@acm.org> 33 * La Monte H.P. Yarroll <piggy@acm.org>
@@ -42,9 +39,6 @@
42 * Daisy Chang <daisyc@us.ibm.com> 39 * Daisy Chang <daisyc@us.ibm.com>
43 * Ardelle Fan <ardelle.fan@intel.com> 40 * Ardelle Fan <ardelle.fan@intel.com>
44 * Kevin Gao <kevin.gao@intel.com> 41 * Kevin Gao <kevin.gao@intel.com>
45 *
46 * Any bugs reported given to us we will try to fix... any fixes shared will
47 * be incorporated into the next SCTP release.
48 */ 42 */
49 43
50#include <linux/types.h> 44#include <linux/types.h>
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index e745c92a1532..2174d8da0770 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -25,10 +25,7 @@
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email addresses: 27 * email addresses:
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <linux-sctp@vger.kernel.org>
29 *
30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp
32 * 29 *
33 * Written or modified by: 30 * Written or modified by:
34 * Randall Stewart <randall@sctp.chicago.il.us> 31 * Randall Stewart <randall@sctp.chicago.il.us>
@@ -46,9 +43,6 @@
46 * Ryan Layer <rmlayer@us.ibm.com> 43 * Ryan Layer <rmlayer@us.ibm.com>
47 * Anup Pemmaiah <pemmaiah@cc.usu.edu> 44 * Anup Pemmaiah <pemmaiah@cc.usu.edu>
48 * Kevin Gao <kevin.gao@intel.com> 45 * Kevin Gao <kevin.gao@intel.com>
49 *
50 * Any bugs reported given to us we will try to fix... any fixes shared will
51 * be incorporated into the next SCTP release.
52 */ 46 */
53 47
54#ifndef __sctp_structs_h__ 48#ifndef __sctp_structs_h__
@@ -119,29 +113,27 @@ struct sctp_hashbucket {
119 113
120/* The SCTP globals structure. */ 114/* The SCTP globals structure. */
121extern struct sctp_globals { 115extern struct sctp_globals {
122 /* The following variables are implementation specific. */
123
124 /* Default initialization values to be applied to new associations. */
125 __u16 max_instreams;
126 __u16 max_outstreams;
127
128 /* This is a list of groups of functions for each address 116 /* This is a list of groups of functions for each address
129 * family that we support. 117 * family that we support.
130 */ 118 */
131 struct list_head address_families; 119 struct list_head address_families;
132 120
133 /* This is the hash of all endpoints. */ 121 /* This is the hash of all endpoints. */
134 int ep_hashsize;
135 struct sctp_hashbucket *ep_hashtable; 122 struct sctp_hashbucket *ep_hashtable;
136
137 /* This is the hash of all associations. */ 123 /* This is the hash of all associations. */
138 int assoc_hashsize;
139 struct sctp_hashbucket *assoc_hashtable; 124 struct sctp_hashbucket *assoc_hashtable;
140
141 /* This is the sctp port control hash. */ 125 /* This is the sctp port control hash. */
142 int port_hashsize;
143 struct sctp_bind_hashbucket *port_hashtable; 126 struct sctp_bind_hashbucket *port_hashtable;
144 127
128 /* Sizes of above hashtables. */
129 int ep_hashsize;
130 int assoc_hashsize;
131 int port_hashsize;
132
133 /* Default initialization values to be applied to new associations. */
134 __u16 max_instreams;
135 __u16 max_outstreams;
136
145 /* Flag to indicate whether computing and verifying checksum 137 /* Flag to indicate whether computing and verifying checksum
146 * is disabled. */ 138 * is disabled. */
147 bool checksum_disable; 139 bool checksum_disable;
@@ -782,6 +774,7 @@ struct sctp_transport {
782 774
783 /* Has this transport moved the ctsn since we last sacked */ 775 /* Has this transport moved the ctsn since we last sacked */
784 __u32 sack_generation; 776 __u32 sack_generation;
777 u32 dst_cookie;
785 778
786 struct flowi fl; 779 struct flowi fl;
787 780
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h
index 2c5d2b4d5d1e..54bbbe547303 100644
--- a/include/net/sctp/tsnmap.h
+++ b/include/net/sctp/tsnmap.h
@@ -28,19 +28,13 @@
28 * 28 *
29 * Please send any bug reports or fixes you make to the 29 * Please send any bug reports or fixes you make to the
30 * email address(es): 30 * email address(es):
31 * lksctp developers <lksctp-developers@lists.sourceforge.net> 31 * lksctp developers <linux-sctp@vger.kernel.org>
32 *
33 * Or submit a bug report through the following website:
34 * http://www.sf.net/projects/lksctp
35 * 32 *
36 * Written or modified by: 33 * Written or modified by:
37 * Jon Grimm <jgrimm@us.ibm.com> 34 * Jon Grimm <jgrimm@us.ibm.com>
38 * La Monte H.P. Yarroll <piggy@acm.org> 35 * La Monte H.P. Yarroll <piggy@acm.org>
39 * Karl Knutson <karl@athena.chicago.il.us> 36 * Karl Knutson <karl@athena.chicago.il.us>
40 * Sridhar Samudrala <sri@us.ibm.com> 37 * Sridhar Samudrala <sri@us.ibm.com>
41 *
42 * Any bugs reported given to us we will try to fix... any fixes shared will
43 * be incorporated into the next SCTP release.
44 */ 38 */
45#include <net/sctp/constants.h> 39#include <net/sctp/constants.h>
46 40
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index ca4693b4e09e..27b9f5c90153 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -31,19 +31,13 @@
31 * 31 *
32 * Please send any bug reports or fixes you make to the 32 * Please send any bug reports or fixes you make to the
33 * email address(es): 33 * email address(es):
34 * lksctp developers <lksctp-developers@lists.sourceforge.net> 34 * lksctp developers <linux-sctp@vger.kernel.org>
35 *
36 * Or submit a bug report through the following website:
37 * http://www.sf.net/projects/lksctp
38 * 35 *
39 * Written or modified by: 36 * Written or modified by:
40 * Jon Grimm <jgrimm@us.ibm.com> 37 * Jon Grimm <jgrimm@us.ibm.com>
41 * La Monte H.P. Yarroll <piggy@acm.org> 38 * La Monte H.P. Yarroll <piggy@acm.org>
42 * Karl Knutson <karl@athena.chicago.il.us> 39 * Karl Knutson <karl@athena.chicago.il.us>
43 * Sridhar Samudrala <sri@us.ibm.com> 40 * Sridhar Samudrala <sri@us.ibm.com>
44 *
45 * Any bugs reported given to us we will try to fix... any fixes shared will
46 * be incorporated into the next SCTP release.
47 */ 41 */
48 42
49#ifndef __sctp_ulpevent_h__ 43#ifndef __sctp_ulpevent_h__
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index 00e50ba3f24b..b0cf5d54d717 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -30,18 +30,12 @@
30 * 30 *
31 * Please send any bug reports or fixes you make to the 31 * Please send any bug reports or fixes you make to the
32 * email addresses: 32 * email addresses:
33 * lksctp developers <lksctp-developers@lists.sourceforge.net> 33 * lksctp developers <linux-sctp@vger.kernel.org>
34 *
35 * Or submit a bug report through the following website:
36 * http://www.sf.net/projects/lksctp
37 * 34 *
38 * Written or modified by: 35 * Written or modified by:
39 * Jon Grimm <jgrimm@us.ibm.com> 36 * Jon Grimm <jgrimm@us.ibm.com>
40 * La Monte H.P. Yarroll <piggy@acm.org> 37 * La Monte H.P. Yarroll <piggy@acm.org>
41 * Sridhar Samudrala <sri@us.ibm.com> 38 * Sridhar Samudrala <sri@us.ibm.com>
42 *
43 * Any bugs reported given to us we will try to fix... any fixes shared will
44 * be incorporated into the next SCTP release.
45 */ 39 */
46 40
47#ifndef __sctp_ulpqueue_h__ 41#ifndef __sctp_ulpqueue_h__
diff --git a/include/net/sock.h b/include/net/sock.h
index 31d5cfbb51ec..6ba2e7b0e2b1 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -232,6 +232,7 @@ struct cg_proto;
232 * @sk_napi_id: id of the last napi context to receive data for sk 232 * @sk_napi_id: id of the last napi context to receive data for sk
233 * @sk_ll_usec: usecs to busypoll when there is no data 233 * @sk_ll_usec: usecs to busypoll when there is no data
234 * @sk_allocation: allocation mode 234 * @sk_allocation: allocation mode
235 * @sk_pacing_rate: Pacing rate (if supported by transport/packet scheduler)
235 * @sk_sndbuf: size of send buffer in bytes 236 * @sk_sndbuf: size of send buffer in bytes
236 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, 237 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE,
237 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings 238 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings
@@ -361,6 +362,7 @@ struct sock {
361 kmemcheck_bitfield_end(flags); 362 kmemcheck_bitfield_end(flags);
362 int sk_wmem_queued; 363 int sk_wmem_queued;
363 gfp_t sk_allocation; 364 gfp_t sk_allocation;
365 u32 sk_pacing_rate; /* bytes per second */
364 netdev_features_t sk_route_caps; 366 netdev_features_t sk_route_caps;
365 netdev_features_t sk_route_nocaps; 367 netdev_features_t sk_route_nocaps;
366 int sk_gso_type; 368 int sk_gso_type;
@@ -746,11 +748,6 @@ static inline int sk_stream_wspace(const struct sock *sk)
746 748
747extern void sk_stream_write_space(struct sock *sk); 749extern void sk_stream_write_space(struct sock *sk);
748 750
749static inline bool sk_stream_memory_free(const struct sock *sk)
750{
751 return sk->sk_wmem_queued < sk->sk_sndbuf;
752}
753
754/* OOB backlog add */ 751/* OOB backlog add */
755static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb) 752static inline void __sk_add_backlog(struct sock *sk, struct sk_buff *skb)
756{ 753{
@@ -950,6 +947,7 @@ struct proto {
950 unsigned int inuse_idx; 947 unsigned int inuse_idx;
951#endif 948#endif
952 949
950 bool (*stream_memory_free)(const struct sock *sk);
953 /* Memory pressure */ 951 /* Memory pressure */
954 void (*enter_memory_pressure)(struct sock *sk); 952 void (*enter_memory_pressure)(struct sock *sk);
955 atomic_long_t *memory_allocated; /* Current allocated memory. */ 953 atomic_long_t *memory_allocated; /* Current allocated memory. */
@@ -1088,6 +1086,21 @@ static inline struct cg_proto *parent_cg_proto(struct proto *proto,
1088} 1086}
1089#endif 1087#endif
1090 1088
1089static inline bool sk_stream_memory_free(const struct sock *sk)
1090{
1091 if (sk->sk_wmem_queued >= sk->sk_sndbuf)
1092 return false;
1093
1094 return sk->sk_prot->stream_memory_free ?
1095 sk->sk_prot->stream_memory_free(sk) : true;
1096}
1097
1098static inline bool sk_stream_is_writeable(const struct sock *sk)
1099{
1100 return sk_stream_wspace(sk) >= sk_stream_min_wspace(sk) &&
1101 sk_stream_memory_free(sk);
1102}
1103
1091 1104
1092static inline bool sk_has_memory_pressure(const struct sock *sk) 1105static inline bool sk_has_memory_pressure(const struct sock *sk)
1093{ 1106{
@@ -1509,6 +1522,7 @@ extern struct sk_buff *sock_rmalloc(struct sock *sk,
1509 unsigned long size, int force, 1522 unsigned long size, int force,
1510 gfp_t priority); 1523 gfp_t priority);
1511extern void sock_wfree(struct sk_buff *skb); 1524extern void sock_wfree(struct sk_buff *skb);
1525extern void skb_orphan_partial(struct sk_buff *skb);
1512extern void sock_rfree(struct sk_buff *skb); 1526extern void sock_rfree(struct sk_buff *skb);
1513extern void sock_edemux(struct sk_buff *skb); 1527extern void sock_edemux(struct sk_buff *skb);
1514 1528
@@ -1527,7 +1541,8 @@ extern struct sk_buff *sock_alloc_send_pskb(struct sock *sk,
1527 unsigned long header_len, 1541 unsigned long header_len,
1528 unsigned long data_len, 1542 unsigned long data_len,
1529 int noblock, 1543 int noblock,
1530 int *errcode); 1544 int *errcode,
1545 int max_page_order);
1531extern void *sock_kmalloc(struct sock *sk, int size, 1546extern void *sock_kmalloc(struct sock *sk, int size,
1532 gfp_t priority); 1547 gfp_t priority);
1533extern void sock_kfree_s(struct sock *sk, void *mem, int size); 1548extern void sock_kfree_s(struct sock *sk, void *mem, int size);
@@ -2249,6 +2264,8 @@ static inline struct sock *skb_steal_sock(struct sk_buff *skb)
2249extern void sock_enable_timestamp(struct sock *sk, int flag); 2264extern void sock_enable_timestamp(struct sock *sk, int flag);
2250extern int sock_get_timestamp(struct sock *, struct timeval __user *); 2265extern int sock_get_timestamp(struct sock *, struct timeval __user *);
2251extern int sock_get_timestampns(struct sock *, struct timespec __user *); 2266extern int sock_get_timestampns(struct sock *, struct timespec __user *);
2267extern int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,
2268 int level, int type);
2252 2269
2253/* 2270/*
2254 * Enable debug/info messages 2271 * Enable debug/info messages
diff --git a/include/net/tcp.h b/include/net/tcp.h
index d1980054ec75..b1aa324c5e65 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -192,10 +192,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
192#define TCPOLEN_TIMESTAMP 10 192#define TCPOLEN_TIMESTAMP 10
193#define TCPOLEN_MD5SIG 18 193#define TCPOLEN_MD5SIG 18
194#define TCPOLEN_EXP_FASTOPEN_BASE 4 194#define TCPOLEN_EXP_FASTOPEN_BASE 4
195#define TCPOLEN_COOKIE_BASE 2 /* Cookie-less header extension */
196#define TCPOLEN_COOKIE_PAIR 3 /* Cookie pair header extension */
197#define TCPOLEN_COOKIE_MIN (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MIN)
198#define TCPOLEN_COOKIE_MAX (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MAX)
199 195
200/* But this is what stacks really send out. */ 196/* But this is what stacks really send out. */
201#define TCPOLEN_TSTAMP_ALIGNED 12 197#define TCPOLEN_TSTAMP_ALIGNED 12
@@ -284,6 +280,8 @@ extern int sysctl_tcp_thin_dupack;
284extern int sysctl_tcp_early_retrans; 280extern int sysctl_tcp_early_retrans;
285extern int sysctl_tcp_limit_output_bytes; 281extern int sysctl_tcp_limit_output_bytes;
286extern int sysctl_tcp_challenge_ack_limit; 282extern int sysctl_tcp_challenge_ack_limit;
283extern unsigned int sysctl_tcp_notsent_lowat;
284extern int sysctl_tcp_min_tso_segs;
287 285
288extern atomic_long_t tcp_memory_allocated; 286extern atomic_long_t tcp_memory_allocated;
289extern struct percpu_counter tcp_sockets_allocated; 287extern struct percpu_counter tcp_sockets_allocated;
@@ -373,8 +371,8 @@ extern void tcp_delack_timer_handler(struct sock *sk);
373extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); 371extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
374extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, 372extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
375 const struct tcphdr *th, unsigned int len); 373 const struct tcphdr *th, unsigned int len);
376extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, 374extern void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
377 const struct tcphdr *th, unsigned int len); 375 const struct tcphdr *th, unsigned int len);
378extern void tcp_rcv_space_adjust(struct sock *sk); 376extern void tcp_rcv_space_adjust(struct sock *sk);
379extern void tcp_cleanup_rbuf(struct sock *sk, int copied); 377extern void tcp_cleanup_rbuf(struct sock *sk, int copied);
380extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); 378extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp);
@@ -479,9 +477,13 @@ void inet_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb);
479 477
480/* From syncookies.c */ 478/* From syncookies.c */
481extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS]; 479extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
480extern int __cookie_v4_check(const struct iphdr *iph, const struct tcphdr *th,
481 u32 cookie);
482extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, 482extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
483 struct ip_options *opt); 483 struct ip_options *opt);
484#ifdef CONFIG_SYN_COOKIES 484#ifdef CONFIG_SYN_COOKIES
485extern u32 __cookie_v4_init_sequence(const struct iphdr *iph,
486 const struct tcphdr *th, u16 *mssp);
485extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, 487extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb,
486 __u16 *mss); 488 __u16 *mss);
487#else 489#else
@@ -498,8 +500,12 @@ extern bool cookie_check_timestamp(struct tcp_options_received *opt,
498 struct net *net, bool *ecn_ok); 500 struct net *net, bool *ecn_ok);
499 501
500/* From net/ipv6/syncookies.c */ 502/* From net/ipv6/syncookies.c */
503extern int __cookie_v6_check(const struct ipv6hdr *iph, const struct tcphdr *th,
504 u32 cookie);
501extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); 505extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
502#ifdef CONFIG_SYN_COOKIES 506#ifdef CONFIG_SYN_COOKIES
507extern u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph,
508 const struct tcphdr *th, u16 *mssp);
503extern __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb, 509extern __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb,
504 __u16 *mss); 510 __u16 *mss);
505#else 511#else
@@ -591,7 +597,6 @@ extern void tcp_initialize_rcv_mss(struct sock *sk);
591extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); 597extern int tcp_mtu_to_mss(struct sock *sk, int pmtu);
592extern int tcp_mss_to_mtu(struct sock *sk, int mss); 598extern int tcp_mss_to_mtu(struct sock *sk, int mss);
593extern void tcp_mtup_init(struct sock *sk); 599extern void tcp_mtup_init(struct sock *sk);
594extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt);
595extern void tcp_init_buffer_space(struct sock *sk); 600extern void tcp_init_buffer_space(struct sock *sk);
596 601
597static inline void tcp_bound_rto(const struct sock *sk) 602static inline void tcp_bound_rto(const struct sock *sk)
@@ -1094,15 +1099,6 @@ static inline void tcp_openreq_init(struct request_sock *req,
1094 ireq->loc_port = tcp_hdr(skb)->dest; 1099 ireq->loc_port = tcp_hdr(skb)->dest;
1095} 1100}
1096 1101
1097/* Compute time elapsed between SYNACK and the ACK completing 3WHS */
1098static inline void tcp_synack_rtt_meas(struct sock *sk,
1099 struct request_sock *req)
1100{
1101 if (tcp_rsk(req)->snt_synack)
1102 tcp_valid_rtt_meas(sk,
1103 tcp_time_stamp - tcp_rsk(req)->snt_synack);
1104}
1105
1106extern void tcp_enter_memory_pressure(struct sock *sk); 1102extern void tcp_enter_memory_pressure(struct sock *sk);
1107 1103
1108static inline int keepalive_intvl_when(const struct tcp_sock *tp) 1104static inline int keepalive_intvl_when(const struct tcp_sock *tp)
@@ -1313,7 +1309,8 @@ void tcp_free_fastopen_req(struct tcp_sock *tp);
1313 1309
1314extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; 1310extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
1315int tcp_fastopen_reset_cipher(void *key, unsigned int len); 1311int tcp_fastopen_reset_cipher(void *key, unsigned int len);
1316void tcp_fastopen_cookie_gen(__be32 addr, struct tcp_fastopen_cookie *foc); 1312extern void tcp_fastopen_cookie_gen(__be32 src, __be32 dst,
1313 struct tcp_fastopen_cookie *foc);
1317 1314
1318#define TCP_FASTOPEN_KEY_LENGTH 16 1315#define TCP_FASTOPEN_KEY_LENGTH 16
1319 1316
@@ -1549,6 +1546,19 @@ extern int tcp_gro_complete(struct sk_buff *skb);
1549extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr, 1546extern void __tcp_v4_send_check(struct sk_buff *skb, __be32 saddr,
1550 __be32 daddr); 1547 __be32 daddr);
1551 1548
1549static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp)
1550{
1551 return tp->notsent_lowat ?: sysctl_tcp_notsent_lowat;
1552}
1553
1554static inline bool tcp_stream_memory_free(const struct sock *sk)
1555{
1556 const struct tcp_sock *tp = tcp_sk(sk);
1557 u32 notsent_bytes = tp->write_seq - tp->snd_nxt;
1558
1559 return notsent_bytes < tcp_notsent_lowat(tp);
1560}
1561
1552#ifdef CONFIG_PROC_FS 1562#ifdef CONFIG_PROC_FS
1553extern int tcp4_proc_init(void); 1563extern int tcp4_proc_init(void);
1554extern void tcp4_proc_exit(void); 1564extern void tcp4_proc_exit(void);
diff --git a/include/net/udp.h b/include/net/udp.h
index 74c10ec5e74f..ef2e0b7843a0 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -183,6 +183,7 @@ extern int udp_sendmsg(struct kiocb *iocb, struct sock *sk,
183 struct msghdr *msg, size_t len); 183 struct msghdr *msg, size_t len);
184extern int udp_push_pending_frames(struct sock *sk); 184extern int udp_push_pending_frames(struct sock *sk);
185extern void udp_flush_pending_frames(struct sock *sk); 185extern void udp_flush_pending_frames(struct sock *sk);
186extern void udp4_hwcsum(struct sk_buff *skb, __be32 src, __be32 dst);
186extern int udp_rcv(struct sk_buff *skb); 187extern int udp_rcv(struct sk_buff *skb);
187extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg); 188extern int udp_ioctl(struct sock *sk, int cmd, unsigned long arg);
188extern int udp_disconnect(struct sock *sk, int flags); 189extern int udp_disconnect(struct sock *sk, int flags);
diff --git a/include/net/vsock_addr.h b/include/net/vsock_addr.h
new file mode 100644
index 000000000000..9ccd5316eac0
--- /dev/null
+++ b/include/net/vsock_addr.h
@@ -0,0 +1,30 @@
1/*
2 * VMware vSockets Driver
3 *
4 * Copyright (C) 2007-2013 VMware, Inc. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation version 2 and no later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 */
15
16#ifndef _VSOCK_ADDR_H_
17#define _VSOCK_ADDR_H_
18
19#include <linux/vm_sockets.h>
20
21void vsock_addr_init(struct sockaddr_vm *addr, u32 cid, u32 port);
22int vsock_addr_validate(const struct sockaddr_vm *addr);
23bool vsock_addr_bound(const struct sockaddr_vm *addr);
24void vsock_addr_unbind(struct sockaddr_vm *addr);
25bool vsock_addr_equals_addr(const struct sockaddr_vm *addr,
26 const struct sockaddr_vm *other);
27int vsock_addr_cast(const struct sockaddr *addr, size_t len,
28 struct sockaddr_vm **out_addr);
29
30#endif
diff --git a/include/net/vxlan.h b/include/net/vxlan.h
new file mode 100644
index 000000000000..2d64d3cd4999
--- /dev/null
+++ b/include/net/vxlan.h
@@ -0,0 +1,40 @@
1#ifndef __NET_VXLAN_H
2#define __NET_VXLAN_H 1
3
4#include <linux/skbuff.h>
5#include <linux/netdevice.h>
6#include <linux/udp.h>
7
8#define VNI_HASH_BITS 10
9#define VNI_HASH_SIZE (1<<VNI_HASH_BITS)
10
11struct vxlan_sock;
12typedef void (vxlan_rcv_t)(struct vxlan_sock *vh, struct sk_buff *skb, __be32 key);
13
14/* per UDP socket information */
15struct vxlan_sock {
16 struct hlist_node hlist;
17 vxlan_rcv_t *rcv;
18 void *data;
19 struct work_struct del_work;
20 struct socket *sock;
21 struct rcu_head rcu;
22 struct hlist_head vni_list[VNI_HASH_SIZE];
23 atomic_t refcnt;
24};
25
26struct vxlan_sock *vxlan_sock_add(struct net *net, __be16 port,
27 vxlan_rcv_t *rcv, void *data,
28 bool no_share, bool ipv6);
29
30void vxlan_sock_release(struct vxlan_sock *vs);
31
32int vxlan_xmit_skb(struct vxlan_sock *vs,
33 struct rtable *rt, struct sk_buff *skb,
34 __be32 src, __be32 dst, __u8 tos, __u8 ttl, __be16 df,
35 __be16 src_port, __be16 dst_port, __be32 vni);
36
37__be16 vxlan_src_port(__u16 port_min, __u16 port_max, struct sk_buff *skb);
38
39void vxlan_get_rx_port(struct net_device *netdev);
40#endif
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 94ce082b29dc..e253bf0cc7ef 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -341,10 +341,13 @@ struct xfrm_state_afinfo {
341 struct sk_buff *skb); 341 struct sk_buff *skb);
342 int (*transport_finish)(struct sk_buff *skb, 342 int (*transport_finish)(struct sk_buff *skb,
343 int async); 343 int async);
344 void (*local_error)(struct sk_buff *skb, u32 mtu);
344}; 345};
345 346
346extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo); 347extern int xfrm_state_register_afinfo(struct xfrm_state_afinfo *afinfo);
347extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); 348extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo);
349extern struct xfrm_state_afinfo *xfrm_state_get_afinfo(unsigned int family);
350extern void xfrm_state_put_afinfo(struct xfrm_state_afinfo *afinfo);
348 351
349extern void xfrm_state_delete_tunnel(struct xfrm_state *x); 352extern void xfrm_state_delete_tunnel(struct xfrm_state *x);
350 353
@@ -1477,6 +1480,7 @@ extern int xfrm_input_resume(struct sk_buff *skb, int nexthdr);
1477extern int xfrm_output_resume(struct sk_buff *skb, int err); 1480extern int xfrm_output_resume(struct sk_buff *skb, int err);
1478extern int xfrm_output(struct sk_buff *skb); 1481extern int xfrm_output(struct sk_buff *skb);
1479extern int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb); 1482extern int xfrm_inner_extract_output(struct xfrm_state *x, struct sk_buff *skb);
1483extern void xfrm_local_error(struct sk_buff *skb, int mtu);
1480extern int xfrm4_extract_header(struct sk_buff *skb); 1484extern int xfrm4_extract_header(struct sk_buff *skb);
1481extern int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb); 1485extern int xfrm4_extract_input(struct xfrm_state *x, struct sk_buff *skb);
1482extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi, 1486extern int xfrm4_rcv_encap(struct sk_buff *skb, int nexthdr, __be32 spi,
@@ -1497,6 +1501,7 @@ extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler, unsigned short fam
1497extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family); 1501extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family);
1498extern int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel *handler); 1502extern int xfrm4_mode_tunnel_input_register(struct xfrm_tunnel *handler);
1499extern int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel *handler); 1503extern int xfrm4_mode_tunnel_input_deregister(struct xfrm_tunnel *handler);
1504extern void xfrm4_local_error(struct sk_buff *skb, u32 mtu);
1500extern int xfrm6_extract_header(struct sk_buff *skb); 1505extern int xfrm6_extract_header(struct sk_buff *skb);
1501extern int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb); 1506extern int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb);
1502extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi); 1507extern int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi);
@@ -1514,6 +1519,7 @@ extern int xfrm6_output(struct sk_buff *skb);
1514extern int xfrm6_output_finish(struct sk_buff *skb); 1519extern int xfrm6_output_finish(struct sk_buff *skb);
1515extern int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb, 1520extern int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb,
1516 u8 **prevhdr); 1521 u8 **prevhdr);
1522extern void xfrm6_local_error(struct sk_buff *skb, u32 mtu);
1517 1523
1518#ifdef CONFIG_XFRM 1524#ifdef CONFIG_XFRM
1519extern int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb); 1525extern int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb);
@@ -1548,7 +1554,7 @@ struct xfrm_policy *xfrm_policy_byid(struct net *net, u32 mark, u8, int dir, u32
1548int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info); 1554int xfrm_policy_flush(struct net *net, u8 type, struct xfrm_audit *audit_info);
1549u32 xfrm_get_acqseq(void); 1555u32 xfrm_get_acqseq(void);
1550extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi); 1556extern int xfrm_alloc_spi(struct xfrm_state *x, u32 minspi, u32 maxspi);
1551struct xfrm_state *xfrm_find_acq(struct net *net, struct xfrm_mark *mark, 1557struct xfrm_state *xfrm_find_acq(struct net *net, const struct xfrm_mark *mark,
1552 u8 mode, u32 reqid, u8 proto, 1558 u8 mode, u32 reqid, u8 proto,
1553 const xfrm_address_t *daddr, 1559 const xfrm_address_t *daddr,
1554 const xfrm_address_t *saddr, int create, 1560 const xfrm_address_t *saddr, int create,
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 645c3cedce9c..e393171e2fac 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -116,7 +116,8 @@ enum ib_device_cap_flags {
116 IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21), 116 IB_DEVICE_MEM_MGT_EXTENSIONS = (1<<21),
117 IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22), 117 IB_DEVICE_BLOCK_MULTICAST_LOOPBACK = (1<<22),
118 IB_DEVICE_MEM_WINDOW_TYPE_2A = (1<<23), 118 IB_DEVICE_MEM_WINDOW_TYPE_2A = (1<<23),
119 IB_DEVICE_MEM_WINDOW_TYPE_2B = (1<<24) 119 IB_DEVICE_MEM_WINDOW_TYPE_2B = (1<<24),
120 IB_DEVICE_MANAGED_FLOW_STEERING = (1<<29)
120}; 121};
121 122
122enum ib_atomic_cap { 123enum ib_atomic_cap {
@@ -635,6 +636,12 @@ enum ib_qp_create_flags {
635 IB_QP_CREATE_RESERVED_END = 1 << 31, 636 IB_QP_CREATE_RESERVED_END = 1 << 31,
636}; 637};
637 638
639
640/*
641 * Note: users may not call ib_close_qp or ib_destroy_qp from the event_handler
642 * callback to destroy the passed in QP.
643 */
644
638struct ib_qp_init_attr { 645struct ib_qp_init_attr {
639 void (*event_handler)(struct ib_event *, void *); 646 void (*event_handler)(struct ib_event *, void *);
640 void *qp_context; 647 void *qp_context;
@@ -953,6 +960,7 @@ struct ib_ucontext {
953 struct list_head srq_list; 960 struct list_head srq_list;
954 struct list_head ah_list; 961 struct list_head ah_list;
955 struct list_head xrcd_list; 962 struct list_head xrcd_list;
963 struct list_head rule_list;
956 int closing; 964 int closing;
957}; 965};
958 966
@@ -1033,7 +1041,8 @@ struct ib_qp {
1033 struct ib_srq *srq; 1041 struct ib_srq *srq;
1034 struct ib_xrcd *xrcd; /* XRC TGT QPs only */ 1042 struct ib_xrcd *xrcd; /* XRC TGT QPs only */
1035 struct list_head xrcd_list; 1043 struct list_head xrcd_list;
1036 atomic_t usecnt; /* count times opened, mcast attaches */ 1044 /* count times opened, mcast attaches, flow attaches */
1045 atomic_t usecnt;
1037 struct list_head open_list; 1046 struct list_head open_list;
1038 struct ib_qp *real_qp; 1047 struct ib_qp *real_qp;
1039 struct ib_uobject *uobject; 1048 struct ib_uobject *uobject;
@@ -1068,6 +1077,112 @@ struct ib_fmr {
1068 u32 rkey; 1077 u32 rkey;
1069}; 1078};
1070 1079
1080/* Supported steering options */
1081enum ib_flow_attr_type {
1082 /* steering according to rule specifications */
1083 IB_FLOW_ATTR_NORMAL = 0x0,
1084 /* default unicast and multicast rule -
1085 * receive all Eth traffic which isn't steered to any QP
1086 */
1087 IB_FLOW_ATTR_ALL_DEFAULT = 0x1,
1088 /* default multicast rule -
1089 * receive all Eth multicast traffic which isn't steered to any QP
1090 */
1091 IB_FLOW_ATTR_MC_DEFAULT = 0x2,
1092 /* sniffer rule - receive all port traffic */
1093 IB_FLOW_ATTR_SNIFFER = 0x3
1094};
1095
1096/* Supported steering header types */
1097enum ib_flow_spec_type {
1098 /* L2 headers*/
1099 IB_FLOW_SPEC_ETH = 0x20,
1100 /* L3 header*/
1101 IB_FLOW_SPEC_IPV4 = 0x30,
1102 /* L4 headers*/
1103 IB_FLOW_SPEC_TCP = 0x40,
1104 IB_FLOW_SPEC_UDP = 0x41
1105};
1106
1107#define IB_FLOW_SPEC_SUPPORT_LAYERS 4
1108
1109/* Flow steering rule priority is set according to it's domain.
1110 * Lower domain value means higher priority.
1111 */
1112enum ib_flow_domain {
1113 IB_FLOW_DOMAIN_USER,
1114 IB_FLOW_DOMAIN_ETHTOOL,
1115 IB_FLOW_DOMAIN_RFS,
1116 IB_FLOW_DOMAIN_NIC,
1117 IB_FLOW_DOMAIN_NUM /* Must be last */
1118};
1119
1120struct ib_flow_eth_filter {
1121 u8 dst_mac[6];
1122 u8 src_mac[6];
1123 __be16 ether_type;
1124 __be16 vlan_tag;
1125};
1126
1127struct ib_flow_spec_eth {
1128 enum ib_flow_spec_type type;
1129 u16 size;
1130 struct ib_flow_eth_filter val;
1131 struct ib_flow_eth_filter mask;
1132};
1133
1134struct ib_flow_ipv4_filter {
1135 __be32 src_ip;
1136 __be32 dst_ip;
1137};
1138
1139struct ib_flow_spec_ipv4 {
1140 enum ib_flow_spec_type type;
1141 u16 size;
1142 struct ib_flow_ipv4_filter val;
1143 struct ib_flow_ipv4_filter mask;
1144};
1145
1146struct ib_flow_tcp_udp_filter {
1147 __be16 dst_port;
1148 __be16 src_port;
1149};
1150
1151struct ib_flow_spec_tcp_udp {
1152 enum ib_flow_spec_type type;
1153 u16 size;
1154 struct ib_flow_tcp_udp_filter val;
1155 struct ib_flow_tcp_udp_filter mask;
1156};
1157
1158union ib_flow_spec {
1159 struct {
1160 enum ib_flow_spec_type type;
1161 u16 size;
1162 };
1163 struct ib_flow_spec_eth eth;
1164 struct ib_flow_spec_ipv4 ipv4;
1165 struct ib_flow_spec_tcp_udp tcp_udp;
1166};
1167
1168struct ib_flow_attr {
1169 enum ib_flow_attr_type type;
1170 u16 size;
1171 u16 priority;
1172 u32 flags;
1173 u8 num_of_specs;
1174 u8 port;
1175 /* Following are the optional layers according to user request
1176 * struct ib_flow_spec_xxx
1177 * struct ib_flow_spec_yyy
1178 */
1179};
1180
1181struct ib_flow {
1182 struct ib_qp *qp;
1183 struct ib_uobject *uobject;
1184};
1185
1071struct ib_mad; 1186struct ib_mad;
1072struct ib_grh; 1187struct ib_grh;
1073 1188
@@ -1300,6 +1415,11 @@ struct ib_device {
1300 struct ib_ucontext *ucontext, 1415 struct ib_ucontext *ucontext,
1301 struct ib_udata *udata); 1416 struct ib_udata *udata);
1302 int (*dealloc_xrcd)(struct ib_xrcd *xrcd); 1417 int (*dealloc_xrcd)(struct ib_xrcd *xrcd);
1418 struct ib_flow * (*create_flow)(struct ib_qp *qp,
1419 struct ib_flow_attr
1420 *flow_attr,
1421 int domain);
1422 int (*destroy_flow)(struct ib_flow *flow_id);
1303 1423
1304 struct ib_dma_mapping_ops *dma_ops; 1424 struct ib_dma_mapping_ops *dma_ops;
1305 1425
@@ -2260,4 +2380,8 @@ struct ib_xrcd *ib_alloc_xrcd(struct ib_device *device);
2260 */ 2380 */
2261int ib_dealloc_xrcd(struct ib_xrcd *xrcd); 2381int ib_dealloc_xrcd(struct ib_xrcd *xrcd);
2262 2382
2383struct ib_flow *ib_create_flow(struct ib_qp *qp,
2384 struct ib_flow_attr *flow_attr, int domain);
2385int ib_destroy_flow(struct ib_flow *flow_id);
2386
2263#endif /* IB_VERBS_H */ 2387#endif /* IB_VERBS_H */
diff --git a/include/rdma/iw_cm.h b/include/rdma/iw_cm.h
index 1a046b1595cc..1017e0bdf8ba 100644
--- a/include/rdma/iw_cm.h
+++ b/include/rdma/iw_cm.h
@@ -49,8 +49,8 @@ enum iw_cm_event_type {
49struct iw_cm_event { 49struct iw_cm_event {
50 enum iw_cm_event_type event; 50 enum iw_cm_event_type event;
51 int status; 51 int status;
52 struct sockaddr_in local_addr; 52 struct sockaddr_storage local_addr;
53 struct sockaddr_in remote_addr; 53 struct sockaddr_storage remote_addr;
54 void *private_data; 54 void *private_data;
55 void *provider_data; 55 void *provider_data;
56 u8 private_data_len; 56 u8 private_data_len;
@@ -83,8 +83,8 @@ struct iw_cm_id {
83 iw_cm_handler cm_handler; /* client callback function */ 83 iw_cm_handler cm_handler; /* client callback function */
84 void *context; /* client cb context */ 84 void *context; /* client cb context */
85 struct ib_device *device; 85 struct ib_device *device;
86 struct sockaddr_in local_addr; 86 struct sockaddr_storage local_addr;
87 struct sockaddr_in remote_addr; 87 struct sockaddr_storage remote_addr;
88 void *provider_data; /* provider private data */ 88 void *provider_data; /* provider private data */
89 iw_event_handler event_handler; /* cb for provider 89 iw_event_handler event_handler; /* cb for provider
90 events */ 90 events */
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h
index 9d28ded2a3f4..13d81c5c4ebf 100644
--- a/include/scsi/iscsi_if.h
+++ b/include/scsi/iscsi_if.h
@@ -494,6 +494,38 @@ enum iscsi_param {
494 ISCSI_PARAM_BOOT_NIC, 494 ISCSI_PARAM_BOOT_NIC,
495 ISCSI_PARAM_BOOT_TARGET, 495 ISCSI_PARAM_BOOT_TARGET,
496 496
497 ISCSI_PARAM_AUTO_SND_TGT_DISABLE,
498 ISCSI_PARAM_DISCOVERY_SESS,
499 ISCSI_PARAM_PORTAL_TYPE,
500 ISCSI_PARAM_CHAP_AUTH_EN,
501 ISCSI_PARAM_DISCOVERY_LOGOUT_EN,
502 ISCSI_PARAM_BIDI_CHAP_EN,
503 ISCSI_PARAM_DISCOVERY_AUTH_OPTIONAL,
504
505 ISCSI_PARAM_DEF_TIME2WAIT,
506 ISCSI_PARAM_DEF_TIME2RETAIN,
507 ISCSI_PARAM_MAX_SEGMENT_SIZE,
508 ISCSI_PARAM_STATSN,
509 ISCSI_PARAM_KEEPALIVE_TMO,
510 ISCSI_PARAM_LOCAL_PORT,
511 ISCSI_PARAM_TSID,
512 ISCSI_PARAM_DEF_TASKMGMT_TMO,
513
514 ISCSI_PARAM_TCP_TIMESTAMP_STAT,
515 ISCSI_PARAM_TCP_WSF_DISABLE,
516 ISCSI_PARAM_TCP_NAGLE_DISABLE,
517 ISCSI_PARAM_TCP_TIMER_SCALE,
518 ISCSI_PARAM_TCP_TIMESTAMP_EN,
519 ISCSI_PARAM_TCP_XMIT_WSF,
520 ISCSI_PARAM_TCP_RECV_WSF,
521 ISCSI_PARAM_IP_FRAGMENT_DISABLE,
522 ISCSI_PARAM_IPV4_TOS,
523 ISCSI_PARAM_IPV6_TC,
524 ISCSI_PARAM_IPV6_FLOW_LABEL,
525 ISCSI_PARAM_IS_FW_ASSIGNED_IPV6,
526
527 ISCSI_PARAM_DISCOVERY_PARENT_IDX,
528 ISCSI_PARAM_DISCOVERY_PARENT_TYPE,
497 /* must always be last */ 529 /* must always be last */
498 ISCSI_PARAM_MAX, 530 ISCSI_PARAM_MAX,
499}; 531};
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 4265a4bb83cd..6ac9e17acdc4 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -62,6 +62,8 @@ enum {
62 TMF_NOT_FOUND, 62 TMF_NOT_FOUND,
63}; 63};
64 64
65#define ISID_SIZE 6
66
65/* Connection suspend "bit" */ 67/* Connection suspend "bit" */
66#define ISCSI_SUSPEND_BIT 1 68#define ISCSI_SUSPEND_BIT 1
67 69
@@ -173,6 +175,7 @@ struct iscsi_conn {
173 175
174 /* iSCSI connection-wide sequencing */ 176 /* iSCSI connection-wide sequencing */
175 uint32_t exp_statsn; 177 uint32_t exp_statsn;
178 uint32_t statsn;
176 179
177 /* control data */ 180 /* control data */
178 int id; /* CID */ 181 int id; /* CID */
@@ -213,6 +216,22 @@ struct iscsi_conn {
213 int persistent_port; 216 int persistent_port;
214 char *persistent_address; 217 char *persistent_address;
215 218
219 unsigned max_segment_size;
220 unsigned tcp_xmit_wsf;
221 unsigned tcp_recv_wsf;
222 uint16_t keepalive_tmo;
223 uint16_t local_port;
224 uint8_t tcp_timestamp_stat;
225 uint8_t tcp_nagle_disable;
226 uint8_t tcp_wsf_disable;
227 uint8_t tcp_timer_scale;
228 uint8_t tcp_timestamp_en;
229 uint8_t fragment_disable;
230 uint8_t ipv4_tos;
231 uint8_t ipv6_traffic_class;
232 uint8_t ipv6_flow_label;
233 uint8_t is_fw_assigned_ipv6;
234
216 /* MIB-statistics */ 235 /* MIB-statistics */
217 uint64_t txdata_octets; 236 uint64_t txdata_octets;
218 uint64_t rxdata_octets; 237 uint64_t rxdata_octets;
@@ -290,6 +309,18 @@ struct iscsi_session {
290 char *boot_root; 309 char *boot_root;
291 char *boot_nic; 310 char *boot_nic;
292 char *boot_target; 311 char *boot_target;
312 char *portal_type;
313 char *discovery_parent_type;
314 uint16_t discovery_parent_idx;
315 uint16_t def_taskmgmt_tmo;
316 uint16_t tsid;
317 uint8_t auto_snd_tgt_disable;
318 uint8_t discovery_sess;
319 uint8_t chap_auth_en;
320 uint8_t discovery_logout_en;
321 uint8_t bidi_chap_en;
322 uint8_t discovery_auth_optional;
323 uint8_t isid[ISID_SIZE];
293 324
294 /* control data */ 325 /* control data */
295 struct iscsi_transport *tt; 326 struct iscsi_transport *tt;
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 4b87d99e7fa1..d477bfb73fb9 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -457,6 +457,8 @@ static inline int scsi_is_wlun(unsigned int lun)
457 * other paths */ 457 * other paths */
458#define DID_NEXUS_FAILURE 0x11 /* Permanent nexus failure, retry on other 458#define DID_NEXUS_FAILURE 0x11 /* Permanent nexus failure, retry on other
459 * paths might yield different results */ 459 * paths might yield different results */
460#define DID_ALLOC_FAILURE 0x12 /* Space allocation on the device failed */
461#define DID_MEDIUM_ERROR 0x13 /* Medium error */
460#define DRIVER_OK 0x00 /* Driver status */ 462#define DRIVER_OK 0x00 /* Driver status */
461 463
462/* 464/*
@@ -486,7 +488,6 @@ static inline int scsi_is_wlun(unsigned int lun)
486#define TIMEOUT_ERROR 0x2007 488#define TIMEOUT_ERROR 0x2007
487#define SCSI_RETURN_NOT_HANDLED 0x2008 489#define SCSI_RETURN_NOT_HANDLED 0x2008
488#define FAST_IO_FAIL 0x2009 490#define FAST_IO_FAIL 0x2009
489#define TARGET_ERROR 0x200A
490 491
491/* 492/*
492 * Midlevel queue return values. 493 * Midlevel queue return values.
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index a44954c7cdc2..d65fbec2533d 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -52,8 +52,15 @@ enum scsi_device_state {
52 52
53enum scsi_device_event { 53enum scsi_device_event {
54 SDEV_EVT_MEDIA_CHANGE = 1, /* media has changed */ 54 SDEV_EVT_MEDIA_CHANGE = 1, /* media has changed */
55 SDEV_EVT_INQUIRY_CHANGE_REPORTED, /* 3F 03 UA reported */
56 SDEV_EVT_CAPACITY_CHANGE_REPORTED, /* 2A 09 UA reported */
57 SDEV_EVT_SOFT_THRESHOLD_REACHED_REPORTED, /* 38 07 UA reported */
58 SDEV_EVT_MODE_PARAMETER_CHANGE_REPORTED, /* 2A 01 UA reported */
59 SDEV_EVT_LUN_CHANGE_REPORTED, /* 3F 0E UA reported */
60
61 SDEV_EVT_FIRST = SDEV_EVT_MEDIA_CHANGE,
62 SDEV_EVT_LAST = SDEV_EVT_LUN_CHANGE_REPORTED,
55 63
56 SDEV_EVT_LAST = SDEV_EVT_MEDIA_CHANGE,
57 SDEV_EVT_MAXBITS = SDEV_EVT_LAST + 1 64 SDEV_EVT_MAXBITS = SDEV_EVT_LAST + 1
58}; 65};
59 66
@@ -164,6 +171,7 @@ struct scsi_device {
164 atomic_t disk_events_disable_depth; /* disable depth for disk events */ 171 atomic_t disk_events_disable_depth; /* disable depth for disk events */
165 172
166 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */ 173 DECLARE_BITMAP(supported_events, SDEV_EVT_MAXBITS); /* supported events */
174 DECLARE_BITMAP(pending_events, SDEV_EVT_MAXBITS); /* pending events */
167 struct list_head event_list; /* asserted events */ 175 struct list_head event_list; /* asserted events */
168 struct work_struct event_work; 176 struct work_struct event_work;
169 177
@@ -261,6 +269,9 @@ struct scsi_target {
261 * means no lun present. */ 269 * means no lun present. */
262 unsigned int no_report_luns:1; /* Don't use 270 unsigned int no_report_luns:1; /* Don't use
263 * REPORT LUNS for scanning. */ 271 * REPORT LUNS for scanning. */
272 unsigned int expecting_lun_change:1; /* A device has reported
273 * a 3F/0E UA, other devices on
274 * the same target will also. */
264 /* commands actually active on LLD. protected by host lock. */ 275 /* commands actually active on LLD. protected by host lock. */
265 unsigned int target_busy; 276 unsigned int target_busy;
266 /* 277 /*
diff --git a/include/sound/core.h b/include/sound/core.h
index c586617cfa0d..2a14f1f02d4f 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -27,6 +27,7 @@
27#include <linux/rwsem.h> /* struct rw_semaphore */ 27#include <linux/rwsem.h> /* struct rw_semaphore */
28#include <linux/pm.h> /* pm_message_t */ 28#include <linux/pm.h> /* pm_message_t */
29#include <linux/stringify.h> 29#include <linux/stringify.h>
30#include <linux/printk.h>
30 31
31/* number of supported soundcards */ 32/* number of supported soundcards */
32#ifdef CONFIG_SND_DYNAMIC_MINORS 33#ifdef CONFIG_SND_DYNAMIC_MINORS
@@ -376,6 +377,11 @@ void __snd_printk(unsigned int level, const char *file, int line,
376#define snd_BUG() WARN(1, "BUG?\n") 377#define snd_BUG() WARN(1, "BUG?\n")
377 378
378/** 379/**
380 * Suppress high rates of output when CONFIG_SND_DEBUG is enabled.
381 */
382#define snd_printd_ratelimit() printk_ratelimit()
383
384/**
379 * snd_BUG_ON - debugging check macro 385 * snd_BUG_ON - debugging check macro
380 * @cond: condition to evaluate 386 * @cond: condition to evaluate
381 * 387 *
@@ -398,6 +404,8 @@ static inline void _snd_printd(int level, const char *format, ...) {}
398 unlikely(__ret_warn_on); \ 404 unlikely(__ret_warn_on); \
399}) 405})
400 406
407static inline bool snd_printd_ratelimit(void) { return false; }
408
401#endif /* CONFIG_SND_DEBUG */ 409#endif /* CONFIG_SND_DEBUG */
402 410
403#ifdef CONFIG_SND_DEBUG_VERBOSE 411#ifdef CONFIG_SND_DEBUG_VERBOSE
diff --git a/include/sound/pxa2xx-lib.h b/include/sound/pxa2xx-lib.h
index 2fd3d251d9a5..56e818e4a1cb 100644
--- a/include/sound/pxa2xx-lib.h
+++ b/include/sound/pxa2xx-lib.h
@@ -6,13 +6,6 @@
6 6
7/* PCM */ 7/* PCM */
8 8
9struct pxa2xx_pcm_dma_params {
10 char *name; /* stream identifier */
11 u32 dcmd; /* DMA descriptor dcmd field */
12 volatile u32 *drcmr; /* the DMA request channel to use */
13 u32 dev_addr; /* device physical address for DMA */
14};
15
16extern int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream, 9extern int __pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
17 struct snd_pcm_hw_params *params); 10 struct snd_pcm_hw_params *params);
18extern int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream); 11extern int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream);
diff --git a/include/sound/rcar_snd.h b/include/sound/rcar_snd.h
new file mode 100644
index 000000000000..d35412ae03b3
--- /dev/null
+++ b/include/sound/rcar_snd.h
@@ -0,0 +1,84 @@
1/*
2 * Renesas R-Car SRU/SCU/SSIU/SSI support
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef RCAR_SND_H
13#define RCAR_SND_H
14
15#include <linux/sh_clk.h>
16
17#define RSND_GEN1_SRU 0
18#define RSND_GEN1_ADG 1
19#define RSND_GEN1_SSI 2
20
21#define RSND_GEN2_SRU 0
22#define RSND_GEN2_ADG 1
23#define RSND_GEN2_SSIU 2
24#define RSND_GEN2_SSI 3
25
26#define RSND_BASE_MAX 4
27
28/*
29 * flags
30 *
31 * 0xAB000000
32 *
33 * A : clock sharing settings
34 * B : SSI direction
35 */
36#define RSND_SSI_CLK_PIN_SHARE (1 << 31)
37#define RSND_SSI_CLK_FROM_ADG (1 << 30) /* clock parent is master */
38#define RSND_SSI_SYNC (1 << 29) /* SSI34_sync etc */
39#define RSND_SSI_DEPENDENT (1 << 28) /* SSI needs SRU/SCU */
40
41#define RSND_SSI_PLAY (1 << 24)
42
43#define RSND_SSI_SET(_dai_id, _dma_id, _pio_irq, _flags) \
44{ .dai_id = _dai_id, .dma_id = _dma_id, .pio_irq = _pio_irq, .flags = _flags }
45#define RSND_SSI_UNUSED \
46{ .dai_id = -1, .dma_id = -1, .pio_irq = -1, .flags = 0 }
47
48struct rsnd_ssi_platform_info {
49 int dai_id;
50 int dma_id;
51 int pio_irq;
52 u32 flags;
53};
54
55/*
56 * flags
57 */
58#define RSND_SCU_USB_HPBIF (1 << 31) /* it needs RSND_SSI_DEPENDENT */
59
60struct rsnd_scu_platform_info {
61 u32 flags;
62};
63
64/*
65 * flags
66 *
67 * 0x0000000A
68 *
69 * A : generation
70 */
71#define RSND_GEN1 (1 << 0) /* fixme */
72#define RSND_GEN2 (2 << 0) /* fixme */
73
74struct rcar_snd_info {
75 u32 flags;
76 struct rsnd_ssi_platform_info *ssi_info;
77 int ssi_info_nr;
78 struct rsnd_scu_platform_info *scu_info;
79 int scu_info_nr;
80 int (*start)(int id);
81 int (*stop)(int id);
82};
83
84#endif
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 3e479f4e15f5..27a72d5d4b00 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -70,121 +70,144 @@ struct device;
70 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 70 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \
71 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 71 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD}
72 72
73#define SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) \
74 .reg = wreg, .mask = 1, .shift = wshift, \
75 .on_val = winvert ? 0 : 1, .off_val = winvert ? 1 : 0
76
73/* path domain */ 77/* path domain */
74#define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ 78#define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\
75 wcontrols, wncontrols) \ 79 wcontrols, wncontrols) \
76{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 80{ .id = snd_soc_dapm_pga, .name = wname, \
77 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 81 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
82 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
78#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ 83#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\
79 wcontrols, wncontrols) \ 84 wcontrols, wncontrols) \
80{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ 85{ .id = snd_soc_dapm_out_drv, .name = wname, \
81 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 86 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
87 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
82#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ 88#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \
83 wcontrols, wncontrols)\ 89 wcontrols, wncontrols)\
84{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 90{ .id = snd_soc_dapm_mixer, .name = wname, \
85 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 91 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
92 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
86#define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ 93#define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \
87 wcontrols, wncontrols)\ 94 wcontrols, wncontrols)\
88{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ 95{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \
89 .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ 96 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
90 .num_kcontrols = wncontrols} 97 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols}
91#define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ 98#define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \
92{ .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ 99{ .id = snd_soc_dapm_micbias, .name = wname, \
93 .invert = winvert, .kcontrol_news = NULL, .num_kcontrols = 0} 100 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
101 .kcontrol_news = NULL, .num_kcontrols = 0}
94#define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ 102#define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \
95{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ 103{ .id = snd_soc_dapm_switch, .name = wname, \
96 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} 104 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
105 .kcontrol_news = wcontrols, .num_kcontrols = 1}
97#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ 106#define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \
98{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ 107{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, \
99 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} 108 .kcontrol_news = wcontrols, .num_kcontrols = 1}
100#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \ 109#define SND_SOC_DAPM_VIRT_MUX(wname, wreg, wshift, winvert, wcontrols) \
101{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ 110{ .id = snd_soc_dapm_virt_mux, .name = wname, \
102 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1} 111 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
112 .kcontrol_news = wcontrols, .num_kcontrols = 1}
103#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \ 113#define SND_SOC_DAPM_VALUE_MUX(wname, wreg, wshift, winvert, wcontrols) \
104{ .id = snd_soc_dapm_value_mux, .name = wname, .reg = wreg, \ 114{ .id = snd_soc_dapm_value_mux, .name = wname, \
105 .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ 115 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
106 .num_kcontrols = 1} 116 .kcontrol_news = wcontrols, .num_kcontrols = 1}
107 117
108/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 118/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
109#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ 119#define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\
110 wcontrols) \ 120 wcontrols) \
111{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 121{ .id = snd_soc_dapm_pga, .name = wname, \
112 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 122 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
123 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
113#define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ 124#define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \
114 wcontrols)\ 125 wcontrols)\
115{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 126{ .id = snd_soc_dapm_mixer, .name = wname, \
116 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 127 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
128 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
117#define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ 129#define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \
118 wcontrols)\ 130 wcontrols)\
119{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ 131{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \
120 .shift = wshift, .invert = winvert, .kcontrol_news = wcontrols, \ 132 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
121 .num_kcontrols = ARRAY_SIZE(wcontrols)} 133 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)}
122 134
123/* path domain with event - event handler must return 0 for success */ 135/* path domain with event - event handler must return 0 for success */
124#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ 136#define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \
125 wncontrols, wevent, wflags) \ 137 wncontrols, wevent, wflags) \
126{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 138{ .id = snd_soc_dapm_pga, .name = wname, \
127 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ 139 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
140 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
128 .event = wevent, .event_flags = wflags} 141 .event = wevent, .event_flags = wflags}
129#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ 142#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \
130 wncontrols, wevent, wflags) \ 143 wncontrols, wevent, wflags) \
131{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \ 144{ .id = snd_soc_dapm_out_drv, .name = wname, \
132 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ 145 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
146 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
133 .event = wevent, .event_flags = wflags} 147 .event = wevent, .event_flags = wflags}
134#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ 148#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \
135 wncontrols, wevent, wflags) \ 149 wncontrols, wevent, wflags) \
136{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 150{ .id = snd_soc_dapm_mixer, .name = wname, \
137 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ 151 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
152 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \
138 .event = wevent, .event_flags = wflags} 153 .event = wevent, .event_flags = wflags}
139#define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ 154#define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \
140 wcontrols, wncontrols, wevent, wflags) \ 155 wcontrols, wncontrols, wevent, wflags) \
141{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 156{ .id = snd_soc_dapm_mixer, .name = wname, \
142 .invert = winvert, .kcontrol_news = wcontrols, \ 157 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
158 .kcontrol_news = wcontrols, \
143 .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags} 159 .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags}
144#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ 160#define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \
145 wevent, wflags) \ 161 wevent, wflags) \
146{ .id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \ 162{ .id = snd_soc_dapm_switch, .name = wname, \
147 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ 163 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
164 .kcontrol_news = wcontrols, .num_kcontrols = 1, \
148 .event = wevent, .event_flags = wflags} 165 .event = wevent, .event_flags = wflags}
149#define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ 166#define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
150 wevent, wflags) \ 167 wevent, wflags) \
151{ .id = snd_soc_dapm_mux, .name = wname, .reg = wreg, .shift = wshift, \ 168{ .id = snd_soc_dapm_mux, .name = wname, \
152 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ 169 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
170 .kcontrol_news = wcontrols, .num_kcontrols = 1, \
153 .event = wevent, .event_flags = wflags} 171 .event = wevent, .event_flags = wflags}
154#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ 172#define SND_SOC_DAPM_VIRT_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
155 wevent, wflags) \ 173 wevent, wflags) \
156{ .id = snd_soc_dapm_virt_mux, .name = wname, .reg = wreg, .shift = wshift, \ 174{ .id = snd_soc_dapm_virt_mux, .name = wname, \
157 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = 1, \ 175 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
176 .kcontrol_news = wcontrols, .num_kcontrols = 1, \
158 .event = wevent, .event_flags = wflags} 177 .event = wevent, .event_flags = wflags}
159 178
160/* additional sequencing control within an event type */ 179/* additional sequencing control within an event type */
161#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \ 180#define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \
162 wevent, wflags) \ 181 wevent, wflags) \
163{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 182{ .id = snd_soc_dapm_pga, .name = wname, \
164 .invert = winvert, .event = wevent, .event_flags = wflags, \ 183 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
184 .event = wevent, .event_flags = wflags, \
165 .subseq = wsubseq} 185 .subseq = wsubseq}
166#define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \ 186#define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \
167 wflags) \ 187 wflags) \
168{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ 188{ .id = snd_soc_dapm_supply, .name = wname, \
169 .shift = wshift, .invert = winvert, .event = wevent, \ 189 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
170 .event_flags = wflags, .subseq = wsubseq} 190 .event = wevent, .event_flags = wflags, .subseq = wsubseq}
171 191
172/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */ 192/* Simplified versions of above macros, assuming wncontrols = ARRAY_SIZE(wcontrols) */
173#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 193#define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
174 wevent, wflags) \ 194 wevent, wflags) \
175{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 195{ .id = snd_soc_dapm_pga, .name = wname, \
176 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 196 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
197 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
177 .event = wevent, .event_flags = wflags} 198 .event = wevent, .event_flags = wflags}
178#define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 199#define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \
179 wevent, wflags) \ 200 wevent, wflags) \
180{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 201{ .id = snd_soc_dapm_mixer, .name = wname, \
181 .invert = winvert, .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ 202 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
203 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
182 .event = wevent, .event_flags = wflags} 204 .event = wevent, .event_flags = wflags}
183#define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ 205#define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \
184 wcontrols, wevent, wflags) \ 206 wcontrols, wevent, wflags) \
185{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 207{ .id = snd_soc_dapm_mixer, .name = wname, \
186 .invert = winvert, .kcontrol_news = wcontrols, \ 208 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
187 .num_kcontrols = ARRAY_SIZE(wcontrols), .event = wevent, .event_flags = wflags} 209 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \
210 .event = wevent, .event_flags = wflags}
188 211
189/* events that are pre and post DAPM */ 212/* events that are pre and post DAPM */
190#define SND_SOC_DAPM_PRE(wname, wevent) \ 213#define SND_SOC_DAPM_PRE(wname, wevent) \
@@ -199,35 +222,36 @@ struct device;
199/* stream domain */ 222/* stream domain */
200#define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ 223#define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \
201{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 224{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
202 .reg = wreg, .shift = wshift, .invert = winvert } 225 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
203#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \ 226#define SND_SOC_DAPM_AIF_IN_E(wname, stname, wslot, wreg, wshift, winvert, \
204 wevent, wflags) \ 227 wevent, wflags) \
205{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 228{ .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \
206 .reg = wreg, .shift = wshift, .invert = winvert, \ 229 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
207 .event = wevent, .event_flags = wflags } 230 .event = wevent, .event_flags = wflags }
208#define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ 231#define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \
209{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 232{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
210 .reg = wreg, .shift = wshift, .invert = winvert } 233 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
211#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \ 234#define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wslot, wreg, wshift, winvert, \
212 wevent, wflags) \ 235 wevent, wflags) \
213{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 236{ .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \
214 .reg = wreg, .shift = wshift, .invert = winvert, \ 237 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
215 .event = wevent, .event_flags = wflags } 238 .event = wevent, .event_flags = wflags }
216#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 239#define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \
217{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ 240{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \
218 .shift = wshift, .invert = winvert} 241 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) }
219#define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ 242#define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \
220 wevent, wflags) \ 243 wevent, wflags) \
221{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ 244{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \
222 .shift = wshift, .invert = winvert, \ 245 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
223 .event = wevent, .event_flags = wflags} 246 .event = wevent, .event_flags = wflags}
247
224#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ 248#define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \
225{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ 249{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \
226 .shift = wshift, .invert = winvert} 250 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), }
227#define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ 251#define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \
228 wevent, wflags) \ 252 wevent, wflags) \
229{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ 253{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \
230 .shift = wshift, .invert = winvert, \ 254 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
231 .event = wevent, .event_flags = wflags} 255 .event = wevent, .event_flags = wflags}
232#define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \ 256#define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \
233{ .id = snd_soc_dapm_clock_supply, .name = wname, \ 257{ .id = snd_soc_dapm_clock_supply, .name = wname, \
@@ -241,14 +265,14 @@ struct device;
241 .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ 265 .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \
242 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} 266 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD}
243#define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ 267#define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \
244{ .id = snd_soc_dapm_supply, .name = wname, .reg = wreg, \ 268{ .id = snd_soc_dapm_supply, .name = wname, \
245 .shift = wshift, .invert = winvert, .event = wevent, \ 269 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \
246 .event_flags = wflags} 270 .event = wevent, .event_flags = wflags}
247#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \ 271#define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \
248{ .id = snd_soc_dapm_regulator_supply, .name = wname, \ 272{ .id = snd_soc_dapm_regulator_supply, .name = wname, \
249 .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ 273 .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \
250 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \ 274 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \
251 .invert = wflags} 275 .on_val = wflags}
252 276
253 277
254/* dapm kcontrol types */ 278/* dapm kcontrol types */
@@ -256,14 +280,26 @@ struct device;
256{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 280{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
257 .info = snd_soc_info_volsw, \ 281 .info = snd_soc_info_volsw, \
258 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 282 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
259 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 283 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
284#define SOC_DAPM_SINGLE_AUTODISABLE(xname, reg, shift, max, invert) \
285{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
286 .info = snd_soc_info_volsw, \
287 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
288 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 1) }
260#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ 289#define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \
261{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 290{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
262 .info = snd_soc_info_volsw, \ 291 .info = snd_soc_info_volsw, \
263 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ 292 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
264 .tlv.p = (tlv_array), \ 293 .tlv.p = (tlv_array), \
265 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 294 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
266 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 295 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
296#define SOC_DAPM_SINGLE_TLV_AUTODISABLE(xname, reg, shift, max, invert, tlv_array) \
297{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
298 .info = snd_soc_info_volsw, \
299 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\
300 .tlv.p = (tlv_array), \
301 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \
302 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
267#define SOC_DAPM_ENUM(xname, xenum) \ 303#define SOC_DAPM_ENUM(xname, xenum) \
268{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 304{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
269 .info = snd_soc_info_enum_double, \ 305 .info = snd_soc_info_enum_double, \
@@ -333,6 +369,7 @@ struct snd_soc_dapm_route;
333struct snd_soc_dapm_context; 369struct snd_soc_dapm_context;
334struct regulator; 370struct regulator;
335struct snd_soc_dapm_widget_list; 371struct snd_soc_dapm_widget_list;
372struct snd_soc_dapm_update;
336 373
337int dapm_reg_event(struct snd_soc_dapm_widget *w, 374int dapm_reg_event(struct snd_soc_dapm_widget *w,
338 struct snd_kcontrol *kcontrol, int event); 375 struct snd_kcontrol *kcontrol, int event);
@@ -376,7 +413,7 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
376 struct snd_soc_dapm_widget *sink); 413 struct snd_soc_dapm_widget *sink);
377 414
378/* dapm path setup */ 415/* dapm path setup */
379int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm); 416int snd_soc_dapm_new_widgets(struct snd_soc_card *card);
380void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); 417void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
381int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, 418int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
382 const struct snd_soc_dapm_route *route, int num); 419 const struct snd_soc_dapm_route *route, int num);
@@ -391,10 +428,12 @@ void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream,
391void snd_soc_dapm_shutdown(struct snd_soc_card *card); 428void snd_soc_dapm_shutdown(struct snd_soc_card *card);
392 429
393/* external DAPM widget events */ 430/* external DAPM widget events */
394int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_widget *widget, 431int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm,
395 struct snd_kcontrol *kcontrol, int connect); 432 struct snd_kcontrol *kcontrol, int connect,
396int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_widget *widget, 433 struct snd_soc_dapm_update *update);
397 struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e); 434int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm,
435 struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e,
436 struct snd_soc_dapm_update *update);
398 437
399/* dapm sys fs - used by the core */ 438/* dapm sys fs - used by the core */
400int snd_soc_dapm_sys_add(struct device *dev); 439int snd_soc_dapm_sys_add(struct device *dev);
@@ -424,6 +463,8 @@ void dapm_mark_io_dirty(struct snd_soc_dapm_context *dapm);
424int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, 463int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream,
425 struct snd_soc_dapm_widget_list **list); 464 struct snd_soc_dapm_widget_list **list);
426 465
466struct snd_soc_codec *snd_soc_dapm_kcontrol_codec(struct snd_kcontrol *kcontrol);
467
427/* dapm widget types */ 468/* dapm widget types */
428enum snd_soc_dapm_type { 469enum snd_soc_dapm_type {
429 snd_soc_dapm_input = 0, /* input pin */ 470 snd_soc_dapm_input = 0, /* input pin */
@@ -455,6 +496,7 @@ enum snd_soc_dapm_type {
455 snd_soc_dapm_dai_in, /* link to DAI structure */ 496 snd_soc_dapm_dai_in, /* link to DAI structure */
456 snd_soc_dapm_dai_out, 497 snd_soc_dapm_dai_out,
457 snd_soc_dapm_dai_link, /* link between two DAI structures */ 498 snd_soc_dapm_dai_link, /* link between two DAI structures */
499 snd_soc_dapm_kcontrol, /* Auto-disabled kcontrol */
458}; 500};
459 501
460enum snd_soc_dapm_subclass { 502enum snd_soc_dapm_subclass {
@@ -485,7 +527,6 @@ struct snd_soc_dapm_path {
485 /* source (input) and sink (output) widgets */ 527 /* source (input) and sink (output) widgets */
486 struct snd_soc_dapm_widget *source; 528 struct snd_soc_dapm_widget *source;
487 struct snd_soc_dapm_widget *sink; 529 struct snd_soc_dapm_widget *sink;
488 struct snd_kcontrol *kcontrol;
489 530
490 /* status */ 531 /* status */
491 u32 connect:1; /* source and sink widgets are connected */ 532 u32 connect:1; /* source and sink widgets are connected */
@@ -498,6 +539,7 @@ struct snd_soc_dapm_path {
498 539
499 struct list_head list_source; 540 struct list_head list_source;
500 struct list_head list_sink; 541 struct list_head list_sink;
542 struct list_head list_kcontrol;
501 struct list_head list; 543 struct list_head list;
502}; 544};
503 545
@@ -518,12 +560,10 @@ struct snd_soc_dapm_widget {
518 /* dapm control */ 560 /* dapm control */
519 int reg; /* negative reg = no direct dapm */ 561 int reg; /* negative reg = no direct dapm */
520 unsigned char shift; /* bits to shift */ 562 unsigned char shift; /* bits to shift */
521 unsigned int value; /* widget current value */
522 unsigned int mask; /* non-shifted mask */ 563 unsigned int mask; /* non-shifted mask */
523 unsigned int on_val; /* on state value */ 564 unsigned int on_val; /* on state value */
524 unsigned int off_val; /* off state value */ 565 unsigned int off_val; /* off state value */
525 unsigned char power:1; /* block power status */ 566 unsigned char power:1; /* block power status */
526 unsigned char invert:1; /* invert the power bit */
527 unsigned char active:1; /* active stream on DAC, ADC's */ 567 unsigned char active:1; /* active stream on DAC, ADC's */
528 unsigned char connected:1; /* connected codec pin */ 568 unsigned char connected:1; /* connected codec pin */
529 unsigned char new:1; /* cnew complete */ 569 unsigned char new:1; /* cnew complete */
@@ -559,7 +599,6 @@ struct snd_soc_dapm_widget {
559}; 599};
560 600
561struct snd_soc_dapm_update { 601struct snd_soc_dapm_update {
562 struct snd_soc_dapm_widget *widget;
563 struct snd_kcontrol *kcontrol; 602 struct snd_kcontrol *kcontrol;
564 int reg; 603 int reg;
565 int mask; 604 int mask;
@@ -573,8 +612,6 @@ struct snd_soc_dapm_context {
573 struct delayed_work delayed_work; 612 struct delayed_work delayed_work;
574 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ 613 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
575 614
576 struct snd_soc_dapm_update *update;
577
578 void (*seq_notifier)(struct snd_soc_dapm_context *, 615 void (*seq_notifier)(struct snd_soc_dapm_context *,
579 enum snd_soc_dapm_type, int); 616 enum snd_soc_dapm_type, int);
580 617
diff --git a/include/sound/soc-dpcm.h b/include/sound/soc-dpcm.h
index 04598f1efd77..047d657c331c 100644
--- a/include/sound/soc-dpcm.h
+++ b/include/sound/soc-dpcm.h
@@ -133,6 +133,6 @@ void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, int stream,
133/* internal use only */ 133/* internal use only */
134int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute); 134int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute);
135int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd); 135int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd);
136int soc_dpcm_runtime_update(struct snd_soc_dapm_widget *); 136int soc_dpcm_runtime_update(struct snd_soc_card *);
137 137
138#endif 138#endif
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 6eabee7ec15a..d22cb0a06feb 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -30,13 +30,13 @@
30/* 30/*
31 * Convenience kcontrol builders 31 * Convenience kcontrol builders
32 */ 32 */
33#define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert) \ 33#define SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, xmax, xinvert, xautodisable) \
34 ((unsigned long)&(struct soc_mixer_control) \ 34 ((unsigned long)&(struct soc_mixer_control) \
35 {.reg = xreg, .rreg = xreg, .shift = shift_left, \ 35 {.reg = xreg, .rreg = xreg, .shift = shift_left, \
36 .rshift = shift_right, .max = xmax, .platform_max = xmax, \ 36 .rshift = shift_right, .max = xmax, .platform_max = xmax, \
37 .invert = xinvert}) 37 .invert = xinvert, .autodisable = xautodisable})
38#define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ 38#define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, xautodisable) \
39 SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert) 39 SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert, xautodisable)
40#define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ 40#define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \
41 ((unsigned long)&(struct soc_mixer_control) \ 41 ((unsigned long)&(struct soc_mixer_control) \
42 {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert}) 42 {.reg = xreg, .max = xmax, .platform_max = xmax, .invert = xinvert})
@@ -52,7 +52,7 @@
52{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 52{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
53 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ 53 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
54 .put = snd_soc_put_volsw, \ 54 .put = snd_soc_put_volsw, \
55 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 55 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
56#define SOC_SINGLE_RANGE(xname, xreg, xshift, xmin, xmax, xinvert) \ 56#define SOC_SINGLE_RANGE(xname, xreg, xshift, xmin, xmax, xinvert) \
57{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 57{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
58 .info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \ 58 .info = snd_soc_info_volsw_range, .get = snd_soc_get_volsw_range, \
@@ -68,7 +68,7 @@
68 .tlv.p = (tlv_array), \ 68 .tlv.p = (tlv_array), \
69 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ 69 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
70 .put = snd_soc_put_volsw, \ 70 .put = snd_soc_put_volsw, \
71 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert) } 71 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
72#define SOC_SINGLE_SX_TLV(xname, xreg, xshift, xmin, xmax, tlv_array) \ 72#define SOC_SINGLE_SX_TLV(xname, xreg, xshift, xmin, xmax, tlv_array) \
73{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 73{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
74 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ 74 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \
@@ -97,7 +97,7 @@
97 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ 97 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
98 .put = snd_soc_put_volsw, \ 98 .put = snd_soc_put_volsw, \
99 .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ 99 .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
100 max, invert) } 100 max, invert, 0) }
101#define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \ 101#define SOC_DOUBLE_R(xname, reg_left, reg_right, xshift, xmax, xinvert) \
102{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 102{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
103 .info = snd_soc_info_volsw, \ 103 .info = snd_soc_info_volsw, \
@@ -119,7 +119,7 @@
119 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \ 119 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw, \
120 .put = snd_soc_put_volsw, \ 120 .put = snd_soc_put_volsw, \
121 .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \ 121 .private_value = SOC_DOUBLE_VALUE(reg, shift_left, shift_right, \
122 max, invert) } 122 max, invert, 0) }
123#define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \ 123#define SOC_DOUBLE_R_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert, tlv_array) \
124{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 124{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
125 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ 125 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
@@ -190,14 +190,14 @@
190{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 190{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
191 .info = snd_soc_info_volsw, \ 191 .info = snd_soc_info_volsw, \
192 .get = xhandler_get, .put = xhandler_put, \ 192 .get = xhandler_get, .put = xhandler_put, \
193 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } 193 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, 0) }
194#define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\ 194#define SOC_DOUBLE_EXT(xname, reg, shift_left, shift_right, max, invert,\
195 xhandler_get, xhandler_put) \ 195 xhandler_get, xhandler_put) \
196{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 196{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\
197 .info = snd_soc_info_volsw, \ 197 .info = snd_soc_info_volsw, \
198 .get = xhandler_get, .put = xhandler_put, \ 198 .get = xhandler_get, .put = xhandler_put, \
199 .private_value = \ 199 .private_value = \
200 SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert) } 200 SOC_DOUBLE_VALUE(reg, shift_left, shift_right, max, invert, 0) }
201#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ 201#define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\
202 xhandler_get, xhandler_put, tlv_array) \ 202 xhandler_get, xhandler_put, tlv_array) \
203{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 203{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
@@ -206,7 +206,7 @@
206 .tlv.p = (tlv_array), \ 206 .tlv.p = (tlv_array), \
207 .info = snd_soc_info_volsw, \ 207 .info = snd_soc_info_volsw, \
208 .get = xhandler_get, .put = xhandler_put, \ 208 .get = xhandler_get, .put = xhandler_put, \
209 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } 209 .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, 0) }
210#define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ 210#define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\
211 xhandler_get, xhandler_put, tlv_array) \ 211 xhandler_get, xhandler_put, tlv_array) \
212{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 212{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
@@ -216,7 +216,7 @@
216 .info = snd_soc_info_volsw, \ 216 .info = snd_soc_info_volsw, \
217 .get = xhandler_get, .put = xhandler_put, \ 217 .get = xhandler_get, .put = xhandler_put, \
218 .private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \ 218 .private_value = SOC_DOUBLE_VALUE(xreg, shift_left, shift_right, \
219 xmax, xinvert) } 219 xmax, xinvert, 0) }
220#define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ 220#define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\
221 xhandler_get, xhandler_put, tlv_array) \ 221 xhandler_get, xhandler_put, tlv_array) \
222{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 222{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
@@ -234,7 +234,7 @@
234 .private_value = xdata } 234 .private_value = xdata }
235#define SOC_ENUM_EXT(xname, xenum, xhandler_get, xhandler_put) \ 235#define SOC_ENUM_EXT(xname, xenum, xhandler_get, xhandler_put) \
236{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 236{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
237 .info = snd_soc_info_enum_ext, \ 237 .info = snd_soc_info_enum_double, \
238 .get = xhandler_get, .put = xhandler_put, \ 238 .get = xhandler_get, .put = xhandler_put, \
239 .private_value = (unsigned long)&xenum } 239 .private_value = (unsigned long)&xenum }
240 240
@@ -468,6 +468,8 @@ int snd_soc_new_ac97_codec(struct snd_soc_codec *codec,
468void snd_soc_free_ac97_codec(struct snd_soc_codec *codec); 468void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
469 469
470int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops); 470int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops);
471int snd_soc_set_ac97_ops_of_reset(struct snd_ac97_bus_ops *ops,
472 struct platform_device *pdev);
471 473
472/* 474/*
473 *Controls 475 *Controls
@@ -475,6 +477,8 @@ int snd_soc_set_ac97_ops(struct snd_ac97_bus_ops *ops);
475struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template, 477struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
476 void *data, const char *long_name, 478 void *data, const char *long_name,
477 const char *prefix); 479 const char *prefix);
480struct snd_kcontrol *snd_soc_card_get_kcontrol(struct snd_soc_card *soc_card,
481 const char *name);
478int snd_soc_add_codec_controls(struct snd_soc_codec *codec, 482int snd_soc_add_codec_controls(struct snd_soc_codec *codec,
479 const struct snd_kcontrol_new *controls, int num_controls); 483 const struct snd_kcontrol_new *controls, int num_controls);
480int snd_soc_add_platform_controls(struct snd_soc_platform *platform, 484int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
@@ -485,8 +489,6 @@ int snd_soc_add_dai_controls(struct snd_soc_dai *dai,
485 const struct snd_kcontrol_new *controls, int num_controls); 489 const struct snd_kcontrol_new *controls, int num_controls);
486int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, 490int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
487 struct snd_ctl_elem_info *uinfo); 491 struct snd_ctl_elem_info *uinfo);
488int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
489 struct snd_ctl_elem_info *uinfo);
490int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol, 492int snd_soc_get_enum_double(struct snd_kcontrol *kcontrol,
491 struct snd_ctl_elem_value *ucontrol); 493 struct snd_ctl_elem_value *ucontrol);
492int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol, 494int snd_soc_put_enum_double(struct snd_kcontrol *kcontrol,
@@ -497,8 +499,6 @@ int snd_soc_put_value_enum_double(struct snd_kcontrol *kcontrol,
497 struct snd_ctl_elem_value *ucontrol); 499 struct snd_ctl_elem_value *ucontrol);
498int snd_soc_info_volsw(struct snd_kcontrol *kcontrol, 500int snd_soc_info_volsw(struct snd_kcontrol *kcontrol,
499 struct snd_ctl_elem_info *uinfo); 501 struct snd_ctl_elem_info *uinfo);
500int snd_soc_info_volsw_ext(struct snd_kcontrol *kcontrol,
501 struct snd_ctl_elem_info *uinfo);
502#define snd_soc_info_bool_ext snd_ctl_boolean_mono_info 502#define snd_soc_info_bool_ext snd_ctl_boolean_mono_info
503int snd_soc_get_volsw(struct snd_kcontrol *kcontrol, 503int snd_soc_get_volsw(struct snd_kcontrol *kcontrol,
504 struct snd_ctl_elem_value *ucontrol); 504 struct snd_ctl_elem_value *ucontrol);
@@ -697,7 +697,6 @@ struct snd_soc_codec {
697 unsigned int probed:1; /* Codec has been probed */ 697 unsigned int probed:1; /* Codec has been probed */
698 unsigned int ac97_registered:1; /* Codec has been AC97 registered */ 698 unsigned int ac97_registered:1; /* Codec has been AC97 registered */
699 unsigned int ac97_created:1; /* Codec has been created by SoC */ 699 unsigned int ac97_created:1; /* Codec has been created by SoC */
700 unsigned int sysfs_registered:1; /* codec has been sysfs registered */
701 unsigned int cache_init:1; /* codec cache has been initialized */ 700 unsigned int cache_init:1; /* codec cache has been initialized */
702 unsigned int using_regmap:1; /* using regmap access */ 701 unsigned int using_regmap:1; /* using regmap access */
703 u32 cache_only; /* Suppress writes to hardware */ 702 u32 cache_only; /* Suppress writes to hardware */
@@ -705,7 +704,6 @@ struct snd_soc_codec {
705 704
706 /* codec IO */ 705 /* codec IO */
707 void *control_data; /* codec control (i2c/3wire) data */ 706 void *control_data; /* codec control (i2c/3wire) data */
708 enum snd_soc_control_type control_type;
709 hw_write_t hw_write; 707 hw_write_t hw_write;
710 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); 708 unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int);
711 unsigned int (*read)(struct snd_soc_codec *, unsigned int); 709 unsigned int (*read)(struct snd_soc_codec *, unsigned int);
@@ -724,7 +722,6 @@ struct snd_soc_codec {
724#ifdef CONFIG_DEBUG_FS 722#ifdef CONFIG_DEBUG_FS
725 struct dentry *debugfs_codec_root; 723 struct dentry *debugfs_codec_root;
726 struct dentry *debugfs_reg; 724 struct dentry *debugfs_reg;
727 struct dentry *debugfs_dapm;
728#endif 725#endif
729}; 726};
730 727
@@ -849,7 +846,6 @@ struct snd_soc_platform {
849 846
850#ifdef CONFIG_DEBUG_FS 847#ifdef CONFIG_DEBUG_FS
851 struct dentry *debugfs_platform_root; 848 struct dentry *debugfs_platform_root;
852 struct dentry *debugfs_dapm;
853#endif 849#endif
854}; 850};
855 851
@@ -934,6 +930,10 @@ struct snd_soc_dai_link {
934 /* machine stream operations */ 930 /* machine stream operations */
935 const struct snd_soc_ops *ops; 931 const struct snd_soc_ops *ops;
936 const struct snd_soc_compr_ops *compr_ops; 932 const struct snd_soc_compr_ops *compr_ops;
933
934 /* For unidirectional dai links */
935 bool playback_only;
936 bool capture_only;
937}; 937};
938 938
939struct snd_soc_codec_conf { 939struct snd_soc_codec_conf {
@@ -1042,6 +1042,7 @@ struct snd_soc_card {
1042 /* Generic DAPM context for the card */ 1042 /* Generic DAPM context for the card */
1043 struct snd_soc_dapm_context dapm; 1043 struct snd_soc_dapm_context dapm;
1044 struct snd_soc_dapm_stats dapm_stats; 1044 struct snd_soc_dapm_stats dapm_stats;
1045 struct snd_soc_dapm_update *update;
1045 1046
1046#ifdef CONFIG_DEBUG_FS 1047#ifdef CONFIG_DEBUG_FS
1047 struct dentry *debugfs_card_root; 1048 struct dentry *debugfs_card_root;
@@ -1087,7 +1088,9 @@ struct snd_soc_pcm_runtime {
1087/* mixer control */ 1088/* mixer control */
1088struct soc_mixer_control { 1089struct soc_mixer_control {
1089 int min, max, platform_max; 1090 int min, max, platform_max;
1090 unsigned int reg, rreg, shift, rshift, invert; 1091 unsigned int reg, rreg, shift, rshift;
1092 unsigned int invert:1;
1093 unsigned int autodisable:1;
1091}; 1094};
1092 1095
1093struct soc_bytes { 1096struct soc_bytes {
diff --git a/include/trace/events/context_tracking.h b/include/trace/events/context_tracking.h
new file mode 100644
index 000000000000..ce8007cf29cf
--- /dev/null
+++ b/include/trace/events/context_tracking.h
@@ -0,0 +1,58 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM context_tracking
3
4#if !defined(_TRACE_CONTEXT_TRACKING_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_CONTEXT_TRACKING_H
6
7#include <linux/tracepoint.h>
8
9DECLARE_EVENT_CLASS(context_tracking_user,
10
11 TP_PROTO(int dummy),
12
13 TP_ARGS(dummy),
14
15 TP_STRUCT__entry(
16 __field( int, dummy )
17 ),
18
19 TP_fast_assign(
20 __entry->dummy = dummy;
21 ),
22
23 TP_printk("%s", "")
24);
25
26/**
27 * user_enter - called when the kernel resumes to userspace
28 * @dummy: dummy arg to make trace event macro happy
29 *
30 * This event occurs when the kernel resumes to userspace after
31 * an exception or a syscall.
32 */
33DEFINE_EVENT(context_tracking_user, user_enter,
34
35 TP_PROTO(int dummy),
36
37 TP_ARGS(dummy)
38);
39
40/**
41 * user_exit - called when userspace enters the kernel
42 * @dummy: dummy arg to make trace event macro happy
43 *
44 * This event occurs when userspace enters the kernel through
45 * an exception or a syscall.
46 */
47DEFINE_EVENT(context_tracking_user, user_exit,
48
49 TP_PROTO(int dummy),
50
51 TP_ARGS(dummy)
52);
53
54
55#endif /* _TRACE_CONTEXT_TRACKING_H */
56
57/* This part must be outside protection */
58#include <trace/define_trace.h>
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 2068db241f22..197d3125df2a 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -14,7 +14,6 @@ struct ext4_prealloc_space;
14struct ext4_inode_info; 14struct ext4_inode_info;
15struct mpage_da_data; 15struct mpage_da_data;
16struct ext4_map_blocks; 16struct ext4_map_blocks;
17struct ext4_extent;
18struct extent_status; 17struct extent_status;
19 18
20#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode)) 19#define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
@@ -64,10 +63,10 @@ struct extent_status;
64 { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" }) 63 { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" })
65 64
66#define show_extent_status(status) __print_flags(status, "", \ 65#define show_extent_status(status) __print_flags(status, "", \
67 { (1 << 3), "W" }, \ 66 { EXTENT_STATUS_WRITTEN, "W" }, \
68 { (1 << 2), "U" }, \ 67 { EXTENT_STATUS_UNWRITTEN, "U" }, \
69 { (1 << 1), "D" }, \ 68 { EXTENT_STATUS_DELAYED, "D" }, \
70 { (1 << 0), "H" }) 69 { EXTENT_STATUS_HOLE, "H" })
71 70
72 71
73TRACE_EVENT(ext4_free_inode, 72TRACE_EVENT(ext4_free_inode,
@@ -2192,7 +2191,7 @@ TRACE_EVENT(ext4_ext_remove_space_done,
2192 (unsigned short) __entry->eh_entries) 2191 (unsigned short) __entry->eh_entries)
2193); 2192);
2194 2193
2195TRACE_EVENT(ext4_es_insert_extent, 2194DECLARE_EVENT_CLASS(ext4__es_extent,
2196 TP_PROTO(struct inode *inode, struct extent_status *es), 2195 TP_PROTO(struct inode *inode, struct extent_status *es),
2197 2196
2198 TP_ARGS(inode, es), 2197 TP_ARGS(inode, es),
@@ -2212,7 +2211,7 @@ TRACE_EVENT(ext4_es_insert_extent,
2212 __entry->lblk = es->es_lblk; 2211 __entry->lblk = es->es_lblk;
2213 __entry->len = es->es_len; 2212 __entry->len = es->es_len;
2214 __entry->pblk = ext4_es_pblock(es); 2213 __entry->pblk = ext4_es_pblock(es);
2215 __entry->status = ext4_es_status(es) >> 60; 2214 __entry->status = ext4_es_status(es);
2216 ), 2215 ),
2217 2216
2218 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s", 2217 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
@@ -2222,6 +2221,18 @@ TRACE_EVENT(ext4_es_insert_extent,
2222 __entry->pblk, show_extent_status(__entry->status)) 2221 __entry->pblk, show_extent_status(__entry->status))
2223); 2222);
2224 2223
2224DEFINE_EVENT(ext4__es_extent, ext4_es_insert_extent,
2225 TP_PROTO(struct inode *inode, struct extent_status *es),
2226
2227 TP_ARGS(inode, es)
2228);
2229
2230DEFINE_EVENT(ext4__es_extent, ext4_es_cache_extent,
2231 TP_PROTO(struct inode *inode, struct extent_status *es),
2232
2233 TP_ARGS(inode, es)
2234);
2235
2225TRACE_EVENT(ext4_es_remove_extent, 2236TRACE_EVENT(ext4_es_remove_extent,
2226 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len), 2237 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len),
2227 2238
@@ -2289,7 +2300,7 @@ TRACE_EVENT(ext4_es_find_delayed_extent_range_exit,
2289 __entry->lblk = es->es_lblk; 2300 __entry->lblk = es->es_lblk;
2290 __entry->len = es->es_len; 2301 __entry->len = es->es_len;
2291 __entry->pblk = ext4_es_pblock(es); 2302 __entry->pblk = ext4_es_pblock(es);
2292 __entry->status = ext4_es_status(es) >> 60; 2303 __entry->status = ext4_es_status(es);
2293 ), 2304 ),
2294 2305
2295 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s", 2306 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
@@ -2343,7 +2354,7 @@ TRACE_EVENT(ext4_es_lookup_extent_exit,
2343 __entry->lblk = es->es_lblk; 2354 __entry->lblk = es->es_lblk;
2344 __entry->len = es->es_len; 2355 __entry->len = es->es_len;
2345 __entry->pblk = ext4_es_pblock(es); 2356 __entry->pblk = ext4_es_pblock(es);
2346 __entry->status = ext4_es_status(es) >> 60; 2357 __entry->status = ext4_es_status(es);
2347 __entry->found = found; 2358 __entry->found = found;
2348 ), 2359 ),
2349 2360
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index 8e42410bd159..cda100d6762d 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -66,6 +66,43 @@ TRACE_EVENT(machine_suspend,
66 TP_printk("state=%lu", (unsigned long)__entry->state) 66 TP_printk("state=%lu", (unsigned long)__entry->state)
67); 67);
68 68
69TRACE_EVENT(device_pm_report_time,
70
71 TP_PROTO(struct device *dev, const char *pm_ops, s64 ops_time,
72 char *pm_event_str, int error),
73
74 TP_ARGS(dev, pm_ops, ops_time, pm_event_str, error),
75
76 TP_STRUCT__entry(
77 __string(device, dev_name(dev))
78 __string(driver, dev_driver_string(dev))
79 __string(parent, dev->parent ? dev_name(dev->parent) : "none")
80 __string(pm_ops, pm_ops ? pm_ops : "none ")
81 __string(pm_event_str, pm_event_str)
82 __field(s64, ops_time)
83 __field(int, error)
84 ),
85
86 TP_fast_assign(
87 const char *tmp = dev->parent ? dev_name(dev->parent) : "none";
88 const char *tmp_i = pm_ops ? pm_ops : "none ";
89
90 __assign_str(device, dev_name(dev));
91 __assign_str(driver, dev_driver_string(dev));
92 __assign_str(parent, tmp);
93 __assign_str(pm_ops, tmp_i);
94 __assign_str(pm_event_str, pm_event_str);
95 __entry->ops_time = ops_time;
96 __entry->error = error;
97 ),
98
99 /* ops_str has an extra space at the end */
100 TP_printk("%s %s parent=%s state=%s ops=%snsecs=%lld err=%d",
101 __get_str(driver), __get_str(device), __get_str(parent),
102 __get_str(pm_event_str), __get_str(pm_ops),
103 __entry->ops_time, __entry->error)
104);
105
69DECLARE_EVENT_CLASS(wakeup_source, 106DECLARE_EVENT_CLASS(wakeup_source,
70 107
71 TP_PROTO(const char *name, unsigned int state), 108 TP_PROTO(const char *name, unsigned int state),
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 59ebcc89f148..ee2376cfaab3 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -19,12 +19,12 @@
19 */ 19 */
20TRACE_EVENT(rcu_utilization, 20TRACE_EVENT(rcu_utilization,
21 21
22 TP_PROTO(char *s), 22 TP_PROTO(const char *s),
23 23
24 TP_ARGS(s), 24 TP_ARGS(s),
25 25
26 TP_STRUCT__entry( 26 TP_STRUCT__entry(
27 __field(char *, s) 27 __field(const char *, s)
28 ), 28 ),
29 29
30 TP_fast_assign( 30 TP_fast_assign(
@@ -51,14 +51,14 @@ TRACE_EVENT(rcu_utilization,
51 */ 51 */
52TRACE_EVENT(rcu_grace_period, 52TRACE_EVENT(rcu_grace_period,
53 53
54 TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent), 54 TP_PROTO(const char *rcuname, unsigned long gpnum, const char *gpevent),
55 55
56 TP_ARGS(rcuname, gpnum, gpevent), 56 TP_ARGS(rcuname, gpnum, gpevent),
57 57
58 TP_STRUCT__entry( 58 TP_STRUCT__entry(
59 __field(char *, rcuname) 59 __field(const char *, rcuname)
60 __field(unsigned long, gpnum) 60 __field(unsigned long, gpnum)
61 __field(char *, gpevent) 61 __field(const char *, gpevent)
62 ), 62 ),
63 63
64 TP_fast_assign( 64 TP_fast_assign(
@@ -89,21 +89,21 @@ TRACE_EVENT(rcu_grace_period,
89 */ 89 */
90TRACE_EVENT(rcu_future_grace_period, 90TRACE_EVENT(rcu_future_grace_period,
91 91
92 TP_PROTO(char *rcuname, unsigned long gpnum, unsigned long completed, 92 TP_PROTO(const char *rcuname, unsigned long gpnum, unsigned long completed,
93 unsigned long c, u8 level, int grplo, int grphi, 93 unsigned long c, u8 level, int grplo, int grphi,
94 char *gpevent), 94 const char *gpevent),
95 95
96 TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent), 96 TP_ARGS(rcuname, gpnum, completed, c, level, grplo, grphi, gpevent),
97 97
98 TP_STRUCT__entry( 98 TP_STRUCT__entry(
99 __field(char *, rcuname) 99 __field(const char *, rcuname)
100 __field(unsigned long, gpnum) 100 __field(unsigned long, gpnum)
101 __field(unsigned long, completed) 101 __field(unsigned long, completed)
102 __field(unsigned long, c) 102 __field(unsigned long, c)
103 __field(u8, level) 103 __field(u8, level)
104 __field(int, grplo) 104 __field(int, grplo)
105 __field(int, grphi) 105 __field(int, grphi)
106 __field(char *, gpevent) 106 __field(const char *, gpevent)
107 ), 107 ),
108 108
109 TP_fast_assign( 109 TP_fast_assign(
@@ -132,13 +132,13 @@ TRACE_EVENT(rcu_future_grace_period,
132 */ 132 */
133TRACE_EVENT(rcu_grace_period_init, 133TRACE_EVENT(rcu_grace_period_init,
134 134
135 TP_PROTO(char *rcuname, unsigned long gpnum, u8 level, 135 TP_PROTO(const char *rcuname, unsigned long gpnum, u8 level,
136 int grplo, int grphi, unsigned long qsmask), 136 int grplo, int grphi, unsigned long qsmask),
137 137
138 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask), 138 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
139 139
140 TP_STRUCT__entry( 140 TP_STRUCT__entry(
141 __field(char *, rcuname) 141 __field(const char *, rcuname)
142 __field(unsigned long, gpnum) 142 __field(unsigned long, gpnum)
143 __field(u8, level) 143 __field(u8, level)
144 __field(int, grplo) 144 __field(int, grplo)
@@ -168,12 +168,12 @@ TRACE_EVENT(rcu_grace_period_init,
168 */ 168 */
169TRACE_EVENT(rcu_preempt_task, 169TRACE_EVENT(rcu_preempt_task,
170 170
171 TP_PROTO(char *rcuname, int pid, unsigned long gpnum), 171 TP_PROTO(const char *rcuname, int pid, unsigned long gpnum),
172 172
173 TP_ARGS(rcuname, pid, gpnum), 173 TP_ARGS(rcuname, pid, gpnum),
174 174
175 TP_STRUCT__entry( 175 TP_STRUCT__entry(
176 __field(char *, rcuname) 176 __field(const char *, rcuname)
177 __field(unsigned long, gpnum) 177 __field(unsigned long, gpnum)
178 __field(int, pid) 178 __field(int, pid)
179 ), 179 ),
@@ -195,12 +195,12 @@ TRACE_EVENT(rcu_preempt_task,
195 */ 195 */
196TRACE_EVENT(rcu_unlock_preempted_task, 196TRACE_EVENT(rcu_unlock_preempted_task,
197 197
198 TP_PROTO(char *rcuname, unsigned long gpnum, int pid), 198 TP_PROTO(const char *rcuname, unsigned long gpnum, int pid),
199 199
200 TP_ARGS(rcuname, gpnum, pid), 200 TP_ARGS(rcuname, gpnum, pid),
201 201
202 TP_STRUCT__entry( 202 TP_STRUCT__entry(
203 __field(char *, rcuname) 203 __field(const char *, rcuname)
204 __field(unsigned long, gpnum) 204 __field(unsigned long, gpnum)
205 __field(int, pid) 205 __field(int, pid)
206 ), 206 ),
@@ -224,14 +224,14 @@ TRACE_EVENT(rcu_unlock_preempted_task,
224 */ 224 */
225TRACE_EVENT(rcu_quiescent_state_report, 225TRACE_EVENT(rcu_quiescent_state_report,
226 226
227 TP_PROTO(char *rcuname, unsigned long gpnum, 227 TP_PROTO(const char *rcuname, unsigned long gpnum,
228 unsigned long mask, unsigned long qsmask, 228 unsigned long mask, unsigned long qsmask,
229 u8 level, int grplo, int grphi, int gp_tasks), 229 u8 level, int grplo, int grphi, int gp_tasks),
230 230
231 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks), 231 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
232 232
233 TP_STRUCT__entry( 233 TP_STRUCT__entry(
234 __field(char *, rcuname) 234 __field(const char *, rcuname)
235 __field(unsigned long, gpnum) 235 __field(unsigned long, gpnum)
236 __field(unsigned long, mask) 236 __field(unsigned long, mask)
237 __field(unsigned long, qsmask) 237 __field(unsigned long, qsmask)
@@ -268,15 +268,15 @@ TRACE_EVENT(rcu_quiescent_state_report,
268 */ 268 */
269TRACE_EVENT(rcu_fqs, 269TRACE_EVENT(rcu_fqs,
270 270
271 TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent), 271 TP_PROTO(const char *rcuname, unsigned long gpnum, int cpu, const char *qsevent),
272 272
273 TP_ARGS(rcuname, gpnum, cpu, qsevent), 273 TP_ARGS(rcuname, gpnum, cpu, qsevent),
274 274
275 TP_STRUCT__entry( 275 TP_STRUCT__entry(
276 __field(char *, rcuname) 276 __field(const char *, rcuname)
277 __field(unsigned long, gpnum) 277 __field(unsigned long, gpnum)
278 __field(int, cpu) 278 __field(int, cpu)
279 __field(char *, qsevent) 279 __field(const char *, qsevent)
280 ), 280 ),
281 281
282 TP_fast_assign( 282 TP_fast_assign(
@@ -308,12 +308,12 @@ TRACE_EVENT(rcu_fqs,
308 */ 308 */
309TRACE_EVENT(rcu_dyntick, 309TRACE_EVENT(rcu_dyntick,
310 310
311 TP_PROTO(char *polarity, long long oldnesting, long long newnesting), 311 TP_PROTO(const char *polarity, long long oldnesting, long long newnesting),
312 312
313 TP_ARGS(polarity, oldnesting, newnesting), 313 TP_ARGS(polarity, oldnesting, newnesting),
314 314
315 TP_STRUCT__entry( 315 TP_STRUCT__entry(
316 __field(char *, polarity) 316 __field(const char *, polarity)
317 __field(long long, oldnesting) 317 __field(long long, oldnesting)
318 __field(long long, newnesting) 318 __field(long long, newnesting)
319 ), 319 ),
@@ -352,12 +352,12 @@ TRACE_EVENT(rcu_dyntick,
352 */ 352 */
353TRACE_EVENT(rcu_prep_idle, 353TRACE_EVENT(rcu_prep_idle,
354 354
355 TP_PROTO(char *reason), 355 TP_PROTO(const char *reason),
356 356
357 TP_ARGS(reason), 357 TP_ARGS(reason),
358 358
359 TP_STRUCT__entry( 359 TP_STRUCT__entry(
360 __field(char *, reason) 360 __field(const char *, reason)
361 ), 361 ),
362 362
363 TP_fast_assign( 363 TP_fast_assign(
@@ -376,13 +376,13 @@ TRACE_EVENT(rcu_prep_idle,
376 */ 376 */
377TRACE_EVENT(rcu_callback, 377TRACE_EVENT(rcu_callback,
378 378
379 TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen_lazy, 379 TP_PROTO(const char *rcuname, struct rcu_head *rhp, long qlen_lazy,
380 long qlen), 380 long qlen),
381 381
382 TP_ARGS(rcuname, rhp, qlen_lazy, qlen), 382 TP_ARGS(rcuname, rhp, qlen_lazy, qlen),
383 383
384 TP_STRUCT__entry( 384 TP_STRUCT__entry(
385 __field(char *, rcuname) 385 __field(const char *, rcuname)
386 __field(void *, rhp) 386 __field(void *, rhp)
387 __field(void *, func) 387 __field(void *, func)
388 __field(long, qlen_lazy) 388 __field(long, qlen_lazy)
@@ -412,13 +412,13 @@ TRACE_EVENT(rcu_callback,
412 */ 412 */
413TRACE_EVENT(rcu_kfree_callback, 413TRACE_EVENT(rcu_kfree_callback,
414 414
415 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset, 415 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset,
416 long qlen_lazy, long qlen), 416 long qlen_lazy, long qlen),
417 417
418 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen), 418 TP_ARGS(rcuname, rhp, offset, qlen_lazy, qlen),
419 419
420 TP_STRUCT__entry( 420 TP_STRUCT__entry(
421 __field(char *, rcuname) 421 __field(const char *, rcuname)
422 __field(void *, rhp) 422 __field(void *, rhp)
423 __field(unsigned long, offset) 423 __field(unsigned long, offset)
424 __field(long, qlen_lazy) 424 __field(long, qlen_lazy)
@@ -447,12 +447,12 @@ TRACE_EVENT(rcu_kfree_callback,
447 */ 447 */
448TRACE_EVENT(rcu_batch_start, 448TRACE_EVENT(rcu_batch_start,
449 449
450 TP_PROTO(char *rcuname, long qlen_lazy, long qlen, long blimit), 450 TP_PROTO(const char *rcuname, long qlen_lazy, long qlen, long blimit),
451 451
452 TP_ARGS(rcuname, qlen_lazy, qlen, blimit), 452 TP_ARGS(rcuname, qlen_lazy, qlen, blimit),
453 453
454 TP_STRUCT__entry( 454 TP_STRUCT__entry(
455 __field(char *, rcuname) 455 __field(const char *, rcuname)
456 __field(long, qlen_lazy) 456 __field(long, qlen_lazy)
457 __field(long, qlen) 457 __field(long, qlen)
458 __field(long, blimit) 458 __field(long, blimit)
@@ -477,12 +477,12 @@ TRACE_EVENT(rcu_batch_start,
477 */ 477 */
478TRACE_EVENT(rcu_invoke_callback, 478TRACE_EVENT(rcu_invoke_callback,
479 479
480 TP_PROTO(char *rcuname, struct rcu_head *rhp), 480 TP_PROTO(const char *rcuname, struct rcu_head *rhp),
481 481
482 TP_ARGS(rcuname, rhp), 482 TP_ARGS(rcuname, rhp),
483 483
484 TP_STRUCT__entry( 484 TP_STRUCT__entry(
485 __field(char *, rcuname) 485 __field(const char *, rcuname)
486 __field(void *, rhp) 486 __field(void *, rhp)
487 __field(void *, func) 487 __field(void *, func)
488 ), 488 ),
@@ -506,12 +506,12 @@ TRACE_EVENT(rcu_invoke_callback,
506 */ 506 */
507TRACE_EVENT(rcu_invoke_kfree_callback, 507TRACE_EVENT(rcu_invoke_kfree_callback,
508 508
509 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset), 509 TP_PROTO(const char *rcuname, struct rcu_head *rhp, unsigned long offset),
510 510
511 TP_ARGS(rcuname, rhp, offset), 511 TP_ARGS(rcuname, rhp, offset),
512 512
513 TP_STRUCT__entry( 513 TP_STRUCT__entry(
514 __field(char *, rcuname) 514 __field(const char *, rcuname)
515 __field(void *, rhp) 515 __field(void *, rhp)
516 __field(unsigned long, offset) 516 __field(unsigned long, offset)
517 ), 517 ),
@@ -539,13 +539,13 @@ TRACE_EVENT(rcu_invoke_kfree_callback,
539 */ 539 */
540TRACE_EVENT(rcu_batch_end, 540TRACE_EVENT(rcu_batch_end,
541 541
542 TP_PROTO(char *rcuname, int callbacks_invoked, 542 TP_PROTO(const char *rcuname, int callbacks_invoked,
543 bool cb, bool nr, bool iit, bool risk), 543 bool cb, bool nr, bool iit, bool risk),
544 544
545 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk), 545 TP_ARGS(rcuname, callbacks_invoked, cb, nr, iit, risk),
546 546
547 TP_STRUCT__entry( 547 TP_STRUCT__entry(
548 __field(char *, rcuname) 548 __field(const char *, rcuname)
549 __field(int, callbacks_invoked) 549 __field(int, callbacks_invoked)
550 __field(bool, cb) 550 __field(bool, cb)
551 __field(bool, nr) 551 __field(bool, nr)
@@ -577,13 +577,13 @@ TRACE_EVENT(rcu_batch_end,
577 */ 577 */
578TRACE_EVENT(rcu_torture_read, 578TRACE_EVENT(rcu_torture_read,
579 579
580 TP_PROTO(char *rcutorturename, struct rcu_head *rhp, 580 TP_PROTO(const char *rcutorturename, struct rcu_head *rhp,
581 unsigned long secs, unsigned long c_old, unsigned long c), 581 unsigned long secs, unsigned long c_old, unsigned long c),
582 582
583 TP_ARGS(rcutorturename, rhp, secs, c_old, c), 583 TP_ARGS(rcutorturename, rhp, secs, c_old, c),
584 584
585 TP_STRUCT__entry( 585 TP_STRUCT__entry(
586 __field(char *, rcutorturename) 586 __field(const char *, rcutorturename)
587 __field(struct rcu_head *, rhp) 587 __field(struct rcu_head *, rhp)
588 __field(unsigned long, secs) 588 __field(unsigned long, secs)
589 __field(unsigned long, c_old) 589 __field(unsigned long, c_old)
@@ -623,13 +623,13 @@ TRACE_EVENT(rcu_torture_read,
623 */ 623 */
624TRACE_EVENT(rcu_barrier, 624TRACE_EVENT(rcu_barrier,
625 625
626 TP_PROTO(char *rcuname, char *s, int cpu, int cnt, unsigned long done), 626 TP_PROTO(const char *rcuname, const char *s, int cpu, int cnt, unsigned long done),
627 627
628 TP_ARGS(rcuname, s, cpu, cnt, done), 628 TP_ARGS(rcuname, s, cpu, cnt, done),
629 629
630 TP_STRUCT__entry( 630 TP_STRUCT__entry(
631 __field(char *, rcuname) 631 __field(const char *, rcuname)
632 __field(char *, s) 632 __field(const char *, s)
633 __field(int, cpu) 633 __field(int, cpu)
634 __field(int, cnt) 634 __field(int, cnt)
635 __field(unsigned long, done) 635 __field(unsigned long, done)
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index e5586caff67a..2e7d9947a10d 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -57,7 +57,7 @@ DECLARE_EVENT_CLASS(sched_wakeup_template,
57 57
58 TP_PROTO(struct task_struct *p, int success), 58 TP_PROTO(struct task_struct *p, int success),
59 59
60 TP_ARGS(p, success), 60 TP_ARGS(__perf_task(p), success),
61 61
62 TP_STRUCT__entry( 62 TP_STRUCT__entry(
63 __array( char, comm, TASK_COMM_LEN ) 63 __array( char, comm, TASK_COMM_LEN )
@@ -73,9 +73,6 @@ DECLARE_EVENT_CLASS(sched_wakeup_template,
73 __entry->prio = p->prio; 73 __entry->prio = p->prio;
74 __entry->success = success; 74 __entry->success = success;
75 __entry->target_cpu = task_cpu(p); 75 __entry->target_cpu = task_cpu(p);
76 )
77 TP_perf_assign(
78 __perf_task(p);
79 ), 76 ),
80 77
81 TP_printk("comm=%s pid=%d prio=%d success=%d target_cpu=%03d", 78 TP_printk("comm=%s pid=%d prio=%d success=%d target_cpu=%03d",
@@ -313,7 +310,7 @@ DECLARE_EVENT_CLASS(sched_stat_template,
313 310
314 TP_PROTO(struct task_struct *tsk, u64 delay), 311 TP_PROTO(struct task_struct *tsk, u64 delay),
315 312
316 TP_ARGS(tsk, delay), 313 TP_ARGS(__perf_task(tsk), __perf_count(delay)),
317 314
318 TP_STRUCT__entry( 315 TP_STRUCT__entry(
319 __array( char, comm, TASK_COMM_LEN ) 316 __array( char, comm, TASK_COMM_LEN )
@@ -325,10 +322,6 @@ DECLARE_EVENT_CLASS(sched_stat_template,
325 memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); 322 memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
326 __entry->pid = tsk->pid; 323 __entry->pid = tsk->pid;
327 __entry->delay = delay; 324 __entry->delay = delay;
328 )
329 TP_perf_assign(
330 __perf_count(delay);
331 __perf_task(tsk);
332 ), 325 ),
333 326
334 TP_printk("comm=%s pid=%d delay=%Lu [ns]", 327 TP_printk("comm=%s pid=%d delay=%Lu [ns]",
@@ -372,11 +365,11 @@ DEFINE_EVENT(sched_stat_template, sched_stat_blocked,
372 * Tracepoint for accounting runtime (time the task is executing 365 * Tracepoint for accounting runtime (time the task is executing
373 * on a CPU). 366 * on a CPU).
374 */ 367 */
375TRACE_EVENT(sched_stat_runtime, 368DECLARE_EVENT_CLASS(sched_stat_runtime,
376 369
377 TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime), 370 TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime),
378 371
379 TP_ARGS(tsk, runtime, vruntime), 372 TP_ARGS(tsk, __perf_count(runtime), vruntime),
380 373
381 TP_STRUCT__entry( 374 TP_STRUCT__entry(
382 __array( char, comm, TASK_COMM_LEN ) 375 __array( char, comm, TASK_COMM_LEN )
@@ -390,9 +383,6 @@ TRACE_EVENT(sched_stat_runtime,
390 __entry->pid = tsk->pid; 383 __entry->pid = tsk->pid;
391 __entry->runtime = runtime; 384 __entry->runtime = runtime;
392 __entry->vruntime = vruntime; 385 __entry->vruntime = vruntime;
393 )
394 TP_perf_assign(
395 __perf_count(runtime);
396 ), 386 ),
397 387
398 TP_printk("comm=%s pid=%d runtime=%Lu [ns] vruntime=%Lu [ns]", 388 TP_printk("comm=%s pid=%d runtime=%Lu [ns] vruntime=%Lu [ns]",
@@ -401,6 +391,10 @@ TRACE_EVENT(sched_stat_runtime,
401 (unsigned long long)__entry->vruntime) 391 (unsigned long long)__entry->vruntime)
402); 392);
403 393
394DEFINE_EVENT(sched_stat_runtime, sched_stat_runtime,
395 TP_PROTO(struct task_struct *tsk, u64 runtime, u64 vruntime),
396 TP_ARGS(tsk, runtime, vruntime));
397
404/* 398/*
405 * Tracepoint for showing priority inheritance modifying a tasks 399 * Tracepoint for showing priority inheritance modifying a tasks
406 * priority. 400 * priority.
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 41a6643e2136..5c7ab17cbb02 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -507,8 +507,14 @@ static inline notrace int ftrace_get_offsets_##call( \
507#undef TP_fast_assign 507#undef TP_fast_assign
508#define TP_fast_assign(args...) args 508#define TP_fast_assign(args...) args
509 509
510#undef TP_perf_assign 510#undef __perf_addr
511#define TP_perf_assign(args...) 511#define __perf_addr(a) (a)
512
513#undef __perf_count
514#define __perf_count(c) (c)
515
516#undef __perf_task
517#define __perf_task(t) (t)
512 518
513#undef DECLARE_EVENT_CLASS 519#undef DECLARE_EVENT_CLASS
514#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 520#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
@@ -636,16 +642,13 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
636#define __get_str(field) (char *)__get_dynamic_array(field) 642#define __get_str(field) (char *)__get_dynamic_array(field)
637 643
638#undef __perf_addr 644#undef __perf_addr
639#define __perf_addr(a) __addr = (a) 645#define __perf_addr(a) (__addr = (a))
640 646
641#undef __perf_count 647#undef __perf_count
642#define __perf_count(c) __count = (c) 648#define __perf_count(c) (__count = (c))
643 649
644#undef __perf_task 650#undef __perf_task
645#define __perf_task(t) __task = (t) 651#define __perf_task(t) (__task = (t))
646
647#undef TP_perf_assign
648#define TP_perf_assign(args...) args
649 652
650#undef DECLARE_EVENT_CLASS 653#undef DECLARE_EVENT_CLASS
651#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 654#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
@@ -663,15 +666,20 @@ perf_trace_##call(void *__data, proto) \
663 int __data_size; \ 666 int __data_size; \
664 int rctx; \ 667 int rctx; \
665 \ 668 \
666 perf_fetch_caller_regs(&__regs); \
667 \
668 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ 669 __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
670 \
671 head = this_cpu_ptr(event_call->perf_events); \
672 if (__builtin_constant_p(!__task) && !__task && \
673 hlist_empty(head)) \
674 return; \
675 \
669 __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ 676 __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\
670 sizeof(u64)); \ 677 sizeof(u64)); \
671 __entry_size -= sizeof(u32); \ 678 __entry_size -= sizeof(u32); \
672 \ 679 \
673 entry = (struct ftrace_raw_##call *)perf_trace_buf_prepare( \ 680 perf_fetch_caller_regs(&__regs); \
674 __entry_size, event_call->event.type, &__regs, &rctx); \ 681 entry = perf_trace_buf_prepare(__entry_size, \
682 event_call->event.type, &__regs, &rctx); \
675 if (!entry) \ 683 if (!entry) \
676 return; \ 684 return; \
677 \ 685 \
@@ -679,7 +687,6 @@ perf_trace_##call(void *__data, proto) \
679 \ 687 \
680 { assign; } \ 688 { assign; } \
681 \ 689 \
682 head = this_cpu_ptr(event_call->perf_events); \
683 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \ 690 perf_trace_buf_submit(entry, __entry_size, rctx, __addr, \
684 __count, &__regs, head, __task); \ 691 __count, &__regs, head, __task); \
685} 692}
diff --git a/include/uapi/drm/Kbuild b/include/uapi/drm/Kbuild
index 119487e05e65..2d9a25daab05 100644
--- a/include/uapi/drm/Kbuild
+++ b/include/uapi/drm/Kbuild
@@ -16,3 +16,4 @@ header-y += sis_drm.h
16header-y += tegra_drm.h 16header-y += tegra_drm.h
17header-y += via_drm.h 17header-y += via_drm.h
18header-y += vmwgfx_drm.h 18header-y += vmwgfx_drm.h
19header-y += msm_drm.h
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 238a166b9fe6..ece867889cc7 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -181,7 +181,7 @@ enum drm_map_type {
181 _DRM_AGP = 3, /**< AGP/GART */ 181 _DRM_AGP = 3, /**< AGP/GART */
182 _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */ 182 _DRM_SCATTER_GATHER = 4, /**< Scatter/gather memory for PCI DMA */
183 _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */ 183 _DRM_CONSISTENT = 5, /**< Consistent memory for PCI DMA */
184 _DRM_GEM = 6, /**< GEM object */ 184 _DRM_GEM = 6, /**< GEM object (obsolete) */
185}; 185};
186 186
187/** 187/**
@@ -780,6 +780,7 @@ struct drm_event_vblank {
780#define DRM_CAP_DUMB_PREFER_SHADOW 0x4 780#define DRM_CAP_DUMB_PREFER_SHADOW 0x4
781#define DRM_CAP_PRIME 0x5 781#define DRM_CAP_PRIME 0x5
782#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 782#define DRM_CAP_TIMESTAMP_MONOTONIC 0x6
783#define DRM_CAP_ASYNC_PAGE_FLIP 0x7
783 784
784#define DRM_PRIME_CAP_IMPORT 0x1 785#define DRM_PRIME_CAP_IMPORT 0x1
785#define DRM_PRIME_CAP_EXPORT 0x2 786#define DRM_PRIME_CAP_EXPORT 0x2
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h
index 53db7cea373b..550811712f78 100644
--- a/include/uapi/drm/drm_mode.h
+++ b/include/uapi/drm/drm_mode.h
@@ -412,7 +412,8 @@ struct drm_mode_crtc_lut {
412}; 412};
413 413
414#define DRM_MODE_PAGE_FLIP_EVENT 0x01 414#define DRM_MODE_PAGE_FLIP_EVENT 0x01
415#define DRM_MODE_PAGE_FLIP_FLAGS DRM_MODE_PAGE_FLIP_EVENT 415#define DRM_MODE_PAGE_FLIP_ASYNC 0x02
416#define DRM_MODE_PAGE_FLIP_FLAGS (DRM_MODE_PAGE_FLIP_EVENT|DRM_MODE_PAGE_FLIP_ASYNC)
416 417
417/* 418/*
418 * Request a page flip on the specified crtc. 419 * Request a page flip on the specified crtc.
@@ -426,11 +427,14 @@ struct drm_mode_crtc_lut {
426 * flip is already pending as the ioctl is called, EBUSY will be 427 * flip is already pending as the ioctl is called, EBUSY will be
427 * returned. 428 * returned.
428 * 429 *
429 * The ioctl supports one flag, DRM_MODE_PAGE_FLIP_EVENT, which will 430 * Flag DRM_MODE_PAGE_FLIP_EVENT requests that drm sends back a vblank
430 * request that drm sends back a vblank event (see drm.h: struct 431 * event (see drm.h: struct drm_event_vblank) when the page flip is
431 * drm_event_vblank) when the page flip is done. The user_data field 432 * done. The user_data field passed in with this ioctl will be
432 * passed in with this ioctl will be returned as the user_data field 433 * returned as the user_data field in the vblank event struct.
433 * in the vblank event struct. 434 *
435 * Flag DRM_MODE_PAGE_FLIP_ASYNC requests that the flip happen
436 * 'as soon as possible', meaning that it not delay waiting for vblank.
437 * This may cause tearing on the screen.
434 * 438 *
435 * The reserved field must be zero until we figure out something 439 * The reserved field must be zero until we figure out something
436 * clever to use it for. 440 * clever to use it for.
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h
index 923ed7fe5775..55bb5729bd78 100644
--- a/include/uapi/drm/i915_drm.h
+++ b/include/uapi/drm/i915_drm.h
@@ -33,6 +33,30 @@
33 * subject to backwards-compatibility constraints. 33 * subject to backwards-compatibility constraints.
34 */ 34 */
35 35
36/**
37 * DOC: uevents generated by i915 on it's device node
38 *
39 * I915_L3_PARITY_UEVENT - Generated when the driver receives a parity mismatch
40 * event from the gpu l3 cache. Additional information supplied is ROW,
41 * BANK, SUBBANK of the affected cacheline. Userspace should keep track of
42 * these events and if a specific cache-line seems to have a persistent
43 * error remap it with the l3 remapping tool supplied in intel-gpu-tools.
44 * The value supplied with the event is always 1.
45 *
46 * I915_ERROR_UEVENT - Generated upon error detection, currently only via
47 * hangcheck. The error detection event is a good indicator of when things
48 * began to go badly. The value supplied with the event is a 1 upon error
49 * detection, and a 0 upon reset completion, signifying no more error
50 * exists. NOTE: Disabling hangcheck or reset via module parameter will
51 * cause the related events to not be seen.
52 *
53 * I915_RESET_UEVENT - Event is generated just before an attempt to reset the
54 * the GPU. The value supplied with the event is always 1. NOTE: Disable
55 * reset via module parameter will cause this event to not be seen.
56 */
57#define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR"
58#define I915_ERROR_UEVENT "ERROR"
59#define I915_RESET_UEVENT "RESET"
36 60
37/* Each region is a minimum of 16k, and there are at most 255 of them. 61/* Each region is a minimum of 16k, and there are at most 255 of them.
38 */ 62 */
@@ -310,6 +334,7 @@ typedef struct drm_i915_irq_wait {
310#define I915_PARAM_HAS_PINNED_BATCHES 24 334#define I915_PARAM_HAS_PINNED_BATCHES 24
311#define I915_PARAM_HAS_EXEC_NO_RELOC 25 335#define I915_PARAM_HAS_EXEC_NO_RELOC 25
312#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 336#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26
337#define I915_PARAM_HAS_WT 27
313 338
314typedef struct drm_i915_getparam { 339typedef struct drm_i915_getparam {
315 int param; 340 int param;
@@ -744,8 +769,32 @@ struct drm_i915_gem_busy {
744 __u32 busy; 769 __u32 busy;
745}; 770};
746 771
772/**
773 * I915_CACHING_NONE
774 *
775 * GPU access is not coherent with cpu caches. Default for machines without an
776 * LLC.
777 */
747#define I915_CACHING_NONE 0 778#define I915_CACHING_NONE 0
779/**
780 * I915_CACHING_CACHED
781 *
782 * GPU access is coherent with cpu caches and furthermore the data is cached in
783 * last-level caches shared between cpu cores and the gpu GT. Default on
784 * machines with HAS_LLC.
785 */
748#define I915_CACHING_CACHED 1 786#define I915_CACHING_CACHED 1
787/**
788 * I915_CACHING_DISPLAY
789 *
790 * Special GPU caching mode which is coherent with the scanout engines.
791 * Transparently falls back to I915_CACHING_NONE on platforms where no special
792 * cache mode (like write-through or gfdt flushing) is available. The kernel
793 * automatically sets this mode when using a buffer as a scanout target.
794 * Userspace can manually set this mode to avoid a costly stall and clflush in
795 * the hotpath of drawing the first frame.
796 */
797#define I915_CACHING_DISPLAY 2
749 798
750struct drm_i915_gem_caching { 799struct drm_i915_gem_caching {
751 /** 800 /**
diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h
new file mode 100644
index 000000000000..d3c62074016d
--- /dev/null
+++ b/include/uapi/drm/msm_drm.h
@@ -0,0 +1,207 @@
1/*
2 * Copyright (C) 2013 Red Hat
3 * Author: Rob Clark <robdclark@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 as published by
7 * the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __MSM_DRM_H__
19#define __MSM_DRM_H__
20
21#include <stddef.h>
22#include <drm/drm.h>
23
24/* Please note that modifications to all structs defined here are
25 * subject to backwards-compatibility constraints:
26 * 1) Do not use pointers, use uint64_t instead for 32 bit / 64 bit
27 * user/kernel compatibility
28 * 2) Keep fields aligned to their size
29 * 3) Because of how drm_ioctl() works, we can add new fields at
30 * the end of an ioctl if some care is taken: drm_ioctl() will
31 * zero out the new fields at the tail of the ioctl, so a zero
32 * value should have a backwards compatible meaning. And for
33 * output params, userspace won't see the newly added output
34 * fields.. so that has to be somehow ok.
35 */
36
37#define MSM_PIPE_NONE 0x00
38#define MSM_PIPE_2D0 0x01
39#define MSM_PIPE_2D1 0x02
40#define MSM_PIPE_3D0 0x10
41
42/* timeouts are specified in clock-monotonic absolute times (to simplify
43 * restarting interrupted ioctls). The following struct is logically the
44 * same as 'struct timespec' but 32/64b ABI safe.
45 */
46struct drm_msm_timespec {
47 int64_t tv_sec; /* seconds */
48 int64_t tv_nsec; /* nanoseconds */
49};
50
51#define MSM_PARAM_GPU_ID 0x01
52#define MSM_PARAM_GMEM_SIZE 0x02
53
54struct drm_msm_param {
55 uint32_t pipe; /* in, MSM_PIPE_x */
56 uint32_t param; /* in, MSM_PARAM_x */
57 uint64_t value; /* out (get_param) or in (set_param) */
58};
59
60/*
61 * GEM buffers:
62 */
63
64#define MSM_BO_SCANOUT 0x00000001 /* scanout capable */
65#define MSM_BO_GPU_READONLY 0x00000002
66#define MSM_BO_CACHE_MASK 0x000f0000
67/* cache modes */
68#define MSM_BO_CACHED 0x00010000
69#define MSM_BO_WC 0x00020000
70#define MSM_BO_UNCACHED 0x00040000
71
72struct drm_msm_gem_new {
73 uint64_t size; /* in */
74 uint32_t flags; /* in, mask of MSM_BO_x */
75 uint32_t handle; /* out */
76};
77
78struct drm_msm_gem_info {
79 uint32_t handle; /* in */
80 uint32_t pad;
81 uint64_t offset; /* out, offset to pass to mmap() */
82};
83
84#define MSM_PREP_READ 0x01
85#define MSM_PREP_WRITE 0x02
86#define MSM_PREP_NOSYNC 0x04
87
88struct drm_msm_gem_cpu_prep {
89 uint32_t handle; /* in */
90 uint32_t op; /* in, mask of MSM_PREP_x */
91 struct drm_msm_timespec timeout; /* in */
92};
93
94struct drm_msm_gem_cpu_fini {
95 uint32_t handle; /* in */
96};
97
98/*
99 * Cmdstream Submission:
100 */
101
102/* The value written into the cmdstream is logically:
103 *
104 * ((relocbuf->gpuaddr + reloc_offset) << shift) | or
105 *
106 * When we have GPU's w/ >32bit ptrs, it should be possible to deal
107 * with this by emit'ing two reloc entries with appropriate shift
108 * values. Or a new MSM_SUBMIT_CMD_x type would also be an option.
109 *
110 * NOTE that reloc's must be sorted by order of increasing submit_offset,
111 * otherwise EINVAL.
112 */
113struct drm_msm_gem_submit_reloc {
114 uint32_t submit_offset; /* in, offset from submit_bo */
115 uint32_t or; /* in, value OR'd with result */
116 int32_t shift; /* in, amount of left shift (can be negative) */
117 uint32_t reloc_idx; /* in, index of reloc_bo buffer */
118 uint64_t reloc_offset; /* in, offset from start of reloc_bo */
119};
120
121/* submit-types:
122 * BUF - this cmd buffer is executed normally.
123 * IB_TARGET_BUF - this cmd buffer is an IB target. Reloc's are
124 * processed normally, but the kernel does not setup an IB to
125 * this buffer in the first-level ringbuffer
126 * CTX_RESTORE_BUF - only executed if there has been a GPU context
127 * switch since the last SUBMIT ioctl
128 */
129#define MSM_SUBMIT_CMD_BUF 0x0001
130#define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002
131#define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003
132struct drm_msm_gem_submit_cmd {
133 uint32_t type; /* in, one of MSM_SUBMIT_CMD_x */
134 uint32_t submit_idx; /* in, index of submit_bo cmdstream buffer */
135 uint32_t submit_offset; /* in, offset into submit_bo */
136 uint32_t size; /* in, cmdstream size */
137 uint32_t pad;
138 uint32_t nr_relocs; /* in, number of submit_reloc's */
139 uint64_t __user relocs; /* in, ptr to array of submit_reloc's */
140};
141
142/* Each buffer referenced elsewhere in the cmdstream submit (ie. the
143 * cmdstream buffer(s) themselves or reloc entries) has one (and only
144 * one) entry in the submit->bos[] table.
145 *
146 * As a optimization, the current buffer (gpu virtual address) can be
147 * passed back through the 'presumed' field. If on a subsequent reloc,
148 * userspace passes back a 'presumed' address that is still valid,
149 * then patching the cmdstream for this entry is skipped. This can
150 * avoid kernel needing to map/access the cmdstream bo in the common
151 * case.
152 */
153#define MSM_SUBMIT_BO_READ 0x0001
154#define MSM_SUBMIT_BO_WRITE 0x0002
155struct drm_msm_gem_submit_bo {
156 uint32_t flags; /* in, mask of MSM_SUBMIT_BO_x */
157 uint32_t handle; /* in, GEM handle */
158 uint64_t presumed; /* in/out, presumed buffer address */
159};
160
161/* Each cmdstream submit consists of a table of buffers involved, and
162 * one or more cmdstream buffers. This allows for conditional execution
163 * (context-restore), and IB buffers needed for per tile/bin draw cmds.
164 */
165struct drm_msm_gem_submit {
166 uint32_t pipe; /* in, MSM_PIPE_x */
167 uint32_t fence; /* out */
168 uint32_t nr_bos; /* in, number of submit_bo's */
169 uint32_t nr_cmds; /* in, number of submit_cmd's */
170 uint64_t __user bos; /* in, ptr to array of submit_bo's */
171 uint64_t __user cmds; /* in, ptr to array of submit_cmd's */
172};
173
174/* The normal way to synchronize with the GPU is just to CPU_PREP on
175 * a buffer if you need to access it from the CPU (other cmdstream
176 * submission from same or other contexts, PAGE_FLIP ioctl, etc, all
177 * handle the required synchronization under the hood). This ioctl
178 * mainly just exists as a way to implement the gallium pipe_fence
179 * APIs without requiring a dummy bo to synchronize on.
180 */
181struct drm_msm_wait_fence {
182 uint32_t fence; /* in */
183 uint32_t pad;
184 struct drm_msm_timespec timeout; /* in */
185};
186
187#define DRM_MSM_GET_PARAM 0x00
188/* placeholder:
189#define DRM_MSM_SET_PARAM 0x01
190 */
191#define DRM_MSM_GEM_NEW 0x02
192#define DRM_MSM_GEM_INFO 0x03
193#define DRM_MSM_GEM_CPU_PREP 0x04
194#define DRM_MSM_GEM_CPU_FINI 0x05
195#define DRM_MSM_GEM_SUBMIT 0x06
196#define DRM_MSM_WAIT_FENCE 0x07
197#define DRM_MSM_NUM_IOCTLS 0x08
198
199#define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param)
200#define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new)
201#define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info)
202#define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep)
203#define DRM_IOCTL_MSM_GEM_CPU_FINI DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini)
204#define DRM_IOCTL_MSM_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit)
205#define DRM_IOCTL_MSM_WAIT_FENCE DRM_IOW (DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence)
206
207#endif /* __MSM_DRM_H__ */
diff --git a/include/uapi/drm/radeon_drm.h b/include/uapi/drm/radeon_drm.h
index 321d4ac5c512..fa8b3adf9ffb 100644
--- a/include/uapi/drm/radeon_drm.h
+++ b/include/uapi/drm/radeon_drm.h
@@ -979,6 +979,8 @@ struct drm_radeon_cs {
979#define RADEON_INFO_RING_WORKING 0x15 979#define RADEON_INFO_RING_WORKING 0x15
980/* SI tile mode array */ 980/* SI tile mode array */
981#define RADEON_INFO_SI_TILE_MODE_ARRAY 0x16 981#define RADEON_INFO_SI_TILE_MODE_ARRAY 0x16
982/* query if CP DMA is supported on the compute ring */
983#define RADEON_INFO_SI_CP_DMA_COMPUTE 0x17
982 984
983 985
984struct drm_radeon_info { 986struct drm_radeon_info {
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 997f9f2f0963..e7c94eeb9475 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -227,6 +227,7 @@ header-y += kvm_para.h
227endif 227endif
228 228
229header-y += l2tp.h 229header-y += l2tp.h
230header-y += libc-compat.h
230header-y += limits.h 231header-y += limits.h
231header-y += llc.h 232header-y += llc.h
232header-y += loop.h 233header-y += loop.h
diff --git a/include/uapi/linux/can/gw.h b/include/uapi/linux/can/gw.h
index ae07bec74f4b..4e27c82b564a 100644
--- a/include/uapi/linux/can/gw.h
+++ b/include/uapi/linux/can/gw.h
@@ -45,6 +45,7 @@ enum {
45 CGW_DST_IF, /* ifindex of destination network interface */ 45 CGW_DST_IF, /* ifindex of destination network interface */
46 CGW_FILTER, /* specify struct can_filter on source CAN device */ 46 CGW_FILTER, /* specify struct can_filter on source CAN device */
47 CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */ 47 CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */
48 CGW_LIM_HOPS, /* limit the number of hops of this specific rule */
48 __CGW_MAX 49 __CGW_MAX
49}; 50};
50 51
@@ -116,13 +117,19 @@ enum {
116 * Sets a CAN receive filter for the gateway job specified by the 117 * Sets a CAN receive filter for the gateway job specified by the
117 * struct can_filter described in include/linux/can.h 118 * struct can_filter described in include/linux/can.h
118 * 119 *
119 * CGW_MOD_XXX (length 17 bytes): 120 * CGW_MOD_(AND|OR|XOR|SET) (length 17 bytes):
120 * Specifies a modification that's done to a received CAN frame before it is 121 * Specifies a modification that's done to a received CAN frame before it is
121 * send out to the destination interface. 122 * send out to the destination interface.
122 * 123 *
123 * <struct can_frame> data used as operator 124 * <struct can_frame> data used as operator
124 * <u8> affected CAN frame elements 125 * <u8> affected CAN frame elements
125 * 126 *
127 * CGW_LIM_HOPS (length 1 byte):
128 * Limit the number of hops of this specific rule. Usually the received CAN
129 * frame can be processed as much as 'max_hops' times (which is given at module
130 * load time of the can-gw module). This value is used to reduce the number of
131 * possible hops for this gateway rule to a value smaller then max_hops.
132 *
126 * CGW_CS_XOR (length 4 bytes): 133 * CGW_CS_XOR (length 4 bytes):
127 * Set a simple XOR checksum starting with an initial value into 134 * Set a simple XOR checksum starting with an initial value into
128 * data[result-idx] using data[start-idx] .. data[end-idx] 135 * data[result-idx] using data[start-idx] .. data[end-idx]
diff --git a/include/uapi/linux/cm4000_cs.h b/include/uapi/linux/cm4000_cs.h
index bc51f77db918..1217f751a1bc 100644
--- a/include/uapi/linux/cm4000_cs.h
+++ b/include/uapi/linux/cm4000_cs.h
@@ -2,6 +2,7 @@
2#define _UAPI_CM4000_H_ 2#define _UAPI_CM4000_H_
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/ioctl.h>
5 6
6#define MAX_ATR 33 7#define MAX_ATR 33
7 8
diff --git a/include/uapi/linux/dn.h b/include/uapi/linux/dn.h
index 9c50445462d9..5fbdd3d49eba 100644
--- a/include/uapi/linux/dn.h
+++ b/include/uapi/linux/dn.h
@@ -2,6 +2,7 @@
2#define _LINUX_DN_H 2#define _LINUX_DN_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/if_ether.h>
5 6
6/* 7/*
7 8
@@ -120,7 +121,7 @@ struct linkinfo_dn {
120 * Ethernet address format (for DECnet) 121 * Ethernet address format (for DECnet)
121 */ 122 */
122union etheraddress { 123union etheraddress {
123 __u8 dne_addr[6]; /* Full ethernet address */ 124 __u8 dne_addr[ETH_ALEN]; /* Full ethernet address */
124 struct { 125 struct {
125 __u8 dne_hiord[4]; /* DECnet HIORD prefix */ 126 __u8 dne_hiord[4]; /* DECnet HIORD prefix */
126 __u8 dne_nodeaddr[2]; /* DECnet node address */ 127 __u8 dne_nodeaddr[2]; /* DECnet node address */
diff --git a/include/uapi/linux/fib_rules.h b/include/uapi/linux/fib_rules.h
index 51da65b68b85..2b82d7e30974 100644
--- a/include/uapi/linux/fib_rules.h
+++ b/include/uapi/linux/fib_rules.h
@@ -44,8 +44,8 @@ enum {
44 FRA_FWMARK, /* mark */ 44 FRA_FWMARK, /* mark */
45 FRA_FLOW, /* flow/class id */ 45 FRA_FLOW, /* flow/class id */
46 FRA_UNUSED6, 46 FRA_UNUSED6,
47 FRA_UNUSED7, 47 FRA_SUPPRESS_IFGROUP,
48 FRA_UNUSED8, 48 FRA_SUPPRESS_PREFIXLEN,
49 FRA_TABLE, /* Extended table id */ 49 FRA_TABLE, /* Extended table id */
50 FRA_FWMASK, /* mask for netfilter mark */ 50 FRA_FWMASK, /* mask for netfilter mark */
51 FRA_OIFNAME, 51 FRA_OIFNAME,
diff --git a/include/uapi/linux/fiemap.h b/include/uapi/linux/fiemap.h
index d830747f5c0b..0c51d617dae9 100644
--- a/include/uapi/linux/fiemap.h
+++ b/include/uapi/linux/fiemap.h
@@ -40,6 +40,7 @@ struct fiemap {
40 40
41#define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */ 41#define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */
42#define FIEMAP_FLAG_XATTR 0x00000002 /* map extended attribute tree */ 42#define FIEMAP_FLAG_XATTR 0x00000002 /* map extended attribute tree */
43#define FIEMAP_FLAG_CACHE 0x00000004 /* request caching of the extents */
43 44
44#define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR) 45#define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR)
45 46
diff --git a/include/uapi/linux/icmpv6.h b/include/uapi/linux/icmpv6.h
index e0133c73c304..590beda78ea0 100644
--- a/include/uapi/linux/icmpv6.h
+++ b/include/uapi/linux/icmpv6.h
@@ -115,6 +115,8 @@ struct icmp6hdr {
115#define ICMPV6_NOT_NEIGHBOUR 2 115#define ICMPV6_NOT_NEIGHBOUR 2
116#define ICMPV6_ADDR_UNREACH 3 116#define ICMPV6_ADDR_UNREACH 3
117#define ICMPV6_PORT_UNREACH 4 117#define ICMPV6_PORT_UNREACH 4
118#define ICMPV6_POLICY_FAIL 5
119#define ICMPV6_REJECT_ROUTE 6
118 120
119/* 121/*
120 * Codes for Time Exceeded 122 * Codes for Time Exceeded
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index 2d70d79ce2fd..39f621a9fe82 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -14,6 +14,7 @@
14#define _UAPI_LINUX_IF_BRIDGE_H 14#define _UAPI_LINUX_IF_BRIDGE_H
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/if_ether.h>
17 18
18#define SYSFS_BRIDGE_ATTR "bridge" 19#define SYSFS_BRIDGE_ATTR "bridge"
19#define SYSFS_BRIDGE_FDB "brforward" 20#define SYSFS_BRIDGE_FDB "brforward"
@@ -88,7 +89,7 @@ struct __port_info {
88}; 89};
89 90
90struct __fdb_entry { 91struct __fdb_entry {
91 __u8 mac_addr[6]; 92 __u8 mac_addr[ETH_ALEN];
92 __u8 port_no; 93 __u8 port_no;
93 __u8 is_local; 94 __u8 is_local;
94 __u32 ageing_timer_value; 95 __u32 ageing_timer_value;
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 03f6170ab337..80394e8dc3a3 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -143,6 +143,7 @@ enum {
143 IFLA_NUM_TX_QUEUES, 143 IFLA_NUM_TX_QUEUES,
144 IFLA_NUM_RX_QUEUES, 144 IFLA_NUM_RX_QUEUES,
145 IFLA_CARRIER, 145 IFLA_CARRIER,
146 IFLA_PHYS_PORT_ID,
146 __IFLA_MAX 147 __IFLA_MAX
147}; 148};
148 149
@@ -313,6 +314,8 @@ enum {
313 IFLA_VXLAN_L2MISS, 314 IFLA_VXLAN_L2MISS,
314 IFLA_VXLAN_L3MISS, 315 IFLA_VXLAN_L3MISS,
315 IFLA_VXLAN_PORT, /* destination port */ 316 IFLA_VXLAN_PORT, /* destination port */
317 IFLA_VXLAN_GROUP6,
318 IFLA_VXLAN_LOCAL6,
316 __IFLA_VXLAN_MAX 319 __IFLA_VXLAN_MAX
317}; 320};
318#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) 321#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h
index b950c02030c0..dbf06667394b 100644
--- a/include/uapi/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
@@ -56,6 +56,7 @@ struct sockaddr_ll {
56#define PACKET_FANOUT_LB 1 56#define PACKET_FANOUT_LB 1
57#define PACKET_FANOUT_CPU 2 57#define PACKET_FANOUT_CPU 2
58#define PACKET_FANOUT_ROLLOVER 3 58#define PACKET_FANOUT_ROLLOVER 3
59#define PACKET_FANOUT_RND 4
59#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000 60#define PACKET_FANOUT_FLAG_ROLLOVER 0x1000
60#define PACKET_FANOUT_FLAG_DEFRAG 0x8000 61#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
61 62
diff --git a/include/uapi/linux/if_pppox.h b/include/uapi/linux/if_pppox.h
index e36a4aecd311..e128769331b5 100644
--- a/include/uapi/linux/if_pppox.h
+++ b/include/uapi/linux/if_pppox.h
@@ -46,7 +46,7 @@ struct pppoe_addr {
46 * PPTP addressing definition 46 * PPTP addressing definition
47 */ 47 */
48struct pptp_addr { 48struct pptp_addr {
49 __be16 call_id; 49 __u16 call_id;
50 struct in_addr sin_addr; 50 struct in_addr sin_addr;
51}; 51};
52 52
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
index 82334f88967e..e9502dd1ee2c 100644
--- a/include/uapi/linux/if_tun.h
+++ b/include/uapi/linux/if_tun.h
@@ -56,6 +56,8 @@
56#define TUNGETVNETHDRSZ _IOR('T', 215, int) 56#define TUNGETVNETHDRSZ _IOR('T', 215, int)
57#define TUNSETVNETHDRSZ _IOW('T', 216, int) 57#define TUNSETVNETHDRSZ _IOW('T', 216, int)
58#define TUNSETQUEUE _IOW('T', 217, int) 58#define TUNSETQUEUE _IOW('T', 217, int)
59#define TUNSETIFINDEX _IOW('T', 218, unsigned int)
60#define TUNGETFILTER _IOR('T', 219, struct sock_fprog)
59 61
60/* TUNSETIFF ifr flags */ 62/* TUNSETIFF ifr flags */
61#define IFF_TUN 0x0001 63#define IFF_TUN 0x0001
@@ -70,6 +72,10 @@
70#define IFF_DETACH_QUEUE 0x0400 72#define IFF_DETACH_QUEUE 0x0400
71/* read-only flag */ 73/* read-only flag */
72#define IFF_PERSIST 0x0800 74#define IFF_PERSIST 0x0800
75#define IFF_NOFILTER 0x1000
76
77/* Socket options */
78#define TUN_TX_TIMESTAMP 1
73 79
74/* Features for GSO (TUNSETOFFLOAD). */ 80/* Features for GSO (TUNSETOFFLOAD). */
75#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ 81#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
diff --git a/include/uapi/linux/in.h b/include/uapi/linux/in.h
index 9edb441df827..f9e8e496ae5d 100644
--- a/include/uapi/linux/in.h
+++ b/include/uapi/linux/in.h
@@ -24,30 +24,53 @@
24/* Standard well-defined IP protocols. */ 24/* Standard well-defined IP protocols. */
25enum { 25enum {
26 IPPROTO_IP = 0, /* Dummy protocol for TCP */ 26 IPPROTO_IP = 0, /* Dummy protocol for TCP */
27#define IPPROTO_IP IPPROTO_IP
27 IPPROTO_ICMP = 1, /* Internet Control Message Protocol */ 28 IPPROTO_ICMP = 1, /* Internet Control Message Protocol */
29#define IPPROTO_ICMP IPPROTO_ICMP
28 IPPROTO_IGMP = 2, /* Internet Group Management Protocol */ 30 IPPROTO_IGMP = 2, /* Internet Group Management Protocol */
31#define IPPROTO_IGMP IPPROTO_IGMP
29 IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */ 32 IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94) */
33#define IPPROTO_IPIP IPPROTO_IPIP
30 IPPROTO_TCP = 6, /* Transmission Control Protocol */ 34 IPPROTO_TCP = 6, /* Transmission Control Protocol */
35#define IPPROTO_TCP IPPROTO_TCP
31 IPPROTO_EGP = 8, /* Exterior Gateway Protocol */ 36 IPPROTO_EGP = 8, /* Exterior Gateway Protocol */
37#define IPPROTO_EGP IPPROTO_EGP
32 IPPROTO_PUP = 12, /* PUP protocol */ 38 IPPROTO_PUP = 12, /* PUP protocol */
39#define IPPROTO_PUP IPPROTO_PUP
33 IPPROTO_UDP = 17, /* User Datagram Protocol */ 40 IPPROTO_UDP = 17, /* User Datagram Protocol */
41#define IPPROTO_UDP IPPROTO_UDP
34 IPPROTO_IDP = 22, /* XNS IDP protocol */ 42 IPPROTO_IDP = 22, /* XNS IDP protocol */
43#define IPPROTO_IDP IPPROTO_IDP
44 IPPROTO_TP = 29, /* SO Transport Protocol Class 4 */
45#define IPPROTO_TP IPPROTO_TP
35 IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */ 46 IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */
36 IPPROTO_RSVP = 46, /* RSVP protocol */ 47#define IPPROTO_DCCP IPPROTO_DCCP
48 IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */
49#define IPPROTO_IPV6 IPPROTO_IPV6
50 IPPROTO_RSVP = 46, /* RSVP Protocol */
51#define IPPROTO_RSVP IPPROTO_RSVP
37 IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */ 52 IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */
38 53#define IPPROTO_GRE IPPROTO_GRE
39 IPPROTO_IPV6 = 41, /* IPv6-in-IPv4 tunnelling */ 54 IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */
40 55#define IPPROTO_ESP IPPROTO_ESP
41 IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */ 56 IPPROTO_AH = 51, /* Authentication Header protocol */
42 IPPROTO_AH = 51, /* Authentication Header protocol */ 57#define IPPROTO_AH IPPROTO_AH
43 IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */ 58 IPPROTO_MTP = 92, /* Multicast Transport Protocol */
44 IPPROTO_PIM = 103, /* Protocol Independent Multicast */ 59#define IPPROTO_MTP IPPROTO_MTP
45 60 IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */
46 IPPROTO_COMP = 108, /* Compression Header protocol */ 61#define IPPROTO_BEETPH IPPROTO_BEETPH
47 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */ 62 IPPROTO_ENCAP = 98, /* Encapsulation Header */
63#define IPPROTO_ENCAP IPPROTO_ENCAP
64 IPPROTO_PIM = 103, /* Protocol Independent Multicast */
65#define IPPROTO_PIM IPPROTO_PIM
66 IPPROTO_COMP = 108, /* Compression Header Protocol */
67#define IPPROTO_COMP IPPROTO_COMP
68 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
69#define IPPROTO_SCTP IPPROTO_SCTP
48 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */ 70 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
49 71#define IPPROTO_UDPLITE IPPROTO_UDPLITE
50 IPPROTO_RAW = 255, /* Raw IP packets */ 72 IPPROTO_RAW = 255, /* Raw IP packets */
73#define IPPROTO_RAW IPPROTO_RAW
51 IPPROTO_MAX 74 IPPROTO_MAX
52}; 75};
53 76
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
index 53b1d56a6e7f..440d5c479145 100644
--- a/include/uapi/linux/in6.h
+++ b/include/uapi/linux/in6.h
@@ -22,22 +22,30 @@
22#define _UAPI_LINUX_IN6_H 22#define _UAPI_LINUX_IN6_H
23 23
24#include <linux/types.h> 24#include <linux/types.h>
25#include <linux/libc-compat.h>
25 26
26/* 27/*
27 * IPv6 address structure 28 * IPv6 address structure
28 */ 29 */
29 30
31#if __UAPI_DEF_IN6_ADDR
30struct in6_addr { 32struct in6_addr {
31 union { 33 union {
32 __u8 u6_addr8[16]; 34 __u8 u6_addr8[16];
35#if __UAPI_DEF_IN6_ADDR_ALT
33 __be16 u6_addr16[8]; 36 __be16 u6_addr16[8];
34 __be32 u6_addr32[4]; 37 __be32 u6_addr32[4];
38#endif
35 } in6_u; 39 } in6_u;
36#define s6_addr in6_u.u6_addr8 40#define s6_addr in6_u.u6_addr8
41#if __UAPI_DEF_IN6_ADDR_ALT
37#define s6_addr16 in6_u.u6_addr16 42#define s6_addr16 in6_u.u6_addr16
38#define s6_addr32 in6_u.u6_addr32 43#define s6_addr32 in6_u.u6_addr32
44#endif
39}; 45};
46#endif /* __UAPI_DEF_IN6_ADDR */
40 47
48#if __UAPI_DEF_SOCKADDR_IN6
41struct sockaddr_in6 { 49struct sockaddr_in6 {
42 unsigned short int sin6_family; /* AF_INET6 */ 50 unsigned short int sin6_family; /* AF_INET6 */
43 __be16 sin6_port; /* Transport layer port # */ 51 __be16 sin6_port; /* Transport layer port # */
@@ -45,7 +53,9 @@ struct sockaddr_in6 {
45 struct in6_addr sin6_addr; /* IPv6 address */ 53 struct in6_addr sin6_addr; /* IPv6 address */
46 __u32 sin6_scope_id; /* scope id (new in RFC2553) */ 54 __u32 sin6_scope_id; /* scope id (new in RFC2553) */
47}; 55};
56#endif /* __UAPI_DEF_SOCKADDR_IN6 */
48 57
58#if __UAPI_DEF_IPV6_MREQ
49struct ipv6_mreq { 59struct ipv6_mreq {
50 /* IPv6 multicast address of group */ 60 /* IPv6 multicast address of group */
51 struct in6_addr ipv6mr_multiaddr; 61 struct in6_addr ipv6mr_multiaddr;
@@ -53,6 +63,7 @@ struct ipv6_mreq {
53 /* local IPv6 address of interface */ 63 /* local IPv6 address of interface */
54 int ipv6mr_ifindex; 64 int ipv6mr_ifindex;
55}; 65};
66#endif /* __UAPI_DEF_IVP6_MREQ */
56 67
57#define ipv6mr_acaddr ipv6mr_multiaddr 68#define ipv6mr_acaddr ipv6mr_multiaddr
58 69
@@ -114,13 +125,24 @@ struct in6_flowlabel_req {
114/* 125/*
115 * IPV6 extension headers 126 * IPV6 extension headers
116 */ 127 */
117#define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */ 128#if __UAPI_DEF_IPPROTO_V6
118#define IPPROTO_ROUTING 43 /* IPv6 routing header */ 129enum {
119#define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */ 130 IPPROTO_HOPOPTS = 0, /* IPv6 hop-by-hop options */
120#define IPPROTO_ICMPV6 58 /* ICMPv6 */ 131#define IPPROTO_HOPOPTS IPPROTO_HOPOPTS
121#define IPPROTO_NONE 59 /* IPv6 no next header */ 132 IPPROTO_ROUTING = 43, /* IPv6 routing header */
122#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */ 133#define IPPROTO_ROUTING IPPROTO_ROUTING
123#define IPPROTO_MH 135 /* IPv6 mobility header */ 134 IPPROTO_FRAGMENT = 44, /* IPv6 fragmentation header */
135#define IPPROTO_FRAGMENT IPPROTO_FRAGMENT
136 IPPROTO_ICMPV6 = 58, /* ICMPv6 */
137#define IPPROTO_ICMPV6 IPPROTO_ICMPV6
138 IPPROTO_NONE = 59, /* IPv6 no next header */
139#define IPPROTO_NONE IPPROTO_NONE
140 IPPROTO_DSTOPTS = 60, /* IPv6 destination options */
141#define IPPROTO_DSTOPTS IPPROTO_DSTOPTS
142 IPPROTO_MH = 135, /* IPv6 mobility header */
143#define IPPROTO_MH IPPROTO_MH
144};
145#endif /* __UAPI_DEF_IPPROTO_V6 */
124 146
125/* 147/*
126 * IPv6 TLV options. 148 * IPv6 TLV options.
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
index d584047b072b..76457eef172a 100644
--- a/include/uapi/linux/input.h
+++ b/include/uapi/linux/input.h
@@ -716,6 +716,14 @@ struct input_keymap_entry {
716#define BTN_DPAD_LEFT 0x222 716#define BTN_DPAD_LEFT 0x222
717#define BTN_DPAD_RIGHT 0x223 717#define BTN_DPAD_RIGHT 0x223
718 718
719#define BTN_FRET_FAR_UP 0x224
720#define BTN_FRET_UP 0x225
721#define BTN_FRET_MID 0x226
722#define BTN_FRET_LOW 0x227
723#define BTN_FRET_FAR_LOW 0x228
724#define BTN_STRUM_BAR_UP 0x229
725#define BTN_STRUM_BAR_DOWN 0x22a
726
719#define BTN_TRIGGER_HAPPY 0x2c0 727#define BTN_TRIGGER_HAPPY 0x2c0
720#define BTN_TRIGGER_HAPPY1 0x2c0 728#define BTN_TRIGGER_HAPPY1 0x2c0
721#define BTN_TRIGGER_HAPPY2 0x2c1 729#define BTN_TRIGGER_HAPPY2 0x2c1
@@ -829,8 +837,21 @@ struct input_keymap_entry {
829#define ABS_MT_TOOL_X 0x3c /* Center X tool position */ 837#define ABS_MT_TOOL_X 0x3c /* Center X tool position */
830#define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */ 838#define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */
831 839
832 840/* Drums and guitars (mostly toys) */
833#define ABS_MAX 0x3f 841#define ABS_TOM_FAR_LEFT 0x40
842#define ABS_TOM_LEFT 0x41
843#define ABS_TOM_RIGHT 0x42
844#define ABS_TOM_FAR_RIGHT 0x43
845#define ABS_CYMBAL_FAR_LEFT 0x44
846#define ABS_CYMBAL_LEFT 0x45
847#define ABS_CYMBAL_RIGHT 0x46
848#define ABS_CYMBAL_FAR_RIGHT 0x47
849#define ABS_BASS 0x48
850#define ABS_HI_HAT 0x49
851#define ABS_FRET_BOARD 0x4a /* Guitar fret board, vertical pos */
852#define ABS_WHAMMY_BAR 0x4b /* Guitar whammy bar (or vibrato) */
853
854#define ABS_MAX 0x4f
834#define ABS_CNT (ABS_MAX+1) 855#define ABS_CNT (ABS_MAX+1)
835 856
836/* 857/*
diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h
index 6cf06bfd841b..411959405ab6 100644
--- a/include/uapi/linux/ip.h
+++ b/include/uapi/linux/ip.h
@@ -133,4 +133,40 @@ struct ip_beet_phdr {
133 __u8 reserved; 133 __u8 reserved;
134}; 134};
135 135
136/* index values for the variables in ipv4_devconf */
137enum
138{
139 IPV4_DEVCONF_FORWARDING=1,
140 IPV4_DEVCONF_MC_FORWARDING,
141 IPV4_DEVCONF_PROXY_ARP,
142 IPV4_DEVCONF_ACCEPT_REDIRECTS,
143 IPV4_DEVCONF_SECURE_REDIRECTS,
144 IPV4_DEVCONF_SEND_REDIRECTS,
145 IPV4_DEVCONF_SHARED_MEDIA,
146 IPV4_DEVCONF_RP_FILTER,
147 IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE,
148 IPV4_DEVCONF_BOOTP_RELAY,
149 IPV4_DEVCONF_LOG_MARTIANS,
150 IPV4_DEVCONF_TAG,
151 IPV4_DEVCONF_ARPFILTER,
152 IPV4_DEVCONF_MEDIUM_ID,
153 IPV4_DEVCONF_NOXFRM,
154 IPV4_DEVCONF_NOPOLICY,
155 IPV4_DEVCONF_FORCE_IGMP_VERSION,
156 IPV4_DEVCONF_ARP_ANNOUNCE,
157 IPV4_DEVCONF_ARP_IGNORE,
158 IPV4_DEVCONF_PROMOTE_SECONDARIES,
159 IPV4_DEVCONF_ARP_ACCEPT,
160 IPV4_DEVCONF_ARP_NOTIFY,
161 IPV4_DEVCONF_ACCEPT_LOCAL,
162 IPV4_DEVCONF_SRC_VMARK,
163 IPV4_DEVCONF_PROXY_ARP_PVLAN,
164 IPV4_DEVCONF_ROUTE_LOCALNET,
165 IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL,
166 IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL,
167 __IPV4_DEVCONF_MAX
168};
169
170#define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1)
171
136#endif /* _UAPI_LINUX_IP_H */ 172#endif /* _UAPI_LINUX_IP_H */
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index 4bda4cf5b0f5..593b0e32d956 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -160,6 +160,9 @@ enum {
160 DEVCONF_ACCEPT_DAD, 160 DEVCONF_ACCEPT_DAD,
161 DEVCONF_FORCE_TLLAO, 161 DEVCONF_FORCE_TLLAO,
162 DEVCONF_NDISC_NOTIFY, 162 DEVCONF_NDISC_NOTIFY,
163 DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL,
164 DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL,
165 DEVCONF_SUPPRESS_FRAG_NDISC,
163 DEVCONF_MAX 166 DEVCONF_MAX
164}; 167};
165 168
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index acccd08be6c7..99c25338ede8 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -667,6 +667,7 @@ struct kvm_ppc_smmu_info {
667#define KVM_CAP_PPC_RTAS 91 667#define KVM_CAP_PPC_RTAS 91
668#define KVM_CAP_IRQ_XICS 92 668#define KVM_CAP_IRQ_XICS 92
669#define KVM_CAP_ARM_EL1_32BIT 93 669#define KVM_CAP_ARM_EL1_32BIT 93
670#define KVM_CAP_SPAPR_MULTITCE 94
670 671
671#ifdef KVM_CAP_IRQ_ROUTING 672#ifdef KVM_CAP_IRQ_ROUTING
672 673
diff --git a/include/uapi/linux/kvm_para.h b/include/uapi/linux/kvm_para.h
index cea2c5c72d26..2841f86eae0b 100644
--- a/include/uapi/linux/kvm_para.h
+++ b/include/uapi/linux/kvm_para.h
@@ -19,6 +19,7 @@
19#define KVM_HC_MMU_OP 2 19#define KVM_HC_MMU_OP 2
20#define KVM_HC_FEATURES 3 20#define KVM_HC_FEATURES 3
21#define KVM_HC_PPC_MAP_MAGIC_PAGE 4 21#define KVM_HC_PPC_MAP_MAGIC_PAGE 4
22#define KVM_HC_KICK_CPU 5
22 23
23/* 24/*
24 * hypercalls use architecture specific 25 * hypercalls use architecture specific
diff --git a/include/uapi/linux/libc-compat.h b/include/uapi/linux/libc-compat.h
new file mode 100644
index 000000000000..335e8a7cad39
--- /dev/null
+++ b/include/uapi/linux/libc-compat.h
@@ -0,0 +1,103 @@
1/*
2 * Compatibility interface for userspace libc header coordination:
3 *
4 * Define compatibility macros that are used to control the inclusion or
5 * exclusion of UAPI structures and definitions in coordination with another
6 * userspace C library.
7 *
8 * This header is intended to solve the problem of UAPI definitions that
9 * conflict with userspace definitions. If a UAPI header has such conflicting
10 * definitions then the solution is as follows:
11 *
12 * * Synchronize the UAPI header and the libc headers so either one can be
13 * used and such that the ABI is preserved. If this is not possible then
14 * no simple compatibility interface exists (you need to write translating
15 * wrappers and rename things) and you can't use this interface.
16 *
17 * Then follow this process:
18 *
19 * (a) Include libc-compat.h in the UAPI header.
20 * e.g. #include <linux/libc-compat.h>
21 * This include must be as early as possible.
22 *
23 * (b) In libc-compat.h add enough code to detect that the comflicting
24 * userspace libc header has been included first.
25 *
26 * (c) If the userspace libc header has been included first define a set of
27 * guard macros of the form __UAPI_DEF_FOO and set their values to 1, else
28 * set their values to 0.
29 *
30 * (d) Back in the UAPI header with the conflicting definitions, guard the
31 * definitions with:
32 * #if __UAPI_DEF_FOO
33 * ...
34 * #endif
35 *
36 * This fixes the situation where the linux headers are included *after* the
37 * libc headers. To fix the problem with the inclusion in the other order the
38 * userspace libc headers must be fixed like this:
39 *
40 * * For all definitions that conflict with kernel definitions wrap those
41 * defines in the following:
42 * #if !__UAPI_DEF_FOO
43 * ...
44 * #endif
45 *
46 * This prevents the redefinition of a construct already defined by the kernel.
47 */
48#ifndef _UAPI_LIBC_COMPAT_H
49#define _UAPI_LIBC_COMPAT_H
50
51/* We have included glibc headers... */
52#if defined(__GLIBC__)
53
54/* Coordinate with glibc netinet/in.h header. */
55#if defined(_NETINET_IN_H)
56
57/* GLIBC headers included first so don't define anything
58 * that would already be defined. */
59#define __UAPI_DEF_IN6_ADDR 0
60/* The exception is the in6_addr macros which must be defined
61 * if the glibc code didn't define them. This guard matches
62 * the guard in glibc/inet/netinet/in.h which defines the
63 * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */
64#if defined(__USE_MISC) || defined (__USE_GNU)
65#define __UAPI_DEF_IN6_ADDR_ALT 0
66#else
67#define __UAPI_DEF_IN6_ADDR_ALT 1
68#endif
69#define __UAPI_DEF_SOCKADDR_IN6 0
70#define __UAPI_DEF_IPV6_MREQ 0
71#define __UAPI_DEF_IPPROTO_V6 0
72
73#else
74
75/* Linux headers included first, and we must define everything
76 * we need. The expectation is that glibc will check the
77 * __UAPI_DEF_* defines and adjust appropriately. */
78#define __UAPI_DEF_IN6_ADDR 1
79/* We unconditionally define the in6_addr macros and glibc must
80 * coordinate. */
81#define __UAPI_DEF_IN6_ADDR_ALT 1
82#define __UAPI_DEF_SOCKADDR_IN6 1
83#define __UAPI_DEF_IPV6_MREQ 1
84#define __UAPI_DEF_IPPROTO_V6 1
85
86#endif /* _NETINET_IN_H */
87
88
89/* If we did not see any headers from any supported C libraries,
90 * or we are being included in the kernel, then define everything
91 * that we need. */
92#else /* !defined(__GLIBC__) */
93
94/* Definitions for in6.h */
95#define __UAPI_DEF_IN6_ADDR 1
96#define __UAPI_DEF_IN6_ADDR_ALT 1
97#define __UAPI_DEF_SOCKADDR_IN6 1
98#define __UAPI_DEF_IPV6_MREQ 1
99#define __UAPI_DEF_IPPROTO_V6 1
100
101#endif /* __GLIBC__ */
102
103#endif /* _UAPI_LIBC_COMPAT_H */
diff --git a/include/uapi/linux/netfilter/Kbuild b/include/uapi/linux/netfilter/Kbuild
index 41115776d76f..174915420d3f 100644
--- a/include/uapi/linux/netfilter/Kbuild
+++ b/include/uapi/linux/netfilter/Kbuild
@@ -22,6 +22,7 @@ header-y += xt_CONNMARK.h
22header-y += xt_CONNSECMARK.h 22header-y += xt_CONNSECMARK.h
23header-y += xt_CT.h 23header-y += xt_CT.h
24header-y += xt_DSCP.h 24header-y += xt_DSCP.h
25header-y += xt_HMARK.h
25header-y += xt_IDLETIMER.h 26header-y += xt_IDLETIMER.h
26header-y += xt_LED.h 27header-y += xt_LED.h
27header-y += xt_LOG.h 28header-y += xt_LOG.h
@@ -68,6 +69,7 @@ header-y += xt_quota.h
68header-y += xt_rateest.h 69header-y += xt_rateest.h
69header-y += xt_realm.h 70header-y += xt_realm.h
70header-y += xt_recent.h 71header-y += xt_recent.h
72header-y += xt_rpfilter.h
71header-y += xt_sctp.h 73header-y += xt_sctp.h
72header-y += xt_set.h 74header-y += xt_set.h
73header-y += xt_socket.h 75header-y += xt_socket.h
diff --git a/include/uapi/linux/netfilter/nf_conntrack_common.h b/include/uapi/linux/netfilter/nf_conntrack_common.h
index d69483fb3825..8dd803818ebe 100644
--- a/include/uapi/linux/netfilter/nf_conntrack_common.h
+++ b/include/uapi/linux/netfilter/nf_conntrack_common.h
@@ -99,7 +99,8 @@ enum ip_conntrack_events {
99 IPCT_PROTOINFO, /* protocol information has changed */ 99 IPCT_PROTOINFO, /* protocol information has changed */
100 IPCT_HELPER, /* new helper has been set */ 100 IPCT_HELPER, /* new helper has been set */
101 IPCT_MARK, /* new mark has been set */ 101 IPCT_MARK, /* new mark has been set */
102 IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */ 102 IPCT_SEQADJ, /* sequence adjustment has changed */
103 IPCT_NATSEQADJ = IPCT_SEQADJ,
103 IPCT_SECMARK, /* new security mark has been set */ 104 IPCT_SECMARK, /* new security mark has been set */
104 IPCT_LABEL, /* new connlabel has been set */ 105 IPCT_LABEL, /* new connlabel has been set */
105}; 106};
diff --git a/include/uapi/linux/netfilter/nfnetlink_conntrack.h b/include/uapi/linux/netfilter/nfnetlink_conntrack.h
index 08fabc6c93f3..acad6c52a652 100644
--- a/include/uapi/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/uapi/linux/netfilter/nfnetlink_conntrack.h
@@ -42,8 +42,10 @@ enum ctattr_type {
42 CTA_ID, 42 CTA_ID,
43 CTA_NAT_DST, 43 CTA_NAT_DST,
44 CTA_TUPLE_MASTER, 44 CTA_TUPLE_MASTER,
45 CTA_NAT_SEQ_ADJ_ORIG, 45 CTA_SEQ_ADJ_ORIG,
46 CTA_NAT_SEQ_ADJ_REPLY, 46 CTA_NAT_SEQ_ADJ_ORIG = CTA_SEQ_ADJ_ORIG,
47 CTA_SEQ_ADJ_REPLY,
48 CTA_NAT_SEQ_ADJ_REPLY = CTA_SEQ_ADJ_REPLY,
47 CTA_SECMARK, /* obsolete */ 49 CTA_SECMARK, /* obsolete */
48 CTA_ZONE, 50 CTA_ZONE,
49 CTA_SECCTX, 51 CTA_SECCTX,
@@ -165,6 +167,15 @@ enum ctattr_protonat {
165}; 167};
166#define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1) 168#define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1)
167 169
170enum ctattr_seqadj {
171 CTA_SEQADJ_UNSPEC,
172 CTA_SEQADJ_CORRECTION_POS,
173 CTA_SEQADJ_OFFSET_BEFORE,
174 CTA_SEQADJ_OFFSET_AFTER,
175 __CTA_SEQADJ_MAX
176};
177#define CTA_SEQADJ_MAX (__CTA_SEQADJ_MAX - 1)
178
168enum ctattr_natseq { 179enum ctattr_natseq {
169 CTA_NAT_SEQ_UNSPEC, 180 CTA_NAT_SEQ_UNSPEC,
170 CTA_NAT_SEQ_CORRECTION_POS, 181 CTA_NAT_SEQ_CORRECTION_POS,
diff --git a/include/uapi/linux/netfilter/nfnetlink_queue.h b/include/uapi/linux/netfilter/nfnetlink_queue.h
index 3a9b92147339..0132bad79de7 100644
--- a/include/uapi/linux/netfilter/nfnetlink_queue.h
+++ b/include/uapi/linux/netfilter/nfnetlink_queue.h
@@ -46,6 +46,7 @@ enum nfqnl_attr_type {
46 NFQA_CT_INFO, /* enum ip_conntrack_info */ 46 NFQA_CT_INFO, /* enum ip_conntrack_info */
47 NFQA_CAP_LEN, /* __u32 length of captured packet */ 47 NFQA_CAP_LEN, /* __u32 length of captured packet */
48 NFQA_SKB_INFO, /* __u32 skb meta information */ 48 NFQA_SKB_INFO, /* __u32 skb meta information */
49 NFQA_EXP, /* nf_conntrack_netlink.h */
49 50
50 __NFQA_MAX 51 __NFQA_MAX
51}; 52};
diff --git a/include/linux/netfilter/xt_HMARK.h b/include/uapi/linux/netfilter/xt_HMARK.h
index 826fc5807577..826fc5807577 100644
--- a/include/linux/netfilter/xt_HMARK.h
+++ b/include/uapi/linux/netfilter/xt_HMARK.h
diff --git a/include/uapi/linux/netfilter/xt_SYNPROXY.h b/include/uapi/linux/netfilter/xt_SYNPROXY.h
new file mode 100644
index 000000000000..2d59fbaa93c6
--- /dev/null
+++ b/include/uapi/linux/netfilter/xt_SYNPROXY.h
@@ -0,0 +1,16 @@
1#ifndef _XT_SYNPROXY_H
2#define _XT_SYNPROXY_H
3
4#define XT_SYNPROXY_OPT_MSS 0x01
5#define XT_SYNPROXY_OPT_WSCALE 0x02
6#define XT_SYNPROXY_OPT_SACK_PERM 0x04
7#define XT_SYNPROXY_OPT_TIMESTAMP 0x08
8#define XT_SYNPROXY_OPT_ECN 0x10
9
10struct xt_synproxy_info {
11 __u8 options;
12 __u8 wscale;
13 __u16 mss;
14};
15
16#endif /* _XT_SYNPROXY_H */
diff --git a/include/linux/netfilter/xt_rpfilter.h b/include/uapi/linux/netfilter/xt_rpfilter.h
index 8358d4f71952..8358d4f71952 100644
--- a/include/linux/netfilter/xt_rpfilter.h
+++ b/include/uapi/linux/netfilter/xt_rpfilter.h
diff --git a/include/uapi/linux/netfilter_bridge/ebt_802_3.h b/include/uapi/linux/netfilter_bridge/ebt_802_3.h
index 5bf84912a082..f37522aade24 100644
--- a/include/uapi/linux/netfilter_bridge/ebt_802_3.h
+++ b/include/uapi/linux/netfilter_bridge/ebt_802_3.h
@@ -2,6 +2,7 @@
2#define _UAPI__LINUX_BRIDGE_EBT_802_3_H 2#define _UAPI__LINUX_BRIDGE_EBT_802_3_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/if_ether.h>
5 6
6#define EBT_802_3_SAP 0x01 7#define EBT_802_3_SAP 0x01
7#define EBT_802_3_TYPE 0x02 8#define EBT_802_3_TYPE 0x02
@@ -42,8 +43,8 @@ struct hdr_ni {
42}; 43};
43 44
44struct ebt_802_3_hdr { 45struct ebt_802_3_hdr {
45 __u8 daddr[6]; 46 __u8 daddr[ETH_ALEN];
46 __u8 saddr[6]; 47 __u8 saddr[ETH_ALEN];
47 __be16 len; 48 __be16 len;
48 union { 49 union {
49 struct hdr_ui ui; 50 struct hdr_ui ui;
diff --git a/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h b/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h
index c6a204c97047..eac0f6548f47 100644
--- a/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h
+++ b/include/uapi/linux/netfilter_ipv4/ipt_CLUSTERIP.h
@@ -2,6 +2,7 @@
2#define _IPT_CLUSTERIP_H_target 2#define _IPT_CLUSTERIP_H_target
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/if_ether.h>
5 6
6enum clusterip_hashmode { 7enum clusterip_hashmode {
7 CLUSTERIP_HASHMODE_SIP = 0, 8 CLUSTERIP_HASHMODE_SIP = 0,
@@ -22,7 +23,7 @@ struct ipt_clusterip_tgt_info {
22 __u32 flags; 23 __u32 flags;
23 24
24 /* only relevant for new ones */ 25 /* only relevant for new ones */
25 __u8 clustermac[6]; 26 __u8 clustermac[ETH_ALEN];
26 __u16 num_total_nodes; 27 __u16 num_total_nodes;
27 __u16 num_local_nodes; 28 __u16 num_local_nodes;
28 __u16 local_nodes[CLUSTERIP_MAX_NODES]; 29 __u16 local_nodes[CLUSTERIP_MAX_NODES];
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index 8137dd8d2adf..29bed72a4ac4 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -71,6 +71,20 @@
71 * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element. 71 * @NFC_CMD_DISABLE_SE: Disable the physical link to a specific secure element.
72 * @NFC_CMD_FW_DOWNLOAD: Request to Load/flash firmware, or event to inform 72 * @NFC_CMD_FW_DOWNLOAD: Request to Load/flash firmware, or event to inform
73 * that some firmware was loaded 73 * that some firmware was loaded
74 * @NFC_EVENT_SE_ADDED: Event emitted when a new secure element is discovered.
75 * This typically will be sent whenever a new NFC controller with either
76 * an embedded SE or an UICC one connected to it through SWP.
77 * @NFC_EVENT_SE_REMOVED: Event emitted when a secure element is removed from
78 * the system, as a consequence of e.g. an NFC controller being unplugged.
79 * @NFC_EVENT_SE_CONNECTIVITY: This event is emitted whenever a secure element
80 * is requesting connectivity access. For example a UICC SE may need to
81 * talk with a sleeping modem and will notify this need by sending this
82 * event. It is then up to userspace to decide if it will wake the modem
83 * up or not.
84 * @NFC_EVENT_SE_TRANSACTION: This event is sent when an application running on
85 * a specific SE notifies us about the end of a transaction. The parameter
86 * for this event is the application ID (AID).
87 * @NFC_CMD_GET_SE: Dump all discovered secure elements from an NFC controller.
74 */ 88 */
75enum nfc_commands { 89enum nfc_commands {
76 NFC_CMD_UNSPEC, 90 NFC_CMD_UNSPEC,
@@ -97,6 +111,9 @@ enum nfc_commands {
97 NFC_CMD_FW_DOWNLOAD, 111 NFC_CMD_FW_DOWNLOAD,
98 NFC_EVENT_SE_ADDED, 112 NFC_EVENT_SE_ADDED,
99 NFC_EVENT_SE_REMOVED, 113 NFC_EVENT_SE_REMOVED,
114 NFC_EVENT_SE_CONNECTIVITY,
115 NFC_EVENT_SE_TRANSACTION,
116 NFC_CMD_GET_SE,
100/* private: internal use only */ 117/* private: internal use only */
101 __NFC_CMD_AFTER_LAST 118 __NFC_CMD_AFTER_LAST
102}; 119};
@@ -129,6 +146,7 @@ enum nfc_commands {
129 * @NFC_ATTR_FIRMWARE_NAME: Free format firmware version 146 * @NFC_ATTR_FIRMWARE_NAME: Free format firmware version
130 * @NFC_ATTR_SE_INDEX: Secure element index 147 * @NFC_ATTR_SE_INDEX: Secure element index
131 * @NFC_ATTR_SE_TYPE: Secure element type (UICC or EMBEDDED) 148 * @NFC_ATTR_SE_TYPE: Secure element type (UICC or EMBEDDED)
149 * @NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS: Firmware download operation status
132 */ 150 */
133enum nfc_attrs { 151enum nfc_attrs {
134 NFC_ATTR_UNSPEC, 152 NFC_ATTR_UNSPEC,
@@ -154,6 +172,8 @@ enum nfc_attrs {
154 NFC_ATTR_FIRMWARE_NAME, 172 NFC_ATTR_FIRMWARE_NAME,
155 NFC_ATTR_SE_INDEX, 173 NFC_ATTR_SE_INDEX,
156 NFC_ATTR_SE_TYPE, 174 NFC_ATTR_SE_TYPE,
175 NFC_ATTR_SE_AID,
176 NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS,
157/* private: internal use only */ 177/* private: internal use only */
158 __NFC_ATTR_AFTER_LAST 178 __NFC_ATTR_AFTER_LAST
159}; 179};
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 861e5eba3953..fde2c021b26d 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -126,6 +126,31 @@
126 */ 126 */
127 127
128/** 128/**
129 * DOC: packet coalesce support
130 *
131 * In most cases, host that receives IPv4 and IPv6 multicast/broadcast
132 * packets does not do anything with these packets. Therefore the
133 * reception of these unwanted packets causes unnecessary processing
134 * and power consumption.
135 *
136 * Packet coalesce feature helps to reduce number of received interrupts
137 * to host by buffering these packets in firmware/hardware for some
138 * predefined time. Received interrupt will be generated when one of the
139 * following events occur.
140 * a) Expiration of hardware timer whose expiration time is set to maximum
141 * coalescing delay of matching coalesce rule.
142 * b) Coalescing buffer in hardware reaches it's limit.
143 * c) Packet doesn't match any of the configured coalesce rules.
144 *
145 * User needs to configure following parameters for creating a coalesce
146 * rule.
147 * a) Maximum coalescing delay
148 * b) List of packet patterns which needs to be matched
149 * c) Condition for coalescence. pattern 'match' or 'no match'
150 * Multiple such rules can be created.
151 */
152
153/**
129 * enum nl80211_commands - supported nl80211 commands 154 * enum nl80211_commands - supported nl80211 commands
130 * 155 *
131 * @NL80211_CMD_UNSPEC: unspecified command to catch errors 156 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
@@ -648,6 +673,19 @@
648 * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can 673 * @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can
649 * return back to normal. 674 * return back to normal.
650 * 675 *
676 * @NL80211_CMD_GET_COALESCE: Get currently supported coalesce rules.
677 * @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules.
678 *
679 * @NL80211_CMD_CHANNEL_SWITCH: Perform a channel switch by announcing the
680 * the new channel information (Channel Switch Announcement - CSA)
681 * in the beacon for some time (as defined in the
682 * %NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the
683 * new channel. Userspace provides the new channel information (using
684 * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel
685 * width). %NL80211_ATTR_CH_SWITCH_BLOCK_TX may be supplied to inform
686 * other station that transmission must be blocked until the channel
687 * switch is complete.
688 *
651 * @NL80211_CMD_MAX: highest used command number 689 * @NL80211_CMD_MAX: highest used command number
652 * @__NL80211_CMD_AFTER_LAST: internal use 690 * @__NL80211_CMD_AFTER_LAST: internal use
653 */ 691 */
@@ -810,6 +848,11 @@ enum nl80211_commands {
810 NL80211_CMD_CRIT_PROTOCOL_START, 848 NL80211_CMD_CRIT_PROTOCOL_START,
811 NL80211_CMD_CRIT_PROTOCOL_STOP, 849 NL80211_CMD_CRIT_PROTOCOL_STOP,
812 850
851 NL80211_CMD_GET_COALESCE,
852 NL80211_CMD_SET_COALESCE,
853
854 NL80211_CMD_CHANNEL_SWITCH,
855
813 /* add new commands above here */ 856 /* add new commands above here */
814 857
815 /* used to define NL80211_CMD_MAX below */ 858 /* used to define NL80211_CMD_MAX below */
@@ -1436,6 +1479,23 @@ enum nl80211_commands {
1436 * allowed to be used with the first @NL80211_CMD_SET_STATION command to 1479 * allowed to be used with the first @NL80211_CMD_SET_STATION command to
1437 * update a TDLS peer STA entry. 1480 * update a TDLS peer STA entry.
1438 * 1481 *
1482 * @NL80211_ATTR_COALESCE_RULE: Coalesce rule information.
1483 *
1484 * @NL80211_ATTR_CH_SWITCH_COUNT: u32 attribute specifying the number of TBTT's
1485 * until the channel switch event.
1486 * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission
1487 * must be blocked on the current channel (before the channel switch
1488 * operation).
1489 * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information
1490 * for the time while performing a channel switch.
1491 * @NL80211_ATTR_CSA_C_OFF_BEACON: Offset of the channel switch counter
1492 * field in the beacons tail (%NL80211_ATTR_BEACON_TAIL).
1493 * @NL80211_ATTR_CSA_C_OFF_PRESP: Offset of the channel switch counter
1494 * field in the probe response (%NL80211_ATTR_PROBE_RESP).
1495 *
1496 * @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
1497 * As specified in the &enum nl80211_rxmgmt_flags.
1498 *
1439 * @NL80211_ATTR_MAX: highest attribute number currently defined 1499 * @NL80211_ATTR_MAX: highest attribute number currently defined
1440 * @__NL80211_ATTR_AFTER_LAST: internal use 1500 * @__NL80211_ATTR_AFTER_LAST: internal use
1441 */ 1501 */
@@ -1736,6 +1796,16 @@ enum nl80211_attrs {
1736 1796
1737 NL80211_ATTR_PEER_AID, 1797 NL80211_ATTR_PEER_AID,
1738 1798
1799 NL80211_ATTR_COALESCE_RULE,
1800
1801 NL80211_ATTR_CH_SWITCH_COUNT,
1802 NL80211_ATTR_CH_SWITCH_BLOCK_TX,
1803 NL80211_ATTR_CSA_IES,
1804 NL80211_ATTR_CSA_C_OFF_BEACON,
1805 NL80211_ATTR_CSA_C_OFF_PRESP,
1806
1807 NL80211_ATTR_RXMGMT_FLAGS,
1808
1739 /* add attributes here, update the policy in nl80211.c */ 1809 /* add attributes here, update the policy in nl80211.c */
1740 1810
1741 __NL80211_ATTR_AFTER_LAST, 1811 __NL80211_ATTR_AFTER_LAST,
@@ -2773,6 +2843,21 @@ enum nl80211_chan_width {
2773}; 2843};
2774 2844
2775/** 2845/**
2846 * enum nl80211_bss_scan_width - control channel width for a BSS
2847 *
2848 * These values are used with the %NL80211_BSS_CHAN_WIDTH attribute.
2849 *
2850 * @NL80211_BSS_CHAN_WIDTH_20: control channel is 20 MHz wide or compatible
2851 * @NL80211_BSS_CHAN_WIDTH_10: control channel is 10 MHz wide
2852 * @NL80211_BSS_CHAN_WIDTH_5: control channel is 5 MHz wide
2853 */
2854enum nl80211_bss_scan_width {
2855 NL80211_BSS_CHAN_WIDTH_20,
2856 NL80211_BSS_CHAN_WIDTH_10,
2857 NL80211_BSS_CHAN_WIDTH_5,
2858};
2859
2860/**
2776 * enum nl80211_bss - netlink attributes for a BSS 2861 * enum nl80211_bss - netlink attributes for a BSS
2777 * 2862 *
2778 * @__NL80211_BSS_INVALID: invalid 2863 * @__NL80211_BSS_INVALID: invalid
@@ -2796,6 +2881,8 @@ enum nl80211_chan_width {
2796 * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information 2881 * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information
2797 * elements from a Beacon frame (bin); not present if no Beacon frame has 2882 * elements from a Beacon frame (bin); not present if no Beacon frame has
2798 * yet been received 2883 * yet been received
2884 * @NL80211_BSS_CHAN_WIDTH: channel width of the control channel
2885 * (u32, enum nl80211_bss_scan_width)
2799 * @__NL80211_BSS_AFTER_LAST: internal 2886 * @__NL80211_BSS_AFTER_LAST: internal
2800 * @NL80211_BSS_MAX: highest BSS attribute 2887 * @NL80211_BSS_MAX: highest BSS attribute
2801 */ 2888 */
@@ -2812,6 +2899,7 @@ enum nl80211_bss {
2812 NL80211_BSS_STATUS, 2899 NL80211_BSS_STATUS,
2813 NL80211_BSS_SEEN_MS_AGO, 2900 NL80211_BSS_SEEN_MS_AGO,
2814 NL80211_BSS_BEACON_IES, 2901 NL80211_BSS_BEACON_IES,
2902 NL80211_BSS_CHAN_WIDTH,
2815 2903
2816 /* keep last */ 2904 /* keep last */
2817 __NL80211_BSS_AFTER_LAST, 2905 __NL80211_BSS_AFTER_LAST,
@@ -3060,11 +3148,11 @@ enum nl80211_tx_power_setting {
3060}; 3148};
3061 3149
3062/** 3150/**
3063 * enum nl80211_wowlan_packet_pattern_attr - WoWLAN packet pattern attribute 3151 * enum nl80211_packet_pattern_attr - packet pattern attribute
3064 * @__NL80211_WOWLAN_PKTPAT_INVALID: invalid number for nested attribute 3152 * @__NL80211_PKTPAT_INVALID: invalid number for nested attribute
3065 * @NL80211_WOWLAN_PKTPAT_PATTERN: the pattern, values where the mask has 3153 * @NL80211_PKTPAT_PATTERN: the pattern, values where the mask has
3066 * a zero bit are ignored 3154 * a zero bit are ignored
3067 * @NL80211_WOWLAN_PKTPAT_MASK: pattern mask, must be long enough to have 3155 * @NL80211_PKTPAT_MASK: pattern mask, must be long enough to have
3068 * a bit for each byte in the pattern. The lowest-order bit corresponds 3156 * a bit for each byte in the pattern. The lowest-order bit corresponds
3069 * to the first byte of the pattern, but the bytes of the pattern are 3157 * to the first byte of the pattern, but the bytes of the pattern are
3070 * in a little-endian-like format, i.e. the 9th byte of the pattern 3158 * in a little-endian-like format, i.e. the 9th byte of the pattern
@@ -3075,39 +3163,50 @@ enum nl80211_tx_power_setting {
3075 * Note that the pattern matching is done as though frames were not 3163 * Note that the pattern matching is done as though frames were not
3076 * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked 3164 * 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
3077 * first (including SNAP header unpacking) and then matched. 3165 * first (including SNAP header unpacking) and then matched.
3078 * @NL80211_WOWLAN_PKTPAT_OFFSET: packet offset, pattern is matched after 3166 * @NL80211_PKTPAT_OFFSET: packet offset, pattern is matched after
3079 * these fixed number of bytes of received packet 3167 * these fixed number of bytes of received packet
3080 * @NUM_NL80211_WOWLAN_PKTPAT: number of attributes 3168 * @NUM_NL80211_PKTPAT: number of attributes
3081 * @MAX_NL80211_WOWLAN_PKTPAT: max attribute number 3169 * @MAX_NL80211_PKTPAT: max attribute number
3082 */ 3170 */
3083enum nl80211_wowlan_packet_pattern_attr { 3171enum nl80211_packet_pattern_attr {
3084 __NL80211_WOWLAN_PKTPAT_INVALID, 3172 __NL80211_PKTPAT_INVALID,
3085 NL80211_WOWLAN_PKTPAT_MASK, 3173 NL80211_PKTPAT_MASK,
3086 NL80211_WOWLAN_PKTPAT_PATTERN, 3174 NL80211_PKTPAT_PATTERN,
3087 NL80211_WOWLAN_PKTPAT_OFFSET, 3175 NL80211_PKTPAT_OFFSET,
3088 3176
3089 NUM_NL80211_WOWLAN_PKTPAT, 3177 NUM_NL80211_PKTPAT,
3090 MAX_NL80211_WOWLAN_PKTPAT = NUM_NL80211_WOWLAN_PKTPAT - 1, 3178 MAX_NL80211_PKTPAT = NUM_NL80211_PKTPAT - 1,
3091}; 3179};
3092 3180
3093/** 3181/**
3094 * struct nl80211_wowlan_pattern_support - pattern support information 3182 * struct nl80211_pattern_support - packet pattern support information
3095 * @max_patterns: maximum number of patterns supported 3183 * @max_patterns: maximum number of patterns supported
3096 * @min_pattern_len: minimum length of each pattern 3184 * @min_pattern_len: minimum length of each pattern
3097 * @max_pattern_len: maximum length of each pattern 3185 * @max_pattern_len: maximum length of each pattern
3098 * @max_pkt_offset: maximum Rx packet offset 3186 * @max_pkt_offset: maximum Rx packet offset
3099 * 3187 *
3100 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when 3188 * This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
3101 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED in the 3189 * that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED or in
3102 * capability information given by the kernel to userspace. 3190 * %NL80211_ATTR_COALESCE_RULE_PKT_PATTERN when that is part of
3191 * %NL80211_ATTR_COALESCE_RULE in the capability information given
3192 * by the kernel to userspace.
3103 */ 3193 */
3104struct nl80211_wowlan_pattern_support { 3194struct nl80211_pattern_support {
3105 __u32 max_patterns; 3195 __u32 max_patterns;
3106 __u32 min_pattern_len; 3196 __u32 min_pattern_len;
3107 __u32 max_pattern_len; 3197 __u32 max_pattern_len;
3108 __u32 max_pkt_offset; 3198 __u32 max_pkt_offset;
3109} __attribute__((packed)); 3199} __attribute__((packed));
3110 3200
3201/* only for backward compatibility */
3202#define __NL80211_WOWLAN_PKTPAT_INVALID __NL80211_PKTPAT_INVALID
3203#define NL80211_WOWLAN_PKTPAT_MASK NL80211_PKTPAT_MASK
3204#define NL80211_WOWLAN_PKTPAT_PATTERN NL80211_PKTPAT_PATTERN
3205#define NL80211_WOWLAN_PKTPAT_OFFSET NL80211_PKTPAT_OFFSET
3206#define NUM_NL80211_WOWLAN_PKTPAT NUM_NL80211_PKTPAT
3207#define MAX_NL80211_WOWLAN_PKTPAT MAX_NL80211_PKTPAT
3208#define nl80211_wowlan_pattern_support nl80211_pattern_support
3209
3111/** 3210/**
3112 * enum nl80211_wowlan_triggers - WoWLAN trigger definitions 3211 * enum nl80211_wowlan_triggers - WoWLAN trigger definitions
3113 * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes 3212 * @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes
@@ -3127,7 +3226,7 @@ struct nl80211_wowlan_pattern_support {
3127 * pattern matching is done after the packet is converted to the MSDU. 3226 * pattern matching is done after the packet is converted to the MSDU.
3128 * 3227 *
3129 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute 3228 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
3130 * carrying a &struct nl80211_wowlan_pattern_support. 3229 * carrying a &struct nl80211_pattern_support.
3131 * 3230 *
3132 * When reporting wakeup. it is a u32 attribute containing the 0-based 3231 * When reporting wakeup. it is a u32 attribute containing the 0-based
3133 * index of the pattern that caused the wakeup, in the patterns passed 3232 * index of the pattern that caused the wakeup, in the patterns passed
@@ -3284,7 +3383,7 @@ struct nl80211_wowlan_tcp_data_token_feature {
3284 * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a 3383 * @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a
3285 * u32 attribute holding the maximum length 3384 * u32 attribute holding the maximum length
3286 * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for 3385 * @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for
3287 * feature advertising. The mask works like @NL80211_WOWLAN_PKTPAT_MASK 3386 * feature advertising. The mask works like @NL80211_PKTPAT_MASK
3288 * but on the TCP payload only. 3387 * but on the TCP payload only.
3289 * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes 3388 * @NUM_NL80211_WOWLAN_TCP: number of TCP attributes
3290 * @MAX_NL80211_WOWLAN_TCP: highest attribute number 3389 * @MAX_NL80211_WOWLAN_TCP: highest attribute number
@@ -3309,6 +3408,55 @@ enum nl80211_wowlan_tcp_attrs {
3309}; 3408};
3310 3409
3311/** 3410/**
3411 * struct nl80211_coalesce_rule_support - coalesce rule support information
3412 * @max_rules: maximum number of rules supported
3413 * @pat: packet pattern support information
3414 * @max_delay: maximum supported coalescing delay in msecs
3415 *
3416 * This struct is carried in %NL80211_ATTR_COALESCE_RULE in the
3417 * capability information given by the kernel to userspace.
3418 */
3419struct nl80211_coalesce_rule_support {
3420 __u32 max_rules;
3421 struct nl80211_pattern_support pat;
3422 __u32 max_delay;
3423} __attribute__((packed));
3424
3425/**
3426 * enum nl80211_attr_coalesce_rule - coalesce rule attribute
3427 * @__NL80211_COALESCE_RULE_INVALID: invalid number for nested attribute
3428 * @NL80211_ATTR_COALESCE_RULE_DELAY: delay in msecs used for packet coalescing
3429 * @NL80211_ATTR_COALESCE_RULE_CONDITION: condition for packet coalescence,
3430 * see &enum nl80211_coalesce_condition.
3431 * @NL80211_ATTR_COALESCE_RULE_PKT_PATTERN: packet offset, pattern is matched
3432 * after these fixed number of bytes of received packet
3433 * @NUM_NL80211_ATTR_COALESCE_RULE: number of attributes
3434 * @NL80211_ATTR_COALESCE_RULE_MAX: max attribute number
3435 */
3436enum nl80211_attr_coalesce_rule {
3437 __NL80211_COALESCE_RULE_INVALID,
3438 NL80211_ATTR_COALESCE_RULE_DELAY,
3439 NL80211_ATTR_COALESCE_RULE_CONDITION,
3440 NL80211_ATTR_COALESCE_RULE_PKT_PATTERN,
3441
3442 /* keep last */
3443 NUM_NL80211_ATTR_COALESCE_RULE,
3444 NL80211_ATTR_COALESCE_RULE_MAX = NUM_NL80211_ATTR_COALESCE_RULE - 1
3445};
3446
3447/**
3448 * enum nl80211_coalesce_condition - coalesce rule conditions
3449 * @NL80211_COALESCE_CONDITION_MATCH: coalaesce Rx packets when patterns
3450 * in a rule are matched.
3451 * @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns
3452 * in a rule are not matched.
3453 */
3454enum nl80211_coalesce_condition {
3455 NL80211_COALESCE_CONDITION_MATCH,
3456 NL80211_COALESCE_CONDITION_NO_MATCH
3457};
3458
3459/**
3312 * enum nl80211_iface_limit_attrs - limit attributes 3460 * enum nl80211_iface_limit_attrs - limit attributes
3313 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved) 3461 * @NL80211_IFACE_LIMIT_UNSPEC: (reserved)
3314 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that 3462 * @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that
@@ -3758,4 +3906,15 @@ enum nl80211_crit_proto_id {
3758/* maximum duration for critical protocol measures */ 3906/* maximum duration for critical protocol measures */
3759#define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */ 3907#define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */
3760 3908
3909/**
3910 * enum nl80211_rxmgmt_flags - flags for received management frame.
3911 *
3912 * Used by cfg80211_rx_mgmt()
3913 *
3914 * @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver.
3915 */
3916enum nl80211_rxmgmt_flags {
3917 NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
3918};
3919
3761#endif /* __LINUX_NL80211_H */ 3920#endif /* __LINUX_NL80211_H */
diff --git a/include/uapi/linux/openvswitch.h b/include/uapi/linux/openvswitch.h
index c55efaaa9bb4..a74d375b439b 100644
--- a/include/uapi/linux/openvswitch.h
+++ b/include/uapi/linux/openvswitch.h
@@ -1,6 +1,6 @@
1 1
2/* 2/*
3 * Copyright (c) 2007-2011 Nicira Networks. 3 * Copyright (c) 2007-2013 Nicira, Inc.
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU General Public 6 * modify it under the terms of version 2 of the GNU General Public
@@ -165,6 +165,7 @@ enum ovs_vport_type {
165 OVS_VPORT_TYPE_NETDEV, /* network device */ 165 OVS_VPORT_TYPE_NETDEV, /* network device */
166 OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */ 166 OVS_VPORT_TYPE_INTERNAL, /* network device implemented by datapath */
167 OVS_VPORT_TYPE_GRE, /* GRE tunnel. */ 167 OVS_VPORT_TYPE_GRE, /* GRE tunnel. */
168 OVS_VPORT_TYPE_VXLAN, /* VXLAN tunnel. */
168 __OVS_VPORT_TYPE_MAX 169 __OVS_VPORT_TYPE_MAX
169}; 170};
170 171
@@ -211,6 +212,16 @@ enum ovs_vport_attr {
211 212
212#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1) 213#define OVS_VPORT_ATTR_MAX (__OVS_VPORT_ATTR_MAX - 1)
213 214
215/* OVS_VPORT_ATTR_OPTIONS attributes for tunnels.
216 */
217enum {
218 OVS_TUNNEL_ATTR_UNSPEC,
219 OVS_TUNNEL_ATTR_DST_PORT, /* 16-bit UDP port, used by L4 tunnels. */
220 __OVS_TUNNEL_ATTR_MAX
221};
222
223#define OVS_TUNNEL_ATTR_MAX (__OVS_TUNNEL_ATTR_MAX - 1)
224
214/* Flows. */ 225/* Flows. */
215 226
216#define OVS_FLOW_FAMILY "ovs_flow" 227#define OVS_FLOW_FAMILY "ovs_flow"
@@ -248,6 +259,7 @@ enum ovs_key_attr {
248 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */ 259 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */
249 OVS_KEY_ATTR_SKB_MARK, /* u32 skb mark */ 260 OVS_KEY_ATTR_SKB_MARK, /* u32 skb mark */
250 OVS_KEY_ATTR_TUNNEL, /* Nested set of ovs_tunnel attributes */ 261 OVS_KEY_ATTR_TUNNEL, /* Nested set of ovs_tunnel attributes */
262 OVS_KEY_ATTR_SCTP, /* struct ovs_key_sctp */
251 263
252#ifdef __KERNEL__ 264#ifdef __KERNEL__
253 OVS_KEY_ATTR_IPV4_TUNNEL, /* struct ovs_key_ipv4_tunnel */ 265 OVS_KEY_ATTR_IPV4_TUNNEL, /* struct ovs_key_ipv4_tunnel */
@@ -322,6 +334,11 @@ struct ovs_key_udp {
322 __be16 udp_dst; 334 __be16 udp_dst;
323}; 335};
324 336
337struct ovs_key_sctp {
338 __be16 sctp_src;
339 __be16 sctp_dst;
340};
341
325struct ovs_key_icmp { 342struct ovs_key_icmp {
326 __u8 icmp_type; 343 __u8 icmp_type;
327 __u8 icmp_code; 344 __u8 icmp_code;
@@ -368,6 +385,12 @@ struct ovs_key_nd {
368 * @OVS_FLOW_ATTR_CLEAR: If present in a %OVS_FLOW_CMD_SET request, clears the 385 * @OVS_FLOW_ATTR_CLEAR: If present in a %OVS_FLOW_CMD_SET request, clears the
369 * last-used time, accumulated TCP flags, and statistics for this flow. 386 * last-used time, accumulated TCP flags, and statistics for this flow.
370 * Otherwise ignored in requests. Never present in notifications. 387 * Otherwise ignored in requests. Never present in notifications.
388 * @OVS_FLOW_ATTR_MASK: Nested %OVS_KEY_ATTR_* attributes specifying the
389 * mask bits for wildcarded flow match. Mask bit value '1' specifies exact
390 * match with corresponding flow key bit, while mask bit value '0' specifies
391 * a wildcarded match. Omitting attribute is treated as wildcarding all
392 * corresponding fields. Optional for all requests. If not present,
393 * all flow key bits are exact match bits.
371 * 394 *
372 * These attributes follow the &struct ovs_header within the Generic Netlink 395 * These attributes follow the &struct ovs_header within the Generic Netlink
373 * payload for %OVS_FLOW_* commands. 396 * payload for %OVS_FLOW_* commands.
@@ -380,6 +403,7 @@ enum ovs_flow_attr {
380 OVS_FLOW_ATTR_TCP_FLAGS, /* 8-bit OR'd TCP flags. */ 403 OVS_FLOW_ATTR_TCP_FLAGS, /* 8-bit OR'd TCP flags. */
381 OVS_FLOW_ATTR_USED, /* u64 msecs last used in monotonic time. */ 404 OVS_FLOW_ATTR_USED, /* u64 msecs last used in monotonic time. */
382 OVS_FLOW_ATTR_CLEAR, /* Flag to clear stats, tcp_flags, used. */ 405 OVS_FLOW_ATTR_CLEAR, /* Flag to clear stats, tcp_flags, used. */
406 OVS_FLOW_ATTR_MASK, /* Sequence of OVS_KEY_ATTR_* attributes. */
383 __OVS_FLOW_ATTR_MAX 407 __OVS_FLOW_ATTR_MAX
384}; 408};
385 409
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index c3cc01d474b0..baa7852468ef 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -421,24 +421,24 @@
421#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */ 421#define PCI_EXP_TYPE_ROOT_PORT 0x4 /* Root Port */
422#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */ 422#define PCI_EXP_TYPE_UPSTREAM 0x5 /* Upstream Port */
423#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */ 423#define PCI_EXP_TYPE_DOWNSTREAM 0x6 /* Downstream Port */
424#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCI/PCI-X Bridge */ 424#define PCI_EXP_TYPE_PCI_BRIDGE 0x7 /* PCIe to PCI/PCI-X Bridge */
425#define PCI_EXP_TYPE_PCIE_BRIDGE 0x8 /* PCI/PCI-X to PCIE Bridge */ 425#define PCI_EXP_TYPE_PCIE_BRIDGE 0x8 /* PCI/PCI-X to PCIe Bridge */
426#define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */ 426#define PCI_EXP_TYPE_RC_END 0x9 /* Root Complex Integrated Endpoint */
427#define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */ 427#define PCI_EXP_TYPE_RC_EC 0xa /* Root Complex Event Collector */
428#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */ 428#define PCI_EXP_FLAGS_SLOT 0x0100 /* Slot implemented */
429#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */ 429#define PCI_EXP_FLAGS_IRQ 0x3e00 /* Interrupt message number */
430#define PCI_EXP_DEVCAP 4 /* Device capabilities */ 430#define PCI_EXP_DEVCAP 4 /* Device capabilities */
431#define PCI_EXP_DEVCAP_PAYLOAD 0x07 /* Max_Payload_Size */ 431#define PCI_EXP_DEVCAP_PAYLOAD 0x00000007 /* Max_Payload_Size */
432#define PCI_EXP_DEVCAP_PHANTOM 0x18 /* Phantom functions */ 432#define PCI_EXP_DEVCAP_PHANTOM 0x00000018 /* Phantom functions */
433#define PCI_EXP_DEVCAP_EXT_TAG 0x20 /* Extended tags */ 433#define PCI_EXP_DEVCAP_EXT_TAG 0x00000020 /* Extended tags */
434#define PCI_EXP_DEVCAP_L0S 0x1c0 /* L0s Acceptable Latency */ 434#define PCI_EXP_DEVCAP_L0S 0x000001c0 /* L0s Acceptable Latency */
435#define PCI_EXP_DEVCAP_L1 0xe00 /* L1 Acceptable Latency */ 435#define PCI_EXP_DEVCAP_L1 0x00000e00 /* L1 Acceptable Latency */
436#define PCI_EXP_DEVCAP_ATN_BUT 0x1000 /* Attention Button Present */ 436#define PCI_EXP_DEVCAP_ATN_BUT 0x00001000 /* Attention Button Present */
437#define PCI_EXP_DEVCAP_ATN_IND 0x2000 /* Attention Indicator Present */ 437#define PCI_EXP_DEVCAP_ATN_IND 0x00002000 /* Attention Indicator Present */
438#define PCI_EXP_DEVCAP_PWR_IND 0x4000 /* Power Indicator Present */ 438#define PCI_EXP_DEVCAP_PWR_IND 0x00004000 /* Power Indicator Present */
439#define PCI_EXP_DEVCAP_RBER 0x8000 /* Role-Based Error Reporting */ 439#define PCI_EXP_DEVCAP_RBER 0x00008000 /* Role-Based Error Reporting */
440#define PCI_EXP_DEVCAP_PWR_VAL 0x3fc0000 /* Slot Power Limit Value */ 440#define PCI_EXP_DEVCAP_PWR_VAL 0x03fc0000 /* Slot Power Limit Value */
441#define PCI_EXP_DEVCAP_PWR_SCL 0xc000000 /* Slot Power Limit Scale */ 441#define PCI_EXP_DEVCAP_PWR_SCL 0x0c000000 /* Slot Power Limit Scale */
442#define PCI_EXP_DEVCAP_FLR 0x10000000 /* Function Level Reset */ 442#define PCI_EXP_DEVCAP_FLR 0x10000000 /* Function Level Reset */
443#define PCI_EXP_DEVCTL 8 /* Device Control */ 443#define PCI_EXP_DEVCTL 8 /* Device Control */
444#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */ 444#define PCI_EXP_DEVCTL_CERE 0x0001 /* Correctable Error Reporting En. */
@@ -454,16 +454,16 @@
454#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */ 454#define PCI_EXP_DEVCTL_READRQ 0x7000 /* Max_Read_Request_Size */
455#define PCI_EXP_DEVCTL_BCR_FLR 0x8000 /* Bridge Configuration Retry / FLR */ 455#define PCI_EXP_DEVCTL_BCR_FLR 0x8000 /* Bridge Configuration Retry / FLR */
456#define PCI_EXP_DEVSTA 10 /* Device Status */ 456#define PCI_EXP_DEVSTA 10 /* Device Status */
457#define PCI_EXP_DEVSTA_CED 0x01 /* Correctable Error Detected */ 457#define PCI_EXP_DEVSTA_CED 0x0001 /* Correctable Error Detected */
458#define PCI_EXP_DEVSTA_NFED 0x02 /* Non-Fatal Error Detected */ 458#define PCI_EXP_DEVSTA_NFED 0x0002 /* Non-Fatal Error Detected */
459#define PCI_EXP_DEVSTA_FED 0x04 /* Fatal Error Detected */ 459#define PCI_EXP_DEVSTA_FED 0x0004 /* Fatal Error Detected */
460#define PCI_EXP_DEVSTA_URD 0x08 /* Unsupported Request Detected */ 460#define PCI_EXP_DEVSTA_URD 0x0008 /* Unsupported Request Detected */
461#define PCI_EXP_DEVSTA_AUXPD 0x10 /* AUX Power Detected */ 461#define PCI_EXP_DEVSTA_AUXPD 0x0010 /* AUX Power Detected */
462#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ 462#define PCI_EXP_DEVSTA_TRPND 0x0020 /* Transactions Pending */
463#define PCI_EXP_LNKCAP 12 /* Link Capabilities */ 463#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
464#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */ 464#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */
465#define PCI_EXP_LNKCAP_SLS_2_5GB 0x1 /* LNKCAP2 SLS Vector bit 0 (2.5GT/s) */ 465#define PCI_EXP_LNKCAP_SLS_2_5GB 0x00000001 /* LNKCAP2 SLS Vector bit 0 */
466#define PCI_EXP_LNKCAP_SLS_5_0GB 0x2 /* LNKCAP2 SLS Vector bit 1 (5.0GT/s) */ 466#define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */
467#define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */ 467#define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */
468#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */ 468#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */
469#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */ 469#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */
@@ -475,21 +475,21 @@
475#define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */ 475#define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */
476#define PCI_EXP_LNKCTL 16 /* Link Control */ 476#define PCI_EXP_LNKCTL 16 /* Link Control */
477#define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */ 477#define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */
478#define PCI_EXP_LNKCTL_ASPM_L0S 0x01 /* L0s Enable */ 478#define PCI_EXP_LNKCTL_ASPM_L0S 0x0001 /* L0s Enable */
479#define PCI_EXP_LNKCTL_ASPM_L1 0x02 /* L1 Enable */ 479#define PCI_EXP_LNKCTL_ASPM_L1 0x0002 /* L1 Enable */
480#define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */ 480#define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */
481#define PCI_EXP_LNKCTL_LD 0x0010 /* Link Disable */ 481#define PCI_EXP_LNKCTL_LD 0x0010 /* Link Disable */
482#define PCI_EXP_LNKCTL_RL 0x0020 /* Retrain Link */ 482#define PCI_EXP_LNKCTL_RL 0x0020 /* Retrain Link */
483#define PCI_EXP_LNKCTL_CCC 0x0040 /* Common Clock Configuration */ 483#define PCI_EXP_LNKCTL_CCC 0x0040 /* Common Clock Configuration */
484#define PCI_EXP_LNKCTL_ES 0x0080 /* Extended Synch */ 484#define PCI_EXP_LNKCTL_ES 0x0080 /* Extended Synch */
485#define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */ 485#define PCI_EXP_LNKCTL_CLKREQ_EN 0x0100 /* Enable clkreq */
486#define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */ 486#define PCI_EXP_LNKCTL_HAWD 0x0200 /* Hardware Autonomous Width Disable */
487#define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */ 487#define PCI_EXP_LNKCTL_LBMIE 0x0400 /* Link Bandwidth Management Interrupt Enable */
488#define PCI_EXP_LNKCTL_LABIE 0x0800 /* Lnk Autonomous Bandwidth Interrupt Enable */ 488#define PCI_EXP_LNKCTL_LABIE 0x0800 /* Lnk Autonomous Bandwidth Interrupt Enable */
489#define PCI_EXP_LNKSTA 18 /* Link Status */ 489#define PCI_EXP_LNKSTA 18 /* Link Status */
490#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */ 490#define PCI_EXP_LNKSTA_CLS 0x000f /* Current Link Speed */
491#define PCI_EXP_LNKSTA_CLS_2_5GB 0x01 /* Current Link Speed 2.5GT/s */ 491#define PCI_EXP_LNKSTA_CLS_2_5GB 0x0001 /* Current Link Speed 2.5GT/s */
492#define PCI_EXP_LNKSTA_CLS_5_0GB 0x02 /* Current Link Speed 5.0GT/s */ 492#define PCI_EXP_LNKSTA_CLS_5_0GB 0x0002 /* Current Link Speed 5.0GT/s */
493#define PCI_EXP_LNKSTA_NLW 0x03f0 /* Nogotiated Link Width */ 493#define PCI_EXP_LNKSTA_NLW 0x03f0 /* Nogotiated Link Width */
494#define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */ 494#define PCI_EXP_LNKSTA_NLW_SHIFT 4 /* start of NLW mask in link status */
495#define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */ 495#define PCI_EXP_LNKSTA_LT 0x0800 /* Link Training */
@@ -534,44 +534,49 @@
534#define PCI_EXP_SLTSTA_EIS 0x0080 /* Electromechanical Interlock Status */ 534#define PCI_EXP_SLTSTA_EIS 0x0080 /* Electromechanical Interlock Status */
535#define PCI_EXP_SLTSTA_DLLSC 0x0100 /* Data Link Layer State Changed */ 535#define PCI_EXP_SLTSTA_DLLSC 0x0100 /* Data Link Layer State Changed */
536#define PCI_EXP_RTCTL 28 /* Root Control */ 536#define PCI_EXP_RTCTL 28 /* Root Control */
537#define PCI_EXP_RTCTL_SECEE 0x01 /* System Error on Correctable Error */ 537#define PCI_EXP_RTCTL_SECEE 0x0001 /* System Error on Correctable Error */
538#define PCI_EXP_RTCTL_SENFEE 0x02 /* System Error on Non-Fatal Error */ 538#define PCI_EXP_RTCTL_SENFEE 0x0002 /* System Error on Non-Fatal Error */
539#define PCI_EXP_RTCTL_SEFEE 0x04 /* System Error on Fatal Error */ 539#define PCI_EXP_RTCTL_SEFEE 0x0004 /* System Error on Fatal Error */
540#define PCI_EXP_RTCTL_PMEIE 0x08 /* PME Interrupt Enable */ 540#define PCI_EXP_RTCTL_PMEIE 0x0008 /* PME Interrupt Enable */
541#define PCI_EXP_RTCTL_CRSSVE 0x10 /* CRS Software Visibility Enable */ 541#define PCI_EXP_RTCTL_CRSSVE 0x0010 /* CRS Software Visibility Enable */
542#define PCI_EXP_RTCAP 30 /* Root Capabilities */ 542#define PCI_EXP_RTCAP 30 /* Root Capabilities */
543#define PCI_EXP_RTSTA 32 /* Root Status */ 543#define PCI_EXP_RTSTA 32 /* Root Status */
544#define PCI_EXP_RTSTA_PME 0x10000 /* PME status */ 544#define PCI_EXP_RTSTA_PME 0x00010000 /* PME status */
545#define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ 545#define PCI_EXP_RTSTA_PENDING 0x00020000 /* PME pending */
546/* 546/*
547 * Note that the following PCI Express 'Capability Structure' registers 547 * The Device Capabilities 2, Device Status 2, Device Control 2,
548 * were introduced with 'Capability Version' 0x2 (v2). These registers 548 * Link Capabilities 2, Link Status 2, Link Control 2,
549 * do not exist on devices with Capability Version 1. Use pci_pcie_cap2() 549 * Slot Capabilities 2, Slot Status 2, and Slot Control 2 registers
550 * to use these fields safely. 550 * are only present on devices with PCIe Capability version 2.
551 * Use pcie_capability_read_word() and similar interfaces to use them
552 * safely.
551 */ 553 */
552#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */ 554#define PCI_EXP_DEVCAP2 36 /* Device Capabilities 2 */
553#define PCI_EXP_DEVCAP2_ARI 0x20 /* Alternative Routing-ID */ 555#define PCI_EXP_DEVCAP2_ARI 0x00000020 /* Alternative Routing-ID */
554#define PCI_EXP_DEVCAP2_LTR 0x800 /* Latency tolerance reporting */ 556#define PCI_EXP_DEVCAP2_LTR 0x00000800 /* Latency tolerance reporting */
555#define PCI_EXP_OBFF_MASK 0xc0000 /* OBFF support mechanism */ 557#define PCI_EXP_DEVCAP2_OBFF_MASK 0x000c0000 /* OBFF support mechanism */
556#define PCI_EXP_OBFF_MSG 0x40000 /* New message signaling */ 558#define PCI_EXP_DEVCAP2_OBFF_MSG 0x00040000 /* New message signaling */
557#define PCI_EXP_OBFF_WAKE 0x80000 /* Re-use WAKE# for OBFF */ 559#define PCI_EXP_DEVCAP2_OBFF_WAKE 0x00080000 /* Re-use WAKE# for OBFF */
558#define PCI_EXP_DEVCTL2 40 /* Device Control 2 */ 560#define PCI_EXP_DEVCTL2 40 /* Device Control 2 */
559#define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */ 561#define PCI_EXP_DEVCTL2_ARI 0x20 /* Alternative Routing-ID */
560#define PCI_EXP_IDO_REQ_EN 0x100 /* ID-based ordering request enable */ 562#define PCI_EXP_DEVCTL2_IDO_REQ_EN 0x0100 /* Allow IDO for requests */
561#define PCI_EXP_IDO_CMP_EN 0x200 /* ID-based ordering completion enable */ 563#define PCI_EXP_DEVCTL2_IDO_CMP_EN 0x0200 /* Allow IDO for completions */
562#define PCI_EXP_LTR_EN 0x400 /* Latency tolerance reporting */ 564#define PCI_EXP_DEVCTL2_LTR_EN 0x0400 /* Enable LTR mechanism */
563#define PCI_EXP_OBFF_MSGA_EN 0x2000 /* OBFF enable with Message type A */ 565#define PCI_EXP_DEVCTL2_OBFF_MSGA_EN 0x2000 /* Enable OBFF Message type A */
564#define PCI_EXP_OBFF_MSGB_EN 0x4000 /* OBFF enable with Message type B */ 566#define PCI_EXP_DEVCTL2_OBFF_MSGB_EN 0x4000 /* Enable OBFF Message type B */
565#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ 567#define PCI_EXP_DEVCTL2_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */
568#define PCI_EXP_DEVSTA2 42 /* Device Status 2 */
566#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */ 569#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */
567#define PCI_EXP_LNKCAP2 44 /* Link Capability 2 */ 570#define PCI_EXP_LNKCAP2 44 /* Link Capabilities 2 */
568#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x02 /* Supported Link Speed 2.5GT/s */ 571#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x00000002 /* Supported Speed 2.5GT/s */
569#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x04 /* Supported Link Speed 5.0GT/s */ 572#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x00000004 /* Supported Speed 5.0GT/s */
570#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x08 /* Supported Link Speed 8.0GT/s */ 573#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x00000008 /* Supported Speed 8.0GT/s */
571#define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */ 574#define PCI_EXP_LNKCAP2_CROSSLINK 0x00000100 /* Crosslink supported */
572#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ 575#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
573#define PCI_EXP_LNKSTA2 50 /* Link Status 2 */ 576#define PCI_EXP_LNKSTA2 50 /* Link Status 2 */
577#define PCI_EXP_SLTCAP2 52 /* Slot Capabilities 2 */
574#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */ 578#define PCI_EXP_SLTCTL2 56 /* Slot Control 2 */
579#define PCI_EXP_SLTSTA2 58 /* Slot Status 2 */
575 580
576/* Extended Capabilities (PCI-X 2.0 and Express) */ 581/* Extended Capabilities (PCI-X 2.0 and Express) */
577#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff) 582#define PCI_EXT_CAP_ID(header) (header & 0x0000ffff)
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index 0b1df41691e8..ca1d90bcb74d 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -109,6 +109,7 @@ enum perf_sw_ids {
109 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, 109 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
110 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7, 110 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
111 PERF_COUNT_SW_EMULATION_FAULTS = 8, 111 PERF_COUNT_SW_EMULATION_FAULTS = 8,
112 PERF_COUNT_SW_DUMMY = 9,
112 113
113 PERF_COUNT_SW_MAX, /* non-ABI */ 114 PERF_COUNT_SW_MAX, /* non-ABI */
114}; 115};
@@ -134,8 +135,9 @@ enum perf_event_sample_format {
134 PERF_SAMPLE_STACK_USER = 1U << 13, 135 PERF_SAMPLE_STACK_USER = 1U << 13,
135 PERF_SAMPLE_WEIGHT = 1U << 14, 136 PERF_SAMPLE_WEIGHT = 1U << 14,
136 PERF_SAMPLE_DATA_SRC = 1U << 15, 137 PERF_SAMPLE_DATA_SRC = 1U << 15,
138 PERF_SAMPLE_IDENTIFIER = 1U << 16,
137 139
138 PERF_SAMPLE_MAX = 1U << 16, /* non-ABI */ 140 PERF_SAMPLE_MAX = 1U << 17, /* non-ABI */
139}; 141};
140 142
141/* 143/*
@@ -275,8 +277,9 @@ struct perf_event_attr {
275 277
276 exclude_callchain_kernel : 1, /* exclude kernel callchains */ 278 exclude_callchain_kernel : 1, /* exclude kernel callchains */
277 exclude_callchain_user : 1, /* exclude user callchains */ 279 exclude_callchain_user : 1, /* exclude user callchains */
280 mmap2 : 1, /* include mmap with inode data */
278 281
279 __reserved_1 : 41; 282 __reserved_1 : 40;
280 283
281 union { 284 union {
282 __u32 wakeup_events; /* wakeup every n events */ 285 __u32 wakeup_events; /* wakeup every n events */
@@ -321,6 +324,7 @@ struct perf_event_attr {
321#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64) 324#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)
322#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) 325#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)
323#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) 326#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
327#define PERF_EVENT_IOC_ID _IOR('$', 7, u64 *)
324 328
325enum perf_event_ioc_flags { 329enum perf_event_ioc_flags {
326 PERF_IOC_FLAG_GROUP = 1U << 0, 330 PERF_IOC_FLAG_GROUP = 1U << 0,
@@ -375,9 +379,12 @@ struct perf_event_mmap_page {
375 __u64 time_running; /* time event on cpu */ 379 __u64 time_running; /* time event on cpu */
376 union { 380 union {
377 __u64 capabilities; 381 __u64 capabilities;
378 __u64 cap_usr_time : 1, 382 struct {
379 cap_usr_rdpmc : 1, 383 __u64 cap_usr_time : 1,
380 cap_____res : 62; 384 cap_usr_rdpmc : 1,
385 cap_usr_time_zero : 1,
386 cap_____res : 61;
387 };
381 }; 388 };
382 389
383 /* 390 /*
@@ -418,12 +425,29 @@ struct perf_event_mmap_page {
418 __u16 time_shift; 425 __u16 time_shift;
419 __u32 time_mult; 426 __u32 time_mult;
420 __u64 time_offset; 427 __u64 time_offset;
428 /*
429 * If cap_usr_time_zero, the hardware clock (e.g. TSC) can be calculated
430 * from sample timestamps.
431 *
432 * time = timestamp - time_zero;
433 * quot = time / time_mult;
434 * rem = time % time_mult;
435 * cyc = (quot << time_shift) + (rem << time_shift) / time_mult;
436 *
437 * And vice versa:
438 *
439 * quot = cyc >> time_shift;
440 * rem = cyc & ((1 << time_shift) - 1);
441 * timestamp = time_zero + quot * time_mult +
442 * ((rem * time_mult) >> time_shift);
443 */
444 __u64 time_zero;
421 445
422 /* 446 /*
423 * Hole for extension of the self monitor capabilities 447 * Hole for extension of the self monitor capabilities
424 */ 448 */
425 449
426 __u64 __reserved[120]; /* align to 1k */ 450 __u64 __reserved[119]; /* align to 1k */
427 451
428 /* 452 /*
429 * Control data for the mmap() data buffer. 453 * Control data for the mmap() data buffer.
@@ -471,13 +495,28 @@ enum perf_event_type {
471 /* 495 /*
472 * If perf_event_attr.sample_id_all is set then all event types will 496 * If perf_event_attr.sample_id_all is set then all event types will
473 * have the sample_type selected fields related to where/when 497 * have the sample_type selected fields related to where/when
474 * (identity) an event took place (TID, TIME, ID, CPU, STREAM_ID) 498 * (identity) an event took place (TID, TIME, ID, STREAM_ID, CPU,
475 * described in PERF_RECORD_SAMPLE below, it will be stashed just after 499 * IDENTIFIER) described in PERF_RECORD_SAMPLE below, it will be stashed
476 * the perf_event_header and the fields already present for the existing 500 * just after the perf_event_header and the fields already present for
477 * fields, i.e. at the end of the payload. That way a newer perf.data 501 * the existing fields, i.e. at the end of the payload. That way a newer
478 * file will be supported by older perf tools, with these new optional 502 * perf.data file will be supported by older perf tools, with these new
479 * fields being ignored. 503 * optional fields being ignored.
504 *
505 * struct sample_id {
506 * { u32 pid, tid; } && PERF_SAMPLE_TID
507 * { u64 time; } && PERF_SAMPLE_TIME
508 * { u64 id; } && PERF_SAMPLE_ID
509 * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID
510 * { u32 cpu, res; } && PERF_SAMPLE_CPU
511 * { u64 id; } && PERF_SAMPLE_IDENTIFIER
512 * } && perf_event_attr::sample_id_all
480 * 513 *
514 * Note that PERF_SAMPLE_IDENTIFIER duplicates PERF_SAMPLE_ID. The
515 * advantage of PERF_SAMPLE_IDENTIFIER is that its position is fixed
516 * relative to header.size.
517 */
518
519 /*
481 * The MMAP events record the PROT_EXEC mappings so that we can 520 * The MMAP events record the PROT_EXEC mappings so that we can
482 * correlate userspace IPs to code. They have the following structure: 521 * correlate userspace IPs to code. They have the following structure:
483 * 522 *
@@ -498,6 +537,7 @@ enum perf_event_type {
498 * struct perf_event_header header; 537 * struct perf_event_header header;
499 * u64 id; 538 * u64 id;
500 * u64 lost; 539 * u64 lost;
540 * struct sample_id sample_id;
501 * }; 541 * };
502 */ 542 */
503 PERF_RECORD_LOST = 2, 543 PERF_RECORD_LOST = 2,
@@ -508,6 +548,7 @@ enum perf_event_type {
508 * 548 *
509 * u32 pid, tid; 549 * u32 pid, tid;
510 * char comm[]; 550 * char comm[];
551 * struct sample_id sample_id;
511 * }; 552 * };
512 */ 553 */
513 PERF_RECORD_COMM = 3, 554 PERF_RECORD_COMM = 3,
@@ -518,6 +559,7 @@ enum perf_event_type {
518 * u32 pid, ppid; 559 * u32 pid, ppid;
519 * u32 tid, ptid; 560 * u32 tid, ptid;
520 * u64 time; 561 * u64 time;
562 * struct sample_id sample_id;
521 * }; 563 * };
522 */ 564 */
523 PERF_RECORD_EXIT = 4, 565 PERF_RECORD_EXIT = 4,
@@ -528,6 +570,7 @@ enum perf_event_type {
528 * u64 time; 570 * u64 time;
529 * u64 id; 571 * u64 id;
530 * u64 stream_id; 572 * u64 stream_id;
573 * struct sample_id sample_id;
531 * }; 574 * };
532 */ 575 */
533 PERF_RECORD_THROTTLE = 5, 576 PERF_RECORD_THROTTLE = 5,
@@ -539,6 +582,7 @@ enum perf_event_type {
539 * u32 pid, ppid; 582 * u32 pid, ppid;
540 * u32 tid, ptid; 583 * u32 tid, ptid;
541 * u64 time; 584 * u64 time;
585 * struct sample_id sample_id;
542 * }; 586 * };
543 */ 587 */
544 PERF_RECORD_FORK = 7, 588 PERF_RECORD_FORK = 7,
@@ -549,6 +593,7 @@ enum perf_event_type {
549 * u32 pid, tid; 593 * u32 pid, tid;
550 * 594 *
551 * struct read_format values; 595 * struct read_format values;
596 * struct sample_id sample_id;
552 * }; 597 * };
553 */ 598 */
554 PERF_RECORD_READ = 8, 599 PERF_RECORD_READ = 8,
@@ -557,6 +602,13 @@ enum perf_event_type {
557 * struct { 602 * struct {
558 * struct perf_event_header header; 603 * struct perf_event_header header;
559 * 604 *
605 * #
606 * # Note that PERF_SAMPLE_IDENTIFIER duplicates PERF_SAMPLE_ID.
607 * # The advantage of PERF_SAMPLE_IDENTIFIER is that its position
608 * # is fixed relative to header.
609 * #
610 *
611 * { u64 id; } && PERF_SAMPLE_IDENTIFIER
560 * { u64 ip; } && PERF_SAMPLE_IP 612 * { u64 ip; } && PERF_SAMPLE_IP
561 * { u32 pid, tid; } && PERF_SAMPLE_TID 613 * { u32 pid, tid; } && PERF_SAMPLE_TID
562 * { u64 time; } && PERF_SAMPLE_TIME 614 * { u64 time; } && PERF_SAMPLE_TIME
@@ -596,11 +648,32 @@ enum perf_event_type {
596 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER 648 * u64 dyn_size; } && PERF_SAMPLE_STACK_USER
597 * 649 *
598 * { u64 weight; } && PERF_SAMPLE_WEIGHT 650 * { u64 weight; } && PERF_SAMPLE_WEIGHT
599 * { u64 data_src; } && PERF_SAMPLE_DATA_SRC 651 * { u64 data_src; } && PERF_SAMPLE_DATA_SRC
600 * }; 652 * };
601 */ 653 */
602 PERF_RECORD_SAMPLE = 9, 654 PERF_RECORD_SAMPLE = 9,
603 655
656 /*
657 * The MMAP2 records are an augmented version of MMAP, they add
658 * maj, min, ino numbers to be used to uniquely identify each mapping
659 *
660 * struct {
661 * struct perf_event_header header;
662 *
663 * u32 pid, tid;
664 * u64 addr;
665 * u64 len;
666 * u64 pgoff;
667 * u32 maj;
668 * u32 min;
669 * u64 ino;
670 * u64 ino_generation;
671 * char filename[];
672 * struct sample_id sample_id;
673 * };
674 */
675 PERF_RECORD_MMAP2 = 10,
676
604 PERF_RECORD_MAX, /* non-ABI */ 677 PERF_RECORD_MAX, /* non-ABI */
605}; 678};
606 679
@@ -685,4 +758,28 @@ union perf_mem_data_src {
685#define PERF_MEM_S(a, s) \ 758#define PERF_MEM_S(a, s) \
686 (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT) 759 (((u64)PERF_MEM_##a##_##s) << PERF_MEM_##a##_SHIFT)
687 760
761/*
762 * single taken branch record layout:
763 *
764 * from: source instruction (may not always be a branch insn)
765 * to: branch target
766 * mispred: branch target was mispredicted
767 * predicted: branch target was predicted
768 *
769 * support for mispred, predicted is optional. In case it
770 * is not supported mispred = predicted = 0.
771 *
772 * in_tx: running in a hardware transaction
773 * abort: aborting a hardware transaction
774 */
775struct perf_branch_entry {
776 __u64 from;
777 __u64 to;
778 __u64 mispred:1, /* target mispredicted */
779 predicted:1,/* target predicted */
780 in_tx:1, /* in transaction */
781 abort:1, /* transaction abort */
782 reserved:60;
783};
784
688#endif /* _UAPI_LINUX_PERF_EVENT_H */ 785#endif /* _UAPI_LINUX_PERF_EVENT_H */
diff --git a/include/uapi/linux/pkt_sched.h b/include/uapi/linux/pkt_sched.h
index dbd71b0c7d8c..9b829134d422 100644
--- a/include/uapi/linux/pkt_sched.h
+++ b/include/uapi/linux/pkt_sched.h
@@ -73,9 +73,17 @@ struct tc_estimator {
73#define TC_H_ROOT (0xFFFFFFFFU) 73#define TC_H_ROOT (0xFFFFFFFFU)
74#define TC_H_INGRESS (0xFFFFFFF1U) 74#define TC_H_INGRESS (0xFFFFFFF1U)
75 75
76/* Need to corrospond to iproute2 tc/tc_core.h "enum link_layer" */
77enum tc_link_layer {
78 TC_LINKLAYER_UNAWARE, /* Indicate unaware old iproute2 util */
79 TC_LINKLAYER_ETHERNET,
80 TC_LINKLAYER_ATM,
81};
82#define TC_LINKLAYER_MASK 0x0F /* limit use to lower 4 bits */
83
76struct tc_ratespec { 84struct tc_ratespec {
77 unsigned char cell_log; 85 unsigned char cell_log;
78 unsigned char __reserved; 86 __u8 linklayer; /* lower 4 bits */
79 unsigned short overhead; 87 unsigned short overhead;
80 short cell_align; 88 short cell_align;
81 unsigned short mpu; 89 unsigned short mpu;
@@ -736,4 +744,45 @@ struct tc_fq_codel_xstats {
736 }; 744 };
737}; 745};
738 746
747/* FQ */
748
749enum {
750 TCA_FQ_UNSPEC,
751
752 TCA_FQ_PLIMIT, /* limit of total number of packets in queue */
753
754 TCA_FQ_FLOW_PLIMIT, /* limit of packets per flow */
755
756 TCA_FQ_QUANTUM, /* RR quantum */
757
758 TCA_FQ_INITIAL_QUANTUM, /* RR quantum for new flow */
759
760 TCA_FQ_RATE_ENABLE, /* enable/disable rate limiting */
761
762 TCA_FQ_FLOW_DEFAULT_RATE,/* for sockets with unspecified sk_rate,
763 * use the following rate
764 */
765
766 TCA_FQ_FLOW_MAX_RATE, /* per flow max rate */
767
768 TCA_FQ_BUCKETS_LOG, /* log2(number of buckets) */
769 __TCA_FQ_MAX
770};
771
772#define TCA_FQ_MAX (__TCA_FQ_MAX - 1)
773
774struct tc_fq_qd_stats {
775 __u64 gc_flows;
776 __u64 highprio_packets;
777 __u64 tcp_retrans;
778 __u64 throttled;
779 __u64 flows_plimit;
780 __u64 pkts_too_long;
781 __u64 allocation_errors;
782 __s64 time_next_delayed_flow;
783 __u32 flows;
784 __u32 inactive_flows;
785 __u32 throttled_flows;
786 __u32 pad;
787};
739#endif 788#endif
diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
index 66b466e4ca08..ca451e99b28b 100644
--- a/include/uapi/linux/sctp.h
+++ b/include/uapi/linux/sctp.h
@@ -28,7 +28,7 @@
28 * 28 *
29 * Please send any bug reports or fixes you make to the 29 * Please send any bug reports or fixes you make to the
30 * email address(es): 30 * email address(es):
31 * lksctp developers <lksctp-developers@lists.sourceforge.net> 31 * lksctp developers <linux-sctp@vger.kernel.org>
32 * 32 *
33 * Or submit a bug report through the following website: 33 * Or submit a bug report through the following website:
34 * http://www.sf.net/projects/lksctp 34 * http://www.sf.net/projects/lksctp
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h
index 9119cc0977bf..e40ebe124ced 100644
--- a/include/uapi/linux/serial_core.h
+++ b/include/uapi/linux/serial_core.h
@@ -232,4 +232,7 @@
232/* SH-SCI */ 232/* SH-SCI */
233#define PORT_HSCIF 104 233#define PORT_HSCIF 104
234 234
235/* ST ASC type numbers */
236#define PORT_ASC 105
237
235#endif /* _UAPILINUX_SERIAL_CORE_H */ 238#endif /* _UAPILINUX_SERIAL_CORE_H */
diff --git a/include/uapi/linux/snmp.h b/include/uapi/linux/snmp.h
index af0a674cc677..1bdb4a39d1e1 100644
--- a/include/uapi/linux/snmp.h
+++ b/include/uapi/linux/snmp.h
@@ -51,6 +51,10 @@ enum
51 IPSTATS_MIB_INBCASTOCTETS, /* InBcastOctets */ 51 IPSTATS_MIB_INBCASTOCTETS, /* InBcastOctets */
52 IPSTATS_MIB_OUTBCASTOCTETS, /* OutBcastOctets */ 52 IPSTATS_MIB_OUTBCASTOCTETS, /* OutBcastOctets */
53 IPSTATS_MIB_CSUMERRORS, /* InCsumErrors */ 53 IPSTATS_MIB_CSUMERRORS, /* InCsumErrors */
54 IPSTATS_MIB_NOECTPKTS, /* InNoECTPkts */
55 IPSTATS_MIB_ECT1PKTS, /* InECT1Pkts */
56 IPSTATS_MIB_ECT0PKTS, /* InECT0Pkts */
57 IPSTATS_MIB_CEPKTS, /* InCEPkts */
54 __IPSTATS_MIB_MAX 58 __IPSTATS_MIB_MAX
55}; 59};
56 60
@@ -253,7 +257,7 @@ enum
253 LINUX_MIB_TCPFASTOPENLISTENOVERFLOW, /* TCPFastOpenListenOverflow */ 257 LINUX_MIB_TCPFASTOPENLISTENOVERFLOW, /* TCPFastOpenListenOverflow */
254 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */ 258 LINUX_MIB_TCPFASTOPENCOOKIEREQD, /* TCPFastOpenCookieReqd */
255 LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */ 259 LINUX_MIB_TCPSPURIOUS_RTX_HOSTQUEUES, /* TCPSpuriousRtxHostQueues */
256 LINUX_MIB_LOWLATENCYRXPACKETS, /* LowLatencyRxPackets */ 260 LINUX_MIB_BUSYPOLLRXPACKETS, /* BusyPollRxPackets */
257 __LINUX_MIB_MAX 261 __LINUX_MIB_MAX
258}; 262};
259 263
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
index 8d776ebc4829..377f1e59411d 100644
--- a/include/uapi/linux/tcp.h
+++ b/include/uapi/linux/tcp.h
@@ -111,6 +111,7 @@ enum {
111#define TCP_REPAIR_OPTIONS 22 111#define TCP_REPAIR_OPTIONS 22
112#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */ 112#define TCP_FASTOPEN 23 /* Enable FastOpen on listeners */
113#define TCP_TIMESTAMP 24 113#define TCP_TIMESTAMP 24
114#define TCP_NOTSENT_LOWAT 25 /* limit number of unsent bytes in write queue */
114 115
115struct tcp_repair_opt { 116struct tcp_repair_opt {
116 __u32 opt_code; 117 __u32 opt_code;
diff --git a/include/uapi/linux/uhid.h b/include/uapi/linux/uhid.h
index e9ed951e2b09..414b74be4da1 100644
--- a/include/uapi/linux/uhid.h
+++ b/include/uapi/linux/uhid.h
@@ -30,7 +30,7 @@ enum uhid_event_type {
30 UHID_OPEN, 30 UHID_OPEN,
31 UHID_CLOSE, 31 UHID_CLOSE,
32 UHID_OUTPUT, 32 UHID_OUTPUT,
33 UHID_OUTPUT_EV, 33 UHID_OUTPUT_EV, /* obsolete! */
34 UHID_INPUT, 34 UHID_INPUT,
35 UHID_FEATURE, 35 UHID_FEATURE,
36 UHID_FEATURE_ANSWER, 36 UHID_FEATURE_ANSWER,
@@ -69,6 +69,8 @@ struct uhid_output_req {
69 __u8 rtype; 69 __u8 rtype;
70} __attribute__((__packed__)); 70} __attribute__((__packed__));
71 71
72/* Obsolete! Newer kernels will no longer send these events but instead convert
73 * it into raw output reports via UHID_OUTPUT. */
72struct uhid_output_ev_req { 74struct uhid_output_ev_req {
73 __u16 type; 75 __u16 type;
74 __u16 code; 76 __u16 code;
diff --git a/include/uapi/linux/v4l2-controls.h b/include/uapi/linux/v4l2-controls.h
index e90a88a8708f..083bb5a5aae2 100644
--- a/include/uapi/linux/v4l2-controls.h
+++ b/include/uapi/linux/v4l2-controls.h
@@ -161,6 +161,8 @@ enum v4l2_colorfx {
161#define V4L2_CID_USER_SI476X_BASE (V4L2_CID_USER_BASE + 0x1040) 161#define V4L2_CID_USER_SI476X_BASE (V4L2_CID_USER_BASE + 0x1040)
162 162
163/* MPEG-class control IDs */ 163/* MPEG-class control IDs */
164/* The MPEG controls are applicable to all codec controls
165 * and the 'MPEG' part of the define is historical */
164 166
165#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 167#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
166#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) 168#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
@@ -522,6 +524,33 @@ enum v4l2_mpeg_video_mpeg4_profile {
522}; 524};
523#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407) 525#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)
524 526
527/* Control IDs for VP8 streams
528 * Although VP8 is not part of MPEG we add these controls to the MPEG class
529 * as that class is already handling other video compression standards
530 */
531#define V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS (V4L2_CID_MPEG_BASE+500)
532enum v4l2_vp8_num_partitions {
533 V4L2_CID_MPEG_VIDEO_VPX_1_PARTITION = 0,
534 V4L2_CID_MPEG_VIDEO_VPX_2_PARTITIONS = 1,
535 V4L2_CID_MPEG_VIDEO_VPX_4_PARTITIONS = 2,
536 V4L2_CID_MPEG_VIDEO_VPX_8_PARTITIONS = 3,
537};
538#define V4L2_CID_MPEG_VIDEO_VPX_IMD_DISABLE_4X4 (V4L2_CID_MPEG_BASE+501)
539#define V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES (V4L2_CID_MPEG_BASE+502)
540enum v4l2_vp8_num_ref_frames {
541 V4L2_CID_MPEG_VIDEO_VPX_1_REF_FRAME = 0,
542 V4L2_CID_MPEG_VIDEO_VPX_2_REF_FRAME = 1,
543 V4L2_CID_MPEG_VIDEO_VPX_3_REF_FRAME = 2,
544};
545#define V4L2_CID_MPEG_VIDEO_VPX_FILTER_LEVEL (V4L2_CID_MPEG_BASE+503)
546#define V4L2_CID_MPEG_VIDEO_VPX_FILTER_SHARPNESS (V4L2_CID_MPEG_BASE+504)
547#define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD (V4L2_CID_MPEG_BASE+505)
548#define V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL (V4L2_CID_MPEG_BASE+506)
549enum v4l2_vp8_golden_frame_sel {
550 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV = 0,
551 V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD = 1,
552};
553
525/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ 554/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
526#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) 555#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
527#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0) 556#define V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (V4L2_CID_MPEG_CX2341X_BASE+0)
diff --git a/include/uapi/linux/v4l2-dv-timings.h b/include/uapi/linux/v4l2-dv-timings.h
index 4e0c58d25ff0..be709fe29552 100644
--- a/include/uapi/linux/v4l2-dv-timings.h
+++ b/include/uapi/linux/v4l2-dv-timings.h
@@ -823,12 +823,4 @@
823 V4L2_DV_FL_REDUCED_BLANKING) \ 823 V4L2_DV_FL_REDUCED_BLANKING) \
824} 824}
825 825
826#define V4L2_DV_BT_DMT_1366X768P60 { \
827 .type = V4L2_DV_BT_656_1120, \
828 V4L2_INIT_BT_TIMINGS(1366, 768, 0, \
829 V4L2_DV_HSYNC_POS_POL | V4L2_DV_VSYNC_POS_POL, \
830 85500000, 70, 143, 213, 3, 3, 24, 0, 0, 0, \
831 V4L2_DV_BT_STD_DMT, 0) \
832}
833
834#endif 826#endif
diff --git a/include/uapi/linux/v4l2-mediabus.h b/include/uapi/linux/v4l2-mediabus.h
index 6ee63d09b32d..a9601257bb43 100644
--- a/include/uapi/linux/v4l2-mediabus.h
+++ b/include/uapi/linux/v4l2-mediabus.h
@@ -37,7 +37,7 @@
37enum v4l2_mbus_pixelcode { 37enum v4l2_mbus_pixelcode {
38 V4L2_MBUS_FMT_FIXED = 0x0001, 38 V4L2_MBUS_FMT_FIXED = 0x0001,
39 39
40 /* RGB - next is 0x100d */ 40 /* RGB - next is 0x100e */
41 V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001, 41 V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001,
42 V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002, 42 V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002,
43 V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003, 43 V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003,
@@ -50,8 +50,9 @@ enum v4l2_mbus_pixelcode {
50 V4L2_MBUS_FMT_RGB888_1X24 = 0x100a, 50 V4L2_MBUS_FMT_RGB888_1X24 = 0x100a,
51 V4L2_MBUS_FMT_RGB888_2X12_BE = 0x100b, 51 V4L2_MBUS_FMT_RGB888_2X12_BE = 0x100b,
52 V4L2_MBUS_FMT_RGB888_2X12_LE = 0x100c, 52 V4L2_MBUS_FMT_RGB888_2X12_LE = 0x100c,
53 V4L2_MBUS_FMT_ARGB8888_1X32 = 0x100d,
53 54
54 /* YUV (including grey) - next is 0x2017 */ 55 /* YUV (including grey) - next is 0x2018 */
55 V4L2_MBUS_FMT_Y8_1X8 = 0x2001, 56 V4L2_MBUS_FMT_Y8_1X8 = 0x2001,
56 V4L2_MBUS_FMT_UV8_1X8 = 0x2015, 57 V4L2_MBUS_FMT_UV8_1X8 = 0x2015,
57 V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002, 58 V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002,
@@ -74,6 +75,7 @@ enum v4l2_mbus_pixelcode {
74 V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d, 75 V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d,
75 V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e, 76 V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e,
76 V4L2_MBUS_FMT_YUV10_1X30 = 0x2016, 77 V4L2_MBUS_FMT_YUV10_1X30 = 0x2016,
78 V4L2_MBUS_FMT_AYUV8_1X32 = 0x2017,
77 79
78 /* Bayer - next is 0x3019 */ 80 /* Bayer - next is 0x3019 */
79 V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001, 81 V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001,
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 95ef4551edc1..437f1b0f8937 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -348,6 +348,8 @@ struct v4l2_pix_format {
348/* two non contiguous planes - one Y, one Cr + Cb interleaved */ 348/* two non contiguous planes - one Y, one Cr + Cb interleaved */
349#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ 349#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
350#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */ 350#define V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
351#define V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6') /* 16 Y/CbCr 4:2:2 */
352#define V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1') /* 16 Y/CrCb 4:2:2 */
351#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */ 353#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
352#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */ 354#define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */
353 355
@@ -1055,6 +1057,16 @@ struct v4l2_bt_timings {
1055 or used depends on the hardware. */ 1057 or used depends on the hardware. */
1056#define V4L2_DV_FL_HALF_LINE (1 << 3) 1058#define V4L2_DV_FL_HALF_LINE (1 << 3)
1057 1059
1060/* A few useful defines to calculate the total blanking and frame sizes */
1061#define V4L2_DV_BT_BLANKING_WIDTH(bt) \
1062 (bt->hfrontporch + bt->hsync + bt->hbackporch)
1063#define V4L2_DV_BT_FRAME_WIDTH(bt) \
1064 (bt->width + V4L2_DV_BT_BLANKING_WIDTH(bt))
1065#define V4L2_DV_BT_BLANKING_HEIGHT(bt) \
1066 (bt->vfrontporch + bt->vsync + bt->vbackporch + \
1067 bt->il_vfrontporch + bt->il_vsync + bt->il_vbackporch)
1068#define V4L2_DV_BT_FRAME_HEIGHT(bt) \
1069 (bt->height + V4L2_DV_BT_BLANKING_HEIGHT(bt))
1058 1070
1059/** struct v4l2_dv_timings - DV timings 1071/** struct v4l2_dv_timings - DV timings
1060 * @type: the type of the timings 1072 * @type: the type of the timings
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
index c520203fac2f..172a7f00780c 100644
--- a/include/uapi/linux/virtio_net.h
+++ b/include/uapi/linux/virtio_net.h
@@ -60,7 +60,7 @@
60 60
61struct virtio_net_config { 61struct virtio_net_config {
62 /* The config defining mac address (if VIRTIO_NET_F_MAC) */ 62 /* The config defining mac address (if VIRTIO_NET_F_MAC) */
63 __u8 mac[6]; 63 __u8 mac[ETH_ALEN];
64 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ 64 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
65 __u16 status; 65 __u16 status;
66 /* Maximum number of each of transmit and receive queues; 66 /* Maximum number of each of transmit and receive queues;
@@ -70,7 +70,9 @@ struct virtio_net_config {
70 __u16 max_virtqueue_pairs; 70 __u16 max_virtqueue_pairs;
71} __attribute__((packed)); 71} __attribute__((packed));
72 72
73/* This is the first element of the scatter-gather list. If you don't 73/* This header comes first in the scatter-gather list.
74 * If VIRTIO_F_ANY_LAYOUT is not negotiated, it must
75 * be the first element of the scatter-gather list. If you don't
74 * specify GSO or CSUM features, you can simply ignore the header. */ 76 * specify GSO or CSUM features, you can simply ignore the header. */
75struct virtio_net_hdr { 77struct virtio_net_hdr {
76#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset 78#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
diff --git a/include/uapi/linux/wimax/i2400m.h b/include/uapi/linux/wimax/i2400m.h
index 62d356153565..fd198bc24a3c 100644
--- a/include/uapi/linux/wimax/i2400m.h
+++ b/include/uapi/linux/wimax/i2400m.h
@@ -122,7 +122,7 @@
122#define __LINUX__WIMAX__I2400M_H__ 122#define __LINUX__WIMAX__I2400M_H__
123 123
124#include <linux/types.h> 124#include <linux/types.h>
125 125#include <linux/if_ether.h>
126 126
127/* 127/*
128 * Host Device Interface (HDI) common to all busses 128 * Host Device Interface (HDI) common to all busses
@@ -487,7 +487,7 @@ struct i2400m_tlv_l4_message_versions {
487struct i2400m_tlv_detailed_device_info { 487struct i2400m_tlv_detailed_device_info {
488 struct i2400m_tlv_hdr hdr; 488 struct i2400m_tlv_hdr hdr;
489 __u8 reserved1[400]; 489 __u8 reserved1[400];
490 __u8 mac_address[6]; 490 __u8 mac_address[ETH_ALEN];
491 __u8 reserved2[2]; 491 __u8 reserved2[2];
492} __attribute__((packed)); 492} __attribute__((packed));
493 493
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
index 805711ea2005..0b233c56b0e4 100644
--- a/include/uapi/rdma/ib_user_verbs.h
+++ b/include/uapi/rdma/ib_user_verbs.h
@@ -43,6 +43,7 @@
43 * compatibility are made. 43 * compatibility are made.
44 */ 44 */
45#define IB_USER_VERBS_ABI_VERSION 6 45#define IB_USER_VERBS_ABI_VERSION 6
46#define IB_USER_VERBS_CMD_THRESHOLD 50
46 47
47enum { 48enum {
48 IB_USER_VERBS_CMD_GET_CONTEXT, 49 IB_USER_VERBS_CMD_GET_CONTEXT,
@@ -85,7 +86,9 @@ enum {
85 IB_USER_VERBS_CMD_OPEN_XRCD, 86 IB_USER_VERBS_CMD_OPEN_XRCD,
86 IB_USER_VERBS_CMD_CLOSE_XRCD, 87 IB_USER_VERBS_CMD_CLOSE_XRCD,
87 IB_USER_VERBS_CMD_CREATE_XSRQ, 88 IB_USER_VERBS_CMD_CREATE_XSRQ,
88 IB_USER_VERBS_CMD_OPEN_QP 89 IB_USER_VERBS_CMD_OPEN_QP,
90 IB_USER_VERBS_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
91 IB_USER_VERBS_CMD_DESTROY_FLOW
89}; 92};
90 93
91/* 94/*
@@ -123,6 +126,15 @@ struct ib_uverbs_cmd_hdr {
123 __u16 out_words; 126 __u16 out_words;
124}; 127};
125 128
129struct ib_uverbs_cmd_hdr_ex {
130 __u32 command;
131 __u16 in_words;
132 __u16 out_words;
133 __u16 provider_in_words;
134 __u16 provider_out_words;
135 __u32 cmd_hdr_reserved;
136};
137
126struct ib_uverbs_get_context { 138struct ib_uverbs_get_context {
127 __u64 response; 139 __u64 response;
128 __u64 driver_data[0]; 140 __u64 driver_data[0];
@@ -684,6 +696,91 @@ struct ib_uverbs_detach_mcast {
684 __u64 driver_data[0]; 696 __u64 driver_data[0];
685}; 697};
686 698
699struct ib_kern_eth_filter {
700 __u8 dst_mac[6];
701 __u8 src_mac[6];
702 __be16 ether_type;
703 __be16 vlan_tag;
704};
705
706struct ib_kern_spec_eth {
707 __u32 type;
708 __u16 size;
709 __u16 reserved;
710 struct ib_kern_eth_filter val;
711 struct ib_kern_eth_filter mask;
712};
713
714struct ib_kern_ipv4_filter {
715 __be32 src_ip;
716 __be32 dst_ip;
717};
718
719struct ib_kern_spec_ipv4 {
720 __u32 type;
721 __u16 size;
722 __u16 reserved;
723 struct ib_kern_ipv4_filter val;
724 struct ib_kern_ipv4_filter mask;
725};
726
727struct ib_kern_tcp_udp_filter {
728 __be16 dst_port;
729 __be16 src_port;
730};
731
732struct ib_kern_spec_tcp_udp {
733 __u32 type;
734 __u16 size;
735 __u16 reserved;
736 struct ib_kern_tcp_udp_filter val;
737 struct ib_kern_tcp_udp_filter mask;
738};
739
740struct ib_kern_spec {
741 union {
742 struct {
743 __u32 type;
744 __u16 size;
745 __u16 reserved;
746 };
747 struct ib_kern_spec_eth eth;
748 struct ib_kern_spec_ipv4 ipv4;
749 struct ib_kern_spec_tcp_udp tcp_udp;
750 };
751};
752
753struct ib_kern_flow_attr {
754 __u32 type;
755 __u16 size;
756 __u16 priority;
757 __u8 num_of_specs;
758 __u8 reserved[2];
759 __u8 port;
760 __u32 flags;
761 /* Following are the optional layers according to user request
762 * struct ib_flow_spec_xxx
763 * struct ib_flow_spec_yyy
764 */
765};
766
767struct ib_uverbs_create_flow {
768 __u32 comp_mask;
769 __u64 response;
770 __u32 qp_handle;
771 struct ib_kern_flow_attr flow_attr;
772};
773
774struct ib_uverbs_create_flow_resp {
775 __u32 comp_mask;
776 __u32 flow_handle;
777};
778
779struct ib_uverbs_destroy_flow {
780 __u32 comp_mask;
781 __u32 flow_handle;
782};
783
687struct ib_uverbs_create_srq { 784struct ib_uverbs_create_srq {
688 __u64 response; 785 __u64 response;
689 __u64 user_handle; 786 __u64 user_handle;
diff --git a/include/uapi/sound/hdspm.h b/include/uapi/sound/hdspm.h
index 1f59ea2a4a76..d956c3593f65 100644
--- a/include/uapi/sound/hdspm.h
+++ b/include/uapi/sound/hdspm.h
@@ -111,7 +111,7 @@ struct hdspm_ltc {
111 enum hdspm_ltc_input_format input_format; 111 enum hdspm_ltc_input_format input_format;
112}; 112};
113 113
114#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_mixer_ioctl) 114#define SNDRV_HDSPM_IOCTL_GET_LTC _IOR('H', 0x46, struct hdspm_ltc)
115 115
116/** 116/**
117 * The status data reflects the device's current state 117 * The status data reflects the device's current state
diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h
index f88825928dd1..efed3c3383d6 100644
--- a/include/video/da8xx-fb.h
+++ b/include/video/da8xx-fb.h
@@ -23,6 +23,11 @@ enum raster_load_mode {
23 LOAD_PALETTE, 23 LOAD_PALETTE,
24}; 24};
25 25
26enum da8xx_frame_complete {
27 DA8XX_FRAME_WAIT,
28 DA8XX_FRAME_NOWAIT,
29};
30
26struct da8xx_lcdc_platform_data { 31struct da8xx_lcdc_platform_data {
27 const char manu_name[10]; 32 const char manu_name[10];
28 void *controller_data; 33 void *controller_data;
diff --git a/include/video/omap-panel-data.h b/include/video/omap-panel-data.h
index 6b2366fb6e53..f7ac8d972af0 100644
--- a/include/video/omap-panel-data.h
+++ b/include/video/omap-panel-data.h
@@ -33,124 +33,6 @@
33struct omap_dss_device; 33struct omap_dss_device;
34 34
35/** 35/**
36 * struct panel_generic_dpi_data - panel driver configuration data
37 * @name: panel name
38 * @platform_enable: platform specific panel enable function
39 * @platform_disable: platform specific panel disable function
40 * @num_gpios: number of gpios connected to panel
41 * @gpios: gpio numbers on the platform
42 * @gpio_invert: configure gpio as active high or low
43 */
44struct panel_generic_dpi_data {
45 const char *name;
46 int (*platform_enable)(struct omap_dss_device *dssdev);
47 void (*platform_disable)(struct omap_dss_device *dssdev);
48
49 int num_gpios;
50 int gpios[10];
51 bool gpio_invert[10];
52};
53
54/**
55 * struct panel_n8x0_data - N800 panel driver configuration data
56 */
57struct panel_n8x0_data {
58 int (*platform_enable)(struct omap_dss_device *dssdev);
59 void (*platform_disable)(struct omap_dss_device *dssdev);
60 int panel_reset;
61 int ctrl_pwrdown;
62};
63
64/**
65 * struct nokia_dsi_panel_data - Nokia DSI panel driver configuration data
66 * @name: panel name
67 * @use_ext_te: use external TE
68 * @ext_te_gpio: external TE GPIO
69 * @esd_interval: interval of ESD checks, 0 = disabled (ms)
70 * @ulps_timeout: time to wait before entering ULPS, 0 = disabled (ms)
71 * @use_dsi_backlight: true if panel uses DSI command to control backlight
72 * @pin_config: DSI pin configuration
73 */
74
75struct nokia_dsi_panel_data {
76 const char *name;
77
78 int reset_gpio;
79
80 bool use_ext_te;
81 int ext_te_gpio;
82
83 unsigned esd_interval;
84 unsigned ulps_timeout;
85
86 bool use_dsi_backlight;
87
88 struct omap_dsi_pin_config pin_config;
89};
90
91/**
92 * struct picodlp_panel_data - picodlp panel driver configuration data
93 * @picodlp_adapter_id: i2c_adapter number for picodlp
94 */
95struct picodlp_panel_data {
96 int picodlp_adapter_id;
97 int emu_done_gpio;
98 int pwrgood_gpio;
99};
100
101/**
102 * struct tfp410_platform_data - tfp410 panel driver configuration data
103 * @i2c_bus_num: i2c bus id for the panel
104 * @power_down_gpio: gpio number for PD pin (or -1 if not available)
105 */
106struct tfp410_platform_data {
107 int i2c_bus_num;
108 int power_down_gpio;
109};
110
111/**
112 * sharp ls panel driver configuration data
113 * @resb_gpio: reset signal
114 * @ini_gpio: power on control
115 * @mo_gpio: selection for resolution(VGA/QVGA)
116 * @lr_gpio: selection for horizontal scanning direction
117 * @ud_gpio: selection for vertical scanning direction
118 */
119struct panel_sharp_ls037v7dw01_data {
120 int resb_gpio;
121 int ini_gpio;
122 int mo_gpio;
123 int lr_gpio;
124 int ud_gpio;
125};
126
127/**
128 * acx565akm panel driver configuration data
129 * @reset_gpio: reset signal
130 */
131struct panel_acx565akm_data {
132 int reset_gpio;
133};
134
135/**
136 * nec nl8048 panel driver configuration data
137 * @res_gpio: reset signal
138 * @qvga_gpio: selection for resolution(QVGA/WVGA)
139 */
140struct panel_nec_nl8048_data {
141 int res_gpio;
142 int qvga_gpio;
143};
144
145/**
146 * tpo td043 panel driver configuration data
147 * @nreset_gpio: reset signal
148 */
149struct panel_tpo_td043_data {
150 int nreset_gpio;
151};
152
153/**
154 * encoder_tfp410 platform data 36 * encoder_tfp410 platform data
155 * @name: name for this display entity 37 * @name: name for this display entity
156 * @power_down_gpio: gpio number for PD pin (or -1 if not available) 38 * @power_down_gpio: gpio number for PD pin (or -1 if not available)
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index b39463553845..3d7c51a6f9ff 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -250,19 +250,6 @@ struct rfbi_timings {
250 int converted; 250 int converted;
251}; 251};
252 252
253void omap_rfbi_write_command(const void *buf, u32 len);
254void omap_rfbi_read_data(void *buf, u32 len);
255void omap_rfbi_write_data(const void *buf, u32 len);
256void omap_rfbi_write_pixels(const void __iomem *buf, int scr_width,
257 u16 x, u16 y,
258 u16 w, u16 h);
259int omap_rfbi_enable_te(bool enable, unsigned line);
260int omap_rfbi_setup_te(enum omap_rfbi_te_mode mode,
261 unsigned hs_pulse_time, unsigned vs_pulse_time,
262 int hs_pol_inv, int vs_pol_inv, int extif_div);
263void rfbi_bus_lock(void);
264void rfbi_bus_unlock(void);
265
266/* DSI */ 253/* DSI */
267 254
268enum omap_dss_dsi_trans_mode { 255enum omap_dss_dsi_trans_mode {
@@ -321,39 +308,6 @@ struct omap_dss_dsi_config {
321 enum omap_dss_dsi_trans_mode trans_mode; 308 enum omap_dss_dsi_trans_mode trans_mode;
322}; 309};
323 310
324void dsi_bus_lock(struct omap_dss_device *dssdev);
325void dsi_bus_unlock(struct omap_dss_device *dssdev);
326int dsi_vc_dcs_write(struct omap_dss_device *dssdev, int channel, u8 *data,
327 int len);
328int dsi_vc_generic_write(struct omap_dss_device *dssdev, int channel, u8 *data,
329 int len);
330int dsi_vc_dcs_write_0(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd);
331int dsi_vc_generic_write_0(struct omap_dss_device *dssdev, int channel);
332int dsi_vc_dcs_write_1(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
333 u8 param);
334int dsi_vc_generic_write_1(struct omap_dss_device *dssdev, int channel,
335 u8 param);
336int dsi_vc_generic_write_2(struct omap_dss_device *dssdev, int channel,
337 u8 param1, u8 param2);
338int dsi_vc_dcs_write_nosync(struct omap_dss_device *dssdev, int channel,
339 u8 *data, int len);
340int dsi_vc_generic_write_nosync(struct omap_dss_device *dssdev, int channel,
341 u8 *data, int len);
342int dsi_vc_dcs_read(struct omap_dss_device *dssdev, int channel, u8 dcs_cmd,
343 u8 *buf, int buflen);
344int dsi_vc_generic_read_0(struct omap_dss_device *dssdev, int channel, u8 *buf,
345 int buflen);
346int dsi_vc_generic_read_1(struct omap_dss_device *dssdev, int channel, u8 param,
347 u8 *buf, int buflen);
348int dsi_vc_generic_read_2(struct omap_dss_device *dssdev, int channel,
349 u8 param1, u8 param2, u8 *buf, int buflen);
350int dsi_vc_set_max_rx_packet_size(struct omap_dss_device *dssdev, int channel,
351 u16 len);
352int dsi_vc_send_null(struct omap_dss_device *dssdev, int channel);
353int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);
354int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel);
355void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel);
356
357enum omapdss_version { 311enum omapdss_version {
358 OMAPDSS_VER_UNKNOWN = 0, 312 OMAPDSS_VER_UNKNOWN = 0,
359 OMAPDSS_VER_OMAP24xx, 313 OMAPDSS_VER_OMAP24xx,
@@ -749,10 +703,6 @@ struct omapdss_dsi_ops {
749}; 703};
750 704
751struct omap_dss_device { 705struct omap_dss_device {
752 /* old device, to be removed */
753 struct device old_dev;
754
755 /* new device, pointer to panel device */
756 struct device *dev; 706 struct device *dev;
757 707
758 struct module *owner; 708 struct module *owner;
@@ -765,9 +715,6 @@ struct omap_dss_device {
765 enum omap_display_type type; 715 enum omap_display_type type;
766 enum omap_display_type output_type; 716 enum omap_display_type output_type;
767 717
768 /* obsolete, to be removed */
769 enum omap_channel channel;
770
771 union { 718 union {
772 struct { 719 struct {
773 u8 data_lines; 720 u8 data_lines;
@@ -827,7 +774,7 @@ struct omap_dss_device {
827 774
828 enum omap_display_caps caps; 775 enum omap_display_caps caps;
829 776
830 struct omap_dss_device *output; 777 struct omap_dss_device *src;
831 778
832 enum omap_dss_display_state state; 779 enum omap_dss_display_state state;
833 780
@@ -846,7 +793,7 @@ struct omap_dss_device {
846 /* dynamic fields */ 793 /* dynamic fields */
847 struct omap_overlay_manager *manager; 794 struct omap_overlay_manager *manager;
848 795
849 struct omap_dss_device *device; 796 struct omap_dss_device *dst;
850}; 797};
851 798
852struct omap_dss_hdmi_data 799struct omap_dss_hdmi_data
@@ -857,8 +804,6 @@ struct omap_dss_hdmi_data
857}; 804};
858 805
859struct omap_dss_driver { 806struct omap_dss_driver {
860 struct device_driver driver;
861
862 int (*probe)(struct omap_dss_device *); 807 int (*probe)(struct omap_dss_device *);
863 void (*remove)(struct omap_dss_device *); 808 void (*remove)(struct omap_dss_device *);
864 809
@@ -1023,51 +968,6 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
1023#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) 968#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
1024#define to_dss_device(x) container_of((x), struct omap_dss_device, old_dev) 969#define to_dss_device(x) container_of((x), struct omap_dss_device, old_dev)
1025 970
1026void omapdss_dsi_vc_enable_hs(struct omap_dss_device *dssdev, int channel,
1027 bool enable);
1028int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable);
1029int omapdss_dsi_set_config(struct omap_dss_device *dssdev,
1030 const struct omap_dss_dsi_config *config);
1031
1032int omap_dsi_update(struct omap_dss_device *dssdev, int channel,
1033 void (*callback)(int, void *), void *data);
1034int omap_dsi_request_vc(struct omap_dss_device *dssdev, int *channel);
1035int omap_dsi_set_vc_id(struct omap_dss_device *dssdev, int channel, int vc_id);
1036void omap_dsi_release_vc(struct omap_dss_device *dssdev, int channel);
1037int omapdss_dsi_configure_pins(struct omap_dss_device *dssdev,
1038 const struct omap_dsi_pin_config *pin_cfg);
1039
1040int omapdss_dsi_display_enable(struct omap_dss_device *dssdev);
1041void omapdss_dsi_display_disable(struct omap_dss_device *dssdev,
1042 bool disconnect_lanes, bool enter_ulps);
1043
1044int omapdss_dpi_display_enable(struct omap_dss_device *dssdev);
1045void omapdss_dpi_display_disable(struct omap_dss_device *dssdev);
1046void omapdss_dpi_set_timings(struct omap_dss_device *dssdev,
1047 struct omap_video_timings *timings);
1048int dpi_check_timings(struct omap_dss_device *dssdev,
1049 struct omap_video_timings *timings);
1050void omapdss_dpi_set_data_lines(struct omap_dss_device *dssdev, int data_lines);
1051
1052int omapdss_sdi_display_enable(struct omap_dss_device *dssdev);
1053void omapdss_sdi_display_disable(struct omap_dss_device *dssdev);
1054void omapdss_sdi_set_timings(struct omap_dss_device *dssdev,
1055 struct omap_video_timings *timings);
1056void omapdss_sdi_set_datapairs(struct omap_dss_device *dssdev, int datapairs);
1057
1058int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev);
1059void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev);
1060int omap_rfbi_update(struct omap_dss_device *dssdev, void (*callback)(void *),
1061 void *data);
1062int omap_rfbi_configure(struct omap_dss_device *dssdev);
1063void omapdss_rfbi_set_size(struct omap_dss_device *dssdev, u16 w, u16 h);
1064void omapdss_rfbi_set_pixel_size(struct omap_dss_device *dssdev,
1065 int pixel_size);
1066void omapdss_rfbi_set_data_lines(struct omap_dss_device *dssdev,
1067 int data_lines);
1068void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev,
1069 struct rfbi_timings *timings);
1070
1071int omapdss_compat_init(void); 971int omapdss_compat_init(void);
1072void omapdss_compat_uninit(void); 972void omapdss_compat_uninit(void);
1073 973
@@ -1111,7 +1011,7 @@ void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
1111 1011
1112static inline bool omapdss_device_is_connected(struct omap_dss_device *dssdev) 1012static inline bool omapdss_device_is_connected(struct omap_dss_device *dssdev)
1113{ 1013{
1114 return dssdev->output; 1014 return dssdev->src;
1115} 1015}
1116 1016
1117static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev) 1017static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)
diff --git a/include/xen/acpi.h b/include/xen/acpi.h
index 46aa3d1c1654..4ddd7dc4a61e 100644
--- a/include/xen/acpi.h
+++ b/include/xen/acpi.h
@@ -75,8 +75,10 @@ static inline int xen_acpi_get_pxm(acpi_handle h)
75 return -ENXIO; 75 return -ENXIO;
76} 76}
77 77
78int xen_acpi_notify_hypervisor_state(u8 sleep_state, 78int xen_acpi_notify_hypervisor_sleep(u8 sleep_state,
79 u32 pm1a_cnt, u32 pm1b_cnd); 79 u32 pm1a_cnt, u32 pm1b_cnd);
80int xen_acpi_notify_hypervisor_extended_sleep(u8 sleep_state,
81 u32 val_a, u32 val_b);
80 82
81static inline int xen_acpi_suspend_lowlevel(void) 83static inline int xen_acpi_suspend_lowlevel(void)
82{ 84{
@@ -93,7 +95,9 @@ static inline void xen_acpi_sleep_register(void)
93{ 95{
94 if (xen_initial_domain()) { 96 if (xen_initial_domain()) {
95 acpi_os_set_prepare_sleep( 97 acpi_os_set_prepare_sleep(
96 &xen_acpi_notify_hypervisor_state); 98 &xen_acpi_notify_hypervisor_sleep);
99 acpi_os_set_prepare_extended_sleep(
100 &xen_acpi_notify_hypervisor_extended_sleep);
97 101
98 acpi_suspend_lowlevel = xen_acpi_suspend_lowlevel; 102 acpi_suspend_lowlevel = xen_acpi_suspend_lowlevel;
99 } 103 }
diff --git a/include/xen/balloon.h b/include/xen/balloon.h
index cc2e1a7e44ec..a4c1c6a93691 100644
--- a/include/xen/balloon.h
+++ b/include/xen/balloon.h
@@ -29,6 +29,9 @@ int alloc_xenballooned_pages(int nr_pages, struct page **pages,
29 bool highmem); 29 bool highmem);
30void free_xenballooned_pages(int nr_pages, struct page **pages); 30void free_xenballooned_pages(int nr_pages, struct page **pages);
31 31
32struct page *get_balloon_scratch_page(void);
33void put_balloon_scratch_page(void);
34
32struct device; 35struct device;
33#ifdef CONFIG_XEN_SELFBALLOONING 36#ifdef CONFIG_XEN_SELFBALLOONING
34extern int register_xen_selfballooning(struct device *dev); 37extern int register_xen_selfballooning(struct device *dev);
diff --git a/include/xen/interface/io/tpmif.h b/include/xen/interface/io/tpmif.h
new file mode 100644
index 000000000000..28e7dcd75e82
--- /dev/null
+++ b/include/xen/interface/io/tpmif.h
@@ -0,0 +1,52 @@
1/******************************************************************************
2 * tpmif.h
3 *
4 * TPM I/O interface for Xen guest OSes, v2
5 *
6 * This file is in the public domain.
7 *
8 */
9
10#ifndef __XEN_PUBLIC_IO_TPMIF_H__
11#define __XEN_PUBLIC_IO_TPMIF_H__
12
13/*
14 * Xenbus state machine
15 *
16 * Device open:
17 * 1. Both ends start in XenbusStateInitialising
18 * 2. Backend transitions to InitWait (frontend does not wait on this step)
19 * 3. Frontend populates ring-ref, event-channel, feature-protocol-v2
20 * 4. Frontend transitions to Initialised
21 * 5. Backend maps grant and event channel, verifies feature-protocol-v2
22 * 6. Backend transitions to Connected
23 * 7. Frontend verifies feature-protocol-v2, transitions to Connected
24 *
25 * Device close:
26 * 1. State is changed to XenbusStateClosing
27 * 2. Frontend transitions to Closed
28 * 3. Backend unmaps grant and event, changes state to InitWait
29 */
30
31enum vtpm_shared_page_state {
32 VTPM_STATE_IDLE, /* no contents / vTPM idle / cancel complete */
33 VTPM_STATE_SUBMIT, /* request ready / vTPM working */
34 VTPM_STATE_FINISH, /* response ready / vTPM idle */
35 VTPM_STATE_CANCEL, /* cancel requested / vTPM working */
36};
37/* The backend should only change state to IDLE or FINISH, while the
38 * frontend should only change to SUBMIT or CANCEL. */
39
40
41struct vtpm_shared_page {
42 uint32_t length; /* request/response length in bytes */
43
44 uint8_t state; /* enum vtpm_shared_page_state */
45 uint8_t locality; /* for the current request */
46 uint8_t pad;
47
48 uint8_t nr_extra_pages; /* extra pages for long packets; may be zero */
49 uint32_t extra_pages[0]; /* grant IDs; length in nr_extra_pages */
50};
51
52#endif
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
index c57d5f67f702..f1331e3e7271 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -152,10 +152,11 @@ DEFINE_GUEST_HANDLE_STRUCT(xenpf_firmware_info_t);
152#define XENPF_enter_acpi_sleep 51 152#define XENPF_enter_acpi_sleep 51
153struct xenpf_enter_acpi_sleep { 153struct xenpf_enter_acpi_sleep {
154 /* IN variables */ 154 /* IN variables */
155 uint16_t pm1a_cnt_val; /* PM1a control value. */ 155 uint16_t val_a; /* PM1a control / sleep type A. */
156 uint16_t pm1b_cnt_val; /* PM1b control value. */ 156 uint16_t val_b; /* PM1b control / sleep type B. */
157 uint32_t sleep_state; /* Which state to enter (Sn). */ 157 uint32_t sleep_state; /* Which state to enter (Sn). */
158 uint32_t flags; /* Must be zero. */ 158#define XENPF_ACPI_SLEEP_EXTENDED 0x00000001
159 uint32_t flags; /* XENPF_ACPI_SLEEP_*. */
159}; 160};
160DEFINE_GUEST_HANDLE_STRUCT(xenpf_enter_acpi_sleep_t); 161DEFINE_GUEST_HANDLE_STRUCT(xenpf_enter_acpi_sleep_t);
161 162
diff --git a/include/xen/interface/vcpu.h b/include/xen/interface/vcpu.h
index 87e6f8a48661..b05288ce3991 100644
--- a/include/xen/interface/vcpu.h
+++ b/include/xen/interface/vcpu.h
@@ -170,4 +170,6 @@ struct vcpu_register_vcpu_info {
170}; 170};
171DEFINE_GUEST_HANDLE_STRUCT(vcpu_register_vcpu_info); 171DEFINE_GUEST_HANDLE_STRUCT(vcpu_register_vcpu_info);
172 172
173/* Send an NMI to the specified VCPU. @extra_arg == NULL. */
174#define VCPUOP_send_nmi 11
173#endif /* __XEN_PUBLIC_VCPU_H__ */ 175#endif /* __XEN_PUBLIC_VCPU_H__ */