aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h1
-rw-r--r--include/acpi/acexcep.h2
-rw-r--r--include/acpi/acnames.h1
-rw-r--r--include/acpi/acpi_bus.h78
-rw-r--r--include/acpi/acpi_drivers.h4
-rw-r--r--include/acpi/acpiosxf.h3
-rw-r--r--include/acpi/acpixf.h18
-rw-r--r--include/acpi/actbl3.h22
-rw-r--r--include/acpi/actypes.h42
-rw-r--r--include/asm-generic/gpio.h52
-rw-r--r--include/asm-generic/io.h21
-rw-r--r--include/asm-generic/pgtable.h26
-rw-r--r--include/asm-generic/signal.h2
-rw-r--r--include/asm-generic/syscalls.h20
-rw-r--r--include/asm-generic/trace_clock.h16
-rw-r--r--include/crypto/cast5.h6
-rw-r--r--include/crypto/cast6.h6
-rw-r--r--include/crypto/cast_common.h9
-rw-r--r--include/crypto/vmac.h2
-rw-r--r--include/drm/drm_pciids.h1
-rw-r--r--include/linux/acpi.h151
-rw-r--r--include/linux/acpi_gpio.h19
-rw-r--r--include/linux/amba/bus.h10
-rw-r--r--include/linux/ata_platform.h2
-rw-r--r--include/linux/ath9k_platform.h2
-rw-r--r--include/linux/atmdev.h2
-rw-r--r--include/linux/atmel-ssc.h6
-rw-r--r--include/linux/balloon_compaction.h272
-rw-r--r--include/linux/bcm47xx_wdt.h19
-rw-r--r--include/linux/bcma/bcma.h7
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h21
-rw-r--r--include/linux/bcma/bcma_driver_mips.h3
-rw-r--r--include/linux/bcma/bcma_regs.h5
-rw-r--r--include/linux/binfmts.h4
-rw-r--r--include/linux/bootmem.h7
-rw-r--r--include/linux/bug.h1
-rw-r--r--include/linux/cgroup.h167
-rw-r--r--include/linux/clk-provider.h24
-rw-r--r--include/linux/clk/mvebu.h22
-rw-r--r--include/linux/clk/sunxi.h22
-rw-r--r--include/linux/clk/zynq.h24
-rw-r--r--include/linux/compat.h4
-rw-r--r--include/linux/context_tracking.h18
-rw-r--r--include/linux/coredump.h4
-rw-r--r--include/linux/cpu_cooling.h6
-rw-r--r--include/linux/cpufreq.h5
-rw-r--r--include/linux/cpuidle.h15
-rw-r--r--include/linux/cpuset.h2
-rw-r--r--include/linux/devfreq.h136
-rw-r--r--include/linux/device.h25
-rw-r--r--include/linux/devpts_fs.h20
-rw-r--r--include/linux/dlm.h2
-rw-r--r--include/linux/dma-contiguous.h4
-rw-r--r--include/linux/dma/ipu-dma.h177
-rw-r--r--include/linux/dvb/Kbuild0
-rw-r--r--include/linux/dvb/dmx.h29
-rw-r--r--include/linux/dvb/video.h29
-rw-r--r--include/linux/earlycpio.h17
-rw-r--r--include/linux/edac.h3
-rw-r--r--include/linux/efi.h78
-rw-r--r--include/linux/etherdevice.h20
-rw-r--r--include/linux/extcon.h50
-rw-r--r--include/linux/fdtable.h1
-rw-r--r--include/linux/filter.h3
-rw-r--r--include/linux/freezer.h58
-rw-r--r--include/linux/fs.h7
-rw-r--r--include/linux/fs_struct.h1
-rw-r--r--include/linux/fsl-diu-fb.h9
-rw-r--r--include/linux/ftrace_event.h20
-rw-r--r--include/linux/gfp.h8
-rw-r--r--include/linux/gpio.h21
-rw-r--r--include/linux/hardirq.h15
-rw-r--r--include/linux/hash.h2
-rw-r--r--include/linux/hdlc/Kbuild1
-rw-r--r--include/linux/hid-sensor-ids.h1
-rw-r--r--include/linux/hid.h6
-rw-r--r--include/linux/huge_mm.h22
-rw-r--r--include/linux/hugetlb.h7
-rw-r--r--include/linux/hw_breakpoint.h31
-rw-r--r--include/linux/i2c-omap.h1
-rw-r--r--include/linux/i2c.h9
-rw-r--r--include/linux/i2c/i2c-hid.h35
-rw-r--r--include/linux/i2c/pcf857x.h3
-rw-r--r--include/linux/ieee80211.h188
-rw-r--r--include/linux/if_tunnel.h17
-rw-r--r--include/linux/iio/buffer.h26
-rw-r--r--include/linux/iio/consumer.h50
-rw-r--r--include/linux/iio/iio.h5
-rw-r--r--include/linux/iio/imu/adis.h280
-rw-r--r--include/linux/iio/machine.h2
-rw-r--r--include/linux/iio/types.h2
-rw-r--r--include/linux/inetdevice.h3
-rw-r--r--include/linux/init.h18
-rw-r--r--include/linux/input/mt.h6
-rw-r--r--include/linux/ip.h5
-rw-r--r--include/linux/ipack.h245
-rw-r--r--include/linux/ipmi_smi.h2
-rw-r--r--include/linux/ipv6.h38
-rw-r--r--include/linux/irq.h19
-rw-r--r--include/linux/irqchip/spear-shirq.h64
-rw-r--r--include/linux/irqchip/sunxi.h27
-rw-r--r--include/linux/irqchip/versatile-fpga.h13
-rw-r--r--include/linux/irqdesc.h3
-rw-r--r--include/linux/jiffies.h3
-rw-r--r--include/linux/kernel.h22
-rw-r--r--include/linux/kernel_stat.h17
-rw-r--r--include/linux/kobject.h18
-rw-r--r--include/linux/ktime.h19
-rw-r--r--include/linux/kvm_host.h65
-rw-r--r--include/linux/leds.h17
-rw-r--r--include/linux/libata.h5
-rw-r--r--include/linux/lru_cache.h4
-rw-r--r--include/linux/memcontrol.h9
-rw-r--r--include/linux/memory.h2
-rw-r--r--include/linux/memory_hotplug.h13
-rw-r--r--include/linux/mempolicy.h16
-rw-r--r--include/linux/mfd/88pm80x.h2
-rw-r--r--include/linux/mfd/abx500.h34
-rw-r--r--include/linux/mfd/abx500/ab8500.h4
-rw-r--r--include/linux/mfd/arizona/core.h4
-rw-r--r--include/linux/mfd/arizona/pdata.h6
-rw-r--r--include/linux/mfd/arizona/registers.h16
-rw-r--r--include/linux/mfd/da9055/pdata.h27
-rw-r--r--include/linux/mfd/db8500-prcmu.h4
-rw-r--r--include/linux/mfd/dbx500-prcmu.h10
-rw-r--r--include/linux/mfd/lp8788.h8
-rw-r--r--include/linux/mfd/max8997-private.h1
-rw-r--r--include/linux/mfd/max8997.h1
-rw-r--r--include/linux/mfd/menelaus.h47
-rw-r--r--include/linux/mfd/pm8xxx/irq.h8
-rw-r--r--include/linux/mfd/rtsx_common.h48
-rw-r--r--include/linux/mfd/rtsx_pci.h794
-rw-r--r--include/linux/mfd/tps65090.h35
-rw-r--r--include/linux/mfd/tps6586x.h3
-rw-r--r--include/linux/mfd/wm8994/core.h4
-rw-r--r--include/linux/mfd/wm8994/pdata.h5
-rw-r--r--include/linux/micrel_phy.h1
-rw-r--r--include/linux/migrate.h18
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mlx4/device.h21
-rw-r--r--include/linux/mm.h31
-rw-r--r--include/linux/mm_types.h19
-rw-r--r--include/linux/mman.h2
-rw-r--r--include/linux/mmc/card.h2
-rw-r--r--include/linux/mmc/core.h2
-rw-r--r--include/linux/mmc/dw_mmc.h5
-rw-r--r--include/linux/mmc/host.h17
-rw-r--r--include/linux/mmc/mmc.h2
-rw-r--r--include/linux/mmc/mxs-mmc.h19
-rw-r--r--include/linux/mmc/sdhci.h6
-rw-r--r--include/linux/mmzone.h50
-rw-r--r--include/linux/netdevice.h49
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h9
-rw-r--r--include/linux/nfc/pn544.h104
-rw-r--r--include/linux/node.h3
-rw-r--r--include/linux/nodemask.h5
-rw-r--r--include/linux/of.h59
-rw-r--r--include/linux/of_address.h2
-rw-r--r--include/linux/of_i2c.h12
-rw-r--r--include/linux/omap-dma.h366
-rw-r--r--include/linux/omap-iommu.h52
-rw-r--r--include/linux/oom.h21
-rw-r--r--include/linux/openvswitch.h1
-rw-r--r--include/linux/page-isolation.h10
-rw-r--r--include/linux/pagemap.h16
-rw-r--r--include/linux/pci.h44
-rw-r--r--include/linux/pci_ids.h5
-rw-r--r--include/linux/percpu-rwsem.h4
-rw-r--r--include/linux/pinctrl/pinconf-generic.h5
-rw-r--r--include/linux/pinctrl/pinctrl.h19
-rw-r--r--include/linux/platform_data/ad5449.h40
-rw-r--r--include/linux/platform_data/ad7298.h20
-rw-r--r--include/linux/platform_data/ad7793.h112
-rw-r--r--include/linux/platform_data/ad7887.h26
-rw-r--r--include/linux/platform_data/ads7828.h29
-rw-r--r--include/linux/platform_data/asoc-imx-ssi.h2
-rw-r--r--include/linux/platform_data/asoc-s3c.h6
-rw-r--r--include/linux/platform_data/atmel.h73
-rw-r--r--include/linux/platform_data/clk-integrator.h2
-rw-r--r--include/linux/platform_data/clocksource-nomadik-mtu.h9
-rw-r--r--include/linux/platform_data/cpsw.h23
-rw-r--r--include/linux/platform_data/crypto-ux500.h2
-rw-r--r--include/linux/platform_data/davinci_asp.h4
-rw-r--r--include/linux/platform_data/db8500_thermal.h38
-rw-r--r--include/linux/platform_data/dma-imx.h4
-rw-r--r--include/linux/platform_data/dma-mv_xor.h11
-rw-r--r--include/linux/platform_data/dma-ste-dma40.h223
-rw-r--r--include/linux/platform_data/dmtimer-omap.h31
-rw-r--r--include/linux/platform_data/gpio-omap.h1
-rw-r--r--include/linux/platform_data/gpio-ts5500.h27
-rw-r--r--include/linux/platform_data/iommu-omap.h49
-rw-r--r--include/linux/platform_data/leds-omap.h22
-rw-r--r--include/linux/platform_data/macb.h1
-rw-r--r--include/linux/platform_data/mmc-omap.h151
-rw-r--r--include/linux/platform_data/mtd-nand-omap2.h46
-rw-r--r--include/linux/platform_data/mtd-onenand-omap2.h28
-rw-r--r--include/linux/platform_data/omap-twl4030.h26
-rw-r--r--include/linux/platform_data/omap-wd-timer.h38
-rw-r--r--include/linux/platform_data/omap_drm.h1
-rw-r--r--include/linux/platform_data/pinctrl-coh901.h4
-rw-r--r--include/linux/platform_data/pinctrl-nomadik.h266
-rw-r--r--include/linux/platform_data/pn544.h44
-rw-r--r--include/linux/platform_data/pxa2xx_udc.h27
-rw-r--r--include/linux/platform_data/pxa_sdhci.h6
-rw-r--r--include/linux/platform_data/sa11x0-serial.h33
-rw-r--r--include/linux/platform_data/spi-clps711x.h21
-rw-r--r--include/linux/platform_data/spi-omap2-mcspi.h4
-rw-r--r--include/linux/platform_data/uio_dmem_genirq.h26
-rw-r--r--include/linux/platform_data/uio_pruss.h3
-rw-r--r--include/linux/platform_data/usb-omap.h80
-rw-r--r--include/linux/platform_device.h1
-rw-r--r--include/linux/pm.h3
-rw-r--r--include/linux/pm_qos.h77
-rw-r--r--include/linux/power/bq2415x_charger.h95
-rw-r--r--include/linux/power/smartreflex.h14
-rw-r--r--include/linux/power_supply.h3
-rw-r--r--include/linux/pstore.h6
-rw-r--r--include/linux/ptrace.h13
-rw-r--r--include/linux/pvclock_gtod.h9
-rw-r--r--include/linux/rculist.h17
-rw-r--r--include/linux/rcupdate.h29
-rw-r--r--include/linux/regmap.h95
-rw-r--r--include/linux/regulator/consumer.h13
-rw-r--r--include/linux/regulator/driver.h5
-rw-r--r--include/linux/regulator/max8973-regulator.h72
-rw-r--r--include/linux/regulator/tps51632-regulator.h47
-rw-r--r--include/linux/regulator/tps65090-regulator.h50
-rw-r--r--include/linux/res_counter.h5
-rw-r--r--include/linux/ring_buffer.h3
-rw-r--r--include/linux/rtnetlink.h3
-rw-r--r--include/linux/sched.h81
-rw-r--r--include/linux/serial_8250.h2
-rw-r--r--include/linux/serial_core.h6
-rw-r--r--include/linux/sh_clk.h9
-rw-r--r--include/linux/shm.h15
-rw-r--r--include/linux/skbuff.h102
-rw-r--r--include/linux/smscphy.h5
-rw-r--r--include/linux/spi/ads7846.h5
-rw-r--r--include/linux/spi/spi-tegra.h40
-rw-r--r--include/linux/spi/spi.h3
-rw-r--r--include/linux/srcu.h34
-rw-r--r--include/linux/ssb/ssb.h6
-rw-r--r--include/linux/ssb/ssb_driver_chipcommon.h8
-rw-r--r--include/linux/ssb/ssb_driver_extif.h53
-rw-r--r--include/linux/ssb/ssb_driver_mips.h10
-rw-r--r--include/linux/ssb/ssb_regs.h2
-rw-r--r--include/linux/stmmac.h3
-rw-r--r--include/linux/sunxi_timer.h24
-rw-r--r--include/linux/syscalls.h16
-rw-r--r--include/linux/sysctl.h3
-rw-r--r--include/linux/tcp.h10
-rw-r--r--include/linux/tegra-ahb.h19
-rw-r--r--include/linux/thermal.h134
-rw-r--r--include/linux/tick.h6
-rw-r--r--include/linux/timecompare.h125
-rw-r--r--include/linux/trace_clock.h2
-rw-r--r--include/linux/tty.h45
-rw-r--r--include/linux/tty_flip.h2
-rw-r--r--include/linux/types.h1
-rw-r--r--include/linux/udp.h5
-rw-r--r--include/linux/uprobes.h10
-rw-r--r--include/linux/usb.h50
-rw-r--r--include/linux/usb/cdc_ncm.h134
-rw-r--r--include/linux/usb/composite.h4
-rw-r--r--include/linux/usb/ehci_pdriver.h5
-rw-r--r--include/linux/usb/ezusb.h8
-rw-r--r--include/linux/usb/gadget.h7
-rw-r--r--include/linux/usb/ohci_pdriver.h2
-rw-r--r--include/linux/usb/phy.h15
-rw-r--r--include/linux/usb/usbnet.h10
-rw-r--r--include/linux/vexpress.h121
-rw-r--r--include/linux/vgaarb.h4
-rw-r--r--include/linux/vm_event_item.h2
-rw-r--r--include/linux/vtime.h48
-rw-r--r--include/linux/watchdog.h2
-rw-r--r--include/linux/writeback.h9
-rw-r--r--include/media/adp1653.h4
-rw-r--r--include/media/adv7604.h21
-rw-r--r--include/media/davinci/vpbe_display.h15
-rw-r--r--include/media/davinci/vpbe_osd.h2
-rw-r--r--include/media/ir-kbd-i2c.h2
-rw-r--r--include/media/mt9v022.h16
-rw-r--r--include/media/rc-core.h4
-rw-r--r--include/media/rc-map.h64
-rw-r--r--include/media/s3c_camif.h45
-rw-r--r--include/media/smiapp.h2
-rw-r--r--include/media/v4l2-event.h2
-rw-r--r--include/media/v4l2-fh.h2
-rw-r--r--include/media/v4l2-ioctl.h2
-rw-r--r--include/media/v4l2-mem2mem.h3
-rw-r--r--include/media/videobuf2-core.h38
-rw-r--r--include/media/videobuf2-memops.h5
-rw-r--r--include/net/addrconf.h3
-rw-r--r--include/net/af_unix.h1
-rw-r--r--include/net/bluetooth/a2mp.h24
-rw-r--r--include/net/bluetooth/amp.h54
-rw-r--r--include/net/bluetooth/bluetooth.h1
-rw-r--r--include/net/bluetooth/hci.h69
-rw-r--r--include/net/bluetooth/hci_core.h123
-rw-r--r--include/net/bluetooth/l2cap.h50
-rw-r--r--include/net/cfg80211.h306
-rw-r--r--include/net/cls_cgroup.h6
-rw-r--r--include/net/gro_cells.h14
-rw-r--r--include/net/ieee80211_radiotap.h24
-rw-r--r--include/net/inet_hashtables.h50
-rw-r--r--include/net/inet_sock.h8
-rw-r--r--include/net/inet_timewait_sock.h7
-rw-r--r--include/net/ip6_checksum.h35
-rw-r--r--include/net/ip6_fib.h20
-rw-r--r--include/net/ip6_route.h3
-rw-r--r--include/net/ip_vs.h195
-rw-r--r--include/net/ipip.h40
-rw-r--r--include/net/ipv6.h19
-rw-r--r--include/net/irda/irlmp.h2
-rw-r--r--include/net/mac80211.h275
-rw-r--r--include/net/ndisc.h15
-rw-r--r--include/net/net_namespace.h24
-rw-r--r--include/net/netfilter/nf_conntrack.h2
-rw-r--r--include/net/netfilter/nf_nat.h15
-rw-r--r--include/net/netfilter/nf_queue.h8
-rw-r--r--include/net/netns/sctp.h3
-rw-r--r--include/net/netprio_cgroup.h11
-rw-r--r--include/net/nfc/hci.h21
-rw-r--r--include/net/nfc/nfc.h2
-rw-r--r--include/net/protocol.h31
-rw-r--r--include/net/request_sock.h12
-rw-r--r--include/net/route.h9
-rw-r--r--include/net/rtnetlink.h2
-rw-r--r--include/net/sch_generic.h7
-rw-r--r--include/net/sctp/command.h38
-rw-r--r--include/net/sctp/constants.h8
-rw-r--r--include/net/sctp/sctp.h12
-rw-r--r--include/net/sctp/sm.h2
-rw-r--r--include/net/sctp/structs.h39
-rw-r--r--include/net/sctp/ulpqueue.h2
-rw-r--r--include/net/sctp/user.h27
-rw-r--r--include/net/sock.h30
-rw-r--r--include/net/tcp.h2
-rw-r--r--include/net/xfrm.h2
-rw-r--r--include/rdma/Kbuild6
-rw-r--r--include/rdma/rdma_netlink.h36
-rw-r--r--include/scsi/scsi_device.h5
-rw-r--r--include/scsi/scsi_transport_sas.h1
-rw-r--r--include/scsi/scsi_transport_srp.h8
-rw-r--r--include/sound/Kbuild10
-rw-r--r--include/sound/asequencer.h594
-rw-r--r--include/sound/asound.h935
-rw-r--r--include/sound/cs4271.h1
-rw-r--r--include/sound/emu10k1.h359
-rw-r--r--include/sound/pcm.h3
-rw-r--r--include/sound/sb16_csp.h104
-rw-r--r--include/sound/sh_fsi.h6
-rw-r--r--include/sound/tlv320aic32x4.h1
-rw-r--r--include/sound/vx_core.h6
-rw-r--r--include/target/target_core_backend.h49
-rw-r--r--include/target/target_core_base.h212
-rw-r--r--include/target/target_core_fabric.h15
-rw-r--r--include/trace/events/gfpflags.h1
-rw-r--r--include/trace/events/oom.h4
-rw-r--r--include/trace/events/rcu.h1
-rw-r--r--include/trace/events/task.h8
-rw-r--r--include/trace/ftrace.h76
-rw-r--r--include/trace/syscall.h23
-rw-r--r--include/uapi/asm-generic/ioctls.h3
-rw-r--r--include/uapi/asm-generic/mman-common.h11
-rw-r--r--include/uapi/asm-generic/mman.h2
-rw-r--r--include/uapi/asm-generic/socket.h1
-rw-r--r--include/uapi/linux/Kbuild2
-rw-r--r--include/uapi/linux/ethtool.h25
-rw-r--r--include/uapi/linux/filter.h4
-rw-r--r--include/uapi/linux/hdlc/Kbuild1
-rw-r--r--include/uapi/linux/hdlc/ioctl.h (renamed from include/linux/hdlc/ioctl.h)7
-rw-r--r--include/uapi/linux/hw_breakpoint.h30
-rw-r--r--include/uapi/linux/if_bridge.h81
-rw-r--r--include/uapi/linux/if_ether.h1
-rw-r--r--include/uapi/linux/if_link.h22
-rw-r--r--include/uapi/linux/if_packet.h1
-rw-r--r--include/uapi/linux/if_tun.h7
-rw-r--r--include/uapi/linux/if_tunnel.h20
-rw-r--r--include/uapi/linux/in6.h1
-rw-r--r--include/uapi/linux/inet_diag.h3
-rw-r--r--include/uapi/linux/input.h1
-rw-r--r--include/uapi/linux/ipv6.h1
-rw-r--r--include/uapi/linux/ipv6_route.h3
-rw-r--r--include/uapi/linux/kvm.h21
-rw-r--r--include/uapi/linux/magic.h1
-rw-r--r--include/uapi/linux/netconf.h24
-rw-r--r--include/uapi/linux/netfilter/nfnetlink_conntrack.h2
-rw-r--r--include/uapi/linux/netfilter_ipv6/ip6_tables.h3
-rw-r--r--include/uapi/linux/nfc.h15
-rw-r--r--include/uapi/linux/nl80211.h177
-rw-r--r--include/uapi/linux/pci_regs.h23
-rw-r--r--include/uapi/linux/ptp_clock.h14
-rw-r--r--include/uapi/linux/rtnetlink.h26
-rw-r--r--include/uapi/linux/serial_core.h5
-rw-r--r--include/uapi/linux/serial_reg.h18
-rw-r--r--include/uapi/linux/unix_diag.h1
-rw-r--r--include/uapi/linux/usb/cdc.h23
-rw-r--r--include/uapi/linux/videodev2.h37
-rw-r--r--include/uapi/linux/virtio_net.h27
-rw-r--r--include/uapi/rdma/Kbuild6
-rw-r--r--include/uapi/rdma/ib_user_cm.h (renamed from include/rdma/ib_user_cm.h)0
-rw-r--r--include/uapi/rdma/ib_user_mad.h (renamed from include/rdma/ib_user_mad.h)0
-rw-r--r--include/uapi/rdma/ib_user_sa.h (renamed from include/rdma/ib_user_sa.h)0
-rw-r--r--include/uapi/rdma/ib_user_verbs.h (renamed from include/rdma/ib_user_verbs.h)0
-rw-r--r--include/uapi/rdma/rdma_netlink.h37
-rw-r--r--include/uapi/rdma/rdma_user_cm.h (renamed from include/rdma/rdma_user_cm.h)0
-rw-r--r--include/uapi/sound/Kbuild10
-rw-r--r--include/uapi/sound/asequencer.h614
-rw-r--r--include/uapi/sound/asound.h971
-rw-r--r--include/uapi/sound/asound_fm.h (renamed from include/sound/asound_fm.h)0
-rw-r--r--include/uapi/sound/compress_offload.h (renamed from include/sound/compress_offload.h)0
-rw-r--r--include/uapi/sound/compress_params.h (renamed from include/sound/compress_params.h)0
-rw-r--r--include/uapi/sound/emu10k1.h373
-rw-r--r--include/uapi/sound/hdsp.h (renamed from include/sound/hdsp.h)0
-rw-r--r--include/uapi/sound/hdspm.h (renamed from include/sound/hdspm.h)0
-rw-r--r--include/uapi/sound/sb16_csp.h122
-rw-r--r--include/uapi/sound/sfnt_info.h (renamed from include/sound/sfnt_info.h)0
-rw-r--r--include/video/da8xx-fb.h25
-rw-r--r--include/video/omapdss.h105
-rw-r--r--include/video/omapvrfb.h68
-rw-r--r--include/video/samsung_fimd.h168
-rw-r--r--include/video/sh_mipi_dsi.h4
-rw-r--r--include/video/sh_mobile_lcdc.h1
-rw-r--r--include/xen/interface/memory.h44
-rw-r--r--include/xen/interface/platform.h17
-rw-r--r--include/xen/xen-ops.h9
427 files changed, 12014 insertions, 4167 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 03f14856bd09..0943457e0fa5 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -241,6 +241,7 @@
241 *****************************************************************************/ 241 *****************************************************************************/
242 242
243#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */ 243#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
244#define ACPI_DB_LINE_BUFFER_SIZE 512
244 245
245#define ACPI_DEBUGGER_COMMAND_PROMPT '-' 246#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
246#define ACPI_DEBUGGER_EXECUTE_PROMPT '%' 247#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 19503449814f..6c3890e02140 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -122,7 +122,7 @@
122#define AE_CODE_TBL_MAX 0x0005 122#define AE_CODE_TBL_MAX 0x0005
123 123
124/* 124/*
125 * AML exceptions. These are caused by problems with 125 * AML exceptions. These are caused by problems with
126 * the actual AML byte stream 126 * the actual AML byte stream
127 */ 127 */
128#define AE_AML_BAD_OPCODE (acpi_status) (0x0001 | AE_CODE_AML) 128#define AE_AML_BAD_OPCODE (acpi_status) (0x0001 | AE_CODE_AML)
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index 745dd24e3cb5..7665df663284 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -50,6 +50,7 @@
50#define METHOD_NAME__HID "_HID" 50#define METHOD_NAME__HID "_HID"
51#define METHOD_NAME__CID "_CID" 51#define METHOD_NAME__CID "_CID"
52#define METHOD_NAME__UID "_UID" 52#define METHOD_NAME__UID "_UID"
53#define METHOD_NAME__SUB "_SUB"
53#define METHOD_NAME__ADR "_ADR" 54#define METHOD_NAME__ADR "_ADR"
54#define METHOD_NAME__INI "_INI" 55#define METHOD_NAME__INI "_INI"
55#define METHOD_NAME__STA "_STA" 56#define METHOD_NAME__STA "_STA"
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 0daa0fbd8654..7ced5dc20dd3 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -144,12 +144,11 @@ struct acpi_device_flags {
144 u32 bus_address:1; 144 u32 bus_address:1;
145 u32 removable:1; 145 u32 removable:1;
146 u32 ejectable:1; 146 u32 ejectable:1;
147 u32 lockable:1;
148 u32 suprise_removal_ok:1; 147 u32 suprise_removal_ok:1;
149 u32 power_manageable:1; 148 u32 power_manageable:1;
150 u32 performance_manageable:1; 149 u32 performance_manageable:1;
151 u32 eject_pending:1; 150 u32 eject_pending:1;
152 u32 reserved:23; 151 u32 reserved:24;
153}; 152};
154 153
155/* File System */ 154/* File System */
@@ -180,6 +179,7 @@ struct acpi_device_pnp {
180 acpi_device_name device_name; /* Driver-determined */ 179 acpi_device_name device_name; /* Driver-determined */
181 acpi_device_class device_class; /* " */ 180 acpi_device_class device_class; /* " */
182 union acpi_object *str_obj; /* unicode string for _STR method */ 181 union acpi_object *str_obj; /* unicode string for _STR method */
182 unsigned long sun; /* _SUN */
183}; 183};
184 184
185#define acpi_device_bid(d) ((d)->pnp.bus_id) 185#define acpi_device_bid(d) ((d)->pnp.bus_id)
@@ -201,6 +201,7 @@ struct acpi_device_power_flags {
201struct acpi_device_power_state { 201struct acpi_device_power_state {
202 struct { 202 struct {
203 u8 valid:1; 203 u8 valid:1;
204 u8 os_accessible:1;
204 u8 explicit_set:1; /* _PSx present? */ 205 u8 explicit_set:1; /* _PSx present? */
205 u8 reserved:6; 206 u8 reserved:6;
206 } flags; 207 } flags;
@@ -339,6 +340,7 @@ acpi_status acpi_bus_get_status_handle(acpi_handle handle,
339 unsigned long long *sta); 340 unsigned long long *sta);
340int acpi_bus_get_status(struct acpi_device *device); 341int acpi_bus_get_status(struct acpi_device *device);
341int acpi_bus_set_power(acpi_handle handle, int state); 342int acpi_bus_set_power(acpi_handle handle, int state);
343int acpi_device_set_power(struct acpi_device *device, int state);
342int acpi_bus_update_power(acpi_handle handle, int *state_p); 344int acpi_bus_update_power(acpi_handle handle, int *state_p);
343bool acpi_bus_power_manageable(acpi_handle handle); 345bool acpi_bus_power_manageable(acpi_handle handle);
344bool acpi_bus_can_wakeup(acpi_handle handle); 346bool acpi_bus_can_wakeup(acpi_handle handle);
@@ -410,36 +412,100 @@ acpi_handle acpi_get_child(acpi_handle, u64);
410int acpi_is_root_bridge(acpi_handle); 412int acpi_is_root_bridge(acpi_handle);
411acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int); 413acpi_handle acpi_get_pci_rootbridge_handle(unsigned int, unsigned int);
412struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle); 414struct acpi_pci_root *acpi_pci_find_root(acpi_handle handle);
413#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)((dev)->archdata.acpi_handle)) 415#define DEVICE_ACPI_HANDLE(dev) ((acpi_handle)ACPI_HANDLE(dev))
414 416
415int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state); 417int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);
416int acpi_disable_wakeup_device_power(struct acpi_device *dev); 418int acpi_disable_wakeup_device_power(struct acpi_device *dev);
417 419
418#ifdef CONFIG_PM 420#ifdef CONFIG_PM
421acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
422 acpi_notify_handler handler, void *context);
423acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
424 acpi_notify_handler handler);
425int acpi_device_power_state(struct device *dev, struct acpi_device *adev,
426 u32 target_state, int d_max_in, int *d_min_p);
419int acpi_pm_device_sleep_state(struct device *, int *, int); 427int acpi_pm_device_sleep_state(struct device *, int *, int);
420#else 428#else
421static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) 429static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
430 acpi_notify_handler handler,
431 void *context)
432{
433 return AE_SUPPORT;
434}
435static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev,
436 acpi_notify_handler handler)
437{
438 return AE_SUPPORT;
439}
440static inline int __acpi_device_power_state(int m, int *p)
422{ 441{
423 if (p) 442 if (p)
424 *p = ACPI_STATE_D0; 443 *p = ACPI_STATE_D0;
425 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0; 444 return (m >= ACPI_STATE_D0 && m <= ACPI_STATE_D3) ? m : ACPI_STATE_D0;
426} 445}
446static inline int acpi_device_power_state(struct device *dev,
447 struct acpi_device *adev,
448 u32 target_state, int d_max_in,
449 int *d_min_p)
450{
451 return __acpi_device_power_state(d_max_in, d_min_p);
452}
453static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
454{
455 return __acpi_device_power_state(m, p);
456}
427#endif 457#endif
428 458
429#ifdef CONFIG_PM_SLEEP 459#ifdef CONFIG_PM_RUNTIME
460int __acpi_device_run_wake(struct acpi_device *, bool);
430int acpi_pm_device_run_wake(struct device *, bool); 461int acpi_pm_device_run_wake(struct device *, bool);
431int acpi_pm_device_sleep_wake(struct device *, bool);
432#else 462#else
463static inline int __acpi_device_run_wake(struct acpi_device *adev, bool en)
464{
465 return -ENODEV;
466}
433static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) 467static inline int acpi_pm_device_run_wake(struct device *dev, bool enable)
434{ 468{
435 return -ENODEV; 469 return -ENODEV;
436} 470}
471#endif
472
473#ifdef CONFIG_PM_SLEEP
474int __acpi_device_sleep_wake(struct acpi_device *, u32, bool);
475int acpi_pm_device_sleep_wake(struct device *, bool);
476#else
477static inline int __acpi_device_sleep_wake(struct acpi_device *adev,
478 u32 target_state, bool enable)
479{
480 return -ENODEV;
481}
437static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) 482static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
438{ 483{
439 return -ENODEV; 484 return -ENODEV;
440} 485}
441#endif 486#endif
442 487
488#ifdef CONFIG_ACPI_SLEEP
489u32 acpi_target_system_state(void);
490#else
491static inline u32 acpi_target_system_state(void) { return ACPI_STATE_S0; }
492#endif
493
494static inline bool acpi_device_power_manageable(struct acpi_device *adev)
495{
496 return adev->flags.power_manageable;
497}
498
499static inline bool acpi_device_can_wakeup(struct acpi_device *adev)
500{
501 return adev->wakeup.flags.valid;
502}
503
504static inline bool acpi_device_can_poweroff(struct acpi_device *adev)
505{
506 return adev->power.states[ACPI_STATE_D3_COLD].flags.os_accessible;
507}
508
443#else /* CONFIG_ACPI */ 509#else /* CONFIG_ACPI */
444 510
445static inline int register_acpi_bus_type(void *bus) { return 0; } 511static inline int register_acpi_bus_type(void *bus) { return 0; }
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index bb145e4b935e..8b1d7a6a9695 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -92,8 +92,8 @@ int acpi_pci_link_free_irq(acpi_handle handle);
92 92
93/* ACPI PCI Interrupt Routing (pci_irq.c) */ 93/* ACPI PCI Interrupt Routing (pci_irq.c) */
94 94
95int acpi_pci_irq_add_prt(acpi_handle handle, struct pci_bus *bus); 95int acpi_pci_irq_add_prt(acpi_handle handle, int segment, int bus);
96void acpi_pci_irq_del_prt(struct pci_bus *bus); 96void acpi_pci_irq_del_prt(int segment, int bus);
97 97
98/* ACPI PCI Device Binding (pci_bind.c) */ 98/* ACPI PCI Device Binding (pci_bind.c) */
99 99
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 1222ba93d80a..43152742b46f 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -1,7 +1,6 @@
1
2/****************************************************************************** 1/******************************************************************************
3 * 2 *
4 * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These 3 * Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These
5 * interfaces must be implemented by OSL to interface the 4 * interfaces must be implemented by OSL to interface the
6 * ACPI components to the host operating system. 5 * ACPI components to the host operating system.
7 * 6 *
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 8b891dbead66..3d88395d4d6f 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -1,4 +1,3 @@
1
2/****************************************************************************** 1/******************************************************************************
3 * 2 *
4 * Name: acpixf.h - External interfaces to the ACPI subsystem 3 * Name: acpixf.h - External interfaces to the ACPI subsystem
@@ -47,7 +46,7 @@
47 46
48/* Current ACPICA subsystem version in YYYYMMDD format */ 47/* Current ACPICA subsystem version in YYYYMMDD format */
49 48
50#define ACPI_CA_VERSION 0x20120913 49#define ACPI_CA_VERSION 0x20121018
51 50
52#include <acpi/acconfig.h> 51#include <acpi/acconfig.h>
53#include <acpi/actypes.h> 52#include <acpi/actypes.h>
@@ -178,8 +177,7 @@ acpi_status acpi_unload_table_id(acpi_owner_id id);
178 177
179acpi_status 178acpi_status
180acpi_get_table_header(acpi_string signature, 179acpi_get_table_header(acpi_string signature,
181 u32 instance, 180 u32 instance, struct acpi_table_header *out_table_header);
182 struct acpi_table_header *out_table_header);
183 181
184acpi_status 182acpi_status
185acpi_get_table_with_size(acpi_string signature, 183acpi_get_table_with_size(acpi_string signature,
@@ -190,8 +188,7 @@ acpi_get_table(acpi_string signature,
190 u32 instance, struct acpi_table_header **out_table); 188 u32 instance, struct acpi_table_header **out_table);
191 189
192acpi_status 190acpi_status
193acpi_get_table_by_index(u32 table_index, 191acpi_get_table_by_index(u32 table_index, struct acpi_table_header **out_table);
194 struct acpi_table_header **out_table);
195 192
196acpi_status 193acpi_status
197acpi_install_table_handler(acpi_tbl_handler handler, void *context); 194acpi_install_table_handler(acpi_tbl_handler handler, void *context);
@@ -274,7 +271,7 @@ acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
274 271
275ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 272ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
276 acpi_install_global_event_handler 273 acpi_install_global_event_handler
277 (ACPI_GBL_EVENT_HANDLER handler, void *context)) 274 (acpi_gbl_event_handler handler, void *context))
278 275
279ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 276ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
280 acpi_install_fixed_event_handler(u32 277 acpi_install_fixed_event_handler(u32
@@ -300,10 +297,9 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
300 u32 gpe_number, 297 u32 gpe_number,
301 acpi_gpe_handler 298 acpi_gpe_handler
302 address)) 299 address))
303acpi_status 300acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type,
304acpi_install_notify_handler(acpi_handle device, 301 acpi_notify_handler handler,
305 u32 handler_type, 302 void *context);
306 acpi_notify_handler handler, void *context);
307 303
308acpi_status 304acpi_status
309acpi_remove_notify_handler(acpi_handle device, 305acpi_remove_notify_handler(acpi_handle device,
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
index 8c61b5fe42a4..6585141e4b97 100644
--- a/include/acpi/actbl3.h
+++ b/include/acpi/actbl3.h
@@ -277,10 +277,10 @@ struct acpi_table_gtdt {
277 ******************************************************************************/ 277 ******************************************************************************/
278 278
279#define ACPI_MPST_CHANNEL_INFO \ 279#define ACPI_MPST_CHANNEL_INFO \
280 u16 reserved1; \
281 u8 channel_id; \ 280 u8 channel_id; \
282 u8 reserved2; \ 281 u8 reserved1[3]; \
283 u16 power_node_count; 282 u16 power_node_count; \
283 u16 reserved2;
284 284
285/* Main table */ 285/* Main table */
286 286
@@ -304,9 +304,8 @@ struct acpi_mpst_power_node {
304 u32 length; 304 u32 length;
305 u64 range_address; 305 u64 range_address;
306 u64 range_length; 306 u64 range_length;
307 u8 num_power_states; 307 u32 num_power_states;
308 u8 num_physical_components; 308 u32 num_physical_components;
309 u16 reserved2;
310}; 309};
311 310
312/* Values for Flags field above */ 311/* Values for Flags field above */
@@ -332,10 +331,11 @@ struct acpi_mpst_component {
332 331
333struct acpi_mpst_data_hdr { 332struct acpi_mpst_data_hdr {
334 u16 characteristics_count; 333 u16 characteristics_count;
334 u16 reserved;
335}; 335};
336 336
337struct acpi_mpst_power_data { 337struct acpi_mpst_power_data {
338 u8 revision; 338 u8 structure_id;
339 u8 flags; 339 u8 flags;
340 u16 reserved1; 340 u16 reserved1;
341 u32 average_power; 341 u32 average_power;
@@ -356,10 +356,10 @@ struct acpi_mpst_shared {
356 u32 signature; 356 u32 signature;
357 u16 pcc_command; 357 u16 pcc_command;
358 u16 pcc_status; 358 u16 pcc_status;
359 u16 command_register; 359 u32 command_register;
360 u16 status_register; 360 u32 status_register;
361 u16 power_state_id; 361 u32 power_state_id;
362 u16 power_node_id; 362 u32 power_node_id;
363 u64 energy_consumed; 363 u64 energy_consumed;
364 u64 average_power; 364 u64 average_power;
365}; 365};
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index a85bae968262..4f43f1fba132 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -453,10 +453,14 @@ typedef u64 acpi_integer;
453#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) 453#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
454#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) 454#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
455 455
456/* Optimizations for 4-character (32-bit) acpi_name manipulation */
457
456#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED 458#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
457#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b))) 459#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b)))
460#define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (u32, (dest)) = *ACPI_CAST_PTR (u32, (src)))
458#else 461#else
459#define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE)) 462#define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))
463#define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE))
460#endif 464#endif
461 465
462/******************************************************************************* 466/*******************************************************************************
@@ -796,11 +800,11 @@ typedef u8 acpi_adr_space_type;
796 800
797/* Sleep function dispatch */ 801/* Sleep function dispatch */
798 802
799typedef acpi_status(*ACPI_SLEEP_FUNCTION) (u8 sleep_state); 803typedef acpi_status(*acpi_sleep_function) (u8 sleep_state);
800 804
801struct acpi_sleep_functions { 805struct acpi_sleep_functions {
802 ACPI_SLEEP_FUNCTION legacy_function; 806 acpi_sleep_function legacy_function;
803 ACPI_SLEEP_FUNCTION extended_function; 807 acpi_sleep_function extended_function;
804}; 808};
805 809
806/* 810/*
@@ -922,7 +926,8 @@ struct acpi_system_info {
922/* 926/*
923 * Types specific to the OS service interfaces 927 * Types specific to the OS service interfaces
924 */ 928 */
925typedef u32(ACPI_SYSTEM_XFACE * acpi_osd_handler) (void *context); 929typedef u32
930 (ACPI_SYSTEM_XFACE * acpi_osd_handler) (void *context);
926 931
927typedef void 932typedef void
928 (ACPI_SYSTEM_XFACE * acpi_osd_exec_callback) (void *context); 933 (ACPI_SYSTEM_XFACE * acpi_osd_exec_callback) (void *context);
@@ -931,14 +936,15 @@ typedef void
931 * Various handlers and callback procedures 936 * Various handlers and callback procedures
932 */ 937 */
933typedef 938typedef
934void (*ACPI_GBL_EVENT_HANDLER) (u32 event_type, 939void (*acpi_gbl_event_handler) (u32 event_type,
935 acpi_handle device, 940 acpi_handle device,
936 u32 event_number, void *context); 941 u32 event_number, void *context);
937 942
938#define ACPI_EVENT_TYPE_GPE 0 943#define ACPI_EVENT_TYPE_GPE 0
939#define ACPI_EVENT_TYPE_FIXED 1 944#define ACPI_EVENT_TYPE_FIXED 1
940 945
941typedef u32(*acpi_event_handler) (void *context); 946typedef
947u32(*acpi_event_handler) (void *context);
942 948
943typedef 949typedef
944u32 (*acpi_gpe_handler) (acpi_handle gpe_device, u32 gpe_number, void *context); 950u32 (*acpi_gpe_handler) (acpi_handle gpe_device, u32 gpe_number, void *context);
@@ -1018,17 +1024,17 @@ u32 (*acpi_interface_handler) (acpi_string interface_name, u32 supported);
1018 1024
1019#define ACPI_UUID_LENGTH 16 1025#define ACPI_UUID_LENGTH 16
1020 1026
1021/* Structures used for device/processor HID, UID, CID */ 1027/* Structures used for device/processor HID, UID, CID, and SUB */
1022 1028
1023struct acpica_device_id { 1029struct acpi_pnp_device_id {
1024 u32 length; /* Length of string + null */ 1030 u32 length; /* Length of string + null */
1025 char *string; 1031 char *string;
1026}; 1032};
1027 1033
1028struct acpica_device_id_list { 1034struct acpi_pnp_device_id_list {
1029 u32 count; /* Number of IDs in Ids array */ 1035 u32 count; /* Number of IDs in Ids array */
1030 u32 list_size; /* Size of list, including ID strings */ 1036 u32 list_size; /* Size of list, including ID strings */
1031 struct acpica_device_id ids[1]; /* ID array */ 1037 struct acpi_pnp_device_id ids[1]; /* ID array */
1032}; 1038};
1033 1039
1034/* 1040/*
@@ -1046,9 +1052,10 @@ struct acpi_device_info {
1046 u8 lowest_dstates[5]; /* _sx_w values: 0xFF indicates not valid */ 1052 u8 lowest_dstates[5]; /* _sx_w values: 0xFF indicates not valid */
1047 u32 current_status; /* _STA value */ 1053 u32 current_status; /* _STA value */
1048 u64 address; /* _ADR value */ 1054 u64 address; /* _ADR value */
1049 struct acpica_device_id hardware_id; /* _HID value */ 1055 struct acpi_pnp_device_id hardware_id; /* _HID value */
1050 struct acpica_device_id unique_id; /* _UID value */ 1056 struct acpi_pnp_device_id unique_id; /* _UID value */
1051 struct acpica_device_id_list compatible_id_list; /* _CID list <must be last> */ 1057 struct acpi_pnp_device_id subsystem_id; /* _SUB value */
1058 struct acpi_pnp_device_id_list compatible_id_list; /* _CID list <must be last> */
1052}; 1059};
1053 1060
1054/* Values for Flags field above (acpi_get_object_info) */ 1061/* Values for Flags field above (acpi_get_object_info) */
@@ -1061,11 +1068,12 @@ struct acpi_device_info {
1061#define ACPI_VALID_ADR 0x02 1068#define ACPI_VALID_ADR 0x02
1062#define ACPI_VALID_HID 0x04 1069#define ACPI_VALID_HID 0x04
1063#define ACPI_VALID_UID 0x08 1070#define ACPI_VALID_UID 0x08
1064#define ACPI_VALID_CID 0x10 1071#define ACPI_VALID_SUB 0x10
1065#define ACPI_VALID_SXDS 0x20 1072#define ACPI_VALID_CID 0x20
1066#define ACPI_VALID_SXWS 0x40 1073#define ACPI_VALID_SXDS 0x40
1074#define ACPI_VALID_SXWS 0x80
1067 1075
1068/* Flags for _STA method */ 1076/* Flags for _STA return value (current_status above) */
1069 1077
1070#define ACPI_STA_DEVICE_PRESENT 0x01 1078#define ACPI_STA_DEVICE_PRESENT 0x01
1071#define ACPI_STA_DEVICE_ENABLED 0x02 1079#define ACPI_STA_DEVICE_ENABLED 0x02
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index a9432fc6b8ba..20ca7663975f 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -5,6 +5,7 @@
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/errno.h> 6#include <linux/errno.h>
7#include <linux/of.h> 7#include <linux/of.h>
8#include <linux/pinctrl/pinctrl.h>
8 9
9#ifdef CONFIG_GPIOLIB 10#ifdef CONFIG_GPIOLIB
10 11
@@ -56,6 +57,8 @@ struct device_node;
56 * enabling module power and clock; may sleep 57 * enabling module power and clock; may sleep
57 * @free: optional hook for chip-specific deactivation, such as 58 * @free: optional hook for chip-specific deactivation, such as
58 * disabling module power and clock; may sleep 59 * disabling module power and clock; may sleep
60 * @get_direction: returns direction for signal "offset", 0=out, 1=in,
61 * (same as GPIOF_DIR_XXX), or negative error
59 * @direction_input: configures signal "offset" as input, or returns error 62 * @direction_input: configures signal "offset" as input, or returns error
60 * @get: returns value for signal "offset"; for output signals this 63 * @get: returns value for signal "offset"; for output signals this
61 * returns either the value actually sensed, or zero 64 * returns either the value actually sensed, or zero
@@ -100,7 +103,8 @@ struct gpio_chip {
100 unsigned offset); 103 unsigned offset);
101 void (*free)(struct gpio_chip *chip, 104 void (*free)(struct gpio_chip *chip,
102 unsigned offset); 105 unsigned offset);
103 106 int (*get_direction)(struct gpio_chip *chip,
107 unsigned offset);
104 int (*direction_input)(struct gpio_chip *chip, 108 int (*direction_input)(struct gpio_chip *chip,
105 unsigned offset); 109 unsigned offset);
106 int (*get)(struct gpio_chip *chip, 110 int (*get)(struct gpio_chip *chip,
@@ -134,6 +138,15 @@ struct gpio_chip {
134 int (*of_xlate)(struct gpio_chip *gc, 138 int (*of_xlate)(struct gpio_chip *gc,
135 const struct of_phandle_args *gpiospec, u32 *flags); 139 const struct of_phandle_args *gpiospec, u32 *flags);
136#endif 140#endif
141#ifdef CONFIG_PINCTRL
142 /*
143 * If CONFIG_PINCTRL is enabled, then gpio controllers can optionally
144 * describe the actual pin range which they serve in an SoC. This
145 * information would be used by pinctrl subsystem to configure
146 * corresponding pins for gpio usage.
147 */
148 struct list_head pin_ranges;
149#endif
137}; 150};
138 151
139extern const char *gpiochip_is_requested(struct gpio_chip *chip, 152extern const char *gpiochip_is_requested(struct gpio_chip *chip,
@@ -257,4 +270,41 @@ static inline void gpio_unexport(unsigned gpio)
257} 270}
258#endif /* CONFIG_GPIO_SYSFS */ 271#endif /* CONFIG_GPIO_SYSFS */
259 272
273#ifdef CONFIG_PINCTRL
274
275/**
276 * struct gpio_pin_range - pin range controlled by a gpio chip
277 * @head: list for maintaining set of pin ranges, used internally
278 * @pctldev: pinctrl device which handles corresponding pins
279 * @range: actual range of pins controlled by a gpio controller
280 */
281
282struct gpio_pin_range {
283 struct list_head node;
284 struct pinctrl_dev *pctldev;
285 struct pinctrl_gpio_range range;
286};
287
288int gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
289 unsigned int gpio_offset, unsigned int pin_offset,
290 unsigned int npins);
291void gpiochip_remove_pin_ranges(struct gpio_chip *chip);
292
293#else
294
295static inline int
296gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
297 unsigned int gpio_offset, unsigned int pin_offset,
298 unsigned int npins)
299{
300 return 0;
301}
302
303static inline void
304gpiochip_remove_pin_ranges(struct gpio_chip *chip)
305{
306}
307
308#endif /* CONFIG_PINCTRL */
309
260#endif /* _ASM_GENERIC_GPIO_H */ 310#endif /* _ASM_GENERIC_GPIO_H */
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index 448303bdb85f..9e0ebe051243 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -83,19 +83,25 @@ static inline void __raw_writel(u32 b, volatile void __iomem *addr)
83#define writel(b,addr) __raw_writel(__cpu_to_le32(b),addr) 83#define writel(b,addr) __raw_writel(__cpu_to_le32(b),addr)
84 84
85#ifdef CONFIG_64BIT 85#ifdef CONFIG_64BIT
86#ifndef __raw_readq
86static inline u64 __raw_readq(const volatile void __iomem *addr) 87static inline u64 __raw_readq(const volatile void __iomem *addr)
87{ 88{
88 return *(const volatile u64 __force *) addr; 89 return *(const volatile u64 __force *) addr;
89} 90}
91#endif
92
90#define readq(addr) __le64_to_cpu(__raw_readq(addr)) 93#define readq(addr) __le64_to_cpu(__raw_readq(addr))
91 94
95#ifndef __raw_writeq
92static inline void __raw_writeq(u64 b, volatile void __iomem *addr) 96static inline void __raw_writeq(u64 b, volatile void __iomem *addr)
93{ 97{
94 *(volatile u64 __force *) addr = b; 98 *(volatile u64 __force *) addr = b;
95} 99}
96#define writeq(b,addr) __raw_writeq(__cpu_to_le64(b),addr)
97#endif 100#endif
98 101
102#define writeq(b, addr) __raw_writeq(__cpu_to_le64(b), addr)
103#endif /* CONFIG_64BIT */
104
99#ifndef PCI_IOBASE 105#ifndef PCI_IOBASE
100#define PCI_IOBASE ((void __iomem *) 0) 106#define PCI_IOBASE ((void __iomem *) 0)
101#endif 107#endif
@@ -286,15 +292,20 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len)
286 292
287#ifndef CONFIG_GENERIC_IOMAP 293#ifndef CONFIG_GENERIC_IOMAP
288struct pci_dev; 294struct pci_dev;
295extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
296
297#ifndef pci_iounmap
289static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p) 298static inline void pci_iounmap(struct pci_dev *dev, void __iomem *p)
290{ 299{
291} 300}
301#endif
292#endif /* CONFIG_GENERIC_IOMAP */ 302#endif /* CONFIG_GENERIC_IOMAP */
293 303
294/* 304/*
295 * Change virtual addresses to physical addresses and vv. 305 * Change virtual addresses to physical addresses and vv.
296 * These are pretty trivial 306 * These are pretty trivial
297 */ 307 */
308#ifndef virt_to_phys
298static inline unsigned long virt_to_phys(volatile void *address) 309static inline unsigned long virt_to_phys(volatile void *address)
299{ 310{
300 return __pa((unsigned long)address); 311 return __pa((unsigned long)address);
@@ -304,6 +315,7 @@ static inline void *phys_to_virt(unsigned long address)
304{ 315{
305 return __va(address); 316 return __va(address);
306} 317}
318#endif
307 319
308/* 320/*
309 * Change "struct page" to physical address. 321 * Change "struct page" to physical address.
@@ -363,9 +375,16 @@ static inline void *bus_to_virt(unsigned long address)
363} 375}
364#endif 376#endif
365 377
378#ifndef memset_io
366#define memset_io(a, b, c) memset(__io_virt(a), (b), (c)) 379#define memset_io(a, b, c) memset(__io_virt(a), (b), (c))
380#endif
381
382#ifndef memcpy_fromio
367#define memcpy_fromio(a, b, c) memcpy((a), __io_virt(b), (c)) 383#define memcpy_fromio(a, b, c) memcpy((a), __io_virt(b), (c))
384#endif
385#ifndef memcpy_toio
368#define memcpy_toio(a, b, c) memcpy(__io_virt(a), (b), (c)) 386#define memcpy_toio(a, b, c) memcpy(__io_virt(a), (b), (c))
387#endif
369 388
370#endif /* __KERNEL__ */ 389#endif /* __KERNEL__ */
371 390
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index f27c83668d10..701beab27aab 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -453,6 +453,32 @@ extern void untrack_pfn(struct vm_area_struct *vma, unsigned long pfn,
453 unsigned long size); 453 unsigned long size);
454#endif 454#endif
455 455
456#ifdef __HAVE_COLOR_ZERO_PAGE
457static inline int is_zero_pfn(unsigned long pfn)
458{
459 extern unsigned long zero_pfn;
460 unsigned long offset_from_zero_pfn = pfn - zero_pfn;
461 return offset_from_zero_pfn <= (zero_page_mask >> PAGE_SHIFT);
462}
463
464static inline unsigned long my_zero_pfn(unsigned long addr)
465{
466 return page_to_pfn(ZERO_PAGE(addr));
467}
468#else
469static inline int is_zero_pfn(unsigned long pfn)
470{
471 extern unsigned long zero_pfn;
472 return pfn == zero_pfn;
473}
474
475static inline unsigned long my_zero_pfn(unsigned long addr)
476{
477 extern unsigned long zero_pfn;
478 return zero_pfn;
479}
480#endif
481
456#ifdef CONFIG_MMU 482#ifdef CONFIG_MMU
457 483
458#ifndef CONFIG_TRANSPARENT_HUGEPAGE 484#ifndef CONFIG_TRANSPARENT_HUGEPAGE
diff --git a/include/asm-generic/signal.h b/include/asm-generic/signal.h
index 98caa306122a..d840c90a157a 100644
--- a/include/asm-generic/signal.h
+++ b/include/asm-generic/signal.h
@@ -10,7 +10,5 @@
10#include <asm/sigcontext.h> 10#include <asm/sigcontext.h>
11#undef __HAVE_ARCH_SIG_BITOPS 11#undef __HAVE_ARCH_SIG_BITOPS
12 12
13#define ptrace_signal_deliver(regs, cookie) do { } while (0)
14
15#endif /* __ASSEMBLY__ */ 13#endif /* __ASSEMBLY__ */
16#endif /* _ASM_GENERIC_SIGNAL_H */ 14#endif /* _ASM_GENERIC_SIGNAL_H */
diff --git a/include/asm-generic/syscalls.h b/include/asm-generic/syscalls.h
index d89dec864d42..58f466ff00d3 100644
--- a/include/asm-generic/syscalls.h
+++ b/include/asm-generic/syscalls.h
@@ -8,26 +8,6 @@
8 * Calling conventions for these system calls can differ, so 8 * Calling conventions for these system calls can differ, so
9 * it's possible to override them. 9 * it's possible to override them.
10 */ 10 */
11#ifndef sys_clone
12asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp,
13 void __user *parent_tid, void __user *child_tid,
14 struct pt_regs *regs);
15#endif
16
17#ifndef sys_fork
18asmlinkage long sys_fork(struct pt_regs *regs);
19#endif
20
21#ifndef sys_vfork
22asmlinkage long sys_vfork(struct pt_regs *regs);
23#endif
24
25#ifndef sys_execve
26asmlinkage long sys_execve(const char __user *filename,
27 const char __user *const __user *argv,
28 const char __user *const __user *envp,
29 struct pt_regs *regs);
30#endif
31 11
32#ifndef sys_mmap2 12#ifndef sys_mmap2
33asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, 13asmlinkage long sys_mmap2(unsigned long addr, unsigned long len,
diff --git a/include/asm-generic/trace_clock.h b/include/asm-generic/trace_clock.h
new file mode 100644
index 000000000000..6726f1bafb5e
--- /dev/null
+++ b/include/asm-generic/trace_clock.h
@@ -0,0 +1,16 @@
1#ifndef _ASM_GENERIC_TRACE_CLOCK_H
2#define _ASM_GENERIC_TRACE_CLOCK_H
3/*
4 * Arch-specific trace clocks.
5 */
6
7/*
8 * Additional trace clocks added to the trace_clocks
9 * array in kernel/trace/trace.c
10 * None if the architecture has not defined it.
11 */
12#ifndef ARCH_TRACE_CLOCKS
13# define ARCH_TRACE_CLOCKS
14#endif
15
16#endif /* _ASM_GENERIC_TRACE_CLOCK_H */
diff --git a/include/crypto/cast5.h b/include/crypto/cast5.h
index 586183a0406e..14fbf39d6380 100644
--- a/include/crypto/cast5.h
+++ b/include/crypto/cast5.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/crypto.h> 5#include <linux/crypto.h>
6#include <crypto/cast_common.h>
6 7
7#define CAST5_BLOCK_SIZE 8 8#define CAST5_BLOCK_SIZE 8
8#define CAST5_MIN_KEY_SIZE 5 9#define CAST5_MIN_KEY_SIZE 5
@@ -19,9 +20,4 @@ int cast5_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen);
19void __cast5_encrypt(struct cast5_ctx *ctx, u8 *dst, const u8 *src); 20void __cast5_encrypt(struct cast5_ctx *ctx, u8 *dst, const u8 *src);
20void __cast5_decrypt(struct cast5_ctx *ctx, u8 *dst, const u8 *src); 21void __cast5_decrypt(struct cast5_ctx *ctx, u8 *dst, const u8 *src);
21 22
22extern const u32 cast5_s1[256];
23extern const u32 cast5_s2[256];
24extern const u32 cast5_s3[256];
25extern const u32 cast5_s4[256];
26
27#endif 23#endif
diff --git a/include/crypto/cast6.h b/include/crypto/cast6.h
index 157af6f342c8..32b60eb8bd24 100644
--- a/include/crypto/cast6.h
+++ b/include/crypto/cast6.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/crypto.h> 5#include <linux/crypto.h>
6#include <crypto/cast_common.h>
6 7
7#define CAST6_BLOCK_SIZE 16 8#define CAST6_BLOCK_SIZE 16
8#define CAST6_MIN_KEY_SIZE 16 9#define CAST6_MIN_KEY_SIZE 16
@@ -20,9 +21,4 @@ int cast6_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen);
20void __cast6_encrypt(struct cast6_ctx *ctx, u8 *dst, const u8 *src); 21void __cast6_encrypt(struct cast6_ctx *ctx, u8 *dst, const u8 *src);
21void __cast6_decrypt(struct cast6_ctx *ctx, u8 *dst, const u8 *src); 22void __cast6_decrypt(struct cast6_ctx *ctx, u8 *dst, const u8 *src);
22 23
23extern const u32 cast6_s1[256];
24extern const u32 cast6_s2[256];
25extern const u32 cast6_s3[256];
26extern const u32 cast6_s4[256];
27
28#endif 24#endif
diff --git a/include/crypto/cast_common.h b/include/crypto/cast_common.h
new file mode 100644
index 000000000000..b7df35cd9f0a
--- /dev/null
+++ b/include/crypto/cast_common.h
@@ -0,0 +1,9 @@
1#ifndef _CRYPTO_CAST_COMMON_H
2#define _CRYPTO_CAST_COMMON_H
3
4extern const u32 cast_s1[256];
5extern const u32 cast_s2[256];
6extern const u32 cast_s3[256];
7extern const u32 cast_s4[256];
8
9#endif
diff --git a/include/crypto/vmac.h b/include/crypto/vmac.h
index c4467c55df1e..6b700c7b2fe1 100644
--- a/include/crypto/vmac.h
+++ b/include/crypto/vmac.h
@@ -56,6 +56,8 @@ typedef u64 vmac_t;
56struct vmac_ctx_t { 56struct vmac_ctx_t {
57 struct crypto_cipher *child; 57 struct crypto_cipher *child;
58 struct vmac_ctx __vmac_ctx; 58 struct vmac_ctx __vmac_ctx;
59 u8 partial[VMAC_NHBYTES]; /* partial block */
60 int partial_size; /* size of the partial block */
59}; 61};
60 62
61#endif /* __CRYPTO_VMAC_H */ 63#endif /* __CRYPTO_VMAC_H */
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index af1cbaf535ed..c5c35e629426 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -210,6 +210,7 @@
210 {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ 210 {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
211 {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ 211 {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
212 {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ 212 {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
213 {0x1002, 0x679B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
213 {0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ 214 {0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
214 {0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ 215 {0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
215 {0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 216 {0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 90be98981102..3994d7790b23 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -25,7 +25,9 @@
25#ifndef _LINUX_ACPI_H 25#ifndef _LINUX_ACPI_H
26#define _LINUX_ACPI_H 26#define _LINUX_ACPI_H
27 27
28#include <linux/errno.h>
28#include <linux/ioport.h> /* for struct resource */ 29#include <linux/ioport.h> /* for struct resource */
30#include <linux/device.h>
29 31
30#ifdef CONFIG_ACPI 32#ifdef CONFIG_ACPI
31 33
@@ -76,6 +78,14 @@ typedef int (*acpi_table_handler) (struct acpi_table_header *table);
76 78
77typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); 79typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
78 80
81#ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE
82void acpi_initrd_override(void *data, size_t size);
83#else
84static inline void acpi_initrd_override(void *data, size_t size)
85{
86}
87#endif
88
79char * __acpi_map_table (unsigned long phys_addr, unsigned long size); 89char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
80void __acpi_unmap_table(char *map, unsigned long size); 90void __acpi_unmap_table(char *map, unsigned long size);
81int early_acpi_boot_init(void); 91int early_acpi_boot_init(void);
@@ -250,6 +260,26 @@ extern int pnpacpi_disabled;
250 260
251#define PXM_INVAL (-1) 261#define PXM_INVAL (-1)
252 262
263bool acpi_dev_resource_memory(struct acpi_resource *ares, struct resource *res);
264bool acpi_dev_resource_io(struct acpi_resource *ares, struct resource *res);
265bool acpi_dev_resource_address_space(struct acpi_resource *ares,
266 struct resource *res);
267bool acpi_dev_resource_ext_address_space(struct acpi_resource *ares,
268 struct resource *res);
269unsigned long acpi_dev_irq_flags(u8 triggering, u8 polarity, u8 shareable);
270bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
271 struct resource *res);
272
273struct resource_list_entry {
274 struct list_head node;
275 struct resource res;
276};
277
278void acpi_dev_free_resource_list(struct list_head *list);
279int acpi_dev_get_resources(struct acpi_device *adev, struct list_head *list,
280 int (*preproc)(struct acpi_resource *, void *),
281 void *preproc_data);
282
253int acpi_check_resource_conflict(const struct resource *res); 283int acpi_check_resource_conflict(const struct resource *res);
254 284
255int acpi_check_region(resource_size_t start, resource_size_t n, 285int acpi_check_region(resource_size_t start, resource_size_t n,
@@ -257,10 +287,14 @@ int acpi_check_region(resource_size_t start, resource_size_t n,
257 287
258int acpi_resources_are_enforced(void); 288int acpi_resources_are_enforced(void);
259 289
260#ifdef CONFIG_PM_SLEEP 290#ifdef CONFIG_HIBERNATION
261void __init acpi_no_s4_hw_signature(void); 291void __init acpi_no_s4_hw_signature(void);
292#endif
293
294#ifdef CONFIG_PM_SLEEP
262void __init acpi_old_suspend_ordering(void); 295void __init acpi_old_suspend_ordering(void);
263void __init acpi_nvs_nosave(void); 296void __init acpi_nvs_nosave(void);
297void __init acpi_nvs_nosave_s3(void);
264#endif /* CONFIG_PM_SLEEP */ 298#endif /* CONFIG_PM_SLEEP */
265 299
266struct acpi_osc_context { 300struct acpi_osc_context {
@@ -364,6 +398,17 @@ extern int acpi_nvs_register(__u64 start, __u64 size);
364extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *), 398extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
365 void *data); 399 void *data);
366 400
401const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids,
402 const struct device *dev);
403
404static inline bool acpi_driver_match_device(struct device *dev,
405 const struct device_driver *drv)
406{
407 return !!acpi_match_device(drv->acpi_match_table, dev);
408}
409
410#define ACPI_PTR(_ptr) (_ptr)
411
367#else /* !CONFIG_ACPI */ 412#else /* !CONFIG_ACPI */
368 413
369#define acpi_disabled 1 414#define acpi_disabled 1
@@ -418,6 +463,22 @@ static inline int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
418 return 0; 463 return 0;
419} 464}
420 465
466struct acpi_device_id;
467
468static inline const struct acpi_device_id *acpi_match_device(
469 const struct acpi_device_id *ids, const struct device *dev)
470{
471 return NULL;
472}
473
474static inline bool acpi_driver_match_device(struct device *dev,
475 const struct device_driver *drv)
476{
477 return false;
478}
479
480#define ACPI_PTR(_ptr) (NULL)
481
421#endif /* !CONFIG_ACPI */ 482#endif /* !CONFIG_ACPI */
422 483
423#ifdef CONFIG_ACPI 484#ifdef CONFIG_ACPI
@@ -426,8 +487,96 @@ void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state,
426 487
427acpi_status acpi_os_prepare_sleep(u8 sleep_state, 488acpi_status acpi_os_prepare_sleep(u8 sleep_state,
428 u32 pm1a_control, u32 pm1b_control); 489 u32 pm1a_control, u32 pm1b_control);
490#ifdef CONFIG_X86
491void arch_reserve_mem_area(acpi_physical_address addr, size_t size);
492#else
493static inline void arch_reserve_mem_area(acpi_physical_address addr,
494 size_t size)
495{
496}
497#endif /* CONFIG_X86 */
429#else 498#else
430#define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0) 499#define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0)
431#endif 500#endif
432 501
502#if defined(CONFIG_ACPI) && defined(CONFIG_PM_RUNTIME)
503int acpi_dev_runtime_suspend(struct device *dev);
504int acpi_dev_runtime_resume(struct device *dev);
505int acpi_subsys_runtime_suspend(struct device *dev);
506int acpi_subsys_runtime_resume(struct device *dev);
507#else
508static inline int acpi_dev_runtime_suspend(struct device *dev) { return 0; }
509static inline int acpi_dev_runtime_resume(struct device *dev) { return 0; }
510static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; }
511static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; }
512#endif
513
514#ifdef CONFIG_ACPI_SLEEP
515int acpi_dev_suspend_late(struct device *dev);
516int acpi_dev_resume_early(struct device *dev);
517int acpi_subsys_prepare(struct device *dev);
518int acpi_subsys_suspend_late(struct device *dev);
519int acpi_subsys_resume_early(struct device *dev);
520#else
521static inline int acpi_dev_suspend_late(struct device *dev) { return 0; }
522static inline int acpi_dev_resume_early(struct device *dev) { return 0; }
523static inline int acpi_subsys_prepare(struct device *dev) { return 0; }
524static inline int acpi_subsys_suspend_late(struct device *dev) { return 0; }
525static inline int acpi_subsys_resume_early(struct device *dev) { return 0; }
526#endif
527
528#if defined(CONFIG_ACPI) && defined(CONFIG_PM)
529int acpi_dev_pm_attach(struct device *dev, bool power_on);
530void acpi_dev_pm_detach(struct device *dev, bool power_off);
531#else
532static inline int acpi_dev_pm_attach(struct device *dev, bool power_on)
533{
534 return -ENODEV;
535}
536static inline void acpi_dev_pm_detach(struct device *dev, bool power_off) {}
537#endif
538
539#ifdef CONFIG_ACPI
540__printf(3, 4)
541void acpi_handle_printk(const char *level, acpi_handle handle,
542 const char *fmt, ...);
543#else /* !CONFIG_ACPI */
544static inline __printf(3, 4) void
545acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {}
546#endif /* !CONFIG_ACPI */
547
548/*
549 * acpi_handle_<level>: Print message with ACPI prefix and object path
550 *
551 * These interfaces acquire the global namespace mutex to obtain an object
552 * path. In interrupt context, it shows the object path as <n/a>.
553 */
554#define acpi_handle_emerg(handle, fmt, ...) \
555 acpi_handle_printk(KERN_EMERG, handle, fmt, ##__VA_ARGS__)
556#define acpi_handle_alert(handle, fmt, ...) \
557 acpi_handle_printk(KERN_ALERT, handle, fmt, ##__VA_ARGS__)
558#define acpi_handle_crit(handle, fmt, ...) \
559 acpi_handle_printk(KERN_CRIT, handle, fmt, ##__VA_ARGS__)
560#define acpi_handle_err(handle, fmt, ...) \
561 acpi_handle_printk(KERN_ERR, handle, fmt, ##__VA_ARGS__)
562#define acpi_handle_warn(handle, fmt, ...) \
563 acpi_handle_printk(KERN_WARNING, handle, fmt, ##__VA_ARGS__)
564#define acpi_handle_notice(handle, fmt, ...) \
565 acpi_handle_printk(KERN_NOTICE, handle, fmt, ##__VA_ARGS__)
566#define acpi_handle_info(handle, fmt, ...) \
567 acpi_handle_printk(KERN_INFO, handle, fmt, ##__VA_ARGS__)
568
569/* REVISIT: Support CONFIG_DYNAMIC_DEBUG when necessary */
570#if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
571#define acpi_handle_debug(handle, fmt, ...) \
572 acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__)
573#else
574#define acpi_handle_debug(handle, fmt, ...) \
575({ \
576 if (0) \
577 acpi_handle_printk(KERN_DEBUG, handle, fmt, ##__VA_ARGS__); \
578 0; \
579})
580#endif
581
433#endif /*_LINUX_ACPI_H*/ 582#endif /*_LINUX_ACPI_H*/
diff --git a/include/linux/acpi_gpio.h b/include/linux/acpi_gpio.h
new file mode 100644
index 000000000000..91615a389b65
--- /dev/null
+++ b/include/linux/acpi_gpio.h
@@ -0,0 +1,19 @@
1#ifndef _LINUX_ACPI_GPIO_H_
2#define _LINUX_ACPI_GPIO_H_
3
4#include <linux/errno.h>
5
6#ifdef CONFIG_GPIO_ACPI
7
8int acpi_get_gpio(char *path, int pin);
9
10#else /* CONFIG_GPIO_ACPI */
11
12static inline int acpi_get_gpio(char *path, int pin)
13{
14 return -ENODEV;
15}
16
17#endif /* CONFIG_GPIO_ACPI */
18
19#endif /* _LINUX_ACPI_GPIO_H_ */
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index d36417158d8f..43ec7e247a80 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -71,6 +71,16 @@ struct amba_device *amba_ahb_device_add(struct device *parent, const char *name,
71 resource_size_t base, size_t size, 71 resource_size_t base, size_t size,
72 int irq1, int irq2, void *pdata, 72 int irq1, int irq2, void *pdata,
73 unsigned int periphid); 73 unsigned int periphid);
74struct amba_device *
75amba_apb_device_add_res(struct device *parent, const char *name,
76 resource_size_t base, size_t size, int irq1,
77 int irq2, void *pdata, unsigned int periphid,
78 struct resource *resbase);
79struct amba_device *
80amba_ahb_device_add_res(struct device *parent, const char *name,
81 resource_size_t base, size_t size, int irq1,
82 int irq2, void *pdata, unsigned int periphid,
83 struct resource *resbase);
74void amba_device_unregister(struct amba_device *); 84void amba_device_unregister(struct amba_device *);
75struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int); 85struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int);
76int amba_request_regions(struct amba_device *, const char *); 86int amba_request_regions(struct amba_device *, const char *);
diff --git a/include/linux/ata_platform.h b/include/linux/ata_platform.h
index b856a2a590d9..fe9989636b62 100644
--- a/include/linux/ata_platform.h
+++ b/include/linux/ata_platform.h
@@ -22,8 +22,6 @@ extern int __devinit __pata_platform_probe(struct device *dev,
22 unsigned int ioport_shift, 22 unsigned int ioport_shift,
23 int __pio_mask); 23 int __pio_mask);
24 24
25extern int __devexit __pata_platform_remove(struct device *dev);
26
27/* 25/*
28 * Marvell SATA private data 26 * Marvell SATA private data
29 */ 27 */
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
index 6e3f54f37844..fcdd81bd5314 100644
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -22,6 +22,8 @@
22#define ATH9K_PLAT_EEP_MAX_WORDS 2048 22#define ATH9K_PLAT_EEP_MAX_WORDS 2048
23 23
24struct ath9k_platform_data { 24struct ath9k_platform_data {
25 const char *eeprom_name;
26
25 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; 27 u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
26 u8 *macaddr; 28 u8 *macaddr;
27 29
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 22ef21c33d0c..c1da539f5e28 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -99,6 +99,7 @@ struct atm_vcc {
99 struct atm_dev *dev; /* device back pointer */ 99 struct atm_dev *dev; /* device back pointer */
100 struct atm_qos qos; /* QOS */ 100 struct atm_qos qos; /* QOS */
101 struct atm_sap sap; /* SAP */ 101 struct atm_sap sap; /* SAP */
102 void (*release_cb)(struct atm_vcc *vcc); /* release_sock callback */
102 void (*push)(struct atm_vcc *vcc,struct sk_buff *skb); 103 void (*push)(struct atm_vcc *vcc,struct sk_buff *skb);
103 void (*pop)(struct atm_vcc *vcc,struct sk_buff *skb); /* optional */ 104 void (*pop)(struct atm_vcc *vcc,struct sk_buff *skb); /* optional */
104 int (*push_oam)(struct atm_vcc *vcc,void *cell); 105 int (*push_oam)(struct atm_vcc *vcc,void *cell);
@@ -106,6 +107,7 @@ struct atm_vcc {
106 void *dev_data; /* per-device data */ 107 void *dev_data; /* per-device data */
107 void *proto_data; /* per-protocol data */ 108 void *proto_data; /* per-protocol data */
108 struct k_atm_aal_stats *stats; /* pointer to AAL stats group */ 109 struct k_atm_aal_stats *stats; /* pointer to AAL stats group */
110 struct module *owner; /* owner of ->push function */
109 /* SVC part --- may move later ------------------------------------- */ 111 /* SVC part --- may move later ------------------------------------- */
110 short itf; /* interface number */ 112 short itf; /* interface number */
111 struct sockaddr_atmsvc local; 113 struct sockaddr_atmsvc local;
diff --git a/include/linux/atmel-ssc.h b/include/linux/atmel-ssc.h
index 4eb31752e2b7..deb0ae58b99b 100644
--- a/include/linux/atmel-ssc.h
+++ b/include/linux/atmel-ssc.h
@@ -5,10 +5,16 @@
5#include <linux/list.h> 5#include <linux/list.h>
6#include <linux/io.h> 6#include <linux/io.h>
7 7
8struct atmel_ssc_platform_data {
9 int use_dma;
10};
11
8struct ssc_device { 12struct ssc_device {
9 struct list_head list; 13 struct list_head list;
14 resource_size_t phybase;
10 void __iomem *regs; 15 void __iomem *regs;
11 struct platform_device *pdev; 16 struct platform_device *pdev;
17 struct atmel_ssc_platform_data *pdata;
12 struct clk *clk; 18 struct clk *clk;
13 int user; 19 int user;
14 int irq; 20 int irq;
diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon_compaction.h
new file mode 100644
index 000000000000..f7f1d7169b11
--- /dev/null
+++ b/include/linux/balloon_compaction.h
@@ -0,0 +1,272 @@
1/*
2 * include/linux/balloon_compaction.h
3 *
4 * Common interface definitions for making balloon pages movable by compaction.
5 *
6 * Despite being perfectly possible to perform ballooned pages migration, they
7 * make a special corner case to compaction scans because balloon pages are not
8 * enlisted at any LRU list like the other pages we do compact / migrate.
9 *
10 * As the page isolation scanning step a compaction thread does is a lockless
11 * procedure (from a page standpoint), it might bring some racy situations while
12 * performing balloon page compaction. In order to sort out these racy scenarios
13 * and safely perform balloon's page compaction and migration we must, always,
14 * ensure following these three simple rules:
15 *
16 * i. when updating a balloon's page ->mapping element, strictly do it under
17 * the following lock order, independently of the far superior
18 * locking scheme (lru_lock, balloon_lock):
19 * +-page_lock(page);
20 * +--spin_lock_irq(&b_dev_info->pages_lock);
21 * ... page->mapping updates here ...
22 *
23 * ii. before isolating or dequeueing a balloon page from the balloon device
24 * pages list, the page reference counter must be raised by one and the
25 * extra refcount must be dropped when the page is enqueued back into
26 * the balloon device page list, thus a balloon page keeps its reference
27 * counter raised only while it is under our special handling;
28 *
29 * iii. after the lockless scan step have selected a potential balloon page for
30 * isolation, re-test the page->mapping flags and the page ref counter
31 * under the proper page lock, to ensure isolating a valid balloon page
32 * (not yet isolated, nor under release procedure)
33 *
34 * The functions provided by this interface are placed to help on coping with
35 * the aforementioned balloon page corner case, as well as to ensure the simple
36 * set of exposed rules are satisfied while we are dealing with balloon pages
37 * compaction / migration.
38 *
39 * Copyright (C) 2012, Red Hat, Inc. Rafael Aquini <aquini@redhat.com>
40 */
41#ifndef _LINUX_BALLOON_COMPACTION_H
42#define _LINUX_BALLOON_COMPACTION_H
43#include <linux/pagemap.h>
44#include <linux/page-flags.h>
45#include <linux/migrate.h>
46#include <linux/gfp.h>
47#include <linux/err.h>
48
49/*
50 * Balloon device information descriptor.
51 * This struct is used to allow the common balloon compaction interface
52 * procedures to find the proper balloon device holding memory pages they'll
53 * have to cope for page compaction / migration, as well as it serves the
54 * balloon driver as a page book-keeper for its registered balloon devices.
55 */
56struct balloon_dev_info {
57 void *balloon_device; /* balloon device descriptor */
58 struct address_space *mapping; /* balloon special page->mapping */
59 unsigned long isolated_pages; /* # of isolated pages for migration */
60 spinlock_t pages_lock; /* Protection to pages list */
61 struct list_head pages; /* Pages enqueued & handled to Host */
62};
63
64extern struct page *balloon_page_enqueue(struct balloon_dev_info *b_dev_info);
65extern struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info);
66extern struct balloon_dev_info *balloon_devinfo_alloc(
67 void *balloon_dev_descriptor);
68
69static inline void balloon_devinfo_free(struct balloon_dev_info *b_dev_info)
70{
71 kfree(b_dev_info);
72}
73
74/*
75 * balloon_page_free - release a balloon page back to the page free lists
76 * @page: ballooned page to be set free
77 *
78 * This function must be used to properly set free an isolated/dequeued balloon
79 * page at the end of a sucessful page migration, or at the balloon driver's
80 * page release procedure.
81 */
82static inline void balloon_page_free(struct page *page)
83{
84 /*
85 * Balloon pages always get an extra refcount before being isolated
86 * and before being dequeued to help on sorting out fortuite colisions
87 * between a thread attempting to isolate and another thread attempting
88 * to release the very same balloon page.
89 *
90 * Before we handle the page back to Buddy, lets drop its extra refcnt.
91 */
92 put_page(page);
93 __free_page(page);
94}
95
96#ifdef CONFIG_BALLOON_COMPACTION
97extern bool balloon_page_isolate(struct page *page);
98extern void balloon_page_putback(struct page *page);
99extern int balloon_page_migrate(struct page *newpage,
100 struct page *page, enum migrate_mode mode);
101extern struct address_space
102*balloon_mapping_alloc(struct balloon_dev_info *b_dev_info,
103 const struct address_space_operations *a_ops);
104
105static inline void balloon_mapping_free(struct address_space *balloon_mapping)
106{
107 kfree(balloon_mapping);
108}
109
110/*
111 * page_flags_cleared - helper to perform balloon @page ->flags tests.
112 *
113 * As balloon pages are obtained from buddy and we do not play with page->flags
114 * at driver level (exception made when we get the page lock for compaction),
115 * we can safely identify a ballooned page by checking if the
116 * PAGE_FLAGS_CHECK_AT_PREP page->flags are all cleared. This approach also
117 * helps us skip ballooned pages that are locked for compaction or release, thus
118 * mitigating their racy check at balloon_page_movable()
119 */
120static inline bool page_flags_cleared(struct page *page)
121{
122 return !(page->flags & PAGE_FLAGS_CHECK_AT_PREP);
123}
124
125/*
126 * __is_movable_balloon_page - helper to perform @page mapping->flags tests
127 */
128static inline bool __is_movable_balloon_page(struct page *page)
129{
130 struct address_space *mapping = page->mapping;
131 return mapping_balloon(mapping);
132}
133
134/*
135 * balloon_page_movable - test page->mapping->flags to identify balloon pages
136 * that can be moved by compaction/migration.
137 *
138 * This function is used at core compaction's page isolation scheme, therefore
139 * most pages exposed to it are not enlisted as balloon pages and so, to avoid
140 * undesired side effects like racing against __free_pages(), we cannot afford
141 * holding the page locked while testing page->mapping->flags here.
142 *
143 * As we might return false positives in the case of a balloon page being just
144 * released under us, the page->mapping->flags need to be re-tested later,
145 * under the proper page lock, at the functions that will be coping with the
146 * balloon page case.
147 */
148static inline bool balloon_page_movable(struct page *page)
149{
150 /*
151 * Before dereferencing and testing mapping->flags, let's make sure
152 * this is not a page that uses ->mapping in a different way
153 */
154 if (page_flags_cleared(page) && !page_mapped(page) &&
155 page_count(page) == 1)
156 return __is_movable_balloon_page(page);
157
158 return false;
159}
160
161/*
162 * balloon_page_insert - insert a page into the balloon's page list and make
163 * the page->mapping assignment accordingly.
164 * @page : page to be assigned as a 'balloon page'
165 * @mapping : allocated special 'balloon_mapping'
166 * @head : balloon's device page list head
167 *
168 * Caller must ensure the page is locked and the spin_lock protecting balloon
169 * pages list is held before inserting a page into the balloon device.
170 */
171static inline void balloon_page_insert(struct page *page,
172 struct address_space *mapping,
173 struct list_head *head)
174{
175 page->mapping = mapping;
176 list_add(&page->lru, head);
177}
178
179/*
180 * balloon_page_delete - delete a page from balloon's page list and clear
181 * the page->mapping assignement accordingly.
182 * @page : page to be released from balloon's page list
183 *
184 * Caller must ensure the page is locked and the spin_lock protecting balloon
185 * pages list is held before deleting a page from the balloon device.
186 */
187static inline void balloon_page_delete(struct page *page)
188{
189 page->mapping = NULL;
190 list_del(&page->lru);
191}
192
193/*
194 * balloon_page_device - get the b_dev_info descriptor for the balloon device
195 * that enqueues the given page.
196 */
197static inline struct balloon_dev_info *balloon_page_device(struct page *page)
198{
199 struct address_space *mapping = page->mapping;
200 if (likely(mapping))
201 return mapping->private_data;
202
203 return NULL;
204}
205
206static inline gfp_t balloon_mapping_gfp_mask(void)
207{
208 return GFP_HIGHUSER_MOVABLE;
209}
210
211static inline bool balloon_compaction_check(void)
212{
213 return true;
214}
215
216#else /* !CONFIG_BALLOON_COMPACTION */
217
218static inline void *balloon_mapping_alloc(void *balloon_device,
219 const struct address_space_operations *a_ops)
220{
221 return ERR_PTR(-EOPNOTSUPP);
222}
223
224static inline void balloon_mapping_free(struct address_space *balloon_mapping)
225{
226 return;
227}
228
229static inline void balloon_page_insert(struct page *page,
230 struct address_space *mapping,
231 struct list_head *head)
232{
233 list_add(&page->lru, head);
234}
235
236static inline void balloon_page_delete(struct page *page)
237{
238 list_del(&page->lru);
239}
240
241static inline bool balloon_page_movable(struct page *page)
242{
243 return false;
244}
245
246static inline bool balloon_page_isolate(struct page *page)
247{
248 return false;
249}
250
251static inline void balloon_page_putback(struct page *page)
252{
253 return;
254}
255
256static inline int balloon_page_migrate(struct page *newpage,
257 struct page *page, enum migrate_mode mode)
258{
259 return 0;
260}
261
262static inline gfp_t balloon_mapping_gfp_mask(void)
263{
264 return GFP_HIGHUSER;
265}
266
267static inline bool balloon_compaction_check(void)
268{
269 return false;
270}
271#endif /* CONFIG_BALLOON_COMPACTION */
272#endif /* _LINUX_BALLOON_COMPACTION_H */
diff --git a/include/linux/bcm47xx_wdt.h b/include/linux/bcm47xx_wdt.h
new file mode 100644
index 000000000000..e5dfc256485b
--- /dev/null
+++ b/include/linux/bcm47xx_wdt.h
@@ -0,0 +1,19 @@
1#ifndef LINUX_BCM47XX_WDT_H_
2#define LINUX_BCM47XX_WDT_H_
3
4#include <linux/types.h>
5
6
7struct bcm47xx_wdt {
8 u32 (*timer_set)(struct bcm47xx_wdt *, u32);
9 u32 (*timer_set_ms)(struct bcm47xx_wdt *, u32);
10 u32 max_timer_ms;
11
12 void *driver_data;
13};
14
15static inline void *bcm47xx_wdt_get_drvdata(struct bcm47xx_wdt *wdt)
16{
17 return wdt->driver_data;
18}
19#endif /* LINUX_BCM47XX_WDT_H_ */
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 4180eb78d575..93b1e091b1e9 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -157,6 +157,7 @@ struct bcma_host_ops {
157 157
158/* Chip IDs of SoCs */ 158/* Chip IDs of SoCs */
159#define BCMA_CHIP_ID_BCM4706 0x5300 159#define BCMA_CHIP_ID_BCM4706 0x5300
160#define BCMA_PKG_ID_BCM4706L 1
160#define BCMA_CHIP_ID_BCM4716 0x4716 161#define BCMA_CHIP_ID_BCM4716 0x4716
161#define BCMA_PKG_ID_BCM4716 8 162#define BCMA_PKG_ID_BCM4716 8
162#define BCMA_PKG_ID_BCM4717 9 163#define BCMA_PKG_ID_BCM4717 9
@@ -166,7 +167,11 @@ struct bcma_host_ops {
166#define BCMA_CHIP_ID_BCM4749 0x4749 167#define BCMA_CHIP_ID_BCM4749 0x4749
167#define BCMA_CHIP_ID_BCM5356 0x5356 168#define BCMA_CHIP_ID_BCM5356 0x5356
168#define BCMA_CHIP_ID_BCM5357 0x5357 169#define BCMA_CHIP_ID_BCM5357 0x5357
170#define BCMA_PKG_ID_BCM5358 9
171#define BCMA_PKG_ID_BCM47186 10
172#define BCMA_PKG_ID_BCM5357 11
169#define BCMA_CHIP_ID_BCM53572 53572 173#define BCMA_CHIP_ID_BCM53572 53572
174#define BCMA_PKG_ID_BCM47188 9
170 175
171struct bcma_device { 176struct bcma_device {
172 struct bcma_bus *bus; 177 struct bcma_bus *bus;
@@ -251,7 +256,7 @@ struct bcma_bus {
251 u8 num; 256 u8 num;
252 257
253 struct bcma_drv_cc drv_cc; 258 struct bcma_drv_cc drv_cc;
254 struct bcma_drv_pci drv_pci; 259 struct bcma_drv_pci drv_pci[2];
255 struct bcma_drv_mips drv_mips; 260 struct bcma_drv_mips drv_mips;
256 struct bcma_drv_gmac_cmn drv_gmac_cmn; 261 struct bcma_drv_gmac_cmn drv_gmac_cmn;
257 262
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 1cf1749440ac..9a0e3fa3ca95 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -1,6 +1,9 @@
1#ifndef LINUX_BCMA_DRIVER_CC_H_ 1#ifndef LINUX_BCMA_DRIVER_CC_H_
2#define LINUX_BCMA_DRIVER_CC_H_ 2#define LINUX_BCMA_DRIVER_CC_H_
3 3
4#include <linux/platform_device.h>
5#include <linux/gpio.h>
6
4/** ChipCommon core registers. **/ 7/** ChipCommon core registers. **/
5#define BCMA_CC_ID 0x0000 8#define BCMA_CC_ID 0x0000
6#define BCMA_CC_ID_ID 0x0000FFFF 9#define BCMA_CC_ID_ID 0x0000FFFF
@@ -510,6 +513,7 @@ struct bcma_chipcommon_pmu {
510 513
511#ifdef CONFIG_BCMA_DRIVER_MIPS 514#ifdef CONFIG_BCMA_DRIVER_MIPS
512struct bcma_pflash { 515struct bcma_pflash {
516 bool present;
513 u8 buswidth; 517 u8 buswidth;
514 u32 window; 518 u32 window;
515 u32 window_size; 519 u32 window_size;
@@ -532,6 +536,7 @@ struct mtd_info;
532 536
533struct bcma_nflash { 537struct bcma_nflash {
534 bool present; 538 bool present;
539 bool boot; /* This is the flash the SoC boots from */
535 540
536 struct mtd_info *mtd; 541 struct mtd_info *mtd;
537}; 542};
@@ -552,6 +557,7 @@ struct bcma_drv_cc {
552 u32 capabilities; 557 u32 capabilities;
553 u32 capabilities_ext; 558 u32 capabilities_ext;
554 u8 setup_done:1; 559 u8 setup_done:1;
560 u8 early_setup_done:1;
555 /* Fast Powerup Delay constant */ 561 /* Fast Powerup Delay constant */
556 u16 fast_pwrup_delay; 562 u16 fast_pwrup_delay;
557 struct bcma_chipcommon_pmu pmu; 563 struct bcma_chipcommon_pmu pmu;
@@ -567,6 +573,14 @@ struct bcma_drv_cc {
567 int nr_serial_ports; 573 int nr_serial_ports;
568 struct bcma_serial_port serial_ports[4]; 574 struct bcma_serial_port serial_ports[4];
569#endif /* CONFIG_BCMA_DRIVER_MIPS */ 575#endif /* CONFIG_BCMA_DRIVER_MIPS */
576 u32 ticks_per_ms;
577 struct platform_device *watchdog;
578
579 /* Lock for GPIO register access. */
580 spinlock_t gpio_lock;
581#ifdef CONFIG_BCMA_DRIVER_GPIO
582 struct gpio_chip gpio;
583#endif
570}; 584};
571 585
572/* Register access */ 586/* Register access */
@@ -583,14 +597,14 @@ struct bcma_drv_cc {
583 bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) 597 bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set))
584 598
585extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); 599extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc);
600extern void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc);
586 601
587extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); 602extern void bcma_chipco_suspend(struct bcma_drv_cc *cc);
588extern void bcma_chipco_resume(struct bcma_drv_cc *cc); 603extern void bcma_chipco_resume(struct bcma_drv_cc *cc);
589 604
590void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable); 605void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable);
591 606
592extern void bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, 607extern u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks);
593 u32 ticks);
594 608
595void bcma_chipco_irq_mask(struct bcma_drv_cc *cc, u32 mask, u32 value); 609void bcma_chipco_irq_mask(struct bcma_drv_cc *cc, u32 mask, u32 value);
596 610
@@ -603,9 +617,12 @@ u32 bcma_chipco_gpio_outen(struct bcma_drv_cc *cc, u32 mask, u32 value);
603u32 bcma_chipco_gpio_control(struct bcma_drv_cc *cc, u32 mask, u32 value); 617u32 bcma_chipco_gpio_control(struct bcma_drv_cc *cc, u32 mask, u32 value);
604u32 bcma_chipco_gpio_intmask(struct bcma_drv_cc *cc, u32 mask, u32 value); 618u32 bcma_chipco_gpio_intmask(struct bcma_drv_cc *cc, u32 mask, u32 value);
605u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value); 619u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value);
620u32 bcma_chipco_gpio_pullup(struct bcma_drv_cc *cc, u32 mask, u32 value);
621u32 bcma_chipco_gpio_pulldown(struct bcma_drv_cc *cc, u32 mask, u32 value);
606 622
607/* PMU support */ 623/* PMU support */
608extern void bcma_pmu_init(struct bcma_drv_cc *cc); 624extern void bcma_pmu_init(struct bcma_drv_cc *cc);
625extern void bcma_pmu_early_init(struct bcma_drv_cc *cc);
609 626
610extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset, 627extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset,
611 u32 value); 628 u32 value);
diff --git a/include/linux/bcma/bcma_driver_mips.h b/include/linux/bcma/bcma_driver_mips.h
index c0043645cdcb..0baf8a56b794 100644
--- a/include/linux/bcma/bcma_driver_mips.h
+++ b/include/linux/bcma/bcma_driver_mips.h
@@ -35,13 +35,16 @@ struct bcma_device;
35struct bcma_drv_mips { 35struct bcma_drv_mips {
36 struct bcma_device *core; 36 struct bcma_device *core;
37 u8 setup_done:1; 37 u8 setup_done:1;
38 u8 early_setup_done:1;
38 unsigned int assigned_irqs; 39 unsigned int assigned_irqs;
39}; 40};
40 41
41#ifdef CONFIG_BCMA_DRIVER_MIPS 42#ifdef CONFIG_BCMA_DRIVER_MIPS
42extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); 43extern void bcma_core_mips_init(struct bcma_drv_mips *mcore);
44extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore);
43#else 45#else
44static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } 46static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { }
47static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { }
45#endif 48#endif
46 49
47extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); 50extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore);
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h
index 6c9cb93ae3de..7e8104bb7a7e 100644
--- a/include/linux/bcma/bcma_regs.h
+++ b/include/linux/bcma/bcma_regs.h
@@ -85,6 +85,9 @@
85 * (2 ZettaBytes), high 32 bits 85 * (2 ZettaBytes), high 32 bits
86 */ 86 */
87 87
88#define BCMA_SFLASH 0x1c000000 88#define BCMA_SOC_FLASH1 0x1fc00000 /* MIPS Flash Region 1 */
89#define BCMA_SOC_FLASH1_SZ 0x00400000 /* MIPS Size of Flash Region 1 */
90#define BCMA_SOC_FLASH2 0x1c000000 /* Flash Region 2 (region 1 shadowed here) */
91#define BCMA_SOC_FLASH2_SZ 0x02000000 /* Size of Flash Region 2 */
89 92
90#endif /* LINUX_BCMA_REGS_H_ */ 93#endif /* LINUX_BCMA_REGS_H_ */
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index cfcc6bfcaec0..2630c9b41a86 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -72,7 +72,7 @@ struct coredump_params {
72struct linux_binfmt { 72struct linux_binfmt {
73 struct list_head lh; 73 struct list_head lh;
74 struct module *module; 74 struct module *module;
75 int (*load_binary)(struct linux_binprm *, struct pt_regs * regs); 75 int (*load_binary)(struct linux_binprm *);
76 int (*load_shlib)(struct file *); 76 int (*load_shlib)(struct file *);
77 int (*core_dump)(struct coredump_params *cprm); 77 int (*core_dump)(struct coredump_params *cprm);
78 unsigned long min_coredump; /* minimal dump size */ 78 unsigned long min_coredump; /* minimal dump size */
@@ -95,7 +95,7 @@ extern void unregister_binfmt(struct linux_binfmt *);
95 95
96extern int prepare_binprm(struct linux_binprm *); 96extern int prepare_binprm(struct linux_binprm *);
97extern int __must_check remove_arg_zero(struct linux_binprm *); 97extern int __must_check remove_arg_zero(struct linux_binprm *);
98extern int search_binary_handler(struct linux_binprm *, struct pt_regs *); 98extern int search_binary_handler(struct linux_binprm *);
99extern int flush_old_exec(struct linux_binprm * bprm); 99extern int flush_old_exec(struct linux_binprm * bprm);
100extern void setup_new_exec(struct linux_binprm * bprm); 100extern void setup_new_exec(struct linux_binprm * bprm);
101extern void would_dump(struct linux_binprm *, struct file *); 101extern void would_dump(struct linux_binprm *, struct file *);
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 6d6795d46a75..3f778c27f825 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -51,8 +51,8 @@ extern unsigned long free_all_bootmem(void);
51extern void free_bootmem_node(pg_data_t *pgdat, 51extern void free_bootmem_node(pg_data_t *pgdat,
52 unsigned long addr, 52 unsigned long addr,
53 unsigned long size); 53 unsigned long size);
54extern void free_bootmem(unsigned long addr, unsigned long size); 54extern void free_bootmem(unsigned long physaddr, unsigned long size);
55extern void free_bootmem_late(unsigned long addr, unsigned long size); 55extern void free_bootmem_late(unsigned long physaddr, unsigned long size);
56 56
57/* 57/*
58 * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, 58 * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE,
@@ -137,9 +137,6 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
137#define alloc_bootmem_low_pages_node(pgdat, x) \ 137#define alloc_bootmem_low_pages_node(pgdat, x) \
138 __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) 138 __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)
139 139
140extern int reserve_bootmem_generic(unsigned long addr, unsigned long size,
141 int flags);
142
143#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP 140#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
144extern void *alloc_remap(int nid, unsigned long size); 141extern void *alloc_remap(int nid, unsigned long size);
145#else 142#else
diff --git a/include/linux/bug.h b/include/linux/bug.h
index aaac4bba6f5c..b1cf40de847e 100644
--- a/include/linux/bug.h
+++ b/include/linux/bug.h
@@ -15,6 +15,7 @@ struct pt_regs;
15#define BUILD_BUG_ON_NOT_POWER_OF_2(n) 15#define BUILD_BUG_ON_NOT_POWER_OF_2(n)
16#define BUILD_BUG_ON_ZERO(e) (0) 16#define BUILD_BUG_ON_ZERO(e) (0)
17#define BUILD_BUG_ON_NULL(e) ((void*)0) 17#define BUILD_BUG_ON_NULL(e) ((void*)0)
18#define BUILD_BUG_ON_INVALID(e) (0)
18#define BUILD_BUG_ON(condition) 19#define BUILD_BUG_ON(condition)
19#define BUILD_BUG() (0) 20#define BUILD_BUG() (0)
20#else /* __CHECKER__ */ 21#else /* __CHECKER__ */
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index f8a030ced0c7..7d73905dcba2 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -12,6 +12,7 @@
12#include <linux/cpumask.h> 12#include <linux/cpumask.h>
13#include <linux/nodemask.h> 13#include <linux/nodemask.h>
14#include <linux/rcupdate.h> 14#include <linux/rcupdate.h>
15#include <linux/rculist.h>
15#include <linux/cgroupstats.h> 16#include <linux/cgroupstats.h>
16#include <linux/prio_heap.h> 17#include <linux/prio_heap.h>
17#include <linux/rwsem.h> 18#include <linux/rwsem.h>
@@ -34,7 +35,6 @@ extern int cgroup_lock_is_held(void);
34extern bool cgroup_lock_live_group(struct cgroup *cgrp); 35extern bool cgroup_lock_live_group(struct cgroup *cgrp);
35extern void cgroup_unlock(void); 36extern void cgroup_unlock(void);
36extern void cgroup_fork(struct task_struct *p); 37extern void cgroup_fork(struct task_struct *p);
37extern void cgroup_fork_callbacks(struct task_struct *p);
38extern void cgroup_post_fork(struct task_struct *p); 38extern void cgroup_post_fork(struct task_struct *p);
39extern void cgroup_exit(struct task_struct *p, int run_callbacks); 39extern void cgroup_exit(struct task_struct *p, int run_callbacks);
40extern int cgroupstats_build(struct cgroupstats *stats, 40extern int cgroupstats_build(struct cgroupstats *stats,
@@ -66,7 +66,7 @@ struct cgroup_subsys_state {
66 /* 66 /*
67 * State maintained by the cgroup system to allow subsystems 67 * State maintained by the cgroup system to allow subsystems
68 * to be "busy". Should be accessed via css_get(), 68 * to be "busy". Should be accessed via css_get(),
69 * css_tryget() and and css_put(). 69 * css_tryget() and css_put().
70 */ 70 */
71 71
72 atomic_t refcnt; 72 atomic_t refcnt;
@@ -81,9 +81,8 @@ struct cgroup_subsys_state {
81 81
82/* bits in struct cgroup_subsys_state flags field */ 82/* bits in struct cgroup_subsys_state flags field */
83enum { 83enum {
84 CSS_ROOT, /* This CSS is the root of the subsystem */ 84 CSS_ROOT = (1 << 0), /* this CSS is the root of the subsystem */
85 CSS_REMOVED, /* This CSS is dead */ 85 CSS_ONLINE = (1 << 1), /* between ->css_online() and ->css_offline() */
86 CSS_CLEAR_CSS_REFS, /* @ss->__DEPRECATED_clear_css_refs */
87}; 86};
88 87
89/* Caller must verify that the css is not for root cgroup */ 88/* Caller must verify that the css is not for root cgroup */
@@ -102,15 +101,10 @@ static inline void __css_get(struct cgroup_subsys_state *css, int count)
102static inline void css_get(struct cgroup_subsys_state *css) 101static inline void css_get(struct cgroup_subsys_state *css)
103{ 102{
104 /* We don't need to reference count the root state */ 103 /* We don't need to reference count the root state */
105 if (!test_bit(CSS_ROOT, &css->flags)) 104 if (!(css->flags & CSS_ROOT))
106 __css_get(css, 1); 105 __css_get(css, 1);
107} 106}
108 107
109static inline bool css_is_removed(struct cgroup_subsys_state *css)
110{
111 return test_bit(CSS_REMOVED, &css->flags);
112}
113
114/* 108/*
115 * Call css_tryget() to take a reference on a css if your existing 109 * Call css_tryget() to take a reference on a css if your existing
116 * (known-valid) reference isn't already ref-counted. Returns false if 110 * (known-valid) reference isn't already ref-counted. Returns false if
@@ -120,7 +114,7 @@ static inline bool css_is_removed(struct cgroup_subsys_state *css)
120extern bool __css_tryget(struct cgroup_subsys_state *css); 114extern bool __css_tryget(struct cgroup_subsys_state *css);
121static inline bool css_tryget(struct cgroup_subsys_state *css) 115static inline bool css_tryget(struct cgroup_subsys_state *css)
122{ 116{
123 if (test_bit(CSS_ROOT, &css->flags)) 117 if (css->flags & CSS_ROOT)
124 return true; 118 return true;
125 return __css_tryget(css); 119 return __css_tryget(css);
126} 120}
@@ -133,7 +127,7 @@ static inline bool css_tryget(struct cgroup_subsys_state *css)
133extern void __css_put(struct cgroup_subsys_state *css); 127extern void __css_put(struct cgroup_subsys_state *css);
134static inline void css_put(struct cgroup_subsys_state *css) 128static inline void css_put(struct cgroup_subsys_state *css)
135{ 129{
136 if (!test_bit(CSS_ROOT, &css->flags)) 130 if (!(css->flags & CSS_ROOT))
137 __css_put(css); 131 __css_put(css);
138} 132}
139 133
@@ -149,13 +143,11 @@ enum {
149 /* Control Group requires release notifications to userspace */ 143 /* Control Group requires release notifications to userspace */
150 CGRP_NOTIFY_ON_RELEASE, 144 CGRP_NOTIFY_ON_RELEASE,
151 /* 145 /*
152 * A thread in rmdir() is wating for this cgroup. 146 * Clone the parent's configuration when creating a new child
153 */ 147 * cpuset cgroup. For historical reasons, this option can be
154 CGRP_WAIT_ON_RMDIR, 148 * specified at mount time and thus is implemented here.
155 /*
156 * Clone cgroup values when creating a new child cgroup
157 */ 149 */
158 CGRP_CLONE_CHILDREN, 150 CGRP_CPUSET_CLONE_CHILDREN,
159}; 151};
160 152
161struct cgroup { 153struct cgroup {
@@ -167,6 +159,8 @@ struct cgroup {
167 */ 159 */
168 atomic_t count; 160 atomic_t count;
169 161
162 int id; /* ida allocated in-hierarchy ID */
163
170 /* 164 /*
171 * We link our 'sibling' struct into our parent's 'children'. 165 * We link our 'sibling' struct into our parent's 'children'.
172 * Our children link their 'sibling' into our 'children'. 166 * Our children link their 'sibling' into our 'children'.
@@ -176,7 +170,7 @@ struct cgroup {
176 struct list_head files; /* my files */ 170 struct list_head files; /* my files */
177 171
178 struct cgroup *parent; /* my parent */ 172 struct cgroup *parent; /* my parent */
179 struct dentry __rcu *dentry; /* cgroup fs entry, RCU protected */ 173 struct dentry *dentry; /* cgroup fs entry, RCU protected */
180 174
181 /* Private pointers for each registered subsystem */ 175 /* Private pointers for each registered subsystem */
182 struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT]; 176 struct cgroup_subsys_state *subsys[CGROUP_SUBSYS_COUNT];
@@ -282,7 +276,7 @@ struct cgroup_map_cb {
282 276
283/* cftype->flags */ 277/* cftype->flags */
284#define CFTYPE_ONLY_ON_ROOT (1U << 0) /* only create on root cg */ 278#define CFTYPE_ONLY_ON_ROOT (1U << 0) /* only create on root cg */
285#define CFTYPE_NOT_ON_ROOT (1U << 1) /* don't create onp root cg */ 279#define CFTYPE_NOT_ON_ROOT (1U << 1) /* don't create on root cg */
286 280
287#define MAX_CFTYPE_NAME 64 281#define MAX_CFTYPE_NAME 64
288 282
@@ -422,23 +416,6 @@ int cgroup_task_count(const struct cgroup *cgrp);
422int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); 416int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task);
423 417
424/* 418/*
425 * When the subsys has to access css and may add permanent refcnt to css,
426 * it should take care of racy conditions with rmdir(). Following set of
427 * functions, is for stop/restart rmdir if necessary.
428 * Because these will call css_get/put, "css" should be alive css.
429 *
430 * cgroup_exclude_rmdir();
431 * ...do some jobs which may access arbitrary empty cgroup
432 * cgroup_release_and_wakeup_rmdir();
433 *
434 * When someone removes a cgroup while cgroup_exclude_rmdir() holds it,
435 * it sleeps and cgroup_release_and_wakeup_rmdir() will wake him up.
436 */
437
438void cgroup_exclude_rmdir(struct cgroup_subsys_state *css);
439void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css);
440
441/*
442 * Control Group taskset, used to pass around set of tasks to cgroup_subsys 419 * Control Group taskset, used to pass around set of tasks to cgroup_subsys
443 * methods. 420 * methods.
444 */ 421 */
@@ -466,16 +443,17 @@ int cgroup_taskset_size(struct cgroup_taskset *tset);
466 */ 443 */
467 444
468struct cgroup_subsys { 445struct cgroup_subsys {
469 struct cgroup_subsys_state *(*create)(struct cgroup *cgrp); 446 struct cgroup_subsys_state *(*css_alloc)(struct cgroup *cgrp);
470 int (*pre_destroy)(struct cgroup *cgrp); 447 int (*css_online)(struct cgroup *cgrp);
471 void (*destroy)(struct cgroup *cgrp); 448 void (*css_offline)(struct cgroup *cgrp);
449 void (*css_free)(struct cgroup *cgrp);
450
472 int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 451 int (*can_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
473 void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 452 void (*cancel_attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
474 void (*attach)(struct cgroup *cgrp, struct cgroup_taskset *tset); 453 void (*attach)(struct cgroup *cgrp, struct cgroup_taskset *tset);
475 void (*fork)(struct task_struct *task); 454 void (*fork)(struct task_struct *task);
476 void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp, 455 void (*exit)(struct cgroup *cgrp, struct cgroup *old_cgrp,
477 struct task_struct *task); 456 struct task_struct *task);
478 void (*post_clone)(struct cgroup *cgrp);
479 void (*bind)(struct cgroup *root); 457 void (*bind)(struct cgroup *root);
480 458
481 int subsys_id; 459 int subsys_id;
@@ -489,17 +467,6 @@ struct cgroup_subsys {
489 bool use_id; 467 bool use_id;
490 468
491 /* 469 /*
492 * If %true, cgroup removal will try to clear css refs by retrying
493 * ss->pre_destroy() until there's no css ref left. This behavior
494 * is strictly for backward compatibility and will be removed as
495 * soon as the current user (memcg) is updated.
496 *
497 * If %false, ss->pre_destroy() can't fail and cgroup removal won't
498 * wait for css refs to drop to zero before proceeding.
499 */
500 bool __DEPRECATED_clear_css_refs;
501
502 /*
503 * If %false, this subsystem is properly hierarchical - 470 * If %false, this subsystem is properly hierarchical -
504 * configuration, resource accounting and restriction on a parent 471 * configuration, resource accounting and restriction on a parent
505 * cgroup cover those of its children. If %true, hierarchy support 472 * cgroup cover those of its children. If %true, hierarchy support
@@ -572,6 +539,100 @@ static inline struct cgroup* task_cgroup(struct task_struct *task,
572 return task_subsys_state(task, subsys_id)->cgroup; 539 return task_subsys_state(task, subsys_id)->cgroup;
573} 540}
574 541
542/**
543 * cgroup_for_each_child - iterate through children of a cgroup
544 * @pos: the cgroup * to use as the loop cursor
545 * @cgroup: cgroup whose children to walk
546 *
547 * Walk @cgroup's children. Must be called under rcu_read_lock(). A child
548 * cgroup which hasn't finished ->css_online() or already has finished
549 * ->css_offline() may show up during traversal and it's each subsystem's
550 * responsibility to verify that each @pos is alive.
551 *
552 * If a subsystem synchronizes against the parent in its ->css_online() and
553 * before starting iterating, a cgroup which finished ->css_online() is
554 * guaranteed to be visible in the future iterations.
555 */
556#define cgroup_for_each_child(pos, cgroup) \
557 list_for_each_entry_rcu(pos, &(cgroup)->children, sibling)
558
559struct cgroup *cgroup_next_descendant_pre(struct cgroup *pos,
560 struct cgroup *cgroup);
561
562/**
563 * cgroup_for_each_descendant_pre - pre-order walk of a cgroup's descendants
564 * @pos: the cgroup * to use as the loop cursor
565 * @cgroup: cgroup whose descendants to walk
566 *
567 * Walk @cgroup's descendants. Must be called under rcu_read_lock(). A
568 * descendant cgroup which hasn't finished ->css_online() or already has
569 * finished ->css_offline() may show up during traversal and it's each
570 * subsystem's responsibility to verify that each @pos is alive.
571 *
572 * If a subsystem synchronizes against the parent in its ->css_online() and
573 * before starting iterating, and synchronizes against @pos on each
574 * iteration, any descendant cgroup which finished ->css_offline() is
575 * guaranteed to be visible in the future iterations.
576 *
577 * In other words, the following guarantees that a descendant can't escape
578 * state updates of its ancestors.
579 *
580 * my_online(@cgrp)
581 * {
582 * Lock @cgrp->parent and @cgrp;
583 * Inherit state from @cgrp->parent;
584 * Unlock both.
585 * }
586 *
587 * my_update_state(@cgrp)
588 * {
589 * Lock @cgrp;
590 * Update @cgrp's state;
591 * Unlock @cgrp;
592 *
593 * cgroup_for_each_descendant_pre(@pos, @cgrp) {
594 * Lock @pos;
595 * Verify @pos is alive and inherit state from @pos->parent;
596 * Unlock @pos;
597 * }
598 * }
599 *
600 * As long as the inheriting step, including checking the parent state, is
601 * enclosed inside @pos locking, double-locking the parent isn't necessary
602 * while inheriting. The state update to the parent is guaranteed to be
603 * visible by walking order and, as long as inheriting operations to the
604 * same @pos are atomic to each other, multiple updates racing each other
605 * still result in the correct state. It's guaranateed that at least one
606 * inheritance happens for any cgroup after the latest update to its
607 * parent.
608 *
609 * If checking parent's state requires locking the parent, each inheriting
610 * iteration should lock and unlock both @pos->parent and @pos.
611 *
612 * Alternatively, a subsystem may choose to use a single global lock to
613 * synchronize ->css_online() and ->css_offline() against tree-walking
614 * operations.
615 */
616#define cgroup_for_each_descendant_pre(pos, cgroup) \
617 for (pos = cgroup_next_descendant_pre(NULL, (cgroup)); (pos); \
618 pos = cgroup_next_descendant_pre((pos), (cgroup)))
619
620struct cgroup *cgroup_next_descendant_post(struct cgroup *pos,
621 struct cgroup *cgroup);
622
623/**
624 * cgroup_for_each_descendant_post - post-order walk of a cgroup's descendants
625 * @pos: the cgroup * to use as the loop cursor
626 * @cgroup: cgroup whose descendants to walk
627 *
628 * Similar to cgroup_for_each_descendant_pre() but performs post-order
629 * traversal instead. Note that the walk visibility guarantee described in
630 * pre-order walk doesn't apply the same to post-order walks.
631 */
632#define cgroup_for_each_descendant_post(pos, cgroup) \
633 for (pos = cgroup_next_descendant_post(NULL, (cgroup)); (pos); \
634 pos = cgroup_next_descendant_post((pos), (cgroup)))
635
575/* A cgroup_iter should be treated as an opaque object */ 636/* A cgroup_iter should be treated as an opaque object */
576struct cgroup_iter { 637struct cgroup_iter {
577 struct list_head *cg_link; 638 struct list_head *cg_link;
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index f9f5e9eeb9dd..4989b8a7bed1 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -53,9 +53,18 @@ struct clk_hw;
53 * @disable: Disable the clock atomically. Called with enable_lock held. 53 * @disable: Disable the clock atomically. Called with enable_lock held.
54 * This function must not sleep. 54 * This function must not sleep.
55 * 55 *
56 * @recalc_rate Recalculate the rate of this clock, by quering hardware. The 56 * @is_enabled: Queries the hardware to determine if the clock is enabled.
57 * This function must not sleep. Optional, if this op is not
58 * set then the enable count will be used.
59 *
60 * @disable_unused: Disable the clock atomically. Only called from
61 * clk_disable_unused for gate clocks with special needs.
62 * Called with enable_lock held. This function must not
63 * sleep.
64 *
65 * @recalc_rate Recalculate the rate of this clock, by querying hardware. The
57 * parent rate is an input parameter. It is up to the caller to 66 * parent rate is an input parameter. It is up to the caller to
58 * insure that the prepare_mutex is held across this call. 67 * ensure that the prepare_mutex is held across this call.
59 * Returns the calculated rate. Optional, but recommended - if 68 * Returns the calculated rate. Optional, but recommended - if
60 * this op is not set then clock rate will be initialized to 0. 69 * this op is not set then clock rate will be initialized to 0.
61 * 70 *
@@ -89,7 +98,7 @@ struct clk_hw;
89 * implementations to split any work between atomic (enable) and sleepable 98 * implementations to split any work between atomic (enable) and sleepable
90 * (prepare) contexts. If enabling a clock requires code that might sleep, 99 * (prepare) contexts. If enabling a clock requires code that might sleep,
91 * this must be done in clk_prepare. Clock enable code that will never be 100 * this must be done in clk_prepare. Clock enable code that will never be
92 * called in a sleepable context may be implement in clk_enable. 101 * called in a sleepable context may be implemented in clk_enable.
93 * 102 *
94 * Typically, drivers will call clk_prepare when a clock may be needed later 103 * Typically, drivers will call clk_prepare when a clock may be needed later
95 * (eg. when a device is opened), and clk_enable when the clock is actually 104 * (eg. when a device is opened), and clk_enable when the clock is actually
@@ -102,6 +111,7 @@ struct clk_ops {
102 int (*enable)(struct clk_hw *hw); 111 int (*enable)(struct clk_hw *hw);
103 void (*disable)(struct clk_hw *hw); 112 void (*disable)(struct clk_hw *hw);
104 int (*is_enabled)(struct clk_hw *hw); 113 int (*is_enabled)(struct clk_hw *hw);
114 void (*disable_unused)(struct clk_hw *hw);
105 unsigned long (*recalc_rate)(struct clk_hw *hw, 115 unsigned long (*recalc_rate)(struct clk_hw *hw,
106 unsigned long parent_rate); 116 unsigned long parent_rate);
107 long (*round_rate)(struct clk_hw *hw, unsigned long, 117 long (*round_rate)(struct clk_hw *hw, unsigned long,
@@ -327,19 +337,21 @@ struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
327 * error code; drivers must test for an error code after calling clk_register. 337 * error code; drivers must test for an error code after calling clk_register.
328 */ 338 */
329struct clk *clk_register(struct device *dev, struct clk_hw *hw); 339struct clk *clk_register(struct device *dev, struct clk_hw *hw);
340struct clk *devm_clk_register(struct device *dev, struct clk_hw *hw);
330 341
331void clk_unregister(struct clk *clk); 342void clk_unregister(struct clk *clk);
343void devm_clk_unregister(struct device *dev, struct clk *clk);
332 344
333/* helper functions */ 345/* helper functions */
334const char *__clk_get_name(struct clk *clk); 346const char *__clk_get_name(struct clk *clk);
335struct clk_hw *__clk_get_hw(struct clk *clk); 347struct clk_hw *__clk_get_hw(struct clk *clk);
336u8 __clk_get_num_parents(struct clk *clk); 348u8 __clk_get_num_parents(struct clk *clk);
337struct clk *__clk_get_parent(struct clk *clk); 349struct clk *__clk_get_parent(struct clk *clk);
338int __clk_get_enable_count(struct clk *clk); 350unsigned int __clk_get_enable_count(struct clk *clk);
339int __clk_get_prepare_count(struct clk *clk); 351unsigned int __clk_get_prepare_count(struct clk *clk);
340unsigned long __clk_get_rate(struct clk *clk); 352unsigned long __clk_get_rate(struct clk *clk);
341unsigned long __clk_get_flags(struct clk *clk); 353unsigned long __clk_get_flags(struct clk *clk);
342int __clk_is_enabled(struct clk *clk); 354bool __clk_is_enabled(struct clk *clk);
343struct clk *__clk_lookup(const char *name); 355struct clk *__clk_lookup(const char *name);
344 356
345/* 357/*
diff --git a/include/linux/clk/mvebu.h b/include/linux/clk/mvebu.h
new file mode 100644
index 000000000000..8c4ae713b063
--- /dev/null
+++ b/include/linux/clk/mvebu.h
@@ -0,0 +1,22 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 */
16
17#ifndef __CLK_MVEBU_H_
18#define __CLK_MVEBU_H_
19
20void __init mvebu_clocks_init(void);
21
22#endif
diff --git a/include/linux/clk/sunxi.h b/include/linux/clk/sunxi.h
new file mode 100644
index 000000000000..e074fdd5a236
--- /dev/null
+++ b/include/linux/clk/sunxi.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright 2012 Maxime Ripard
3 *
4 * Maxime Ripard <maxime.ripard@free-electrons.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 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __LINUX_CLK_SUNXI_H_
18#define __LINUX_CLK_SUNXI_H_
19
20void __init sunxi_init_clocks(void);
21
22#endif
diff --git a/include/linux/clk/zynq.h b/include/linux/clk/zynq.h
new file mode 100644
index 000000000000..56be7cd9aa8b
--- /dev/null
+++ b/include/linux/clk/zynq.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright (C) 2012 National Instruments
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
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __LINUX_CLK_ZYNQ_H_
20#define __LINUX_CLK_ZYNQ_H_
21
22void __init xilinx_zynq_clocks_init(void __iomem *slcr);
23
24#endif
diff --git a/include/linux/compat.h b/include/linux/compat.h
index d0ced1011f2f..784ebfe63c48 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -284,12 +284,8 @@ asmlinkage ssize_t compat_sys_pwritev(unsigned long fd,
284 const struct compat_iovec __user *vec, 284 const struct compat_iovec __user *vec,
285 unsigned long vlen, u32 pos_low, u32 pos_high); 285 unsigned long vlen, u32 pos_low, u32 pos_high);
286 286
287int compat_do_execve(const char *filename, const compat_uptr_t __user *argv,
288 const compat_uptr_t __user *envp, struct pt_regs *regs);
289#ifdef __ARCH_WANT_SYS_EXECVE
290asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, 287asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
291 const compat_uptr_t __user *envp); 288 const compat_uptr_t __user *envp);
292#endif
293 289
294asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, 290asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
295 compat_ulong_t __user *outp, compat_ulong_t __user *exp, 291 compat_ulong_t __user *outp, compat_ulong_t __user *exp,
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
new file mode 100644
index 000000000000..e24339ccb7f0
--- /dev/null
+++ b/include/linux/context_tracking.h
@@ -0,0 +1,18 @@
1#ifndef _LINUX_CONTEXT_TRACKING_H
2#define _LINUX_CONTEXT_TRACKING_H
3
4#ifdef CONFIG_CONTEXT_TRACKING
5#include <linux/sched.h>
6
7extern void user_enter(void);
8extern void user_exit(void);
9extern void context_tracking_task_switch(struct task_struct *prev,
10 struct task_struct *next);
11#else
12static inline void user_enter(void) { }
13static inline void user_exit(void) { }
14static inline void context_tracking_task_switch(struct task_struct *prev,
15 struct task_struct *next) { }
16#endif /* !CONFIG_CONTEXT_TRACKING */
17
18#endif
diff --git a/include/linux/coredump.h b/include/linux/coredump.h
index 1d7399314a89..a98f1ca60407 100644
--- a/include/linux/coredump.h
+++ b/include/linux/coredump.h
@@ -13,9 +13,9 @@
13extern int dump_write(struct file *file, const void *addr, int nr); 13extern int dump_write(struct file *file, const void *addr, int nr);
14extern int dump_seek(struct file *file, loff_t off); 14extern int dump_seek(struct file *file, loff_t off);
15#ifdef CONFIG_COREDUMP 15#ifdef CONFIG_COREDUMP
16extern void do_coredump(siginfo_t *siginfo, struct pt_regs *regs); 16extern void do_coredump(siginfo_t *siginfo);
17#else 17#else
18static inline void do_coredump(siginfo_t *siginfo, struct pt_regs *regs) {} 18static inline void do_coredump(siginfo_t *siginfo) {}
19#endif 19#endif
20 20
21#endif /* _LINUX_COREDUMP_H */ 21#endif /* _LINUX_COREDUMP_H */
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h
index 851530128e65..40b4ef54cc7d 100644
--- a/include/linux/cpu_cooling.h
+++ b/include/linux/cpu_cooling.h
@@ -29,13 +29,13 @@
29#define CPUFREQ_COOLING_START 0 29#define CPUFREQ_COOLING_START 0
30#define CPUFREQ_COOLING_STOP 1 30#define CPUFREQ_COOLING_STOP 1
31 31
32#ifdef CONFIG_CPU_THERMAL 32#if defined(CONFIG_CPU_THERMAL) || defined(CONFIG_CPU_THERMAL_MODULE)
33/** 33/**
34 * cpufreq_cooling_register - function to create cpufreq cooling device. 34 * cpufreq_cooling_register - function to create cpufreq cooling device.
35 * @clip_cpus: cpumask of cpus where the frequency constraints will happen 35 * @clip_cpus: cpumask of cpus where the frequency constraints will happen
36 */ 36 */
37struct thermal_cooling_device *cpufreq_cooling_register( 37struct thermal_cooling_device *cpufreq_cooling_register(
38 struct cpumask *clip_cpus); 38 const struct cpumask *clip_cpus);
39 39
40/** 40/**
41 * cpufreq_cooling_unregister - function to remove cpufreq cooling device. 41 * cpufreq_cooling_unregister - function to remove cpufreq cooling device.
@@ -44,7 +44,7 @@ struct thermal_cooling_device *cpufreq_cooling_register(
44void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev); 44void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev);
45#else /* !CONFIG_CPU_THERMAL */ 45#else /* !CONFIG_CPU_THERMAL */
46static inline struct thermal_cooling_device *cpufreq_cooling_register( 46static inline struct thermal_cooling_device *cpufreq_cooling_register(
47 struct cpumask *clip_cpus) 47 const struct cpumask *clip_cpus)
48{ 48{
49 return NULL; 49 return NULL;
50} 50}
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index b60f6ba01d0c..a55b88eaf96a 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -11,6 +11,7 @@
11#ifndef _LINUX_CPUFREQ_H 11#ifndef _LINUX_CPUFREQ_H
12#define _LINUX_CPUFREQ_H 12#define _LINUX_CPUFREQ_H
13 13
14#include <asm/cputime.h>
14#include <linux/mutex.h> 15#include <linux/mutex.h>
15#include <linux/notifier.h> 16#include <linux/notifier.h>
16#include <linux/threads.h> 17#include <linux/threads.h>
@@ -22,6 +23,8 @@
22#include <asm/div64.h> 23#include <asm/div64.h>
23 24
24#define CPUFREQ_NAME_LEN 16 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)
25 28
26 29
27/********************************************************************* 30/*********************************************************************
@@ -404,6 +407,4 @@ void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table,
404 unsigned int cpu); 407 unsigned int cpu);
405 408
406void cpufreq_frequency_table_put_attr(unsigned int cpu); 409void cpufreq_frequency_table_put_attr(unsigned int cpu);
407
408
409#endif /* _LINUX_CPUFREQ_H */ 410#endif /* _LINUX_CPUFREQ_H */
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 279b1eaa8b73..3711b34dc4f9 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -82,13 +82,6 @@ cpuidle_set_statedata(struct cpuidle_state_usage *st_usage, void *data)
82 st_usage->driver_data = data; 82 st_usage->driver_data = data;
83} 83}
84 84
85struct cpuidle_state_kobj {
86 struct cpuidle_state *state;
87 struct cpuidle_state_usage *state_usage;
88 struct completion kobj_unregister;
89 struct kobject kobj;
90};
91
92struct cpuidle_device { 85struct cpuidle_device {
93 unsigned int registered:1; 86 unsigned int registered:1;
94 unsigned int enabled:1; 87 unsigned int enabled:1;
@@ -98,7 +91,7 @@ struct cpuidle_device {
98 int state_count; 91 int state_count;
99 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX]; 92 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
100 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; 93 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
101 94 struct cpuidle_driver_kobj *kobj_driver;
102 struct list_head device_list; 95 struct list_head device_list;
103 struct kobject kobj; 96 struct kobject kobj;
104 struct completion kobj_unregister; 97 struct completion kobj_unregister;
@@ -131,6 +124,7 @@ static inline int cpuidle_get_last_residency(struct cpuidle_device *dev)
131struct cpuidle_driver { 124struct cpuidle_driver {
132 const char *name; 125 const char *name;
133 struct module *owner; 126 struct module *owner;
127 int refcnt;
134 128
135 unsigned int power_specified:1; 129 unsigned int power_specified:1;
136 /* set to 1 to use the core cpuidle time keeping (for all states). */ 130 /* set to 1 to use the core cpuidle time keeping (for all states). */
@@ -163,6 +157,10 @@ extern int cpuidle_wrap_enter(struct cpuidle_device *dev,
163 struct cpuidle_driver *drv, int index)); 157 struct cpuidle_driver *drv, int index));
164extern int cpuidle_play_dead(void); 158extern int cpuidle_play_dead(void);
165 159
160extern struct cpuidle_driver *cpuidle_get_cpu_driver(struct cpuidle_device *dev);
161extern int cpuidle_register_cpu_driver(struct cpuidle_driver *drv, int cpu);
162extern void cpuidle_unregister_cpu_driver(struct cpuidle_driver *drv, int cpu);
163
166#else 164#else
167static inline void disable_cpuidle(void) { } 165static inline void disable_cpuidle(void) { }
168static inline int cpuidle_idle_call(void) { return -ENODEV; } 166static inline int cpuidle_idle_call(void) { return -ENODEV; }
@@ -189,7 +187,6 @@ static inline int cpuidle_wrap_enter(struct cpuidle_device *dev,
189 struct cpuidle_driver *drv, int index)) 187 struct cpuidle_driver *drv, int index))
190{ return -ENODEV; } 188{ return -ENODEV; }
191static inline int cpuidle_play_dead(void) {return -ENODEV; } 189static inline int cpuidle_play_dead(void) {return -ENODEV; }
192
193#endif 190#endif
194 191
195#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED 192#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 838320fc3d1d..8c8a60d29407 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -144,7 +144,7 @@ static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
144 return node_possible_map; 144 return node_possible_map;
145} 145}
146 146
147#define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY]) 147#define cpuset_current_mems_allowed (node_states[N_MEMORY])
148static inline void cpuset_init_current_mems_allowed(void) {} 148static inline void cpuset_init_current_mems_allowed(void) {}
149 149
150static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask) 150static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask)
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index 281c72a3b9d5..e83ef39b3bea 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -25,12 +25,12 @@ struct devfreq;
25 * struct devfreq_dev_status - Data given from devfreq user device to 25 * struct devfreq_dev_status - Data given from devfreq user device to
26 * governors. Represents the performance 26 * governors. Represents the performance
27 * statistics. 27 * statistics.
28 * @total_time The total time represented by this instance of 28 * @total_time: The total time represented by this instance of
29 * devfreq_dev_status 29 * devfreq_dev_status
30 * @busy_time The time that the device was working among the 30 * @busy_time: The time that the device was working among the
31 * total_time. 31 * total_time.
32 * @current_frequency The operating frequency. 32 * @current_frequency: The operating frequency.
33 * @private_data An entry not specified by the devfreq framework. 33 * @private_data: An entry not specified by the devfreq framework.
34 * A device and a specific governor may have their 34 * A device and a specific governor may have their
35 * own protocol with private_data. However, because 35 * own protocol with private_data. However, because
36 * this is governor-specific, a governor using this 36 * this is governor-specific, a governor using this
@@ -54,23 +54,27 @@ struct devfreq_dev_status {
54 54
55/** 55/**
56 * struct devfreq_dev_profile - Devfreq's user device profile 56 * struct devfreq_dev_profile - Devfreq's user device profile
57 * @initial_freq The operating frequency when devfreq_add_device() is 57 * @initial_freq: The operating frequency when devfreq_add_device() is
58 * called. 58 * called.
59 * @polling_ms The polling interval in ms. 0 disables polling. 59 * @polling_ms: The polling interval in ms. 0 disables polling.
60 * @target The device should set its operating frequency at 60 * @target: The device should set its operating frequency at
61 * freq or lowest-upper-than-freq value. If freq is 61 * freq or lowest-upper-than-freq value. If freq is
62 * higher than any operable frequency, set maximum. 62 * higher than any operable frequency, set maximum.
63 * Before returning, target function should set 63 * Before returning, target function should set
64 * freq at the current frequency. 64 * freq at the current frequency.
65 * The "flags" parameter's possible values are 65 * The "flags" parameter's possible values are
66 * explained above with "DEVFREQ_FLAG_*" macros. 66 * explained above with "DEVFREQ_FLAG_*" macros.
67 * @get_dev_status The device should provide the current performance 67 * @get_dev_status: The device should provide the current performance
68 * status to devfreq, which is used by governors. 68 * status to devfreq, which is used by governors.
69 * @exit An optional callback that is called when devfreq 69 * @get_cur_freq: The device should provide the current frequency
70 * at which it is operating.
71 * @exit: An optional callback that is called when devfreq
70 * is removing the devfreq object due to error or 72 * is removing the devfreq object due to error or
71 * from devfreq_remove_device() call. If the user 73 * from devfreq_remove_device() call. If the user
72 * has registered devfreq->nb at a notifier-head, 74 * has registered devfreq->nb at a notifier-head,
73 * this is the time to unregister it. 75 * this is the time to unregister it.
76 * @freq_table: Optional list of frequencies to support statistics.
77 * @max_state: The size of freq_table.
74 */ 78 */
75struct devfreq_dev_profile { 79struct devfreq_dev_profile {
76 unsigned long initial_freq; 80 unsigned long initial_freq;
@@ -79,63 +83,63 @@ struct devfreq_dev_profile {
79 int (*target)(struct device *dev, unsigned long *freq, u32 flags); 83 int (*target)(struct device *dev, unsigned long *freq, u32 flags);
80 int (*get_dev_status)(struct device *dev, 84 int (*get_dev_status)(struct device *dev,
81 struct devfreq_dev_status *stat); 85 struct devfreq_dev_status *stat);
86 int (*get_cur_freq)(struct device *dev, unsigned long *freq);
82 void (*exit)(struct device *dev); 87 void (*exit)(struct device *dev);
88
89 unsigned int *freq_table;
90 unsigned int max_state;
83}; 91};
84 92
85/** 93/**
86 * struct devfreq_governor - Devfreq policy governor 94 * struct devfreq_governor - Devfreq policy governor
87 * @name Governor's name 95 * @node: list node - contains registered devfreq governors
88 * @get_target_freq Returns desired operating frequency for the device. 96 * @name: Governor's name
97 * @get_target_freq: Returns desired operating frequency for the device.
89 * Basically, get_target_freq will run 98 * Basically, get_target_freq will run
90 * devfreq_dev_profile.get_dev_status() to get the 99 * devfreq_dev_profile.get_dev_status() to get the
91 * status of the device (load = busy_time / total_time). 100 * status of the device (load = busy_time / total_time).
92 * If no_central_polling is set, this callback is called 101 * If no_central_polling is set, this callback is called
93 * only with update_devfreq() notified by OPP. 102 * only with update_devfreq() notified by OPP.
94 * @init Called when the devfreq is being attached to a device 103 * @event_handler: Callback for devfreq core framework to notify events
95 * @exit Called when the devfreq is being removed from a 104 * to governors. Events include per device governor
96 * device. Governor should stop any internal routines 105 * init and exit, opp changes out of devfreq, suspend
97 * before return because related data may be 106 * and resume of per device devfreq during device idle.
98 * freed after exit().
99 * @no_central_polling Do not use devfreq's central polling mechanism.
100 * When this is set, devfreq will not call
101 * get_target_freq with devfreq_monitor(). However,
102 * devfreq will call get_target_freq with
103 * devfreq_update() notified by OPP framework.
104 * 107 *
105 * Note that the callbacks are called with devfreq->lock locked by devfreq. 108 * Note that the callbacks are called with devfreq->lock locked by devfreq.
106 */ 109 */
107struct devfreq_governor { 110struct devfreq_governor {
111 struct list_head node;
112
108 const char name[DEVFREQ_NAME_LEN]; 113 const char name[DEVFREQ_NAME_LEN];
109 int (*get_target_freq)(struct devfreq *this, unsigned long *freq); 114 int (*get_target_freq)(struct devfreq *this, unsigned long *freq);
110 int (*init)(struct devfreq *this); 115 int (*event_handler)(struct devfreq *devfreq,
111 void (*exit)(struct devfreq *this); 116 unsigned int event, void *data);
112 const bool no_central_polling;
113}; 117};
114 118
115/** 119/**
116 * struct devfreq - Device devfreq structure 120 * struct devfreq - Device devfreq structure
117 * @node list node - contains the devices with devfreq that have been 121 * @node: list node - contains the devices with devfreq that have been
118 * registered. 122 * registered.
119 * @lock a mutex to protect accessing devfreq. 123 * @lock: a mutex to protect accessing devfreq.
120 * @dev device registered by devfreq class. dev.parent is the device 124 * @dev: device registered by devfreq class. dev.parent is the device
121 * using devfreq. 125 * using devfreq.
122 * @profile device-specific devfreq profile 126 * @profile: device-specific devfreq profile
123 * @governor method how to choose frequency based on the usage. 127 * @governor: method how to choose frequency based on the usage.
124 * @nb notifier block used to notify devfreq object that it should 128 * @governor_name: devfreq governor name for use with this devfreq
129 * @nb: notifier block used to notify devfreq object that it should
125 * reevaluate operable frequencies. Devfreq users may use 130 * reevaluate operable frequencies. Devfreq users may use
126 * devfreq.nb to the corresponding register notifier call chain. 131 * devfreq.nb to the corresponding register notifier call chain.
127 * @polling_jiffies interval in jiffies. 132 * @work: delayed work for load monitoring.
128 * @previous_freq previously configured frequency value. 133 * @previous_freq: previously configured frequency value.
129 * @next_polling the number of remaining jiffies to poll with 134 * @data: Private data of the governor. The devfreq framework does not
130 * "devfreq_monitor" executions to reevaluate
131 * frequency/voltage of the device. Set by
132 * profile's polling_ms interval.
133 * @data Private data of the governor. The devfreq framework does not
134 * touch this. 135 * touch this.
135 * @being_removed a flag to mark that this object is being removed in 136 * @min_freq: Limit minimum frequency requested by user (0: none)
136 * order to prevent trying to remove the object multiple times. 137 * @max_freq: Limit maximum frequency requested by user (0: none)
137 * @min_freq Limit minimum frequency requested by user (0: none) 138 * @stop_polling: devfreq polling status of a device.
138 * @max_freq Limit maximum frequency requested by user (0: none) 139 * @total_trans: Number of devfreq transitions
140 * @trans_table: Statistics of devfreq transitions
141 * @time_in_state: Statistics of devfreq states
142 * @last_stat_updated: The last time stat updated
139 * 143 *
140 * This structure stores the devfreq information for a give device. 144 * This structure stores the devfreq information for a give device.
141 * 145 *
@@ -152,26 +156,33 @@ struct devfreq {
152 struct device dev; 156 struct device dev;
153 struct devfreq_dev_profile *profile; 157 struct devfreq_dev_profile *profile;
154 const struct devfreq_governor *governor; 158 const struct devfreq_governor *governor;
159 char governor_name[DEVFREQ_NAME_LEN];
155 struct notifier_block nb; 160 struct notifier_block nb;
161 struct delayed_work work;
156 162
157 unsigned long polling_jiffies;
158 unsigned long previous_freq; 163 unsigned long previous_freq;
159 unsigned int next_polling;
160 164
161 void *data; /* private data for governors */ 165 void *data; /* private data for governors */
162 166
163 bool being_removed;
164
165 unsigned long min_freq; 167 unsigned long min_freq;
166 unsigned long max_freq; 168 unsigned long max_freq;
169 bool stop_polling;
170
171 /* information for device freqeuncy transition */
172 unsigned int total_trans;
173 unsigned int *trans_table;
174 unsigned long *time_in_state;
175 unsigned long last_stat_updated;
167}; 176};
168 177
169#if defined(CONFIG_PM_DEVFREQ) 178#if defined(CONFIG_PM_DEVFREQ)
170extern struct devfreq *devfreq_add_device(struct device *dev, 179extern struct devfreq *devfreq_add_device(struct device *dev,
171 struct devfreq_dev_profile *profile, 180 struct devfreq_dev_profile *profile,
172 const struct devfreq_governor *governor, 181 const char *governor_name,
173 void *data); 182 void *data);
174extern int devfreq_remove_device(struct devfreq *devfreq); 183extern int devfreq_remove_device(struct devfreq *devfreq);
184extern int devfreq_suspend_device(struct devfreq *devfreq);
185extern int devfreq_resume_device(struct devfreq *devfreq);
175 186
176/* Helper functions for devfreq user device driver with OPP. */ 187/* Helper functions for devfreq user device driver with OPP. */
177extern struct opp *devfreq_recommended_opp(struct device *dev, 188extern struct opp *devfreq_recommended_opp(struct device *dev,
@@ -181,23 +192,13 @@ extern int devfreq_register_opp_notifier(struct device *dev,
181extern int devfreq_unregister_opp_notifier(struct device *dev, 192extern int devfreq_unregister_opp_notifier(struct device *dev,
182 struct devfreq *devfreq); 193 struct devfreq *devfreq);
183 194
184#ifdef CONFIG_DEVFREQ_GOV_POWERSAVE 195#if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND)
185extern const struct devfreq_governor devfreq_powersave;
186#endif
187#ifdef CONFIG_DEVFREQ_GOV_PERFORMANCE
188extern const struct devfreq_governor devfreq_performance;
189#endif
190#ifdef CONFIG_DEVFREQ_GOV_USERSPACE
191extern const struct devfreq_governor devfreq_userspace;
192#endif
193#ifdef CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
194extern const struct devfreq_governor devfreq_simple_ondemand;
195/** 196/**
196 * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq 197 * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq
197 * and devfreq_add_device 198 * and devfreq_add_device
198 * @ upthreshold If the load is over this value, the frequency jumps. 199 * @upthreshold: If the load is over this value, the frequency jumps.
199 * Specify 0 to use the default. Valid value = 0 to 100. 200 * Specify 0 to use the default. Valid value = 0 to 100.
200 * @ downdifferential If the load is under upthreshold - downdifferential, 201 * @downdifferential: If the load is under upthreshold - downdifferential,
201 * the governor may consider slowing the frequency down. 202 * the governor may consider slowing the frequency down.
202 * Specify 0 to use the default. Valid value = 0 to 100. 203 * Specify 0 to use the default. Valid value = 0 to 100.
203 * downdifferential < upthreshold must hold. 204 * downdifferential < upthreshold must hold.
@@ -214,7 +215,7 @@ struct devfreq_simple_ondemand_data {
214#else /* !CONFIG_PM_DEVFREQ */ 215#else /* !CONFIG_PM_DEVFREQ */
215static struct devfreq *devfreq_add_device(struct device *dev, 216static struct devfreq *devfreq_add_device(struct device *dev,
216 struct devfreq_dev_profile *profile, 217 struct devfreq_dev_profile *profile,
217 struct devfreq_governor *governor, 218 const char *governor_name,
218 void *data) 219 void *data)
219{ 220{
220 return NULL; 221 return NULL;
@@ -225,6 +226,16 @@ static int devfreq_remove_device(struct devfreq *devfreq)
225 return 0; 226 return 0;
226} 227}
227 228
229static int devfreq_suspend_device(struct devfreq *devfreq)
230{
231 return 0;
232}
233
234static int devfreq_resume_device(struct devfreq *devfreq)
235{
236 return 0;
237}
238
228static struct opp *devfreq_recommended_opp(struct device *dev, 239static struct opp *devfreq_recommended_opp(struct device *dev,
229 unsigned long *freq, u32 flags) 240 unsigned long *freq, u32 flags)
230{ 241{
@@ -243,11 +254,6 @@ static int devfreq_unregister_opp_notifier(struct device *dev,
243 return -EINVAL; 254 return -EINVAL;
244} 255}
245 256
246#define devfreq_powersave NULL
247#define devfreq_performance NULL
248#define devfreq_userspace NULL
249#define devfreq_simple_ondemand NULL
250
251#endif /* CONFIG_PM_DEVFREQ */ 257#endif /* CONFIG_PM_DEVFREQ */
252 258
253#endif /* __LINUX_DEVFREQ_H__ */ 259#endif /* __LINUX_DEVFREQ_H__ */
diff --git a/include/linux/device.h b/include/linux/device.h
index 86ef6ab553b1..43dcda937ddf 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -190,6 +190,7 @@ extern struct klist *bus_get_device_klist(struct bus_type *bus);
190 * @mod_name: Used for built-in modules. 190 * @mod_name: Used for built-in modules.
191 * @suppress_bind_attrs: Disables bind/unbind via sysfs. 191 * @suppress_bind_attrs: Disables bind/unbind via sysfs.
192 * @of_match_table: The open firmware table. 192 * @of_match_table: The open firmware table.
193 * @acpi_match_table: The ACPI match table.
193 * @probe: Called to query the existence of a specific device, 194 * @probe: Called to query the existence of a specific device,
194 * whether this driver can work with it, and bind the driver 195 * whether this driver can work with it, and bind the driver
195 * to a specific device. 196 * to a specific device.
@@ -223,6 +224,7 @@ struct device_driver {
223 bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ 224 bool suppress_bind_attrs; /* disables bind/unbind via sysfs */
224 225
225 const struct of_device_id *of_match_table; 226 const struct of_device_id *of_match_table;
227 const struct acpi_device_id *acpi_match_table;
226 228
227 int (*probe) (struct device *dev); 229 int (*probe) (struct device *dev);
228 int (*remove) (struct device *dev); 230 int (*remove) (struct device *dev);
@@ -496,6 +498,10 @@ ssize_t device_show_int(struct device *dev, struct device_attribute *attr,
496 char *buf); 498 char *buf);
497ssize_t device_store_int(struct device *dev, struct device_attribute *attr, 499ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
498 const char *buf, size_t count); 500 const char *buf, size_t count);
501ssize_t device_show_bool(struct device *dev, struct device_attribute *attr,
502 char *buf);
503ssize_t device_store_bool(struct device *dev, struct device_attribute *attr,
504 const char *buf, size_t count);
499 505
500#define DEVICE_ATTR(_name, _mode, _show, _store) \ 506#define DEVICE_ATTR(_name, _mode, _show, _store) \
501 struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store) 507 struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
@@ -505,6 +511,9 @@ ssize_t device_store_int(struct device *dev, struct device_attribute *attr,
505#define DEVICE_INT_ATTR(_name, _mode, _var) \ 511#define DEVICE_INT_ATTR(_name, _mode, _var) \
506 struct dev_ext_attribute dev_attr_##_name = \ 512 struct dev_ext_attribute dev_attr_##_name = \
507 { __ATTR(_name, _mode, device_show_int, device_store_int), &(_var) } 513 { __ATTR(_name, _mode, device_show_int, device_store_int), &(_var) }
514#define DEVICE_BOOL_ATTR(_name, _mode, _var) \
515 struct dev_ext_attribute dev_attr_##_name = \
516 { __ATTR(_name, _mode, device_show_bool, device_store_bool), &(_var) }
508#define DEVICE_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) \ 517#define DEVICE_ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) \
509 struct device_attribute dev_attr_##_name = \ 518 struct device_attribute dev_attr_##_name = \
510 __ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store) 519 __ATTR_IGNORE_LOCKDEP(_name, _mode, _show, _store)
@@ -576,6 +585,12 @@ struct device_dma_parameters {
576 unsigned long segment_boundary_mask; 585 unsigned long segment_boundary_mask;
577}; 586};
578 587
588struct acpi_dev_node {
589#ifdef CONFIG_ACPI
590 void *handle;
591#endif
592};
593
579/** 594/**
580 * struct device - The basic device structure 595 * struct device - The basic device structure
581 * @parent: The device's "parent" device, the device to which it is attached. 596 * @parent: The device's "parent" device, the device to which it is attached.
@@ -616,6 +631,7 @@ struct device_dma_parameters {
616 * @dma_mem: Internal for coherent mem override. 631 * @dma_mem: Internal for coherent mem override.
617 * @archdata: For arch-specific additions. 632 * @archdata: For arch-specific additions.
618 * @of_node: Associated device tree node. 633 * @of_node: Associated device tree node.
634 * @acpi_node: Associated ACPI device node.
619 * @devt: For creating the sysfs "dev". 635 * @devt: For creating the sysfs "dev".
620 * @id: device instance 636 * @id: device instance
621 * @devres_lock: Spinlock to protect the resource of the device. 637 * @devres_lock: Spinlock to protect the resource of the device.
@@ -680,6 +696,7 @@ struct device {
680 struct dev_archdata archdata; 696 struct dev_archdata archdata;
681 697
682 struct device_node *of_node; /* associated device tree node */ 698 struct device_node *of_node; /* associated device tree node */
699 struct acpi_dev_node acpi_node; /* associated ACPI device node */
683 700
684 dev_t devt; /* dev_t, creates the sysfs "dev" */ 701 dev_t devt; /* dev_t, creates the sysfs "dev" */
685 u32 id; /* device instance */ 702 u32 id; /* device instance */
@@ -700,6 +717,14 @@ static inline struct device *kobj_to_dev(struct kobject *kobj)
700 return container_of(kobj, struct device, kobj); 717 return container_of(kobj, struct device, kobj);
701} 718}
702 719
720#ifdef CONFIG_ACPI
721#define ACPI_HANDLE(dev) ((dev)->acpi_node.handle)
722#define ACPI_HANDLE_SET(dev, _handle_) (dev)->acpi_node.handle = (_handle_)
723#else
724#define ACPI_HANDLE(dev) (NULL)
725#define ACPI_HANDLE_SET(dev, _handle_) do { } while (0)
726#endif
727
703/* Get the wakeup routines, which depend on struct device */ 728/* Get the wakeup routines, which depend on struct device */
704#include <linux/pm_wakeup.h> 729#include <linux/pm_wakeup.h>
705 730
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h
index 5ce0e5fd712e..251a2090a554 100644
--- a/include/linux/devpts_fs.h
+++ b/include/linux/devpts_fs.h
@@ -20,28 +20,28 @@
20int devpts_new_index(struct inode *ptmx_inode); 20int devpts_new_index(struct inode *ptmx_inode);
21void devpts_kill_index(struct inode *ptmx_inode, int idx); 21void devpts_kill_index(struct inode *ptmx_inode, int idx);
22/* mknod in devpts */ 22/* mknod in devpts */
23int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty); 23struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
24/* get tty structure */ 24 void *priv);
25struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number); 25/* get private structure */
26void *devpts_get_priv(struct inode *pts_inode);
26/* unlink */ 27/* unlink */
27void devpts_pty_kill(struct tty_struct *tty); 28void devpts_pty_kill(struct inode *inode);
28 29
29#else 30#else
30 31
31/* Dummy stubs in the no-pty case */ 32/* Dummy stubs in the no-pty case */
32static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; } 33static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
33static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { } 34static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
34static inline int devpts_pty_new(struct inode *ptmx_inode, 35static inline struct inode *devpts_pty_new(struct inode *ptmx_inode,
35 struct tty_struct *tty) 36 dev_t device, int index, void *priv)
36{ 37{
37 return -EINVAL; 38 return ERR_PTR(-EINVAL);
38} 39}
39static inline struct tty_struct *devpts_get_tty(struct inode *pts_inode, 40static inline void *devpts_get_priv(struct inode *pts_inode)
40 int number)
41{ 41{
42 return NULL; 42 return NULL;
43} 43}
44static inline void devpts_pty_kill(struct tty_struct *tty) { } 44static inline void devpts_pty_kill(struct inode *inode) { }
45 45
46#endif 46#endif
47 47
diff --git a/include/linux/dlm.h b/include/linux/dlm.h
index 1d47dcce11e1..d02da2c6fc1a 100644
--- a/include/linux/dlm.h
+++ b/include/linux/dlm.h
@@ -98,7 +98,7 @@ int dlm_release_lockspace(dlm_lockspace_t *lockspace, int force);
98/* 98/*
99 * dlm_lock 99 * dlm_lock
100 * 100 *
101 * Make an asyncronous request to acquire or convert a lock on a named 101 * Make an asynchronous request to acquire or convert a lock on a named
102 * resource. 102 * resource.
103 * 103 *
104 * lockspace: context for the request 104 * lockspace: context for the request
diff --git a/include/linux/dma-contiguous.h b/include/linux/dma-contiguous.h
index 2f303e4b7ed3..01b5c84be828 100644
--- a/include/linux/dma-contiguous.h
+++ b/include/linux/dma-contiguous.h
@@ -68,7 +68,7 @@ struct device;
68extern struct cma *dma_contiguous_default_area; 68extern struct cma *dma_contiguous_default_area;
69 69
70void dma_contiguous_reserve(phys_addr_t addr_limit); 70void dma_contiguous_reserve(phys_addr_t addr_limit);
71int dma_declare_contiguous(struct device *dev, unsigned long size, 71int dma_declare_contiguous(struct device *dev, phys_addr_t size,
72 phys_addr_t base, phys_addr_t limit); 72 phys_addr_t base, phys_addr_t limit);
73 73
74struct page *dma_alloc_from_contiguous(struct device *dev, int count, 74struct page *dma_alloc_from_contiguous(struct device *dev, int count,
@@ -83,7 +83,7 @@ bool dma_release_from_contiguous(struct device *dev, struct page *pages,
83static inline void dma_contiguous_reserve(phys_addr_t limit) { } 83static inline void dma_contiguous_reserve(phys_addr_t limit) { }
84 84
85static inline 85static inline
86int dma_declare_contiguous(struct device *dev, unsigned long size, 86int dma_declare_contiguous(struct device *dev, phys_addr_t size,
87 phys_addr_t base, phys_addr_t limit) 87 phys_addr_t base, phys_addr_t limit)
88{ 88{
89 return -ENOSYS; 89 return -ENOSYS;
diff --git a/include/linux/dma/ipu-dma.h b/include/linux/dma/ipu-dma.h
new file mode 100644
index 000000000000..18031115c668
--- /dev/null
+++ b/include/linux/dma/ipu-dma.h
@@ -0,0 +1,177 @@
1/*
2 * Copyright (C) 2008
3 * Guennadi Liakhovetski, DENX Software Engineering, <lg@denx.de>
4 *
5 * Copyright (C) 2005-2007 Freescale Semiconductor, Inc.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __LINUX_DMA_IPU_DMA_H
13#define __LINUX_DMA_IPU_DMA_H
14
15#include <linux/types.h>
16#include <linux/dmaengine.h>
17
18/* IPU DMA Controller channel definitions. */
19enum ipu_channel {
20 IDMAC_IC_0 = 0, /* IC (encoding task) to memory */
21 IDMAC_IC_1 = 1, /* IC (viewfinder task) to memory */
22 IDMAC_ADC_0 = 1,
23 IDMAC_IC_2 = 2,
24 IDMAC_ADC_1 = 2,
25 IDMAC_IC_3 = 3,
26 IDMAC_IC_4 = 4,
27 IDMAC_IC_5 = 5,
28 IDMAC_IC_6 = 6,
29 IDMAC_IC_7 = 7, /* IC (sensor data) to memory */
30 IDMAC_IC_8 = 8,
31 IDMAC_IC_9 = 9,
32 IDMAC_IC_10 = 10,
33 IDMAC_IC_11 = 11,
34 IDMAC_IC_12 = 12,
35 IDMAC_IC_13 = 13,
36 IDMAC_SDC_0 = 14, /* Background synchronous display data */
37 IDMAC_SDC_1 = 15, /* Foreground data (overlay) */
38 IDMAC_SDC_2 = 16,
39 IDMAC_SDC_3 = 17,
40 IDMAC_ADC_2 = 18,
41 IDMAC_ADC_3 = 19,
42 IDMAC_ADC_4 = 20,
43 IDMAC_ADC_5 = 21,
44 IDMAC_ADC_6 = 22,
45 IDMAC_ADC_7 = 23,
46 IDMAC_PF_0 = 24,
47 IDMAC_PF_1 = 25,
48 IDMAC_PF_2 = 26,
49 IDMAC_PF_3 = 27,
50 IDMAC_PF_4 = 28,
51 IDMAC_PF_5 = 29,
52 IDMAC_PF_6 = 30,
53 IDMAC_PF_7 = 31,
54};
55
56/* Order significant! */
57enum ipu_channel_status {
58 IPU_CHANNEL_FREE,
59 IPU_CHANNEL_INITIALIZED,
60 IPU_CHANNEL_READY,
61 IPU_CHANNEL_ENABLED,
62};
63
64#define IPU_CHANNELS_NUM 32
65
66enum pixel_fmt {
67 /* 1 byte */
68 IPU_PIX_FMT_GENERIC,
69 IPU_PIX_FMT_RGB332,
70 IPU_PIX_FMT_YUV420P,
71 IPU_PIX_FMT_YUV422P,
72 IPU_PIX_FMT_YUV420P2,
73 IPU_PIX_FMT_YVU422P,
74 /* 2 bytes */
75 IPU_PIX_FMT_RGB565,
76 IPU_PIX_FMT_RGB666,
77 IPU_PIX_FMT_BGR666,
78 IPU_PIX_FMT_YUYV,
79 IPU_PIX_FMT_UYVY,
80 /* 3 bytes */
81 IPU_PIX_FMT_RGB24,
82 IPU_PIX_FMT_BGR24,
83 /* 4 bytes */
84 IPU_PIX_FMT_GENERIC_32,
85 IPU_PIX_FMT_RGB32,
86 IPU_PIX_FMT_BGR32,
87 IPU_PIX_FMT_ABGR32,
88 IPU_PIX_FMT_BGRA32,
89 IPU_PIX_FMT_RGBA32,
90};
91
92enum ipu_color_space {
93 IPU_COLORSPACE_RGB,
94 IPU_COLORSPACE_YCBCR,
95 IPU_COLORSPACE_YUV
96};
97
98/*
99 * Enumeration of IPU rotation modes
100 */
101enum ipu_rotate_mode {
102 /* Note the enum values correspond to BAM value */
103 IPU_ROTATE_NONE = 0,
104 IPU_ROTATE_VERT_FLIP = 1,
105 IPU_ROTATE_HORIZ_FLIP = 2,
106 IPU_ROTATE_180 = 3,
107 IPU_ROTATE_90_RIGHT = 4,
108 IPU_ROTATE_90_RIGHT_VFLIP = 5,
109 IPU_ROTATE_90_RIGHT_HFLIP = 6,
110 IPU_ROTATE_90_LEFT = 7,
111};
112
113/*
114 * Enumeration of DI ports for ADC.
115 */
116enum display_port {
117 DISP0,
118 DISP1,
119 DISP2,
120 DISP3
121};
122
123struct idmac_video_param {
124 unsigned short in_width;
125 unsigned short in_height;
126 uint32_t in_pixel_fmt;
127 unsigned short out_width;
128 unsigned short out_height;
129 uint32_t out_pixel_fmt;
130 unsigned short out_stride;
131 bool graphics_combine_en;
132 bool global_alpha_en;
133 bool key_color_en;
134 enum display_port disp;
135 unsigned short out_left;
136 unsigned short out_top;
137};
138
139/*
140 * Union of initialization parameters for a logical channel. So far only video
141 * parameters are used.
142 */
143union ipu_channel_param {
144 struct idmac_video_param video;
145};
146
147struct idmac_tx_desc {
148 struct dma_async_tx_descriptor txd;
149 struct scatterlist *sg; /* scatterlist for this */
150 unsigned int sg_len; /* tx-descriptor. */
151 struct list_head list;
152};
153
154struct idmac_channel {
155 struct dma_chan dma_chan;
156 dma_cookie_t completed; /* last completed cookie */
157 union ipu_channel_param params;
158 enum ipu_channel link; /* input channel, linked to the output */
159 enum ipu_channel_status status;
160 void *client; /* Only one client per channel */
161 unsigned int n_tx_desc;
162 struct idmac_tx_desc *desc; /* allocated tx-descriptors */
163 struct scatterlist *sg[2]; /* scatterlist elements in buffer-0 and -1 */
164 struct list_head free_list; /* free tx-descriptors */
165 struct list_head queue; /* queued tx-descriptors */
166 spinlock_t lock; /* protects sg[0,1], queue */
167 struct mutex chan_mutex; /* protects status, cookie, free_list */
168 bool sec_chan_en;
169 int active_buffer;
170 unsigned int eof_irq;
171 char eof_name[16]; /* EOF IRQ name for request_irq() */
172};
173
174#define to_tx_desc(tx) container_of(tx, struct idmac_tx_desc, txd)
175#define to_idmac_chan(c) container_of(c, struct idmac_channel, dma_chan)
176
177#endif /* __LINUX_DMA_IPU_DMA_H */
diff --git a/include/linux/dvb/Kbuild b/include/linux/dvb/Kbuild
deleted file mode 100644
index e69de29bb2d1..000000000000
--- a/include/linux/dvb/Kbuild
+++ /dev/null
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h
deleted file mode 100644
index 0be6d8f2b52b..000000000000
--- a/include/linux/dvb/dmx.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * dmx.h
3 *
4 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
5 * & Ralph Metzler <ralph@convergence.de>
6 * for convergence integrated media GmbH
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23#ifndef _DVBDMX_H_
24#define _DVBDMX_H_
25
26#include <linux/time.h>
27#include <uapi/linux/dvb/dmx.h>
28
29#endif /*_DVBDMX_H_*/
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h
deleted file mode 100644
index 85c20d925696..000000000000
--- a/include/linux/dvb/video.h
+++ /dev/null
@@ -1,29 +0,0 @@
1/*
2 * video.h
3 *
4 * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de>
5 * & Ralph Metzler <ralph@convergence.de>
6 * for convergence integrated media GmbH
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 *
22 */
23#ifndef _DVBVIDEO_H_
24#define _DVBVIDEO_H_
25
26#include <linux/compiler.h>
27#include <uapi/linux/dvb/video.h>
28
29#endif /*_DVBVIDEO_H_*/
diff --git a/include/linux/earlycpio.h b/include/linux/earlycpio.h
new file mode 100644
index 000000000000..111f46d83d00
--- /dev/null
+++ b/include/linux/earlycpio.h
@@ -0,0 +1,17 @@
1#ifndef _LINUX_EARLYCPIO_H
2#define _LINUX_EARLYCPIO_H
3
4#include <linux/types.h>
5
6#define MAX_CPIO_FILE_NAME 18
7
8struct cpio_data {
9 void *data;
10 size_t size;
11 char name[MAX_CPIO_FILE_NAME];
12};
13
14struct cpio_data find_cpio_data(const char *path, void *data, size_t len,
15 long *offset);
16
17#endif /* _LINUX_EARLYCPIO_H */
diff --git a/include/linux/edac.h b/include/linux/edac.h
index bab9f8473dc1..1b8c02b36f76 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -533,6 +533,7 @@ struct csrow_info {
533 533
534 u32 ue_count; /* Uncorrectable Errors for this csrow */ 534 u32 ue_count; /* Uncorrectable Errors for this csrow */
535 u32 ce_count; /* Correctable Errors for this csrow */ 535 u32 ce_count; /* Correctable Errors for this csrow */
536 u32 nr_pages; /* combined pages count of all channels */
536 537
537 struct mem_ctl_info *mci; /* the parent */ 538 struct mem_ctl_info *mci; /* the parent */
538 539
@@ -667,6 +668,8 @@ struct mem_ctl_info {
667 u32 fake_inject_ue; 668 u32 fake_inject_ue;
668 u16 fake_inject_count; 669 u16 fake_inject_count;
669#endif 670#endif
671 __u8 csbased : 1, /* csrow-based memory controller */
672 __resv : 7;
670}; 673};
671 674
672#endif 675#endif
diff --git a/include/linux/efi.h b/include/linux/efi.h
index 8670eb1eb8cd..8b84916dc671 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -29,7 +29,12 @@
29#define EFI_UNSUPPORTED ( 3 | (1UL << (BITS_PER_LONG-1))) 29#define EFI_UNSUPPORTED ( 3 | (1UL << (BITS_PER_LONG-1)))
30#define EFI_BAD_BUFFER_SIZE ( 4 | (1UL << (BITS_PER_LONG-1))) 30#define EFI_BAD_BUFFER_SIZE ( 4 | (1UL << (BITS_PER_LONG-1)))
31#define EFI_BUFFER_TOO_SMALL ( 5 | (1UL << (BITS_PER_LONG-1))) 31#define EFI_BUFFER_TOO_SMALL ( 5 | (1UL << (BITS_PER_LONG-1)))
32#define EFI_NOT_READY ( 6 | (1UL << (BITS_PER_LONG-1)))
33#define EFI_DEVICE_ERROR ( 7 | (1UL << (BITS_PER_LONG-1)))
34#define EFI_WRITE_PROTECTED ( 8 | (1UL << (BITS_PER_LONG-1)))
35#define EFI_OUT_OF_RESOURCES ( 9 | (1UL << (BITS_PER_LONG-1)))
32#define EFI_NOT_FOUND (14 | (1UL << (BITS_PER_LONG-1))) 36#define EFI_NOT_FOUND (14 | (1UL << (BITS_PER_LONG-1)))
37#define EFI_SECURITY_VIOLATION (26 | (1UL << (BITS_PER_LONG-1)))
33 38
34typedef unsigned long efi_status_t; 39typedef unsigned long efi_status_t;
35typedef u8 efi_bool_t; 40typedef u8 efi_bool_t;
@@ -196,6 +201,77 @@ typedef struct {
196 void *create_event_ex; 201 void *create_event_ex;
197} efi_boot_services_t; 202} efi_boot_services_t;
198 203
204typedef enum {
205 EfiPciIoWidthUint8,
206 EfiPciIoWidthUint16,
207 EfiPciIoWidthUint32,
208 EfiPciIoWidthUint64,
209 EfiPciIoWidthFifoUint8,
210 EfiPciIoWidthFifoUint16,
211 EfiPciIoWidthFifoUint32,
212 EfiPciIoWidthFifoUint64,
213 EfiPciIoWidthFillUint8,
214 EfiPciIoWidthFillUint16,
215 EfiPciIoWidthFillUint32,
216 EfiPciIoWidthFillUint64,
217 EfiPciIoWidthMaximum
218} EFI_PCI_IO_PROTOCOL_WIDTH;
219
220typedef enum {
221 EfiPciIoAttributeOperationGet,
222 EfiPciIoAttributeOperationSet,
223 EfiPciIoAttributeOperationEnable,
224 EfiPciIoAttributeOperationDisable,
225 EfiPciIoAttributeOperationSupported,
226 EfiPciIoAttributeOperationMaximum
227} EFI_PCI_IO_PROTOCOL_ATTRIBUTE_OPERATION;
228
229
230typedef struct {
231 void *read;
232 void *write;
233} efi_pci_io_protocol_access_t;
234
235typedef struct {
236 void *poll_mem;
237 void *poll_io;
238 efi_pci_io_protocol_access_t mem;
239 efi_pci_io_protocol_access_t io;
240 efi_pci_io_protocol_access_t pci;
241 void *copy_mem;
242 void *map;
243 void *unmap;
244 void *allocate_buffer;
245 void *free_buffer;
246 void *flush;
247 void *get_location;
248 void *attributes;
249 void *get_bar_attributes;
250 void *set_bar_attributes;
251 uint64_t romsize;
252 void *romimage;
253} efi_pci_io_protocol;
254
255#define EFI_PCI_IO_ATTRIBUTE_ISA_MOTHERBOARD_IO 0x0001
256#define EFI_PCI_IO_ATTRIBUTE_ISA_IO 0x0002
257#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO 0x0004
258#define EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY 0x0008
259#define EFI_PCI_IO_ATTRIBUTE_VGA_IO 0x0010
260#define EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO 0x0020
261#define EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO 0x0040
262#define EFI_PCI_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x0080
263#define EFI_PCI_IO_ATTRIBUTE_IO 0x0100
264#define EFI_PCI_IO_ATTRIBUTE_MEMORY 0x0200
265#define EFI_PCI_IO_ATTRIBUTE_BUS_MASTER 0x0400
266#define EFI_PCI_IO_ATTRIBUTE_MEMORY_CACHED 0x0800
267#define EFI_PCI_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000
268#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE 0x2000
269#define EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM 0x4000
270#define EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE 0x8000
271#define EFI_PCI_IO_ATTRIBUTE_ISA_IO_16 0x10000
272#define EFI_PCI_IO_ATTRIBUTE_VGA_PALETTE_IO_16 0x20000
273#define EFI_PCI_IO_ATTRIBUTE_VGA_IO_16 0x40000
274
199/* 275/*
200 * Types and defines for EFI ResetSystem 276 * Types and defines for EFI ResetSystem
201 */ 277 */
@@ -643,6 +719,7 @@ struct efivar_operations {
643 efi_get_variable_t *get_variable; 719 efi_get_variable_t *get_variable;
644 efi_get_next_variable_t *get_next_variable; 720 efi_get_next_variable_t *get_next_variable;
645 efi_set_variable_t *set_variable; 721 efi_set_variable_t *set_variable;
722 efi_query_variable_info_t *query_variable_info;
646}; 723};
647 724
648struct efivars { 725struct efivars {
@@ -657,6 +734,7 @@ struct efivars {
657 spinlock_t lock; 734 spinlock_t lock;
658 struct list_head list; 735 struct list_head list;
659 struct kset *kset; 736 struct kset *kset;
737 struct kobject *kobject;
660 struct bin_attribute *new_var, *del_var; 738 struct bin_attribute *new_var, *del_var;
661 const struct efivar_operations *ops; 739 const struct efivar_operations *ops;
662 struct efivar_entry *walk_entry; 740 struct efivar_entry *walk_entry;
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index b006ba0a9f42..243eea1e33d8 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -51,6 +51,26 @@ extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
51#define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) 51#define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1)
52#define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) 52#define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count)
53 53
54/* Reserved Ethernet Addresses per IEEE 802.1Q */
55static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) =
56{ 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 };
57
58/**
59 * is_link_local_ether_addr - Determine if given Ethernet address is link-local
60 * @addr: Pointer to a six-byte array containing the Ethernet address
61 *
62 * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per
63 * IEEE 802.1Q 8.6.3 Frame filtering.
64 */
65static inline bool is_link_local_ether_addr(const u8 *addr)
66{
67 __be16 *a = (__be16 *)addr;
68 static const __be16 *b = (const __be16 *)eth_reserved_addr_base;
69 static const __be16 m = cpu_to_be16(0xfff0);
70
71 return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0;
72}
73
54/** 74/**
55 * is_zero_ether_addr - Determine if give Ethernet address is all zeros. 75 * is_zero_ether_addr - Determine if give Ethernet address is all zeros.
56 * @addr: Pointer to a six-byte array containing the Ethernet address 76 * @addr: Pointer to a six-byte array containing the Ethernet address
diff --git a/include/linux/extcon.h b/include/linux/extcon.h
index 2c26c14cd710..fcb51c88319f 100644
--- a/include/linux/extcon.h
+++ b/include/linux/extcon.h
@@ -23,7 +23,9 @@
23#ifndef __LINUX_EXTCON_H__ 23#ifndef __LINUX_EXTCON_H__
24#define __LINUX_EXTCON_H__ 24#define __LINUX_EXTCON_H__
25 25
26#include <linux/device.h>
26#include <linux/notifier.h> 27#include <linux/notifier.h>
28#include <linux/sysfs.h>
27 29
28#define SUPPORTED_CABLE_MAX 32 30#define SUPPORTED_CABLE_MAX 32
29#define CABLE_NAME_MAX 30 31#define CABLE_NAME_MAX 30
@@ -74,12 +76,12 @@ struct extcon_cable;
74 76
75/** 77/**
76 * struct extcon_dev - An extcon device represents one external connector. 78 * struct extcon_dev - An extcon device represents one external connector.
77 * @name The name of this extcon device. Parent device name is used 79 * @name: The name of this extcon device. Parent device name is used
78 * if NULL. 80 * if NULL.
79 * @supported_cable Array of supported cable names ending with NULL. 81 * @supported_cable: Array of supported cable names ending with NULL.
80 * If supported_cable is NULL, cable name related APIs 82 * If supported_cable is NULL, cable name related APIs
81 * are disabled. 83 * are disabled.
82 * @mutually_exclusive Array of mutually exclusive set of cables that cannot 84 * @mutually_exclusive: Array of mutually exclusive set of cables that cannot
83 * be attached simultaneously. The array should be 85 * be attached simultaneously. The array should be
84 * ending with NULL or be NULL (no mutually exclusive 86 * ending with NULL or be NULL (no mutually exclusive
85 * cables). For example, if it is { 0x7, 0x30, 0}, then, 87 * cables). For example, if it is { 0x7, 0x30, 0}, then,
@@ -87,21 +89,21 @@ struct extcon_cable;
87 * be attached simulataneously. {0x7, 0} is equivalent to 89 * be attached simulataneously. {0x7, 0} is equivalent to
88 * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there 90 * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there
89 * can be no simultaneous connections. 91 * can be no simultaneous connections.
90 * @print_name An optional callback to override the method to print the 92 * @print_name: An optional callback to override the method to print the
91 * name of the extcon device. 93 * name of the extcon device.
92 * @print_state An optional callback to override the method to print the 94 * @print_state: An optional callback to override the method to print the
93 * status of the extcon device. 95 * status of the extcon device.
94 * @dev Device of this extcon. Do not provide at register-time. 96 * @dev: Device of this extcon. Do not provide at register-time.
95 * @state Attach/detach state of this extcon. Do not provide at 97 * @state: Attach/detach state of this extcon. Do not provide at
96 * register-time 98 * register-time
97 * @nh Notifier for the state change events from this extcon 99 * @nh: Notifier for the state change events from this extcon
98 * @entry To support list of extcon devices so that users can search 100 * @entry: To support list of extcon devices so that users can search
99 * for extcon devices based on the extcon name. 101 * for extcon devices based on the extcon name.
100 * @lock 102 * @lock:
101 * @max_supported Internal value to store the number of cables. 103 * @max_supported: Internal value to store the number of cables.
102 * @extcon_dev_type Device_type struct to provide attribute_groups 104 * @extcon_dev_type: Device_type struct to provide attribute_groups
103 * customized for each extcon device. 105 * customized for each extcon device.
104 * @cables Sysfs subdirectories. Each represents one cable. 106 * @cables: Sysfs subdirectories. Each represents one cable.
105 * 107 *
106 * In most cases, users only need to provide "User initializing data" of 108 * In most cases, users only need to provide "User initializing data" of
107 * this struct when registering an extcon. In some exceptional cases, 109 * this struct when registering an extcon. In some exceptional cases,
@@ -137,12 +139,12 @@ struct extcon_dev {
137 139
138/** 140/**
139 * struct extcon_cable - An internal data for each cable of extcon device. 141 * struct extcon_cable - An internal data for each cable of extcon device.
140 * @edev The extcon device 142 * @edev: The extcon device
141 * @cable_index Index of this cable in the edev 143 * @cable_index: Index of this cable in the edev
142 * @attr_g Attribute group for the cable 144 * @attr_g: Attribute group for the cable
143 * @attr_name "name" sysfs entry 145 * @attr_name: "name" sysfs entry
144 * @attr_state "state" sysfs entry 146 * @attr_state: "state" sysfs entry
145 * @attrs Array pointing to attr_name and attr_state for attr_g 147 * @attrs: Array pointing to attr_name and attr_state for attr_g
146 */ 148 */
147struct extcon_cable { 149struct extcon_cable {
148 struct extcon_dev *edev; 150 struct extcon_dev *edev;
@@ -158,11 +160,11 @@ struct extcon_cable {
158/** 160/**
159 * struct extcon_specific_cable_nb - An internal data for 161 * struct extcon_specific_cable_nb - An internal data for
160 * extcon_register_interest(). 162 * extcon_register_interest().
161 * @internal_nb a notifier block bridging extcon notifier and cable notifier. 163 * @internal_nb: a notifier block bridging extcon notifier and cable notifier.
162 * @user_nb user provided notifier block for events from a specific cable. 164 * @user_nb: user provided notifier block for events from a specific cable.
163 * @cable_index the target cable. 165 * @cable_index: the target cable.
164 * @edev the target extcon device. 166 * @edev: the target extcon device.
165 * @previous_value the saved previous event value. 167 * @previous_value: the saved previous event value.
166 */ 168 */
167struct extcon_specific_cable_nb { 169struct extcon_specific_cable_nb {
168 struct notifier_block internal_nb; 170 struct notifier_block internal_nb;
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 45052aa814c8..fb7dacae0522 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -95,7 +95,6 @@ struct task_struct;
95struct files_struct *get_files_struct(struct task_struct *); 95struct files_struct *get_files_struct(struct task_struct *);
96void put_files_struct(struct files_struct *fs); 96void put_files_struct(struct files_struct *fs);
97void reset_files_struct(struct files_struct *); 97void reset_files_struct(struct files_struct *);
98void daemonize_descriptors(void);
99int unshare_files(struct files_struct **); 98int unshare_files(struct files_struct **);
100struct files_struct *dup_fd(struct files_struct *, int *); 99struct files_struct *dup_fd(struct files_struct *, int *);
101void do_close_on_exec(struct files_struct *); 100void do_close_on_exec(struct files_struct *);
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 24d251f3bab0..c45eabc135e1 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -45,6 +45,7 @@ extern void sk_unattached_filter_destroy(struct sk_filter *fp);
45extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 45extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
46extern int sk_detach_filter(struct sock *sk); 46extern int sk_detach_filter(struct sock *sk);
47extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen); 47extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
48extern int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, unsigned len);
48 49
49#ifdef CONFIG_BPF_JIT 50#ifdef CONFIG_BPF_JIT
50extern void bpf_jit_compile(struct sk_filter *fp); 51extern void bpf_jit_compile(struct sk_filter *fp);
@@ -123,6 +124,8 @@ enum {
123 BPF_S_ANC_CPU, 124 BPF_S_ANC_CPU,
124 BPF_S_ANC_ALU_XOR_X, 125 BPF_S_ANC_ALU_XOR_X,
125 BPF_S_ANC_SECCOMP_LD_W, 126 BPF_S_ANC_SECCOMP_LD_W,
127 BPF_S_ANC_VLAN_TAG,
128 BPF_S_ANC_VLAN_TAG_PRESENT,
126}; 129};
127 130
128#endif /* __LINUX_FILTER_H__ */ 131#endif /* __LINUX_FILTER_H__ */
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index d09af4b67cf1..e4238ceaa4d6 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -75,35 +75,68 @@ static inline bool cgroup_freezing(struct task_struct *task)
75 */ 75 */
76 76
77 77
78/* Tell the freezer not to count the current task as freezable. */ 78/**
79 * freezer_do_not_count - tell freezer to ignore %current
80 *
81 * Tell freezers to ignore the current task when determining whether the
82 * target frozen state is reached. IOW, the current task will be
83 * considered frozen enough by freezers.
84 *
85 * The caller shouldn't do anything which isn't allowed for a frozen task
86 * until freezer_cont() is called. Usually, freezer[_do_not]_count() pair
87 * wrap a scheduling operation and nothing much else.
88 */
79static inline void freezer_do_not_count(void) 89static inline void freezer_do_not_count(void)
80{ 90{
81 current->flags |= PF_FREEZER_SKIP; 91 current->flags |= PF_FREEZER_SKIP;
82} 92}
83 93
84/* 94/**
85 * Tell the freezer to count the current task as freezable again and try to 95 * freezer_count - tell freezer to stop ignoring %current
86 * freeze it. 96 *
97 * Undo freezer_do_not_count(). It tells freezers that %current should be
98 * considered again and tries to freeze if freezing condition is already in
99 * effect.
87 */ 100 */
88static inline void freezer_count(void) 101static inline void freezer_count(void)
89{ 102{
90 current->flags &= ~PF_FREEZER_SKIP; 103 current->flags &= ~PF_FREEZER_SKIP;
104 /*
105 * If freezing is in progress, the following paired with smp_mb()
106 * in freezer_should_skip() ensures that either we see %true
107 * freezing() or freezer_should_skip() sees !PF_FREEZER_SKIP.
108 */
109 smp_mb();
91 try_to_freeze(); 110 try_to_freeze();
92} 111}
93 112
94/* 113/**
95 * Check if the task should be counted as freezable by the freezer 114 * freezer_should_skip - whether to skip a task when determining frozen
115 * state is reached
116 * @p: task in quesion
117 *
118 * This function is used by freezers after establishing %true freezing() to
119 * test whether a task should be skipped when determining the target frozen
120 * state is reached. IOW, if this function returns %true, @p is considered
121 * frozen enough.
96 */ 122 */
97static inline int freezer_should_skip(struct task_struct *p) 123static inline bool freezer_should_skip(struct task_struct *p)
98{ 124{
99 return !!(p->flags & PF_FREEZER_SKIP); 125 /*
126 * The following smp_mb() paired with the one in freezer_count()
127 * ensures that either freezer_count() sees %true freezing() or we
128 * see cleared %PF_FREEZER_SKIP and return %false. This makes it
129 * impossible for a task to slip frozen state testing after
130 * clearing %PF_FREEZER_SKIP.
131 */
132 smp_mb();
133 return p->flags & PF_FREEZER_SKIP;
100} 134}
101 135
102/* 136/*
103 * These macros are intended to be used whenever you want allow a task that's 137 * These macros are intended to be used whenever you want allow a sleeping
104 * sleeping in TASK_UNINTERRUPTIBLE or TASK_KILLABLE state to be frozen. Note 138 * task to be frozen. Note that neither return any clear indication of
105 * that neither return any clear indication of whether a freeze event happened 139 * whether a freeze event happened while in this function.
106 * while in this function.
107 */ 140 */
108 141
109/* Like schedule(), but should not block the freezer. */ 142/* Like schedule(), but should not block the freezer. */
@@ -177,6 +210,7 @@ static inline int freeze_kernel_threads(void) { return -ENOSYS; }
177static inline void thaw_processes(void) {} 210static inline void thaw_processes(void) {}
178static inline void thaw_kernel_threads(void) {} 211static inline void thaw_kernel_threads(void) {}
179 212
213static inline bool try_to_freeze_nowarn(void) { return false; }
180static inline bool try_to_freeze(void) { return false; } 214static inline bool try_to_freeze(void) { return false; }
181 215
182static inline void freezer_do_not_count(void) {} 216static inline void freezer_do_not_count(void) {}
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b33cfc97b9ca..408fb1e77a0a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -418,7 +418,7 @@ struct address_space {
418 struct backing_dev_info *backing_dev_info; /* device readahead, etc */ 418 struct backing_dev_info *backing_dev_info; /* device readahead, etc */
419 spinlock_t private_lock; /* for use by the address_space */ 419 spinlock_t private_lock; /* for use by the address_space */
420 struct list_head private_list; /* ditto */ 420 struct list_head private_list; /* ditto */
421 struct address_space *assoc_mapping; /* ditto */ 421 void *private_data; /* ditto */
422} __attribute__((aligned(sizeof(long)))); 422} __attribute__((aligned(sizeof(long))));
423 /* 423 /*
424 * On most architectures that alignment is already the case; but 424 * On most architectures that alignment is already the case; but
@@ -462,8 +462,6 @@ struct block_device {
462 int bd_fsfreeze_count; 462 int bd_fsfreeze_count;
463 /* Mutex for freeze */ 463 /* Mutex for freeze */
464 struct mutex bd_fsfreeze_mutex; 464 struct mutex bd_fsfreeze_mutex;
465 /* A semaphore that prevents I/O while block size is being changed */
466 struct percpu_rw_semaphore bd_block_size_semaphore;
467}; 465};
468 466
469/* 467/*
@@ -2049,7 +2047,6 @@ extern void unregister_blkdev(unsigned int, const char *);
2049extern struct block_device *bdget(dev_t); 2047extern struct block_device *bdget(dev_t);
2050extern struct block_device *bdgrab(struct block_device *bdev); 2048extern struct block_device *bdgrab(struct block_device *bdev);
2051extern void bd_set_size(struct block_device *, loff_t size); 2049extern void bd_set_size(struct block_device *, loff_t size);
2052extern sector_t blkdev_max_block(struct block_device *bdev);
2053extern void bd_forget(struct inode *inode); 2050extern void bd_forget(struct inode *inode);
2054extern void bdput(struct block_device *); 2051extern void bdput(struct block_device *);
2055extern void invalidate_bdev(struct block_device *); 2052extern void invalidate_bdev(struct block_device *);
@@ -2379,8 +2376,6 @@ extern int generic_segment_checks(const struct iovec *iov,
2379 unsigned long *nr_segs, size_t *count, int access_flags); 2376 unsigned long *nr_segs, size_t *count, int access_flags);
2380 2377
2381/* fs/block_dev.c */ 2378/* fs/block_dev.c */
2382extern ssize_t blkdev_aio_read(struct kiocb *iocb, const struct iovec *iov,
2383 unsigned long nr_segs, loff_t pos);
2384extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, 2379extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
2385 unsigned long nr_segs, loff_t pos); 2380 unsigned long nr_segs, loff_t pos);
2386extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, 2381extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
diff --git a/include/linux/fs_struct.h b/include/linux/fs_struct.h
index 003dc0fd7347..d0ae3a84bcfb 100644
--- a/include/linux/fs_struct.h
+++ b/include/linux/fs_struct.h
@@ -21,7 +21,6 @@ extern void set_fs_root(struct fs_struct *, struct path *);
21extern void set_fs_pwd(struct fs_struct *, struct path *); 21extern void set_fs_pwd(struct fs_struct *, struct path *);
22extern struct fs_struct *copy_fs_struct(struct fs_struct *); 22extern struct fs_struct *copy_fs_struct(struct fs_struct *);
23extern void free_fs_struct(struct fs_struct *); 23extern void free_fs_struct(struct fs_struct *);
24extern void daemonize_fs_struct(void);
25extern int unshare_fs_struct(void); 24extern int unshare_fs_struct(void);
26 25
27static inline void get_fs_root(struct fs_struct *fs, struct path *root) 26static inline void get_fs_root(struct fs_struct *fs, struct path *root)
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
index 11c16a1fb9e3..a1e8277120c7 100644
--- a/include/linux/fsl-diu-fb.h
+++ b/include/linux/fsl-diu-fb.h
@@ -47,6 +47,15 @@ struct aoi_display_offset {
47#define MFB_GET_PIXFMT _IOR('M', 8, __u32) 47#define MFB_GET_PIXFMT _IOR('M', 8, __u32)
48 48
49/* 49/*
50 * The MPC5121 BSP comes with a gamma_set utility that initializes the
51 * gamma table. Unfortunately, it uses bad values for the IOCTL commands,
52 * but there's nothing we can do about it now. These ioctls are only
53 * supported on the MPC5121.
54 */
55#define MFB_SET_GAMMA _IOW('M', 1, __u8)
56#define MFB_GET_GAMMA _IOR('M', 1, __u8)
57
58/*
50 * The original definitions of MFB_SET_PIXFMT and MFB_GET_PIXFMT used the 59 * The original definitions of MFB_SET_PIXFMT and MFB_GET_PIXFMT used the
51 * wrong value for 'size' field of the ioctl. The current macros above use the 60 * wrong value for 'size' field of the ioctl. The current macros above use the
52 * right size, but we still need to provide backwards compatibility, at least 61 * right size, but we still need to provide backwards compatibility, at least
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 642928cf57b4..a3d489531d83 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -86,6 +86,12 @@ struct trace_iterator {
86 cpumask_var_t started; 86 cpumask_var_t started;
87}; 87};
88 88
89enum trace_iter_flags {
90 TRACE_FILE_LAT_FMT = 1,
91 TRACE_FILE_ANNOTATE = 2,
92 TRACE_FILE_TIME_IN_NS = 4,
93};
94
89 95
90struct trace_event; 96struct trace_event;
91 97
@@ -127,13 +133,13 @@ trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer,
127void trace_current_buffer_unlock_commit(struct ring_buffer *buffer, 133void trace_current_buffer_unlock_commit(struct ring_buffer *buffer,
128 struct ring_buffer_event *event, 134 struct ring_buffer_event *event,
129 unsigned long flags, int pc); 135 unsigned long flags, int pc);
130void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer, 136void trace_buffer_unlock_commit(struct ring_buffer *buffer,
131 struct ring_buffer_event *event, 137 struct ring_buffer_event *event,
132 unsigned long flags, int pc); 138 unsigned long flags, int pc);
133void trace_nowake_buffer_unlock_commit_regs(struct ring_buffer *buffer, 139void trace_buffer_unlock_commit_regs(struct ring_buffer *buffer,
134 struct ring_buffer_event *event, 140 struct ring_buffer_event *event,
135 unsigned long flags, int pc, 141 unsigned long flags, int pc,
136 struct pt_regs *regs); 142 struct pt_regs *regs);
137void trace_current_buffer_discard_commit(struct ring_buffer *buffer, 143void trace_current_buffer_discard_commit(struct ring_buffer *buffer,
138 struct ring_buffer_event *event); 144 struct ring_buffer_event *event);
139 145
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 02c1c9710be0..f74856e17e48 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -31,8 +31,10 @@ struct vm_area_struct;
31#define ___GFP_THISNODE 0x40000u 31#define ___GFP_THISNODE 0x40000u
32#define ___GFP_RECLAIMABLE 0x80000u 32#define ___GFP_RECLAIMABLE 0x80000u
33#define ___GFP_NOTRACK 0x200000u 33#define ___GFP_NOTRACK 0x200000u
34#define ___GFP_NO_KSWAPD 0x400000u
34#define ___GFP_OTHER_NODE 0x800000u 35#define ___GFP_OTHER_NODE 0x800000u
35#define ___GFP_WRITE 0x1000000u 36#define ___GFP_WRITE 0x1000000u
37/* If the above are modified, __GFP_BITS_SHIFT may need updating */
36 38
37/* 39/*
38 * GFP bitmasks.. 40 * GFP bitmasks..
@@ -85,6 +87,7 @@ struct vm_area_struct;
85#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ 87#define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */
86#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ 88#define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */
87 89
90#define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD)
88#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */ 91#define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */
89#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */ 92#define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */
90 93
@@ -114,7 +117,8 @@ struct vm_area_struct;
114 __GFP_MOVABLE) 117 __GFP_MOVABLE)
115#define GFP_IOFS (__GFP_IO | __GFP_FS) 118#define GFP_IOFS (__GFP_IO | __GFP_FS)
116#define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ 119#define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \
117 __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN) 120 __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \
121 __GFP_NO_KSWAPD)
118 122
119#ifdef CONFIG_NUMA 123#ifdef CONFIG_NUMA
120#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) 124#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
@@ -263,7 +267,7 @@ static inline enum zone_type gfp_zone(gfp_t flags)
263 267
264static inline int gfp_zonelist(gfp_t flags) 268static inline int gfp_zonelist(gfp_t flags)
265{ 269{
266 if (NUMA_BUILD && unlikely(flags & __GFP_THISNODE)) 270 if (IS_ENABLED(CONFIG_NUMA) && unlikely(flags & __GFP_THISNODE))
267 return 1; 271 return 1;
268 272
269 return 0; 273 return 0;
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 2e31e8b3a190..bfe665621536 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -72,9 +72,9 @@ static inline int irq_to_gpio(unsigned int irq)
72 return -EINVAL; 72 return -EINVAL;
73} 73}
74 74
75#endif 75#endif /* ! CONFIG_ARCH_HAVE_CUSTOM_GPIO_H */
76 76
77#else 77#else /* ! CONFIG_GENERIC_GPIO */
78 78
79#include <linux/kernel.h> 79#include <linux/kernel.h>
80#include <linux/types.h> 80#include <linux/types.h>
@@ -231,6 +231,21 @@ static inline int irq_to_gpio(unsigned irq)
231 return -EINVAL; 231 return -EINVAL;
232} 232}
233 233
234#endif 234static inline int
235gpiochip_add_pin_range(struct gpio_chip *chip, const char *pinctl_name,
236 unsigned int gpio_offset, unsigned int pin_offset,
237 unsigned int npins)
238{
239 WARN_ON(1);
240 return -EINVAL;
241}
242
243static inline void
244gpiochip_remove_pin_ranges(struct gpio_chip *chip)
245{
246 WARN_ON(1);
247}
248
249#endif /* ! CONFIG_GENERIC_GPIO */
235 250
236#endif /* __LINUX_GPIO_H */ 251#endif /* __LINUX_GPIO_H */
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index cab3da3d0949..624ef3f45c8e 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -4,6 +4,7 @@
4#include <linux/preempt.h> 4#include <linux/preempt.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 <asm/hardirq.h> 8#include <asm/hardirq.h>
8 9
9/* 10/*
@@ -129,16 +130,6 @@ extern void synchronize_irq(unsigned int irq);
129# define synchronize_irq(irq) barrier() 130# define synchronize_irq(irq) barrier()
130#endif 131#endif
131 132
132struct task_struct;
133
134#if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING)
135static inline void vtime_account(struct task_struct *tsk)
136{
137}
138#else
139extern void vtime_account(struct task_struct *tsk);
140#endif
141
142#if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) 133#if defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU)
143 134
144static inline void rcu_nmi_enter(void) 135static inline void rcu_nmi_enter(void)
@@ -162,7 +153,7 @@ extern void rcu_nmi_exit(void);
162 */ 153 */
163#define __irq_enter() \ 154#define __irq_enter() \
164 do { \ 155 do { \
165 vtime_account(current); \ 156 vtime_account_irq_enter(current); \
166 add_preempt_count(HARDIRQ_OFFSET); \ 157 add_preempt_count(HARDIRQ_OFFSET); \
167 trace_hardirq_enter(); \ 158 trace_hardirq_enter(); \
168 } while (0) 159 } while (0)
@@ -178,7 +169,7 @@ extern void irq_enter(void);
178#define __irq_exit() \ 169#define __irq_exit() \
179 do { \ 170 do { \
180 trace_hardirq_exit(); \ 171 trace_hardirq_exit(); \
181 vtime_account(current); \ 172 vtime_account_irq_exit(current); \
182 sub_preempt_count(HARDIRQ_OFFSET); \ 173 sub_preempt_count(HARDIRQ_OFFSET); \
183 } while (0) 174 } while (0)
184 175
diff --git a/include/linux/hash.h b/include/linux/hash.h
index 24df9e70406f..61c97ae22e01 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -1,7 +1,7 @@
1#ifndef _LINUX_HASH_H 1#ifndef _LINUX_HASH_H
2#define _LINUX_HASH_H 2#define _LINUX_HASH_H
3/* Fast hashing routine for ints, longs and pointers. 3/* Fast hashing routine for ints, longs and pointers.
4 (C) 2002 William Lee Irwin III, IBM */ 4 (C) 2002 Nadia Yvette Chambers, IBM */
5 5
6/* 6/*
7 * Knuth recommends primes in approximately golden ratio to the maximum 7 * Knuth recommends primes in approximately golden ratio to the maximum
diff --git a/include/linux/hdlc/Kbuild b/include/linux/hdlc/Kbuild
index 1fb26448faa9..e69de29bb2d1 100644
--- a/include/linux/hdlc/Kbuild
+++ b/include/linux/hdlc/Kbuild
@@ -1 +0,0 @@
1header-y += ioctl.h
diff --git a/include/linux/hid-sensor-ids.h b/include/linux/hid-sensor-ids.h
index ca8d7e94eb3c..55f277372fed 100644
--- a/include/linux/hid-sensor-ids.h
+++ b/include/linux/hid-sensor-ids.h
@@ -19,7 +19,6 @@
19#ifndef _HID_SENSORS_IDS_H 19#ifndef _HID_SENSORS_IDS_H
20#define _HID_SENSORS_IDS_H 20#define _HID_SENSORS_IDS_H
21 21
22#define HID_UP_SENSOR 0x00200000
23#define HID_MAX_PHY_DEVICES 0xFF 22#define HID_MAX_PHY_DEVICES 0xFF
24 23
25/* Accel 3D (200073) */ 24/* Accel 3D (200073) */
diff --git a/include/linux/hid.h b/include/linux/hid.h
index c076041a069e..7330a0fef0c0 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -167,6 +167,7 @@ struct hid_item {
167#define HID_UP_MSVENDOR 0xff000000 167#define HID_UP_MSVENDOR 0xff000000
168#define HID_UP_CUSTOM 0x00ff0000 168#define HID_UP_CUSTOM 0x00ff0000
169#define HID_UP_LOGIVENDOR 0xffbc0000 169#define HID_UP_LOGIVENDOR 0xffbc0000
170#define HID_UP_SENSOR 0x00200000
170 171
171#define HID_USAGE 0x0000ffff 172#define HID_USAGE 0x0000ffff
172 173
@@ -292,6 +293,7 @@ struct hid_item {
292 */ 293 */
293#define HID_GROUP_GENERIC 0x0001 294#define HID_GROUP_GENERIC 0x0001
294#define HID_GROUP_MULTITOUCH 0x0002 295#define HID_GROUP_MULTITOUCH 0x0002
296#define HID_GROUP_SENSOR_HUB 0x0003
295 297
296/* 298/*
297 * This is the global environment of the parser. This information is 299 * This is the global environment of the parser. This information is
@@ -342,6 +344,7 @@ struct hid_collection {
342struct hid_usage { 344struct hid_usage {
343 unsigned hid; /* hid usage code */ 345 unsigned hid; /* hid usage code */
344 unsigned collection_index; /* index into collection array */ 346 unsigned collection_index; /* index into collection array */
347 unsigned usage_index; /* index into usage array */
345 /* hidinput data */ 348 /* hidinput data */
346 __u16 code; /* input driver code */ 349 __u16 code; /* input driver code */
347 __u8 type; /* input driver type */ 350 __u8 type; /* input driver type */
@@ -684,6 +687,7 @@ struct hid_ll_driver {
684 687
685extern int hid_debug; 688extern int hid_debug;
686 689
690extern bool hid_ignore(struct hid_device *);
687extern int hid_add_device(struct hid_device *); 691extern int hid_add_device(struct hid_device *);
688extern void hid_destroy_device(struct hid_device *); 692extern void hid_destroy_device(struct hid_device *);
689 693
@@ -706,6 +710,7 @@ int hid_input_report(struct hid_device *, int type, u8 *, int, int);
706int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); 710int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
707struct hid_field *hidinput_get_led_field(struct hid_device *hid); 711struct hid_field *hidinput_get_led_field(struct hid_device *hid);
708unsigned int hidinput_count_leds(struct hid_device *hid); 712unsigned int hidinput_count_leds(struct hid_device *hid);
713__s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code);
709void hid_output_report(struct hid_report *report, __u8 *data); 714void hid_output_report(struct hid_report *report, __u8 *data);
710struct hid_device *hid_allocate_device(void); 715struct hid_device *hid_allocate_device(void);
711struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); 716struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id);
@@ -716,6 +721,7 @@ int hid_connect(struct hid_device *hid, unsigned int connect_mask);
716void hid_disconnect(struct hid_device *hid); 721void hid_disconnect(struct hid_device *hid);
717const struct hid_device_id *hid_match_id(struct hid_device *hdev, 722const struct hid_device_id *hid_match_id(struct hid_device *hdev,
718 const struct hid_device_id *id); 723 const struct hid_device_id *id);
724s32 hid_snto32(__u32 value, unsigned n);
719 725
720/** 726/**
721 * hid_map_usage - map usage input bits 727 * hid_map_usage - map usage input bits
diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index 0d1208c0bdc4..1d76f8ca90f0 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -8,6 +8,10 @@ extern int do_huge_pmd_anonymous_page(struct mm_struct *mm,
8extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm, 8extern int copy_huge_pmd(struct mm_struct *dst_mm, struct mm_struct *src_mm,
9 pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr, 9 pmd_t *dst_pmd, pmd_t *src_pmd, unsigned long addr,
10 struct vm_area_struct *vma); 10 struct vm_area_struct *vma);
11extern void huge_pmd_set_accessed(struct mm_struct *mm,
12 struct vm_area_struct *vma,
13 unsigned long address, pmd_t *pmd,
14 pmd_t orig_pmd, int dirty);
11extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, 15extern int do_huge_pmd_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
12 unsigned long address, pmd_t *pmd, 16 unsigned long address, pmd_t *pmd,
13 pmd_t orig_pmd); 17 pmd_t orig_pmd);
@@ -36,6 +40,7 @@ enum transparent_hugepage_flag {
36 TRANSPARENT_HUGEPAGE_DEFRAG_FLAG, 40 TRANSPARENT_HUGEPAGE_DEFRAG_FLAG,
37 TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG, 41 TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG,
38 TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG, 42 TRANSPARENT_HUGEPAGE_DEFRAG_KHUGEPAGED_FLAG,
43 TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG,
39#ifdef CONFIG_DEBUG_VM 44#ifdef CONFIG_DEBUG_VM
40 TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG, 45 TRANSPARENT_HUGEPAGE_DEBUG_COW_FLAG,
41#endif 46#endif
@@ -75,6 +80,9 @@ extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
75 (transparent_hugepage_flags & \ 80 (transparent_hugepage_flags & \
76 (1<<TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG) && \ 81 (1<<TRANSPARENT_HUGEPAGE_DEFRAG_REQ_MADV_FLAG) && \
77 (__vma)->vm_flags & VM_HUGEPAGE)) 82 (__vma)->vm_flags & VM_HUGEPAGE))
83#define transparent_hugepage_use_zero_page() \
84 (transparent_hugepage_flags & \
85 (1<<TRANSPARENT_HUGEPAGE_USE_ZERO_PAGE_FLAG))
78#ifdef CONFIG_DEBUG_VM 86#ifdef CONFIG_DEBUG_VM
79#define transparent_hugepage_debug_cow() \ 87#define transparent_hugepage_debug_cow() \
80 (transparent_hugepage_flags & \ 88 (transparent_hugepage_flags & \
@@ -92,12 +100,14 @@ extern int handle_pte_fault(struct mm_struct *mm,
92 struct vm_area_struct *vma, unsigned long address, 100 struct vm_area_struct *vma, unsigned long address,
93 pte_t *pte, pmd_t *pmd, unsigned int flags); 101 pte_t *pte, pmd_t *pmd, unsigned int flags);
94extern int split_huge_page(struct page *page); 102extern int split_huge_page(struct page *page);
95extern void __split_huge_page_pmd(struct mm_struct *mm, pmd_t *pmd); 103extern void __split_huge_page_pmd(struct vm_area_struct *vma,
96#define split_huge_page_pmd(__mm, __pmd) \ 104 unsigned long address, pmd_t *pmd);
105#define split_huge_page_pmd(__vma, __address, __pmd) \
97 do { \ 106 do { \
98 pmd_t *____pmd = (__pmd); \ 107 pmd_t *____pmd = (__pmd); \
99 if (unlikely(pmd_trans_huge(*____pmd))) \ 108 if (unlikely(pmd_trans_huge(*____pmd))) \
100 __split_huge_page_pmd(__mm, ____pmd); \ 109 __split_huge_page_pmd(__vma, __address, \
110 ____pmd); \
101 } while (0) 111 } while (0)
102#define wait_split_huge_page(__anon_vma, __pmd) \ 112#define wait_split_huge_page(__anon_vma, __pmd) \
103 do { \ 113 do { \
@@ -107,6 +117,8 @@ extern void __split_huge_page_pmd(struct mm_struct *mm, pmd_t *pmd);
107 BUG_ON(pmd_trans_splitting(*____pmd) || \ 117 BUG_ON(pmd_trans_splitting(*____pmd) || \
108 pmd_trans_huge(*____pmd)); \ 118 pmd_trans_huge(*____pmd)); \
109 } while (0) 119 } while (0)
120extern void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address,
121 pmd_t *pmd);
110#if HPAGE_PMD_ORDER > MAX_ORDER 122#if HPAGE_PMD_ORDER > MAX_ORDER
111#error "hugepages can't be allocated by the buddy allocator" 123#error "hugepages can't be allocated by the buddy allocator"
112#endif 124#endif
@@ -178,10 +190,12 @@ static inline int split_huge_page(struct page *page)
178{ 190{
179 return 0; 191 return 0;
180} 192}
181#define split_huge_page_pmd(__mm, __pmd) \ 193#define split_huge_page_pmd(__vma, __address, __pmd) \
182 do { } while (0) 194 do { } while (0)
183#define wait_split_huge_page(__anon_vma, __pmd) \ 195#define wait_split_huge_page(__anon_vma, __pmd) \
184 do { } while (0) 196 do { } while (0)
197#define split_huge_page_pmd_mm(__mm, __address, __pmd) \
198 do { } while (0)
185#define compound_trans_head(page) compound_head(page) 199#define compound_trans_head(page) compound_head(page)
186static inline int hugepage_madvise(struct vm_area_struct *vma, 200static inline int hugepage_madvise(struct vm_area_struct *vma,
187 unsigned long *vm_flags, int advice) 201 unsigned long *vm_flags, int advice)
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 06e691baab86..0c80d3f57a5b 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -187,7 +187,8 @@ extern const struct file_operations hugetlbfs_file_operations;
187extern const struct vm_operations_struct hugetlb_vm_ops; 187extern const struct vm_operations_struct hugetlb_vm_ops;
188struct file *hugetlb_file_setup(const char *name, unsigned long addr, 188struct file *hugetlb_file_setup(const char *name, unsigned long addr,
189 size_t size, vm_flags_t acct, 189 size_t size, vm_flags_t acct,
190 struct user_struct **user, int creat_flags); 190 struct user_struct **user, int creat_flags,
191 int page_size_log);
191 192
192static inline int is_file_hugepages(struct file *file) 193static inline int is_file_hugepages(struct file *file)
193{ 194{
@@ -199,12 +200,14 @@ static inline int is_file_hugepages(struct file *file)
199 return 0; 200 return 0;
200} 201}
201 202
203
202#else /* !CONFIG_HUGETLBFS */ 204#else /* !CONFIG_HUGETLBFS */
203 205
204#define is_file_hugepages(file) 0 206#define is_file_hugepages(file) 0
205static inline struct file * 207static inline struct file *
206hugetlb_file_setup(const char *name, unsigned long addr, size_t size, 208hugetlb_file_setup(const char *name, unsigned long addr, size_t size,
207 vm_flags_t acctflag, struct user_struct **user, int creat_flags) 209 vm_flags_t acctflag, struct user_struct **user, int creat_flags,
210 int page_size_log)
208{ 211{
209 return ERR_PTR(-ENOSYS); 212 return ERR_PTR(-ENOSYS);
210} 213}
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index 6ae9c631a1be..0464c85e63fd 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -1,35 +1,8 @@
1#ifndef _LINUX_HW_BREAKPOINT_H 1#ifndef _LINUX_HW_BREAKPOINT_H
2#define _LINUX_HW_BREAKPOINT_H 2#define _LINUX_HW_BREAKPOINT_H
3 3
4enum {
5 HW_BREAKPOINT_LEN_1 = 1,
6 HW_BREAKPOINT_LEN_2 = 2,
7 HW_BREAKPOINT_LEN_4 = 4,
8 HW_BREAKPOINT_LEN_8 = 8,
9};
10
11enum {
12 HW_BREAKPOINT_EMPTY = 0,
13 HW_BREAKPOINT_R = 1,
14 HW_BREAKPOINT_W = 2,
15 HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W,
16 HW_BREAKPOINT_X = 4,
17 HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
18};
19
20enum bp_type_idx {
21 TYPE_INST = 0,
22#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
23 TYPE_DATA = 0,
24#else
25 TYPE_DATA = 1,
26#endif
27 TYPE_MAX
28};
29
30#ifdef __KERNEL__
31
32#include <linux/perf_event.h> 4#include <linux/perf_event.h>
5#include <uapi/linux/hw_breakpoint.h>
33 6
34#ifdef CONFIG_HAVE_HW_BREAKPOINT 7#ifdef CONFIG_HAVE_HW_BREAKPOINT
35 8
@@ -151,6 +124,4 @@ static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp)
151} 124}
152 125
153#endif /* CONFIG_HAVE_HW_BREAKPOINT */ 126#endif /* CONFIG_HAVE_HW_BREAKPOINT */
154#endif /* __KERNEL__ */
155
156#endif /* _LINUX_HW_BREAKPOINT_H */ 127#endif /* _LINUX_HW_BREAKPOINT_H */
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
index df804ba73e0b..92a0dc75bc74 100644
--- a/include/linux/i2c-omap.h
+++ b/include/linux/i2c-omap.h
@@ -34,6 +34,7 @@ struct omap_i2c_bus_platform_data {
34 u32 clkrate; 34 u32 clkrate;
35 u32 rev; 35 u32 rev;
36 u32 flags; 36 u32 flags;
37 void (*set_mpu_wkup_lat)(struct device *dev, long set);
37}; 38};
38 39
39#endif 40#endif
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 800de224336b..d0c4db7b4872 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -259,6 +259,7 @@ static inline void i2c_set_clientdata(struct i2c_client *dev, void *data)
259 * @platform_data: stored in i2c_client.dev.platform_data 259 * @platform_data: stored in i2c_client.dev.platform_data
260 * @archdata: copied into i2c_client.dev.archdata 260 * @archdata: copied into i2c_client.dev.archdata
261 * @of_node: pointer to OpenFirmware device node 261 * @of_node: pointer to OpenFirmware device node
262 * @acpi_node: ACPI device node
262 * @irq: stored in i2c_client.irq 263 * @irq: stored in i2c_client.irq
263 * 264 *
264 * I2C doesn't actually support hardware probing, although controllers and 265 * I2C doesn't actually support hardware probing, although controllers and
@@ -279,6 +280,7 @@ struct i2c_board_info {
279 void *platform_data; 280 void *platform_data;
280 struct dev_archdata *archdata; 281 struct dev_archdata *archdata;
281 struct device_node *of_node; 282 struct device_node *of_node;
283 struct acpi_dev_node acpi_node;
282 int irq; 284 int irq;
283}; 285};
284 286
@@ -501,4 +503,11 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
501 i2c_del_driver) 503 i2c_del_driver)
502 504
503#endif /* I2C */ 505#endif /* I2C */
506
507#if IS_ENABLED(CONFIG_ACPI_I2C)
508extern void acpi_i2c_register_devices(struct i2c_adapter *adap);
509#else
510static inline void acpi_i2c_register_devices(struct i2c_adapter *adap) {}
511#endif
512
504#endif /* _LINUX_I2C_H */ 513#endif /* _LINUX_I2C_H */
diff --git a/include/linux/i2c/i2c-hid.h b/include/linux/i2c/i2c-hid.h
new file mode 100644
index 000000000000..60e411d764d4
--- /dev/null
+++ b/include/linux/i2c/i2c-hid.h
@@ -0,0 +1,35 @@
1/*
2 * HID over I2C protocol implementation
3 *
4 * Copyright (c) 2012 Benjamin Tissoires <benjamin.tissoires@gmail.com>
5 * Copyright (c) 2012 Ecole Nationale de l'Aviation Civile, France
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file COPYING in the main directory of this archive for
9 * more details.
10 */
11
12#ifndef __LINUX_I2C_HID_H
13#define __LINUX_I2C_HID_H
14
15#include <linux/types.h>
16
17/**
18 * struct i2chid_platform_data - used by hid over i2c implementation.
19 * @hid_descriptor_address: i2c register where the HID descriptor is stored.
20 *
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.
23 * The platform driver should also setup the gpio according to the device:
24 *
25 * A typical example is the following:
26 * irq = gpio_to_irq(intr_gpio);
27 * hkdk4412_i2c_devs5[0].irq = irq; // store the irq in i2c_board_info
28 * gpio_request(intr_gpio, "elan-irq");
29 * s3c_gpio_setpull(intr_gpio, S3C_GPIO_PULL_UP);
30 */
31struct i2c_hid_platform_data {
32 u16 hid_descriptor_address;
33};
34
35#endif /* __LINUX_I2C_HID_H */
diff --git a/include/linux/i2c/pcf857x.h b/include/linux/i2c/pcf857x.h
index 781e6bd06c34..0767a2a6b2f1 100644
--- a/include/linux/i2c/pcf857x.h
+++ b/include/linux/i2c/pcf857x.h
@@ -10,7 +10,6 @@
10 * @setup: optional callback issued once the GPIOs are valid 10 * @setup: optional callback issued once the GPIOs are valid
11 * @teardown: optional callback issued before the GPIOs are invalidated 11 * @teardown: optional callback issued before the GPIOs are invalidated
12 * @context: optional parameter passed to setup() and teardown() 12 * @context: optional parameter passed to setup() and teardown()
13 * @irq: optional interrupt number
14 * 13 *
15 * In addition to the I2C_BOARD_INFO() state appropriate to each chip, 14 * In addition to the I2C_BOARD_INFO() state appropriate to each chip,
16 * the i2c_board_info used with the pcf875x driver must provide its 15 * the i2c_board_info used with the pcf875x driver must provide its
@@ -40,8 +39,6 @@ struct pcf857x_platform_data {
40 int gpio, unsigned ngpio, 39 int gpio, unsigned ngpio,
41 void *context); 40 void *context);
42 void *context; 41 void *context;
43
44 int irq;
45}; 42};
46 43
47#endif /* __LINUX_PCF857X_H */ 44#endif /* __LINUX_PCF857X_H */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 2385119f8bb0..f0859cc73861 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -131,6 +131,8 @@
131 131
132#define IEEE80211_MAX_MESH_ID_LEN 32 132#define IEEE80211_MAX_MESH_ID_LEN 32
133 133
134#define IEEE80211_NUM_TIDS 16
135
134#define IEEE80211_QOS_CTL_LEN 2 136#define IEEE80211_QOS_CTL_LEN 2
135/* 1d tag mask */ 137/* 1d tag mask */
136#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 138#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007
@@ -666,6 +668,21 @@ struct ieee80211_meshconf_ie {
666} __attribute__ ((packed)); 668} __attribute__ ((packed));
667 669
668/** 670/**
671 * enum mesh_config_capab_flags - Mesh Configuration IE capability field flags
672 *
673 * @IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS: STA is willing to establish
674 * additional mesh peerings with other mesh STAs
675 * @IEEE80211_MESHCONF_CAPAB_FORWARDING: the STA forwards MSDUs
676 * @IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING: TBTT adjustment procedure
677 * is ongoing
678 */
679enum mesh_config_capab_flags {
680 IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS = 0x01,
681 IEEE80211_MESHCONF_CAPAB_FORWARDING = 0x08,
682 IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING = 0x20,
683};
684
685/**
669 * struct ieee80211_rann_ie 686 * struct ieee80211_rann_ie
670 * 687 *
671 * This structure refers to "Root Announcement information element" 688 * This structure refers to "Root Announcement information element"
@@ -905,6 +922,38 @@ struct ieee80211_tdls_data {
905 } u; 922 } u;
906} __packed; 923} __packed;
907 924
925/*
926 * Peer-to-Peer IE attribute related definitions.
927 */
928/**
929 * enum ieee80211_p2p_attr_id - identifies type of peer-to-peer attribute.
930 */
931enum ieee80211_p2p_attr_id {
932 IEEE80211_P2P_ATTR_STATUS = 0,
933 IEEE80211_P2P_ATTR_MINOR_REASON,
934 IEEE80211_P2P_ATTR_CAPABILITY,
935 IEEE80211_P2P_ATTR_DEVICE_ID,
936 IEEE80211_P2P_ATTR_GO_INTENT,
937 IEEE80211_P2P_ATTR_GO_CONFIG_TIMEOUT,
938 IEEE80211_P2P_ATTR_LISTEN_CHANNEL,
939 IEEE80211_P2P_ATTR_GROUP_BSSID,
940 IEEE80211_P2P_ATTR_EXT_LISTEN_TIMING,
941 IEEE80211_P2P_ATTR_INTENDED_IFACE_ADDR,
942 IEEE80211_P2P_ATTR_MANAGABILITY,
943 IEEE80211_P2P_ATTR_CHANNEL_LIST,
944 IEEE80211_P2P_ATTR_ABSENCE_NOTICE,
945 IEEE80211_P2P_ATTR_DEVICE_INFO,
946 IEEE80211_P2P_ATTR_GROUP_INFO,
947 IEEE80211_P2P_ATTR_GROUP_ID,
948 IEEE80211_P2P_ATTR_INTERFACE,
949 IEEE80211_P2P_ATTR_OPER_CHANNEL,
950 IEEE80211_P2P_ATTR_INVITE_FLAGS,
951 /* 19 - 220: Reserved */
952 IEEE80211_P2P_ATTR_VENDOR_SPECIFIC = 221,
953
954 IEEE80211_P2P_ATTR_MAX
955};
956
908/** 957/**
909 * struct ieee80211_bar - HT Block Ack Request 958 * struct ieee80211_bar - HT Block Ack Request
910 * 959 *
@@ -1107,20 +1156,6 @@ struct ieee80211_ht_operation {
1107#define WLAN_HT_SMPS_CONTROL_STATIC 1 1156#define WLAN_HT_SMPS_CONTROL_STATIC 1
1108#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 1157#define WLAN_HT_SMPS_CONTROL_DYNAMIC 3
1109 1158
1110#define VHT_MCS_SUPPORTED_SET_SIZE 8
1111
1112struct ieee80211_vht_capabilities {
1113 __le32 vht_capabilities_info;
1114 u8 vht_supported_mcs_set[VHT_MCS_SUPPORTED_SET_SIZE];
1115} __packed;
1116
1117struct ieee80211_vht_operation {
1118 u8 vht_op_info_chwidth;
1119 u8 vht_op_info_chan_center_freq_seg1_idx;
1120 u8 vht_op_info_chan_center_freq_seg2_idx;
1121 __le16 vht_basic_mcs_set;
1122} __packed;
1123
1124/** 1159/**
1125 * struct ieee80211_vht_mcs_info - VHT MCS information 1160 * struct ieee80211_vht_mcs_info - VHT MCS information
1126 * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams 1161 * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams
@@ -1128,11 +1163,13 @@ struct ieee80211_vht_operation {
1128 * STA can receive. Rate expressed in units of 1 Mbps. 1163 * STA can receive. Rate expressed in units of 1 Mbps.
1129 * If this field is 0 this value should not be used to 1164 * If this field is 0 this value should not be used to
1130 * consider the highest RX data rate supported. 1165 * consider the highest RX data rate supported.
1166 * The top 3 bits of this field are reserved.
1131 * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams 1167 * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams
1132 * @tx_highest: Indicates highest long GI VHT PPDU data rate 1168 * @tx_highest: Indicates highest long GI VHT PPDU data rate
1133 * STA can transmit. Rate expressed in units of 1 Mbps. 1169 * STA can transmit. Rate expressed in units of 1 Mbps.
1134 * If this field is 0 this value should not be used to 1170 * If this field is 0 this value should not be used to
1135 * consider the highest TX data rate supported. 1171 * consider the highest TX data rate supported.
1172 * The top 3 bits of this field are reserved.
1136 */ 1173 */
1137struct ieee80211_vht_mcs_info { 1174struct ieee80211_vht_mcs_info {
1138 __le16 rx_mcs_map; 1175 __le16 rx_mcs_map;
@@ -1141,38 +1178,107 @@ struct ieee80211_vht_mcs_info {
1141 __le16 tx_highest; 1178 __le16 tx_highest;
1142} __packed; 1179} __packed;
1143 1180
1181/**
1182 * enum ieee80211_vht_mcs_support - VHT MCS support definitions
1183 * @IEEE80211_VHT_MCS_SUPPORT_0_7: MCSes 0-7 are supported for the
1184 * number of streams
1185 * @IEEE80211_VHT_MCS_SUPPORT_0_8: MCSes 0-8 are supported
1186 * @IEEE80211_VHT_MCS_SUPPORT_0_9: MCSes 0-9 are supported
1187 * @IEEE80211_VHT_MCS_NOT_SUPPORTED: This number of streams isn't supported
1188 *
1189 * These definitions are used in each 2-bit subfield of the @rx_mcs_map
1190 * and @tx_mcs_map fields of &struct ieee80211_vht_mcs_info, which are
1191 * both split into 8 subfields by number of streams. These values indicate
1192 * which MCSes are supported for the number of streams the value appears
1193 * for.
1194 */
1195enum ieee80211_vht_mcs_support {
1196 IEEE80211_VHT_MCS_SUPPORT_0_7 = 0,
1197 IEEE80211_VHT_MCS_SUPPORT_0_8 = 1,
1198 IEEE80211_VHT_MCS_SUPPORT_0_9 = 2,
1199 IEEE80211_VHT_MCS_NOT_SUPPORTED = 3,
1200};
1201
1202/**
1203 * struct ieee80211_vht_cap - VHT capabilities
1204 *
1205 * This structure is the "VHT capabilities element" as
1206 * described in 802.11ac D3.0 8.4.2.160
1207 * @vht_cap_info: VHT capability info
1208 * @supp_mcs: VHT MCS supported rates
1209 */
1210struct ieee80211_vht_cap {
1211 __le32 vht_cap_info;
1212 struct ieee80211_vht_mcs_info supp_mcs;
1213} __packed;
1214
1215/**
1216 * enum ieee80211_vht_chanwidth - VHT channel width
1217 * @IEEE80211_VHT_CHANWIDTH_USE_HT: use the HT operation IE to
1218 * determine the channel width (20 or 40 MHz)
1219 * @IEEE80211_VHT_CHANWIDTH_80MHZ: 80 MHz bandwidth
1220 * @IEEE80211_VHT_CHANWIDTH_160MHZ: 160 MHz bandwidth
1221 * @IEEE80211_VHT_CHANWIDTH_80P80MHZ: 80+80 MHz bandwidth
1222 */
1223enum ieee80211_vht_chanwidth {
1224 IEEE80211_VHT_CHANWIDTH_USE_HT = 0,
1225 IEEE80211_VHT_CHANWIDTH_80MHZ = 1,
1226 IEEE80211_VHT_CHANWIDTH_160MHZ = 2,
1227 IEEE80211_VHT_CHANWIDTH_80P80MHZ = 3,
1228};
1229
1230/**
1231 * struct ieee80211_vht_operation - VHT operation IE
1232 *
1233 * This structure is the "VHT operation element" as
1234 * described in 802.11ac D3.0 8.4.2.161
1235 * @chan_width: Operating channel width
1236 * @center_freq_seg1_idx: center freq segment 1 index
1237 * @center_freq_seg2_idx: center freq segment 2 index
1238 * @basic_mcs_set: VHT Basic MCS rate set
1239 */
1240struct ieee80211_vht_operation {
1241 u8 chan_width;
1242 u8 center_freq_seg1_idx;
1243 u8 center_freq_seg2_idx;
1244 __le16 basic_mcs_set;
1245} __packed;
1246
1247
1144#define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0 1248#define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0
1145#define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1 1249#define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1
1146#define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2 1250#define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2
1147#define IEEE80211_VHT_MCS_NOT_SUPPORTED 3 1251#define IEEE80211_VHT_MCS_NOT_SUPPORTED 3
1148 1252
1149/* 802.11ac VHT Capabilities */ 1253/* 802.11ac VHT Capabilities */
1150#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000 1254#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895 0x00000000
1151#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001 1255#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 0x00000001
1152#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002 1256#define IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 0x00000002
1153#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 1257#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004
1154#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 1258#define IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008
1155#define IEEE80211_VHT_CAP_RXLDPC 0x00000010 1259#define IEEE80211_VHT_CAP_RXLDPC 0x00000010
1156#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020 1260#define IEEE80211_VHT_CAP_SHORT_GI_80 0x00000020
1157#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040 1261#define IEEE80211_VHT_CAP_SHORT_GI_160 0x00000040
1158#define IEEE80211_VHT_CAP_TXSTBC 0x00000080 1262#define IEEE80211_VHT_CAP_TXSTBC 0x00000080
1159#define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100 1263#define IEEE80211_VHT_CAP_RXSTBC_1 0x00000100
1160#define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200 1264#define IEEE80211_VHT_CAP_RXSTBC_2 0x00000200
1161#define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300 1265#define IEEE80211_VHT_CAP_RXSTBC_3 0x00000300
1162#define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400 1266#define IEEE80211_VHT_CAP_RXSTBC_4 0x00000400
1163#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800 1267#define IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE 0x00000800
1164#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000 1268#define IEEE80211_VHT_CAP_SU_BEAMFORMEE_CAPABLE 0x00001000
1165#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000 1269#define IEEE80211_VHT_CAP_BEAMFORMER_ANTENNAS_MAX 0x00006000
1166#define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000 1270#define IEEE80211_VHT_CAP_SOUNDING_DIMENTION_MAX 0x00030000
1167#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000 1271#define IEEE80211_VHT_CAP_MU_BEAMFORMER_CAPABLE 0x00080000
1168#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000 1272#define IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE 0x00100000
1169#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000 1273#define IEEE80211_VHT_CAP_VHT_TXOP_PS 0x00200000
1170#define IEEE80211_VHT_CAP_HTC_VHT 0x00400000 1274#define IEEE80211_VHT_CAP_HTC_VHT 0x00400000
1171#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT 0x00800000 1275#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 23
1172#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000 1276#define IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \
1173#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 1277 (7 << IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT)
1174#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000 1278#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000
1175#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000 1279#define IEEE80211_VHT_CAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000
1280#define IEEE80211_VHT_CAP_RX_ANTENNA_PATTERN 0x10000000
1281#define IEEE80211_VHT_CAP_TX_ANTENNA_PATTERN 0x20000000
1176 1282
1177/* Authentication algorithms */ 1283/* Authentication algorithms */
1178#define WLAN_AUTH_OPEN 0 1284#define WLAN_AUTH_OPEN 0
@@ -1440,8 +1546,6 @@ enum ieee80211_eid {
1440 1546
1441 WLAN_EID_RSN = 48, 1547 WLAN_EID_RSN = 48,
1442 WLAN_EID_MMIE = 76, 1548 WLAN_EID_MMIE = 76,
1443 WLAN_EID_WPA = 221,
1444 WLAN_EID_GENERIC = 221,
1445 WLAN_EID_VENDOR_SPECIFIC = 221, 1549 WLAN_EID_VENDOR_SPECIFIC = 221,
1446 WLAN_EID_QOS_PARAMETER = 222, 1550 WLAN_EID_QOS_PARAMETER = 222,
1447 1551
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index 1cc595a67cc9..f4e56ecd0b1a 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -4,5 +4,22 @@
4#include <linux/ip.h> 4#include <linux/ip.h>
5#include <linux/in6.h> 5#include <linux/in6.h>
6#include <uapi/linux/if_tunnel.h> 6#include <uapi/linux/if_tunnel.h>
7#include <linux/u64_stats_sync.h>
8
9/*
10 * Locking : hash tables are protected by RCU and RTNL
11 */
12
13#define for_each_ip_tunnel_rcu(pos, start) \
14 for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next))
15
16/* often modified stats are per cpu, other are shared (netdev->stats) */
17struct pcpu_tstats {
18 u64 rx_packets;
19 u64 rx_bytes;
20 u64 tx_packets;
21 u64 tx_bytes;
22 struct u64_stats_sync syncp;
23};
7 24
8#endif /* _IF_TUNNEL_H_ */ 25#endif /* _IF_TUNNEL_H_ */
diff --git a/include/linux/iio/buffer.h b/include/linux/iio/buffer.h
index c629b3a1d9a9..f3eea18fdf46 100644
--- a/include/linux/iio/buffer.h
+++ b/include/linux/iio/buffer.h
@@ -66,7 +66,8 @@ struct iio_buffer_access_funcs {
66 * @stufftoread: [INTERN] flag to indicate new data. 66 * @stufftoread: [INTERN] flag to indicate new data.
67 * @demux_list: [INTERN] list of operations required to demux the scan. 67 * @demux_list: [INTERN] list of operations required to demux the scan.
68 * @demux_bounce: [INTERN] buffer for doing gather from incoming scan. 68 * @demux_bounce: [INTERN] buffer for doing gather from incoming scan.
69 **/ 69 * @buffer_list: [INTERN] entry in the devices list of current buffers.
70 */
70struct iio_buffer { 71struct iio_buffer {
71 int length; 72 int length;
72 int bytes_per_datum; 73 int bytes_per_datum;
@@ -81,9 +82,22 @@ struct iio_buffer {
81 const struct attribute_group *attrs; 82 const struct attribute_group *attrs;
82 struct list_head demux_list; 83 struct list_head demux_list;
83 unsigned char *demux_bounce; 84 unsigned char *demux_bounce;
85 struct list_head buffer_list;
84}; 86};
85 87
86/** 88/**
89 * iio_update_buffers() - add or remove buffer from active list
90 * @indio_dev: device to add buffer to
91 * @insert_buffer: buffer to insert
92 * @remove_buffer: buffer_to_remove
93 *
94 * Note this will tear down the all buffering and build it up again
95 */
96int iio_update_buffers(struct iio_dev *indio_dev,
97 struct iio_buffer *insert_buffer,
98 struct iio_buffer *remove_buffer);
99
100/**
87 * iio_buffer_init() - Initialize the buffer structure 101 * iio_buffer_init() - Initialize the buffer structure
88 * @buffer: buffer to be initialized 102 * @buffer: buffer to be initialized
89 **/ 103 **/
@@ -115,11 +129,11 @@ int iio_scan_mask_set(struct iio_dev *indio_dev,
115 struct iio_buffer *buffer, int bit); 129 struct iio_buffer *buffer, int bit);
116 130
117/** 131/**
118 * iio_push_to_buffer() - push to a registered buffer. 132 * iio_push_to_buffers() - push to a registered buffer.
119 * @buffer: IIO buffer structure for device 133 * @indio_dev: iio_dev structure for device.
120 * @data: the data to push to the buffer 134 * @data: Full scan.
121 */ 135 */
122int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data); 136int iio_push_to_buffers(struct iio_dev *indio_dev, unsigned char *data);
123 137
124int iio_update_demux(struct iio_dev *indio_dev); 138int iio_update_demux(struct iio_dev *indio_dev);
125 139
@@ -181,7 +195,7 @@ bool iio_validate_scan_mask_onehot(struct iio_dev *indio_dev,
181#else /* CONFIG_IIO_BUFFER */ 195#else /* CONFIG_IIO_BUFFER */
182 196
183static inline int iio_buffer_register(struct iio_dev *indio_dev, 197static inline int iio_buffer_register(struct iio_dev *indio_dev,
184 struct iio_chan_spec *channels, 198 const struct iio_chan_spec *channels,
185 int num_channels) 199 int num_channels)
186{ 200{
187 return 0; 201 return 0;
diff --git a/include/linux/iio/consumer.h b/include/linux/iio/consumer.h
index e875bcf0478f..16c35ac045bd 100644
--- a/include/linux/iio/consumer.h
+++ b/include/linux/iio/consumer.h
@@ -9,6 +9,8 @@
9 */ 9 */
10#ifndef _IIO_INKERN_CONSUMER_H_ 10#ifndef _IIO_INKERN_CONSUMER_H_
11#define _IIO_INKERN_CONSUMER_H_ 11#define _IIO_INKERN_CONSUMER_H_
12
13#include <linux/types.h>
12#include <linux/iio/types.h> 14#include <linux/iio/types.h>
13 15
14struct iio_dev; 16struct iio_dev;
@@ -18,10 +20,12 @@ struct iio_chan_spec;
18 * struct iio_channel - everything needed for a consumer to use a channel 20 * struct iio_channel - everything needed for a consumer to use a channel
19 * @indio_dev: Device on which the channel exists. 21 * @indio_dev: Device on which the channel exists.
20 * @channel: Full description of the channel. 22 * @channel: Full description of the channel.
23 * @data: Data about the channel used by consumer.
21 */ 24 */
22struct iio_channel { 25struct iio_channel {
23 struct iio_dev *indio_dev; 26 struct iio_dev *indio_dev;
24 const struct iio_chan_spec *channel; 27 const struct iio_chan_spec *channel;
28 void *data;
25}; 29};
26 30
27/** 31/**
@@ -59,6 +63,52 @@ struct iio_channel *iio_channel_get_all(const char *name);
59 */ 63 */
60void iio_channel_release_all(struct iio_channel *chan); 64void iio_channel_release_all(struct iio_channel *chan);
61 65
66struct iio_cb_buffer;
67/**
68 * iio_channel_get_all_cb() - register callback for triggered capture
69 * @name: Name of client device.
70 * @cb: Callback function.
71 * @private: Private data passed to callback.
72 *
73 * NB right now we have no ability to mux data from multiple devices.
74 * So if the channels requested come from different devices this will
75 * fail.
76 */
77struct iio_cb_buffer *iio_channel_get_all_cb(const char *name,
78 int (*cb)(u8 *data,
79 void *private),
80 void *private);
81/**
82 * iio_channel_release_all_cb() - release and unregister the callback.
83 * @cb_buffer: The callback buffer that was allocated.
84 */
85void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buffer);
86
87/**
88 * iio_channel_start_all_cb() - start the flow of data through callback.
89 * @cb_buff: The callback buffer we are starting.
90 */
91int iio_channel_start_all_cb(struct iio_cb_buffer *cb_buff);
92
93/**
94 * iio_channel_stop_all_cb() - stop the flow of data through the callback.
95 * @cb_buff: The callback buffer we are stopping.
96 */
97void iio_channel_stop_all_cb(struct iio_cb_buffer *cb_buff);
98
99/**
100 * iio_channel_cb_get_channels() - get access to the underlying channels.
101 * @cb_buff: The callback buffer from whom we want the channel
102 * information.
103 *
104 * This function allows one to obtain information about the channels.
105 * Whilst this may allow direct reading if all buffers are disabled, the
106 * primary aim is to allow drivers that are consuming a channel to query
107 * things like scaling of the channel.
108 */
109struct iio_channel
110*iio_channel_cb_get_channels(const struct iio_cb_buffer *cb_buffer);
111
62/** 112/**
63 * iio_read_channel_raw() - read from a given channel 113 * iio_read_channel_raw() - read from a given channel
64 * @chan: The channel being queried. 114 * @chan: The channel being queried.
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 7806c24e5bc8..da8c776ba0bd 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -410,6 +410,7 @@ struct iio_buffer_setup_ops {
410 * and owner 410 * and owner
411 * @event_interface: [INTERN] event chrdevs associated with interrupt lines 411 * @event_interface: [INTERN] event chrdevs associated with interrupt lines
412 * @buffer: [DRIVER] any buffer present 412 * @buffer: [DRIVER] any buffer present
413 * @buffer_list: [INTERN] list of all buffers currently attached
413 * @scan_bytes: [INTERN] num bytes captured to be fed to buffer demux 414 * @scan_bytes: [INTERN] num bytes captured to be fed to buffer demux
414 * @mlock: [INTERN] lock used to prevent simultaneous device state 415 * @mlock: [INTERN] lock used to prevent simultaneous device state
415 * changes 416 * changes
@@ -448,6 +449,7 @@ struct iio_dev {
448 struct iio_event_interface *event_interface; 449 struct iio_event_interface *event_interface;
449 450
450 struct iio_buffer *buffer; 451 struct iio_buffer *buffer;
452 struct list_head buffer_list;
451 int scan_bytes; 453 int scan_bytes;
452 struct mutex mlock; 454 struct mutex mlock;
453 455
@@ -618,6 +620,9 @@ static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev)
618}; 620};
619#endif 621#endif
620 622
623int iio_str_to_fixpoint(const char *str, int fract_mult, int *integer,
624 int *fract);
625
621/** 626/**
622 * IIO_DEGREE_TO_RAD() - Convert degree to rad 627 * IIO_DEGREE_TO_RAD() - Convert degree to rad
623 * @deg: A value in degree 628 * @deg: A value in degree
diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h
new file mode 100644
index 000000000000..ff781dca2e9a
--- /dev/null
+++ b/include/linux/iio/imu/adis.h
@@ -0,0 +1,280 @@
1/*
2 * Common library for ADIS16XXX devices
3 *
4 * Copyright 2012 Analog Devices Inc.
5 * Author: Lars-Peter Clausen <lars@metafoo.de>
6 *
7 * Licensed under the GPL-2 or later.
8 */
9
10#ifndef __IIO_ADIS_H__
11#define __IIO_ADIS_H__
12
13#include <linux/spi/spi.h>
14#include <linux/interrupt.h>
15#include <linux/iio/types.h>
16
17#define ADIS_WRITE_REG(reg) ((0x80 | (reg)))
18#define ADIS_READ_REG(reg) ((reg) & 0x7f)
19
20#define ADIS_PAGE_SIZE 0x80
21#define ADIS_REG_PAGE_ID 0x00
22
23struct adis;
24
25/**
26 * struct adis_data - ADIS chip variant specific data
27 * @read_delay: SPI delay for read operations in us
28 * @write_delay: SPI delay for write operations in us
29 * @glob_cmd_reg: Register address of the GLOB_CMD register
30 * @msc_ctrl_reg: Register address of the MSC_CTRL register
31 * @diag_stat_reg: Register address of the DIAG_STAT register
32 * @status_error_msgs: Array of error messgaes
33 * @status_error_mask:
34 */
35struct adis_data {
36 unsigned int read_delay;
37 unsigned int write_delay;
38
39 unsigned int glob_cmd_reg;
40 unsigned int msc_ctrl_reg;
41 unsigned int diag_stat_reg;
42
43 unsigned int self_test_mask;
44 unsigned int startup_delay;
45
46 const char * const *status_error_msgs;
47 unsigned int status_error_mask;
48
49 int (*enable_irq)(struct adis *adis, bool enable);
50
51 bool has_paging;
52};
53
54struct adis {
55 struct spi_device *spi;
56 struct iio_trigger *trig;
57
58 const struct adis_data *data;
59
60 struct mutex txrx_lock;
61 struct spi_message msg;
62 struct spi_transfer *xfer;
63 unsigned int current_page;
64 void *buffer;
65
66 uint8_t tx[10] ____cacheline_aligned;
67 uint8_t rx[4];
68};
69
70int adis_init(struct adis *adis, struct iio_dev *indio_dev,
71 struct spi_device *spi, const struct adis_data *data);
72int adis_reset(struct adis *adis);
73
74int adis_write_reg(struct adis *adis, unsigned int reg,
75 unsigned int val, unsigned int size);
76int adis_read_reg(struct adis *adis, unsigned int reg,
77 unsigned int *val, unsigned int size);
78
79/**
80 * adis_write_reg_8() - Write single byte to a register
81 * @adis: The adis device
82 * @reg: The address of the register to be written
83 * @value: The value to write
84 */
85static inline int adis_write_reg_8(struct adis *adis, unsigned int reg,
86 uint8_t val)
87{
88 return adis_write_reg(adis, reg, val, 1);
89}
90
91/**
92 * adis_write_reg_16() - Write 2 bytes to a pair of registers
93 * @adis: The adis device
94 * @reg: The address of the lower of the two registers
95 * @value: Value to be written
96 */
97static inline int adis_write_reg_16(struct adis *adis, unsigned int reg,
98 uint16_t val)
99{
100 return adis_write_reg(adis, reg, val, 2);
101}
102
103/**
104 * adis_write_reg_32() - write 4 bytes to four registers
105 * @adis: The adis device
106 * @reg: The address of the lower of the four register
107 * @value: Value to be written
108 */
109static inline int adis_write_reg_32(struct adis *adis, unsigned int reg,
110 uint32_t val)
111{
112 return adis_write_reg(adis, reg, val, 4);
113}
114
115/**
116 * adis_read_reg_16() - read 2 bytes from a 16-bit register
117 * @adis: The adis device
118 * @reg: The address of the lower of the two registers
119 * @val: The value read back from the device
120 */
121static inline int adis_read_reg_16(struct adis *adis, unsigned int reg,
122 uint16_t *val)
123{
124 unsigned int tmp;
125 int ret;
126
127 ret = adis_read_reg(adis, reg, &tmp, 2);
128 *val = tmp;
129
130 return ret;
131}
132
133/**
134 * adis_read_reg_32() - read 4 bytes from a 32-bit register
135 * @adis: The adis device
136 * @reg: The address of the lower of the two registers
137 * @val: The value read back from the device
138 */
139static inline int adis_read_reg_32(struct adis *adis, unsigned int reg,
140 uint32_t *val)
141{
142 unsigned int tmp;
143 int ret;
144
145 ret = adis_read_reg(adis, reg, &tmp, 4);
146 *val = tmp;
147
148 return ret;
149}
150
151int adis_enable_irq(struct adis *adis, bool enable);
152int adis_check_status(struct adis *adis);
153
154int adis_initial_startup(struct adis *adis);
155
156int adis_single_conversion(struct iio_dev *indio_dev,
157 const struct iio_chan_spec *chan, unsigned int error_mask,
158 int *val);
159
160#define ADIS_VOLTAGE_CHAN(addr, si, chan, name, bits) { \
161 .type = IIO_VOLTAGE, \
162 .indexed = 1, \
163 .channel = (chan), \
164 .extend_name = name, \
165 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
166 IIO_CHAN_INFO_SCALE_SEPARATE_BIT, \
167 .address = (addr), \
168 .scan_index = (si), \
169 .scan_type = { \
170 .sign = 'u', \
171 .realbits = (bits), \
172 .storagebits = 16, \
173 .endianness = IIO_BE, \
174 }, \
175}
176
177#define ADIS_SUPPLY_CHAN(addr, si, bits) \
178 ADIS_VOLTAGE_CHAN(addr, si, 0, "supply", bits)
179
180#define ADIS_AUX_ADC_CHAN(addr, si, bits) \
181 ADIS_VOLTAGE_CHAN(addr, si, 1, NULL, bits)
182
183#define ADIS_TEMP_CHAN(addr, si, bits) { \
184 .type = IIO_TEMP, \
185 .indexed = 1, \
186 .channel = 0, \
187 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
188 IIO_CHAN_INFO_SCALE_SEPARATE_BIT | \
189 IIO_CHAN_INFO_OFFSET_SEPARATE_BIT, \
190 .address = (addr), \
191 .scan_index = (si), \
192 .scan_type = { \
193 .sign = 'u', \
194 .realbits = (bits), \
195 .storagebits = 16, \
196 .endianness = IIO_BE, \
197 }, \
198}
199
200#define ADIS_MOD_CHAN(_type, mod, addr, si, info, bits) { \
201 .type = (_type), \
202 .modified = 1, \
203 .channel2 = IIO_MOD_ ## mod, \
204 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
205 IIO_CHAN_INFO_SCALE_SHARED_BIT | \
206 info, \
207 .address = (addr), \
208 .scan_index = (si), \
209 .scan_type = { \
210 .sign = 's', \
211 .realbits = (bits), \
212 .storagebits = 16, \
213 .endianness = IIO_BE, \
214 }, \
215}
216
217#define ADIS_ACCEL_CHAN(mod, addr, si, info, bits) \
218 ADIS_MOD_CHAN(IIO_ACCEL, mod, addr, si, info, bits)
219
220#define ADIS_GYRO_CHAN(mod, addr, si, info, bits) \
221 ADIS_MOD_CHAN(IIO_ANGL_VEL, mod, addr, si, info, bits)
222
223#define ADIS_INCLI_CHAN(mod, addr, si, info, bits) \
224 ADIS_MOD_CHAN(IIO_INCLI, mod, addr, si, info, bits)
225
226#define ADIS_ROT_CHAN(mod, addr, si, info, bits) \
227 ADIS_MOD_CHAN(IIO_ROT, mod, addr, si, info, bits)
228
229#ifdef CONFIG_IIO_ADIS_LIB_BUFFER
230
231int adis_setup_buffer_and_trigger(struct adis *adis,
232 struct iio_dev *indio_dev, irqreturn_t (*trigger_handler)(int, void *));
233void adis_cleanup_buffer_and_trigger(struct adis *adis,
234 struct iio_dev *indio_dev);
235
236int adis_probe_trigger(struct adis *adis, struct iio_dev *indio_dev);
237void adis_remove_trigger(struct adis *adis);
238
239int adis_update_scan_mode(struct iio_dev *indio_dev,
240 const unsigned long *scan_mask);
241
242#else /* CONFIG_IIO_BUFFER */
243
244static inline int adis_setup_buffer_and_trigger(struct adis *adis,
245 struct iio_dev *indio_dev, irqreturn_t (*trigger_handler)(int, void *))
246{
247 return 0;
248}
249
250static inline void adis_cleanup_buffer_and_trigger(struct adis *adis,
251 struct iio_dev *indio_dev)
252{
253}
254
255static inline int adis_probe_trigger(struct adis *adis,
256 struct iio_dev *indio_dev)
257{
258 return 0;
259}
260
261static inline void adis_remove_trigger(struct adis *adis)
262{
263}
264
265#define adis_update_scan_mode NULL
266
267#endif /* CONFIG_IIO_BUFFER */
268
269#ifdef CONFIG_DEBUG_FS
270
271int adis_debugfs_reg_access(struct iio_dev *indio_dev,
272 unsigned int reg, unsigned int writeval, unsigned int *readval);
273
274#else
275
276#define adis_debugfs_reg_access NULL
277
278#endif
279
280#endif
diff --git a/include/linux/iio/machine.h b/include/linux/iio/machine.h
index 809a3f08d5a5..1601a2a63a72 100644
--- a/include/linux/iio/machine.h
+++ b/include/linux/iio/machine.h
@@ -19,11 +19,13 @@
19 * @consumer_dev_name: Name to uniquely identify the consumer device. 19 * @consumer_dev_name: Name to uniquely identify the consumer device.
20 * @consumer_channel: Unique name used to identify the channel on the 20 * @consumer_channel: Unique name used to identify the channel on the
21 * consumer side. 21 * consumer side.
22 * @consumer_data: Data about the channel for use by the consumer driver.
22 */ 23 */
23struct iio_map { 24struct iio_map {
24 const char *adc_channel_label; 25 const char *adc_channel_label;
25 const char *consumer_dev_name; 26 const char *consumer_dev_name;
26 const char *consumer_channel; 27 const char *consumer_channel;
28 void *consumer_data;
27}; 29};
28 30
29#endif 31#endif
diff --git a/include/linux/iio/types.h b/include/linux/iio/types.h
index 5c647ecfd5ba..88bf0f0d27b4 100644
--- a/include/linux/iio/types.h
+++ b/include/linux/iio/types.h
@@ -28,6 +28,7 @@ enum iio_chan_type {
28 IIO_CAPACITANCE, 28 IIO_CAPACITANCE,
29 IIO_ALTVOLTAGE, 29 IIO_ALTVOLTAGE,
30 IIO_CCT, 30 IIO_CCT,
31 IIO_PRESSURE,
31}; 32};
32 33
33enum iio_modifier { 34enum iio_modifier {
@@ -58,5 +59,6 @@ enum iio_modifier {
58#define IIO_VAL_INT_PLUS_NANO 3 59#define IIO_VAL_INT_PLUS_NANO 3
59#define IIO_VAL_INT_PLUS_MICRO_DB 4 60#define IIO_VAL_INT_PLUS_MICRO_DB 4
60#define IIO_VAL_FRACTIONAL 10 61#define IIO_VAL_FRACTIONAL 10
62#define IIO_VAL_FRACTIONAL_LOG2 11
61 63
62#endif /* _IIO_TYPES_H_ */ 64#endif /* _IIO_TYPES_H_ */
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index d032780d0ce5..a9d828976a77 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -171,6 +171,9 @@ struct in_ifaddr {
171extern int register_inetaddr_notifier(struct notifier_block *nb); 171extern int register_inetaddr_notifier(struct notifier_block *nb);
172extern int unregister_inetaddr_notifier(struct notifier_block *nb); 172extern int unregister_inetaddr_notifier(struct notifier_block *nb);
173 173
174extern void inet_netconf_notify_devconf(struct net *net, int type, int ifindex,
175 struct ipv4_devconf *devconf);
176
174extern struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref); 177extern struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref);
175static inline struct net_device *ip_dev_find(struct net *net, __be32 addr) 178static inline struct net_device *ip_dev_find(struct net *net, __be32 addr)
176{ 179{
diff --git a/include/linux/init.h b/include/linux/init.h
index e59041e21df3..f63692d6902e 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -93,13 +93,13 @@
93 93
94#define __exit __section(.exit.text) __exitused __cold notrace 94#define __exit __section(.exit.text) __exitused __cold notrace
95 95
96/* Used for HOTPLUG */ 96/* Used for HOTPLUG, but that is always enabled now, so just make them noops */
97#define __devinit __section(.devinit.text) __cold notrace 97#define __devinit
98#define __devinitdata __section(.devinit.data) 98#define __devinitdata
99#define __devinitconst __constsection(.devinit.rodata) 99#define __devinitconst
100#define __devexit __section(.devexit.text) __exitused __cold notrace 100#define __devexit
101#define __devexitdata __section(.devexit.data) 101#define __devexitdata
102#define __devexitconst __constsection(.devexit.rodata) 102#define __devexitconst
103 103
104/* Used for HOTPLUG_CPU */ 104/* Used for HOTPLUG_CPU */
105#define __cpuinit __section(.cpuinit.text) __cold notrace 105#define __cpuinit __section(.cpuinit.text) __cold notrace
@@ -126,10 +126,6 @@
126#define __INITRODATA .section ".init.rodata","a",%progbits 126#define __INITRODATA .section ".init.rodata","a",%progbits
127#define __FINITDATA .previous 127#define __FINITDATA .previous
128 128
129#define __DEVINIT .section ".devinit.text", "ax"
130#define __DEVINITDATA .section ".devinit.data", "aw"
131#define __DEVINITRODATA .section ".devinit.rodata", "a"
132
133#define __CPUINIT .section ".cpuinit.text", "ax" 129#define __CPUINIT .section ".cpuinit.text", "ax"
134#define __CPUINITDATA .section ".cpuinit.data", "aw" 130#define __CPUINITDATA .section ".cpuinit.data", "aw"
135#define __CPUINITRODATA .section ".cpuinit.rodata", "a" 131#define __CPUINITRODATA .section ".cpuinit.rodata", "a"
diff --git a/include/linux/input/mt.h b/include/linux/input/mt.h
index cc5cca774bab..2e86bd0bfba1 100644
--- a/include/linux/input/mt.h
+++ b/include/linux/input/mt.h
@@ -69,6 +69,12 @@ static inline bool input_mt_is_active(const struct input_mt_slot *slot)
69 return input_mt_get_value(slot, ABS_MT_TRACKING_ID) >= 0; 69 return input_mt_get_value(slot, ABS_MT_TRACKING_ID) >= 0;
70} 70}
71 71
72static inline bool input_mt_is_used(const struct input_mt *mt,
73 const struct input_mt_slot *slot)
74{
75 return slot->frame == mt->frame;
76}
77
72int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots, 78int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots,
73 unsigned int flags); 79 unsigned int flags);
74void input_mt_destroy_slots(struct input_dev *dev); 80void input_mt_destroy_slots(struct input_dev *dev);
diff --git a/include/linux/ip.h b/include/linux/ip.h
index 58b82a22a52b..492bc6513533 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -25,6 +25,11 @@ static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
25 return (struct iphdr *)skb_network_header(skb); 25 return (struct iphdr *)skb_network_header(skb);
26} 26}
27 27
28static inline struct iphdr *inner_ip_hdr(const struct sk_buff *skb)
29{
30 return (struct iphdr *)skb_inner_network_header(skb);
31}
32
28static inline struct iphdr *ipip_hdr(const struct sk_buff *skb) 33static inline struct iphdr *ipip_hdr(const struct sk_buff *skb)
29{ 34{
30 return (struct iphdr *)skb_transport_header(skb); 35 return (struct iphdr *)skb_transport_header(skb);
diff --git a/include/linux/ipack.h b/include/linux/ipack.h
new file mode 100644
index 000000000000..fea12cbb2aeb
--- /dev/null
+++ b/include/linux/ipack.h
@@ -0,0 +1,245 @@
1/*
2 * Industry-pack bus.
3 *
4 * Copyright (C) 2011-2012 CERN (www.cern.ch)
5 * Author: Samuel Iglesias Gonsalvez <siglesias@igalia.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 Free
9 * Software Foundation; version 2 of the License.
10 */
11
12#include <linux/mod_devicetable.h>
13#include <linux/device.h>
14#include <linux/interrupt.h>
15
16#define IPACK_IDPROM_OFFSET_I 0x01
17#define IPACK_IDPROM_OFFSET_P 0x03
18#define IPACK_IDPROM_OFFSET_A 0x05
19#define IPACK_IDPROM_OFFSET_C 0x07
20#define IPACK_IDPROM_OFFSET_MANUFACTURER_ID 0x09
21#define IPACK_IDPROM_OFFSET_MODEL 0x0B
22#define IPACK_IDPROM_OFFSET_REVISION 0x0D
23#define IPACK_IDPROM_OFFSET_RESERVED 0x0F
24#define IPACK_IDPROM_OFFSET_DRIVER_ID_L 0x11
25#define IPACK_IDPROM_OFFSET_DRIVER_ID_H 0x13
26#define IPACK_IDPROM_OFFSET_NUM_BYTES 0x15
27#define IPACK_IDPROM_OFFSET_CRC 0x17
28
29/*
30 * IndustryPack Fromat, Vendor and Device IDs.
31 */
32
33/* ID section format versions */
34#define IPACK_ID_VERSION_INVALID 0x00
35#define IPACK_ID_VERSION_1 0x01
36#define IPACK_ID_VERSION_2 0x02
37
38/* Vendors and devices. Sort key: vendor first, device next. */
39#define IPACK1_VENDOR_ID_RESERVED1 0x00
40#define IPACK1_VENDOR_ID_RESERVED2 0xFF
41#define IPACK1_VENDOR_ID_UNREGISTRED01 0x01
42#define IPACK1_VENDOR_ID_UNREGISTRED02 0x02
43#define IPACK1_VENDOR_ID_UNREGISTRED03 0x03
44#define IPACK1_VENDOR_ID_UNREGISTRED04 0x04
45#define IPACK1_VENDOR_ID_UNREGISTRED05 0x05
46#define IPACK1_VENDOR_ID_UNREGISTRED06 0x06
47#define IPACK1_VENDOR_ID_UNREGISTRED07 0x07
48#define IPACK1_VENDOR_ID_UNREGISTRED08 0x08
49#define IPACK1_VENDOR_ID_UNREGISTRED09 0x09
50#define IPACK1_VENDOR_ID_UNREGISTRED10 0x0A
51#define IPACK1_VENDOR_ID_UNREGISTRED11 0x0B
52#define IPACK1_VENDOR_ID_UNREGISTRED12 0x0C
53#define IPACK1_VENDOR_ID_UNREGISTRED13 0x0D
54#define IPACK1_VENDOR_ID_UNREGISTRED14 0x0E
55#define IPACK1_VENDOR_ID_UNREGISTRED15 0x0F
56
57#define IPACK1_VENDOR_ID_SBS 0xF0
58#define IPACK1_DEVICE_ID_SBS_OCTAL_232 0x22
59#define IPACK1_DEVICE_ID_SBS_OCTAL_422 0x2A
60#define IPACK1_DEVICE_ID_SBS_OCTAL_485 0x48
61
62struct ipack_bus_ops;
63struct ipack_driver;
64
65enum ipack_space {
66 IPACK_IO_SPACE = 0,
67 IPACK_ID_SPACE,
68 IPACK_INT_SPACE,
69 IPACK_MEM8_SPACE,
70 IPACK_MEM16_SPACE,
71 /* Dummy for counting the number of entries. Must remain the last
72 * entry */
73 IPACK_SPACE_COUNT,
74};
75
76/**
77 */
78struct ipack_region {
79 phys_addr_t start;
80 size_t size;
81};
82
83/**
84 * struct ipack_device
85 *
86 * @slot: Slot where the device is plugged in the carrier board
87 * @bus: ipack_bus_device where the device is plugged to.
88 * @id_space: Virtual address to ID space.
89 * @io_space: Virtual address to IO space.
90 * @mem_space: Virtual address to MEM space.
91 * @dev: device in kernel representation.
92 *
93 * Warning: Direct access to mapped memory is possible but the endianness
94 * is not the same with PCI carrier or VME carrier. The endianness is managed
95 * by the carrier board throught bus->ops.
96 */
97struct ipack_device {
98 unsigned int slot;
99 struct ipack_bus_device *bus;
100 struct device dev;
101 void (*release) (struct ipack_device *dev);
102 struct ipack_region region[IPACK_SPACE_COUNT];
103 u8 *id;
104 size_t id_avail;
105 u32 id_vendor;
106 u32 id_device;
107 u8 id_format;
108 unsigned int id_crc_correct:1;
109 unsigned int speed_8mhz:1;
110 unsigned int speed_32mhz:1;
111};
112
113/**
114 * struct ipack_driver_ops -- Callbacks to IPack device driver
115 *
116 * @probe: Probe function
117 * @remove: Prepare imminent removal of the device. Services provided by the
118 * device should be revoked.
119 */
120
121struct ipack_driver_ops {
122 int (*probe) (struct ipack_device *dev);
123 void (*remove) (struct ipack_device *dev);
124};
125
126/**
127 * struct ipack_driver -- Specific data to each ipack device driver
128 *
129 * @driver: Device driver kernel representation
130 * @ops: Callbacks provided by the IPack device driver
131 */
132struct ipack_driver {
133 struct device_driver driver;
134 const struct ipack_device_id *id_table;
135 const struct ipack_driver_ops *ops;
136};
137
138/**
139 * struct ipack_bus_ops - available operations on a bridge module
140 *
141 * @map_space: map IP address space
142 * @unmap_space: unmap IP address space
143 * @request_irq: request IRQ
144 * @free_irq: free IRQ
145 * @get_clockrate: Returns the clockrate the carrier is currently
146 * communicating with the device at.
147 * @set_clockrate: Sets the clock-rate for carrier / module communication.
148 * Should return -EINVAL if the requested speed is not supported.
149 * @get_error: Returns the error state for the slot the device is attached
150 * to.
151 * @get_timeout: Returns 1 if the communication with the device has
152 * previously timed out.
153 * @reset_timeout: Resets the state returned by get_timeout.
154 */
155struct ipack_bus_ops {
156 int (*request_irq) (struct ipack_device *dev,
157 irqreturn_t (*handler)(void *), void *arg);
158 int (*free_irq) (struct ipack_device *dev);
159 int (*get_clockrate) (struct ipack_device *dev);
160 int (*set_clockrate) (struct ipack_device *dev, int mherz);
161 int (*get_error) (struct ipack_device *dev);
162 int (*get_timeout) (struct ipack_device *dev);
163 int (*reset_timeout) (struct ipack_device *dev);
164};
165
166/**
167 * struct ipack_bus_device
168 *
169 * @dev: pointer to carrier device
170 * @slots: number of slots available
171 * @bus_nr: ipack bus number
172 * @ops: bus operations for the mezzanine drivers
173 */
174struct ipack_bus_device {
175 struct device *parent;
176 int slots;
177 int bus_nr;
178 const struct ipack_bus_ops *ops;
179};
180
181/**
182 * ipack_bus_register -- register a new ipack bus
183 *
184 * @parent: pointer to the parent device, if any.
185 * @slots: number of slots available in the bus device.
186 * @ops: bus operations for the mezzanine drivers.
187 *
188 * The carrier board device should call this function to register itself as
189 * available bus device in ipack.
190 */
191struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots,
192 const struct ipack_bus_ops *ops);
193
194/**
195 * ipack_bus_unregister -- unregister an ipack bus
196 */
197int ipack_bus_unregister(struct ipack_bus_device *bus);
198
199/**
200 * ipack_driver_register -- Register a new ipack device driver
201 *
202 * Called by a ipack driver to register itself as a driver
203 * that can manage ipack devices.
204 */
205int ipack_driver_register(struct ipack_driver *edrv, struct module *owner,
206 const char *name);
207void ipack_driver_unregister(struct ipack_driver *edrv);
208
209/**
210 * ipack_device_register -- register an IPack device with the kernel
211 * @dev: the new device to register.
212 *
213 * Register a new IPack device ("module" in IndustryPack jargon). The call
214 * is done by the carrier driver. The carrier should populate the fields
215 * bus and slot as well as the region array of @dev prior to calling this
216 * function. The rest of the fields will be allocated and populated
217 * during registration.
218 *
219 * Return zero on success or error code on failure.
220 */
221int ipack_device_register(struct ipack_device *dev);
222void ipack_device_unregister(struct ipack_device *dev);
223
224/**
225 * DEFINE_IPACK_DEVICE_TABLE - macro used to describe a IndustryPack table
226 * @_table: device table name
227 *
228 * This macro is used to create a struct ipack_device_id array (a device table)
229 * in a generic manner.
230 */
231#define DEFINE_IPACK_DEVICE_TABLE(_table) \
232 const struct ipack_device_id _table[]
233/**
234 * IPACK_DEVICE - macro used to describe a specific IndustryPack device
235 * @_format: the format version (currently either 1 or 2, 8 bit value)
236 * @vend: the 8 or 24 bit IndustryPack Vendor ID
237 * @dev: the 8 or 16 bit IndustryPack Device ID
238 *
239 * This macro is used to create a struct ipack_device_id that matches a specific
240 * device.
241 */
242#define IPACK_DEVICE(_format, vend, dev) \
243 .format = (_format), \
244 .vendor = (vend), \
245 .device = (dev)
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h
index fcb5d44ea635..8ea3fe0b9759 100644
--- a/include/linux/ipmi_smi.h
+++ b/include/linux/ipmi_smi.h
@@ -216,7 +216,7 @@ int ipmi_unregister_smi(ipmi_smi_t intf);
216 216
217/* 217/*
218 * The lower layer reports received messages through this interface. 218 * The lower layer reports received messages through this interface.
219 * The data_size should be zero if this is an asyncronous message. If 219 * The data_size should be zero if this is an asynchronous message. If
220 * the lower layer gets an error sending a message, it should format 220 * the lower layer gets an error sending a message, it should format
221 * an error response in the message response. 221 * an error response in the message response.
222 */ 222 */
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index bcba48a97868..faed1e357dd6 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -47,6 +47,7 @@ struct ipv6_devconf {
47 __s32 disable_ipv6; 47 __s32 disable_ipv6;
48 __s32 accept_dad; 48 __s32 accept_dad;
49 __s32 force_tllao; 49 __s32 force_tllao;
50 __s32 ndisc_notify;
50 void *sysctl; 51 void *sysctl;
51}; 52};
52 53
@@ -66,6 +67,11 @@ static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb)
66 return (struct ipv6hdr *)skb_network_header(skb); 67 return (struct ipv6hdr *)skb_network_header(skb);
67} 68}
68 69
70static inline struct ipv6hdr *inner_ipv6_hdr(const struct sk_buff *skb)
71{
72 return (struct ipv6hdr *)skb_inner_network_header(skb);
73}
74
69static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb) 75static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb)
70{ 76{
71 return (struct ipv6hdr *)skb_transport_header(skb); 77 return (struct ipv6hdr *)skb_transport_header(skb);
@@ -363,20 +369,22 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk)
363#define inet_v6_ipv6only(__sk) 0 369#define inet_v6_ipv6only(__sk) 0
364#endif /* IS_ENABLED(CONFIG_IPV6) */ 370#endif /* IS_ENABLED(CONFIG_IPV6) */
365 371
366#define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ 372#define INET6_MATCH(__sk, __net, __saddr, __daddr, __ports, __dif) \
367 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ 373 ((inet_sk(__sk)->inet_portpair == (__ports)) && \
368 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ 374 ((__sk)->sk_family == AF_INET6) && \
369 ((__sk)->sk_family == AF_INET6) && \ 375 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \
370 ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ 376 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \
371 ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ 377 (!(__sk)->sk_bound_dev_if || \
372 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 378 ((__sk)->sk_bound_dev_if == (__dif))) && \
373 379 net_eq(sock_net(__sk), (__net)))
374#define INET6_TW_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif) \ 380
375 (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ 381#define INET6_TW_MATCH(__sk, __net, __saddr, __daddr, __ports, __dif) \
376 (*((__portpair *)&(inet_twsk(__sk)->tw_dport)) == (__ports)) && \ 382 ((inet_twsk(__sk)->tw_portpair == (__ports)) && \
377 ((__sk)->sk_family == PF_INET6) && \ 383 ((__sk)->sk_family == AF_INET6) && \
378 (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr))) && \ 384 ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr)) && \
379 (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr))) && \ 385 ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_rcv_saddr, (__daddr)) && \
380 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 386 (!(__sk)->sk_bound_dev_if || \
387 ((__sk)->sk_bound_dev_if == (__dif))) && \
388 net_eq(sock_net(__sk), (__net)))
381 389
382#endif /* _IPV6_H */ 390#endif /* _IPV6_H */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 216b0ba109d7..fdf2c4a238cc 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -10,9 +10,6 @@
10 */ 10 */
11 11
12#include <linux/smp.h> 12#include <linux/smp.h>
13
14#ifndef CONFIG_S390
15
16#include <linux/linkage.h> 13#include <linux/linkage.h>
17#include <linux/cache.h> 14#include <linux/cache.h>
18#include <linux/spinlock.h> 15#include <linux/spinlock.h>
@@ -392,6 +389,15 @@ static inline void irq_move_masked_irq(struct irq_data *data) { }
392 389
393extern int no_irq_affinity; 390extern int no_irq_affinity;
394 391
392#ifdef CONFIG_HARDIRQS_SW_RESEND
393int irq_set_parent(int irq, int parent_irq);
394#else
395static inline int irq_set_parent(int irq, int parent_irq)
396{
397 return 0;
398}
399#endif
400
395/* 401/*
396 * Built-in IRQ handlers for various IRQ types, 402 * Built-in IRQ handlers for various IRQ types,
397 * callable via desc->handle_irq() 403 * callable via desc->handle_irq()
@@ -737,8 +743,11 @@ static inline void irq_gc_lock(struct irq_chip_generic *gc) { }
737static inline void irq_gc_unlock(struct irq_chip_generic *gc) { } 743static inline void irq_gc_unlock(struct irq_chip_generic *gc) { }
738#endif 744#endif
739 745
740#endif /* CONFIG_GENERIC_HARDIRQS */ 746#else /* !CONFIG_GENERIC_HARDIRQS */
741 747
742#endif /* !CONFIG_S390 */ 748extern struct msi_desc *irq_get_msi_desc(unsigned int irq);
749extern int irq_set_msi_desc(unsigned int irq, struct msi_desc *entry);
750
751#endif /* CONFIG_GENERIC_HARDIRQS */
743 752
744#endif /* _LINUX_IRQ_H */ 753#endif /* _LINUX_IRQ_H */
diff --git a/include/linux/irqchip/spear-shirq.h b/include/linux/irqchip/spear-shirq.h
new file mode 100644
index 000000000000..c8be16d213a3
--- /dev/null
+++ b/include/linux/irqchip/spear-shirq.h
@@ -0,0 +1,64 @@
1/*
2 * SPEAr platform shared irq layer header file
3 *
4 * Copyright (C) 2009-2012 ST Microelectronics
5 * Viresh Kumar <viresh.linux@gmail.com>
6 *
7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any
9 * warranty of any kind, whether express or implied.
10 */
11
12#ifndef __SPEAR_SHIRQ_H
13#define __SPEAR_SHIRQ_H
14
15#include <linux/irq.h>
16#include <linux/types.h>
17
18/*
19 * struct shirq_regs: shared irq register configuration
20 *
21 * enb_reg: enable register offset
22 * reset_to_enb: val 1 indicates, we need to clear bit for enabling interrupt
23 * status_reg: status register offset
24 * status_reg_mask: status register valid mask
25 * clear_reg: clear register offset
26 * reset_to_clear: val 1 indicates, we need to clear bit for clearing interrupt
27 */
28struct shirq_regs {
29 u32 enb_reg;
30 u32 reset_to_enb;
31 u32 status_reg;
32 u32 clear_reg;
33 u32 reset_to_clear;
34};
35
36/*
37 * struct spear_shirq: shared irq structure
38 *
39 * irq: hardware irq number
40 * irq_base: base irq in linux domain
41 * irq_nr: no. of shared interrupts in a particular block
42 * irq_bit_off: starting bit offset in the status register
43 * invalid_irq: irq group is currently disabled
44 * base: base address of shared irq register
45 * regs: register configuration for shared irq block
46 */
47struct spear_shirq {
48 u32 irq;
49 u32 irq_base;
50 u32 irq_nr;
51 u32 irq_bit_off;
52 int invalid_irq;
53 void __iomem *base;
54 struct shirq_regs regs;
55};
56
57int __init spear300_shirq_of_init(struct device_node *np,
58 struct device_node *parent);
59int __init spear310_shirq_of_init(struct device_node *np,
60 struct device_node *parent);
61int __init spear320_shirq_of_init(struct device_node *np,
62 struct device_node *parent);
63
64#endif /* __SPEAR_SHIRQ_H */
diff --git a/include/linux/irqchip/sunxi.h b/include/linux/irqchip/sunxi.h
new file mode 100644
index 000000000000..1fe2c2260e2b
--- /dev/null
+++ b/include/linux/irqchip/sunxi.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright 2012 Maxime Ripard
3 *
4 * Maxime Ripard <maxime.ripard@free-electrons.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 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __LINUX_IRQCHIP_SUNXI_H
18#define __LINUX_IRQCHIP_SUNXI_H
19
20#include <asm/exception.h>
21
22extern void sunxi_init_irq(void);
23
24extern asmlinkage void __exception_irq_entry sunxi_handle_irq(
25 struct pt_regs *regs);
26
27#endif
diff --git a/include/linux/irqchip/versatile-fpga.h b/include/linux/irqchip/versatile-fpga.h
new file mode 100644
index 000000000000..1fac9651d3ca
--- /dev/null
+++ b/include/linux/irqchip/versatile-fpga.h
@@ -0,0 +1,13 @@
1#ifndef PLAT_FPGA_IRQ_H
2#define PLAT_FPGA_IRQ_H
3
4struct device_node;
5struct pt_regs;
6
7void fpga_handle_irq(struct pt_regs *regs);
8void fpga_irq_init(void __iomem *, const char *, int, int, u32,
9 struct device_node *node);
10int fpga_irq_of_init(struct device_node *node,
11 struct device_node *parent);
12
13#endif
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 0ba014c55056..623325e2ff97 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -11,6 +11,8 @@
11struct irq_affinity_notify; 11struct irq_affinity_notify;
12struct proc_dir_entry; 12struct proc_dir_entry;
13struct module; 13struct module;
14struct irq_desc;
15
14/** 16/**
15 * struct irq_desc - interrupt descriptor 17 * struct irq_desc - interrupt descriptor
16 * @irq_data: per irq and chip data passed down to chip functions 18 * @irq_data: per irq and chip data passed down to chip functions
@@ -65,6 +67,7 @@ struct irq_desc {
65#ifdef CONFIG_PROC_FS 67#ifdef CONFIG_PROC_FS
66 struct proc_dir_entry *dir; 68 struct proc_dir_entry *dir;
67#endif 69#endif
70 int parent_irq;
68 struct module *owner; 71 struct module *owner;
69 const char *name; 72 const char *name;
70} ____cacheline_internodealigned_in_smp; 73} ____cacheline_internodealigned_in_smp;
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index 6b87413da9d6..82ed068b1ebe 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -70,11 +70,12 @@ extern int register_refined_jiffies(long clock_tick_rate);
70 70
71/* 71/*
72 * The 64-bit value is not atomic - you MUST NOT read it 72 * The 64-bit value is not atomic - you MUST NOT read it
73 * without sampling the sequence number in xtime_lock. 73 * without sampling the sequence number in jiffies_lock.
74 * get_jiffies_64() will do this for you as appropriate. 74 * get_jiffies_64() will do this for you as appropriate.
75 */ 75 */
76extern u64 __jiffy_data jiffies_64; 76extern u64 __jiffy_data jiffies_64;
77extern unsigned long volatile __jiffy_data jiffies; 77extern unsigned long volatile __jiffy_data jiffies;
78extern seqlock_t jiffies_lock;
78 79
79#if (BITS_PER_LONG < 64) 80#if (BITS_PER_LONG < 64)
80u64 get_jiffies_64(void); 81u64 get_jiffies_64(void);
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index a123b13b70fd..d97ed5897447 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -527,9 +527,6 @@ __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
527 527
528extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode); 528extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
529#else 529#else
530static inline __printf(1, 2)
531int trace_printk(const char *fmt, ...);
532
533static inline void tracing_start(void) { } 530static inline void tracing_start(void) { }
534static inline void tracing_stop(void) { } 531static inline void tracing_stop(void) { }
535static inline void ftrace_off_permanent(void) { } 532static inline void ftrace_off_permanent(void) { }
@@ -539,8 +536,8 @@ static inline void tracing_on(void) { }
539static inline void tracing_off(void) { } 536static inline void tracing_off(void) { }
540static inline int tracing_is_on(void) { return 0; } 537static inline int tracing_is_on(void) { return 0; }
541 538
542static inline int 539static inline __printf(1, 2)
543trace_printk(const char *fmt, ...) 540int trace_printk(const char *fmt, ...)
544{ 541{
545 return 0; 542 return 0;
546} 543}
@@ -687,18 +684,11 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
687/* Trap pasters of __FUNCTION__ at compile-time */ 684/* Trap pasters of __FUNCTION__ at compile-time */
688#define __FUNCTION__ (__func__) 685#define __FUNCTION__ (__func__)
689 686
690/* This helps us to avoid #ifdef CONFIG_NUMA */ 687/* This helps us to avoid #ifdef CONFIG_SYMBOL_PREFIX */
691#ifdef CONFIG_NUMA 688#ifdef CONFIG_SYMBOL_PREFIX
692#define NUMA_BUILD 1 689#define SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
693#else
694#define NUMA_BUILD 0
695#endif
696
697/* This helps us avoid #ifdef CONFIG_COMPACTION */
698#ifdef CONFIG_COMPACTION
699#define COMPACTION_BUILD 1
700#else 690#else
701#define COMPACTION_BUILD 0 691#define SYMBOL_PREFIX ""
702#endif 692#endif
703 693
704/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */ 694/* Rebuild everything on CONFIG_FTRACE_MCOUNT_RECORD */
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h
index 36d12f0884c3..66b70780e910 100644
--- a/include/linux/kernel_stat.h
+++ b/include/linux/kernel_stat.h
@@ -7,6 +7,7 @@
7#include <linux/cpumask.h> 7#include <linux/cpumask.h>
8#include <linux/interrupt.h> 8#include <linux/interrupt.h>
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/vtime.h>
10#include <asm/irq.h> 11#include <asm/irq.h>
11#include <asm/cputime.h> 12#include <asm/cputime.h>
12 13
@@ -126,16 +127,16 @@ extern void account_system_time(struct task_struct *, int, cputime_t, cputime_t)
126extern void account_steal_time(cputime_t); 127extern void account_steal_time(cputime_t);
127extern void account_idle_time(cputime_t); 128extern void account_idle_time(cputime_t);
128 129
129extern void account_process_tick(struct task_struct *, int user);
130extern void account_steal_ticks(unsigned long ticks);
131extern void account_idle_ticks(unsigned long ticks);
132
133#ifdef CONFIG_VIRT_CPU_ACCOUNTING 130#ifdef CONFIG_VIRT_CPU_ACCOUNTING
134extern void vtime_task_switch(struct task_struct *prev); 131static inline void account_process_tick(struct task_struct *tsk, int user)
135extern void vtime_account_system(struct task_struct *tsk); 132{
136extern void vtime_account_idle(struct task_struct *tsk); 133 vtime_account_user(tsk);
134}
137#else 135#else
138static inline void vtime_task_switch(struct task_struct *prev) { } 136extern void account_process_tick(struct task_struct *, int user);
139#endif 137#endif
140 138
139extern void account_steal_ticks(unsigned long ticks);
140extern void account_idle_ticks(unsigned long ticks);
141
141#endif /* _LINUX_KERNEL_STAT_H */ 142#endif /* _LINUX_KERNEL_STAT_H */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 1e57449395b1..939b11268c86 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -203,7 +203,6 @@ extern struct kobject *power_kobj;
203/* The global /sys/firmware/ kobject for people to chain off of */ 203/* The global /sys/firmware/ kobject for people to chain off of */
204extern struct kobject *firmware_kobj; 204extern struct kobject *firmware_kobj;
205 205
206#if defined(CONFIG_HOTPLUG)
207int kobject_uevent(struct kobject *kobj, enum kobject_action action); 206int kobject_uevent(struct kobject *kobj, enum kobject_action action);
208int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, 207int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
209 char *envp[]); 208 char *envp[]);
@@ -213,22 +212,5 @@ int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...);
213 212
214int kobject_action_type(const char *buf, size_t count, 213int kobject_action_type(const char *buf, size_t count,
215 enum kobject_action *type); 214 enum kobject_action *type);
216#else
217static inline int kobject_uevent(struct kobject *kobj,
218 enum kobject_action action)
219{ return 0; }
220static inline int kobject_uevent_env(struct kobject *kobj,
221 enum kobject_action action,
222 char *envp[])
223{ return 0; }
224
225static inline __printf(2, 3)
226int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
227{ return -ENOMEM; }
228
229static inline int kobject_action_type(const char *buf, size_t count,
230 enum kobject_action *type)
231{ return -EINVAL; }
232#endif
233 215
234#endif /* _KOBJECT_H_ */ 216#endif /* _KOBJECT_H_ */
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 06177ba10a16..e83512f63df5 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -282,6 +282,25 @@ static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2)
282 return cmp1.tv64 == cmp2.tv64; 282 return cmp1.tv64 == cmp2.tv64;
283} 283}
284 284
285/**
286 * ktime_compare - Compares two ktime_t variables for less, greater or equal
287 * @cmp1: comparable1
288 * @cmp2: comparable2
289 *
290 * Returns ...
291 * cmp1 < cmp2: return <0
292 * cmp1 == cmp2: return 0
293 * cmp1 > cmp2: return >0
294 */
295static inline int ktime_compare(const ktime_t cmp1, const ktime_t cmp2)
296{
297 if (cmp1.tv64 < cmp2.tv64)
298 return -1;
299 if (cmp1.tv64 > cmp2.tv64)
300 return 1;
301 return 0;
302}
303
285static inline s64 ktime_to_us(const ktime_t kt) 304static inline s64 ktime_to_us(const ktime_t kt)
286{ 305{
287 struct timeval tv = ktime_to_timeval(kt); 306 struct timeval tv = ktime_to_timeval(kt);
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index ecc554374e44..2c497ab0d03d 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -47,28 +47,40 @@
47 47
48/* 48/*
49 * For the normal pfn, the highest 12 bits should be zero, 49 * For the normal pfn, the highest 12 bits should be zero,
50 * so we can mask these bits to indicate the error. 50 * so we can mask bit 62 ~ bit 52 to indicate the error pfn,
51 * mask bit 63 to indicate the noslot pfn.
51 */ 52 */
52#define KVM_PFN_ERR_MASK (0xfffULL << 52) 53#define KVM_PFN_ERR_MASK (0x7ffULL << 52)
54#define KVM_PFN_ERR_NOSLOT_MASK (0xfffULL << 52)
55#define KVM_PFN_NOSLOT (0x1ULL << 63)
53 56
54#define KVM_PFN_ERR_FAULT (KVM_PFN_ERR_MASK) 57#define KVM_PFN_ERR_FAULT (KVM_PFN_ERR_MASK)
55#define KVM_PFN_ERR_HWPOISON (KVM_PFN_ERR_MASK + 1) 58#define KVM_PFN_ERR_HWPOISON (KVM_PFN_ERR_MASK + 1)
56#define KVM_PFN_ERR_BAD (KVM_PFN_ERR_MASK + 2) 59#define KVM_PFN_ERR_RO_FAULT (KVM_PFN_ERR_MASK + 2)
57#define KVM_PFN_ERR_RO_FAULT (KVM_PFN_ERR_MASK + 3)
58 60
61/*
62 * error pfns indicate that the gfn is in slot but faild to
63 * translate it to pfn on host.
64 */
59static inline bool is_error_pfn(pfn_t pfn) 65static inline bool is_error_pfn(pfn_t pfn)
60{ 66{
61 return !!(pfn & KVM_PFN_ERR_MASK); 67 return !!(pfn & KVM_PFN_ERR_MASK);
62} 68}
63 69
64static inline bool is_noslot_pfn(pfn_t pfn) 70/*
71 * error_noslot pfns indicate that the gfn can not be
72 * translated to pfn - it is not in slot or failed to
73 * translate it to pfn.
74 */
75static inline bool is_error_noslot_pfn(pfn_t pfn)
65{ 76{
66 return pfn == KVM_PFN_ERR_BAD; 77 return !!(pfn & KVM_PFN_ERR_NOSLOT_MASK);
67} 78}
68 79
69static inline bool is_invalid_pfn(pfn_t pfn) 80/* noslot pfn indicates that the gfn is not in slot. */
81static inline bool is_noslot_pfn(pfn_t pfn)
70{ 82{
71 return !is_noslot_pfn(pfn) && is_error_pfn(pfn); 83 return pfn == KVM_PFN_NOSLOT;
72} 84}
73 85
74#define KVM_HVA_ERR_BAD (PAGE_OFFSET) 86#define KVM_HVA_ERR_BAD (PAGE_OFFSET)
@@ -107,6 +119,9 @@ static inline bool is_error_page(struct page *page)
107#define KVM_REQ_IMMEDIATE_EXIT 15 119#define KVM_REQ_IMMEDIATE_EXIT 15
108#define KVM_REQ_PMU 16 120#define KVM_REQ_PMU 16
109#define KVM_REQ_PMI 17 121#define KVM_REQ_PMI 17
122#define KVM_REQ_WATCHDOG 18
123#define KVM_REQ_MASTERCLOCK_UPDATE 19
124#define KVM_REQ_MCLOCK_INPROGRESS 20
110 125
111#define KVM_USERSPACE_IRQ_SOURCE_ID 0 126#define KVM_USERSPACE_IRQ_SOURCE_ID 0
112#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1 127#define KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID 1
@@ -516,6 +531,7 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu);
516 531
517void kvm_flush_remote_tlbs(struct kvm *kvm); 532void kvm_flush_remote_tlbs(struct kvm *kvm);
518void kvm_reload_remote_mmus(struct kvm *kvm); 533void kvm_reload_remote_mmus(struct kvm *kvm);
534void kvm_make_mclock_inprogress_request(struct kvm *kvm);
519 535
520long kvm_arch_dev_ioctl(struct file *filp, 536long kvm_arch_dev_ioctl(struct file *filp,
521 unsigned int ioctl, unsigned long arg); 537 unsigned int ioctl, unsigned long arg);
@@ -569,9 +585,9 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
569void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); 585void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu);
570struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id); 586struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, unsigned int id);
571int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu); 587int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu);
588int kvm_arch_vcpu_postcreate(struct kvm_vcpu *vcpu);
572void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu); 589void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu);
573 590
574int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu);
575int kvm_arch_hardware_enable(void *garbage); 591int kvm_arch_hardware_enable(void *garbage);
576void kvm_arch_hardware_disable(void *garbage); 592void kvm_arch_hardware_disable(void *garbage);
577int kvm_arch_hardware_setup(void); 593int kvm_arch_hardware_setup(void);
@@ -666,6 +682,7 @@ void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic,
666 unsigned long *deliver_bitmask); 682 unsigned long *deliver_bitmask);
667#endif 683#endif
668int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); 684int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level);
685int kvm_set_irq_inatomic(struct kvm *kvm, int irq_source_id, u32 irq, int level);
669int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, 686int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm,
670 int irq_source_id, int level); 687 int irq_source_id, int level);
671void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); 688void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin);
@@ -726,7 +743,11 @@ static inline int kvm_deassign_device(struct kvm *kvm,
726static inline void kvm_guest_enter(void) 743static inline void kvm_guest_enter(void)
727{ 744{
728 BUG_ON(preemptible()); 745 BUG_ON(preemptible());
729 vtime_account(current); 746 /*
747 * This is running in ioctl context so we can avoid
748 * the call to vtime_account() with its unnecessary idle check.
749 */
750 vtime_account_system_irqsafe(current);
730 current->flags |= PF_VCPU; 751 current->flags |= PF_VCPU;
731 /* KVM does not hold any references to rcu protected data when it 752 /* KVM does not hold any references to rcu protected data when it
732 * switches CPU into a guest mode. In fact switching to a guest mode 753 * switches CPU into a guest mode. In fact switching to a guest mode
@@ -740,7 +761,11 @@ static inline void kvm_guest_enter(void)
740 761
741static inline void kvm_guest_exit(void) 762static inline void kvm_guest_exit(void)
742{ 763{
743 vtime_account(current); 764 /*
765 * This is running in ioctl context so we can avoid
766 * the call to vtime_account() with its unnecessary idle check.
767 */
768 vtime_account_system_irqsafe(current);
744 current->flags &= ~PF_VCPU; 769 current->flags &= ~PF_VCPU;
745} 770}
746 771
@@ -830,9 +855,9 @@ extern struct kvm_stats_debugfs_item debugfs_entries[];
830extern struct dentry *kvm_debugfs_dir; 855extern struct dentry *kvm_debugfs_dir;
831 856
832#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER) 857#if defined(CONFIG_MMU_NOTIFIER) && defined(KVM_ARCH_WANT_MMU_NOTIFIER)
833static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq) 858static inline int mmu_notifier_retry(struct kvm *kvm, unsigned long mmu_seq)
834{ 859{
835 if (unlikely(vcpu->kvm->mmu_notifier_count)) 860 if (unlikely(kvm->mmu_notifier_count))
836 return 1; 861 return 1;
837 /* 862 /*
838 * Ensure the read of mmu_notifier_count happens before the read 863 * Ensure the read of mmu_notifier_count happens before the read
@@ -845,7 +870,7 @@ static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_se
845 * can't rely on kvm->mmu_lock to keep things ordered. 870 * can't rely on kvm->mmu_lock to keep things ordered.
846 */ 871 */
847 smp_rmb(); 872 smp_rmb();
848 if (vcpu->kvm->mmu_notifier_seq != mmu_seq) 873 if (kvm->mmu_notifier_seq != mmu_seq)
849 return 1; 874 return 1;
850 return 0; 875 return 0;
851} 876}
@@ -873,10 +898,20 @@ static inline void kvm_free_irq_routing(struct kvm *kvm) {}
873#ifdef CONFIG_HAVE_KVM_EVENTFD 898#ifdef CONFIG_HAVE_KVM_EVENTFD
874 899
875void kvm_eventfd_init(struct kvm *kvm); 900void kvm_eventfd_init(struct kvm *kvm);
901int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args);
902
903#ifdef CONFIG_HAVE_KVM_IRQCHIP
876int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args); 904int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args);
877void kvm_irqfd_release(struct kvm *kvm); 905void kvm_irqfd_release(struct kvm *kvm);
878void kvm_irq_routing_update(struct kvm *, struct kvm_irq_routing_table *); 906void kvm_irq_routing_update(struct kvm *, struct kvm_irq_routing_table *);
879int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); 907#else
908static inline int kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args)
909{
910 return -EINVAL;
911}
912
913static inline void kvm_irqfd_release(struct kvm *kvm) {}
914#endif
880 915
881#else 916#else
882 917
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 6e53bb31c220..0d9b5eed714e 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -179,6 +179,23 @@ extern void led_trigger_blink_oneshot(struct led_trigger *trigger,
179 unsigned long *delay_on, 179 unsigned long *delay_on,
180 unsigned long *delay_off, 180 unsigned long *delay_off,
181 int invert); 181 int invert);
182/**
183 * led_trigger_rename_static - rename a trigger
184 * @name: the new trigger name
185 * @trig: the LED trigger to rename
186 *
187 * Change a LED trigger name by copying the string passed in
188 * name into current trigger name, which MUST be large
189 * enough for the new string.
190 *
191 * Note that name must NOT point to the same string used
192 * during LED registration, as that could lead to races.
193 *
194 * This is meant to be used on triggers with statically
195 * allocated name.
196 */
197extern void led_trigger_rename_static(const char *name,
198 struct led_trigger *trig);
182 199
183#else 200#else
184 201
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 77eeeda2b6e2..83ba0ab2c915 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -163,6 +163,7 @@ enum {
163 163
164 ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */ 164 ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */
165 ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */ 165 ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */
166 ATA_DFLAG_ACPI_DISABLED = (1 << 28), /* ACPI for the device is disabled */
166 167
167 ATA_DEV_UNKNOWN = 0, /* unknown device */ 168 ATA_DEV_UNKNOWN = 0, /* unknown device */
168 ATA_DEV_ATA = 1, /* ATA device */ 169 ATA_DEV_ATA = 1, /* ATA device */
@@ -1114,6 +1115,10 @@ extern int ata_pci_device_resume(struct pci_dev *pdev);
1114#endif /* CONFIG_PM */ 1115#endif /* CONFIG_PM */
1115#endif /* CONFIG_PCI */ 1116#endif /* CONFIG_PCI */
1116 1117
1118struct platform_device;
1119
1120extern int ata_platform_remove_one(struct platform_device *pdev);
1121
1117/* 1122/*
1118 * ACPI - drivers/ata/libata-acpi.c 1123 * ACPI - drivers/ata/libata-acpi.c
1119 */ 1124 */
diff --git a/include/linux/lru_cache.h b/include/linux/lru_cache.h
index 7a71ffad037c..cafc7f99e124 100644
--- a/include/linux/lru_cache.h
+++ b/include/linux/lru_cache.h
@@ -52,8 +52,8 @@ We replicate IO (more or less synchronously) to local and remote disk.
52 52
53For crash recovery after replication node failure, 53For crash recovery after replication node failure,
54 we need to resync all regions that have been target of in-flight WRITE IO 54 we need to resync all regions that have been target of in-flight WRITE IO
55 (in use, or "hot", regions), as we don't know wether or not those WRITEs have 55 (in use, or "hot", regions), as we don't know whether or not those WRITEs
56 made it to stable storage. 56 have made it to stable storage.
57 57
58 To avoid a "full resync", we need to persistently track these regions. 58 To avoid a "full resync", we need to persistently track these regions.
59 59
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 11ddc7ffeba8..e98a74c0c9c0 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -181,7 +181,14 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
181 gfp_t gfp_mask, 181 gfp_t gfp_mask,
182 unsigned long *total_scanned); 182 unsigned long *total_scanned);
183 183
184void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx); 184void __mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx);
185static inline void mem_cgroup_count_vm_event(struct mm_struct *mm,
186 enum vm_event_item idx)
187{
188 if (mem_cgroup_disabled())
189 return;
190 __mem_cgroup_count_vm_event(mm, idx);
191}
185#ifdef CONFIG_TRANSPARENT_HUGEPAGE 192#ifdef CONFIG_TRANSPARENT_HUGEPAGE
186void mem_cgroup_split_huge_fixup(struct page *head); 193void mem_cgroup_split_huge_fixup(struct page *head);
187#endif 194#endif
diff --git a/include/linux/memory.h b/include/linux/memory.h
index ff9a9f8e0ed9..45e93b468878 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -53,6 +53,8 @@ int arch_get_memory_phys_device(unsigned long start_pfn);
53struct memory_notify { 53struct memory_notify {
54 unsigned long start_pfn; 54 unsigned long start_pfn;
55 unsigned long nr_pages; 55 unsigned long nr_pages;
56 int status_change_nid_normal;
57 int status_change_nid_high;
56 int status_change_nid; 58 int status_change_nid;
57}; 59};
58 60
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 95573ec4ee6c..4a45c4e50025 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -26,6 +26,13 @@ enum {
26 MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO, 26 MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO,
27}; 27};
28 28
29/* Types for control the zone type of onlined memory */
30enum {
31 ONLINE_KEEP,
32 ONLINE_KERNEL,
33 ONLINE_MOVABLE,
34};
35
29/* 36/*
30 * pgdat resizing functions 37 * pgdat resizing functions
31 */ 38 */
@@ -46,6 +53,10 @@ void pgdat_resize_init(struct pglist_data *pgdat)
46} 53}
47/* 54/*
48 * Zone resizing functions 55 * Zone resizing functions
56 *
57 * Note: any attempt to resize a zone should has pgdat_resize_lock()
58 * zone_span_writelock() both held. This ensure the size of a zone
59 * can't be changed while pgdat_resize_lock() held.
49 */ 60 */
50static inline unsigned zone_span_seqbegin(struct zone *zone) 61static inline unsigned zone_span_seqbegin(struct zone *zone)
51{ 62{
@@ -71,7 +82,7 @@ extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages);
71extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages); 82extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages);
72extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); 83extern int add_one_highpage(struct page *page, int pfn, int bad_ppro);
73/* VM interface that may be used by firmware interface */ 84/* VM interface that may be used by firmware interface */
74extern int online_pages(unsigned long, unsigned long); 85extern int online_pages(unsigned long, unsigned long, int);
75extern void __offline_isolated_pages(unsigned long, unsigned long); 86extern void __offline_isolated_pages(unsigned long, unsigned long);
76 87
77typedef void (*online_page_callback_t)(struct page *page); 88typedef void (*online_page_callback_t)(struct page *page);
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index c511e2523560..9adc270de7ef 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -82,16 +82,6 @@ static inline void mpol_cond_put(struct mempolicy *pol)
82 __mpol_put(pol); 82 __mpol_put(pol);
83} 83}
84 84
85extern struct mempolicy *__mpol_cond_copy(struct mempolicy *tompol,
86 struct mempolicy *frompol);
87static inline struct mempolicy *mpol_cond_copy(struct mempolicy *tompol,
88 struct mempolicy *frompol)
89{
90 if (!frompol)
91 return frompol;
92 return __mpol_cond_copy(tompol, frompol);
93}
94
95extern struct mempolicy *__mpol_dup(struct mempolicy *pol); 85extern struct mempolicy *__mpol_dup(struct mempolicy *pol);
96static inline struct mempolicy *mpol_dup(struct mempolicy *pol) 86static inline struct mempolicy *mpol_dup(struct mempolicy *pol)
97{ 87{
@@ -217,12 +207,6 @@ static inline void mpol_cond_put(struct mempolicy *pol)
217{ 207{
218} 208}
219 209
220static inline struct mempolicy *mpol_cond_copy(struct mempolicy *to,
221 struct mempolicy *from)
222{
223 return from;
224}
225
226static inline void mpol_get(struct mempolicy *pol) 210static inline void mpol_get(struct mempolicy *pol)
227{ 211{
228} 212}
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h
index a0ca0dca1244..478672ed0c3d 100644
--- a/include/linux/mfd/88pm80x.h
+++ b/include/linux/mfd/88pm80x.h
@@ -364,6 +364,6 @@ static inline int pm80x_dev_resume(struct device *dev)
364#endif 364#endif
365 365
366extern int pm80x_init(struct i2c_client *client, 366extern int pm80x_init(struct i2c_client *client,
367 const struct i2c_device_id *id) __devinit; 367 const struct i2c_device_id *id);
368extern int pm80x_deinit(struct i2c_client *client); 368extern int pm80x_deinit(struct i2c_client *client);
369#endif /* __LINUX_MFD_88PM80X_H */ 369#endif /* __LINUX_MFD_88PM80X_H */
diff --git a/include/linux/mfd/abx500.h b/include/linux/mfd/abx500.h
index 5d5298d56026..2138bd33021a 100644
--- a/include/linux/mfd/abx500.h
+++ b/include/linux/mfd/abx500.h
@@ -267,39 +267,21 @@ struct abx500_bm_data {
267 int gnd_lift_resistance; 267 int gnd_lift_resistance;
268 const struct abx500_maxim_parameters *maxi; 268 const struct abx500_maxim_parameters *maxi;
269 const struct abx500_bm_capacity_levels *cap_levels; 269 const struct abx500_bm_capacity_levels *cap_levels;
270 const struct abx500_battery_type *bat_type; 270 struct abx500_battery_type *bat_type;
271 const struct abx500_bm_charger_parameters *chg_params; 271 const struct abx500_bm_charger_parameters *chg_params;
272 const struct abx500_fg_parameters *fg_params; 272 const struct abx500_fg_parameters *fg_params;
273}; 273};
274 274
275struct abx500_chargalg_platform_data { 275extern struct abx500_bm_data ab8500_bm_data;
276 char **supplied_to;
277 size_t num_supplicants;
278};
279
280struct abx500_charger_platform_data {
281 char **supplied_to;
282 size_t num_supplicants;
283 bool autopower_cfg;
284};
285 276
286struct abx500_btemp_platform_data { 277enum {
287 char **supplied_to; 278 NTC_EXTERNAL = 0,
288 size_t num_supplicants; 279 NTC_INTERNAL,
289}; 280};
290 281
291struct abx500_fg_platform_data { 282int bmdevs_of_probe(struct device *dev,
292 char **supplied_to; 283 struct device_node *np,
293 size_t num_supplicants; 284 struct abx500_bm_data **battery);
294};
295
296struct abx500_bm_plat_data {
297 struct abx500_bm_data *battery;
298 struct abx500_charger_platform_data *charger;
299 struct abx500_btemp_platform_data *btemp;
300 struct abx500_fg_platform_data *fg;
301 struct abx500_chargalg_platform_data *chargalg;
302};
303 285
304int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg, 286int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg,
305 u8 value); 287 u8 value);
diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h
index 1491044efa10..1cb5698b4d76 100644
--- a/include/linux/mfd/abx500/ab8500.h
+++ b/include/linux/mfd/abx500/ab8500.h
@@ -291,9 +291,9 @@ struct ab8500_platform_data {
291 struct ab8500_codec_platform_data *codec; 291 struct ab8500_codec_platform_data *codec;
292}; 292};
293 293
294extern int __devinit ab8500_init(struct ab8500 *ab8500, 294extern int ab8500_init(struct ab8500 *ab8500,
295 enum ab8500_version version); 295 enum ab8500_version version);
296extern int __devexit ab8500_exit(struct ab8500 *ab8500); 296extern int ab8500_exit(struct ab8500 *ab8500);
297 297
298extern int ab8500_suspend(struct ab8500 *ab8500); 298extern int ab8500_suspend(struct ab8500 *ab8500);
299 299
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h
index dd231ac0bb1f..a580363a7d29 100644
--- a/include/linux/mfd/arizona/core.h
+++ b/include/linux/mfd/arizona/core.h
@@ -78,6 +78,8 @@ enum arizona_type {
78 78
79#define ARIZONA_NUM_IRQ 50 79#define ARIZONA_NUM_IRQ 50
80 80
81struct snd_soc_dapm_context;
82
81struct arizona { 83struct arizona {
82 struct regmap *regmap; 84 struct regmap *regmap;
83 struct device *dev; 85 struct device *dev;
@@ -98,6 +100,8 @@ struct arizona {
98 100
99 struct mutex clk_lock; 101 struct mutex clk_lock;
100 int clk32k_ref; 102 int clk32k_ref;
103
104 struct snd_soc_dapm_context *dapm;
101}; 105};
102 106
103int arizona_clk32k_enable(struct arizona *arizona); 107int arizona_clk32k_enable(struct arizona *arizona);
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index 7ab442905a57..8b1d1daaae16 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -62,6 +62,9 @@
62 62
63#define ARIZONA_MAX_OUTPUT 6 63#define ARIZONA_MAX_OUTPUT 6
64 64
65#define ARIZONA_HAP_ACT_ERM 0
66#define ARIZONA_HAP_ACT_LRA 2
67
65#define ARIZONA_MAX_PDM_SPK 2 68#define ARIZONA_MAX_PDM_SPK 2
66 69
67struct regulator_init_data; 70struct regulator_init_data;
@@ -114,6 +117,9 @@ struct arizona_pdata {
114 117
115 /** PDM speaker format */ 118 /** PDM speaker format */
116 unsigned int spk_fmt[ARIZONA_MAX_PDM_SPK]; 119 unsigned int spk_fmt[ARIZONA_MAX_PDM_SPK];
120
121 /** Haptic actuator type */
122 unsigned int hap_act;
117}; 123};
118 124
119#endif 125#endif
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h
index 7671a287dfee..ba26e99c388d 100644
--- a/include/linux/mfd/arizona/registers.h
+++ b/include/linux/mfd/arizona/registers.h
@@ -76,6 +76,7 @@
76#define ARIZONA_RATE_ESTIMATOR_3 0x154 76#define ARIZONA_RATE_ESTIMATOR_3 0x154
77#define ARIZONA_RATE_ESTIMATOR_4 0x155 77#define ARIZONA_RATE_ESTIMATOR_4 0x155
78#define ARIZONA_RATE_ESTIMATOR_5 0x156 78#define ARIZONA_RATE_ESTIMATOR_5 0x156
79#define ARIZONA_DYNAMIC_FREQUENCY_SCALING_1 0x161
79#define ARIZONA_FLL1_CONTROL_1 0x171 80#define ARIZONA_FLL1_CONTROL_1 0x171
80#define ARIZONA_FLL1_CONTROL_2 0x172 81#define ARIZONA_FLL1_CONTROL_2 0x172
81#define ARIZONA_FLL1_CONTROL_3 0x173 82#define ARIZONA_FLL1_CONTROL_3 0x173
@@ -110,6 +111,7 @@
110#define ARIZONA_FLL2_GPIO_CLOCK 0x1AA 111#define ARIZONA_FLL2_GPIO_CLOCK 0x1AA
111#define ARIZONA_MIC_CHARGE_PUMP_1 0x200 112#define ARIZONA_MIC_CHARGE_PUMP_1 0x200
112#define ARIZONA_LDO1_CONTROL_1 0x210 113#define ARIZONA_LDO1_CONTROL_1 0x210
114#define ARIZONA_LDO1_CONTROL_2 0x212
113#define ARIZONA_LDO2_CONTROL_1 0x213 115#define ARIZONA_LDO2_CONTROL_1 0x213
114#define ARIZONA_MIC_BIAS_CTRL_1 0x218 116#define ARIZONA_MIC_BIAS_CTRL_1 0x218
115#define ARIZONA_MIC_BIAS_CTRL_2 0x219 117#define ARIZONA_MIC_BIAS_CTRL_2 0x219
@@ -1574,6 +1576,13 @@
1574#define ARIZONA_SAMPLE_RATE_DETECT_D_WIDTH 5 /* SAMPLE_RATE_DETECT_D - [4:0] */ 1576#define ARIZONA_SAMPLE_RATE_DETECT_D_WIDTH 5 /* SAMPLE_RATE_DETECT_D - [4:0] */
1575 1577
1576/* 1578/*
1579 * R353 (0x161) - Dynamic Frequency Scaling 1
1580 */
1581#define ARIZONA_SUBSYS_MAX_FREQ 0x0001 /* SUBSYS_MAX_FREQ */
1582#define ARIZONA_SUBSYS_MAX_FREQ_SHIFT 0 /* SUBSYS_MAX_FREQ */
1583#define ARIZONA_SUBSYS_MAX_FREQ_WIDTH 1 /* SUBSYS_MAX_FREQ */
1584
1585/*
1577 * R369 (0x171) - FLL1 Control 1 1586 * R369 (0x171) - FLL1 Control 1
1578 */ 1587 */
1579#define ARIZONA_FLL1_FREERUN 0x0002 /* FLL1_FREERUN */ 1588#define ARIZONA_FLL1_FREERUN 0x0002 /* FLL1_FREERUN */
@@ -1889,6 +1898,13 @@
1889#define ARIZONA_LDO1_ENA_WIDTH 1 /* LDO1_ENA */ 1898#define ARIZONA_LDO1_ENA_WIDTH 1 /* LDO1_ENA */
1890 1899
1891/* 1900/*
1901 * R530 (0x212) - LDO1 Control 2
1902 */
1903#define ARIZONA_LDO1_HI_PWR 0x0001 /* LDO1_HI_PWR */
1904#define ARIZONA_LDO1_HI_PWR_SHIFT 0 /* LDO1_HI_PWR */
1905#define ARIZONA_LDO1_HI_PWR_WIDTH 1 /* LDO1_HI_PWR */
1906
1907/*
1892 * R531 (0x213) - LDO2 Control 1 1908 * R531 (0x213) - LDO2 Control 1
1893 */ 1909 */
1894#define ARIZONA_LDO2_VSEL_MASK 0x07E0 /* LDO2_VSEL - [10:5] */ 1910#define ARIZONA_LDO2_VSEL_MASK 0x07E0 /* LDO2_VSEL - [10:5] */
diff --git a/include/linux/mfd/da9055/pdata.h b/include/linux/mfd/da9055/pdata.h
index 147293b4471d..f87a6c172a91 100644
--- a/include/linux/mfd/da9055/pdata.h
+++ b/include/linux/mfd/da9055/pdata.h
@@ -25,8 +25,29 @@ struct da9055_pdata {
25 int gpio_base; 25 int gpio_base;
26 26
27 struct regulator_init_data *regulators[DA9055_MAX_REGULATORS]; 27 struct regulator_init_data *regulators[DA9055_MAX_REGULATORS];
28 bool reset_enable; /* Enable RTC in RESET Mode */ 28 /* Enable RTC in RESET Mode */
29 enum gpio_select *gpio_rsel; /* Select regulator set thru GPIO 1/2 */ 29 bool reset_enable;
30 enum gpio_select *gpio_ren; /* Enable regulator thru GPIO 1/2 */ 30 /*
31 * GPI muxed pin to control
32 * regulator state A/B, 0 if not available.
33 */
34 int *gpio_ren;
35 /*
36 * GPI muxed pin to control
37 * regulator set, 0 if not available.
38 */
39 int *gpio_rsel;
40 /*
41 * Regulator mode control bits value (GPI offset) that
42 * that controls the regulator state, 0 if not available.
43 */
44 enum gpio_select *reg_ren;
45 /*
46 * Regulator mode control bits value (GPI offset) that
47 * controls the regulator set A/B, 0 if not available.
48 */
49 enum gpio_select *reg_rsel;
50 /* GPIOs to enable regulator, 0 if not available */
51 int *ena_gpio;
31}; 52};
32#endif /* __DA9055_PDATA_H */ 53#endif /* __DA9055_PDATA_H */
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
index b82f6ee66a0b..6ee4247df11e 100644
--- a/include/linux/mfd/db8500-prcmu.h
+++ b/include/linux/mfd/db8500-prcmu.h
@@ -515,7 +515,6 @@ enum romcode_read prcmu_get_rc_p2a(void);
515enum ap_pwrst prcmu_get_xp70_current_state(void); 515enum ap_pwrst prcmu_get_xp70_current_state(void);
516bool prcmu_has_arm_maxopp(void); 516bool prcmu_has_arm_maxopp(void);
517struct prcmu_fw_version *prcmu_get_fw_version(void); 517struct prcmu_fw_version *prcmu_get_fw_version(void);
518int prcmu_request_ape_opp_100_voltage(bool enable);
519int prcmu_release_usb_wakeup_state(void); 518int prcmu_release_usb_wakeup_state(void);
520void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, 519void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep,
521 struct prcmu_auto_pm_config *idle); 520 struct prcmu_auto_pm_config *idle);
@@ -564,6 +563,7 @@ int db8500_prcmu_set_arm_opp(u8 opp);
564int db8500_prcmu_get_arm_opp(void); 563int db8500_prcmu_get_arm_opp(void);
565int db8500_prcmu_set_ape_opp(u8 opp); 564int db8500_prcmu_set_ape_opp(u8 opp);
566int db8500_prcmu_get_ape_opp(void); 565int db8500_prcmu_get_ape_opp(void);
566int db8500_prcmu_request_ape_opp_100_voltage(bool enable);
567int db8500_prcmu_set_ddr_opp(u8 opp); 567int db8500_prcmu_set_ddr_opp(u8 opp);
568int db8500_prcmu_get_ddr_opp(void); 568int db8500_prcmu_get_ddr_opp(void);
569 569
@@ -610,7 +610,7 @@ static inline int db8500_prcmu_get_ape_opp(void)
610 return APE_100_OPP; 610 return APE_100_OPP;
611} 611}
612 612
613static inline int prcmu_request_ape_opp_100_voltage(bool enable) 613static inline int db8500_prcmu_request_ape_opp_100_voltage(bool enable)
614{ 614{
615 return 0; 615 return 0;
616} 616}
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
index c410d99bd667..c202d6c4d879 100644
--- a/include/linux/mfd/dbx500-prcmu.h
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -336,6 +336,11 @@ static inline int prcmu_get_ape_opp(void)
336 return db8500_prcmu_get_ape_opp(); 336 return db8500_prcmu_get_ape_opp();
337} 337}
338 338
339static inline int prcmu_request_ape_opp_100_voltage(bool enable)
340{
341 return db8500_prcmu_request_ape_opp_100_voltage(enable);
342}
343
339static inline void prcmu_system_reset(u16 reset_code) 344static inline void prcmu_system_reset(u16 reset_code)
340{ 345{
341 return db8500_prcmu_system_reset(reset_code); 346 return db8500_prcmu_system_reset(reset_code);
@@ -507,6 +512,11 @@ static inline int prcmu_get_ape_opp(void)
507 return APE_100_OPP; 512 return APE_100_OPP;
508} 513}
509 514
515static inline int prcmu_request_ape_opp_100_voltage(bool enable)
516{
517 return 0;
518}
519
510static inline int prcmu_set_arm_opp(u8 opp) 520static inline int prcmu_set_arm_opp(u8 opp)
511{ 521{
512 return 0; 522 return 0;
diff --git a/include/linux/mfd/lp8788.h b/include/linux/mfd/lp8788.h
index cec364bdccfa..2a32b16f79cb 100644
--- a/include/linux/mfd/lp8788.h
+++ b/include/linux/mfd/lp8788.h
@@ -211,16 +211,16 @@ struct lp8788_chg_param {
211 211
212/* 212/*
213 * struct lp8788_charger_platform_data 213 * struct lp8788_charger_platform_data
214 * @vbatt_adc : adc selection id for battery voltage 214 * @adc_vbatt : adc channel name for battery voltage
215 * @batt_temp_adc : adc selection id for battery temperature 215 * @adc_batt_temp : adc channel name for battery temperature
216 * @max_vbatt_mv : used for calculating battery capacity 216 * @max_vbatt_mv : used for calculating battery capacity
217 * @chg_params : initial charging parameters 217 * @chg_params : initial charging parameters
218 * @num_chg_params : numbers of charging parameters 218 * @num_chg_params : numbers of charging parameters
219 * @charger_event : the charger event can be reported to the platform side 219 * @charger_event : the charger event can be reported to the platform side
220 */ 220 */
221struct lp8788_charger_platform_data { 221struct lp8788_charger_platform_data {
222 enum lp8788_adc_id vbatt_adc; 222 const char *adc_vbatt;
223 enum lp8788_adc_id batt_temp_adc; 223 const char *adc_batt_temp;
224 unsigned int max_vbatt_mv; 224 unsigned int max_vbatt_mv;
225 struct lp8788_chg_param *chg_params; 225 struct lp8788_chg_param *chg_params;
226 int num_chg_params; 226 int num_chg_params;
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index 830152cfae33..6ae21bf47d64 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -316,6 +316,7 @@ enum max8997_irq {
316#define MAX8997_NUM_GPIO 12 316#define MAX8997_NUM_GPIO 12
317struct max8997_dev { 317struct max8997_dev {
318 struct device *dev; 318 struct device *dev;
319 struct max8997_platform_data *pdata;
319 struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */ 320 struct i2c_client *i2c; /* 0xcc / PMIC, Battery Control, and FLASH */
320 struct i2c_client *rtc; /* slave addr 0x0c */ 321 struct i2c_client *rtc; /* slave addr 0x0c */
321 struct i2c_client *haptic; /* slave addr 0x90 */ 322 struct i2c_client *haptic; /* slave addr 0x90 */
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h
index 328d8e24b533..1d4a4fe6ac33 100644
--- a/include/linux/mfd/max8997.h
+++ b/include/linux/mfd/max8997.h
@@ -75,6 +75,7 @@ enum max8998_regulators {
75struct max8997_regulator_data { 75struct max8997_regulator_data {
76 int id; 76 int id;
77 struct regulator_init_data *initdata; 77 struct regulator_init_data *initdata;
78 struct device_node *reg_node;
78}; 79};
79 80
80enum max8997_muic_usb_type { 81enum max8997_muic_usb_type {
diff --git a/include/linux/mfd/menelaus.h b/include/linux/mfd/menelaus.h
new file mode 100644
index 000000000000..f097e89134cb
--- /dev/null
+++ b/include/linux/mfd/menelaus.h
@@ -0,0 +1,47 @@
1/*
2 * Functions to access Menelaus power management chip
3 */
4
5#ifndef __ASM_ARCH_MENELAUS_H
6#define __ASM_ARCH_MENELAUS_H
7
8struct device;
9
10struct menelaus_platform_data {
11 int (* late_init)(struct device *dev);
12};
13
14extern int menelaus_register_mmc_callback(void (*callback)(void *data, u8 card_mask),
15 void *data);
16extern void menelaus_unregister_mmc_callback(void);
17extern int menelaus_set_mmc_opendrain(int slot, int enable);
18extern int menelaus_set_mmc_slot(int slot, int enable, int power, int cd_on);
19
20extern int menelaus_set_vmem(unsigned int mV);
21extern int menelaus_set_vio(unsigned int mV);
22extern int menelaus_set_vmmc(unsigned int mV);
23extern int menelaus_set_vaux(unsigned int mV);
24extern int menelaus_set_vdcdc(int dcdc, unsigned int mV);
25extern int menelaus_set_slot_sel(int enable);
26extern int menelaus_get_slot_pin_states(void);
27extern int menelaus_set_vcore_sw(unsigned int mV);
28extern int menelaus_set_vcore_hw(unsigned int roof_mV, unsigned int floor_mV);
29
30#define EN_VPLL_SLEEP (1 << 7)
31#define EN_VMMC_SLEEP (1 << 6)
32#define EN_VAUX_SLEEP (1 << 5)
33#define EN_VIO_SLEEP (1 << 4)
34#define EN_VMEM_SLEEP (1 << 3)
35#define EN_DC3_SLEEP (1 << 2)
36#define EN_DC2_SLEEP (1 << 1)
37#define EN_VC_SLEEP (1 << 0)
38
39extern int menelaus_set_regulator_sleep(int enable, u32 val);
40
41#if defined(CONFIG_ARCH_OMAP2) && defined(CONFIG_MENELAUS)
42#define omap_has_menelaus() 1
43#else
44#define omap_has_menelaus() 0
45#endif
46
47#endif
diff --git a/include/linux/mfd/pm8xxx/irq.h b/include/linux/mfd/pm8xxx/irq.h
index 4b21769f4483..f83d6b43ecbb 100644
--- a/include/linux/mfd/pm8xxx/irq.h
+++ b/include/linux/mfd/pm8xxx/irq.h
@@ -37,21 +37,21 @@ struct pm_irq_chip;
37 37
38#ifdef CONFIG_MFD_PM8XXX_IRQ 38#ifdef CONFIG_MFD_PM8XXX_IRQ
39int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq); 39int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq);
40struct pm_irq_chip * __devinit pm8xxx_irq_init(struct device *dev, 40struct pm_irq_chip *pm8xxx_irq_init(struct device *dev,
41 const struct pm8xxx_irq_platform_data *pdata); 41 const struct pm8xxx_irq_platform_data *pdata);
42int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip); 42int pm8xxx_irq_exit(struct pm_irq_chip *chip);
43#else 43#else
44static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq) 44static inline int pm8xxx_get_irq_stat(struct pm_irq_chip *chip, int irq)
45{ 45{
46 return -ENXIO; 46 return -ENXIO;
47} 47}
48static inline struct pm_irq_chip * __devinit pm8xxx_irq_init( 48static inline struct pm_irq_chip *pm8xxx_irq_init(
49 const struct device *dev, 49 const struct device *dev,
50 const struct pm8xxx_irq_platform_data *pdata) 50 const struct pm8xxx_irq_platform_data *pdata)
51{ 51{
52 return ERR_PTR(-ENXIO); 52 return ERR_PTR(-ENXIO);
53} 53}
54static inline int __devexit pm8xxx_irq_exit(struct pm_irq_chip *chip) 54static inline int pm8xxx_irq_exit(struct pm_irq_chip *chip)
55{ 55{
56 return -ENXIO; 56 return -ENXIO;
57} 57}
diff --git a/include/linux/mfd/rtsx_common.h b/include/linux/mfd/rtsx_common.h
new file mode 100644
index 000000000000..a8d393e3066b
--- /dev/null
+++ b/include/linux/mfd/rtsx_common.h
@@ -0,0 +1,48 @@
1/* Driver for Realtek driver-based card reader
2 *
3 * Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved.
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 as published by the
7 * Free Software Foundation; either version 2, or (at your option) any
8 * later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, see <http://www.gnu.org/licenses/>.
17 *
18 * Author:
19 * Wei WANG <wei_wang@realsil.com.cn>
20 * No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
21 */
22
23#ifndef __RTSX_COMMON_H
24#define __RTSX_COMMON_H
25
26#define DRV_NAME_RTSX_PCI "rtsx_pci"
27#define DRV_NAME_RTSX_PCI_SDMMC "rtsx_pci_sdmmc"
28#define DRV_NAME_RTSX_PCI_MS "rtsx_pci_ms"
29
30#define RTSX_REG_PAIR(addr, val) (((u32)(addr) << 16) | (u8)(val))
31
32#define RTSX_SSC_DEPTH_4M 0x01
33#define RTSX_SSC_DEPTH_2M 0x02
34#define RTSX_SSC_DEPTH_1M 0x03
35#define RTSX_SSC_DEPTH_500K 0x04
36#define RTSX_SSC_DEPTH_250K 0x05
37
38#define RTSX_SD_CARD 0
39#define RTSX_MS_CARD 1
40
41struct platform_device;
42
43struct rtsx_slot {
44 struct platform_device *p_dev;
45 void (*card_event)(struct platform_device *p_dev);
46};
47
48#endif
diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h
new file mode 100644
index 000000000000..060b721fcbfb
--- /dev/null
+++ b/include/linux/mfd/rtsx_pci.h
@@ -0,0 +1,794 @@
1/* Driver for Realtek PCI-Express card reader
2 *
3 * Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved.
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 as published by the
7 * Free Software Foundation; either version 2, or (at your option) any
8 * later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, see <http://www.gnu.org/licenses/>.
17 *
18 * Author:
19 * Wei WANG <wei_wang@realsil.com.cn>
20 * No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
21 */
22
23#ifndef __RTSX_PCI_H
24#define __RTSX_PCI_H
25
26#include <linux/sched.h>
27#include <linux/pci.h>
28
29#include "rtsx_common.h"
30
31#define MAX_RW_REG_CNT 1024
32
33/* PCI Operation Register Address */
34#define RTSX_HCBAR 0x00
35#define RTSX_HCBCTLR 0x04
36#define RTSX_HDBAR 0x08
37#define RTSX_HDBCTLR 0x0C
38#define RTSX_HAIMR 0x10
39#define RTSX_BIPR 0x14
40#define RTSX_BIER 0x18
41
42/* Host command buffer control register */
43#define STOP_CMD (0x01 << 28)
44
45/* Host data buffer control register */
46#define SDMA_MODE 0x00
47#define ADMA_MODE (0x02 << 26)
48#define STOP_DMA (0x01 << 28)
49#define TRIG_DMA (0x01 << 31)
50
51/* Host access internal memory register */
52#define HAIMR_TRANS_START (0x01 << 31)
53#define HAIMR_READ 0x00
54#define HAIMR_WRITE (0x01 << 30)
55#define HAIMR_READ_START (HAIMR_TRANS_START | HAIMR_READ)
56#define HAIMR_WRITE_START (HAIMR_TRANS_START | HAIMR_WRITE)
57#define HAIMR_TRANS_END (HAIMR_TRANS_START)
58
59/* Bus interrupt pending register */
60#define CMD_DONE_INT (1 << 31)
61#define DATA_DONE_INT (1 << 30)
62#define TRANS_OK_INT (1 << 29)
63#define TRANS_FAIL_INT (1 << 28)
64#define XD_INT (1 << 27)
65#define MS_INT (1 << 26)
66#define SD_INT (1 << 25)
67#define GPIO0_INT (1 << 24)
68#define OC_INT (1 << 23)
69#define SD_WRITE_PROTECT (1 << 19)
70#define XD_EXIST (1 << 18)
71#define MS_EXIST (1 << 17)
72#define SD_EXIST (1 << 16)
73#define DELINK_INT GPIO0_INT
74#define MS_OC_INT (1 << 23)
75#define SD_OC_INT (1 << 22)
76
77#define CARD_INT (XD_INT | MS_INT | SD_INT)
78#define NEED_COMPLETE_INT (DATA_DONE_INT | TRANS_OK_INT | TRANS_FAIL_INT)
79#define RTSX_INT (CMD_DONE_INT | NEED_COMPLETE_INT | \
80 CARD_INT | GPIO0_INT | OC_INT)
81
82#define CARD_EXIST (XD_EXIST | MS_EXIST | SD_EXIST)
83
84/* Bus interrupt enable register */
85#define CMD_DONE_INT_EN (1 << 31)
86#define DATA_DONE_INT_EN (1 << 30)
87#define TRANS_OK_INT_EN (1 << 29)
88#define TRANS_FAIL_INT_EN (1 << 28)
89#define XD_INT_EN (1 << 27)
90#define MS_INT_EN (1 << 26)
91#define SD_INT_EN (1 << 25)
92#define GPIO0_INT_EN (1 << 24)
93#define OC_INT_EN (1 << 23)
94#define DELINK_INT_EN GPIO0_INT_EN
95#define MS_OC_INT_EN (1 << 23)
96#define SD_OC_INT_EN (1 << 22)
97
98#define READ_REG_CMD 0
99#define WRITE_REG_CMD 1
100#define CHECK_REG_CMD 2
101
102/*
103 * macros for easy use
104 */
105#define rtsx_pci_writel(pcr, reg, value) \
106 iowrite32(value, (pcr)->remap_addr + reg)
107#define rtsx_pci_readl(pcr, reg) \
108 ioread32((pcr)->remap_addr + reg)
109#define rtsx_pci_writew(pcr, reg, value) \
110 iowrite16(value, (pcr)->remap_addr + reg)
111#define rtsx_pci_readw(pcr, reg) \
112 ioread16((pcr)->remap_addr + reg)
113#define rtsx_pci_writeb(pcr, reg, value) \
114 iowrite8(value, (pcr)->remap_addr + reg)
115#define rtsx_pci_readb(pcr, reg) \
116 ioread8((pcr)->remap_addr + reg)
117
118#define rtsx_pci_read_config_byte(pcr, where, val) \
119 pci_read_config_byte((pcr)->pci, where, val)
120
121#define rtsx_pci_write_config_byte(pcr, where, val) \
122 pci_write_config_byte((pcr)->pci, where, val)
123
124#define rtsx_pci_read_config_dword(pcr, where, val) \
125 pci_read_config_dword((pcr)->pci, where, val)
126
127#define rtsx_pci_write_config_dword(pcr, where, val) \
128 pci_write_config_dword((pcr)->pci, where, val)
129
130#define STATE_TRANS_NONE 0
131#define STATE_TRANS_CMD 1
132#define STATE_TRANS_BUF 2
133#define STATE_TRANS_SG 3
134
135#define TRANS_NOT_READY 0
136#define TRANS_RESULT_OK 1
137#define TRANS_RESULT_FAIL 2
138#define TRANS_NO_DEVICE 3
139
140#define RTSX_RESV_BUF_LEN 4096
141#define HOST_CMDS_BUF_LEN 1024
142#define HOST_SG_TBL_BUF_LEN (RTSX_RESV_BUF_LEN - HOST_CMDS_BUF_LEN)
143#define HOST_SG_TBL_ITEMS (HOST_SG_TBL_BUF_LEN / 8)
144#define MAX_SG_ITEM_LEN 0x80000
145
146#define HOST_TO_DEVICE 0
147#define DEVICE_TO_HOST 1
148
149#define MAX_PHASE 31
150#define RX_TUNING_CNT 3
151
152/* SG descriptor */
153#define SG_INT 0x04
154#define SG_END 0x02
155#define SG_VALID 0x01
156
157#define SG_NO_OP 0x00
158#define SG_TRANS_DATA (0x02 << 4)
159#define SG_LINK_DESC (0x03 << 4)
160
161/* SD bank voltage */
162#define SD_IO_3V3 0
163#define SD_IO_1V8 1
164
165
166/* Card Clock Enable Register */
167#define SD_CLK_EN 0x04
168#define MS_CLK_EN 0x08
169
170/* Card Select Register */
171#define SD_MOD_SEL 2
172#define MS_MOD_SEL 3
173
174/* Card Output Enable Register */
175#define SD_OUTPUT_EN 0x04
176#define MS_OUTPUT_EN 0x08
177
178/* CARD_SHARE_MODE */
179#define CARD_SHARE_MASK 0x0F
180#define CARD_SHARE_MULTI_LUN 0x00
181#define CARD_SHARE_NORMAL 0x00
182#define CARD_SHARE_48_SD 0x04
183#define CARD_SHARE_48_MS 0x08
184/* CARD_SHARE_MODE for barossa */
185#define CARD_SHARE_BAROSSA_SD 0x01
186#define CARD_SHARE_BAROSSA_MS 0x02
187
188/* SD30_DRIVE_SEL */
189#define DRIVER_TYPE_A 0x05
190#define DRIVER_TYPE_B 0x03
191#define DRIVER_TYPE_C 0x02
192#define DRIVER_TYPE_D 0x01
193
194/* FPDCTL */
195#define SSC_POWER_DOWN 0x01
196#define SD_OC_POWER_DOWN 0x02
197#define ALL_POWER_DOWN 0x07
198#define OC_POWER_DOWN 0x06
199
200/* CLK_CTL */
201#define CHANGE_CLK 0x01
202
203/* LDO_CTL */
204#define BPP_LDO_POWB 0x03
205#define BPP_LDO_ON 0x00
206#define BPP_LDO_SUSPEND 0x02
207#define BPP_LDO_OFF 0x03
208
209/* CD_PAD_CTL */
210#define CD_DISABLE_MASK 0x07
211#define MS_CD_DISABLE 0x04
212#define SD_CD_DISABLE 0x02
213#define XD_CD_DISABLE 0x01
214#define CD_DISABLE 0x07
215#define CD_ENABLE 0x00
216#define MS_CD_EN_ONLY 0x03
217#define SD_CD_EN_ONLY 0x05
218#define XD_CD_EN_ONLY 0x06
219#define FORCE_CD_LOW_MASK 0x38
220#define FORCE_CD_XD_LOW 0x08
221#define FORCE_CD_SD_LOW 0x10
222#define FORCE_CD_MS_LOW 0x20
223#define CD_AUTO_DISABLE 0x40
224
225/* SD_STAT1 */
226#define SD_CRC7_ERR 0x80
227#define SD_CRC16_ERR 0x40
228#define SD_CRC_WRITE_ERR 0x20
229#define SD_CRC_WRITE_ERR_MASK 0x1C
230#define GET_CRC_TIME_OUT 0x02
231#define SD_TUNING_COMPARE_ERR 0x01
232
233/* SD_STAT2 */
234#define SD_RSP_80CLK_TIMEOUT 0x01
235
236/* SD_BUS_STAT */
237#define SD_CLK_TOGGLE_EN 0x80
238#define SD_CLK_FORCE_STOP 0x40
239#define SD_DAT3_STATUS 0x10
240#define SD_DAT2_STATUS 0x08
241#define SD_DAT1_STATUS 0x04
242#define SD_DAT0_STATUS 0x02
243#define SD_CMD_STATUS 0x01
244
245/* SD_PAD_CTL */
246#define SD_IO_USING_1V8 0x80
247#define SD_IO_USING_3V3 0x7F
248#define TYPE_A_DRIVING 0x00
249#define TYPE_B_DRIVING 0x01
250#define TYPE_C_DRIVING 0x02
251#define TYPE_D_DRIVING 0x03
252
253/* SD_SAMPLE_POINT_CTL */
254#define DDR_FIX_RX_DAT 0x00
255#define DDR_VAR_RX_DAT 0x80
256#define DDR_FIX_RX_DAT_EDGE 0x00
257#define DDR_FIX_RX_DAT_14_DELAY 0x40
258#define DDR_FIX_RX_CMD 0x00
259#define DDR_VAR_RX_CMD 0x20
260#define DDR_FIX_RX_CMD_POS_EDGE 0x00
261#define DDR_FIX_RX_CMD_14_DELAY 0x10
262#define SD20_RX_POS_EDGE 0x00
263#define SD20_RX_14_DELAY 0x08
264#define SD20_RX_SEL_MASK 0x08
265
266/* SD_PUSH_POINT_CTL */
267#define DDR_FIX_TX_CMD_DAT 0x00
268#define DDR_VAR_TX_CMD_DAT 0x80
269#define DDR_FIX_TX_DAT_14_TSU 0x00
270#define DDR_FIX_TX_DAT_12_TSU 0x40
271#define DDR_FIX_TX_CMD_NEG_EDGE 0x00
272#define DDR_FIX_TX_CMD_14_AHEAD 0x20
273#define SD20_TX_NEG_EDGE 0x00
274#define SD20_TX_14_AHEAD 0x10
275#define SD20_TX_SEL_MASK 0x10
276#define DDR_VAR_SDCLK_POL_SWAP 0x01
277
278/* SD_TRANSFER */
279#define SD_TRANSFER_START 0x80
280#define SD_TRANSFER_END 0x40
281#define SD_STAT_IDLE 0x20
282#define SD_TRANSFER_ERR 0x10
283/* SD Transfer Mode definition */
284#define SD_TM_NORMAL_WRITE 0x00
285#define SD_TM_AUTO_WRITE_3 0x01
286#define SD_TM_AUTO_WRITE_4 0x02
287#define SD_TM_AUTO_READ_3 0x05
288#define SD_TM_AUTO_READ_4 0x06
289#define SD_TM_CMD_RSP 0x08
290#define SD_TM_AUTO_WRITE_1 0x09
291#define SD_TM_AUTO_WRITE_2 0x0A
292#define SD_TM_NORMAL_READ 0x0C
293#define SD_TM_AUTO_READ_1 0x0D
294#define SD_TM_AUTO_READ_2 0x0E
295#define SD_TM_AUTO_TUNING 0x0F
296
297/* SD_VPTX_CTL / SD_VPRX_CTL */
298#define PHASE_CHANGE 0x80
299#define PHASE_NOT_RESET 0x40
300
301/* SD_DCMPS_TX_CTL / SD_DCMPS_RX_CTL */
302#define DCMPS_CHANGE 0x80
303#define DCMPS_CHANGE_DONE 0x40
304#define DCMPS_ERROR 0x20
305#define DCMPS_CURRENT_PHASE 0x1F
306
307/* SD Configure 1 Register */
308#define SD_CLK_DIVIDE_0 0x00
309#define SD_CLK_DIVIDE_256 0xC0
310#define SD_CLK_DIVIDE_128 0x80
311#define SD_BUS_WIDTH_1BIT 0x00
312#define SD_BUS_WIDTH_4BIT 0x01
313#define SD_BUS_WIDTH_8BIT 0x02
314#define SD_ASYNC_FIFO_NOT_RST 0x10
315#define SD_20_MODE 0x00
316#define SD_DDR_MODE 0x04
317#define SD_30_MODE 0x08
318
319#define SD_CLK_DIVIDE_MASK 0xC0
320
321/* SD_CMD_STATE */
322#define SD_CMD_IDLE 0x80
323
324/* SD_DATA_STATE */
325#define SD_DATA_IDLE 0x80
326
327/* DCM_DRP_CTL */
328#define DCM_RESET 0x08
329#define DCM_LOCKED 0x04
330#define DCM_208M 0x00
331#define DCM_TX 0x01
332#define DCM_RX 0x02
333
334/* DCM_DRP_TRIG */
335#define DRP_START 0x80
336#define DRP_DONE 0x40
337
338/* DCM_DRP_CFG */
339#define DRP_WRITE 0x80
340#define DRP_READ 0x00
341#define DCM_WRITE_ADDRESS_50 0x50
342#define DCM_WRITE_ADDRESS_51 0x51
343#define DCM_READ_ADDRESS_00 0x00
344#define DCM_READ_ADDRESS_51 0x51
345
346/* IRQSTAT0 */
347#define DMA_DONE_INT 0x80
348#define SUSPEND_INT 0x40
349#define LINK_RDY_INT 0x20
350#define LINK_DOWN_INT 0x10
351
352/* DMACTL */
353#define DMA_RST 0x80
354#define DMA_BUSY 0x04
355#define DMA_DIR_TO_CARD 0x00
356#define DMA_DIR_FROM_CARD 0x02
357#define DMA_EN 0x01
358#define DMA_128 (0 << 4)
359#define DMA_256 (1 << 4)
360#define DMA_512 (2 << 4)
361#define DMA_1024 (3 << 4)
362#define DMA_PACK_SIZE_MASK 0x30
363
364/* SSC_CTL1 */
365#define SSC_RSTB 0x80
366#define SSC_8X_EN 0x40
367#define SSC_FIX_FRAC 0x20
368#define SSC_SEL_1M 0x00
369#define SSC_SEL_2M 0x08
370#define SSC_SEL_4M 0x10
371#define SSC_SEL_8M 0x18
372
373/* SSC_CTL2 */
374#define SSC_DEPTH_MASK 0x07
375#define SSC_DEPTH_DISALBE 0x00
376#define SSC_DEPTH_4M 0x01
377#define SSC_DEPTH_2M 0x02
378#define SSC_DEPTH_1M 0x03
379#define SSC_DEPTH_500K 0x04
380#define SSC_DEPTH_250K 0x05
381
382/* System Clock Control Register */
383#define CLK_LOW_FREQ 0x01
384
385/* System Clock Divider Register */
386#define CLK_DIV_1 0x01
387#define CLK_DIV_2 0x02
388#define CLK_DIV_4 0x03
389#define CLK_DIV_8 0x04
390
391/* MS_CFG */
392#define SAMPLE_TIME_RISING 0x00
393#define SAMPLE_TIME_FALLING 0x80
394#define PUSH_TIME_DEFAULT 0x00
395#define PUSH_TIME_ODD 0x40
396#define NO_EXTEND_TOGGLE 0x00
397#define EXTEND_TOGGLE_CHK 0x20
398#define MS_BUS_WIDTH_1 0x00
399#define MS_BUS_WIDTH_4 0x10
400#define MS_BUS_WIDTH_8 0x18
401#define MS_2K_SECTOR_MODE 0x04
402#define MS_512_SECTOR_MODE 0x00
403#define MS_TOGGLE_TIMEOUT_EN 0x00
404#define MS_TOGGLE_TIMEOUT_DISEN 0x01
405#define MS_NO_CHECK_INT 0x02
406
407/* MS_TRANS_CFG */
408#define WAIT_INT 0x80
409#define NO_WAIT_INT 0x00
410#define NO_AUTO_READ_INT_REG 0x00
411#define AUTO_READ_INT_REG 0x40
412#define MS_CRC16_ERR 0x20
413#define MS_RDY_TIMEOUT 0x10
414#define MS_INT_CMDNK 0x08
415#define MS_INT_BREQ 0x04
416#define MS_INT_ERR 0x02
417#define MS_INT_CED 0x01
418
419/* MS_TRANSFER */
420#define MS_TRANSFER_START 0x80
421#define MS_TRANSFER_END 0x40
422#define MS_TRANSFER_ERR 0x20
423#define MS_BS_STATE 0x10
424#define MS_TM_READ_BYTES 0x00
425#define MS_TM_NORMAL_READ 0x01
426#define MS_TM_WRITE_BYTES 0x04
427#define MS_TM_NORMAL_WRITE 0x05
428#define MS_TM_AUTO_READ 0x08
429#define MS_TM_AUTO_WRITE 0x0C
430
431/* SD Configure 2 Register */
432#define SD_CALCULATE_CRC7 0x00
433#define SD_NO_CALCULATE_CRC7 0x80
434#define SD_CHECK_CRC16 0x00
435#define SD_NO_CHECK_CRC16 0x40
436#define SD_NO_CHECK_WAIT_CRC_TO 0x20
437#define SD_WAIT_BUSY_END 0x08
438#define SD_NO_WAIT_BUSY_END 0x00
439#define SD_CHECK_CRC7 0x00
440#define SD_NO_CHECK_CRC7 0x04
441#define SD_RSP_LEN_0 0x00
442#define SD_RSP_LEN_6 0x01
443#define SD_RSP_LEN_17 0x02
444/* SD/MMC Response Type Definition */
445#define SD_RSP_TYPE_R0 0x04
446#define SD_RSP_TYPE_R1 0x01
447#define SD_RSP_TYPE_R1b 0x09
448#define SD_RSP_TYPE_R2 0x02
449#define SD_RSP_TYPE_R3 0x05
450#define SD_RSP_TYPE_R4 0x05
451#define SD_RSP_TYPE_R5 0x01
452#define SD_RSP_TYPE_R6 0x01
453#define SD_RSP_TYPE_R7 0x01
454
455/* SD_CONFIURE3 */
456#define SD_RSP_80CLK_TIMEOUT_EN 0x01
457
458/* Card Transfer Reset Register */
459#define SPI_STOP 0x01
460#define XD_STOP 0x02
461#define SD_STOP 0x04
462#define MS_STOP 0x08
463#define SPI_CLR_ERR 0x10
464#define XD_CLR_ERR 0x20
465#define SD_CLR_ERR 0x40
466#define MS_CLR_ERR 0x80
467
468/* Card Data Source Register */
469#define PINGPONG_BUFFER 0x01
470#define RING_BUFFER 0x00
471
472/* Card Power Control Register */
473#define PMOS_STRG_MASK 0x10
474#define PMOS_STRG_800mA 0x10
475#define PMOS_STRG_400mA 0x00
476#define SD_POWER_OFF 0x03
477#define SD_PARTIAL_POWER_ON 0x01
478#define SD_POWER_ON 0x00
479#define SD_POWER_MASK 0x03
480#define MS_POWER_OFF 0x0C
481#define MS_PARTIAL_POWER_ON 0x04
482#define MS_POWER_ON 0x00
483#define MS_POWER_MASK 0x0C
484#define BPP_POWER_OFF 0x0F
485#define BPP_POWER_5_PERCENT_ON 0x0E
486#define BPP_POWER_10_PERCENT_ON 0x0C
487#define BPP_POWER_15_PERCENT_ON 0x08
488#define BPP_POWER_ON 0x00
489#define BPP_POWER_MASK 0x0F
490
491/* PWR_GATE_CTRL */
492#define PWR_GATE_EN 0x01
493#define LDO3318_PWR_MASK 0x06
494#define LDO_ON 0x00
495#define LDO_SUSPEND 0x04
496#define LDO_OFF 0x06
497
498/* CARD_CLK_SOURCE */
499#define CRC_FIX_CLK (0x00 << 0)
500#define CRC_VAR_CLK0 (0x01 << 0)
501#define CRC_VAR_CLK1 (0x02 << 0)
502#define SD30_FIX_CLK (0x00 << 2)
503#define SD30_VAR_CLK0 (0x01 << 2)
504#define SD30_VAR_CLK1 (0x02 << 2)
505#define SAMPLE_FIX_CLK (0x00 << 4)
506#define SAMPLE_VAR_CLK0 (0x01 << 4)
507#define SAMPLE_VAR_CLK1 (0x02 << 4)
508
509#define MS_CFG 0xFD40
510#define MS_TPC 0xFD41
511#define MS_TRANS_CFG 0xFD42
512#define MS_TRANSFER 0xFD43
513#define MS_INT_REG 0xFD44
514#define MS_BYTE_CNT 0xFD45
515#define MS_SECTOR_CNT_L 0xFD46
516#define MS_SECTOR_CNT_H 0xFD47
517#define MS_DBUS_H 0xFD48
518
519#define SD_CFG1 0xFDA0
520#define SD_CFG2 0xFDA1
521#define SD_CFG3 0xFDA2
522#define SD_STAT1 0xFDA3
523#define SD_STAT2 0xFDA4
524#define SD_BUS_STAT 0xFDA5
525#define SD_PAD_CTL 0xFDA6
526#define SD_SAMPLE_POINT_CTL 0xFDA7
527#define SD_PUSH_POINT_CTL 0xFDA8
528#define SD_CMD0 0xFDA9
529#define SD_CMD1 0xFDAA
530#define SD_CMD2 0xFDAB
531#define SD_CMD3 0xFDAC
532#define SD_CMD4 0xFDAD
533#define SD_CMD5 0xFDAE
534#define SD_BYTE_CNT_L 0xFDAF
535#define SD_BYTE_CNT_H 0xFDB0
536#define SD_BLOCK_CNT_L 0xFDB1
537#define SD_BLOCK_CNT_H 0xFDB2
538#define SD_TRANSFER 0xFDB3
539#define SD_CMD_STATE 0xFDB5
540#define SD_DATA_STATE 0xFDB6
541
542#define SRCTL 0xFC13
543
544#define DCM_DRP_CTL 0xFC23
545#define DCM_DRP_TRIG 0xFC24
546#define DCM_DRP_CFG 0xFC25
547#define DCM_DRP_WR_DATA_L 0xFC26
548#define DCM_DRP_WR_DATA_H 0xFC27
549#define DCM_DRP_RD_DATA_L 0xFC28
550#define DCM_DRP_RD_DATA_H 0xFC29
551#define SD_VPCLK0_CTL 0xFC2A
552#define SD_VPCLK1_CTL 0xFC2B
553#define SD_DCMPS0_CTL 0xFC2C
554#define SD_DCMPS1_CTL 0xFC2D
555#define SD_VPTX_CTL SD_VPCLK0_CTL
556#define SD_VPRX_CTL SD_VPCLK1_CTL
557#define SD_DCMPS_TX_CTL SD_DCMPS0_CTL
558#define SD_DCMPS_RX_CTL SD_DCMPS1_CTL
559#define CARD_CLK_SOURCE 0xFC2E
560
561#define CARD_PWR_CTL 0xFD50
562#define CARD_CLK_SWITCH 0xFD51
563#define CARD_SHARE_MODE 0xFD52
564#define CARD_DRIVE_SEL 0xFD53
565#define CARD_STOP 0xFD54
566#define CARD_OE 0xFD55
567#define CARD_AUTO_BLINK 0xFD56
568#define CARD_GPIO_DIR 0xFD57
569#define CARD_GPIO 0xFD58
570#define CARD_DATA_SOURCE 0xFD5B
571#define CARD_SELECT 0xFD5C
572#define SD30_DRIVE_SEL 0xFD5E
573#define CARD_CLK_EN 0xFD69
574#define SDIO_CTRL 0xFD6B
575#define CD_PAD_CTL 0xFD73
576
577#define FPDCTL 0xFC00
578#define PDINFO 0xFC01
579
580#define CLK_CTL 0xFC02
581#define CLK_DIV 0xFC03
582#define CLK_SEL 0xFC04
583
584#define SSC_DIV_N_0 0xFC0F
585#define SSC_DIV_N_1 0xFC10
586#define SSC_CTL1 0xFC11
587#define SSC_CTL2 0xFC12
588
589#define RCCTL 0xFC14
590
591#define FPGA_PULL_CTL 0xFC1D
592#define OLT_LED_CTL 0xFC1E
593#define GPIO_CTL 0xFC1F
594
595#define LDO_CTL 0xFC1E
596#define SYS_VER 0xFC32
597
598#define CARD_PULL_CTL1 0xFD60
599#define CARD_PULL_CTL2 0xFD61
600#define CARD_PULL_CTL3 0xFD62
601#define CARD_PULL_CTL4 0xFD63
602#define CARD_PULL_CTL5 0xFD64
603#define CARD_PULL_CTL6 0xFD65
604
605/* PCI Express Related Registers */
606#define IRQEN0 0xFE20
607#define IRQSTAT0 0xFE21
608#define IRQEN1 0xFE22
609#define IRQSTAT1 0xFE23
610#define TLPRIEN 0xFE24
611#define TLPRISTAT 0xFE25
612#define TLPTIEN 0xFE26
613#define TLPTISTAT 0xFE27
614#define DMATC0 0xFE28
615#define DMATC1 0xFE29
616#define DMATC2 0xFE2A
617#define DMATC3 0xFE2B
618#define DMACTL 0xFE2C
619#define BCTL 0xFE2D
620#define RBBC0 0xFE2E
621#define RBBC1 0xFE2F
622#define RBDAT 0xFE30
623#define RBCTL 0xFE34
624#define CFGADDR0 0xFE35
625#define CFGADDR1 0xFE36
626#define CFGDATA0 0xFE37
627#define CFGDATA1 0xFE38
628#define CFGDATA2 0xFE39
629#define CFGDATA3 0xFE3A
630#define CFGRWCTL 0xFE3B
631#define PHYRWCTL 0xFE3C
632#define PHYDATA0 0xFE3D
633#define PHYDATA1 0xFE3E
634#define PHYADDR 0xFE3F
635#define MSGRXDATA0 0xFE40
636#define MSGRXDATA1 0xFE41
637#define MSGRXDATA2 0xFE42
638#define MSGRXDATA3 0xFE43
639#define MSGTXDATA0 0xFE44
640#define MSGTXDATA1 0xFE45
641#define MSGTXDATA2 0xFE46
642#define MSGTXDATA3 0xFE47
643#define MSGTXCTL 0xFE48
644#define PETXCFG 0xFE49
645
646#define CDRESUMECTL 0xFE52
647#define WAKE_SEL_CTL 0xFE54
648#define PME_FORCE_CTL 0xFE56
649#define ASPM_FORCE_CTL 0xFE57
650#define PM_CLK_FORCE_CTL 0xFE58
651#define PERST_GLITCH_WIDTH 0xFE5C
652#define CHANGE_LINK_STATE 0xFE5B
653#define RESET_LOAD_REG 0xFE5E
654#define EFUSE_CONTENT 0xFE5F
655#define HOST_SLEEP_STATE 0xFE60
656#define SDIO_CFG 0xFE70
657
658#define NFTS_TX_CTRL 0xFE72
659
660#define PWR_GATE_CTRL 0xFE75
661#define PWD_SUSPEND_EN 0xFE76
662#define LDO_PWR_SEL 0xFE78
663
664#define DUMMY_REG_RESET_0 0xFE90
665
666/* Memory mapping */
667#define SRAM_BASE 0xE600
668#define RBUF_BASE 0xF400
669#define PPBUF_BASE1 0xF800
670#define PPBUF_BASE2 0xFA00
671#define IMAGE_FLAG_ADDR0 0xCE80
672#define IMAGE_FLAG_ADDR1 0xCE81
673
674#define rtsx_pci_init_cmd(pcr) ((pcr)->ci = 0)
675
676struct rtsx_pcr;
677
678struct pcr_handle {
679 struct rtsx_pcr *pcr;
680};
681
682struct pcr_ops {
683 int (*extra_init_hw)(struct rtsx_pcr *pcr);
684 int (*optimize_phy)(struct rtsx_pcr *pcr);
685 int (*turn_on_led)(struct rtsx_pcr *pcr);
686 int (*turn_off_led)(struct rtsx_pcr *pcr);
687 int (*enable_auto_blink)(struct rtsx_pcr *pcr);
688 int (*disable_auto_blink)(struct rtsx_pcr *pcr);
689 int (*card_power_on)(struct rtsx_pcr *pcr, int card);
690 int (*card_power_off)(struct rtsx_pcr *pcr, int card);
691 unsigned int (*cd_deglitch)(struct rtsx_pcr *pcr);
692};
693
694enum PDEV_STAT {PDEV_STAT_IDLE, PDEV_STAT_RUN};
695
696struct rtsx_pcr {
697 struct pci_dev *pci;
698 unsigned int id;
699
700 /* pci resources */
701 unsigned long addr;
702 void __iomem *remap_addr;
703 int irq;
704
705 /* host reserved buffer */
706 void *rtsx_resv_buf;
707 dma_addr_t rtsx_resv_buf_addr;
708
709 void *host_cmds_ptr;
710 dma_addr_t host_cmds_addr;
711 int ci;
712
713 void *host_sg_tbl_ptr;
714 dma_addr_t host_sg_tbl_addr;
715 int sgi;
716
717 u32 bier;
718 char trans_result;
719
720 unsigned int card_inserted;
721 unsigned int card_removed;
722
723 struct delayed_work carddet_work;
724 struct delayed_work idle_work;
725
726 spinlock_t lock;
727 struct mutex pcr_mutex;
728 struct completion *done;
729 struct completion *finish_me;
730
731 unsigned int cur_clock;
732 bool ms_pmos;
733 bool remove_pci;
734 bool msi_en;
735
736#define EXTRA_CAPS_SD_SDR50 (1 << 0)
737#define EXTRA_CAPS_SD_SDR104 (1 << 1)
738#define EXTRA_CAPS_SD_DDR50 (1 << 2)
739#define EXTRA_CAPS_MMC_HSDDR (1 << 3)
740#define EXTRA_CAPS_MMC_HS200 (1 << 4)
741#define EXTRA_CAPS_MMC_8BIT (1 << 5)
742 u32 extra_caps;
743
744#define IC_VER_A 0
745#define IC_VER_B 1
746#define IC_VER_C 2
747#define IC_VER_D 3
748 u8 ic_version;
749
750 const u32 *sd_pull_ctl_enable_tbl;
751 const u32 *sd_pull_ctl_disable_tbl;
752 const u32 *ms_pull_ctl_enable_tbl;
753 const u32 *ms_pull_ctl_disable_tbl;
754
755 const struct pcr_ops *ops;
756 enum PDEV_STAT state;
757
758 int num_slots;
759 struct rtsx_slot *slots;
760};
761
762#define CHK_PCI_PID(pcr, pid) ((pcr)->pci->device == (pid))
763#define PCI_VID(pcr) ((pcr)->pci->vendor)
764#define PCI_PID(pcr) ((pcr)->pci->device)
765
766void rtsx_pci_start_run(struct rtsx_pcr *pcr);
767int rtsx_pci_write_register(struct rtsx_pcr *pcr, u16 addr, u8 mask, u8 data);
768int rtsx_pci_read_register(struct rtsx_pcr *pcr, u16 addr, u8 *data);
769int rtsx_pci_write_phy_register(struct rtsx_pcr *pcr, u8 addr, u16 val);
770int rtsx_pci_read_phy_register(struct rtsx_pcr *pcr, u8 addr, u16 *val);
771void rtsx_pci_stop_cmd(struct rtsx_pcr *pcr);
772void rtsx_pci_add_cmd(struct rtsx_pcr *pcr,
773 u8 cmd_type, u16 reg_addr, u8 mask, u8 data);
774void rtsx_pci_send_cmd_no_wait(struct rtsx_pcr *pcr);
775int rtsx_pci_send_cmd(struct rtsx_pcr *pcr, int timeout);
776int rtsx_pci_transfer_data(struct rtsx_pcr *pcr, struct scatterlist *sglist,
777 int num_sg, bool read, int timeout);
778int rtsx_pci_read_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len);
779int rtsx_pci_write_ppbuf(struct rtsx_pcr *pcr, u8 *buf, int buf_len);
780int rtsx_pci_card_pull_ctl_enable(struct rtsx_pcr *pcr, int card);
781int rtsx_pci_card_pull_ctl_disable(struct rtsx_pcr *pcr, int card);
782int rtsx_pci_switch_clock(struct rtsx_pcr *pcr, unsigned int card_clock,
783 u8 ssc_depth, bool initial_mode, bool double_clk, bool vpclk);
784int rtsx_pci_card_power_on(struct rtsx_pcr *pcr, int card);
785int rtsx_pci_card_power_off(struct rtsx_pcr *pcr, int card);
786unsigned int rtsx_pci_card_exist(struct rtsx_pcr *pcr);
787void rtsx_pci_complete_unfinished_transfer(struct rtsx_pcr *pcr);
788
789static inline u8 *rtsx_pci_get_cmd_data(struct rtsx_pcr *pcr)
790{
791 return (u8 *)(pcr->host_cmds_ptr);
792}
793
794#endif
diff --git a/include/linux/mfd/tps65090.h b/include/linux/mfd/tps65090.h
index 6bc31d854626..804e280c1e1d 100644
--- a/include/linux/mfd/tps65090.h
+++ b/include/linux/mfd/tps65090.h
@@ -24,6 +24,25 @@
24 24
25#include <linux/irq.h> 25#include <linux/irq.h>
26 26
27/* TPS65090 Regulator ID */
28enum {
29 TPS65090_REGULATOR_DCDC1,
30 TPS65090_REGULATOR_DCDC2,
31 TPS65090_REGULATOR_DCDC3,
32 TPS65090_REGULATOR_FET1,
33 TPS65090_REGULATOR_FET2,
34 TPS65090_REGULATOR_FET3,
35 TPS65090_REGULATOR_FET4,
36 TPS65090_REGULATOR_FET5,
37 TPS65090_REGULATOR_FET6,
38 TPS65090_REGULATOR_FET7,
39 TPS65090_REGULATOR_LDO1,
40 TPS65090_REGULATOR_LDO2,
41
42 /* Last entry for maximum ID */
43 TPS65090_REGULATOR_MAX,
44};
45
27struct tps65090 { 46struct tps65090 {
28 struct mutex lock; 47 struct mutex lock;
29 struct device *dev; 48 struct device *dev;
@@ -41,10 +60,26 @@ struct tps65090_subdev_info {
41 void *platform_data; 60 void *platform_data;
42}; 61};
43 62
63/*
64 * struct tps65090_regulator_plat_data
65 *
66 * @reg_init_data: The regulator init data.
67 * @enable_ext_control: Enable extrenal control or not. Only available for
68 * DCDC1, DCDC2 and DCDC3.
69 * @gpio: Gpio number if external control is enabled and controlled through
70 * gpio.
71 */
72struct tps65090_regulator_plat_data {
73 struct regulator_init_data *reg_init_data;
74 bool enable_ext_control;
75 int gpio;
76};
77
44struct tps65090_platform_data { 78struct tps65090_platform_data {
45 int irq_base; 79 int irq_base;
46 int num_subdevs; 80 int num_subdevs;
47 struct tps65090_subdev_info *subdevs; 81 struct tps65090_subdev_info *subdevs;
82 struct tps65090_regulator_plat_data *reg_pdata[TPS65090_REGULATOR_MAX];
48}; 83};
49 84
50/* 85/*
diff --git a/include/linux/mfd/tps6586x.h b/include/linux/mfd/tps6586x.h
index 2dd123194958..f8da0e152567 100644
--- a/include/linux/mfd/tps6586x.h
+++ b/include/linux/mfd/tps6586x.h
@@ -29,6 +29,7 @@ enum {
29 TPS6586X_ID_LDO_8, 29 TPS6586X_ID_LDO_8,
30 TPS6586X_ID_LDO_9, 30 TPS6586X_ID_LDO_9,
31 TPS6586X_ID_LDO_RTC, 31 TPS6586X_ID_LDO_RTC,
32 TPS6586X_ID_MAX_REGULATOR,
32}; 33};
33 34
34enum { 35enum {
@@ -79,6 +80,8 @@ struct tps6586x_platform_data {
79 int gpio_base; 80 int gpio_base;
80 int irq_base; 81 int irq_base;
81 bool pm_off; 82 bool pm_off;
83
84 struct regulator_init_data *reg_init_data[TPS6586X_ID_MAX_REGULATOR];
82}; 85};
83 86
84/* 87/*
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index 1f173306bf05..ae5c249530b4 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -19,6 +19,8 @@
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/regmap.h> 20#include <linux/regmap.h>
21 21
22#include <linux/mfd/wm8994/pdata.h>
23
22enum wm8994_type { 24enum wm8994_type {
23 WM8994 = 0, 25 WM8994 = 0,
24 WM8958 = 1, 26 WM8958 = 1,
@@ -55,6 +57,8 @@ struct regulator_bulk_data;
55struct wm8994 { 57struct wm8994 {
56 struct mutex irq_lock; 58 struct mutex irq_lock;
57 59
60 struct wm8994_pdata pdata;
61
58 enum wm8994_type type; 62 enum wm8994_type type;
59 int revision; 63 int revision;
60 int cust_id; 64 int cust_id;
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index fc87be4fdc25..8e21a094836d 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -176,6 +176,11 @@ struct wm8994_pdata {
176 unsigned int lineout1fb:1; 176 unsigned int lineout1fb:1;
177 unsigned int lineout2fb:1; 177 unsigned int lineout2fb:1;
178 178
179 /* Delay between detecting a jack and starting microphone
180 * detect (specified in ms)
181 */
182 int micdet_delay;
183
179 /* IRQ for microphone detection if brought out directly as a 184 /* IRQ for microphone detection if brought out directly as a
180 * signal. 185 * signal.
181 */ 186 */
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h
index de201203bc7c..adfe8c058f29 100644
--- a/include/linux/micrel_phy.h
+++ b/include/linux/micrel_phy.h
@@ -15,6 +15,7 @@
15 15
16#define MICREL_PHY_ID_MASK 0x00fffff0 16#define MICREL_PHY_ID_MASK 0x00fffff0
17 17
18#define PHY_ID_KSZ8873MLL 0x000e7237
18#define PHY_ID_KSZ9021 0x00221610 19#define PHY_ID_KSZ9021 0x00221610
19#define PHY_ID_KS8737 0x00221720 20#define PHY_ID_KS8737 0x00221720
20#define PHY_ID_KSZ8021 0x00221555 21#define PHY_ID_KSZ8021 0x00221555
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index d52afb9a790c..1e9f627967a3 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -7,6 +7,22 @@
7 7
8typedef struct page *new_page_t(struct page *, unsigned long private, int **); 8typedef struct page *new_page_t(struct page *, unsigned long private, int **);
9 9
10/*
11 * Return values from addresss_space_operations.migratepage():
12 * - negative errno on page migration failure;
13 * - zero on page migration success;
14 *
15 * The balloon page migration introduces this special case where a 'distinct'
16 * return code is used to flag a successful page migration to unmap_and_move().
17 * This approach is necessary because page migration can race against balloon
18 * deflation procedure, and for such case we could introduce a nasty page leak
19 * if a successfully migrated balloon page gets released concurrently with
20 * migration's unmap_and_move() wrap-up steps.
21 */
22#define MIGRATEPAGE_SUCCESS 0
23#define MIGRATEPAGE_BALLOON_SUCCESS 1 /* special ret code for balloon page
24 * sucessful migration case.
25 */
10enum migrate_reason { 26enum migrate_reason {
11 MR_COMPACTION, 27 MR_COMPACTION,
12 MR_MEMORY_FAILURE, 28 MR_MEMORY_FAILURE,
@@ -20,6 +36,7 @@ enum migrate_reason {
20#ifdef CONFIG_MIGRATION 36#ifdef CONFIG_MIGRATION
21 37
22extern void putback_lru_pages(struct list_head *l); 38extern void putback_lru_pages(struct list_head *l);
39extern void putback_movable_pages(struct list_head *l);
23extern int migrate_page(struct address_space *, 40extern int migrate_page(struct address_space *,
24 struct page *, struct page *, enum migrate_mode); 41 struct page *, struct page *, enum migrate_mode);
25extern int migrate_pages(struct list_head *l, new_page_t x, 42extern int migrate_pages(struct list_head *l, new_page_t x,
@@ -43,6 +60,7 @@ extern int migrate_huge_page_move_mapping(struct address_space *mapping,
43#else 60#else
44 61
45static inline void putback_lru_pages(struct list_head *l) {} 62static inline void putback_lru_pages(struct list_head *l) {}
63static inline void putback_movable_pages(struct list_head *l) {}
46static inline int migrate_pages(struct list_head *l, new_page_t x, 64static inline int migrate_pages(struct list_head *l, new_page_t x,
47 unsigned long private, bool offlining, 65 unsigned long private, bool offlining,
48 enum migrate_mode mode, int reason) { return -ENOSYS; } 66 enum migrate_mode mode, int reason) { return -ENOSYS; }
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index e0deeb2cc939..09c2300ddb37 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -34,6 +34,7 @@
34#define MWAVE_MINOR 219 /* ACP/Mwave Modem */ 34#define MWAVE_MINOR 219 /* ACP/Mwave Modem */
35#define MPT_MINOR 220 35#define MPT_MINOR 220
36#define MPT2SAS_MINOR 221 36#define MPT2SAS_MINOR 221
37#define MPT3SAS_MINOR 222
37#define UINPUT_MINOR 223 38#define UINPUT_MINOR 223
38#define MISC_MCELOG_MINOR 227 39#define MISC_MCELOG_MINOR 227
39#define HPET_MINOR 228 40#define HPET_MINOR 228
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 6d1acb04cd17..21821da2abfd 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -142,6 +142,8 @@ enum {
142 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48, 142 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48,
143 MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55, 143 MLX4_DEV_CAP_FLAG_SENSE_SUPPORT = 1LL << 55,
144 MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV = 1LL << 59, 144 MLX4_DEV_CAP_FLAG_PORT_MNG_CHG_EV = 1LL << 59,
145 MLX4_DEV_CAP_FLAG_64B_EQE = 1LL << 61,
146 MLX4_DEV_CAP_FLAG_64B_CQE = 1LL << 62
145}; 147};
146 148
147enum { 149enum {
@@ -151,6 +153,20 @@ enum {
151 MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3 153 MLX4_DEV_CAP_FLAG2_FS_EN = 1LL << 3
152}; 154};
153 155
156enum {
157 MLX4_DEV_CAP_64B_EQE_ENABLED = 1LL << 0,
158 MLX4_DEV_CAP_64B_CQE_ENABLED = 1LL << 1
159};
160
161enum {
162 MLX4_USER_DEV_CAP_64B_CQE = 1L << 0
163};
164
165enum {
166 MLX4_FUNC_CAP_64B_EQE_CQE = 1L << 0
167};
168
169
154#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90) 170#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90)
155 171
156enum { 172enum {
@@ -419,6 +435,11 @@ struct mlx4_caps {
419 u32 max_counters; 435 u32 max_counters;
420 u8 port_ib_mtu[MLX4_MAX_PORTS + 1]; 436 u8 port_ib_mtu[MLX4_MAX_PORTS + 1];
421 u16 sqp_demux; 437 u16 sqp_demux;
438 u32 eqe_size;
439 u32 cqe_size;
440 u8 eqe_factor;
441 u32 userspace_caps; /* userspace must be aware of these */
442 u32 function_caps; /* VFs must be aware of these */
422}; 443};
423 444
424struct mlx4_buf_list { 445struct mlx4_buf_list {
diff --git a/include/linux/mm.h b/include/linux/mm.h
index d87f9ec4a145..7f4f906190bd 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1489,6 +1489,37 @@ extern unsigned long vm_mmap(struct file *, unsigned long,
1489 unsigned long, unsigned long, 1489 unsigned long, unsigned long,
1490 unsigned long, unsigned long); 1490 unsigned long, unsigned long);
1491 1491
1492struct vm_unmapped_area_info {
1493#define VM_UNMAPPED_AREA_TOPDOWN 1
1494 unsigned long flags;
1495 unsigned long length;
1496 unsigned long low_limit;
1497 unsigned long high_limit;
1498 unsigned long align_mask;
1499 unsigned long align_offset;
1500};
1501
1502extern unsigned long unmapped_area(struct vm_unmapped_area_info *info);
1503extern unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info);
1504
1505/*
1506 * Search for an unmapped address range.
1507 *
1508 * We are looking for a range that:
1509 * - does not intersect with any VMA;
1510 * - is contained within the [low_limit, high_limit) interval;
1511 * - is at least the desired size.
1512 * - satisfies (begin_addr & align_mask) == (align_offset & align_mask)
1513 */
1514static inline unsigned long
1515vm_unmapped_area(struct vm_unmapped_area_info *info)
1516{
1517 if (!(info->flags & VM_UNMAPPED_AREA_TOPDOWN))
1518 return unmapped_area(info);
1519 else
1520 return unmapped_area_topdown(info);
1521}
1522
1492/* truncate.c */ 1523/* truncate.c */
1493extern void truncate_inode_pages(struct address_space *, loff_t); 1524extern void truncate_inode_pages(struct address_space *, loff_t);
1494extern void truncate_inode_pages_range(struct address_space *, 1525extern void truncate_inode_pages_range(struct address_space *,
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 197422a1598c..7d9ebb7cc982 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -228,7 +228,8 @@ struct vm_region {
228 * library, the executable area etc). 228 * library, the executable area etc).
229 */ 229 */
230struct vm_area_struct { 230struct vm_area_struct {
231 struct mm_struct * vm_mm; /* The address space we belong to. */ 231 /* The first cache line has the info for VMA tree walking. */
232
232 unsigned long vm_start; /* Our start address within vm_mm. */ 233 unsigned long vm_start; /* Our start address within vm_mm. */
233 unsigned long vm_end; /* The first byte after our end address 234 unsigned long vm_end; /* The first byte after our end address
234 within vm_mm. */ 235 within vm_mm. */
@@ -236,11 +237,22 @@ struct vm_area_struct {
236 /* linked list of VM areas per task, sorted by address */ 237 /* linked list of VM areas per task, sorted by address */
237 struct vm_area_struct *vm_next, *vm_prev; 238 struct vm_area_struct *vm_next, *vm_prev;
238 239
240 struct rb_node vm_rb;
241
242 /*
243 * Largest free memory gap in bytes to the left of this VMA.
244 * Either between this VMA and vma->vm_prev, or between one of the
245 * VMAs below us in the VMA rbtree and its ->vm_prev. This helps
246 * get_unmapped_area find a free area of the right size.
247 */
248 unsigned long rb_subtree_gap;
249
250 /* Second cache line starts here. */
251
252 struct mm_struct *vm_mm; /* The address space we belong to. */
239 pgprot_t vm_page_prot; /* Access permissions of this VMA. */ 253 pgprot_t vm_page_prot; /* Access permissions of this VMA. */
240 unsigned long vm_flags; /* Flags, see mm.h. */ 254 unsigned long vm_flags; /* Flags, see mm.h. */
241 255
242 struct rb_node vm_rb;
243
244 /* 256 /*
245 * For areas with an address space and backing store, 257 * For areas with an address space and backing store,
246 * linkage into the address_space->i_mmap interval tree, or 258 * linkage into the address_space->i_mmap interval tree, or
@@ -326,6 +338,7 @@ struct mm_struct {
326 unsigned long task_size; /* size of task vm space */ 338 unsigned long task_size; /* size of task vm space */
327 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ 339 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
328 unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */ 340 unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */
341 unsigned long highest_vm_end; /* highest vma end address */
329 pgd_t * pgd; 342 pgd_t * pgd;
330 atomic_t mm_users; /* How many users with user space? */ 343 atomic_t mm_users; /* How many users with user space? */
331 atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ 344 atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */
diff --git a/include/linux/mman.h b/include/linux/mman.h
index d09dde1e57fb..9aa863da287f 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -11,6 +11,8 @@ extern int sysctl_overcommit_memory;
11extern int sysctl_overcommit_ratio; 11extern int sysctl_overcommit_ratio;
12extern struct percpu_counter vm_committed_as; 12extern struct percpu_counter vm_committed_as;
13 13
14unsigned long vm_memory_committed(void);
15
14static inline void vm_acct_memory(long pages) 16static inline void vm_acct_memory(long pages)
15{ 17{
16 percpu_counter_add(&vm_committed_as, pages); 18 percpu_counter_add(&vm_committed_as, pages);
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 943550dfe9ea..5c69315d60cc 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -85,6 +85,7 @@ struct mmc_ext_csd {
85 bool boot_ro_lockable; 85 bool boot_ro_lockable;
86 u8 raw_exception_status; /* 53 */ 86 u8 raw_exception_status; /* 53 */
87 u8 raw_partition_support; /* 160 */ 87 u8 raw_partition_support; /* 160 */
88 u8 raw_rpmb_size_mult; /* 168 */
88 u8 raw_erased_mem_count; /* 181 */ 89 u8 raw_erased_mem_count; /* 181 */
89 u8 raw_ext_csd_structure; /* 194 */ 90 u8 raw_ext_csd_structure; /* 194 */
90 u8 raw_card_type; /* 196 */ 91 u8 raw_card_type; /* 196 */
@@ -206,6 +207,7 @@ struct mmc_part {
206#define MMC_BLK_DATA_AREA_MAIN (1<<0) 207#define MMC_BLK_DATA_AREA_MAIN (1<<0)
207#define MMC_BLK_DATA_AREA_BOOT (1<<1) 208#define MMC_BLK_DATA_AREA_BOOT (1<<1)
208#define MMC_BLK_DATA_AREA_GP (1<<2) 209#define MMC_BLK_DATA_AREA_GP (1<<2)
210#define MMC_BLK_DATA_AREA_RPMB (1<<3)
209}; 211};
210 212
211/* 213/*
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 9b9cdafc7737..5bf7c2274fcb 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -170,6 +170,8 @@ extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
170extern unsigned int mmc_calc_max_discard(struct mmc_card *card); 170extern unsigned int mmc_calc_max_discard(struct mmc_card *card);
171 171
172extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); 172extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
173extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount,
174 bool is_rel_write);
173extern int mmc_hw_reset(struct mmc_host *host); 175extern int mmc_hw_reset(struct mmc_host *host);
174extern int mmc_hw_reset_check(struct mmc_host *host); 176extern int mmc_hw_reset_check(struct mmc_host *host);
175extern int mmc_can_reset(struct mmc_card *card); 177extern int mmc_can_reset(struct mmc_card *card);
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index 96531664a061..34be4f47293c 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -229,8 +229,9 @@ struct dw_mci_board {
229 u32 quirks; /* Workaround / Quirk flags */ 229 u32 quirks; /* Workaround / Quirk flags */
230 unsigned int bus_hz; /* Clock speed at the cclk_in pad */ 230 unsigned int bus_hz; /* Clock speed at the cclk_in pad */
231 231
232 unsigned int caps; /* Capabilities */ 232 u32 caps; /* Capabilities */
233 unsigned int caps2; /* More capabilities */ 233 u32 caps2; /* More capabilities */
234 u32 pm_caps; /* PM capabilities */
234 /* 235 /*
235 * Override fifo depth. If 0, autodetect it from the FIFOTH register, 236 * Override fifo depth. If 0, autodetect it from the FIFOTH register,
236 * but note that this may not be reliable after a bootloader has used 237 * but note that this may not be reliable after a bootloader has used
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7abb0e1f7bda..61a10c17aabd 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -53,12 +53,12 @@ struct mmc_ios {
53#define MMC_TIMING_LEGACY 0 53#define MMC_TIMING_LEGACY 0
54#define MMC_TIMING_MMC_HS 1 54#define MMC_TIMING_MMC_HS 1
55#define MMC_TIMING_SD_HS 2 55#define MMC_TIMING_SD_HS 2
56#define MMC_TIMING_UHS_SDR12 MMC_TIMING_LEGACY 56#define MMC_TIMING_UHS_SDR12 3
57#define MMC_TIMING_UHS_SDR25 MMC_TIMING_SD_HS 57#define MMC_TIMING_UHS_SDR25 4
58#define MMC_TIMING_UHS_SDR50 3 58#define MMC_TIMING_UHS_SDR50 5
59#define MMC_TIMING_UHS_SDR104 4 59#define MMC_TIMING_UHS_SDR104 6
60#define MMC_TIMING_UHS_DDR50 5 60#define MMC_TIMING_UHS_DDR50 7
61#define MMC_TIMING_MMC_HS200 6 61#define MMC_TIMING_MMC_HS200 8
62 62
63#define MMC_SDR_MODE 0 63#define MMC_SDR_MODE 0
64#define MMC_1_2V_DDR_MODE 1 64#define MMC_1_2V_DDR_MODE 1
@@ -136,6 +136,7 @@ struct mmc_host_ops {
136 void (*enable_preset_value)(struct mmc_host *host, bool enable); 136 void (*enable_preset_value)(struct mmc_host *host, bool enable);
137 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); 137 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
138 void (*hw_reset)(struct mmc_host *host); 138 void (*hw_reset)(struct mmc_host *host);
139 void (*card_event)(struct mmc_host *host);
139}; 140};
140 141
141struct mmc_card; 142struct mmc_card;
@@ -211,7 +212,7 @@ struct mmc_host {
211#define MMC_VDD_34_35 0x00400000 /* VDD voltage 3.4 ~ 3.5 */ 212#define MMC_VDD_34_35 0x00400000 /* VDD voltage 3.4 ~ 3.5 */
212#define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */ 213#define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */
213 214
214 unsigned long caps; /* Host capabilities */ 215 u32 caps; /* Host capabilities */
215 216
216#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ 217#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */
217#define MMC_CAP_MMC_HIGHSPEED (1 << 1) /* Can do MMC high-speed timing */ 218#define MMC_CAP_MMC_HIGHSPEED (1 << 1) /* Can do MMC high-speed timing */
@@ -241,7 +242,7 @@ struct mmc_host {
241#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ 242#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */
242#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ 243#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */
243 244
244 unsigned int caps2; /* More host capabilities */ 245 u32 caps2; /* More host capabilities */
245 246
246#define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ 247#define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */
247#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ 248#define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 01e4b394029b..94d532e41c61 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -286,6 +286,7 @@ struct _mmc_csd {
286#define EXT_CSD_BKOPS_START 164 /* W */ 286#define EXT_CSD_BKOPS_START 164 /* W */
287#define EXT_CSD_SANITIZE_START 165 /* W */ 287#define EXT_CSD_SANITIZE_START 165 /* W */
288#define EXT_CSD_WR_REL_PARAM 166 /* RO */ 288#define EXT_CSD_WR_REL_PARAM 166 /* RO */
289#define EXT_CSD_RPMB_MULT 168 /* RO */
289#define EXT_CSD_BOOT_WP 173 /* R/W */ 290#define EXT_CSD_BOOT_WP 173 /* R/W */
290#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ 291#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */
291#define EXT_CSD_PART_CONFIG 179 /* R/W */ 292#define EXT_CSD_PART_CONFIG 179 /* R/W */
@@ -339,6 +340,7 @@ struct _mmc_csd {
339 340
340#define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) 341#define EXT_CSD_PART_CONFIG_ACC_MASK (0x7)
341#define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) 342#define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1)
343#define EXT_CSD_PART_CONFIG_ACC_RPMB (0x3)
342#define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) 344#define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4)
343 345
344#define EXT_CSD_PART_SUPPORT_PART_EN (0x1) 346#define EXT_CSD_PART_SUPPORT_PART_EN (0x1)
diff --git a/include/linux/mmc/mxs-mmc.h b/include/linux/mmc/mxs-mmc.h
deleted file mode 100644
index 7c2ad3a7f2f3..000000000000
--- a/include/linux/mmc/mxs-mmc.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * Copyright 2011 Freescale Semiconductor, Inc. All Rights Reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __LINUX_MMC_MXS_MMC_H__
10#define __LINUX_MMC_MXS_MMC_H__
11
12struct mxs_mmc_platform_data {
13 int wp_gpio; /* write protect pin */
14 unsigned int flags;
15#define SLOTF_4_BIT_CAPABLE (1 << 0)
16#define SLOTF_8_BIT_CAPABLE (1 << 1)
17};
18
19#endif /* __LINUX_MMC_MXS_MMC_H__ */
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 1edcb4dad8c4..4bbc3301fbbf 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -92,6 +92,8 @@ struct sdhci_host {
92 92
93#define SDHCI_QUIRK2_HOST_OFF_CARD_ON (1<<0) 93#define SDHCI_QUIRK2_HOST_OFF_CARD_ON (1<<0)
94#define SDHCI_QUIRK2_HOST_NO_CMD23 (1<<1) 94#define SDHCI_QUIRK2_HOST_NO_CMD23 (1<<1)
95/* The system physically doesn't support 1.8v, even if the host does */
96#define SDHCI_QUIRK2_NO_1_8_V (1<<2)
95 97
96 int irq; /* Device IRQ */ 98 int irq; /* Device IRQ */
97 void __iomem *ioaddr; /* Mapped address */ 99 void __iomem *ioaddr; /* Mapped address */
@@ -158,8 +160,8 @@ struct sdhci_host {
158 160
159 struct timer_list timer; /* Timer for timeouts */ 161 struct timer_list timer; /* Timer for timeouts */
160 162
161 unsigned int caps; /* Alternative CAPABILITY_0 */ 163 u32 caps; /* Alternative CAPABILITY_0 */
162 unsigned int caps1; /* Alternative CAPABILITY_1 */ 164 u32 caps1; /* Alternative CAPABILITY_1 */
163 165
164 unsigned int ocr_avail_sdio; /* OCR bit masks */ 166 unsigned int ocr_avail_sdio; /* OCR bit masks */
165 unsigned int ocr_avail_sd; 167 unsigned int ocr_avail_sd;
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 28601fdfcdb2..4bec5be82cab 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -63,10 +63,8 @@ enum {
63 63
64#ifdef CONFIG_CMA 64#ifdef CONFIG_CMA
65# define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA) 65# define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA)
66# define cma_wmark_pages(zone) zone->min_cma_pages
67#else 66#else
68# define is_migrate_cma(migratetype) false 67# define is_migrate_cma(migratetype) false
69# define cma_wmark_pages(zone) 0
70#endif 68#endif
71 69
72#define for_each_migratetype_order(order, type) \ 70#define for_each_migratetype_order(order, type) \
@@ -383,13 +381,6 @@ struct zone {
383 /* see spanned/present_pages for more description */ 381 /* see spanned/present_pages for more description */
384 seqlock_t span_seqlock; 382 seqlock_t span_seqlock;
385#endif 383#endif
386#ifdef CONFIG_CMA
387 /*
388 * CMA needs to increase watermark levels during the allocation
389 * process to make sure that the system is not starved.
390 */
391 unsigned long min_cma_pages;
392#endif
393 struct free_area free_area[MAX_ORDER]; 384 struct free_area free_area[MAX_ORDER];
394 385
395#ifndef CONFIG_SPARSEMEM 386#ifndef CONFIG_SPARSEMEM
@@ -469,17 +460,44 @@ struct zone {
469 unsigned long zone_start_pfn; 460 unsigned long zone_start_pfn;
470 461
471 /* 462 /*
472 * zone_start_pfn, spanned_pages and present_pages are all 463 * spanned_pages is the total pages spanned by the zone, including
473 * protected by span_seqlock. It is a seqlock because it has 464 * holes, which is calculated as:
474 * to be read outside of zone->lock, and it is done in the main 465 * spanned_pages = zone_end_pfn - zone_start_pfn;
475 * allocator path. But, it is written quite infrequently. 466 *
467 * present_pages is physical pages existing within the zone, which
468 * is calculated as:
469 * present_pages = spanned_pages - absent_pages(pags in holes);
476 * 470 *
477 * The lock is declared along with zone->lock because it is 471 * managed_pages is present pages managed by the buddy system, which
472 * is calculated as (reserved_pages includes pages allocated by the
473 * bootmem allocator):
474 * managed_pages = present_pages - reserved_pages;
475 *
476 * So present_pages may be used by memory hotplug or memory power
477 * management logic to figure out unmanaged pages by checking
478 * (present_pages - managed_pages). And managed_pages should be used
479 * by page allocator and vm scanner to calculate all kinds of watermarks
480 * and thresholds.
481 *
482 * Locking rules:
483 *
484 * zone_start_pfn and spanned_pages are protected by span_seqlock.
485 * It is a seqlock because it has to be read outside of zone->lock,
486 * and it is done in the main allocator path. But, it is written
487 * quite infrequently.
488 *
489 * The span_seq lock is declared along with zone->lock because it is
478 * frequently read in proximity to zone->lock. It's good to 490 * frequently read in proximity to zone->lock. It's good to
479 * give them a chance of being in the same cacheline. 491 * give them a chance of being in the same cacheline.
492 *
493 * Write access to present_pages and managed_pages at runtime should
494 * be protected by lock_memory_hotplug()/unlock_memory_hotplug().
495 * Any reader who can't tolerant drift of present_pages and
496 * managed_pages should hold memory hotplug lock to get a stable value.
480 */ 497 */
481 unsigned long spanned_pages; /* total size, including holes */ 498 unsigned long spanned_pages;
482 unsigned long present_pages; /* amount of memory (excluding holes) */ 499 unsigned long present_pages;
500 unsigned long managed_pages;
483 501
484 /* 502 /*
485 * rarely used fields: 503 * rarely used fields:
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f8eda0276f03..02e0f6b156c3 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -369,7 +369,7 @@ typedef enum gro_result gro_result_t;
369 * 369 *
370 * If the rx_handler consider the skb should be ignored, it should return 370 * If the rx_handler consider the skb should be ignored, it should return
371 * RX_HANDLER_EXACT. The skb will only be delivered to protocol handlers that 371 * RX_HANDLER_EXACT. The skb will only be delivered to protocol handlers that
372 * are registred on exact device (ptype->dev == skb->dev). 372 * are registered on exact device (ptype->dev == skb->dev).
373 * 373 *
374 * If the rx_handler didn't changed skb->dev, but want the skb to be normally 374 * If the rx_handler didn't changed skb->dev, but want the skb to be normally
375 * delivered, it should return RX_HANDLER_PASS. 375 * delivered, it should return RX_HANDLER_PASS.
@@ -887,6 +887,10 @@ struct netdev_fcoe_hbainfo {
887 * struct net_device *dev, int idx) 887 * struct net_device *dev, int idx)
888 * Used to add FDB entries to dump requests. Implementers should add 888 * Used to add FDB entries to dump requests. Implementers should add
889 * entries to skb and update idx with the number of entries. 889 * entries to skb and update idx with the number of entries.
890 *
891 * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh)
892 * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq,
893 * struct net_device *dev)
890 */ 894 */
891struct net_device_ops { 895struct net_device_ops {
892 int (*ndo_init)(struct net_device *dev); 896 int (*ndo_init)(struct net_device *dev);
@@ -998,6 +1002,12 @@ struct net_device_ops {
998 struct netlink_callback *cb, 1002 struct netlink_callback *cb,
999 struct net_device *dev, 1003 struct net_device *dev,
1000 int idx); 1004 int idx);
1005
1006 int (*ndo_bridge_setlink)(struct net_device *dev,
1007 struct nlmsghdr *nlh);
1008 int (*ndo_bridge_getlink)(struct sk_buff *skb,
1009 u32 pid, u32 seq,
1010 struct net_device *dev);
1001}; 1011};
1002 1012
1003/* 1013/*
@@ -1053,6 +1063,12 @@ struct net_device {
1053 netdev_features_t wanted_features; 1063 netdev_features_t wanted_features;
1054 /* mask of features inheritable by VLAN devices */ 1064 /* mask of features inheritable by VLAN devices */
1055 netdev_features_t vlan_features; 1065 netdev_features_t vlan_features;
1066 /* mask of features inherited by encapsulating devices
1067 * This field indicates what encapsulation offloads
1068 * the hardware is capable of doing, and drivers will
1069 * need to set them appropriately.
1070 */
1071 netdev_features_t hw_enc_features;
1056 1072
1057 /* Interface index. Unique device identifier */ 1073 /* Interface index. Unique device identifier */
1058 int ifindex; 1074 int ifindex;
@@ -1488,6 +1504,9 @@ struct napi_gro_cb {
1488 1504
1489 /* Used in ipv6_gro_receive() */ 1505 /* Used in ipv6_gro_receive() */
1490 int proto; 1506 int proto;
1507
1508 /* used in skb_gro_receive() slow path */
1509 struct sk_buff *last;
1491}; 1510};
1492 1511
1493#define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb) 1512#define NAPI_GRO_CB(skb) ((struct napi_gro_cb *)(skb)->cb)
@@ -1499,16 +1518,25 @@ struct packet_type {
1499 struct net_device *, 1518 struct net_device *,
1500 struct packet_type *, 1519 struct packet_type *,
1501 struct net_device *); 1520 struct net_device *);
1521 bool (*id_match)(struct packet_type *ptype,
1522 struct sock *sk);
1523 void *af_packet_priv;
1524 struct list_head list;
1525};
1526
1527struct offload_callbacks {
1502 struct sk_buff *(*gso_segment)(struct sk_buff *skb, 1528 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
1503 netdev_features_t features); 1529 netdev_features_t features);
1504 int (*gso_send_check)(struct sk_buff *skb); 1530 int (*gso_send_check)(struct sk_buff *skb);
1505 struct sk_buff **(*gro_receive)(struct sk_buff **head, 1531 struct sk_buff **(*gro_receive)(struct sk_buff **head,
1506 struct sk_buff *skb); 1532 struct sk_buff *skb);
1507 int (*gro_complete)(struct sk_buff *skb); 1533 int (*gro_complete)(struct sk_buff *skb);
1508 bool (*id_match)(struct packet_type *ptype, 1534};
1509 struct sock *sk); 1535
1510 void *af_packet_priv; 1536struct packet_offload {
1511 struct list_head list; 1537 __be16 type; /* This is really htons(ether_type). */
1538 struct offload_callbacks callbacks;
1539 struct list_head list;
1512}; 1540};
1513 1541
1514#include <linux/notifier.h> 1542#include <linux/notifier.h>
@@ -1548,6 +1576,8 @@ extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1548 1576
1549extern rwlock_t dev_base_lock; /* Device list lock */ 1577extern rwlock_t dev_base_lock; /* Device list lock */
1550 1578
1579extern seqlock_t devnet_rename_seq; /* Device rename lock */
1580
1551 1581
1552#define for_each_netdev(net, d) \ 1582#define for_each_netdev(net, d) \
1553 list_for_each_entry(d, &(net)->dev_base_head, dev_list) 1583 list_for_each_entry(d, &(net)->dev_base_head, dev_list)
@@ -1605,6 +1635,9 @@ extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short
1605extern void dev_add_pack(struct packet_type *pt); 1635extern void dev_add_pack(struct packet_type *pt);
1606extern void dev_remove_pack(struct packet_type *pt); 1636extern void dev_remove_pack(struct packet_type *pt);
1607extern void __dev_remove_pack(struct packet_type *pt); 1637extern void __dev_remove_pack(struct packet_type *pt);
1638extern void dev_add_offload(struct packet_offload *po);
1639extern void dev_remove_offload(struct packet_offload *po);
1640extern void __dev_remove_offload(struct packet_offload *po);
1608 1641
1609extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, 1642extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags,
1610 unsigned short mask); 1643 unsigned short mask);
@@ -2129,16 +2162,10 @@ extern void dev_kfree_skb_any(struct sk_buff *skb);
2129extern int netif_rx(struct sk_buff *skb); 2162extern int netif_rx(struct sk_buff *skb);
2130extern int netif_rx_ni(struct sk_buff *skb); 2163extern int netif_rx_ni(struct sk_buff *skb);
2131extern int netif_receive_skb(struct sk_buff *skb); 2164extern int netif_receive_skb(struct sk_buff *skb);
2132extern gro_result_t dev_gro_receive(struct napi_struct *napi,
2133 struct sk_buff *skb);
2134extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
2135extern gro_result_t napi_gro_receive(struct napi_struct *napi, 2165extern gro_result_t napi_gro_receive(struct napi_struct *napi,
2136 struct sk_buff *skb); 2166 struct sk_buff *skb);
2137extern void napi_gro_flush(struct napi_struct *napi, bool flush_old); 2167extern void napi_gro_flush(struct napi_struct *napi, bool flush_old);
2138extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 2168extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
2139extern gro_result_t napi_frags_finish(struct napi_struct *napi,
2140 struct sk_buff *skb,
2141 gro_result_t ret);
2142extern gro_result_t napi_gro_frags(struct napi_struct *napi); 2169extern gro_result_t napi_gro_frags(struct napi_struct *napi);
2143 2170
2144static inline void napi_free_frags(struct napi_struct *napi) 2171static inline void napi_free_frags(struct napi_struct *napi)
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 5f84c6229dc6..610208b18c05 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -47,15 +47,6 @@ ip6t_ext_hdr(u8 nexthdr)
47 (nexthdr == IPPROTO_DSTOPTS); 47 (nexthdr == IPPROTO_DSTOPTS);
48} 48}
49 49
50enum {
51 IP6T_FH_F_FRAG = (1 << 0),
52 IP6T_FH_F_AUTH = (1 << 1),
53};
54
55/* find specified header and get offset to it */
56extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
57 int target, unsigned short *fragoff, int *fragflg);
58
59#ifdef CONFIG_COMPAT 50#ifdef CONFIG_COMPAT
60#include <net/compat.h> 51#include <net/compat.h>
61 52
diff --git a/include/linux/nfc/pn544.h b/include/linux/nfc/pn544.h
deleted file mode 100644
index 9890bbaf4328..000000000000
--- a/include/linux/nfc/pn544.h
+++ /dev/null
@@ -1,104 +0,0 @@
1/*
2 * Driver include for the PN544 NFC chip.
3 *
4 * Copyright (C) Nokia Corporation
5 *
6 * Author: Jari Vanhala <ext-jari.vanhala@nokia.com>
7 * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.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,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef _PN544_H_
24#define _PN544_H_
25
26#include <linux/i2c.h>
27
28#define PN544_DRIVER_NAME "pn544"
29#define PN544_MAXWINDOW_SIZE 7
30#define PN544_WINDOW_SIZE 4
31#define PN544_RETRIES 10
32#define PN544_MAX_I2C_TRANSFER 0x0400
33#define PN544_MSG_MAX_SIZE 0x21 /* at normal HCI mode */
34
35/* ioctl */
36#define PN544_CHAR_BASE 'P'
37#define PN544_IOR(num, dtype) _IOR(PN544_CHAR_BASE, num, dtype)
38#define PN544_IOW(num, dtype) _IOW(PN544_CHAR_BASE, num, dtype)
39#define PN544_GET_FW_MODE PN544_IOW(1, unsigned int)
40#define PN544_SET_FW_MODE PN544_IOW(2, unsigned int)
41#define PN544_GET_DEBUG PN544_IOW(3, unsigned int)
42#define PN544_SET_DEBUG PN544_IOW(4, unsigned int)
43
44/* Timing restrictions (ms) */
45#define PN544_RESETVEN_TIME 30 /* 7 */
46#define PN544_PVDDVEN_TIME 0
47#define PN544_VBATVEN_TIME 0
48#define PN544_GPIO4VEN_TIME 0
49#define PN544_WAKEUP_ACK 5
50#define PN544_WAKEUP_GUARD (PN544_WAKEUP_ACK + 1)
51#define PN544_INACTIVITY_TIME 1000
52#define PN544_INTERFRAME_DELAY 200 /* us */
53#define PN544_BAUDRATE_CHANGE 150 /* us */
54
55/* Debug bits */
56#define PN544_DEBUG_BUF 0x01
57#define PN544_DEBUG_READ 0x02
58#define PN544_DEBUG_WRITE 0x04
59#define PN544_DEBUG_IRQ 0x08
60#define PN544_DEBUG_CALLS 0x10
61#define PN544_DEBUG_MODE 0x20
62
63/* Normal (HCI) mode */
64#define PN544_LLC_HCI_OVERHEAD 3 /* header + crc (to length) */
65#define PN544_LLC_MIN_SIZE (1 + PN544_LLC_HCI_OVERHEAD) /* length + */
66#define PN544_LLC_MAX_DATA (PN544_MSG_MAX_SIZE - 2)
67#define PN544_LLC_MAX_HCI_SIZE (PN544_LLC_MAX_DATA - 2)
68
69struct pn544_llc_packet {
70 unsigned char length; /* of rest of packet */
71 unsigned char header;
72 unsigned char data[PN544_LLC_MAX_DATA]; /* includes crc-ccitt */
73};
74
75/* Firmware upgrade mode */
76#define PN544_FW_HEADER_SIZE 3
77/* max fw transfer is 1024bytes, but I2C limits it to 0xC0 */
78#define PN544_MAX_FW_DATA (PN544_MAX_I2C_TRANSFER - PN544_FW_HEADER_SIZE)
79
80struct pn544_fw_packet {
81 unsigned char command; /* status in answer */
82 unsigned char length[2]; /* big-endian order (msf) */
83 unsigned char data[PN544_MAX_FW_DATA];
84};
85
86#ifdef __KERNEL__
87enum {
88 NFC_GPIO_ENABLE,
89 NFC_GPIO_FW_RESET,
90 NFC_GPIO_IRQ
91};
92
93/* board config */
94struct pn544_nfc_platform_data {
95 int (*request_resources) (struct i2c_client *client);
96 void (*free_resources) (void);
97 void (*enable) (int fw);
98 int (*test) (void);
99 void (*disable) (void);
100 int (*get_gpio)(int type);
101};
102#endif /* __KERNEL__ */
103
104#endif /* _PN544_H_ */
diff --git a/include/linux/node.h b/include/linux/node.h
index 624e53cecc02..2115ad5d6f19 100644
--- a/include/linux/node.h
+++ b/include/linux/node.h
@@ -27,10 +27,9 @@ struct node {
27}; 27};
28 28
29struct memory_block; 29struct memory_block;
30extern struct node node_devices[]; 30extern struct node *node_devices[];
31typedef void (*node_registration_func_t)(struct node *); 31typedef void (*node_registration_func_t)(struct node *);
32 32
33extern int register_node(struct node *, int, struct node *);
34extern void unregister_node(struct node *node); 33extern void unregister_node(struct node *node);
35#ifdef CONFIG_NUMA 34#ifdef CONFIG_NUMA
36extern int register_one_node(int nid); 35extern int register_one_node(int nid);
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index 7afc36334d52..4e2cbfa640b7 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -380,6 +380,11 @@ enum node_states {
380#else 380#else
381 N_HIGH_MEMORY = N_NORMAL_MEMORY, 381 N_HIGH_MEMORY = N_NORMAL_MEMORY,
382#endif 382#endif
383#ifdef CONFIG_MOVABLE_NODE
384 N_MEMORY, /* The node has memory(regular, high, movable) */
385#else
386 N_MEMORY = N_HIGH_MEMORY,
387#endif
383 N_CPU, /* The node has one or more cpus */ 388 N_CPU, /* The node has one or more cpus */
384 NR_NODE_STATES 389 NR_NODE_STATES
385}; 390};
diff --git a/include/linux/of.h b/include/linux/of.h
index b4e50d56fc74..6cfea9aa401f 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -46,7 +46,7 @@ struct device_node {
46 const char *name; 46 const char *name;
47 const char *type; 47 const char *type;
48 phandle phandle; 48 phandle phandle;
49 char *full_name; 49 const char *full_name;
50 50
51 struct property *properties; 51 struct property *properties;
52 struct property *deadprops; /* removed properties */ 52 struct property *deadprops; /* removed properties */
@@ -60,7 +60,7 @@ struct device_node {
60 unsigned long _flags; 60 unsigned long _flags;
61 void *data; 61 void *data;
62#if defined(CONFIG_SPARC) 62#if defined(CONFIG_SPARC)
63 char *path_component_name; 63 const char *path_component_name;
64 unsigned int unique_id; 64 unsigned int unique_id;
65 struct of_irq_controller *irq_trans; 65 struct of_irq_controller *irq_trans;
66#endif 66#endif
@@ -88,14 +88,14 @@ static inline void of_node_put(struct device_node *node) { }
88#ifdef CONFIG_OF 88#ifdef CONFIG_OF
89 89
90/* Pointer for first entry in chain of all nodes. */ 90/* Pointer for first entry in chain of all nodes. */
91extern struct device_node *allnodes; 91extern struct device_node *of_allnodes;
92extern struct device_node *of_chosen; 92extern struct device_node *of_chosen;
93extern struct device_node *of_aliases; 93extern struct device_node *of_aliases;
94extern rwlock_t devtree_lock; 94extern rwlock_t devtree_lock;
95 95
96static inline bool of_have_populated_dt(void) 96static inline bool of_have_populated_dt(void)
97{ 97{
98 return allnodes != NULL; 98 return of_allnodes != NULL;
99} 99}
100 100
101static inline bool of_node_is_root(const struct device_node *node) 101static inline bool of_node_is_root(const struct device_node *node)
@@ -179,11 +179,22 @@ extern struct device_node *of_find_compatible_node(struct device_node *from,
179#define for_each_compatible_node(dn, type, compatible) \ 179#define for_each_compatible_node(dn, type, compatible) \
180 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \ 180 for (dn = of_find_compatible_node(NULL, type, compatible); dn; \
181 dn = of_find_compatible_node(dn, type, compatible)) 181 dn = of_find_compatible_node(dn, type, compatible))
182extern struct device_node *of_find_matching_node(struct device_node *from, 182extern struct device_node *of_find_matching_node_and_match(
183 const struct of_device_id *matches); 183 struct device_node *from,
184 const struct of_device_id *matches,
185 const struct of_device_id **match);
186static inline struct device_node *of_find_matching_node(
187 struct device_node *from,
188 const struct of_device_id *matches)
189{
190 return of_find_matching_node_and_match(from, matches, NULL);
191}
184#define for_each_matching_node(dn, matches) \ 192#define for_each_matching_node(dn, matches) \
185 for (dn = of_find_matching_node(NULL, matches); dn; \ 193 for (dn = of_find_matching_node(NULL, matches); dn; \
186 dn = of_find_matching_node(dn, matches)) 194 dn = of_find_matching_node(dn, matches))
195#define for_each_matching_node_and_match(dn, matches, match) \
196 for (dn = of_find_matching_node_and_match(NULL, matches, match); \
197 dn; dn = of_find_matching_node_and_match(dn, matches, match))
187extern struct device_node *of_find_node_by_path(const char *path); 198extern struct device_node *of_find_node_by_path(const char *path);
188extern struct device_node *of_find_node_by_phandle(phandle handle); 199extern struct device_node *of_find_node_by_phandle(phandle handle);
189extern struct device_node *of_get_parent(const struct device_node *node); 200extern struct device_node *of_get_parent(const struct device_node *node);
@@ -223,6 +234,10 @@ extern struct device_node *of_find_node_with_property(
223extern struct property *of_find_property(const struct device_node *np, 234extern struct property *of_find_property(const struct device_node *np,
224 const char *name, 235 const char *name,
225 int *lenp); 236 int *lenp);
237extern int of_property_read_u8_array(const struct device_node *np,
238 const char *propname, u8 *out_values, size_t sz);
239extern int of_property_read_u16_array(const struct device_node *np,
240 const char *propname, u16 *out_values, size_t sz);
226extern int of_property_read_u32_array(const struct device_node *np, 241extern int of_property_read_u32_array(const struct device_node *np,
227 const char *propname, 242 const char *propname,
228 u32 *out_values, 243 u32 *out_values,
@@ -255,10 +270,10 @@ extern int of_n_size_cells(struct device_node *np);
255extern const struct of_device_id *of_match_node( 270extern const struct of_device_id *of_match_node(
256 const struct of_device_id *matches, const struct device_node *node); 271 const struct of_device_id *matches, const struct device_node *node);
257extern int of_modalias_node(struct device_node *node, char *modalias, int len); 272extern int of_modalias_node(struct device_node *node, char *modalias, int len);
258extern struct device_node *of_parse_phandle(struct device_node *np, 273extern struct device_node *of_parse_phandle(const struct device_node *np,
259 const char *phandle_name, 274 const char *phandle_name,
260 int index); 275 int index);
261extern int of_parse_phandle_with_args(struct device_node *np, 276extern int of_parse_phandle_with_args(const struct device_node *np,
262 const char *list_name, const char *cells_name, int index, 277 const char *list_name, const char *cells_name, int index,
263 struct of_phandle_args *out_args); 278 struct of_phandle_args *out_args);
264 279
@@ -364,6 +379,18 @@ static inline struct device_node *of_find_compatible_node(
364 return NULL; 379 return NULL;
365} 380}
366 381
382static inline int of_property_read_u8_array(const struct device_node *np,
383 const char *propname, u8 *out_values, size_t sz)
384{
385 return -ENOSYS;
386}
387
388static inline int of_property_read_u16_array(const struct device_node *np,
389 const char *propname, u16 *out_values, size_t sz)
390{
391 return -ENOSYS;
392}
393
367static inline int of_property_read_u32_array(const struct device_node *np, 394static inline int of_property_read_u32_array(const struct device_node *np,
368 const char *propname, 395 const char *propname,
369 u32 *out_values, size_t sz) 396 u32 *out_values, size_t sz)
@@ -411,7 +438,7 @@ static inline int of_property_match_string(struct device_node *np,
411 return -ENOSYS; 438 return -ENOSYS;
412} 439}
413 440
414static inline struct device_node *of_parse_phandle(struct device_node *np, 441static inline struct device_node *of_parse_phandle(const struct device_node *np,
415 const char *phandle_name, 442 const char *phandle_name,
416 int index) 443 int index)
417{ 444{
@@ -470,6 +497,20 @@ static inline bool of_property_read_bool(const struct device_node *np,
470 return prop ? true : false; 497 return prop ? true : false;
471} 498}
472 499
500static inline int of_property_read_u8(const struct device_node *np,
501 const char *propname,
502 u8 *out_value)
503{
504 return of_property_read_u8_array(np, propname, out_value, 1);
505}
506
507static inline int of_property_read_u16(const struct device_node *np,
508 const char *propname,
509 u16 *out_value)
510{
511 return of_property_read_u16_array(np, propname, out_value, 1);
512}
513
473static inline int of_property_read_u32(const struct device_node *np, 514static inline int of_property_read_u32(const struct device_node *np,
474 const char *propname, 515 const char *propname,
475 u32 *out_value) 516 u32 *out_value)
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index e20e3af68fb6..0506eb53519b 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -42,10 +42,12 @@ static inline struct device_node *of_find_matching_node_by_address(
42{ 42{
43 return NULL; 43 return NULL;
44} 44}
45#ifndef of_iomap
45static inline void __iomem *of_iomap(struct device_node *device, int index) 46static inline void __iomem *of_iomap(struct device_node *device, int index)
46{ 47{
47 return NULL; 48 return NULL;
48} 49}
50#endif
49static inline const __be32 *of_get_address(struct device_node *dev, int index, 51static inline const __be32 *of_get_address(struct device_node *dev, int index,
50 u64 *size, unsigned int *flags) 52 u64 *size, unsigned int *flags)
51{ 53{
diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h
index 1cb775f8e663..cfb545cd86b5 100644
--- a/include/linux/of_i2c.h
+++ b/include/linux/of_i2c.h
@@ -29,6 +29,18 @@ static inline void of_i2c_register_devices(struct i2c_adapter *adap)
29{ 29{
30 return; 30 return;
31} 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}
32#endif /* CONFIG_OF_I2C */ 44#endif /* CONFIG_OF_I2C */
33 45
34#endif /* __LINUX_OF_I2C_H */ 46#endif /* __LINUX_OF_I2C_H */
diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
index eb475a8ea25b..7af25a9c9c51 100644
--- a/include/linux/omap-dma.h
+++ b/include/linux/omap-dma.h
@@ -19,4 +19,370 @@ static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
19} 19}
20#endif 20#endif
21 21
22/*
23 * Legacy OMAP DMA handling defines and functions
24 *
25 * NOTE: Do not use these any longer.
26 *
27 * Use the generic dmaengine functions as defined in
28 * include/linux/dmaengine.h.
29 *
30 * Copyright (C) 2003 Nokia Corporation
31 * Author: Juha Yrjölä <juha.yrjola@nokia.com>
32 *
33 */
34
35#include <linux/platform_device.h>
36
37#define INT_DMA_LCD 25
38
39#define OMAP1_DMA_TOUT_IRQ (1 << 0)
40#define OMAP_DMA_DROP_IRQ (1 << 1)
41#define OMAP_DMA_HALF_IRQ (1 << 2)
42#define OMAP_DMA_FRAME_IRQ (1 << 3)
43#define OMAP_DMA_LAST_IRQ (1 << 4)
44#define OMAP_DMA_BLOCK_IRQ (1 << 5)
45#define OMAP1_DMA_SYNC_IRQ (1 << 6)
46#define OMAP2_DMA_PKT_IRQ (1 << 7)
47#define OMAP2_DMA_TRANS_ERR_IRQ (1 << 8)
48#define OMAP2_DMA_SECURE_ERR_IRQ (1 << 9)
49#define OMAP2_DMA_SUPERVISOR_ERR_IRQ (1 << 10)
50#define OMAP2_DMA_MISALIGNED_ERR_IRQ (1 << 11)
51
52#define OMAP_DMA_CCR_EN (1 << 7)
53#define OMAP_DMA_CCR_RD_ACTIVE (1 << 9)
54#define OMAP_DMA_CCR_WR_ACTIVE (1 << 10)
55#define OMAP_DMA_CCR_SEL_SRC_DST_SYNC (1 << 24)
56#define OMAP_DMA_CCR_BUFFERING_DISABLE (1 << 25)
57
58#define OMAP_DMA_DATA_TYPE_S8 0x00
59#define OMAP_DMA_DATA_TYPE_S16 0x01
60#define OMAP_DMA_DATA_TYPE_S32 0x02
61
62#define OMAP_DMA_SYNC_ELEMENT 0x00
63#define OMAP_DMA_SYNC_FRAME 0x01
64#define OMAP_DMA_SYNC_BLOCK 0x02
65#define OMAP_DMA_SYNC_PACKET 0x03
66
67#define OMAP_DMA_DST_SYNC_PREFETCH 0x02
68#define OMAP_DMA_SRC_SYNC 0x01
69#define OMAP_DMA_DST_SYNC 0x00
70
71#define OMAP_DMA_PORT_EMIFF 0x00
72#define OMAP_DMA_PORT_EMIFS 0x01
73#define OMAP_DMA_PORT_OCP_T1 0x02
74#define OMAP_DMA_PORT_TIPB 0x03
75#define OMAP_DMA_PORT_OCP_T2 0x04
76#define OMAP_DMA_PORT_MPUI 0x05
77
78#define OMAP_DMA_AMODE_CONSTANT 0x00
79#define OMAP_DMA_AMODE_POST_INC 0x01
80#define OMAP_DMA_AMODE_SINGLE_IDX 0x02
81#define OMAP_DMA_AMODE_DOUBLE_IDX 0x03
82
83#define DMA_DEFAULT_FIFO_DEPTH 0x10
84#define DMA_DEFAULT_ARB_RATE 0x01
85/* Pass THREAD_RESERVE ORed with THREAD_FIFO for tparams */
86#define DMA_THREAD_RESERVE_NORM (0x00 << 12) /* Def */
87#define DMA_THREAD_RESERVE_ONET (0x01 << 12)
88#define DMA_THREAD_RESERVE_TWOT (0x02 << 12)
89#define DMA_THREAD_RESERVE_THREET (0x03 << 12)
90#define DMA_THREAD_FIFO_NONE (0x00 << 14) /* Def */
91#define DMA_THREAD_FIFO_75 (0x01 << 14)
92#define DMA_THREAD_FIFO_25 (0x02 << 14)
93#define DMA_THREAD_FIFO_50 (0x03 << 14)
94
95/* DMA4_OCP_SYSCONFIG bits */
96#define DMA_SYSCONFIG_MIDLEMODE_MASK (3 << 12)
97#define DMA_SYSCONFIG_CLOCKACTIVITY_MASK (3 << 8)
98#define DMA_SYSCONFIG_EMUFREE (1 << 5)
99#define DMA_SYSCONFIG_SIDLEMODE_MASK (3 << 3)
100#define DMA_SYSCONFIG_SOFTRESET (1 << 2)
101#define DMA_SYSCONFIG_AUTOIDLE (1 << 0)
102
103#define DMA_SYSCONFIG_MIDLEMODE(n) ((n) << 12)
104#define DMA_SYSCONFIG_SIDLEMODE(n) ((n) << 3)
105
106#define DMA_IDLEMODE_SMARTIDLE 0x2
107#define DMA_IDLEMODE_NO_IDLE 0x1
108#define DMA_IDLEMODE_FORCE_IDLE 0x0
109
110/* Chaining modes*/
111#ifndef CONFIG_ARCH_OMAP1
112#define OMAP_DMA_STATIC_CHAIN 0x1
113#define OMAP_DMA_DYNAMIC_CHAIN 0x2
114#define OMAP_DMA_CHAIN_ACTIVE 0x1
115#define OMAP_DMA_CHAIN_INACTIVE 0x0
116#endif
117
118#define DMA_CH_PRIO_HIGH 0x1
119#define DMA_CH_PRIO_LOW 0x0 /* Def */
120
121/* Errata handling */
122#define IS_DMA_ERRATA(id) (errata & (id))
123#define SET_DMA_ERRATA(id) (errata |= (id))
124
125#define DMA_ERRATA_IFRAME_BUFFERING BIT(0x0)
126#define DMA_ERRATA_PARALLEL_CHANNELS BIT(0x1)
127#define DMA_ERRATA_i378 BIT(0x2)
128#define DMA_ERRATA_i541 BIT(0x3)
129#define DMA_ERRATA_i88 BIT(0x4)
130#define DMA_ERRATA_3_3 BIT(0x5)
131#define DMA_ROMCODE_BUG BIT(0x6)
132
133/* Attributes for OMAP DMA Contrller */
134#define DMA_LINKED_LCH BIT(0x0)
135#define GLOBAL_PRIORITY BIT(0x1)
136#define RESERVE_CHANNEL BIT(0x2)
137#define IS_CSSA_32 BIT(0x3)
138#define IS_CDSA_32 BIT(0x4)
139#define IS_RW_PRIORITY BIT(0x5)
140#define ENABLE_1510_MODE BIT(0x6)
141#define SRC_PORT BIT(0x7)
142#define DST_PORT BIT(0x8)
143#define SRC_INDEX BIT(0x9)
144#define DST_INDEX BIT(0xa)
145#define IS_BURST_ONLY4 BIT(0xb)
146#define CLEAR_CSR_ON_READ BIT(0xc)
147#define IS_WORD_16 BIT(0xd)
148#define ENABLE_16XX_MODE BIT(0xe)
149#define HS_CHANNELS_RESERVED BIT(0xf)
150
151/* Defines for DMA Capabilities */
152#define DMA_HAS_TRANSPARENT_CAPS (0x1 << 18)
153#define DMA_HAS_CONSTANT_FILL_CAPS (0x1 << 19)
154#define DMA_HAS_DESCRIPTOR_CAPS (0x3 << 20)
155
156enum omap_reg_offsets {
157
158GCR, GSCR, GRST1, HW_ID,
159PCH2_ID, PCH0_ID, PCH1_ID, PCHG_ID,
160PCHD_ID, CAPS_0, CAPS_1, CAPS_2,
161CAPS_3, CAPS_4, PCH2_SR, PCH0_SR,
162PCH1_SR, PCHD_SR, REVISION, IRQSTATUS_L0,
163IRQSTATUS_L1, IRQSTATUS_L2, IRQSTATUS_L3, IRQENABLE_L0,
164IRQENABLE_L1, IRQENABLE_L2, IRQENABLE_L3, SYSSTATUS,
165OCP_SYSCONFIG,
166
167/* omap1+ specific */
168CPC, CCR2, LCH_CTRL,
169
170/* Common registers for all omap's */
171CSDP, CCR, CICR, CSR,
172CEN, CFN, CSFI, CSEI,
173CSAC, CDAC, CDEI,
174CDFI, CLNK_CTRL,
175
176/* Channel specific registers */
177CSSA, CDSA, COLOR,
178CCEN, CCFN,
179
180/* omap3630 and omap4 specific */
181CDP, CNDP, CCDN,
182
183};
184
185enum omap_dma_burst_mode {
186 OMAP_DMA_DATA_BURST_DIS = 0,
187 OMAP_DMA_DATA_BURST_4,
188 OMAP_DMA_DATA_BURST_8,
189 OMAP_DMA_DATA_BURST_16,
190};
191
192enum end_type {
193 OMAP_DMA_LITTLE_ENDIAN = 0,
194 OMAP_DMA_BIG_ENDIAN
195};
196
197enum omap_dma_color_mode {
198 OMAP_DMA_COLOR_DIS = 0,
199 OMAP_DMA_CONSTANT_FILL,
200 OMAP_DMA_TRANSPARENT_COPY
201};
202
203enum omap_dma_write_mode {
204 OMAP_DMA_WRITE_NON_POSTED = 0,
205 OMAP_DMA_WRITE_POSTED,
206 OMAP_DMA_WRITE_LAST_NON_POSTED
207};
208
209enum omap_dma_channel_mode {
210 OMAP_DMA_LCH_2D = 0,
211 OMAP_DMA_LCH_G,
212 OMAP_DMA_LCH_P,
213 OMAP_DMA_LCH_PD
214};
215
216struct omap_dma_channel_params {
217 int data_type; /* data type 8,16,32 */
218 int elem_count; /* number of elements in a frame */
219 int frame_count; /* number of frames in a element */
220
221 int src_port; /* Only on OMAP1 REVISIT: Is this needed? */
222 int src_amode; /* constant, post increment, indexed,
223 double indexed */
224 unsigned long src_start; /* source address : physical */
225 int src_ei; /* source element index */
226 int src_fi; /* source frame index */
227
228 int dst_port; /* Only on OMAP1 REVISIT: Is this needed? */
229 int dst_amode; /* constant, post increment, indexed,
230 double indexed */
231 unsigned long dst_start; /* source address : physical */
232 int dst_ei; /* source element index */
233 int dst_fi; /* source frame index */
234
235 int trigger; /* trigger attached if the channel is
236 synchronized */
237 int sync_mode; /* sycn on element, frame , block or packet */
238 int src_or_dst_synch; /* source synch(1) or destination synch(0) */
239
240 int ie; /* interrupt enabled */
241
242 unsigned char read_prio;/* read priority */
243 unsigned char write_prio;/* write priority */
244
245#ifndef CONFIG_ARCH_OMAP1
246 enum omap_dma_burst_mode burst_mode; /* Burst mode 4/8/16 words */
247#endif
248};
249
250struct omap_dma_lch {
251 int next_lch;
252 int dev_id;
253 u16 saved_csr;
254 u16 enabled_irqs;
255 const char *dev_name;
256 void (*callback)(int lch, u16 ch_status, void *data);
257 void *data;
258 long flags;
259 /* required for Dynamic chaining */
260 int prev_linked_ch;
261 int next_linked_ch;
262 int state;
263 int chain_id;
264 int status;
265};
266
267struct omap_dma_dev_attr {
268 u32 dev_caps;
269 u16 lch_count;
270 u16 chan_count;
271 struct omap_dma_lch *chan;
272};
273
274/* System DMA platform data structure */
275struct omap_system_dma_plat_info {
276 struct omap_dma_dev_attr *dma_attr;
277 u32 errata;
278 void (*disable_irq_lch)(int lch);
279 void (*show_dma_caps)(void);
280 void (*clear_lch_regs)(int lch);
281 void (*clear_dma)(int lch);
282 void (*dma_write)(u32 val, int reg, int lch);
283 u32 (*dma_read)(int reg, int lch);
284};
285
286#ifdef CONFIG_ARCH_OMAP2PLUS
287#define dma_omap2plus() 1
288#else
289#define dma_omap2plus() 0
22#endif 290#endif
291#define dma_omap1() (!dma_omap2plus())
292#define dma_omap15xx() ((dma_omap1() && (d->dev_caps & ENABLE_1510_MODE)))
293#define dma_omap16xx() ((dma_omap1() && (d->dev_caps & ENABLE_16XX_MODE)))
294
295extern void omap_set_dma_priority(int lch, int dst_port, int priority);
296extern int omap_request_dma(int dev_id, const char *dev_name,
297 void (*callback)(int lch, u16 ch_status, void *data),
298 void *data, int *dma_ch);
299extern void omap_enable_dma_irq(int ch, u16 irq_bits);
300extern void omap_disable_dma_irq(int ch, u16 irq_bits);
301extern void omap_free_dma(int ch);
302extern void omap_start_dma(int lch);
303extern void omap_stop_dma(int lch);
304extern void omap_set_dma_transfer_params(int lch, int data_type,
305 int elem_count, int frame_count,
306 int sync_mode,
307 int dma_trigger, int src_or_dst_synch);
308extern void omap_set_dma_color_mode(int lch, enum omap_dma_color_mode mode,
309 u32 color);
310extern void omap_set_dma_write_mode(int lch, enum omap_dma_write_mode mode);
311extern void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode);
312
313extern void omap_set_dma_src_params(int lch, int src_port, int src_amode,
314 unsigned long src_start,
315 int src_ei, int src_fi);
316extern void omap_set_dma_src_index(int lch, int eidx, int fidx);
317extern void omap_set_dma_src_data_pack(int lch, int enable);
318extern void omap_set_dma_src_burst_mode(int lch,
319 enum omap_dma_burst_mode burst_mode);
320
321extern void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
322 unsigned long dest_start,
323 int dst_ei, int dst_fi);
324extern void omap_set_dma_dest_index(int lch, int eidx, int fidx);
325extern void omap_set_dma_dest_data_pack(int lch, int enable);
326extern void omap_set_dma_dest_burst_mode(int lch,
327 enum omap_dma_burst_mode burst_mode);
328
329extern void omap_set_dma_params(int lch,
330 struct omap_dma_channel_params *params);
331
332extern void omap_dma_link_lch(int lch_head, int lch_queue);
333extern void omap_dma_unlink_lch(int lch_head, int lch_queue);
334
335extern int omap_set_dma_callback(int lch,
336 void (*callback)(int lch, u16 ch_status, void *data),
337 void *data);
338extern dma_addr_t omap_get_dma_src_pos(int lch);
339extern dma_addr_t omap_get_dma_dst_pos(int lch);
340extern void omap_clear_dma(int lch);
341extern int omap_get_dma_active_status(int lch);
342extern int omap_dma_running(void);
343extern void omap_dma_set_global_params(int arb_rate, int max_fifo_depth,
344 int tparams);
345extern int omap_dma_set_prio_lch(int lch, unsigned char read_prio,
346 unsigned char write_prio);
347extern void omap_set_dma_dst_endian_type(int lch, enum end_type etype);
348extern void omap_set_dma_src_endian_type(int lch, enum end_type etype);
349extern int omap_get_dma_index(int lch, int *ei, int *fi);
350
351void omap_dma_global_context_save(void);
352void omap_dma_global_context_restore(void);
353
354extern void omap_dma_disable_irq(int lch);
355
356/* Chaining APIs */
357#ifndef CONFIG_ARCH_OMAP1
358extern int omap_request_dma_chain(int dev_id, const char *dev_name,
359 void (*callback) (int lch, u16 ch_status,
360 void *data),
361 int *chain_id, int no_of_chans,
362 int chain_mode,
363 struct omap_dma_channel_params params);
364extern int omap_free_dma_chain(int chain_id);
365extern int omap_dma_chain_a_transfer(int chain_id, int src_start,
366 int dest_start, int elem_count,
367 int frame_count, void *callbk_data);
368extern int omap_start_dma_chain_transfers(int chain_id);
369extern int omap_stop_dma_chain_transfers(int chain_id);
370extern int omap_get_dma_chain_index(int chain_id, int *ei, int *fi);
371extern int omap_get_dma_chain_dst_pos(int chain_id);
372extern int omap_get_dma_chain_src_pos(int chain_id);
373
374extern int omap_modify_dma_chain_params(int chain_id,
375 struct omap_dma_channel_params params);
376extern int omap_dma_chain_status(int chain_id);
377#endif
378
379#if defined(CONFIG_ARCH_OMAP1) && defined(CONFIG_FB_OMAP)
380#include <mach/lcd_dma.h>
381#else
382static inline int omap_lcd_dma_running(void)
383{
384 return 0;
385}
386#endif
387
388#endif /* __LINUX_OMAP_DMA_H */
diff --git a/include/linux/omap-iommu.h b/include/linux/omap-iommu.h
new file mode 100644
index 000000000000..cac78de09c07
--- /dev/null
+++ b/include/linux/omap-iommu.h
@@ -0,0 +1,52 @@
1/*
2 * omap iommu: simple virtual address space management
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.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 _INTEL_IOMMU_H_
14#define _INTEL_IOMMU_H_
15
16struct iovm_struct {
17 struct omap_iommu *iommu; /* iommu object which this belongs to */
18 u32 da_start; /* area definition */
19 u32 da_end;
20 u32 flags; /* IOVMF_: see below */
21 struct list_head list; /* linked in ascending order */
22 const struct sg_table *sgt; /* keep 'page' <-> 'da' mapping */
23 void *va; /* mpu side mapped address */
24};
25
26#define MMU_RAM_ENDIAN_SHIFT 9
27#define MMU_RAM_ENDIAN_LITTLE (0 << MMU_RAM_ENDIAN_SHIFT)
28#define MMU_RAM_ELSZ_8 (0 << MMU_RAM_ELSZ_SHIFT)
29#define IOVMF_ENDIAN_LITTLE MMU_RAM_ENDIAN_LITTLE
30#define MMU_RAM_ELSZ_SHIFT 7
31#define IOVMF_ELSZ_8 MMU_RAM_ELSZ_8
32
33struct iommu_domain;
34
35extern struct iovm_struct *omap_find_iovm_area(struct device *dev, u32 da);
36extern u32
37omap_iommu_vmap(struct iommu_domain *domain, struct device *dev, u32 da,
38 const struct sg_table *sgt, u32 flags);
39extern struct sg_table *omap_iommu_vunmap(struct iommu_domain *domain,
40 struct device *dev, u32 da);
41extern u32
42omap_iommu_vmalloc(struct iommu_domain *domain, struct device *dev,
43 u32 da, size_t bytes, u32 flags);
44extern void
45omap_iommu_vfree(struct iommu_domain *domain, struct device *dev,
46 const u32 da);
47extern void *omap_da_to_va(struct device *dev, u32 da);
48
49extern void omap_iommu_save_ctx(struct device *dev);
50extern void omap_iommu_restore_ctx(struct device *dev);
51
52#endif
diff --git a/include/linux/oom.h b/include/linux/oom.h
index fb9826847b89..da60007075b5 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -29,8 +29,23 @@ enum oom_scan_t {
29 OOM_SCAN_SELECT, /* always select this thread first */ 29 OOM_SCAN_SELECT, /* always select this thread first */
30}; 30};
31 31
32extern void compare_swap_oom_score_adj(int old_val, int new_val); 32/* Thread is the potential origin of an oom condition; kill first on oom */
33extern int test_set_oom_score_adj(int new_val); 33#define OOM_FLAG_ORIGIN ((__force oom_flags_t)0x1)
34
35static inline void set_current_oom_origin(void)
36{
37 current->signal->oom_flags |= OOM_FLAG_ORIGIN;
38}
39
40static inline void clear_current_oom_origin(void)
41{
42 current->signal->oom_flags &= ~OOM_FLAG_ORIGIN;
43}
44
45static inline bool oom_task_origin(const struct task_struct *p)
46{
47 return !!(p->signal->oom_flags & OOM_FLAG_ORIGIN);
48}
34 49
35extern unsigned long oom_badness(struct task_struct *p, 50extern unsigned long oom_badness(struct task_struct *p,
36 struct mem_cgroup *memcg, const nodemask_t *nodemask, 51 struct mem_cgroup *memcg, const nodemask_t *nodemask,
@@ -49,8 +64,6 @@ extern void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask,
49extern enum oom_scan_t oom_scan_process_thread(struct task_struct *task, 64extern enum oom_scan_t oom_scan_process_thread(struct task_struct *task,
50 unsigned long totalpages, const nodemask_t *nodemask, 65 unsigned long totalpages, const nodemask_t *nodemask,
51 bool force_kill); 66 bool force_kill);
52extern void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
53 int order);
54 67
55extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask, 68extern void out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
56 int order, nodemask_t *mask, bool force_kill); 69 int order, nodemask_t *mask, bool force_kill);
diff --git a/include/linux/openvswitch.h b/include/linux/openvswitch.h
index eb1efa54fe84..d42e174bd0c8 100644
--- a/include/linux/openvswitch.h
+++ b/include/linux/openvswitch.h
@@ -243,6 +243,7 @@ enum ovs_key_attr {
243 OVS_KEY_ATTR_ICMPV6, /* struct ovs_key_icmpv6 */ 243 OVS_KEY_ATTR_ICMPV6, /* struct ovs_key_icmpv6 */
244 OVS_KEY_ATTR_ARP, /* struct ovs_key_arp */ 244 OVS_KEY_ATTR_ARP, /* struct ovs_key_arp */
245 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */ 245 OVS_KEY_ATTR_ND, /* struct ovs_key_nd */
246 OVS_KEY_ATTR_SKB_MARK, /* u32 skb mark */
246 __OVS_KEY_ATTR_MAX 247 __OVS_KEY_ATTR_MAX
247}; 248};
248 249
diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h
index 76a9539cfd3f..a92061e08d48 100644
--- a/include/linux/page-isolation.h
+++ b/include/linux/page-isolation.h
@@ -2,7 +2,8 @@
2#define __LINUX_PAGEISOLATION_H 2#define __LINUX_PAGEISOLATION_H
3 3
4 4
5bool has_unmovable_pages(struct zone *zone, struct page *page, int count); 5bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
6 bool skip_hwpoisoned_pages);
6void set_pageblock_migratetype(struct page *page, int migratetype); 7void set_pageblock_migratetype(struct page *page, int migratetype);
7int move_freepages_block(struct zone *zone, struct page *page, 8int move_freepages_block(struct zone *zone, struct page *page,
8 int migratetype); 9 int migratetype);
@@ -21,7 +22,7 @@ int move_freepages(struct zone *zone,
21 */ 22 */
22int 23int
23start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn, 24start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
24 unsigned migratetype); 25 unsigned migratetype, bool skip_hwpoisoned_pages);
25 26
26/* 27/*
27 * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE. 28 * Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE.
@@ -34,12 +35,13 @@ undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
34/* 35/*
35 * Test all pages in [start_pfn, end_pfn) are isolated or not. 36 * Test all pages in [start_pfn, end_pfn) are isolated or not.
36 */ 37 */
37int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn); 38int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
39 bool skip_hwpoisoned_pages);
38 40
39/* 41/*
40 * Internal functions. Changes pageblock's migrate type. 42 * Internal functions. Changes pageblock's migrate type.
41 */ 43 */
42int set_migratetype_isolate(struct page *page); 44int set_migratetype_isolate(struct page *page, bool skip_hwpoisoned_pages);
43void unset_migratetype_isolate(struct page *page, unsigned migratetype); 45void unset_migratetype_isolate(struct page *page, unsigned migratetype);
44struct page *alloc_migrate_target(struct page *page, unsigned long private, 46struct page *alloc_migrate_target(struct page *page, unsigned long private,
45 int **resultp); 47 int **resultp);
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index e42c762f0dc7..6da609d14c15 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -24,6 +24,7 @@ enum mapping_flags {
24 AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */ 24 AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */
25 AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */ 25 AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */
26 AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */ 26 AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */
27 AS_BALLOON_MAP = __GFP_BITS_SHIFT + 4, /* balloon page special map */
27}; 28};
28 29
29static inline void mapping_set_error(struct address_space *mapping, int error) 30static inline void mapping_set_error(struct address_space *mapping, int error)
@@ -53,6 +54,21 @@ static inline int mapping_unevictable(struct address_space *mapping)
53 return !!mapping; 54 return !!mapping;
54} 55}
55 56
57static inline void mapping_set_balloon(struct address_space *mapping)
58{
59 set_bit(AS_BALLOON_MAP, &mapping->flags);
60}
61
62static inline void mapping_clear_balloon(struct address_space *mapping)
63{
64 clear_bit(AS_BALLOON_MAP, &mapping->flags);
65}
66
67static inline int mapping_balloon(struct address_space *mapping)
68{
69 return mapping && test_bit(AS_BALLOON_MAP, &mapping->flags);
70}
71
56static inline gfp_t mapping_gfp_mask(struct address_space * mapping) 72static inline gfp_t mapping_gfp_mask(struct address_space * mapping)
57{ 73{
58 return (__force gfp_t)mapping->flags & __GFP_BITS_MASK; 74 return (__force gfp_t)mapping->flags & __GFP_BITS_MASK;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index ee2179546c63..15472d691ee6 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -333,6 +333,8 @@ struct pci_dev {
333 }; 333 };
334 struct pci_ats *ats; /* Address Translation Service */ 334 struct pci_ats *ats; /* Address Translation Service */
335#endif 335#endif
336 phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */
337 size_t romlen; /* Length of ROM if it's not from the BAR */
336}; 338};
337 339
338static inline struct pci_dev *pci_physfn(struct pci_dev *dev) 340static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
@@ -538,6 +540,9 @@ enum pci_ers_result {
538 540
539 /* Device driver is fully recovered and operational */ 541 /* Device driver is fully recovered and operational */
540 PCI_ERS_RESULT_RECOVERED = (__force pci_ers_result_t) 5, 542 PCI_ERS_RESULT_RECOVERED = (__force pci_ers_result_t) 5,
543
544 /* No AER capabilities registered for the driver */
545 PCI_ERS_RESULT_NO_AER_DRIVER = (__force pci_ers_result_t) 6,
541}; 546};
542 547
543/* PCI bus error event callbacks */ 548/* PCI bus error event callbacks */
@@ -573,6 +578,7 @@ struct pci_driver {
573 int (*resume_early) (struct pci_dev *dev); 578 int (*resume_early) (struct pci_dev *dev);
574 int (*resume) (struct pci_dev *dev); /* Device woken up */ 579 int (*resume) (struct pci_dev *dev); /* Device woken up */
575 void (*shutdown) (struct pci_dev *dev); 580 void (*shutdown) (struct pci_dev *dev);
581 int (*sriov_configure) (struct pci_dev *dev, int num_vfs); /* PF pdev */
576 const struct pci_error_handlers *err_handler; 582 const struct pci_error_handlers *err_handler;
577 struct device_driver driver; 583 struct device_driver driver;
578 struct pci_dynids dynids; 584 struct pci_dynids dynids;
@@ -588,7 +594,7 @@ struct pci_driver {
588 * in a generic manner. 594 * in a generic manner.
589 */ 595 */
590#define DEFINE_PCI_DEVICE_TABLE(_table) \ 596#define DEFINE_PCI_DEVICE_TABLE(_table) \
591 const struct pci_device_id _table[] __devinitconst 597 const struct pci_device_id _table[]
592 598
593/** 599/**
594 * PCI_DEVICE - macro used to describe a specific pci device 600 * PCI_DEVICE - macro used to describe a specific pci device
@@ -604,6 +610,20 @@ struct pci_driver {
604 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID 610 .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
605 611
606/** 612/**
613 * PCI_DEVICE_SUB - macro used to describe a specific pci device with subsystem
614 * @vend: the 16 bit PCI Vendor ID
615 * @dev: the 16 bit PCI Device ID
616 * @subvend: the 16 bit PCI Subvendor ID
617 * @subdev: the 16 bit PCI Subdevice ID
618 *
619 * This macro is used to create a struct pci_device_id that matches a
620 * specific device with subsystem information.
621 */
622#define PCI_DEVICE_SUB(vend, dev, subvend, subdev) \
623 .vendor = (vend), .device = (dev), \
624 .subvendor = (subvend), .subdevice = (subdev)
625
626/**
607 * PCI_DEVICE_CLASS - macro used to describe a specific pci device class 627 * PCI_DEVICE_CLASS - macro used to describe a specific pci device class
608 * @dev_class: the class, subclass, prog-if triple for this device 628 * @dev_class: the class, subclass, prog-if triple for this device
609 * @dev_class_mask: the class mask for this device 629 * @dev_class_mask: the class mask for this device
@@ -686,7 +706,7 @@ struct pci_bus *pci_create_root_bus(struct device *parent, int bus,
686int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax); 706int pci_bus_insert_busn_res(struct pci_bus *b, int bus, int busmax);
687int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax); 707int pci_bus_update_busn_res_end(struct pci_bus *b, int busmax);
688void pci_bus_release_busn_res(struct pci_bus *b); 708void pci_bus_release_busn_res(struct pci_bus *b);
689struct pci_bus * __devinit pci_scan_root_bus(struct device *parent, int bus, 709struct pci_bus *pci_scan_root_bus(struct device *parent, int bus,
690 struct pci_ops *ops, void *sysdata, 710 struct pci_ops *ops, void *sysdata,
691 struct list_head *resources); 711 struct list_head *resources);
692struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, 712struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev,
@@ -712,6 +732,8 @@ extern struct pci_dev *pci_dev_get(struct pci_dev *dev);
712extern void pci_dev_put(struct pci_dev *dev); 732extern void pci_dev_put(struct pci_dev *dev);
713extern void pci_remove_bus(struct pci_bus *b); 733extern void pci_remove_bus(struct pci_bus *b);
714extern void pci_stop_and_remove_bus_device(struct pci_dev *dev); 734extern void pci_stop_and_remove_bus_device(struct pci_dev *dev);
735void pci_stop_root_bus(struct pci_bus *bus);
736void pci_remove_root_bus(struct pci_bus *bus);
715void pci_setup_cardbus(struct pci_bus *bus); 737void pci_setup_cardbus(struct pci_bus *bus);
716extern void pci_sort_breadthfirst(void); 738extern void pci_sort_breadthfirst(void);
717#define dev_is_pci(d) ((d)->bus == &pci_bus_type) 739#define dev_is_pci(d) ((d)->bus == &pci_bus_type)
@@ -941,10 +963,8 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev);
941 963
942/* Functions for PCI Hotplug drivers to use */ 964/* Functions for PCI Hotplug drivers to use */
943int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); 965int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap);
944#ifdef CONFIG_HOTPLUG
945unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge); 966unsigned int pci_rescan_bus_bridge_resize(struct pci_dev *bridge);
946unsigned int pci_rescan_bus(struct pci_bus *bus); 967unsigned int pci_rescan_bus(struct pci_bus *bus);
947#endif
948 968
949/* Vital product data routines */ 969/* Vital product data routines */
950ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf); 970ssize_t pci_read_vpd(struct pci_dev *dev, loff_t pos, size_t count, void *buf);
@@ -958,6 +978,7 @@ void pci_bus_size_bridges(struct pci_bus *bus);
958int pci_claim_resource(struct pci_dev *, int); 978int pci_claim_resource(struct pci_dev *, int);
959void pci_assign_unassigned_resources(void); 979void pci_assign_unassigned_resources(void);
960void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); 980void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge);
981void pci_assign_unassigned_bus_resources(struct pci_bus *bus);
961void pdev_enable_device(struct pci_dev *); 982void pdev_enable_device(struct pci_dev *);
962int pci_enable_resources(struct pci_dev *, int mask); 983int pci_enable_resources(struct pci_dev *, int mask);
963void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), 984void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
@@ -1580,7 +1601,7 @@ extern int pci_pci_problems;
1580 1601
1581extern unsigned long pci_cardbus_io_size; 1602extern unsigned long pci_cardbus_io_size;
1582extern unsigned long pci_cardbus_mem_size; 1603extern unsigned long pci_cardbus_mem_size;
1583extern u8 __devinitdata pci_dfl_cache_line_size; 1604extern u8 pci_dfl_cache_line_size;
1584extern u8 pci_cache_line_size; 1605extern u8 pci_cache_line_size;
1585 1606
1586extern unsigned long pci_hotplug_io_size; 1607extern unsigned long pci_hotplug_io_size;
@@ -1592,6 +1613,7 @@ void pcibios_disable_device(struct pci_dev *dev);
1592void pcibios_set_master(struct pci_dev *dev); 1613void pcibios_set_master(struct pci_dev *dev);
1593int pcibios_set_pcie_reset_state(struct pci_dev *dev, 1614int pcibios_set_pcie_reset_state(struct pci_dev *dev,
1594 enum pcie_reset_state state); 1615 enum pcie_reset_state state);
1616int pcibios_add_device(struct pci_dev *dev);
1595 1617
1596#ifdef CONFIG_PCI_MMCONFIG 1618#ifdef CONFIG_PCI_MMCONFIG
1597extern void __init pci_mmcfg_early_init(void); 1619extern void __init pci_mmcfg_early_init(void);
@@ -1601,7 +1623,7 @@ static inline void pci_mmcfg_early_init(void) { }
1601static inline void pci_mmcfg_late_init(void) { } 1623static inline void pci_mmcfg_late_init(void) { }
1602#endif 1624#endif
1603 1625
1604int pci_ext_cfg_avail(struct pci_dev *dev); 1626int pci_ext_cfg_avail(void);
1605 1627
1606void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); 1628void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
1607 1629
@@ -1610,6 +1632,8 @@ extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn);
1610extern void pci_disable_sriov(struct pci_dev *dev); 1632extern void pci_disable_sriov(struct pci_dev *dev);
1611extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); 1633extern irqreturn_t pci_sriov_migration(struct pci_dev *dev);
1612extern int pci_num_vf(struct pci_dev *dev); 1634extern int pci_num_vf(struct pci_dev *dev);
1635extern int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs);
1636extern int pci_sriov_get_totalvfs(struct pci_dev *dev);
1613#else 1637#else
1614static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) 1638static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
1615{ 1639{
@@ -1626,6 +1650,14 @@ static inline int pci_num_vf(struct pci_dev *dev)
1626{ 1650{
1627 return 0; 1651 return 0;
1628} 1652}
1653static inline int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs)
1654{
1655 return 0;
1656}
1657static inline int pci_sriov_get_totalvfs(struct pci_dev *dev)
1658{
1659 return 0;
1660}
1629#endif 1661#endif
1630 1662
1631#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) 1663#if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE)
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 9d36b829533a..0f8447376ddb 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1985,6 +1985,9 @@
1985#define PCI_DEVICE_ID_EXAR_XR17C152 0x0152 1985#define PCI_DEVICE_ID_EXAR_XR17C152 0x0152
1986#define PCI_DEVICE_ID_EXAR_XR17C154 0x0154 1986#define PCI_DEVICE_ID_EXAR_XR17C154 0x0154
1987#define PCI_DEVICE_ID_EXAR_XR17C158 0x0158 1987#define PCI_DEVICE_ID_EXAR_XR17C158 0x0158
1988#define PCI_DEVICE_ID_EXAR_XR17V352 0x0352
1989#define PCI_DEVICE_ID_EXAR_XR17V354 0x0354
1990#define PCI_DEVICE_ID_EXAR_XR17V358 0x0358
1988 1991
1989#define PCI_VENDOR_ID_MICROGATE 0x13c0 1992#define PCI_VENDOR_ID_MICROGATE 0x13c0
1990#define PCI_DEVICE_ID_MICROGATE_USC 0x0010 1993#define PCI_DEVICE_ID_MICROGATE_USC 0x0010
@@ -2323,6 +2326,8 @@
2323 2326
2324#define PCI_VENDOR_ID_TOPSPIN 0x1867 2327#define PCI_VENDOR_ID_TOPSPIN 0x1867
2325 2328
2329#define PCI_VENDOR_ID_COMMTECH 0x18f7
2330
2326#define PCI_VENDOR_ID_SILAN 0x1904 2331#define PCI_VENDOR_ID_SILAN 0x1904
2327 2332
2328#define PCI_VENDOR_ID_RENESAS 0x1912 2333#define PCI_VENDOR_ID_RENESAS 0x1912
diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h
index 250a4acddb2b..bd1e86071e57 100644
--- a/include/linux/percpu-rwsem.h
+++ b/include/linux/percpu-rwsem.h
@@ -13,7 +13,7 @@ struct percpu_rw_semaphore {
13}; 13};
14 14
15#define light_mb() barrier() 15#define light_mb() barrier()
16#define heavy_mb() synchronize_sched() 16#define heavy_mb() synchronize_sched_expedited()
17 17
18static inline void percpu_down_read(struct percpu_rw_semaphore *p) 18static inline void percpu_down_read(struct percpu_rw_semaphore *p)
19{ 19{
@@ -51,7 +51,7 @@ static inline void percpu_down_write(struct percpu_rw_semaphore *p)
51{ 51{
52 mutex_lock(&p->mtx); 52 mutex_lock(&p->mtx);
53 p->locked = true; 53 p->locked = true;
54 synchronize_sched(); /* make sure that all readers exit the rcu_read_lock_sched region */ 54 synchronize_sched_expedited(); /* make sure that all readers exit the rcu_read_lock_sched region */
55 while (__percpu_count(p->counters)) 55 while (__percpu_count(p->counters))
56 msleep(1); 56 msleep(1);
57 heavy_mb(); /* C, between read of p->counter and write to data, paired with B */ 57 heavy_mb(); /* C, between read of p->counter and write to data, paired with B */
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h
index 4f0abb9f1c09..47a1bdd88878 100644
--- a/include/linux/pinctrl/pinconf-generic.h
+++ b/include/linux/pinctrl/pinconf-generic.h
@@ -46,11 +46,11 @@
46 * @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source 46 * @PIN_CONFIG_DRIVE_OPEN_SOURCE: the pin will be driven with open source
47 * (open emitter). Sending this config will enabale open drain mode, the 47 * (open emitter). Sending this config will enabale open drain mode, the
48 * argument is ignored. 48 * argument is ignored.
49 * @PIN_CONFIG_INPUT_SCHMITT_DISABLE: disable schmitt-trigger mode on the pin.
49 * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in 50 * @PIN_CONFIG_INPUT_SCHMITT: this will configure an input pin to run in
50 * schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis, 51 * schmitt-trigger mode. If the schmitt-trigger has adjustable hysteresis,
51 * the threshold value is given on a custom format as argument when 52 * the threshold value is given on a custom format as argument when
52 * setting pins to this mode. The argument zero turns the schmitt trigger 53 * setting pins to this mode.
53 * off.
54 * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode, 54 * @PIN_CONFIG_INPUT_DEBOUNCE: this will configure the pin to debounce mode,
55 * which means it will wait for signals to settle when reading inputs. The 55 * which means it will wait for signals to settle when reading inputs. The
56 * argument gives the debounce time on a custom format. Setting the 56 * argument gives the debounce time on a custom format. Setting the
@@ -74,6 +74,7 @@ enum pin_config_param {
74 PIN_CONFIG_DRIVE_PUSH_PULL, 74 PIN_CONFIG_DRIVE_PUSH_PULL,
75 PIN_CONFIG_DRIVE_OPEN_DRAIN, 75 PIN_CONFIG_DRIVE_OPEN_DRAIN,
76 PIN_CONFIG_DRIVE_OPEN_SOURCE, 76 PIN_CONFIG_DRIVE_OPEN_SOURCE,
77 PIN_CONFIG_INPUT_SCHMITT_DISABLE,
77 PIN_CONFIG_INPUT_SCHMITT, 78 PIN_CONFIG_INPUT_SCHMITT,
78 PIN_CONFIG_INPUT_DEBOUNCE, 79 PIN_CONFIG_INPUT_DEBOUNCE,
79 PIN_CONFIG_POWER_SOURCE, 80 PIN_CONFIG_POWER_SOURCE,
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
index 7d087f03e91e..04d6700d99af 100644
--- a/include/linux/pinctrl/pinctrl.h
+++ b/include/linux/pinctrl/pinctrl.h
@@ -134,6 +134,25 @@ extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
134extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev, 134extern void pinctrl_add_gpio_ranges(struct pinctrl_dev *pctldev,
135 struct pinctrl_gpio_range *ranges, 135 struct pinctrl_gpio_range *ranges,
136 unsigned nranges); 136 unsigned nranges);
137extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev,
138 struct pinctrl_gpio_range *range);
139
140extern struct pinctrl_dev *pinctrl_find_and_add_gpio_range(const char *devname,
141 struct pinctrl_gpio_range *range);
142extern struct pinctrl_gpio_range *
143pinctrl_find_gpio_range_from_pin(struct pinctrl_dev *pctldev,
144 unsigned int pin);
145
146#ifdef CONFIG_OF
147extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np);
148#else
149static inline
150struct pinctrl_dev *of_pinctrl_get(struct device_node *np)
151{
152 return NULL;
153}
154#endif /* CONFIG_OF */
155
137extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); 156extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
138extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); 157extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
139#else 158#else
diff --git a/include/linux/platform_data/ad5449.h b/include/linux/platform_data/ad5449.h
new file mode 100644
index 000000000000..bd712bd4b94e
--- /dev/null
+++ b/include/linux/platform_data/ad5449.h
@@ -0,0 +1,40 @@
1/*
2 * AD5415, AD5426, AD5429, AD5432, AD5439, AD5443, AD5449 Digital to Analog
3 * Converter driver.
4 *
5 * Copyright 2012 Analog Devices Inc.
6 * Author: Lars-Peter Clausen <lars@metafoo.de>
7 *
8 * Licensed under the GPL-2.
9 */
10
11#ifndef __LINUX_PLATFORM_DATA_AD5449_H__
12#define __LINUX_PLATFORM_DATA_AD5449_H__
13
14/**
15 * enum ad5449_sdo_mode - AD5449 SDO pin configuration
16 * @AD5449_SDO_DRIVE_FULL: Drive the SDO pin with full strength.
17 * @AD5449_SDO_DRIVE_WEAK: Drive the SDO pin with not full strength.
18 * @AD5449_SDO_OPEN_DRAIN: Operate the SDO pin in open-drain mode.
19 * @AD5449_SDO_DISABLED: Disable the SDO pin, in this mode it is not possible to
20 * read back from the device.
21 */
22enum ad5449_sdo_mode {
23 AD5449_SDO_DRIVE_FULL = 0x0,
24 AD5449_SDO_DRIVE_WEAK = 0x1,
25 AD5449_SDO_OPEN_DRAIN = 0x2,
26 AD5449_SDO_DISABLED = 0x3,
27};
28
29/**
30 * struct ad5449_platform_data - Platform data for the ad5449 DAC driver
31 * @sdo_mode: SDO pin mode
32 * @hardware_clear_to_midscale: Whether asserting the hardware CLR pin sets the
33 * outputs to midscale (true) or to zero scale(false).
34 */
35struct ad5449_platform_data {
36 enum ad5449_sdo_mode sdo_mode;
37 bool hardware_clear_to_midscale;
38};
39
40#endif
diff --git a/include/linux/platform_data/ad7298.h b/include/linux/platform_data/ad7298.h
new file mode 100644
index 000000000000..fbf8adf1363a
--- /dev/null
+++ b/include/linux/platform_data/ad7298.h
@@ -0,0 +1,20 @@
1/*
2 * AD7298 SPI ADC driver
3 *
4 * Copyright 2011 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2.
7 */
8
9#ifndef __LINUX_PLATFORM_DATA_AD7298_H__
10#define __LINUX_PLATFORM_DATA_AD7298_H__
11
12/**
13 * struct ad7298_platform_data - Platform data for the ad7298 ADC driver
14 * @ext_ref: Whether to use an external reference voltage.
15 **/
16struct ad7298_platform_data {
17 bool ext_ref;
18};
19
20#endif /* IIO_ADC_AD7298_H_ */
diff --git a/include/linux/platform_data/ad7793.h b/include/linux/platform_data/ad7793.h
new file mode 100644
index 000000000000..7ea6751aae6d
--- /dev/null
+++ b/include/linux/platform_data/ad7793.h
@@ -0,0 +1,112 @@
1/*
2 * AD7792/AD7793 SPI ADC driver
3 *
4 * Copyright 2011 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2.
7 */
8#ifndef __LINUX_PLATFORM_DATA_AD7793_H__
9#define __LINUX_PLATFORM_DATA_AD7793_H__
10
11/**
12 * enum ad7793_clock_source - AD7793 clock source selection
13 * @AD7793_CLK_SRC_INT: Internal 64 kHz clock, not available at the CLK pin.
14 * @AD7793_CLK_SRC_INT_CO: Internal 64 kHz clock, available at the CLK pin.
15 * @AD7793_CLK_SRC_EXT: Use external clock.
16 * @AD7793_CLK_SRC_EXT_DIV2: Use external clock divided by 2.
17 */
18enum ad7793_clock_source {
19 AD7793_CLK_SRC_INT,
20 AD7793_CLK_SRC_INT_CO,
21 AD7793_CLK_SRC_EXT,
22 AD7793_CLK_SRC_EXT_DIV2,
23};
24
25/**
26 * enum ad7793_bias_voltage - AD7793 bias voltage selection
27 * @AD7793_BIAS_VOLTAGE_DISABLED: Bias voltage generator disabled
28 * @AD7793_BIAS_VOLTAGE_AIN1: Bias voltage connected to AIN1(-).
29 * @AD7793_BIAS_VOLTAGE_AIN2: Bias voltage connected to AIN2(-).
30 * @AD7793_BIAS_VOLTAGE_AIN3: Bias voltage connected to AIN3(-).
31 * Only valid for AD7795/AD7796.
32 */
33enum ad7793_bias_voltage {
34 AD7793_BIAS_VOLTAGE_DISABLED,
35 AD7793_BIAS_VOLTAGE_AIN1,
36 AD7793_BIAS_VOLTAGE_AIN2,
37 AD7793_BIAS_VOLTAGE_AIN3,
38};
39
40/**
41 * enum ad7793_refsel - AD7793 reference voltage selection
42 * @AD7793_REFSEL_REFIN1: External reference applied between REFIN1(+)
43 * and REFIN1(-).
44 * @AD7793_REFSEL_REFIN2: External reference applied between REFIN2(+) and
45 * and REFIN1(-). Only valid for AD7795/AD7796.
46 * @AD7793_REFSEL_INTERNAL: Internal 1.17 V reference.
47 */
48enum ad7793_refsel {
49 AD7793_REFSEL_REFIN1 = 0,
50 AD7793_REFSEL_REFIN2 = 1,
51 AD7793_REFSEL_INTERNAL = 2,
52};
53
54/**
55 * enum ad7793_current_source_direction - AD7793 excitation current direction
56 * @AD7793_IEXEC1_IOUT1_IEXEC2_IOUT2: Current source IEXC1 connected to pin
57 * IOUT1, current source IEXC2 connected to pin IOUT2.
58 * @AD7793_IEXEC1_IOUT2_IEXEC2_IOUT1: Current source IEXC2 connected to pin
59 * IOUT1, current source IEXC1 connected to pin IOUT2.
60 * @AD7793_IEXEC1_IEXEC2_IOUT1: Both current sources connected to pin IOUT1.
61 * Only valid when the current sources are set to 10 uA or 210 uA.
62 * @AD7793_IEXEC1_IEXEC2_IOUT2: Both current sources connected to Pin IOUT2.
63 * Only valid when the current ources are set to 10 uA or 210 uA.
64 */
65enum ad7793_current_source_direction {
66 AD7793_IEXEC1_IOUT1_IEXEC2_IOUT2 = 0,
67 AD7793_IEXEC1_IOUT2_IEXEC2_IOUT1 = 1,
68 AD7793_IEXEC1_IEXEC2_IOUT1 = 2,
69 AD7793_IEXEC1_IEXEC2_IOUT2 = 3,
70};
71
72/**
73 * enum ad7793_excitation_current - AD7793 excitation current selection
74 * @AD7793_IX_DISABLED: Excitation current Disabled.
75 * @AD7793_IX_10uA: Enable 10 micro-ampere excitation current.
76 * @AD7793_IX_210uA: Enable 210 micro-ampere excitation current.
77 * @AD7793_IX_1mA: Enable 1 milli-Ampere excitation current.
78 */
79enum ad7793_excitation_current {
80 AD7793_IX_DISABLED = 0,
81 AD7793_IX_10uA = 1,
82 AD7793_IX_210uA = 2,
83 AD7793_IX_1mA = 3,
84};
85
86/**
87 * struct ad7793_platform_data - AD7793 platform data
88 * @clock_src: Clock source selection
89 * @burnout_current: If set to true the 100nA burnout current is enabled.
90 * @boost_enable: Enable boost for the bias voltage generator.
91 * @buffered: If set to true configure the device for buffered input mode.
92 * @unipolar: If set to true sample in unipolar mode, if set to false sample in
93 * bipolar mode.
94 * @refsel: Reference voltage selection
95 * @bias_voltage: Bias voltage selection
96 * @exitation_current: Excitation current selection
97 * @current_source_direction: Excitation current direction selection
98 */
99struct ad7793_platform_data {
100 enum ad7793_clock_source clock_src;
101 bool burnout_current;
102 bool boost_enable;
103 bool buffered;
104 bool unipolar;
105
106 enum ad7793_refsel refsel;
107 enum ad7793_bias_voltage bias_voltage;
108 enum ad7793_excitation_current exitation_current;
109 enum ad7793_current_source_direction current_source_direction;
110};
111
112#endif /* IIO_ADC_AD7793_H_ */
diff --git a/include/linux/platform_data/ad7887.h b/include/linux/platform_data/ad7887.h
new file mode 100644
index 000000000000..1e06eac3174d
--- /dev/null
+++ b/include/linux/platform_data/ad7887.h
@@ -0,0 +1,26 @@
1/*
2 * AD7887 SPI ADC driver
3 *
4 * Copyright 2010 Analog Devices Inc.
5 *
6 * Licensed under the GPL-2 or later.
7 */
8#ifndef IIO_ADC_AD7887_H_
9#define IIO_ADC_AD7887_H_
10
11/**
12 * struct ad7887_platform_data - AD7887 ADC driver platform data
13 * @en_dual: Whether to use dual channel mode. If set to true AIN1 becomes the
14 * second input channel, and Vref is internally connected to Vdd. If set to
15 * false the device is used in single channel mode and AIN1/Vref is used as
16 * VREF input.
17 * @use_onchip_ref: Whether to use the onchip reference. If set to true the
18 * internal 2.5V reference is used. If set to false a external reference is
19 * used.
20 */
21struct ad7887_platform_data {
22 bool en_dual;
23 bool use_onchip_ref;
24};
25
26#endif /* IIO_ADC_AD7887_H_ */
diff --git a/include/linux/platform_data/ads7828.h b/include/linux/platform_data/ads7828.h
new file mode 100644
index 000000000000..3245f45f9d77
--- /dev/null
+++ b/include/linux/platform_data/ads7828.h
@@ -0,0 +1,29 @@
1/*
2 * TI ADS7828 A/D Converter platform data definition
3 *
4 * Copyright (c) 2012 Savoir-faire Linux Inc.
5 * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
6 *
7 * For further information, see the Documentation/hwmon/ads7828 file.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef _PDATA_ADS7828_H
15#define _PDATA_ADS7828_H
16
17/**
18 * struct ads7828_platform_data - optional ADS7828 connectivity info
19 * @diff_input: Differential input mode.
20 * @ext_vref: Use an external voltage reference.
21 * @vref_mv: Voltage reference value, if external.
22 */
23struct ads7828_platform_data {
24 bool diff_input;
25 bool ext_vref;
26 unsigned int vref_mv;
27};
28
29#endif /* _PDATA_ADS7828_H */
diff --git a/include/linux/platform_data/asoc-imx-ssi.h b/include/linux/platform_data/asoc-imx-ssi.h
index 63f3c2804239..92c7fd72f636 100644
--- a/include/linux/platform_data/asoc-imx-ssi.h
+++ b/include/linux/platform_data/asoc-imx-ssi.h
@@ -17,5 +17,7 @@ struct imx_ssi_platform_data {
17 void (*ac97_warm_reset)(struct snd_ac97 *ac97); 17 void (*ac97_warm_reset)(struct snd_ac97 *ac97);
18}; 18};
19 19
20extern int mxc_set_irq_fiq(unsigned int irq, unsigned int type);
21
20#endif /* __MACH_SSI_H */ 22#endif /* __MACH_SSI_H */
21 23
diff --git a/include/linux/platform_data/asoc-s3c.h b/include/linux/platform_data/asoc-s3c.h
index aa9875f77c40..88272591a895 100644
--- a/include/linux/platform_data/asoc-s3c.h
+++ b/include/linux/platform_data/asoc-s3c.h
@@ -38,12 +38,6 @@ struct samsung_i2s {
38#define QUIRK_NEED_RSTCLR (1 << 3) 38#define QUIRK_NEED_RSTCLR (1 << 3)
39 /* Quirks of the I2S controller */ 39 /* Quirks of the I2S controller */
40 u32 quirks; 40 u32 quirks;
41
42 /*
43 * Array of clock names that can be used to generate I2S signals.
44 * Also corresponds to clocks of I2SMOD[10]
45 */
46 const char **src_clk;
47 dma_addr_t idma_addr; 41 dma_addr_t idma_addr;
48}; 42};
49 43
diff --git a/include/linux/platform_data/atmel.h b/include/linux/platform_data/atmel.h
index b0f2c56a8ea2..6a293b7fff3b 100644
--- a/include/linux/platform_data/atmel.h
+++ b/include/linux/platform_data/atmel.h
@@ -8,6 +8,55 @@
8#define __ATMEL_H__ 8#define __ATMEL_H__
9 9
10#include <linux/mtd/nand.h> 10#include <linux/mtd/nand.h>
11#include <linux/mtd/partitions.h>
12#include <linux/device.h>
13#include <linux/i2c.h>
14#include <linux/leds.h>
15#include <linux/spi/spi.h>
16#include <linux/usb/atmel_usba_udc.h>
17#include <linux/atmel-mci.h>
18#include <sound/atmel-ac97c.h>
19#include <linux/serial.h>
20#include <linux/platform_data/macb.h>
21
22/*
23 * at91: 6 USARTs and one DBGU port (SAM9260)
24 * avr32: 4
25 */
26#define ATMEL_MAX_UART 7
27
28 /* USB Device */
29struct at91_udc_data {
30 int vbus_pin; /* high == host powering us */
31 u8 vbus_active_low; /* vbus polarity */
32 u8 vbus_polled; /* Use polling, not interrupt */
33 int pullup_pin; /* active == D+ pulled up */
34 u8 pullup_active_low; /* true == pullup_pin is active low */
35};
36
37 /* Compact Flash */
38struct at91_cf_data {
39 int irq_pin; /* I/O IRQ */
40 int det_pin; /* Card detect */
41 int vcc_pin; /* power switching */
42 int rst_pin; /* card reset */
43 u8 chipselect; /* EBI Chip Select number */
44 u8 flags;
45#define AT91_CF_TRUE_IDE 0x01
46#define AT91_IDE_SWAP_A0_A2 0x02
47};
48
49 /* USB Host */
50#define AT91_MAX_USBH_PORTS 3
51struct at91_usbh_data {
52 int vbus_pin[AT91_MAX_USBH_PORTS]; /* port power-control pin */
53 int overcurrent_pin[AT91_MAX_USBH_PORTS];
54 u8 ports; /* number of ports on root hub */
55 u8 overcurrent_supported;
56 u8 vbus_pin_active_low[AT91_MAX_USBH_PORTS];
57 u8 overcurrent_status[AT91_MAX_USBH_PORTS];
58 u8 overcurrent_changed[AT91_MAX_USBH_PORTS];
59};
11 60
12 /* NAND / SmartMedia */ 61 /* NAND / SmartMedia */
13struct atmel_nand_data { 62struct atmel_nand_data {
@@ -24,4 +73,28 @@ struct atmel_nand_data {
24 unsigned int num_parts; 73 unsigned int num_parts;
25}; 74};
26 75
76 /* Serial */
77struct atmel_uart_data {
78 int num; /* port num */
79 short use_dma_tx; /* use transmit DMA? */
80 short use_dma_rx; /* use receive DMA? */
81 void __iomem *regs; /* virt. base address, if any */
82 struct serial_rs485 rs485; /* rs485 settings */
83};
84
85 /* Touchscreen Controller */
86struct at91_tsadcc_data {
87 unsigned int adc_clock;
88 u8 pendet_debounce;
89 u8 ts_sample_hold_time;
90};
91
92/* CAN */
93struct at91_can_data {
94 void (*transceiver_switch)(int on);
95};
96
97/* FIXME: this needs a better location, but gets stuff building again */
98extern int at91_suspend_entering_slow_clock(void);
99
27#endif /* __ATMEL_H__ */ 100#endif /* __ATMEL_H__ */
diff --git a/include/linux/platform_data/clk-integrator.h b/include/linux/platform_data/clk-integrator.h
index 83fe9c283bb8..280edac9d0a5 100644
--- a/include/linux/platform_data/clk-integrator.h
+++ b/include/linux/platform_data/clk-integrator.h
@@ -1 +1,3 @@
1void integrator_clk_init(bool is_cp); 1void integrator_clk_init(bool is_cp);
2void integrator_impd1_clk_init(void __iomem *base, unsigned int id);
3void integrator_impd1_clk_exit(unsigned int id);
diff --git a/include/linux/platform_data/clocksource-nomadik-mtu.h b/include/linux/platform_data/clocksource-nomadik-mtu.h
new file mode 100644
index 000000000000..80088973b734
--- /dev/null
+++ b/include/linux/platform_data/clocksource-nomadik-mtu.h
@@ -0,0 +1,9 @@
1#ifndef __PLAT_MTU_H
2#define __PLAT_MTU_H
3
4void nmdk_timer_init(void __iomem *base, int irq);
5void nmdk_clkevt_reset(void);
6void nmdk_clksrc_reset(void);
7
8#endif /* __PLAT_MTU_H */
9
diff --git a/include/linux/platform_data/cpsw.h b/include/linux/platform_data/cpsw.h
index c4e23d029498..24368a2e8b87 100644
--- a/include/linux/platform_data/cpsw.h
+++ b/include/linux/platform_data/cpsw.h
@@ -18,9 +18,7 @@
18#include <linux/if_ether.h> 18#include <linux/if_ether.h>
19 19
20struct cpsw_slave_data { 20struct cpsw_slave_data {
21 u32 slave_reg_ofs; 21 char phy_id[MII_BUS_ID_SIZE];
22 u32 sliver_reg_ofs;
23 const char *phy_id;
24 int phy_if; 22 int phy_if;
25 u8 mac_addr[ETH_ALEN]; 23 u8 mac_addr[ETH_ALEN];
26}; 24};
@@ -28,27 +26,14 @@ struct cpsw_slave_data {
28struct cpsw_platform_data { 26struct cpsw_platform_data {
29 u32 ss_reg_ofs; /* Subsystem control register offset */ 27 u32 ss_reg_ofs; /* Subsystem control register offset */
30 u32 channels; /* number of cpdma channels (symmetric) */ 28 u32 channels; /* number of cpdma channels (symmetric) */
31 u32 cpdma_reg_ofs; /* cpdma register offset */
32 u32 cpdma_sram_ofs; /* cpdma sram offset */
33
34 u32 slaves; /* number of slave cpgmac ports */ 29 u32 slaves; /* number of slave cpgmac ports */
35 struct cpsw_slave_data *slave_data; 30 struct cpsw_slave_data *slave_data;
36 31 u32 cpts_active_slave; /* time stamping slave */
37 u32 ale_reg_ofs; /* address lookup engine reg offset */ 32 u32 cpts_clock_mult; /* convert input clock ticks to nanoseconds */
33 u32 cpts_clock_shift; /* convert input clock ticks to nanoseconds */
38 u32 ale_entries; /* ale table size */ 34 u32 ale_entries; /* ale table size */
39
40 u32 host_port_reg_ofs; /* cpsw cpdma host port registers */
41 u32 host_port_num; /* The port number for the host port */
42
43 u32 hw_stats_reg_ofs; /* cpsw hardware statistics counters */
44
45 u32 bd_ram_ofs; /* embedded buffer descriptor RAM offset*/
46 u32 bd_ram_size; /*buffer descriptor ram size */ 35 u32 bd_ram_size; /*buffer descriptor ram size */
47 u32 hw_ram_addr; /*if the HW address for BD RAM is different */
48 bool no_bd_ram; /* no embedded BD ram*/
49
50 u32 rx_descs; /* Number of Rx Descriptios */ 36 u32 rx_descs; /* Number of Rx Descriptios */
51
52 u32 mac_control; /* Mac control register */ 37 u32 mac_control; /* Mac control register */
53}; 38};
54 39
diff --git a/include/linux/platform_data/crypto-ux500.h b/include/linux/platform_data/crypto-ux500.h
index 5b2d0817e26a..94df96d9a336 100644
--- a/include/linux/platform_data/crypto-ux500.h
+++ b/include/linux/platform_data/crypto-ux500.h
@@ -7,7 +7,7 @@
7#ifndef _CRYPTO_UX500_H 7#ifndef _CRYPTO_UX500_H
8#define _CRYPTO_UX500_H 8#define _CRYPTO_UX500_H
9#include <linux/dmaengine.h> 9#include <linux/dmaengine.h>
10#include <plat/ste_dma40.h> 10#include <linux/platform_data/dma-ste-dma40.h>
11 11
12struct hash_platform_data { 12struct hash_platform_data {
13 void *mem_to_engine; 13 void *mem_to_engine;
diff --git a/include/linux/platform_data/davinci_asp.h b/include/linux/platform_data/davinci_asp.h
index d0c5825876f8..8db5ae03b6e3 100644
--- a/include/linux/platform_data/davinci_asp.h
+++ b/include/linux/platform_data/davinci_asp.h
@@ -16,12 +16,13 @@
16#ifndef __DAVINCI_ASP_H 16#ifndef __DAVINCI_ASP_H
17#define __DAVINCI_ASP_H 17#define __DAVINCI_ASP_H
18 18
19#include <linux/genalloc.h>
20
19struct snd_platform_data { 21struct snd_platform_data {
20 u32 tx_dma_offset; 22 u32 tx_dma_offset;
21 u32 rx_dma_offset; 23 u32 rx_dma_offset;
22 int asp_chan_q; /* event queue number for ASP channel */ 24 int asp_chan_q; /* event queue number for ASP channel */
23 int ram_chan_q; /* event queue number for RAM channel */ 25 int ram_chan_q; /* event queue number for RAM channel */
24 unsigned int codec_fmt;
25 /* 26 /*
26 * Allowing this is more efficient and eliminates left and right swaps 27 * Allowing this is more efficient and eliminates left and right swaps
27 * caused by underruns, but will swap the left and right channels 28 * caused by underruns, but will swap the left and right channels
@@ -30,6 +31,7 @@ struct snd_platform_data {
30 unsigned enable_channel_combine:1; 31 unsigned enable_channel_combine:1;
31 unsigned sram_size_playback; 32 unsigned sram_size_playback;
32 unsigned sram_size_capture; 33 unsigned sram_size_capture;
34 struct gen_pool *sram_pool;
33 35
34 /* 36 /*
35 * If McBSP peripheral gets the clock from an external pin, 37 * If McBSP peripheral gets the clock from an external pin,
diff --git a/include/linux/platform_data/db8500_thermal.h b/include/linux/platform_data/db8500_thermal.h
new file mode 100644
index 000000000000..3bf60902e902
--- /dev/null
+++ b/include/linux/platform_data/db8500_thermal.h
@@ -0,0 +1,38 @@
1/*
2 * db8500_thermal.h - DB8500 Thermal Management Implementation
3 *
4 * Copyright (C) 2012 ST-Ericsson
5 * Copyright (C) 2012 Linaro Ltd.
6 *
7 * Author: Hongbo Zhang <hongbo.zhang@linaro.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 */
19
20#ifndef _DB8500_THERMAL_H_
21#define _DB8500_THERMAL_H_
22
23#include <linux/thermal.h>
24
25#define COOLING_DEV_MAX 8
26
27struct db8500_trip_point {
28 unsigned long temp;
29 enum thermal_trip_type type;
30 char cdev_name[COOLING_DEV_MAX][THERMAL_NAME_LENGTH];
31};
32
33struct db8500_thsens_platform_data {
34 struct db8500_trip_point trip_points[THERMAL_MAX_TRIPS];
35 int num_trips;
36};
37
38#endif /* _DB8500_THERMAL_H_ */
diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h
index 1b9080385b46..f6d30cc1cb77 100644
--- a/include/linux/platform_data/dma-imx.h
+++ b/include/linux/platform_data/dma-imx.h
@@ -61,7 +61,9 @@ static inline int imx_dma_is_ipu(struct dma_chan *chan)
61static inline int imx_dma_is_general_purpose(struct dma_chan *chan) 61static inline int imx_dma_is_general_purpose(struct dma_chan *chan)
62{ 62{
63 return strstr(dev_name(chan->device->dev), "sdma") || 63 return strstr(dev_name(chan->device->dev), "sdma") ||
64 !strcmp(dev_name(chan->device->dev), "imx-dma"); 64 !strcmp(dev_name(chan->device->dev), "imx1-dma") ||
65 !strcmp(dev_name(chan->device->dev), "imx21-dma") ||
66 !strcmp(dev_name(chan->device->dev), "imx27-dma");
65} 67}
66 68
67#endif 69#endif
diff --git a/include/linux/platform_data/dma-mv_xor.h b/include/linux/platform_data/dma-mv_xor.h
index 2ba1f7d76eef..8ec18f64e396 100644
--- a/include/linux/platform_data/dma-mv_xor.h
+++ b/include/linux/platform_data/dma-mv_xor.h
@@ -10,15 +10,14 @@
10#include <linux/dmaengine.h> 10#include <linux/dmaengine.h>
11#include <linux/mbus.h> 11#include <linux/mbus.h>
12 12
13#define MV_XOR_SHARED_NAME "mv_xor_shared" 13#define MV_XOR_NAME "mv_xor"
14#define MV_XOR_NAME "mv_xor"
15 14
16struct mv_xor_platform_data { 15struct mv_xor_channel_data {
17 struct platform_device *shared;
18 int hw_id;
19 dma_cap_mask_t cap_mask; 16 dma_cap_mask_t cap_mask;
20 size_t pool_size;
21}; 17};
22 18
19struct mv_xor_platform_data {
20 struct mv_xor_channel_data *channels;
21};
23 22
24#endif 23#endif
diff --git a/include/linux/platform_data/dma-ste-dma40.h b/include/linux/platform_data/dma-ste-dma40.h
new file mode 100644
index 000000000000..9ff93b065686
--- /dev/null
+++ b/include/linux/platform_data/dma-ste-dma40.h
@@ -0,0 +1,223 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2007-2010
3 * Author: Per Forlin <per.forlin@stericsson.com> for ST-Ericsson
4 * Author: Jonas Aaberg <jonas.aberg@stericsson.com> for ST-Ericsson
5 * License terms: GNU General Public License (GPL) version 2
6 */
7
8
9#ifndef STE_DMA40_H
10#define STE_DMA40_H
11
12#include <linux/dmaengine.h>
13#include <linux/scatterlist.h>
14#include <linux/workqueue.h>
15#include <linux/interrupt.h>
16
17/*
18 * Maxium size for a single dma descriptor
19 * Size is limited to 16 bits.
20 * Size is in the units of addr-widths (1,2,4,8 bytes)
21 * Larger transfers will be split up to multiple linked desc
22 */
23#define STEDMA40_MAX_SEG_SIZE 0xFFFF
24
25/* dev types for memcpy */
26#define STEDMA40_DEV_DST_MEMORY (-1)
27#define STEDMA40_DEV_SRC_MEMORY (-1)
28
29enum stedma40_mode {
30 STEDMA40_MODE_LOGICAL = 0,
31 STEDMA40_MODE_PHYSICAL,
32 STEDMA40_MODE_OPERATION,
33};
34
35enum stedma40_mode_opt {
36 STEDMA40_PCHAN_BASIC_MODE = 0,
37 STEDMA40_LCHAN_SRC_LOG_DST_LOG = 0,
38 STEDMA40_PCHAN_MODULO_MODE,
39 STEDMA40_PCHAN_DOUBLE_DST_MODE,
40 STEDMA40_LCHAN_SRC_PHY_DST_LOG,
41 STEDMA40_LCHAN_SRC_LOG_DST_PHY,
42};
43
44#define STEDMA40_ESIZE_8_BIT 0x0
45#define STEDMA40_ESIZE_16_BIT 0x1
46#define STEDMA40_ESIZE_32_BIT 0x2
47#define STEDMA40_ESIZE_64_BIT 0x3
48
49/* The value 4 indicates that PEN-reg shall be set to 0 */
50#define STEDMA40_PSIZE_PHY_1 0x4
51#define STEDMA40_PSIZE_PHY_2 0x0
52#define STEDMA40_PSIZE_PHY_4 0x1
53#define STEDMA40_PSIZE_PHY_8 0x2
54#define STEDMA40_PSIZE_PHY_16 0x3
55
56/*
57 * The number of elements differ in logical and
58 * physical mode
59 */
60#define STEDMA40_PSIZE_LOG_1 STEDMA40_PSIZE_PHY_2
61#define STEDMA40_PSIZE_LOG_4 STEDMA40_PSIZE_PHY_4
62#define STEDMA40_PSIZE_LOG_8 STEDMA40_PSIZE_PHY_8
63#define STEDMA40_PSIZE_LOG_16 STEDMA40_PSIZE_PHY_16
64
65/* Maximum number of possible physical channels */
66#define STEDMA40_MAX_PHYS 32
67
68enum stedma40_flow_ctrl {
69 STEDMA40_NO_FLOW_CTRL,
70 STEDMA40_FLOW_CTRL,
71};
72
73enum stedma40_periph_data_width {
74 STEDMA40_BYTE_WIDTH = STEDMA40_ESIZE_8_BIT,
75 STEDMA40_HALFWORD_WIDTH = STEDMA40_ESIZE_16_BIT,
76 STEDMA40_WORD_WIDTH = STEDMA40_ESIZE_32_BIT,
77 STEDMA40_DOUBLEWORD_WIDTH = STEDMA40_ESIZE_64_BIT
78};
79
80enum stedma40_xfer_dir {
81 STEDMA40_MEM_TO_MEM = 1,
82 STEDMA40_MEM_TO_PERIPH,
83 STEDMA40_PERIPH_TO_MEM,
84 STEDMA40_PERIPH_TO_PERIPH
85};
86
87
88/**
89 * struct stedma40_chan_cfg - dst/src channel configuration
90 *
91 * @big_endian: true if the src/dst should be read as big endian
92 * @data_width: Data width of the src/dst hardware
93 * @p_size: Burst size
94 * @flow_ctrl: Flow control on/off.
95 */
96struct stedma40_half_channel_info {
97 bool big_endian;
98 enum stedma40_periph_data_width data_width;
99 int psize;
100 enum stedma40_flow_ctrl flow_ctrl;
101};
102
103/**
104 * struct stedma40_chan_cfg - Structure to be filled by client drivers.
105 *
106 * @dir: MEM 2 MEM, PERIPH 2 MEM , MEM 2 PERIPH, PERIPH 2 PERIPH
107 * @high_priority: true if high-priority
108 * @realtime: true if realtime mode is to be enabled. Only available on DMA40
109 * version 3+, i.e DB8500v2+
110 * @mode: channel mode: physical, logical, or operation
111 * @mode_opt: options for the chosen channel mode
112 * @src_dev_type: Src device type
113 * @dst_dev_type: Dst device type
114 * @src_info: Parameters for dst half channel
115 * @dst_info: Parameters for dst half channel
116 * @use_fixed_channel: if true, use physical channel specified by phy_channel
117 * @phy_channel: physical channel to use, only if use_fixed_channel is true
118 *
119 * This structure has to be filled by the client drivers.
120 * It is recommended to do all dma configurations for clients in the machine.
121 *
122 */
123struct stedma40_chan_cfg {
124 enum stedma40_xfer_dir dir;
125 bool high_priority;
126 bool realtime;
127 enum stedma40_mode mode;
128 enum stedma40_mode_opt mode_opt;
129 int src_dev_type;
130 int dst_dev_type;
131 struct stedma40_half_channel_info src_info;
132 struct stedma40_half_channel_info dst_info;
133
134 bool use_fixed_channel;
135 int phy_channel;
136};
137
138/**
139 * struct stedma40_platform_data - Configuration struct for the dma device.
140 *
141 * @dev_len: length of dev_tx and dev_rx
142 * @dev_tx: mapping between destination event line and io address
143 * @dev_rx: mapping between source event line and io address
144 * @memcpy: list of memcpy event lines
145 * @memcpy_len: length of memcpy
146 * @memcpy_conf_phy: default configuration of physical channel memcpy
147 * @memcpy_conf_log: default configuration of logical channel memcpy
148 * @disabled_channels: A vector, ending with -1, that marks physical channels
149 * that are for different reasons not available for the driver.
150 */
151struct stedma40_platform_data {
152 u32 dev_len;
153 const dma_addr_t *dev_tx;
154 const dma_addr_t *dev_rx;
155 int *memcpy;
156 u32 memcpy_len;
157 struct stedma40_chan_cfg *memcpy_conf_phy;
158 struct stedma40_chan_cfg *memcpy_conf_log;
159 int disabled_channels[STEDMA40_MAX_PHYS];
160 bool use_esram_lcla;
161};
162
163#ifdef CONFIG_STE_DMA40
164
165/**
166 * stedma40_filter() - Provides stedma40_chan_cfg to the
167 * ste_dma40 dma driver via the dmaengine framework.
168 * does some checking of what's provided.
169 *
170 * Never directly called by client. It used by dmaengine.
171 * @chan: dmaengine handle.
172 * @data: Must be of type: struct stedma40_chan_cfg and is
173 * the configuration of the framework.
174 *
175 *
176 */
177
178bool stedma40_filter(struct dma_chan *chan, void *data);
179
180/**
181 * stedma40_slave_mem() - Transfers a raw data buffer to or from a slave
182 * (=device)
183 *
184 * @chan: dmaengine handle
185 * @addr: source or destination physicall address.
186 * @size: bytes to transfer
187 * @direction: direction of transfer
188 * @flags: is actually enum dma_ctrl_flags. See dmaengine.h
189 */
190
191static inline struct
192dma_async_tx_descriptor *stedma40_slave_mem(struct dma_chan *chan,
193 dma_addr_t addr,
194 unsigned int size,
195 enum dma_transfer_direction direction,
196 unsigned long flags)
197{
198 struct scatterlist sg;
199 sg_init_table(&sg, 1);
200 sg.dma_address = addr;
201 sg.length = size;
202
203 return dmaengine_prep_slave_sg(chan, &sg, 1, direction, flags);
204}
205
206#else
207static inline bool stedma40_filter(struct dma_chan *chan, void *data)
208{
209 return false;
210}
211
212static inline struct
213dma_async_tx_descriptor *stedma40_slave_mem(struct dma_chan *chan,
214 dma_addr_t addr,
215 unsigned int size,
216 enum dma_transfer_direction direction,
217 unsigned long flags)
218{
219 return NULL;
220}
221#endif
222
223#endif
diff --git a/include/linux/platform_data/dmtimer-omap.h b/include/linux/platform_data/dmtimer-omap.h
new file mode 100644
index 000000000000..a19b78d826e9
--- /dev/null
+++ b/include/linux/platform_data/dmtimer-omap.h
@@ -0,0 +1,31 @@
1/*
2 * DMTIMER platform data for TI OMAP platforms
3 *
4 * Copyright (C) 2012 Texas Instruments
5 * Author: Jon Hunter <jon-hunter@ti.com>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef __PLATFORM_DATA_DMTIMER_OMAP_H__
21#define __PLATFORM_DATA_DMTIMER_OMAP_H__
22
23struct dmtimer_platform_data {
24 /* set_timer_src - Only used for OMAP1 devices */
25 int (*set_timer_src)(struct platform_device *pdev, int source);
26 u32 timer_capability;
27 u32 timer_errata;
28 int (*get_context_loss_count)(struct device *);
29};
30
31#endif /* __PLATFORM_DATA_DMTIMER_OMAP_H__ */
diff --git a/include/linux/platform_data/gpio-omap.h b/include/linux/platform_data/gpio-omap.h
index e8741c2678d5..5d50b25a73d7 100644
--- a/include/linux/platform_data/gpio-omap.h
+++ b/include/linux/platform_data/gpio-omap.h
@@ -26,7 +26,6 @@
26 26
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <mach/irqs.h>
30 29
31#define OMAP1_MPUIO_BASE 0xfffb5000 30#define OMAP1_MPUIO_BASE 0xfffb5000
32 31
diff --git a/include/linux/platform_data/gpio-ts5500.h b/include/linux/platform_data/gpio-ts5500.h
new file mode 100644
index 000000000000..b10d11c9bb49
--- /dev/null
+++ b/include/linux/platform_data/gpio-ts5500.h
@@ -0,0 +1,27 @@
1/*
2 * GPIO (DIO) header for Technologic Systems TS-5500
3 *
4 * Copyright (c) 2012 Savoir-faire Linux Inc.
5 * Vivien Didelot <vivien.didelot@savoirfairelinux.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 _PDATA_GPIO_TS5500_H
13#define _PDATA_GPIO_TS5500_H
14
15/**
16 * struct ts5500_dio_platform_data - TS-5500 pin block configuration
17 * @base: The GPIO base number to use.
18 * @strap: The only pin connected to an interrupt in a block is input-only.
19 * If you need a bidirectional line which can trigger an IRQ, you
20 * may strap it with an in/out pin. This flag indicates this case.
21 */
22struct ts5500_dio_platform_data {
23 int base;
24 bool strap;
25};
26
27#endif /* _PDATA_GPIO_TS5500_H */
diff --git a/include/linux/platform_data/iommu-omap.h b/include/linux/platform_data/iommu-omap.h
new file mode 100644
index 000000000000..c677b9f2fefa
--- /dev/null
+++ b/include/linux/platform_data/iommu-omap.h
@@ -0,0 +1,49 @@
1/*
2 * omap iommu: main structures
3 *
4 * Copyright (C) 2008-2009 Nokia Corporation
5 *
6 * Written by Hiroshi DOYU <Hiroshi.DOYU@nokia.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#define MMU_REG_SIZE 256
14
15/**
16 * struct iommu_arch_data - omap iommu private data
17 * @name: name of the iommu device
18 * @iommu_dev: handle of the iommu device
19 *
20 * This is an omap iommu private data object, which binds an iommu user
21 * to its iommu device. This object should be placed at the iommu user's
22 * dev_archdata so generic IOMMU API can be used without having to
23 * utilize omap-specific plumbing anymore.
24 */
25struct omap_iommu_arch_data {
26 const char *name;
27 struct omap_iommu *iommu_dev;
28};
29
30/**
31 * struct omap_mmu_dev_attr - OMAP mmu device attributes for omap_hwmod
32 * @da_start: device address where the va space starts.
33 * @da_end: device address where the va space ends.
34 * @nr_tlb_entries: number of entries supported by the translation
35 * look-aside buffer (TLB).
36 */
37struct omap_mmu_dev_attr {
38 u32 da_start;
39 u32 da_end;
40 int nr_tlb_entries;
41};
42
43struct iommu_platform_data {
44 const char *name;
45 const char *clk_name;
46 const int nr_tlb_entries;
47 u32 da_start;
48 u32 da_end;
49};
diff --git a/include/linux/platform_data/leds-omap.h b/include/linux/platform_data/leds-omap.h
new file mode 100644
index 000000000000..56c9b2a0ada5
--- /dev/null
+++ b/include/linux/platform_data/leds-omap.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright (C) 2006 Samsung Electronics
3 * Kyungmin Park <kyungmin.park@samsung.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9#ifndef ASMARM_ARCH_LED_H
10#define ASMARM_ARCH_LED_H
11
12struct omap_led_config {
13 struct led_classdev cdev;
14 s16 gpio;
15};
16
17struct omap_led_platform_data {
18 s16 nr_leds;
19 struct omap_led_config *leds;
20};
21
22#endif
diff --git a/include/linux/platform_data/macb.h b/include/linux/platform_data/macb.h
index b081c7245ec8..044a124bfbbc 100644
--- a/include/linux/platform_data/macb.h
+++ b/include/linux/platform_data/macb.h
@@ -12,6 +12,7 @@ struct macb_platform_data {
12 u32 phy_mask; 12 u32 phy_mask;
13 int phy_irq_pin; /* PHY IRQ */ 13 int phy_irq_pin; /* PHY IRQ */
14 u8 is_rmii; /* using RMII interface? */ 14 u8 is_rmii; /* using RMII interface? */
15 u8 rev_eth_addr; /* reverse Ethernet address byte order */
15}; 16};
16 17
17#endif /* __MACB_PDATA_H__ */ 18#endif /* __MACB_PDATA_H__ */
diff --git a/include/linux/platform_data/mmc-omap.h b/include/linux/platform_data/mmc-omap.h
new file mode 100644
index 000000000000..2bf1b30cb5dc
--- /dev/null
+++ b/include/linux/platform_data/mmc-omap.h
@@ -0,0 +1,151 @@
1/*
2 * MMC definitions for OMAP2
3 *
4 * Copyright (C) 2006 Nokia Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#define OMAP_MMC_MAX_SLOTS 2
12
13/*
14 * struct omap_mmc_dev_attr.flags possibilities
15 *
16 * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can
17 * operate with either 1.8Vdc or 3.0Vdc card voltages; this flag
18 * should be set if this is the case. See for example Section 22.5.3
19 * "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia
20 * Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R).
21 *
22 * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers
23 * don't work correctly on some MMC controller instances on some
24 * OMAP3 SoCs; this flag should be set if this is the case. See
25 * for example Advisory 2.1.1.128 "MMC: Multiple Block Read
26 * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_
27 * Revision F (October 2010) (SPRZ278F).
28 */
29#define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0)
30#define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1)
31
32struct mmc_card;
33
34struct omap_mmc_dev_attr {
35 u8 flags;
36};
37
38struct omap_mmc_platform_data {
39 /* back-link to device */
40 struct device *dev;
41
42 /* number of slots per controller */
43 unsigned nr_slots:2;
44
45 /* set if your board has components or wiring that limits the
46 * maximum frequency on the MMC bus */
47 unsigned int max_freq;
48
49 /* switch the bus to a new slot */
50 int (*switch_slot)(struct device *dev, int slot);
51 /* initialize board-specific MMC functionality, can be NULL if
52 * not supported */
53 int (*init)(struct device *dev);
54 void (*cleanup)(struct device *dev);
55 void (*shutdown)(struct device *dev);
56
57 /* To handle board related suspend/resume functionality for MMC */
58 int (*suspend)(struct device *dev, int slot);
59 int (*resume)(struct device *dev, int slot);
60
61 /* Return context loss count due to PM states changing */
62 int (*get_context_loss_count)(struct device *dev);
63
64 /* Integrating attributes from the omap_hwmod layer */
65 u8 controller_flags;
66
67 /* Register offset deviation */
68 u16 reg_offset;
69
70 struct omap_mmc_slot_data {
71
72 /*
73 * 4/8 wires and any additional host capabilities
74 * need to OR'd all capabilities (ref. linux/mmc/host.h)
75 */
76 u8 wires; /* Used for the MMC driver on omap1 and 2420 */
77 u32 caps; /* Used for the MMC driver on 2430 and later */
78 u32 pm_caps; /* PM capabilities of the mmc */
79
80 /*
81 * nomux means "standard" muxing is wrong on this board, and
82 * that board-specific code handled it before common init logic.
83 */
84 unsigned nomux:1;
85
86 /* switch pin can be for card detect (default) or card cover */
87 unsigned cover:1;
88
89 /* use the internal clock */
90 unsigned internal_clock:1;
91
92 /* nonremovable e.g. eMMC */
93 unsigned nonremovable:1;
94
95 /* Try to sleep or power off when possible */
96 unsigned power_saving:1;
97
98 /* If using power_saving and the MMC power is not to go off */
99 unsigned no_off:1;
100
101 /* eMMC does not handle power off when not in sleep state */
102 unsigned no_regulator_off_init:1;
103
104 /* Regulator off remapped to sleep */
105 unsigned vcc_aux_disable_is_sleep:1;
106
107 /* we can put the features above into this variable */
108#define HSMMC_HAS_PBIAS (1 << 0)
109#define HSMMC_HAS_UPDATED_RESET (1 << 1)
110#define HSMMC_HAS_HSPE_SUPPORT (1 << 2)
111#define MMC_OMAP7XX (1 << 3)
112#define MMC_OMAP15XX (1 << 4)
113#define MMC_OMAP16XX (1 << 5)
114 unsigned features;
115
116 int switch_pin; /* gpio (card detect) */
117 int gpio_wp; /* gpio (write protect) */
118
119 int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
120 int (*set_power)(struct device *dev, int slot,
121 int power_on, int vdd);
122 int (*get_ro)(struct device *dev, int slot);
123 void (*remux)(struct device *dev, int slot, int power_on);
124 /* Call back before enabling / disabling regulators */
125 void (*before_set_reg)(struct device *dev, int slot,
126 int power_on, int vdd);
127 /* Call back after enabling / disabling regulators */
128 void (*after_set_reg)(struct device *dev, int slot,
129 int power_on, int vdd);
130 /* if we have special card, init it using this callback */
131 void (*init_card)(struct mmc_card *card);
132
133 /* return MMC cover switch state, can be NULL if not supported.
134 *
135 * possible return values:
136 * 0 - closed
137 * 1 - open
138 */
139 int (*get_cover_state)(struct device *dev, int slot);
140
141 const char *name;
142 u32 ocr_mask;
143
144 /* Card detection IRQs */
145 int card_detect_irq;
146 int (*card_detect)(struct device *dev, int slot);
147
148 unsigned int ban_openended:1;
149
150 } slots[OMAP_MMC_MAX_SLOTS];
151};
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
index 1a68c1e5fe53..24d32ca34bef 100644
--- a/include/linux/platform_data/mtd-nand-omap2.h
+++ b/include/linux/platform_data/mtd-nand-omap2.h
@@ -8,9 +8,13 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <plat/gpmc.h> 11#ifndef _MTD_NAND_OMAP2_H
12#define _MTD_NAND_OMAP2_H
13
12#include <linux/mtd/partitions.h> 14#include <linux/mtd/partitions.h>
13 15
16#define GPMC_BCH_NUM_REMAINDER 8
17
14enum nand_io { 18enum nand_io {
15 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ 19 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
16 NAND_OMAP_POLLED, /* polled mode, without prefetch */ 20 NAND_OMAP_POLLED, /* polled mode, without prefetch */
@@ -18,10 +22,38 @@ enum nand_io {
18 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ 22 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
19}; 23};
20 24
25enum omap_ecc {
26 /* 1-bit ecc: stored at end of spare area */
27 OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
28 OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
29 /* 1-bit ecc: stored at beginning of spare area as romcode */
30 OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
31 OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */
32 OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */
33};
34
35struct gpmc_nand_regs {
36 void __iomem *gpmc_status;
37 void __iomem *gpmc_nand_command;
38 void __iomem *gpmc_nand_address;
39 void __iomem *gpmc_nand_data;
40 void __iomem *gpmc_prefetch_config1;
41 void __iomem *gpmc_prefetch_config2;
42 void __iomem *gpmc_prefetch_control;
43 void __iomem *gpmc_prefetch_status;
44 void __iomem *gpmc_ecc_config;
45 void __iomem *gpmc_ecc_control;
46 void __iomem *gpmc_ecc_size_config;
47 void __iomem *gpmc_ecc1_result;
48 void __iomem *gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER];
49 void __iomem *gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER];
50 void __iomem *gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER];
51 void __iomem *gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER];
52};
53
21struct omap_nand_platform_data { 54struct omap_nand_platform_data {
22 int cs; 55 int cs;
23 struct mtd_partition *parts; 56 struct mtd_partition *parts;
24 struct gpmc_timings *gpmc_t;
25 int nr_parts; 57 int nr_parts;
26 bool dev_ready; 58 bool dev_ready;
27 enum nand_io xfer_type; 59 enum nand_io xfer_type;
@@ -30,14 +62,4 @@ struct omap_nand_platform_data {
30 struct gpmc_nand_regs reg; 62 struct gpmc_nand_regs reg;
31}; 63};
32 64
33/* minimum size for IO mapping */
34#define NAND_IO_SIZE 4
35
36#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
37extern int gpmc_nand_init(struct omap_nand_platform_data *d);
38#else
39static inline int gpmc_nand_init(struct omap_nand_platform_data *d)
40{
41 return 0;
42}
43#endif 65#endif
diff --git a/include/linux/platform_data/mtd-onenand-omap2.h b/include/linux/platform_data/mtd-onenand-omap2.h
index 2858667d2e4f..685af7e8b120 100644
--- a/include/linux/platform_data/mtd-onenand-omap2.h
+++ b/include/linux/platform_data/mtd-onenand-omap2.h
@@ -9,17 +9,15 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12#ifndef __MTD_ONENAND_OMAP2_H
13#define __MTD_ONENAND_OMAP2_H
14
12#include <linux/mtd/mtd.h> 15#include <linux/mtd/mtd.h>
13#include <linux/mtd/partitions.h> 16#include <linux/mtd/partitions.h>
14 17
15#define ONENAND_SYNC_READ (1 << 0) 18#define ONENAND_SYNC_READ (1 << 0)
16#define ONENAND_SYNC_READWRITE (1 << 1) 19#define ONENAND_SYNC_READWRITE (1 << 1)
17 20#define ONENAND_IN_OMAP34XX (1 << 2)
18struct onenand_freq_info {
19 u16 maf_id;
20 u16 dev_id;
21 u16 ver_id;
22};
23 21
24struct omap_onenand_platform_data { 22struct omap_onenand_platform_data {
25 int cs; 23 int cs;
@@ -27,27 +25,9 @@ struct omap_onenand_platform_data {
27 struct mtd_partition *parts; 25 struct mtd_partition *parts;
28 int nr_parts; 26 int nr_parts;
29 int (*onenand_setup)(void __iomem *, int *freq_ptr); 27 int (*onenand_setup)(void __iomem *, int *freq_ptr);
30 int (*get_freq)(const struct onenand_freq_info *freq_info,
31 bool *clk_dep);
32 int dma_channel; 28 int dma_channel;
33 u8 flags; 29 u8 flags;
34 u8 regulator_can_sleep; 30 u8 regulator_can_sleep;
35 u8 skip_initial_unlocking; 31 u8 skip_initial_unlocking;
36}; 32};
37
38#define ONENAND_MAX_PARTITIONS 8
39
40#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
41 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
42
43extern void gpmc_onenand_init(struct omap_onenand_platform_data *d);
44
45#else
46
47#define board_onenand_data NULL
48
49static inline void gpmc_onenand_init(struct omap_onenand_platform_data *d)
50{
51}
52
53#endif 33#endif
diff --git a/include/linux/platform_data/omap-twl4030.h b/include/linux/platform_data/omap-twl4030.h
index c7bef788daab..ee60ef79d792 100644
--- a/include/linux/platform_data/omap-twl4030.h
+++ b/include/linux/platform_data/omap-twl4030.h
@@ -25,8 +25,34 @@
25#ifndef _OMAP_TWL4030_H_ 25#ifndef _OMAP_TWL4030_H_
26#define _OMAP_TWL4030_H_ 26#define _OMAP_TWL4030_H_
27 27
28/* To select if only one channel is connected in a stereo port */
29#define OMAP_TWL4030_LEFT (1 << 0)
30#define OMAP_TWL4030_RIGHT (1 << 1)
31
28struct omap_tw4030_pdata { 32struct omap_tw4030_pdata {
29 const char *card_name; 33 const char *card_name;
34 /* Voice port is connected to McBSP3 */
35 bool voice_connected;
36
37 /* The driver will parse the connection flags if this flag is set */
38 bool custom_routing;
39 /* Flags to indicate connected audio ports. */
40 u8 has_hs;
41 u8 has_hf;
42 u8 has_predriv;
43 u8 has_carkit;
44 bool has_ear;
45
46 bool has_mainmic;
47 bool has_submic;
48 bool has_hsmic;
49 bool has_carkitmic;
50 bool has_digimic0;
51 bool has_digimic1;
52 u8 has_linein;
53
54 /* Jack detect GPIO or <= 0 if it is not implemented */
55 int jack_detect;
30}; 56};
31 57
32#endif /* _OMAP_TWL4030_H_ */ 58#endif /* _OMAP_TWL4030_H_ */
diff --git a/include/linux/platform_data/omap-wd-timer.h b/include/linux/platform_data/omap-wd-timer.h
new file mode 100644
index 000000000000..d75f5f802d98
--- /dev/null
+++ b/include/linux/platform_data/omap-wd-timer.h
@@ -0,0 +1,38 @@
1/*
2 * OMAP2+ WDTIMER-specific function prototypes
3 *
4 * Copyright (C) 2012 Texas Instruments, Inc.
5 * Paul Walmsley
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef __LINUX_PLATFORM_DATA_OMAP_WD_TIMER_H
14#define __LINUX_PLATFORM_DATA_OMAP_WD_TIMER_H
15
16#include <linux/types.h>
17
18/*
19 * Standardized OMAP reset source bits
20 *
21 * This is a subset of the ones listed in arch/arm/mach-omap2/prm.h
22 * and are the only ones needed in the watchdog driver.
23 */
24#define OMAP_MPU_WD_RST_SRC_ID_SHIFT 3
25
26/**
27 * struct omap_wd_timer_platform_data - WDTIMER integration to the host SoC
28 * @read_reset_sources - fn ptr for the SoC to indicate the last reset cause
29 *
30 * The function pointed to by @read_reset_sources must return its data
31 * in a standard format - search for RST_SRC_ID_SHIFT in
32 * arch/arm/mach-omap2
33 */
34struct omap_wd_timer_platform_data {
35 u32 (*read_reset_sources)(void);
36};
37
38#endif
diff --git a/include/linux/platform_data/omap_drm.h b/include/linux/platform_data/omap_drm.h
index 3da73bdc2031..f4e4a237ebd2 100644
--- a/include/linux/platform_data/omap_drm.h
+++ b/include/linux/platform_data/omap_drm.h
@@ -46,6 +46,7 @@ struct omap_kms_platform_data {
46}; 46};
47 47
48struct omap_drm_platform_data { 48struct omap_drm_platform_data {
49 uint32_t omaprev;
49 struct omap_kms_platform_data *kms_pdata; 50 struct omap_kms_platform_data *kms_pdata;
50}; 51};
51 52
diff --git a/include/linux/platform_data/pinctrl-coh901.h b/include/linux/platform_data/pinctrl-coh901.h
index 30dea251b835..dfbc65d10484 100644
--- a/include/linux/platform_data/pinctrl-coh901.h
+++ b/include/linux/platform_data/pinctrl-coh901.h
@@ -13,14 +13,10 @@
13 * struct u300_gpio_platform - U300 GPIO platform data 13 * struct u300_gpio_platform - U300 GPIO platform data
14 * @ports: number of GPIO block ports 14 * @ports: number of GPIO block ports
15 * @gpio_base: first GPIO number for this block (use a free range) 15 * @gpio_base: first GPIO number for this block (use a free range)
16 * @gpio_irq_base: first GPIO IRQ number for this block (use a free range)
17 * @pinctrl_device: pin control device to spawn as child
18 */ 16 */
19struct u300_gpio_platform { 17struct u300_gpio_platform {
20 u8 ports; 18 u8 ports;
21 int gpio_base; 19 int gpio_base;
22 int gpio_irq_base;
23 struct platform_device *pinctrl_device;
24}; 20};
25 21
26#endif /* __MACH_U300_GPIO_U300_H */ 22#endif /* __MACH_U300_GPIO_U300_H */
diff --git a/include/linux/platform_data/pinctrl-nomadik.h b/include/linux/platform_data/pinctrl-nomadik.h
new file mode 100644
index 000000000000..f73b2f0c55b7
--- /dev/null
+++ b/include/linux/platform_data/pinctrl-nomadik.h
@@ -0,0 +1,266 @@
1/*
2 * Structures and registers for GPIO access in the Nomadik SoC
3 *
4 * Copyright (C) 2008 STMicroelectronics
5 * Author: Prafulla WADASKAR <prafulla.wadaskar@st.com>
6 * Copyright (C) 2009 Alessandro Rubini <rubini@unipv.it>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __PLAT_NOMADIK_GPIO
14#define __PLAT_NOMADIK_GPIO
15
16/*
17 * pin configurations are represented by 32-bit integers:
18 *
19 * bit 0.. 8 - Pin Number (512 Pins Maximum)
20 * bit 9..10 - Alternate Function Selection
21 * bit 11..12 - Pull up/down state
22 * bit 13 - Sleep mode behaviour
23 * bit 14 - Direction
24 * bit 15 - Value (if output)
25 * bit 16..18 - SLPM pull up/down state
26 * bit 19..20 - SLPM direction
27 * bit 21..22 - SLPM Value (if output)
28 * bit 23..25 - PDIS value (if input)
29 * bit 26 - Gpio mode
30 * bit 27 - Sleep mode
31 *
32 * to facilitate the definition, the following macros are provided
33 *
34 * PIN_CFG_DEFAULT - default config (0):
35 * pull up/down = disabled
36 * sleep mode = input/wakeup
37 * direction = input
38 * value = low
39 * SLPM direction = same as normal
40 * SLPM pull = same as normal
41 * SLPM value = same as normal
42 *
43 * PIN_CFG - default config with alternate function
44 */
45
46typedef unsigned long pin_cfg_t;
47
48#define PIN_NUM_MASK 0x1ff
49#define PIN_NUM(x) ((x) & PIN_NUM_MASK)
50
51#define PIN_ALT_SHIFT 9
52#define PIN_ALT_MASK (0x3 << PIN_ALT_SHIFT)
53#define PIN_ALT(x) (((x) & PIN_ALT_MASK) >> PIN_ALT_SHIFT)
54#define PIN_GPIO (NMK_GPIO_ALT_GPIO << PIN_ALT_SHIFT)
55#define PIN_ALT_A (NMK_GPIO_ALT_A << PIN_ALT_SHIFT)
56#define PIN_ALT_B (NMK_GPIO_ALT_B << PIN_ALT_SHIFT)
57#define PIN_ALT_C (NMK_GPIO_ALT_C << PIN_ALT_SHIFT)
58
59#define PIN_PULL_SHIFT 11
60#define PIN_PULL_MASK (0x3 << PIN_PULL_SHIFT)
61#define PIN_PULL(x) (((x) & PIN_PULL_MASK) >> PIN_PULL_SHIFT)
62#define PIN_PULL_NONE (NMK_GPIO_PULL_NONE << PIN_PULL_SHIFT)
63#define PIN_PULL_UP (NMK_GPIO_PULL_UP << PIN_PULL_SHIFT)
64#define PIN_PULL_DOWN (NMK_GPIO_PULL_DOWN << PIN_PULL_SHIFT)
65
66#define PIN_SLPM_SHIFT 13
67#define PIN_SLPM_MASK (0x1 << PIN_SLPM_SHIFT)
68#define PIN_SLPM(x) (((x) & PIN_SLPM_MASK) >> PIN_SLPM_SHIFT)
69#define PIN_SLPM_MAKE_INPUT (NMK_GPIO_SLPM_INPUT << PIN_SLPM_SHIFT)
70#define PIN_SLPM_NOCHANGE (NMK_GPIO_SLPM_NOCHANGE << PIN_SLPM_SHIFT)
71/* These two replace the above in DB8500v2+ */
72#define PIN_SLPM_WAKEUP_ENABLE (NMK_GPIO_SLPM_WAKEUP_ENABLE << PIN_SLPM_SHIFT)
73#define PIN_SLPM_WAKEUP_DISABLE (NMK_GPIO_SLPM_WAKEUP_DISABLE << PIN_SLPM_SHIFT)
74#define PIN_SLPM_USE_MUX_SETTINGS_IN_SLEEP PIN_SLPM_WAKEUP_DISABLE
75
76#define PIN_SLPM_GPIO PIN_SLPM_WAKEUP_ENABLE /* In SLPM, pin is a gpio */
77#define PIN_SLPM_ALTFUNC PIN_SLPM_WAKEUP_DISABLE /* In SLPM, pin is altfunc */
78
79#define PIN_DIR_SHIFT 14
80#define PIN_DIR_MASK (0x1 << PIN_DIR_SHIFT)
81#define PIN_DIR(x) (((x) & PIN_DIR_MASK) >> PIN_DIR_SHIFT)
82#define PIN_DIR_INPUT (0 << PIN_DIR_SHIFT)
83#define PIN_DIR_OUTPUT (1 << PIN_DIR_SHIFT)
84
85#define PIN_VAL_SHIFT 15
86#define PIN_VAL_MASK (0x1 << PIN_VAL_SHIFT)
87#define PIN_VAL(x) (((x) & PIN_VAL_MASK) >> PIN_VAL_SHIFT)
88#define PIN_VAL_LOW (0 << PIN_VAL_SHIFT)
89#define PIN_VAL_HIGH (1 << PIN_VAL_SHIFT)
90
91#define PIN_SLPM_PULL_SHIFT 16
92#define PIN_SLPM_PULL_MASK (0x7 << PIN_SLPM_PULL_SHIFT)
93#define PIN_SLPM_PULL(x) \
94 (((x) & PIN_SLPM_PULL_MASK) >> PIN_SLPM_PULL_SHIFT)
95#define PIN_SLPM_PULL_NONE \
96 ((1 + NMK_GPIO_PULL_NONE) << PIN_SLPM_PULL_SHIFT)
97#define PIN_SLPM_PULL_UP \
98 ((1 + NMK_GPIO_PULL_UP) << PIN_SLPM_PULL_SHIFT)
99#define PIN_SLPM_PULL_DOWN \
100 ((1 + NMK_GPIO_PULL_DOWN) << PIN_SLPM_PULL_SHIFT)
101
102#define PIN_SLPM_DIR_SHIFT 19
103#define PIN_SLPM_DIR_MASK (0x3 << PIN_SLPM_DIR_SHIFT)
104#define PIN_SLPM_DIR(x) \
105 (((x) & PIN_SLPM_DIR_MASK) >> PIN_SLPM_DIR_SHIFT)
106#define PIN_SLPM_DIR_INPUT ((1 + 0) << PIN_SLPM_DIR_SHIFT)
107#define PIN_SLPM_DIR_OUTPUT ((1 + 1) << PIN_SLPM_DIR_SHIFT)
108
109#define PIN_SLPM_VAL_SHIFT 21
110#define PIN_SLPM_VAL_MASK (0x3 << PIN_SLPM_VAL_SHIFT)
111#define PIN_SLPM_VAL(x) \
112 (((x) & PIN_SLPM_VAL_MASK) >> PIN_SLPM_VAL_SHIFT)
113#define PIN_SLPM_VAL_LOW ((1 + 0) << PIN_SLPM_VAL_SHIFT)
114#define PIN_SLPM_VAL_HIGH ((1 + 1) << PIN_SLPM_VAL_SHIFT)
115
116#define PIN_SLPM_PDIS_SHIFT 23
117#define PIN_SLPM_PDIS_MASK (0x3 << PIN_SLPM_PDIS_SHIFT)
118#define PIN_SLPM_PDIS(x) \
119 (((x) & PIN_SLPM_PDIS_MASK) >> PIN_SLPM_PDIS_SHIFT)
120#define PIN_SLPM_PDIS_NO_CHANGE (0 << PIN_SLPM_PDIS_SHIFT)
121#define PIN_SLPM_PDIS_DISABLED (1 << PIN_SLPM_PDIS_SHIFT)
122#define PIN_SLPM_PDIS_ENABLED (2 << PIN_SLPM_PDIS_SHIFT)
123
124#define PIN_LOWEMI_SHIFT 25
125#define PIN_LOWEMI_MASK (0x1 << PIN_LOWEMI_SHIFT)
126#define PIN_LOWEMI(x) (((x) & PIN_LOWEMI_MASK) >> PIN_LOWEMI_SHIFT)
127#define PIN_LOWEMI_DISABLED (0 << PIN_LOWEMI_SHIFT)
128#define PIN_LOWEMI_ENABLED (1 << PIN_LOWEMI_SHIFT)
129
130#define PIN_GPIOMODE_SHIFT 26
131#define PIN_GPIOMODE_MASK (0x1 << PIN_GPIOMODE_SHIFT)
132#define PIN_GPIOMODE(x) (((x) & PIN_GPIOMODE_MASK) >> PIN_GPIOMODE_SHIFT)
133#define PIN_GPIOMODE_DISABLED (0 << PIN_GPIOMODE_SHIFT)
134#define PIN_GPIOMODE_ENABLED (1 << PIN_GPIOMODE_SHIFT)
135
136#define PIN_SLEEPMODE_SHIFT 27
137#define PIN_SLEEPMODE_MASK (0x1 << PIN_SLEEPMODE_SHIFT)
138#define PIN_SLEEPMODE(x) (((x) & PIN_SLEEPMODE_MASK) >> PIN_SLEEPMODE_SHIFT)
139#define PIN_SLEEPMODE_DISABLED (0 << PIN_SLEEPMODE_SHIFT)
140#define PIN_SLEEPMODE_ENABLED (1 << PIN_SLEEPMODE_SHIFT)
141
142
143/* Shortcuts. Use these instead of separate DIR, PULL, and VAL. */
144#define PIN_INPUT_PULLDOWN (PIN_DIR_INPUT | PIN_PULL_DOWN)
145#define PIN_INPUT_PULLUP (PIN_DIR_INPUT | PIN_PULL_UP)
146#define PIN_INPUT_NOPULL (PIN_DIR_INPUT | PIN_PULL_NONE)
147#define PIN_OUTPUT_LOW (PIN_DIR_OUTPUT | PIN_VAL_LOW)
148#define PIN_OUTPUT_HIGH (PIN_DIR_OUTPUT | PIN_VAL_HIGH)
149
150#define PIN_SLPM_INPUT_PULLDOWN (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_DOWN)
151#define PIN_SLPM_INPUT_PULLUP (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_UP)
152#define PIN_SLPM_INPUT_NOPULL (PIN_SLPM_DIR_INPUT | PIN_SLPM_PULL_NONE)
153#define PIN_SLPM_OUTPUT_LOW (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_LOW)
154#define PIN_SLPM_OUTPUT_HIGH (PIN_SLPM_DIR_OUTPUT | PIN_SLPM_VAL_HIGH)
155
156#define PIN_CFG_DEFAULT (0)
157
158#define PIN_CFG(num, alt) \
159 (PIN_CFG_DEFAULT |\
160 (PIN_NUM(num) | PIN_##alt))
161
162#define PIN_CFG_INPUT(num, alt, pull) \
163 (PIN_CFG_DEFAULT |\
164 (PIN_NUM(num) | PIN_##alt | PIN_INPUT_##pull))
165
166#define PIN_CFG_OUTPUT(num, alt, val) \
167 (PIN_CFG_DEFAULT |\
168 (PIN_NUM(num) | PIN_##alt | PIN_OUTPUT_##val))
169
170/*
171 * "nmk_gpio" and "NMK_GPIO" stand for "Nomadik GPIO", leaving
172 * the "gpio" namespace for generic and cross-machine functions
173 */
174
175#define GPIO_BLOCK_SHIFT 5
176#define NMK_GPIO_PER_CHIP (1 << GPIO_BLOCK_SHIFT)
177
178/* Register in the logic block */
179#define NMK_GPIO_DAT 0x00
180#define NMK_GPIO_DATS 0x04
181#define NMK_GPIO_DATC 0x08
182#define NMK_GPIO_PDIS 0x0c
183#define NMK_GPIO_DIR 0x10
184#define NMK_GPIO_DIRS 0x14
185#define NMK_GPIO_DIRC 0x18
186#define NMK_GPIO_SLPC 0x1c
187#define NMK_GPIO_AFSLA 0x20
188#define NMK_GPIO_AFSLB 0x24
189#define NMK_GPIO_LOWEMI 0x28
190
191#define NMK_GPIO_RIMSC 0x40
192#define NMK_GPIO_FIMSC 0x44
193#define NMK_GPIO_IS 0x48
194#define NMK_GPIO_IC 0x4c
195#define NMK_GPIO_RWIMSC 0x50
196#define NMK_GPIO_FWIMSC 0x54
197#define NMK_GPIO_WKS 0x58
198/* These appear in DB8540 and later ASICs */
199#define NMK_GPIO_EDGELEVEL 0x5C
200#define NMK_GPIO_LEVEL 0x60
201
202/* Alternate functions: function C is set in hw by setting both A and B */
203#define NMK_GPIO_ALT_GPIO 0
204#define NMK_GPIO_ALT_A 1
205#define NMK_GPIO_ALT_B 2
206#define NMK_GPIO_ALT_C (NMK_GPIO_ALT_A | NMK_GPIO_ALT_B)
207
208#define NMK_GPIO_ALT_CX_SHIFT 2
209#define NMK_GPIO_ALT_C1 ((1<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
210#define NMK_GPIO_ALT_C2 ((2<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
211#define NMK_GPIO_ALT_C3 ((3<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
212#define NMK_GPIO_ALT_C4 ((4<<NMK_GPIO_ALT_CX_SHIFT) | NMK_GPIO_ALT_C)
213
214/* Pull up/down values */
215enum nmk_gpio_pull {
216 NMK_GPIO_PULL_NONE,
217 NMK_GPIO_PULL_UP,
218 NMK_GPIO_PULL_DOWN,
219};
220
221/* Sleep mode */
222enum nmk_gpio_slpm {
223 NMK_GPIO_SLPM_INPUT,
224 NMK_GPIO_SLPM_WAKEUP_ENABLE = NMK_GPIO_SLPM_INPUT,
225 NMK_GPIO_SLPM_NOCHANGE,
226 NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE,
227};
228
229/* 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/*
254 * Platform data to register a block: only the initial gpio/irq number.
255 */
256struct nmk_gpio_platform_data {
257 char *name;
258 int first_gpio;
259 int first_irq;
260 int num_gpio;
261 u32 (*get_secondary_status)(unsigned int bank);
262 void (*set_ioforce)(bool enable);
263 bool supports_sleepmode;
264};
265
266#endif /* __PLAT_NOMADIK_GPIO */
diff --git a/include/linux/platform_data/pn544.h b/include/linux/platform_data/pn544.h
new file mode 100644
index 000000000000..713bfd703342
--- /dev/null
+++ b/include/linux/platform_data/pn544.h
@@ -0,0 +1,44 @@
1/*
2 * Driver include for the PN544 NFC chip.
3 *
4 * Copyright (C) Nokia Corporation
5 *
6 * Author: Jari Vanhala <ext-jari.vanhala@nokia.com>
7 * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.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,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef _PN544_H_
24#define _PN544_H_
25
26#include <linux/i2c.h>
27
28enum {
29 NFC_GPIO_ENABLE,
30 NFC_GPIO_FW_RESET,
31 NFC_GPIO_IRQ
32};
33
34/* board config */
35struct pn544_nfc_platform_data {
36 int (*request_resources) (struct i2c_client *client);
37 void (*free_resources) (void);
38 void (*enable) (int fw);
39 int (*test) (void);
40 void (*disable) (void);
41 int (*get_gpio)(int type);
42};
43
44#endif /* _PN544_H_ */
diff --git a/include/linux/platform_data/pxa2xx_udc.h b/include/linux/platform_data/pxa2xx_udc.h
new file mode 100644
index 000000000000..c6c5e98b5b82
--- /dev/null
+++ b/include/linux/platform_data/pxa2xx_udc.h
@@ -0,0 +1,27 @@
1/*
2 * This supports machine-specific differences in how the PXA2xx
3 * USB Device Controller (UDC) is wired.
4 *
5 * It is set in linux/arch/arm/mach-pxa/<machine>.c or in
6 * linux/arch/mach-ixp4xx/<machine>.c and used in
7 * the probe routine of linux/drivers/usb/gadget/pxa2xx_udc.c
8 */
9#ifndef PXA2XX_UDC_H
10#define PXA2XX_UDC_H
11
12struct pxa2xx_udc_mach_info {
13 int (*udc_is_connected)(void); /* do we see host? */
14 void (*udc_command)(int cmd);
15#define PXA2XX_UDC_CMD_CONNECT 0 /* let host see us */
16#define PXA2XX_UDC_CMD_DISCONNECT 1 /* so host won't see us */
17
18 /* Boards following the design guidelines in the developer's manual,
19 * with on-chip GPIOs not Lubbock's weird hardware, can have a sane
20 * VBUS IRQ and omit the methods above. Store the GPIO number
21 * here. Note that sometimes the signals go through inverters...
22 */
23 bool gpio_pullup_inverted;
24 int gpio_pullup; /* high == pullup activated */
25};
26
27#endif
diff --git a/include/linux/platform_data/pxa_sdhci.h b/include/linux/platform_data/pxa_sdhci.h
index 59acd987ed34..27d3156d093a 100644
--- a/include/linux/platform_data/pxa_sdhci.h
+++ b/include/linux/platform_data/pxa_sdhci.h
@@ -38,6 +38,7 @@
38 * @max_speed: the maximum speed supported 38 * @max_speed: the maximum speed supported
39 * @host_caps: Standard MMC host capabilities bit field. 39 * @host_caps: Standard MMC host capabilities bit field.
40 * @quirks: quirks of platfrom 40 * @quirks: quirks of platfrom
41 * @quirks2: quirks2 of platfrom
41 * @pm_caps: pm_caps of platfrom 42 * @pm_caps: pm_caps of platfrom
42 */ 43 */
43struct sdhci_pxa_platdata { 44struct sdhci_pxa_platdata {
@@ -48,9 +49,10 @@ struct sdhci_pxa_platdata {
48 unsigned int ext_cd_gpio; 49 unsigned int ext_cd_gpio;
49 bool ext_cd_gpio_invert; 50 bool ext_cd_gpio_invert;
50 unsigned int max_speed; 51 unsigned int max_speed;
51 unsigned int host_caps; 52 u32 host_caps;
52 unsigned int host_caps2; 53 u32 host_caps2;
53 unsigned int quirks; 54 unsigned int quirks;
55 unsigned int quirks2;
54 unsigned int pm_caps; 56 unsigned int pm_caps;
55}; 57};
56 58
diff --git a/include/linux/platform_data/sa11x0-serial.h b/include/linux/platform_data/sa11x0-serial.h
new file mode 100644
index 000000000000..4504d5d592f0
--- /dev/null
+++ b/include/linux/platform_data/sa11x0-serial.h
@@ -0,0 +1,33 @@
1/*
2 * Author: Nicolas Pitre
3 *
4 * Moved and changed lots, Russell King
5 *
6 * Low level machine dependent UART functions.
7 */
8#ifndef SA11X0_SERIAL_H
9#define SA11X0_SERIAL_H
10
11struct uart_port;
12struct uart_info;
13
14/*
15 * This is a temporary structure for registering these
16 * functions; it is intended to be discarded after boot.
17 */
18struct sa1100_port_fns {
19 void (*set_mctrl)(struct uart_port *, u_int);
20 u_int (*get_mctrl)(struct uart_port *);
21 void (*pm)(struct uart_port *, u_int, u_int);
22 int (*set_wake)(struct uart_port *, u_int);
23};
24
25#ifdef CONFIG_SERIAL_SA1100
26void sa1100_register_uart_fns(struct sa1100_port_fns *fns);
27void sa1100_register_uart(int idx, int port);
28#else
29#define sa1100_register_uart_fns(fns) do { } while (0)
30#define sa1100_register_uart(idx,port) do { } while (0)
31#endif
32
33#endif
diff --git a/include/linux/platform_data/spi-clps711x.h b/include/linux/platform_data/spi-clps711x.h
new file mode 100644
index 000000000000..301956e63143
--- /dev/null
+++ b/include/linux/platform_data/spi-clps711x.h
@@ -0,0 +1,21 @@
1/*
2 * CLPS711X SPI bus driver definitions
3 *
4 * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru>
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_PLATFORM_DATA_SPI_CLPS711X_H
13#define ____LINUX_PLATFORM_DATA_SPI_CLPS711X_H
14
15/* Board specific platform_data */
16struct spi_clps711x_pdata {
17 int *chipselect; /* Array of GPIO-numbers */
18 int num_chipselect; /* Total count of GPIOs */
19};
20
21#endif
diff --git a/include/linux/platform_data/spi-omap2-mcspi.h b/include/linux/platform_data/spi-omap2-mcspi.h
index a357eb26bd25..a65572d53211 100644
--- a/include/linux/platform_data/spi-omap2-mcspi.h
+++ b/include/linux/platform_data/spi-omap2-mcspi.h
@@ -7,9 +7,13 @@
7 7
8#define OMAP4_MCSPI_REG_OFFSET 0x100 8#define OMAP4_MCSPI_REG_OFFSET 0x100
9 9
10#define MCSPI_PINDIR_D0_IN_D1_OUT 0
11#define MCSPI_PINDIR_D0_OUT_D1_IN 1
12
10struct omap2_mcspi_platform_config { 13struct omap2_mcspi_platform_config {
11 unsigned short num_cs; 14 unsigned short num_cs;
12 unsigned int regs_offset; 15 unsigned int regs_offset;
16 unsigned int pin_dir:1;
13}; 17};
14 18
15struct omap2_mcspi_dev_attr { 19struct omap2_mcspi_dev_attr {
diff --git a/include/linux/platform_data/uio_dmem_genirq.h b/include/linux/platform_data/uio_dmem_genirq.h
new file mode 100644
index 000000000000..973c1bb32168
--- /dev/null
+++ b/include/linux/platform_data/uio_dmem_genirq.h
@@ -0,0 +1,26 @@
1/*
2 * include/linux/platform_data/uio_dmem_genirq.h
3 *
4 * Copyright (C) 2012 Damian Hobson-Garcia
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
16#ifndef _UIO_DMEM_GENIRQ_H
17#define _UIO_DMEM_GENIRQ_H
18
19#include <linux/uio_driver.h>
20
21struct uio_dmem_genirq_pdata {
22 struct uio_info uioinfo;
23 unsigned int *dynamic_region_sizes;
24 unsigned int num_dynamic_regions;
25};
26#endif /* _UIO_DMEM_GENIRQ_H */
diff --git a/include/linux/platform_data/uio_pruss.h b/include/linux/platform_data/uio_pruss.h
index f39140aabc6f..3d47d219827f 100644
--- a/include/linux/platform_data/uio_pruss.h
+++ b/include/linux/platform_data/uio_pruss.h
@@ -20,6 +20,7 @@
20 20
21/* To configure the PRUSS INTC base offset for UIO driver */ 21/* To configure the PRUSS INTC base offset for UIO driver */
22struct uio_pruss_pdata { 22struct uio_pruss_pdata {
23 u32 pintc_base; 23 u32 pintc_base;
24 struct gen_pool *sram_pool;
24}; 25};
25#endif /* _UIO_PRUSS_H_ */ 26#endif /* _UIO_PRUSS_H_ */
diff --git a/include/linux/platform_data/usb-omap.h b/include/linux/platform_data/usb-omap.h
new file mode 100644
index 000000000000..8570bcfe6311
--- /dev/null
+++ b/include/linux/platform_data/usb-omap.h
@@ -0,0 +1,80 @@
1/*
2 * usb-omap.h - Platform data for the various OMAP USB IPs
3 *
4 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com
5 *
6 * This software is distributed under the terms of the GNU General Public
7 * License ("GPL") version 2, as published by the Free Software Foundation.
8 *
9 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
10 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
11 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
12 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
13 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
14 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
15 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
16 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
17 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
18 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
19 * POSSIBILITY OF SUCH DAMAGE.
20 */
21
22#define OMAP3_HS_USB_PORTS 3
23
24enum usbhs_omap_port_mode {
25 OMAP_USBHS_PORT_MODE_UNUSED,
26 OMAP_EHCI_PORT_MODE_PHY,
27 OMAP_EHCI_PORT_MODE_TLL,
28 OMAP_EHCI_PORT_MODE_HSIC,
29 OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0,
30 OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM,
31 OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0,
32 OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM,
33 OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0,
34 OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM,
35 OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0,
36 OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM,
37 OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0,
38 OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM
39};
40
41struct usbtll_omap_platform_data {
42 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
43};
44
45struct ehci_hcd_omap_platform_data {
46 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
47 int reset_gpio_port[OMAP3_HS_USB_PORTS];
48 struct regulator *regulator[OMAP3_HS_USB_PORTS];
49 unsigned phy_reset:1;
50};
51
52struct ohci_hcd_omap_platform_data {
53 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
54 unsigned es2_compatibility:1;
55};
56
57struct usbhs_omap_platform_data {
58 enum usbhs_omap_port_mode port_mode[OMAP3_HS_USB_PORTS];
59
60 struct ehci_hcd_omap_platform_data *ehci_data;
61 struct ohci_hcd_omap_platform_data *ohci_data;
62};
63
64/*-------------------------------------------------------------------------*/
65
66struct omap_musb_board_data {
67 u8 interface_type;
68 u8 mode;
69 u16 power;
70 unsigned extvbus:1;
71 void (*set_phy_power)(u8 on);
72 void (*clear_irq)(void);
73 void (*set_mode)(u8 mode);
74 void (*reset)(void);
75};
76
77enum musb_interface {
78 MUSB_INTERFACE_ULPI,
79 MUSB_INTERFACE_UTMI
80};
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 5711e9525a2a..a9ded9a3c175 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -55,6 +55,7 @@ extern int platform_add_devices(struct platform_device **, int);
55 55
56struct platform_device_info { 56struct platform_device_info {
57 struct device *parent; 57 struct device *parent;
58 struct acpi_dev_node acpi_node;
58 59
59 const char *name; 60 const char *name;
60 int id; 61 int id;
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 007e687c4f69..03d7bb145311 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -546,10 +546,9 @@ struct dev_pm_info {
546 unsigned long active_jiffies; 546 unsigned long active_jiffies;
547 unsigned long suspended_jiffies; 547 unsigned long suspended_jiffies;
548 unsigned long accounting_timestamp; 548 unsigned long accounting_timestamp;
549 struct dev_pm_qos_request *pq_req;
550#endif 549#endif
551 struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */ 550 struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */
552 struct pm_qos_constraints *constraints; 551 struct dev_pm_qos *qos;
553}; 552};
554 553
555extern void update_pm_runtime_accounting(struct device *dev); 554extern void update_pm_runtime_accounting(struct device *dev);
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
index 9924ea1f22e0..5a95013905c8 100644
--- a/include/linux/pm_qos.h
+++ b/include/linux/pm_qos.h
@@ -20,6 +20,13 @@ enum {
20 PM_QOS_NUM_CLASSES, 20 PM_QOS_NUM_CLASSES,
21}; 21};
22 22
23enum pm_qos_flags_status {
24 PM_QOS_FLAGS_UNDEFINED = -1,
25 PM_QOS_FLAGS_NONE,
26 PM_QOS_FLAGS_SOME,
27 PM_QOS_FLAGS_ALL,
28};
29
23#define PM_QOS_DEFAULT_VALUE -1 30#define PM_QOS_DEFAULT_VALUE -1
24 31
25#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) 32#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
@@ -27,14 +34,31 @@ enum {
27#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 34#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0
28#define PM_QOS_DEV_LAT_DEFAULT_VALUE 0 35#define PM_QOS_DEV_LAT_DEFAULT_VALUE 0
29 36
37#define PM_QOS_FLAG_NO_POWER_OFF (1 << 0)
38#define PM_QOS_FLAG_REMOTE_WAKEUP (1 << 1)
39
30struct pm_qos_request { 40struct pm_qos_request {
31 struct plist_node node; 41 struct plist_node node;
32 int pm_qos_class; 42 int pm_qos_class;
33 struct delayed_work work; /* for pm_qos_update_request_timeout */ 43 struct delayed_work work; /* for pm_qos_update_request_timeout */
34}; 44};
35 45
46struct pm_qos_flags_request {
47 struct list_head node;
48 s32 flags; /* Do not change to 64 bit */
49};
50
51enum dev_pm_qos_req_type {
52 DEV_PM_QOS_LATENCY = 1,
53 DEV_PM_QOS_FLAGS,
54};
55
36struct dev_pm_qos_request { 56struct dev_pm_qos_request {
37 struct plist_node node; 57 enum dev_pm_qos_req_type type;
58 union {
59 struct plist_node pnode;
60 struct pm_qos_flags_request flr;
61 } data;
38 struct device *dev; 62 struct device *dev;
39}; 63};
40 64
@@ -45,8 +69,8 @@ enum pm_qos_type {
45}; 69};
46 70
47/* 71/*
48 * Note: The lockless read path depends on the CPU accessing 72 * Note: The lockless read path depends on the CPU accessing target_value
49 * target_value atomically. Atomic access is only guaranteed on all CPU 73 * or effective_flags atomically. Atomic access is only guaranteed on all CPU
50 * types linux supports for 32 bit quantites 74 * types linux supports for 32 bit quantites
51 */ 75 */
52struct pm_qos_constraints { 76struct pm_qos_constraints {
@@ -57,6 +81,18 @@ struct pm_qos_constraints {
57 struct blocking_notifier_head *notifiers; 81 struct blocking_notifier_head *notifiers;
58}; 82};
59 83
84struct pm_qos_flags {
85 struct list_head list;
86 s32 effective_flags; /* Do not change to 64 bit */
87};
88
89struct dev_pm_qos {
90 struct pm_qos_constraints latency;
91 struct pm_qos_flags flags;
92 struct dev_pm_qos_request *latency_req;
93 struct dev_pm_qos_request *flags_req;
94};
95
60/* Action requested to pm_qos_update_target */ 96/* Action requested to pm_qos_update_target */
61enum pm_qos_req_action { 97enum pm_qos_req_action {
62 PM_QOS_ADD_REQ, /* Add a new request */ 98 PM_QOS_ADD_REQ, /* Add a new request */
@@ -71,6 +107,9 @@ static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
71 107
72int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, 108int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
73 enum pm_qos_req_action action, int value); 109 enum pm_qos_req_action action, int value);
110bool pm_qos_update_flags(struct pm_qos_flags *pqf,
111 struct pm_qos_flags_request *req,
112 enum pm_qos_req_action action, s32 val);
74void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class, 113void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
75 s32 value); 114 s32 value);
76void pm_qos_update_request(struct pm_qos_request *req, 115void pm_qos_update_request(struct pm_qos_request *req,
@@ -86,10 +125,12 @@ int pm_qos_request_active(struct pm_qos_request *req);
86s32 pm_qos_read_value(struct pm_qos_constraints *c); 125s32 pm_qos_read_value(struct pm_qos_constraints *c);
87 126
88#ifdef CONFIG_PM 127#ifdef CONFIG_PM
128enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask);
129enum pm_qos_flags_status dev_pm_qos_flags(struct device *dev, s32 mask);
89s32 __dev_pm_qos_read_value(struct device *dev); 130s32 __dev_pm_qos_read_value(struct device *dev);
90s32 dev_pm_qos_read_value(struct device *dev); 131s32 dev_pm_qos_read_value(struct device *dev);
91int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req, 132int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
92 s32 value); 133 enum dev_pm_qos_req_type type, s32 value);
93int dev_pm_qos_update_request(struct dev_pm_qos_request *req, s32 new_value); 134int dev_pm_qos_update_request(struct dev_pm_qos_request *req, s32 new_value);
94int dev_pm_qos_remove_request(struct dev_pm_qos_request *req); 135int dev_pm_qos_remove_request(struct dev_pm_qos_request *req);
95int dev_pm_qos_add_notifier(struct device *dev, 136int dev_pm_qos_add_notifier(struct device *dev,
@@ -103,12 +144,19 @@ void dev_pm_qos_constraints_destroy(struct device *dev);
103int dev_pm_qos_add_ancestor_request(struct device *dev, 144int dev_pm_qos_add_ancestor_request(struct device *dev,
104 struct dev_pm_qos_request *req, s32 value); 145 struct dev_pm_qos_request *req, s32 value);
105#else 146#else
147static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev,
148 s32 mask)
149 { return PM_QOS_FLAGS_UNDEFINED; }
150static inline enum pm_qos_flags_status dev_pm_qos_flags(struct device *dev,
151 s32 mask)
152 { return PM_QOS_FLAGS_UNDEFINED; }
106static inline s32 __dev_pm_qos_read_value(struct device *dev) 153static inline s32 __dev_pm_qos_read_value(struct device *dev)
107 { return 0; } 154 { return 0; }
108static inline s32 dev_pm_qos_read_value(struct device *dev) 155static inline s32 dev_pm_qos_read_value(struct device *dev)
109 { return 0; } 156 { return 0; }
110static inline int dev_pm_qos_add_request(struct device *dev, 157static inline int dev_pm_qos_add_request(struct device *dev,
111 struct dev_pm_qos_request *req, 158 struct dev_pm_qos_request *req,
159 enum dev_pm_qos_req_type type,
112 s32 value) 160 s32 value)
113 { return 0; } 161 { return 0; }
114static inline int dev_pm_qos_update_request(struct dev_pm_qos_request *req, 162static inline int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
@@ -144,10 +192,31 @@ static inline int dev_pm_qos_add_ancestor_request(struct device *dev,
144#ifdef CONFIG_PM_RUNTIME 192#ifdef CONFIG_PM_RUNTIME
145int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value); 193int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value);
146void dev_pm_qos_hide_latency_limit(struct device *dev); 194void dev_pm_qos_hide_latency_limit(struct device *dev);
195int dev_pm_qos_expose_flags(struct device *dev, s32 value);
196void dev_pm_qos_hide_flags(struct device *dev);
197int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set);
198
199static inline s32 dev_pm_qos_requested_latency(struct device *dev)
200{
201 return dev->power.qos->latency_req->data.pnode.prio;
202}
203
204static inline s32 dev_pm_qos_requested_flags(struct device *dev)
205{
206 return dev->power.qos->flags_req->data.flr.flags;
207}
147#else 208#else
148static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) 209static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value)
149 { return 0; } 210 { return 0; }
150static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {} 211static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {}
212static inline int dev_pm_qos_expose_flags(struct device *dev, s32 value)
213 { return 0; }
214static inline void dev_pm_qos_hide_flags(struct device *dev) {}
215static inline int dev_pm_qos_update_flags(struct device *dev, s32 m, bool set)
216 { return 0; }
217
218static inline s32 dev_pm_qos_requested_latency(struct device *dev) { return 0; }
219static inline s32 dev_pm_qos_requested_flags(struct device *dev) { return 0; }
151#endif 220#endif
152 221
153#endif 222#endif
diff --git a/include/linux/power/bq2415x_charger.h b/include/linux/power/bq2415x_charger.h
new file mode 100644
index 000000000000..97a1665eaeaf
--- /dev/null
+++ b/include/linux/power/bq2415x_charger.h
@@ -0,0 +1,95 @@
1/*
2 * bq2415x charger driver
3 *
4 * Copyright (C) 2011-2012 Pali Rohár <pali.rohar@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 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifndef BQ2415X_CHARGER_H
22#define BQ2415X_CHARGER_H
23
24/*
25 * This is platform data for bq2415x chip. It contains default board
26 * voltages and currents which can be also later configured via sysfs. If
27 * value is -1 then default chip value (specified in datasheet) will be
28 * used.
29 *
30 * Value resistor_sense is needed for for configuring charge and
31 * termination current. It it is less or equal to zero, configuring charge
32 * and termination current will not be possible.
33 *
34 * Function set_mode_hook is needed for automode (setting correct current
35 * limit when charger is connected/disconnected or setting boost mode).
36 * When is NULL, automode function is disabled. When is not NULL, it must
37 * have this prototype:
38 *
39 * int (*set_mode_hook)(
40 * void (*hook)(enum bq2415x_mode mode, void *data),
41 * void *data)
42 *
43 * hook is hook function (see below) and data is pointer to driver private
44 * data
45 *
46 * bq2415x driver will call it as:
47 *
48 * platform_data->set_mode_hook(bq2415x_hook_function, bq2415x_device);
49 *
50 * Board/platform function set_mode_hook return non zero value when hook
51 * function was successful registered. Platform code should call that hook
52 * function (which get from pointer, with data) every time when charger
53 * was connected/disconnected or require to enable boost mode. bq2415x
54 * driver then will set correct current limit, enable/disable charger or
55 * boost mode.
56 *
57 * Hook function has this prototype:
58 *
59 * void hook(enum bq2415x_mode mode, void *data);
60 *
61 * mode is bq2415x mode (charger or boost)
62 * data is pointer to driver private data (which get from
63 * set_charger_type_hook)
64 *
65 * When bq driver is being unloaded, it call function:
66 *
67 * platform_data->set_mode_hook(NULL, NULL);
68 *
69 * (hook function and driver private data are NULL)
70 *
71 * After that board/platform code must not call driver hook function! It
72 * is possible that pointer to hook function will not be valid and calling
73 * will cause undefined result.
74 */
75
76/* Supported modes with maximal current limit */
77enum bq2415x_mode {
78 BQ2415X_MODE_NONE, /* unknown or no charger (100mA) */
79 BQ2415X_MODE_HOST_CHARGER, /* usb host/hub charger (500mA) */
80 BQ2415X_MODE_DEDICATED_CHARGER, /* dedicated charger (unlimited) */
81 BQ2415X_MODE_BOOST, /* boost mode (charging disabled) */
82};
83
84struct bq2415x_platform_data {
85 int current_limit; /* mA */
86 int weak_battery_voltage; /* mV */
87 int battery_regulation_voltage; /* mV */
88 int charge_current; /* mA */
89 int termination_current; /* mA */
90 int resistor_sense; /* m ohm */
91 int (*set_mode_hook)(void (*hook)(enum bq2415x_mode mode, void *data),
92 void *data);
93};
94
95#endif
diff --git a/include/linux/power/smartreflex.h b/include/linux/power/smartreflex.h
index 4a496ebc7d73..c0f44c2b006d 100644
--- a/include/linux/power/smartreflex.h
+++ b/include/linux/power/smartreflex.h
@@ -260,8 +260,13 @@ struct omap_sr_nvalue_table {
260 * 260 *
261 * @name: instance name 261 * @name: instance name
262 * @ip_type: Smartreflex IP type. 262 * @ip_type: Smartreflex IP type.
263 * @senp_mod: SENPENABLE value for the sr 263 * @senp_mod: SENPENABLE value of the sr CONFIG register
264 * @senn_mod: SENNENABLE value for sr 264 * @senn_mod: SENNENABLE value for sr CONFIG register
265 * @err_weight ERRWEIGHT value of the sr ERRCONFIG register
266 * @err_maxlimit ERRMAXLIMIT value of the sr ERRCONFIG register
267 * @accum_data ACCUMDATA value of the sr CONFIG register
268 * @senn_avgweight SENNAVGWEIGHT value of the sr AVGWEIGHT register
269 * @senp_avgweight SENPAVGWEIGHT value of the sr AVGWEIGHT register
265 * @nvalue_count: Number of distinct nvalues in the nvalue table 270 * @nvalue_count: Number of distinct nvalues in the nvalue table
266 * @enable_on_init: whether this sr module needs to enabled at 271 * @enable_on_init: whether this sr module needs to enabled at
267 * boot up or not. 272 * boot up or not.
@@ -274,6 +279,11 @@ struct omap_sr_data {
274 int ip_type; 279 int ip_type;
275 u32 senp_mod; 280 u32 senp_mod;
276 u32 senn_mod; 281 u32 senn_mod;
282 u32 err_weight;
283 u32 err_maxlimit;
284 u32 accum_data;
285 u32 senn_avgweight;
286 u32 senp_avgweight;
277 int nvalue_count; 287 int nvalue_count;
278 bool enable_on_init; 288 bool enable_on_init;
279 struct omap_sr_nvalue_table *nvalue_table; 289 struct omap_sr_nvalue_table *nvalue_table;
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index e5ef45834c3c..1f0ab90aff00 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -114,6 +114,8 @@ enum power_supply_property {
114 POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX, 114 POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT_MAX,
115 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE, 115 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE,
116 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX, 116 POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE_MAX,
117 POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT,
118 POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT_MAX,
117 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN, 119 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
118 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN, 120 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
119 POWER_SUPPLY_PROP_ENERGY_FULL, 121 POWER_SUPPLY_PROP_ENERGY_FULL,
@@ -186,6 +188,7 @@ struct power_supply {
186 struct work_struct changed_work; 188 struct work_struct changed_work;
187#ifdef CONFIG_THERMAL 189#ifdef CONFIG_THERMAL
188 struct thermal_zone_device *tzd; 190 struct thermal_zone_device *tzd;
191 struct thermal_cooling_device *tcd;
189#endif 192#endif
190 193
191#ifdef CONFIG_LEDS_TRIGGERS 194#ifdef CONFIG_LEDS_TRIGGERS
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index ee3034a40884..1788909d9a99 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -50,16 +50,18 @@ struct pstore_info {
50 int (*open)(struct pstore_info *psi); 50 int (*open)(struct pstore_info *psi);
51 int (*close)(struct pstore_info *psi); 51 int (*close)(struct pstore_info *psi);
52 ssize_t (*read)(u64 *id, enum pstore_type_id *type, 52 ssize_t (*read)(u64 *id, enum pstore_type_id *type,
53 struct timespec *time, char **buf, 53 int *count, struct timespec *time, char **buf,
54 struct pstore_info *psi); 54 struct pstore_info *psi);
55 int (*write)(enum pstore_type_id type, 55 int (*write)(enum pstore_type_id type,
56 enum kmsg_dump_reason reason, u64 *id, 56 enum kmsg_dump_reason reason, u64 *id,
57 unsigned int part, size_t size, struct pstore_info *psi); 57 unsigned int part, int count, size_t size,
58 struct pstore_info *psi);
58 int (*write_buf)(enum pstore_type_id type, 59 int (*write_buf)(enum pstore_type_id type,
59 enum kmsg_dump_reason reason, u64 *id, 60 enum kmsg_dump_reason reason, u64 *id,
60 unsigned int part, const char *buf, size_t size, 61 unsigned int part, const char *buf, size_t size,
61 struct pstore_info *psi); 62 struct pstore_info *psi);
62 int (*erase)(enum pstore_type_id type, u64 id, 63 int (*erase)(enum pstore_type_id type, u64 id,
64 int count, struct timespec time,
63 struct pstore_info *psi); 65 struct pstore_info *psi);
64 void *data; 66 void *data;
65}; 67};
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index e0ff4689d35a..a89ff04bddd9 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -329,6 +329,19 @@ static inline void user_single_step_siginfo(struct task_struct *tsk,
329#define current_pt_regs() task_pt_regs(current) 329#define current_pt_regs() task_pt_regs(current)
330#endif 330#endif
331 331
332#ifndef ptrace_signal_deliver
333#define ptrace_signal_deliver() ((void)0)
334#endif
335
336/*
337 * unlike current_pt_regs(), this one is equal to task_pt_regs(current)
338 * on *all* architectures; the only reason to have a per-arch definition
339 * is optimisation.
340 */
341#ifndef signal_pt_regs
342#define signal_pt_regs() task_pt_regs(current)
343#endif
344
332extern int task_current_syscall(struct task_struct *target, long *callno, 345extern int task_current_syscall(struct task_struct *target, long *callno,
333 unsigned long args[6], unsigned int maxargs, 346 unsigned long args[6], unsigned int maxargs,
334 unsigned long *sp, unsigned long *pc); 347 unsigned long *sp, unsigned long *pc);
diff --git a/include/linux/pvclock_gtod.h b/include/linux/pvclock_gtod.h
new file mode 100644
index 000000000000..0ca75825b60d
--- /dev/null
+++ b/include/linux/pvclock_gtod.h
@@ -0,0 +1,9 @@
1#ifndef _PVCLOCK_GTOD_H
2#define _PVCLOCK_GTOD_H
3
4#include <linux/notifier.h>
5
6extern int pvclock_gtod_register_notifier(struct notifier_block *nb);
7extern int pvclock_gtod_unregister_notifier(struct notifier_block *nb);
8
9#endif /* _PVCLOCK_GTOD_H */
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index e0f0fab20415..c92dd28eaa6c 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -286,23 +286,6 @@ static inline void list_splice_init_rcu(struct list_head *list,
286 &pos->member != (head); \ 286 &pos->member != (head); \
287 pos = list_entry_rcu(pos->member.next, typeof(*pos), member)) 287 pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
288 288
289
290/**
291 * list_for_each_continue_rcu
292 * @pos: the &struct list_head to use as a loop cursor.
293 * @head: the head for your list.
294 *
295 * Iterate over an rcu-protected list, continuing after current point.
296 *
297 * This list-traversal primitive may safely run concurrently with
298 * the _rcu list-mutation primitives such as list_add_rcu()
299 * as long as the traversal is guarded by rcu_read_lock().
300 */
301#define list_for_each_continue_rcu(pos, head) \
302 for ((pos) = rcu_dereference_raw(list_next_rcu(pos)); \
303 (pos) != (head); \
304 (pos) = rcu_dereference_raw(list_next_rcu(pos)))
305
306/** 289/**
307 * list_for_each_entry_continue_rcu - continue iteration over list of given type 290 * list_for_each_entry_continue_rcu - continue iteration over list of given type
308 * @pos: the type * to use as a loop cursor. 291 * @pos: the type * to use as a loop cursor.
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 7c968e4f929e..275aa3f1062d 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -90,6 +90,25 @@ extern void do_trace_rcu_torture_read(char *rcutorturename,
90 * that started after call_rcu() was invoked. RCU read-side critical 90 * that started after call_rcu() was invoked. RCU read-side critical
91 * sections are delimited by rcu_read_lock() and rcu_read_unlock(), 91 * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
92 * and may be nested. 92 * and may be nested.
93 *
94 * Note that all CPUs must agree that the grace period extended beyond
95 * all pre-existing RCU read-side critical section. On systems with more
96 * than one CPU, this means that when "func()" is invoked, each CPU is
97 * guaranteed to have executed a full memory barrier since the end of its
98 * last RCU read-side critical section whose beginning preceded the call
99 * to call_rcu(). It also means that each CPU executing an RCU read-side
100 * critical section that continues beyond the start of "func()" must have
101 * executed a memory barrier after the call_rcu() but before the beginning
102 * of that RCU read-side critical section. Note that these guarantees
103 * include CPUs that are offline, idle, or executing in user mode, as
104 * well as CPUs that are executing in the kernel.
105 *
106 * Furthermore, if CPU A invoked call_rcu() and CPU B invoked the
107 * resulting RCU callback function "func()", then both CPU A and CPU B are
108 * guaranteed to execute a full memory barrier during the time interval
109 * between the call to call_rcu() and the invocation of "func()" -- even
110 * if CPU A and CPU B are the same CPU (but again only if the system has
111 * more than one CPU).
93 */ 112 */
94extern void call_rcu(struct rcu_head *head, 113extern void call_rcu(struct rcu_head *head,
95 void (*func)(struct rcu_head *head)); 114 void (*func)(struct rcu_head *head));
@@ -118,6 +137,9 @@ extern void call_rcu(struct rcu_head *head,
118 * OR 137 * OR
119 * - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context. 138 * - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context.
120 * These may be nested. 139 * These may be nested.
140 *
141 * See the description of call_rcu() for more detailed information on
142 * memory ordering guarantees.
121 */ 143 */
122extern void call_rcu_bh(struct rcu_head *head, 144extern void call_rcu_bh(struct rcu_head *head,
123 void (*func)(struct rcu_head *head)); 145 void (*func)(struct rcu_head *head));
@@ -137,6 +159,9 @@ extern void call_rcu_bh(struct rcu_head *head,
137 * OR 159 * OR
138 * anything that disables preemption. 160 * anything that disables preemption.
139 * These may be nested. 161 * These may be nested.
162 *
163 * See the description of call_rcu() for more detailed information on
164 * memory ordering guarantees.
140 */ 165 */
141extern void call_rcu_sched(struct rcu_head *head, 166extern void call_rcu_sched(struct rcu_head *head,
142 void (*func)(struct rcu_head *rcu)); 167 void (*func)(struct rcu_head *rcu));
@@ -197,13 +222,13 @@ extern void rcu_user_enter(void);
197extern void rcu_user_exit(void); 222extern void rcu_user_exit(void);
198extern void rcu_user_enter_after_irq(void); 223extern void rcu_user_enter_after_irq(void);
199extern void rcu_user_exit_after_irq(void); 224extern void rcu_user_exit_after_irq(void);
200extern void rcu_user_hooks_switch(struct task_struct *prev,
201 struct task_struct *next);
202#else 225#else
203static inline void rcu_user_enter(void) { } 226static inline void rcu_user_enter(void) { }
204static inline void rcu_user_exit(void) { } 227static inline void rcu_user_exit(void) { }
205static inline void rcu_user_enter_after_irq(void) { } 228static inline void rcu_user_enter_after_irq(void) { }
206static inline void rcu_user_exit_after_irq(void) { } 229static inline void rcu_user_exit_after_irq(void) { }
230static inline void rcu_user_hooks_switch(struct task_struct *prev,
231 struct task_struct *next) { }
207#endif /* CONFIG_RCU_USER_QS */ 232#endif /* CONFIG_RCU_USER_QS */
208 233
209extern void exit_rcu(void); 234extern void exit_rcu(void);
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index e3bcc3f4dcb8..b7e95bf942c9 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -19,6 +19,7 @@
19struct module; 19struct module;
20struct device; 20struct device;
21struct i2c_client; 21struct i2c_client;
22struct irq_domain;
22struct spi_device; 23struct spi_device;
23struct regmap; 24struct regmap;
24struct regmap_range_cfg; 25struct regmap_range_cfg;
@@ -54,6 +55,39 @@ enum regmap_endian {
54}; 55};
55 56
56/** 57/**
58 * A register range, used for access related checks
59 * (readable/writeable/volatile/precious checks)
60 *
61 * @range_min: address of first register
62 * @range_max: address of last register
63 */
64struct regmap_range {
65 unsigned int range_min;
66 unsigned int range_max;
67};
68
69/*
70 * A table of ranges including some yes ranges and some no ranges.
71 * If a register belongs to a no_range, the corresponding check function
72 * will return false. If a register belongs to a yes range, the corresponding
73 * check function will return true. "no_ranges" are searched first.
74 *
75 * @yes_ranges : pointer to an array of regmap ranges used as "yes ranges"
76 * @n_yes_ranges: size of the above array
77 * @no_ranges: pointer to an array of regmap ranges used as "no ranges"
78 * @n_no_ranges: size of the above array
79 */
80struct regmap_access_table {
81 const struct regmap_range *yes_ranges;
82 unsigned int n_yes_ranges;
83 const struct regmap_range *no_ranges;
84 unsigned int n_no_ranges;
85};
86
87typedef void (*regmap_lock)(void *);
88typedef void (*regmap_unlock)(void *);
89
90/**
57 * Configuration for the register map of a device. 91 * Configuration for the register map of a device.
58 * 92 *
59 * @name: Optional name of the regmap. Useful when a device has multiple 93 * @name: Optional name of the regmap. Useful when a device has multiple
@@ -67,16 +101,39 @@ enum regmap_endian {
67 * @val_bits: Number of bits in a register value, mandatory. 101 * @val_bits: Number of bits in a register value, mandatory.
68 * 102 *
69 * @writeable_reg: Optional callback returning true if the register 103 * @writeable_reg: Optional callback returning true if the register
70 * can be written to. 104 * can be written to. If this field is NULL but wr_table
105 * (see below) is not, the check is performed on such table
106 * (a register is writeable if it belongs to one of the ranges
107 * specified by wr_table).
71 * @readable_reg: Optional callback returning true if the register 108 * @readable_reg: Optional callback returning true if the register
72 * can be read from. 109 * can be read from. If this field is NULL but rd_table
110 * (see below) is not, the check is performed on such table
111 * (a register is readable if it belongs to one of the ranges
112 * specified by rd_table).
73 * @volatile_reg: Optional callback returning true if the register 113 * @volatile_reg: Optional callback returning true if the register
74 * value can't be cached. 114 * value can't be cached. If this field is NULL but
115 * volatile_table (see below) is not, the check is performed on
116 * such table (a register is volatile if it belongs to one of
117 * the ranges specified by volatile_table).
75 * @precious_reg: Optional callback returning true if the rgister 118 * @precious_reg: Optional callback returning true if the rgister
76 * should not be read outside of a call from the driver 119 * should not be read outside of a call from the driver
77 * (eg, a clear on read interrupt status register). 120 * (eg, a clear on read interrupt status register). If this
121 * field is NULL but precious_table (see below) is not, the
122 * check is performed on such table (a register is precious if
123 * it belongs to one of the ranges specified by precious_table).
124 * @lock: Optional lock callback (overrides regmap's default lock
125 * function, based on spinlock or mutex).
126 * @unlock: As above for unlocking.
127 * @lock_arg: this field is passed as the only argument of lock/unlock
128 * functions (ignored in case regular lock/unlock functions
129 * are not overridden).
78 * 130 *
79 * @max_register: Optional, specifies the maximum valid register index. 131 * @max_register: Optional, specifies the maximum valid register index.
132 * @wr_table: Optional, points to a struct regmap_access_table specifying
133 * valid ranges for write access.
134 * @rd_table: As above, for read access.
135 * @volatile_table: As above, for volatile registers.
136 * @precious_table: As above, for precious registers.
80 * @reg_defaults: Power on reset values for registers (for use with 137 * @reg_defaults: Power on reset values for registers (for use with
81 * register cache support). 138 * register cache support).
82 * @num_reg_defaults: Number of elements in reg_defaults. 139 * @num_reg_defaults: Number of elements in reg_defaults.
@@ -116,8 +173,15 @@ struct regmap_config {
116 bool (*readable_reg)(struct device *dev, unsigned int reg); 173 bool (*readable_reg)(struct device *dev, unsigned int reg);
117 bool (*volatile_reg)(struct device *dev, unsigned int reg); 174 bool (*volatile_reg)(struct device *dev, unsigned int reg);
118 bool (*precious_reg)(struct device *dev, unsigned int reg); 175 bool (*precious_reg)(struct device *dev, unsigned int reg);
176 regmap_lock lock;
177 regmap_unlock unlock;
178 void *lock_arg;
119 179
120 unsigned int max_register; 180 unsigned int max_register;
181 const struct regmap_access_table *wr_table;
182 const struct regmap_access_table *rd_table;
183 const struct regmap_access_table *volatile_table;
184 const struct regmap_access_table *precious_table;
121 const struct reg_default *reg_defaults; 185 const struct reg_default *reg_defaults;
122 unsigned int num_reg_defaults; 186 unsigned int num_reg_defaults;
123 enum regcache_type cache_type; 187 enum regcache_type cache_type;
@@ -133,7 +197,7 @@ struct regmap_config {
133 enum regmap_endian val_format_endian; 197 enum regmap_endian val_format_endian;
134 198
135 const struct regmap_range_cfg *ranges; 199 const struct regmap_range_cfg *ranges;
136 unsigned int n_ranges; 200 unsigned int num_ranges;
137}; 201};
138 202
139/** 203/**
@@ -142,6 +206,8 @@ struct regmap_config {
142 * 1. page selector register update; 206 * 1. page selector register update;
143 * 2. access through data window registers. 207 * 2. access through data window registers.
144 * 208 *
209 * @name: Descriptive name for diagnostics
210 *
145 * @range_min: Address of the lowest register address in virtual range. 211 * @range_min: Address of the lowest register address in virtual range.
146 * @range_max: Address of the highest register in virtual range. 212 * @range_max: Address of the highest register in virtual range.
147 * 213 *
@@ -153,6 +219,8 @@ struct regmap_config {
153 * @window_len: Number of registers in data window. 219 * @window_len: Number of registers in data window.
154 */ 220 */
155struct regmap_range_cfg { 221struct regmap_range_cfg {
222 const char *name;
223
156 /* Registers of virtual address range */ 224 /* Registers of virtual address range */
157 unsigned int range_min; 225 unsigned int range_min;
158 unsigned int range_max; 226 unsigned int range_max;
@@ -181,7 +249,9 @@ typedef void (*regmap_hw_free_context)(void *context);
181 * Description of a hardware bus for the register map infrastructure. 249 * Description of a hardware bus for the register map infrastructure.
182 * 250 *
183 * @fast_io: Register IO is fast. Use a spinlock instead of a mutex 251 * @fast_io: Register IO is fast. Use a spinlock instead of a mutex
184 * to perform locking. 252 * to perform locking. This field is ignored if custom lock/unlock
253 * functions are used (see fields lock/unlock of
254 * struct regmap_config).
185 * @write: Write operation. 255 * @write: Write operation.
186 * @gather_write: Write operation with split register/value, return -ENOTSUPP 256 * @gather_write: Write operation with split register/value, return -ENOTSUPP
187 * if not implemented on a given device. 257 * if not implemented on a given device.
@@ -262,6 +332,16 @@ void regcache_mark_dirty(struct regmap *map);
262int regmap_register_patch(struct regmap *map, const struct reg_default *regs, 332int regmap_register_patch(struct regmap *map, const struct reg_default *regs,
263 int num_regs); 333 int num_regs);
264 334
335static inline bool regmap_reg_in_range(unsigned int reg,
336 const struct regmap_range *range)
337{
338 return reg >= range->range_min && reg <= range->range_max;
339}
340
341bool regmap_reg_in_ranges(unsigned int reg,
342 const struct regmap_range *ranges,
343 unsigned int nranges);
344
265/** 345/**
266 * Description of an IRQ for the generic regmap irq_chip. 346 * Description of an IRQ for the generic regmap irq_chip.
267 * 347 *
@@ -317,6 +397,7 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
317void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data); 397void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *data);
318int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data); 398int regmap_irq_chip_get_base(struct regmap_irq_chip_data *data);
319int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq); 399int regmap_irq_get_virq(struct regmap_irq_chip_data *data, int irq);
400struct irq_domain *regmap_irq_get_domain(struct regmap_irq_chip_data *data);
320 401
321#else 402#else
322 403
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index c43cd3556b1f..7bc732ce6e50 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -160,6 +160,7 @@ int regulator_bulk_force_disable(int num_consumers,
160void regulator_bulk_free(int num_consumers, 160void regulator_bulk_free(int num_consumers,
161 struct regulator_bulk_data *consumers); 161 struct regulator_bulk_data *consumers);
162 162
163int regulator_can_change_voltage(struct regulator *regulator);
163int regulator_count_voltages(struct regulator *regulator); 164int regulator_count_voltages(struct regulator *regulator);
164int regulator_list_voltage(struct regulator *regulator, unsigned selector); 165int regulator_list_voltage(struct regulator *regulator, unsigned selector);
165int regulator_is_supported_voltage(struct regulator *regulator, 166int regulator_is_supported_voltage(struct regulator *regulator,
@@ -358,6 +359,10 @@ static inline void regulator_set_drvdata(struct regulator *regulator,
358{ 359{
359} 360}
360 361
362static inline int regulator_count_voltages(struct regulator *regulator)
363{
364 return 0;
365}
361#endif 366#endif
362 367
363static inline int regulator_set_voltage_tol(struct regulator *regulator, 368static inline int regulator_set_voltage_tol(struct regulator *regulator,
@@ -367,4 +372,12 @@ static inline int regulator_set_voltage_tol(struct regulator *regulator,
367 new_uV - tol_uV, new_uV + tol_uV); 372 new_uV - tol_uV, new_uV + tol_uV);
368} 373}
369 374
375static inline int regulator_is_supported_voltage_tol(struct regulator *regulator,
376 int target_uV, int tol_uV)
377{
378 return regulator_is_supported_voltage(regulator,
379 target_uV - tol_uV,
380 target_uV + tol_uV);
381}
382
370#endif 383#endif
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 7932a3bf21bd..d10bb0f39c5e 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -181,10 +181,13 @@ enum regulator_type {
181 * @type: Indicates if the regulator is a voltage or current regulator. 181 * @type: Indicates if the regulator is a voltage or current regulator.
182 * @owner: Module providing the regulator, used for refcounting. 182 * @owner: Module providing the regulator, used for refcounting.
183 * 183 *
184 * @continuous_voltage_range: Indicates if the regulator can set any
185 * voltage within constrains range.
184 * @n_voltages: Number of selectors available for ops.list_voltage(). 186 * @n_voltages: Number of selectors available for ops.list_voltage().
185 * 187 *
186 * @min_uV: Voltage given by the lowest selector (if linear mapping) 188 * @min_uV: Voltage given by the lowest selector (if linear mapping)
187 * @uV_step: Voltage increase with each selector (if linear mapping) 189 * @uV_step: Voltage increase with each selector (if linear mapping)
190 * @linear_min_sel: Minimal selector for starting linear mapping
188 * @ramp_delay: Time to settle down after voltage change (unit: uV/us) 191 * @ramp_delay: Time to settle down after voltage change (unit: uV/us)
189 * @volt_table: Voltage mapping table (if table based mapping) 192 * @volt_table: Voltage mapping table (if table based mapping)
190 * 193 *
@@ -199,6 +202,7 @@ struct regulator_desc {
199 const char *name; 202 const char *name;
200 const char *supply_name; 203 const char *supply_name;
201 int id; 204 int id;
205 bool continuous_voltage_range;
202 unsigned n_voltages; 206 unsigned n_voltages;
203 struct regulator_ops *ops; 207 struct regulator_ops *ops;
204 int irq; 208 int irq;
@@ -207,6 +211,7 @@ struct regulator_desc {
207 211
208 unsigned int min_uV; 212 unsigned int min_uV;
209 unsigned int uV_step; 213 unsigned int uV_step;
214 unsigned int linear_min_sel;
210 unsigned int ramp_delay; 215 unsigned int ramp_delay;
211 216
212 const unsigned int *volt_table; 217 const unsigned int *volt_table;
diff --git a/include/linux/regulator/max8973-regulator.h b/include/linux/regulator/max8973-regulator.h
new file mode 100644
index 000000000000..f8acc052e353
--- /dev/null
+++ b/include/linux/regulator/max8973-regulator.h
@@ -0,0 +1,72 @@
1/*
2 * max8973-regulator.h -- MAXIM 8973 regulator
3 *
4 * Interface for regulator driver for MAXIM 8973 DC-DC step-down
5 * switching regulator.
6 *
7 * Copyright (C) 2012 NVIDIA Corporation
8
9 * Author: Laxman Dewangan <ldewangan@nvidia.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 * more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 *
25 */
26
27#ifndef __LINUX_REGULATOR_MAX8973_H
28#define __LINUX_REGULATOR_MAX8973_H
29
30/*
31 * Control flags for configuration of the device.
32 * Client need to pass this information with ORed
33 */
34#define MAX8973_CONTROL_REMOTE_SENSE_ENABLE 0x00000001
35#define MAX8973_CONTROL_FALLING_SLEW_RATE_ENABLE 0x00000002
36#define MAX8973_CONTROL_OUTPUT_ACTIVE_DISCH_ENABLE 0x00000004
37#define MAX8973_CONTROL_BIAS_ENABLE 0x00000008
38#define MAX8973_CONTROL_PULL_DOWN_ENABLE 0x00000010
39#define MAX8973_CONTROL_FREQ_SHIFT_9PER_ENABLE 0x00000020
40
41#define MAX8973_CONTROL_CLKADV_TRIP_DISABLED 0x00000000
42#define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US 0x00010000
43#define MAX8973_CONTROL_CLKADV_TRIP_150mV_PER_US 0x00020000
44#define MAX8973_CONTROL_CLKADV_TRIP_75mV_PER_US_HIST_DIS 0x00030000
45
46#define MAX8973_CONTROL_INDUCTOR_VALUE_NOMINAL 0x00000000
47#define MAX8973_CONTROL_INDUCTOR_VALUE_MINUS_30_PER 0x00100000
48#define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_30_PER 0x00200000
49#define MAX8973_CONTROL_INDUCTOR_VALUE_PLUS_60_PER 0x00300000
50
51/*
52 * struct max8973_regulator_platform_data - max8973 regulator platform data.
53 *
54 * @reg_init_data: The regulator init data.
55 * @control_flags: Control flags which are ORed value of above flags to
56 * configure device.
57 * @enable_ext_control: Enable the voltage enable/disable through external
58 * control signal from EN input pin. If it is false then
59 * voltage output will be enabled/disabled through EN bit of
60 * device register.
61 * @dvs_gpio: GPIO for dvs. It should be -1 if this is tied with fixed logic.
62 * @dvs_def_state: Default state of dvs. 1 if it is high else 0.
63 */
64struct max8973_regulator_platform_data {
65 struct regulator_init_data *reg_init_data;
66 unsigned long control_flags;
67 bool enable_ext_control;
68 int dvs_gpio;
69 unsigned dvs_def_state:1;
70};
71
72#endif /* __LINUX_REGULATOR_MAX8973_H */
diff --git a/include/linux/regulator/tps51632-regulator.h b/include/linux/regulator/tps51632-regulator.h
new file mode 100644
index 000000000000..d00841e1a75a
--- /dev/null
+++ b/include/linux/regulator/tps51632-regulator.h
@@ -0,0 +1,47 @@
1/*
2 * tps51632-regulator.h -- TPS51632 regulator
3 *
4 * Interface for regulator driver for TPS51632 3-2-1 Phase D-Cap Step Down
5 * Driverless Controller with serial VID control and DVFS.
6 *
7 * Copyright (C) 2012 NVIDIA Corporation
8
9 * Author: Laxman Dewangan <ldewangan@nvidia.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 * more details.
20 *
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 *
25 */
26
27#ifndef __LINUX_REGULATOR_TPS51632_H
28#define __LINUX_REGULATOR_TPS51632_H
29
30/*
31 * struct tps51632_regulator_platform_data - tps51632 regulator platform data.
32 *
33 * @reg_init_data: The regulator init data.
34 * @enable_pwm_dvfs: Enable PWM DVFS or not.
35 * @dvfs_step_20mV: Step for DVFS is 20mV or 10mV.
36 * @max_voltage_uV: Maximum possible voltage in PWM-DVFS mode.
37 * @base_voltage_uV: Base voltage when PWM-DVFS enabled.
38 */
39struct tps51632_regulator_platform_data {
40 struct regulator_init_data *reg_init_data;
41 bool enable_pwm_dvfs;
42 bool dvfs_step_20mV;
43 int max_voltage_uV;
44 int base_voltage_uV;
45};
46
47#endif /* __LINUX_REGULATOR_TPS51632_H */
diff --git a/include/linux/regulator/tps65090-regulator.h b/include/linux/regulator/tps65090-regulator.h
deleted file mode 100644
index 0fa04b64db3e..000000000000
--- a/include/linux/regulator/tps65090-regulator.h
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * Regulator driver interface for TI TPS65090 PMIC family
3 *
4 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
5
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9
10 * This program is distributed in the hope 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 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef __REGULATOR_TPS65090_H
20#define __REGULATOR_TPS65090_H
21
22#include <linux/regulator/machine.h>
23
24#define tps65090_rails(_name) "tps65090_"#_name
25
26enum {
27 TPS65090_ID_DCDC1,
28 TPS65090_ID_DCDC2,
29 TPS65090_ID_DCDC3,
30 TPS65090_ID_FET1,
31 TPS65090_ID_FET2,
32 TPS65090_ID_FET3,
33 TPS65090_ID_FET4,
34 TPS65090_ID_FET5,
35 TPS65090_ID_FET6,
36 TPS65090_ID_FET7,
37};
38
39/*
40 * struct tps65090_regulator_platform_data
41 *
42 * @regulator: The regulator init data.
43 * @slew_rate_uV_per_us: Slew rate microvolt per microsec.
44 */
45
46struct tps65090_regulator_platform_data {
47 struct regulator_init_data regulator;
48};
49
50#endif /* __REGULATOR_TPS65090_H */
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h
index 7d7fbe2ef782..6f54e40fa218 100644
--- a/include/linux/res_counter.h
+++ b/include/linux/res_counter.h
@@ -74,14 +74,9 @@ ssize_t res_counter_read(struct res_counter *counter, int member,
74 const char __user *buf, size_t nbytes, loff_t *pos, 74 const char __user *buf, size_t nbytes, loff_t *pos,
75 int (*read_strategy)(unsigned long long val, char *s)); 75 int (*read_strategy)(unsigned long long val, char *s));
76 76
77typedef int (*write_strategy_fn)(const char *buf, unsigned long long *val);
78
79int res_counter_memparse_write_strategy(const char *buf, 77int res_counter_memparse_write_strategy(const char *buf,
80 unsigned long long *res); 78 unsigned long long *res);
81 79
82int res_counter_write(struct res_counter *counter, int member,
83 const char *buffer, write_strategy_fn write_strategy);
84
85/* 80/*
86 * the field descriptors. one for each member of res_counter 81 * the field descriptors. one for each member of res_counter
87 */ 82 */
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 6c8835f74f79..519777e3fa01 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -159,13 +159,14 @@ int ring_buffer_record_is_on(struct ring_buffer *buffer);
159void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu); 159void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu);
160void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu); 160void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu);
161 161
162unsigned long ring_buffer_oldest_event_ts(struct ring_buffer *buffer, int cpu); 162u64 ring_buffer_oldest_event_ts(struct ring_buffer *buffer, int cpu);
163unsigned long ring_buffer_bytes_cpu(struct ring_buffer *buffer, int cpu); 163unsigned long ring_buffer_bytes_cpu(struct ring_buffer *buffer, int cpu);
164unsigned long ring_buffer_entries(struct ring_buffer *buffer); 164unsigned long ring_buffer_entries(struct ring_buffer *buffer);
165unsigned long ring_buffer_overruns(struct ring_buffer *buffer); 165unsigned long ring_buffer_overruns(struct ring_buffer *buffer);
166unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); 166unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu);
167unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); 167unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu);
168unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu); 168unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu);
169unsigned long ring_buffer_dropped_events_cpu(struct ring_buffer *buffer, int cpu);
169 170
170u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); 171u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu);
171void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, 172void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer,
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 7002bbfd5d4a..489dd7bb28ec 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -69,4 +69,7 @@ extern int ndo_dflt_fdb_dump(struct sk_buff *skb,
69 struct netlink_callback *cb, 69 struct netlink_callback *cb,
70 struct net_device *dev, 70 struct net_device *dev,
71 int idx); 71 int idx);
72
73extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
74 struct net_device *dev, u16 mode);
72#endif /* __LINUX_RTNETLINK_H */ 75#endif /* __LINUX_RTNETLINK_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index b1e619f9ff1a..b089c92c609b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -107,8 +107,18 @@ 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
110extern unsigned long get_parent_ip(unsigned long addr); 118extern unsigned long get_parent_ip(unsigned long addr);
111 119
120extern void dump_cpu_task(int cpu);
121
112struct seq_file; 122struct seq_file;
113struct cfs_rq; 123struct cfs_rq;
114struct task_group; 124struct task_group;
@@ -434,13 +444,28 @@ struct cpu_itimer {
434}; 444};
435 445
436/** 446/**
447 * struct cputime - snaphsot of system and user cputime
448 * @utime: time spent in user mode
449 * @stime: time spent in system mode
450 *
451 * Gathers a generic snapshot of user and system time.
452 */
453struct cputime {
454 cputime_t utime;
455 cputime_t stime;
456};
457
458/**
437 * struct task_cputime - collected CPU time counts 459 * struct task_cputime - collected CPU time counts
438 * @utime: time spent in user mode, in &cputime_t units 460 * @utime: time spent in user mode, in &cputime_t units
439 * @stime: time spent in kernel mode, in &cputime_t units 461 * @stime: time spent in kernel mode, in &cputime_t units
440 * @sum_exec_runtime: total time spent on the CPU, in nanoseconds 462 * @sum_exec_runtime: total time spent on the CPU, in nanoseconds
441 * 463 *
442 * This structure groups together three kinds of CPU time that are 464 * This is an extension of struct cputime that includes the total runtime
443 * tracked for threads and thread groups. Most things considering 465 * spent by the task from the scheduler point of view.
466 *
467 * As a result, this structure groups together three kinds of CPU time
468 * that are tracked for threads and thread groups. Most things considering
444 * CPU time want to group these counts together and treat all three 469 * CPU time want to group these counts together and treat all three
445 * of them in parallel. 470 * of them in parallel.
446 */ 471 */
@@ -581,7 +606,7 @@ struct signal_struct {
581 cputime_t gtime; 606 cputime_t gtime;
582 cputime_t cgtime; 607 cputime_t cgtime;
583#ifndef CONFIG_VIRT_CPU_ACCOUNTING 608#ifndef CONFIG_VIRT_CPU_ACCOUNTING
584 cputime_t prev_utime, prev_stime; 609 struct cputime prev_cputime;
585#endif 610#endif
586 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; 611 unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw;
587 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; 612 unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt;
@@ -631,9 +656,10 @@ struct signal_struct {
631 struct rw_semaphore group_rwsem; 656 struct rw_semaphore group_rwsem;
632#endif 657#endif
633 658
634 int oom_score_adj; /* OOM kill score adjustment */ 659 oom_flags_t oom_flags;
635 int oom_score_adj_min; /* OOM kill score adjustment minimum value. 660 short oom_score_adj; /* OOM kill score adjustment */
636 * Only settable by CAP_SYS_RESOURCE. */ 661 short oom_score_adj_min; /* OOM kill score adjustment min value.
662 * Only settable by CAP_SYS_RESOURCE. */
637 663
638 struct mutex cred_guard_mutex; /* guard against foreign influences on 664 struct mutex cred_guard_mutex; /* guard against foreign influences on
639 * credential calculations 665 * credential calculations
@@ -1061,6 +1087,7 @@ struct sched_class {
1061 1087
1062#ifdef CONFIG_SMP 1088#ifdef CONFIG_SMP
1063 int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); 1089 int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags);
1090 void (*migrate_task_rq)(struct task_struct *p, int next_cpu);
1064 1091
1065 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); 1092 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
1066 void (*post_schedule) (struct rq *this_rq); 1093 void (*post_schedule) (struct rq *this_rq);
@@ -1095,6 +1122,18 @@ struct load_weight {
1095 unsigned long weight, inv_weight; 1122 unsigned long weight, inv_weight;
1096}; 1123};
1097 1124
1125struct sched_avg {
1126 /*
1127 * These sums represent an infinite geometric series and so are bound
1128 * above by 1024/(1-y). Thus we only need a u32 to store them for for all
1129 * choices of y < 1-2^(-32)*1024.
1130 */
1131 u32 runnable_avg_sum, runnable_avg_period;
1132 u64 last_runnable_update;
1133 s64 decay_count;
1134 unsigned long load_avg_contrib;
1135};
1136
1098#ifdef CONFIG_SCHEDSTATS 1137#ifdef CONFIG_SCHEDSTATS
1099struct sched_statistics { 1138struct sched_statistics {
1100 u64 wait_start; 1139 u64 wait_start;
@@ -1155,6 +1194,15 @@ struct sched_entity {
1155 /* rq "owned" by this entity/group: */ 1194 /* rq "owned" by this entity/group: */
1156 struct cfs_rq *my_q; 1195 struct cfs_rq *my_q;
1157#endif 1196#endif
1197/*
1198 * Load-tracking only depends on SMP, FAIR_GROUP_SCHED dependency below may be
1199 * removed when useful for applications beyond shares distribution (e.g.
1200 * load-balance).
1201 */
1202#if defined(CONFIG_SMP) && defined(CONFIG_FAIR_GROUP_SCHED)
1203 /* Per-entity load-tracking */
1204 struct sched_avg avg;
1205#endif
1158}; 1206};
1159 1207
1160struct sched_rt_entity { 1208struct sched_rt_entity {
@@ -1318,7 +1366,7 @@ struct task_struct {
1318 cputime_t utime, stime, utimescaled, stimescaled; 1366 cputime_t utime, stime, utimescaled, stimescaled;
1319 cputime_t gtime; 1367 cputime_t gtime;
1320#ifndef CONFIG_VIRT_CPU_ACCOUNTING 1368#ifndef CONFIG_VIRT_CPU_ACCOUNTING
1321 cputime_t prev_utime, prev_stime; 1369 struct cputime prev_cputime;
1322#endif 1370#endif
1323 unsigned long nvcsw, nivcsw; /* context switch counts */ 1371 unsigned long nvcsw, nivcsw; /* context switch counts */
1324 struct timespec start_time; /* monotonic time */ 1372 struct timespec start_time; /* monotonic time */
@@ -1749,8 +1797,8 @@ static inline void put_task_struct(struct task_struct *t)
1749 __put_task_struct(t); 1797 __put_task_struct(t);
1750} 1798}
1751 1799
1752extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st); 1800extern void task_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
1753extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st); 1801extern void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime_t *st);
1754 1802
1755/* 1803/*
1756 * Per process flags 1804 * Per process flags
@@ -1864,14 +1912,6 @@ static inline void rcu_copy_process(struct task_struct *p)
1864 1912
1865#endif 1913#endif
1866 1914
1867static inline void rcu_switch(struct task_struct *prev,
1868 struct task_struct *next)
1869{
1870#ifdef CONFIG_RCU_USER_QS
1871 rcu_user_hooks_switch(prev, next);
1872#endif
1873}
1874
1875static inline void tsk_restore_flags(struct task_struct *task, 1915static inline void tsk_restore_flags(struct task_struct *task,
1876 unsigned long orig_flags, unsigned long flags) 1916 unsigned long orig_flags, unsigned long flags)
1877{ 1917{
@@ -2298,7 +2338,7 @@ extern void mm_release(struct task_struct *, struct mm_struct *);
2298extern struct mm_struct *dup_mm(struct task_struct *tsk); 2338extern struct mm_struct *dup_mm(struct task_struct *tsk);
2299 2339
2300extern int copy_thread(unsigned long, unsigned long, unsigned long, 2340extern int copy_thread(unsigned long, unsigned long, unsigned long,
2301 struct task_struct *, struct pt_regs *); 2341 struct task_struct *);
2302extern void flush_thread(void); 2342extern void flush_thread(void);
2303extern void exit_thread(void); 2343extern void exit_thread(void);
2304 2344
@@ -2310,14 +2350,13 @@ extern void flush_itimer_signals(void);
2310 2350
2311extern void do_group_exit(int); 2351extern void do_group_exit(int);
2312 2352
2313extern void daemonize(const char *, ...);
2314extern int allow_signal(int); 2353extern int allow_signal(int);
2315extern int disallow_signal(int); 2354extern int disallow_signal(int);
2316 2355
2317extern int do_execve(const char *, 2356extern int do_execve(const char *,
2318 const char __user * const __user *, 2357 const char __user * const __user *,
2319 const char __user * const __user *, struct pt_regs *); 2358 const char __user * const __user *);
2320extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); 2359extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
2321struct task_struct *fork_idle(int); 2360struct task_struct *fork_idle(int);
2322#ifdef CONFIG_GENERIC_KERNEL_THREAD 2361#ifdef CONFIG_GENERIC_KERNEL_THREAD
2323extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); 2362extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index c174c90fb3fb..c490d20b3fb8 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -105,6 +105,8 @@ extern int early_serial_setup(struct uart_port *port);
105 105
106extern int serial8250_find_port(struct uart_port *p); 106extern int serial8250_find_port(struct uart_port *p);
107extern int serial8250_find_port_for_earlycon(void); 107extern int serial8250_find_port_for_earlycon(void);
108extern unsigned int serial8250_early_in(struct uart_port *port, int offset);
109extern void serial8250_early_out(struct uart_port *port, int offset, int value);
108extern int setup_early_serial8250_console(char *cmdline); 110extern int setup_early_serial8250_console(char *cmdline);
109extern void serial8250_do_set_termios(struct uart_port *port, 111extern void serial8250_do_set_termios(struct uart_port *port,
110 struct ktermios *termios, struct ktermios *old); 112 struct ktermios *termios, struct ktermios *old);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 3c430228d232..c6690a2a27fb 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -46,6 +46,8 @@ struct uart_ops {
46 unsigned int (*get_mctrl)(struct uart_port *); 46 unsigned int (*get_mctrl)(struct uart_port *);
47 void (*stop_tx)(struct uart_port *); 47 void (*stop_tx)(struct uart_port *);
48 void (*start_tx)(struct uart_port *); 48 void (*start_tx)(struct uart_port *);
49 void (*throttle)(struct uart_port *);
50 void (*unthrottle)(struct uart_port *);
49 void (*send_xchar)(struct uart_port *, char ch); 51 void (*send_xchar)(struct uart_port *, char ch);
50 void (*stop_rx)(struct uart_port *); 52 void (*stop_rx)(struct uart_port *);
51 void (*enable_ms)(struct uart_port *); 53 void (*enable_ms)(struct uart_port *);
@@ -163,6 +165,10 @@ struct uart_port {
163#define UPF_BUGGY_UART ((__force upf_t) (1 << 14)) 165#define UPF_BUGGY_UART ((__force upf_t) (1 << 14))
164#define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15)) 166#define UPF_NO_TXEN_TEST ((__force upf_t) (1 << 15))
165#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) 167#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16))
168/* Port has hardware-assisted h/w flow control (iow, auto-RTS *not* auto-CTS) */
169#define UPF_HARD_FLOW ((__force upf_t) (1 << 21))
170/* Port has hardware-assisted s/w flow control */
171#define UPF_SOFT_FLOW ((__force upf_t) (1 << 22))
166#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 172#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
167#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) 173#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
168#define UPF_EXAR_EFR ((__force upf_t) (1 << 25)) 174#define UPF_EXAR_EFR ((__force upf_t) (1 << 25))
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
index 50910913b268..60c72395ec6b 100644
--- a/include/linux/sh_clk.h
+++ b/include/linux/sh_clk.h
@@ -199,4 +199,13 @@ int sh_clk_div6_reparent_register(struct clk *clks, int nr);
199#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk } 199#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
200#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk } 200#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
201 201
202/* .enable_reg will be updated to .mapping on sh_clk_fsidiv_register() */
203#define SH_CLK_FSIDIV(_reg, _parent) \
204{ \
205 .enable_reg = (void __iomem *)_reg, \
206 .parent = _parent, \
207}
208
209int sh_clk_fsidiv_register(struct clk *clks, int nr);
210
202#endif /* __SH_CLOCK_H */ 211#endif /* __SH_CLOCK_H */
diff --git a/include/linux/shm.h b/include/linux/shm.h
index bcf8a6a3ec00..429c1995d756 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -29,6 +29,21 @@ struct shmid_kernel /* private to the kernel */
29#define SHM_HUGETLB 04000 /* segment will use huge TLB pages */ 29#define SHM_HUGETLB 04000 /* segment will use huge TLB pages */
30#define SHM_NORESERVE 010000 /* don't check for reservations */ 30#define SHM_NORESERVE 010000 /* don't check for reservations */
31 31
32/* Bits [26:31] are reserved */
33
34/*
35 * When SHM_HUGETLB is set bits [26:31] encode the log2 of the huge page size.
36 * This gives us 6 bits, which is enough until someone invents 128 bit address
37 * spaces.
38 *
39 * Assume these are all power of twos.
40 * When 0 use the default page size.
41 */
42#define SHM_HUGE_SHIFT 26
43#define SHM_HUGE_MASK 0x3f
44#define SHM_HUGE_2MB (21 << SHM_HUGE_SHIFT)
45#define SHM_HUGE_1GB (30 << SHM_HUGE_SHIFT)
46
32#ifdef CONFIG_SYSVIPC 47#ifdef CONFIG_SYSVIPC
33long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr, 48long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr,
34 unsigned long shmlba); 49 unsigned long shmlba);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 6a2c34e6d962..320e976d5ab8 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -235,11 +235,13 @@ enum {
235/* 235/*
236 * The callback notifies userspace to release buffers when skb DMA is done in 236 * The callback notifies userspace to release buffers when skb DMA is done in
237 * lower device, the skb last reference should be 0 when calling this. 237 * lower device, the skb last reference should be 0 when calling this.
238 * The zerocopy_success argument is true if zero copy transmit occurred,
239 * false on data copy or out of memory error caused by data copy attempt.
238 * The ctx field is used to track device context. 240 * The ctx field is used to track device context.
239 * The desc field is used to track userspace buffer index. 241 * The desc field is used to track userspace buffer index.
240 */ 242 */
241struct ubuf_info { 243struct ubuf_info {
242 void (*callback)(struct ubuf_info *); 244 void (*callback)(struct ubuf_info *, bool zerocopy_success);
243 void *ctx; 245 void *ctx;
244 unsigned long desc; 246 unsigned long desc;
245}; 247};
@@ -374,6 +376,8 @@ typedef unsigned char *sk_buff_data_t;
374 * @mark: Generic packet mark 376 * @mark: Generic packet mark
375 * @dropcount: total number of sk_receive_queue overflows 377 * @dropcount: total number of sk_receive_queue overflows
376 * @vlan_tci: vlan tag control information 378 * @vlan_tci: vlan tag control information
379 * @inner_transport_header: Inner transport layer header (encapsulation)
380 * @inner_network_header: Network layer header (encapsulation)
377 * @transport_header: Transport layer header 381 * @transport_header: Transport layer header
378 * @network_header: Network layer header 382 * @network_header: Network layer header
379 * @mac_header: Link layer header 383 * @mac_header: Link layer header
@@ -469,7 +473,13 @@ struct sk_buff {
469 __u8 wifi_acked:1; 473 __u8 wifi_acked:1;
470 __u8 no_fcs:1; 474 __u8 no_fcs:1;
471 __u8 head_frag:1; 475 __u8 head_frag:1;
472 /* 8/10 bit hole (depending on ndisc_nodetype presence) */ 476 /* Encapsulation protocol and NIC drivers should use
477 * this flag to indicate to each other if the skb contains
478 * encapsulated packet or not and maybe use the inner packet
479 * headers if needed
480 */
481 __u8 encapsulation:1;
482 /* 7/9 bit hole (depending on ndisc_nodetype presence) */
473 kmemcheck_bitfield_end(flags2); 483 kmemcheck_bitfield_end(flags2);
474 484
475#ifdef CONFIG_NET_DMA 485#ifdef CONFIG_NET_DMA
@@ -484,6 +494,8 @@ struct sk_buff {
484 __u32 avail_size; 494 __u32 avail_size;
485 }; 495 };
486 496
497 sk_buff_data_t inner_transport_header;
498 sk_buff_data_t inner_network_header;
487 sk_buff_data_t transport_header; 499 sk_buff_data_t transport_header;
488 sk_buff_data_t network_header; 500 sk_buff_data_t network_header;
489 sk_buff_data_t mac_header; 501 sk_buff_data_t mac_header;
@@ -566,6 +578,7 @@ static inline struct rtable *skb_rtable(const struct sk_buff *skb)
566} 578}
567 579
568extern void kfree_skb(struct sk_buff *skb); 580extern void kfree_skb(struct sk_buff *skb);
581extern void skb_tx_error(struct sk_buff *skb);
569extern void consume_skb(struct sk_buff *skb); 582extern void consume_skb(struct sk_buff *skb);
570extern void __kfree_skb(struct sk_buff *skb); 583extern void __kfree_skb(struct sk_buff *skb);
571extern struct kmem_cache *skbuff_head_cache; 584extern struct kmem_cache *skbuff_head_cache;
@@ -643,7 +656,7 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
643extern void __skb_get_rxhash(struct sk_buff *skb); 656extern void __skb_get_rxhash(struct sk_buff *skb);
644static inline __u32 skb_get_rxhash(struct sk_buff *skb) 657static inline __u32 skb_get_rxhash(struct sk_buff *skb)
645{ 658{
646 if (!skb->rxhash) 659 if (!skb->l4_rxhash)
647 __skb_get_rxhash(skb); 660 __skb_get_rxhash(skb);
648 661
649 return skb->rxhash; 662 return skb->rxhash;
@@ -1432,12 +1445,53 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
1432 skb->tail += len; 1445 skb->tail += len;
1433} 1446}
1434 1447
1448static inline void skb_reset_inner_headers(struct sk_buff *skb)
1449{
1450 skb->inner_network_header = skb->network_header;
1451 skb->inner_transport_header = skb->transport_header;
1452}
1453
1435static inline void skb_reset_mac_len(struct sk_buff *skb) 1454static inline void skb_reset_mac_len(struct sk_buff *skb)
1436{ 1455{
1437 skb->mac_len = skb->network_header - skb->mac_header; 1456 skb->mac_len = skb->network_header - skb->mac_header;
1438} 1457}
1439 1458
1440#ifdef NET_SKBUFF_DATA_USES_OFFSET 1459#ifdef NET_SKBUFF_DATA_USES_OFFSET
1460static inline unsigned char *skb_inner_transport_header(const struct sk_buff
1461 *skb)
1462{
1463 return skb->head + skb->inner_transport_header;
1464}
1465
1466static inline void skb_reset_inner_transport_header(struct sk_buff *skb)
1467{
1468 skb->inner_transport_header = skb->data - skb->head;
1469}
1470
1471static inline void skb_set_inner_transport_header(struct sk_buff *skb,
1472 const int offset)
1473{
1474 skb_reset_inner_transport_header(skb);
1475 skb->inner_transport_header += offset;
1476}
1477
1478static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb)
1479{
1480 return skb->head + skb->inner_network_header;
1481}
1482
1483static inline void skb_reset_inner_network_header(struct sk_buff *skb)
1484{
1485 skb->inner_network_header = skb->data - skb->head;
1486}
1487
1488static inline void skb_set_inner_network_header(struct sk_buff *skb,
1489 const int offset)
1490{
1491 skb_reset_inner_network_header(skb);
1492 skb->inner_network_header += offset;
1493}
1494
1441static inline unsigned char *skb_transport_header(const struct sk_buff *skb) 1495static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
1442{ 1496{
1443 return skb->head + skb->transport_header; 1497 return skb->head + skb->transport_header;
@@ -1493,6 +1547,38 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
1493} 1547}
1494 1548
1495#else /* NET_SKBUFF_DATA_USES_OFFSET */ 1549#else /* NET_SKBUFF_DATA_USES_OFFSET */
1550static inline unsigned char *skb_inner_transport_header(const struct sk_buff
1551 *skb)
1552{
1553 return skb->inner_transport_header;
1554}
1555
1556static inline void skb_reset_inner_transport_header(struct sk_buff *skb)
1557{
1558 skb->inner_transport_header = skb->data;
1559}
1560
1561static inline void skb_set_inner_transport_header(struct sk_buff *skb,
1562 const int offset)
1563{
1564 skb->inner_transport_header = skb->data + offset;
1565}
1566
1567static inline unsigned char *skb_inner_network_header(const struct sk_buff *skb)
1568{
1569 return skb->inner_network_header;
1570}
1571
1572static inline void skb_reset_inner_network_header(struct sk_buff *skb)
1573{
1574 skb->inner_network_header = skb->data;
1575}
1576
1577static inline void skb_set_inner_network_header(struct sk_buff *skb,
1578 const int offset)
1579{
1580 skb->inner_network_header = skb->data + offset;
1581}
1496 1582
1497static inline unsigned char *skb_transport_header(const struct sk_buff *skb) 1583static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
1498{ 1584{
@@ -1571,11 +1657,21 @@ static inline u32 skb_network_header_len(const struct sk_buff *skb)
1571 return skb->transport_header - skb->network_header; 1657 return skb->transport_header - skb->network_header;
1572} 1658}
1573 1659
1660static inline u32 skb_inner_network_header_len(const struct sk_buff *skb)
1661{
1662 return skb->inner_transport_header - skb->inner_network_header;
1663}
1664
1574static inline int skb_network_offset(const struct sk_buff *skb) 1665static inline int skb_network_offset(const struct sk_buff *skb)
1575{ 1666{
1576 return skb_network_header(skb) - skb->data; 1667 return skb_network_header(skb) - skb->data;
1577} 1668}
1578 1669
1670static inline int skb_inner_network_offset(const struct sk_buff *skb)
1671{
1672 return skb_inner_network_header(skb) - skb->data;
1673}
1674
1579static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len) 1675static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len)
1580{ 1676{
1581 return pskb_may_pull(skb, skb_network_offset(skb) + len); 1677 return pskb_may_pull(skb, skb_network_offset(skb) + len);
diff --git a/include/linux/smscphy.h b/include/linux/smscphy.h
index ce718cbce435..f4bf16e16e16 100644
--- a/include/linux/smscphy.h
+++ b/include/linux/smscphy.h
@@ -4,6 +4,7 @@
4#define MII_LAN83C185_ISF 29 /* Interrupt Source Flags */ 4#define MII_LAN83C185_ISF 29 /* Interrupt Source Flags */
5#define MII_LAN83C185_IM 30 /* Interrupt Mask */ 5#define MII_LAN83C185_IM 30 /* Interrupt Mask */
6#define MII_LAN83C185_CTRL_STATUS 17 /* Mode/Status Register */ 6#define MII_LAN83C185_CTRL_STATUS 17 /* Mode/Status Register */
7#define MII_LAN83C185_SPECIAL_MODES 18 /* Special Modes Register */
7 8
8#define MII_LAN83C185_ISF_INT1 (1<<1) /* Auto-Negotiation Page Received */ 9#define MII_LAN83C185_ISF_INT1 (1<<1) /* Auto-Negotiation Page Received */
9#define MII_LAN83C185_ISF_INT2 (1<<2) /* Parallel Detection Fault */ 10#define MII_LAN83C185_ISF_INT2 (1<<2) /* Parallel Detection Fault */
@@ -22,4 +23,8 @@
22#define MII_LAN83C185_EDPWRDOWN (1 << 13) /* EDPWRDOWN */ 23#define MII_LAN83C185_EDPWRDOWN (1 << 13) /* EDPWRDOWN */
23#define MII_LAN83C185_ENERGYON (1 << 1) /* ENERGYON */ 24#define MII_LAN83C185_ENERGYON (1 << 1) /* ENERGYON */
24 25
26#define MII_LAN83C185_MODE_MASK 0xE0
27#define MII_LAN83C185_MODE_POWERDOWN 0xC0 /* Power Down mode */
28#define MII_LAN83C185_MODE_ALL 0xE0 /* All capable mode */
29
25#endif /* __LINUX_SMSCPHY_H__ */ 30#endif /* __LINUX_SMSCPHY_H__ */
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index c64de9dd7631..2f694f3846a9 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -46,8 +46,9 @@ struct ads7846_platform_data {
46 u16 debounce_rep; /* additional consecutive good readings 46 u16 debounce_rep; /* additional consecutive good readings
47 * required after the first two */ 47 * required after the first two */
48 int gpio_pendown; /* the GPIO used to decide the pendown 48 int gpio_pendown; /* the GPIO used to decide the pendown
49 * state if get_pendown_state == NULL 49 * state if get_pendown_state == NULL */
50 */ 50 int gpio_pendown_debounce; /* platform specific debounce time for
51 * the gpio_pendown */
51 int (*get_pendown_state)(void); 52 int (*get_pendown_state)(void);
52 int (*filter_init) (const struct ads7846_platform_data *pdata, 53 int (*filter_init) (const struct ads7846_platform_data *pdata,
53 void **filter_data); 54 void **filter_data);
diff --git a/include/linux/spi/spi-tegra.h b/include/linux/spi/spi-tegra.h
new file mode 100644
index 000000000000..786932c62edb
--- /dev/null
+++ b/include/linux/spi/spi-tegra.h
@@ -0,0 +1,40 @@
1/*
2 * spi-tegra.h: SPI interface for Nvidia Tegra20 SLINK controller.
3 *
4 * Copyright (C) 2011 NVIDIA Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21#ifndef _LINUX_SPI_TEGRA_H
22#define _LINUX_SPI_TEGRA_H
23
24struct tegra_spi_platform_data {
25 int dma_req_sel;
26 unsigned int spi_max_frequency;
27};
28
29/*
30 * Controller data from device to pass some info like
31 * hw based chip select can be used or not and if yes
32 * then CS hold and setup time.
33 */
34struct tegra_spi_device_controller_data {
35 bool is_hw_based_cs;
36 int cs_setup_clk_count;
37 int cs_hold_clk_count;
38};
39
40#endif /* _LINUX_SPI_TEGRA_H */
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index fa702aeb5038..f62918946d86 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -90,6 +90,7 @@ struct spi_device {
90 void *controller_state; 90 void *controller_state;
91 void *controller_data; 91 void *controller_data;
92 char modalias[SPI_NAME_SIZE]; 92 char modalias[SPI_NAME_SIZE];
93 int cs_gpio; /* chip select gpio */
93 94
94 /* 95 /*
95 * likely need more hooks for more protocol options affecting how 96 * likely need more hooks for more protocol options affecting how
@@ -362,6 +363,8 @@ struct spi_master {
362 int (*transfer_one_message)(struct spi_master *master, 363 int (*transfer_one_message)(struct spi_master *master,
363 struct spi_message *mesg); 364 struct spi_message *mesg);
364 int (*unprepare_transfer_hardware)(struct spi_master *master); 365 int (*unprepare_transfer_hardware)(struct spi_master *master);
366 /* gpio chip select */
367 int *cs_gpios;
365}; 368};
366 369
367static inline void *spi_master_get_devdata(struct spi_master *master) 370static inline void *spi_master_get_devdata(struct spi_master *master)
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 55a5c52cbb25..6eb691b08358 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -16,8 +16,10 @@
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 * 17 *
18 * Copyright (C) IBM Corporation, 2006 18 * Copyright (C) IBM Corporation, 2006
19 * Copyright (C) Fujitsu, 2012
19 * 20 *
20 * Author: Paul McKenney <paulmck@us.ibm.com> 21 * Author: Paul McKenney <paulmck@us.ibm.com>
22 * Lai Jiangshan <laijs@cn.fujitsu.com>
21 * 23 *
22 * For detailed explanation of Read-Copy Update mechanism see - 24 * For detailed explanation of Read-Copy Update mechanism see -
23 * Documentation/RCU/ *.txt 25 * Documentation/RCU/ *.txt
@@ -40,6 +42,8 @@ struct rcu_batch {
40 struct rcu_head *head, **tail; 42 struct rcu_head *head, **tail;
41}; 43};
42 44
45#define RCU_BATCH_INIT(name) { NULL, &(name.head) }
46
43struct srcu_struct { 47struct srcu_struct {
44 unsigned completed; 48 unsigned completed;
45 struct srcu_struct_array __percpu *per_cpu_ref; 49 struct srcu_struct_array __percpu *per_cpu_ref;
@@ -70,12 +74,42 @@ int __init_srcu_struct(struct srcu_struct *sp, const char *name,
70 __init_srcu_struct((sp), #sp, &__srcu_key); \ 74 __init_srcu_struct((sp), #sp, &__srcu_key); \
71}) 75})
72 76
77#define __SRCU_DEP_MAP_INIT(srcu_name) .dep_map = { .name = #srcu_name },
73#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 78#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
74 79
75int init_srcu_struct(struct srcu_struct *sp); 80int init_srcu_struct(struct srcu_struct *sp);
76 81
82#define __SRCU_DEP_MAP_INIT(srcu_name)
77#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 83#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
78 84
85void process_srcu(struct work_struct *work);
86
87#define __SRCU_STRUCT_INIT(name) \
88 { \
89 .completed = -300, \
90 .per_cpu_ref = &name##_srcu_array, \
91 .queue_lock = __SPIN_LOCK_UNLOCKED(name.queue_lock), \
92 .running = false, \
93 .batch_queue = RCU_BATCH_INIT(name.batch_queue), \
94 .batch_check0 = RCU_BATCH_INIT(name.batch_check0), \
95 .batch_check1 = RCU_BATCH_INIT(name.batch_check1), \
96 .batch_done = RCU_BATCH_INIT(name.batch_done), \
97 .work = __DELAYED_WORK_INITIALIZER(name.work, process_srcu, 0),\
98 __SRCU_DEP_MAP_INIT(name) \
99 }
100
101/*
102 * define and init a srcu struct at build time.
103 * dont't call init_srcu_struct() nor cleanup_srcu_struct() on it.
104 */
105#define DEFINE_SRCU(name) \
106 static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\
107 struct srcu_struct name = __SRCU_STRUCT_INIT(name);
108
109#define DEFINE_STATIC_SRCU(name) \
110 static DEFINE_PER_CPU(struct srcu_struct_array, name##_srcu_array);\
111 static struct srcu_struct name = __SRCU_STRUCT_INIT(name);
112
79/** 113/**
80 * call_srcu() - Queue a callback for invocation after an SRCU grace period 114 * call_srcu() - Queue a callback for invocation after an SRCU grace period
81 * @sp: srcu_struct in queue the callback 115 * @sp: srcu_struct in queue the callback
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index bb674c02f306..22958d68ecfe 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -6,8 +6,10 @@
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/spinlock.h> 7#include <linux/spinlock.h>
8#include <linux/pci.h> 8#include <linux/pci.h>
9#include <linux/gpio.h>
9#include <linux/mod_devicetable.h> 10#include <linux/mod_devicetable.h>
10#include <linux/dma-mapping.h> 11#include <linux/dma-mapping.h>
12#include <linux/platform_device.h>
11 13
12#include <linux/ssb/ssb_regs.h> 14#include <linux/ssb/ssb_regs.h>
13 15
@@ -432,7 +434,11 @@ struct ssb_bus {
432#ifdef CONFIG_SSB_EMBEDDED 434#ifdef CONFIG_SSB_EMBEDDED
433 /* Lock for GPIO register access. */ 435 /* Lock for GPIO register access. */
434 spinlock_t gpio_lock; 436 spinlock_t gpio_lock;
437 struct platform_device *watchdog;
435#endif /* EMBEDDED */ 438#endif /* EMBEDDED */
439#ifdef CONFIG_SSB_DRIVER_GPIO
440 struct gpio_chip gpio;
441#endif /* DRIVER_GPIO */
436 442
437 /* Internal-only stuff follows. Do not touch. */ 443 /* Internal-only stuff follows. Do not touch. */
438 struct list_head list; 444 struct list_head list;
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h
index c2b02a5c86ae..9e492be5244b 100644
--- a/include/linux/ssb/ssb_driver_chipcommon.h
+++ b/include/linux/ssb/ssb_driver_chipcommon.h
@@ -590,7 +590,10 @@ struct ssb_chipcommon {
590 u32 status; 590 u32 status;
591 /* Fast Powerup Delay constant */ 591 /* Fast Powerup Delay constant */
592 u16 fast_pwrup_delay; 592 u16 fast_pwrup_delay;
593 spinlock_t gpio_lock;
593 struct ssb_chipcommon_pmu pmu; 594 struct ssb_chipcommon_pmu pmu;
595 u32 ticks_per_ms;
596 u32 max_timer_ms;
594}; 597};
595 598
596static inline bool ssb_chipco_available(struct ssb_chipcommon *cc) 599static inline bool ssb_chipco_available(struct ssb_chipcommon *cc)
@@ -630,8 +633,7 @@ enum ssb_clkmode {
630extern void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc, 633extern void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc,
631 enum ssb_clkmode mode); 634 enum ssb_clkmode mode);
632 635
633extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, 636extern u32 ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, u32 ticks);
634 u32 ticks);
635 637
636void ssb_chipco_irq_mask(struct ssb_chipcommon *cc, u32 mask, u32 value); 638void ssb_chipco_irq_mask(struct ssb_chipcommon *cc, u32 mask, u32 value);
637 639
@@ -644,6 +646,8 @@ u32 ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value);
644u32 ssb_chipco_gpio_control(struct ssb_chipcommon *cc, u32 mask, u32 value); 646u32 ssb_chipco_gpio_control(struct ssb_chipcommon *cc, u32 mask, u32 value);
645u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc, u32 mask, u32 value); 647u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc, u32 mask, u32 value);
646u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value); 648u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value);
649u32 ssb_chipco_gpio_pullup(struct ssb_chipcommon *cc, u32 mask, u32 value);
650u32 ssb_chipco_gpio_pulldown(struct ssb_chipcommon *cc, u32 mask, u32 value);
647 651
648#ifdef CONFIG_SSB_SERIAL 652#ifdef CONFIG_SSB_SERIAL
649extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc, 653extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc,
diff --git a/include/linux/ssb/ssb_driver_extif.h b/include/linux/ssb/ssb_driver_extif.h
index 91161f0aa22b..a410e841eb91 100644
--- a/include/linux/ssb/ssb_driver_extif.h
+++ b/include/linux/ssb/ssb_driver_extif.h
@@ -152,12 +152,16 @@
152/* watchdog */ 152/* watchdog */
153#define SSB_EXTIF_WATCHDOG_CLK 48000000 /* Hz */ 153#define SSB_EXTIF_WATCHDOG_CLK 48000000 /* Hz */
154 154
155#define SSB_EXTIF_WATCHDOG_MAX_TIMER ((1 << 28) - 1)
156#define SSB_EXTIF_WATCHDOG_MAX_TIMER_MS (SSB_EXTIF_WATCHDOG_MAX_TIMER \
157 / (SSB_EXTIF_WATCHDOG_CLK / 1000))
155 158
156 159
157#ifdef CONFIG_SSB_DRIVER_EXTIF 160#ifdef CONFIG_SSB_DRIVER_EXTIF
158 161
159struct ssb_extif { 162struct ssb_extif {
160 struct ssb_device *dev; 163 struct ssb_device *dev;
164 spinlock_t gpio_lock;
161}; 165};
162 166
163static inline bool ssb_extif_available(struct ssb_extif *extif) 167static inline bool ssb_extif_available(struct ssb_extif *extif)
@@ -171,8 +175,7 @@ extern void ssb_extif_get_clockcontrol(struct ssb_extif *extif,
171extern void ssb_extif_timing_init(struct ssb_extif *extif, 175extern void ssb_extif_timing_init(struct ssb_extif *extif,
172 unsigned long ns); 176 unsigned long ns);
173 177
174extern void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, 178extern u32 ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks);
175 u32 ticks);
176 179
177/* Extif GPIO pin access */ 180/* Extif GPIO pin access */
178u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask); 181u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask);
@@ -205,10 +208,52 @@ void ssb_extif_get_clockcontrol(struct ssb_extif *extif,
205} 208}
206 209
207static inline 210static inline
208void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, 211void ssb_extif_timing_init(struct ssb_extif *extif, unsigned long ns)
209 u32 ticks)
210{ 212{
211} 213}
212 214
215static inline
216u32 ssb_extif_watchdog_timer_set(struct ssb_extif *extif, u32 ticks)
217{
218 return 0;
219}
220
221static inline u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask)
222{
223 return 0;
224}
225
226static inline u32 ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask,
227 u32 value)
228{
229 return 0;
230}
231
232static inline u32 ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask,
233 u32 value)
234{
235 return 0;
236}
237
238static inline u32 ssb_extif_gpio_polarity(struct ssb_extif *extif, u32 mask,
239 u32 value)
240{
241 return 0;
242}
243
244static inline u32 ssb_extif_gpio_intmask(struct ssb_extif *extif, u32 mask,
245 u32 value)
246{
247 return 0;
248}
249
250#ifdef CONFIG_SSB_SERIAL
251static inline int ssb_extif_serial_init(struct ssb_extif *extif,
252 struct ssb_serial_port *ports)
253{
254 return 0;
255}
256#endif /* CONFIG_SSB_SERIAL */
257
213#endif /* CONFIG_SSB_DRIVER_EXTIF */ 258#endif /* CONFIG_SSB_DRIVER_EXTIF */
214#endif /* LINUX_SSB_EXTIFCORE_H_ */ 259#endif /* LINUX_SSB_EXTIFCORE_H_ */
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h
index 5f44e9740cd2..07a9c7a2e088 100644
--- a/include/linux/ssb/ssb_driver_mips.h
+++ b/include/linux/ssb/ssb_driver_mips.h
@@ -13,6 +13,12 @@ struct ssb_serial_port {
13 unsigned int reg_shift; 13 unsigned int reg_shift;
14}; 14};
15 15
16struct ssb_pflash {
17 bool present;
18 u8 buswidth;
19 u32 window;
20 u32 window_size;
21};
16 22
17struct ssb_mipscore { 23struct ssb_mipscore {
18 struct ssb_device *dev; 24 struct ssb_device *dev;
@@ -20,9 +26,7 @@ struct ssb_mipscore {
20 int nr_serial_ports; 26 int nr_serial_ports;
21 struct ssb_serial_port serial_ports[4]; 27 struct ssb_serial_port serial_ports[4];
22 28
23 u8 flash_buswidth; 29 struct ssb_pflash pflash;
24 u32 flash_window;
25 u32 flash_window_size;
26}; 30};
27 31
28extern void ssb_mipscore_init(struct ssb_mipscore *mcore); 32extern void ssb_mipscore_init(struct ssb_mipscore *mcore);
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index a0525019e1d1..6ecfa02ddbac 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -485,7 +485,7 @@
485#define SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP_SHIFT 4 485#define SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP_SHIFT 4
486#define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL 0x0020 486#define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL 0x0020
487#define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL_SHIFT 5 487#define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL_SHIFT 5
488#define SSB_SPROM8_TEMPDELTA 0x00BA 488#define SSB_SPROM8_TEMPDELTA 0x00BC
489#define SSB_SPROM8_TEMPDELTA_PHYCAL 0x00ff 489#define SSB_SPROM8_TEMPDELTA_PHYCAL 0x00ff
490#define SSB_SPROM8_TEMPDELTA_PHYCAL_SHIFT 0 490#define SSB_SPROM8_TEMPDELTA_PHYCAL_SHIFT 0
491#define SSB_SPROM8_TEMPDELTA_PERIOD 0x0f00 491#define SSB_SPROM8_TEMPDELTA_PERIOD 0x0f00
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index a1547ea3920d..c1b3ed3fb787 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -61,7 +61,7 @@
61#define STMMAC_CSR_I_16 0xE /* clk_csr_i/16 */ 61#define STMMAC_CSR_I_16 0xE /* clk_csr_i/16 */
62#define STMMAC_CSR_I_18 0xF /* clk_csr_i/18 */ 62#define STMMAC_CSR_I_18 0xF /* clk_csr_i/18 */
63 63
64/* AXI DMA Burst length suported */ 64/* AXI DMA Burst length supported */
65#define DMA_AXI_BLEN_4 (1 << 1) 65#define DMA_AXI_BLEN_4 (1 << 1)
66#define DMA_AXI_BLEN_8 (1 << 2) 66#define DMA_AXI_BLEN_8 (1 << 2)
67#define DMA_AXI_BLEN_16 (1 << 3) 67#define DMA_AXI_BLEN_16 (1 << 3)
@@ -104,6 +104,7 @@ struct plat_stmmacenet_data {
104 int bugged_jumbo; 104 int bugged_jumbo;
105 int pmt; 105 int pmt;
106 int force_sf_dma_mode; 106 int force_sf_dma_mode;
107 int riwt_off;
107 void (*fix_mac_speed)(void *priv, unsigned int speed); 108 void (*fix_mac_speed)(void *priv, unsigned int speed);
108 void (*bus_setup)(void __iomem *ioaddr); 109 void (*bus_setup)(void __iomem *ioaddr);
109 int (*init)(struct platform_device *pdev); 110 int (*init)(struct platform_device *pdev);
diff --git a/include/linux/sunxi_timer.h b/include/linux/sunxi_timer.h
new file mode 100644
index 000000000000..b9165bba6e61
--- /dev/null
+++ b/include/linux/sunxi_timer.h
@@ -0,0 +1,24 @@
1/*
2 * Copyright 2012 Maxime Ripard
3 *
4 * Maxime Ripard <maxime.ripard@free-electrons.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 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#ifndef __SUNXI_TIMER_H
18#define __SUNXI_TIMER_H
19
20#include <asm/mach/time.h>
21
22extern struct sys_timer sunxi_timer;
23
24#endif
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 727f0cd73921..91835e7f364d 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -833,10 +833,22 @@ int kernel_execve(const char *filename, const char *const argv[], const char *co
833#define kernel_execve(filename, argv, envp) \ 833#define kernel_execve(filename, argv, envp) \
834 do_execve(filename, \ 834 do_execve(filename, \
835 (const char __user *const __user *)argv, \ 835 (const char __user *const __user *)argv, \
836 (const char __user *const __user *)envp, \ 836 (const char __user *const __user *)envp)
837 current_pt_regs())
838#endif 837#endif
839 838
839asmlinkage long sys_fork(void);
840asmlinkage long sys_vfork(void);
841#ifdef CONFIG_CLONE_BACKWARDS
842asmlinkage long sys_clone(unsigned long, unsigned long, int __user *, int,
843 int __user *);
844#else
845asmlinkage long sys_clone(unsigned long, unsigned long, int __user *,
846 int __user *, int);
847#endif
848
849asmlinkage long sys_execve(const char __user *filename,
850 const char __user *const __user *argv,
851 const char __user *const __user *envp);
840 852
841asmlinkage long sys_perf_event_open( 853asmlinkage long sys_perf_event_open(
842 struct perf_event_attr __user *attr_uptr, 854 struct perf_event_attr __user *attr_uptr,
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index cd844a6a8d5f..14a8ff2de11e 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -158,8 +158,7 @@ struct ctl_table_root {
158 struct ctl_table_set default_set; 158 struct ctl_table_set default_set;
159 struct ctl_table_set *(*lookup)(struct ctl_table_root *root, 159 struct ctl_table_set *(*lookup)(struct ctl_table_root *root,
160 struct nsproxy *namespaces); 160 struct nsproxy *namespaces);
161 int (*permissions)(struct ctl_table_root *root, 161 int (*permissions)(struct ctl_table_header *head, struct ctl_table *table);
162 struct nsproxy *namespaces, struct ctl_table *table);
163}; 162};
164 163
165/* struct ctl_path describes where in the hierarchy a table is added */ 164/* struct ctl_path describes where in the hierarchy a table is added */
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 60b7aac15e0e..4e1d2283e3cc 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -35,6 +35,16 @@ static inline unsigned int tcp_hdrlen(const struct sk_buff *skb)
35 return tcp_hdr(skb)->doff * 4; 35 return tcp_hdr(skb)->doff * 4;
36} 36}
37 37
38static inline struct tcphdr *inner_tcp_hdr(const struct sk_buff *skb)
39{
40 return (struct tcphdr *)skb_inner_transport_header(skb);
41}
42
43static inline unsigned int inner_tcp_hdrlen(const struct sk_buff *skb)
44{
45 return inner_tcp_hdr(skb)->doff * 4;
46}
47
38static inline unsigned int tcp_optlen(const struct sk_buff *skb) 48static inline unsigned int tcp_optlen(const struct sk_buff *skb)
39{ 49{
40 return (tcp_hdr(skb)->doff - 5) * 4; 50 return (tcp_hdr(skb)->doff - 5) * 4;
diff --git a/include/linux/tegra-ahb.h b/include/linux/tegra-ahb.h
new file mode 100644
index 000000000000..f1cd075ceee1
--- /dev/null
+++ b/include/linux/tegra-ahb.h
@@ -0,0 +1,19 @@
1/*
2 * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 */
13
14#ifndef __LINUX_AHB_H__
15#define __LINUX_AHB_H__
16
17extern int tegra_ahb_enable_smmu(struct device_node *ahb);
18
19#endif /* __LINUX_AHB_H__ */
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 91b34812cd84..fe82022478e7 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -29,6 +29,32 @@
29#include <linux/device.h> 29#include <linux/device.h>
30#include <linux/workqueue.h> 30#include <linux/workqueue.h>
31 31
32#define THERMAL_TRIPS_NONE -1
33#define THERMAL_MAX_TRIPS 12
34#define THERMAL_NAME_LENGTH 20
35
36/* No upper/lower limit requirement */
37#define THERMAL_NO_LIMIT -1UL
38
39/* Unit conversion macros */
40#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \
41 ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
42#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
43
44/* Adding event notification support elements */
45#define THERMAL_GENL_FAMILY_NAME "thermal_event"
46#define THERMAL_GENL_VERSION 0x01
47#define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group"
48
49/* Default Thermal Governor */
50#if defined(CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE)
51#define DEFAULT_THERMAL_GOVERNOR "step_wise"
52#elif defined(CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE)
53#define DEFAULT_THERMAL_GOVERNOR "fair_share"
54#elif defined(CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE)
55#define DEFAULT_THERMAL_GOVERNOR "user_space"
56#endif
57
32struct thermal_zone_device; 58struct thermal_zone_device;
33struct thermal_cooling_device; 59struct thermal_cooling_device;
34 60
@@ -50,6 +76,30 @@ enum thermal_trend {
50 THERMAL_TREND_DROPPING, /* temperature is dropping */ 76 THERMAL_TREND_DROPPING, /* temperature is dropping */
51}; 77};
52 78
79/* Events supported by Thermal Netlink */
80enum events {
81 THERMAL_AUX0,
82 THERMAL_AUX1,
83 THERMAL_CRITICAL,
84 THERMAL_DEV_FAULT,
85};
86
87/* attributes of thermal_genl_family */
88enum {
89 THERMAL_GENL_ATTR_UNSPEC,
90 THERMAL_GENL_ATTR_EVENT,
91 __THERMAL_GENL_ATTR_MAX,
92};
93#define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)
94
95/* commands supported by the thermal_genl_family */
96enum {
97 THERMAL_GENL_CMD_UNSPEC,
98 THERMAL_GENL_CMD_EVENT,
99 __THERMAL_GENL_CMD_MAX,
100};
101#define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)
102
53struct thermal_zone_device_ops { 103struct thermal_zone_device_ops {
54 int (*bind) (struct thermal_zone_device *, 104 int (*bind) (struct thermal_zone_device *,
55 struct thermal_cooling_device *); 105 struct thermal_cooling_device *);
@@ -83,11 +133,6 @@ struct thermal_cooling_device_ops {
83 int (*set_cur_state) (struct thermal_cooling_device *, unsigned long); 133 int (*set_cur_state) (struct thermal_cooling_device *, unsigned long);
84}; 134};
85 135
86#define THERMAL_NO_LIMIT -1UL /* no upper/lower limit requirement */
87
88#define THERMAL_TRIPS_NONE -1
89#define THERMAL_MAX_TRIPS 12
90#define THERMAL_NAME_LENGTH 20
91struct thermal_cooling_device { 136struct thermal_cooling_device {
92 int id; 137 int id;
93 char type[THERMAL_NAME_LENGTH]; 138 char type[THERMAL_NAME_LENGTH];
@@ -100,10 +145,6 @@ struct thermal_cooling_device {
100 struct list_head node; 145 struct list_head node;
101}; 146};
102 147
103#define KELVIN_TO_CELSIUS(t) (long)(((long)t-2732 >= 0) ? \
104 ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
105#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
106
107struct thermal_attr { 148struct thermal_attr {
108 struct device_attribute attr; 149 struct device_attribute attr;
109 char name[THERMAL_NAME_LENGTH]; 150 char name[THERMAL_NAME_LENGTH];
@@ -125,46 +166,61 @@ struct thermal_zone_device {
125 int passive; 166 int passive;
126 unsigned int forced_passive; 167 unsigned int forced_passive;
127 const struct thermal_zone_device_ops *ops; 168 const struct thermal_zone_device_ops *ops;
169 const struct thermal_zone_params *tzp;
170 struct thermal_governor *governor;
128 struct list_head thermal_instances; 171 struct list_head thermal_instances;
129 struct idr idr; 172 struct idr idr;
130 struct mutex lock; /* protect thermal_instances list */ 173 struct mutex lock; /* protect thermal_instances list */
131 struct list_head node; 174 struct list_head node;
132 struct delayed_work poll_queue; 175 struct delayed_work poll_queue;
133}; 176};
134/* Adding event notification support elements */
135#define THERMAL_GENL_FAMILY_NAME "thermal_event"
136#define THERMAL_GENL_VERSION 0x01
137#define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group"
138 177
139enum events { 178/* Structure that holds thermal governor information */
140 THERMAL_AUX0, 179struct thermal_governor {
141 THERMAL_AUX1, 180 char name[THERMAL_NAME_LENGTH];
142 THERMAL_CRITICAL, 181 int (*throttle)(struct thermal_zone_device *tz, int trip);
143 THERMAL_DEV_FAULT, 182 struct list_head governor_list;
183 struct module *owner;
144}; 184};
145 185
146struct thermal_genl_event { 186/* Structure that holds binding parameters for a zone */
147 u32 orig; 187struct thermal_bind_params {
148 enum events event; 188 struct thermal_cooling_device *cdev;
189
190 /*
191 * This is a measure of 'how effectively these devices can
192 * cool 'this' thermal zone. The shall be determined by platform
193 * characterization. This is on a 'percentage' scale.
194 * See Documentation/thermal/sysfs-api.txt for more information.
195 */
196 int weight;
197
198 /*
199 * This is a bit mask that gives the binding relation between this
200 * thermal zone and cdev, for a particular trip point.
201 * See Documentation/thermal/sysfs-api.txt for more information.
202 */
203 int trip_mask;
204 int (*match) (struct thermal_zone_device *tz,
205 struct thermal_cooling_device *cdev);
149}; 206};
150/* attributes of thermal_genl_family */ 207
151enum { 208/* Structure to define Thermal Zone parameters */
152 THERMAL_GENL_ATTR_UNSPEC, 209struct thermal_zone_params {
153 THERMAL_GENL_ATTR_EVENT, 210 char governor_name[THERMAL_NAME_LENGTH];
154 __THERMAL_GENL_ATTR_MAX, 211 int num_tbps; /* Number of tbp entries */
212 struct thermal_bind_params *tbp;
155}; 213};
156#define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1)
157 214
158/* commands supported by the thermal_genl_family */ 215struct thermal_genl_event {
159enum { 216 u32 orig;
160 THERMAL_GENL_CMD_UNSPEC, 217 enum events event;
161 THERMAL_GENL_CMD_EVENT,
162 __THERMAL_GENL_CMD_MAX,
163}; 218};
164#define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1)
165 219
220/* Function declarations */
166struct thermal_zone_device *thermal_zone_device_register(const char *, int, int, 221struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
167 void *, const struct thermal_zone_device_ops *, int, int); 222 void *, const struct thermal_zone_device_ops *,
223 const struct thermal_zone_params *, int, int);
168void thermal_zone_device_unregister(struct thermal_zone_device *); 224void thermal_zone_device_unregister(struct thermal_zone_device *);
169 225
170int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, 226int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
@@ -173,10 +229,20 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
173int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, 229int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
174 struct thermal_cooling_device *); 230 struct thermal_cooling_device *);
175void thermal_zone_device_update(struct thermal_zone_device *); 231void thermal_zone_device_update(struct thermal_zone_device *);
232
176struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, 233struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
177 const struct thermal_cooling_device_ops *); 234 const struct thermal_cooling_device_ops *);
178void thermal_cooling_device_unregister(struct thermal_cooling_device *); 235void thermal_cooling_device_unregister(struct thermal_cooling_device *);
179 236
237int get_tz_trend(struct thermal_zone_device *, int);
238struct thermal_instance *get_thermal_instance(struct thermal_zone_device *,
239 struct thermal_cooling_device *, int);
240void thermal_cdev_update(struct thermal_cooling_device *);
241void notify_thermal_framework(struct thermal_zone_device *, int);
242
243int thermal_register_governor(struct thermal_governor *);
244void thermal_unregister_governor(struct thermal_governor *);
245
180#ifdef CONFIG_NET 246#ifdef CONFIG_NET
181extern int thermal_generate_netlink_event(u32 orig, enum events event); 247extern int thermal_generate_netlink_event(u32 orig, enum events event);
182#else 248#else
diff --git a/include/linux/tick.h b/include/linux/tick.h
index f37fceb69b73..1a6567b48492 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -142,4 +142,10 @@ static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; }
142static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } 142static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; }
143# endif /* !NO_HZ */ 143# endif /* !NO_HZ */
144 144
145# ifdef CONFIG_CPU_IDLE_GOV_MENU
146extern void menu_hrtimer_cancel(void);
147# else
148static inline void menu_hrtimer_cancel(void) {}
149# endif /* CONFIG_CPU_IDLE_GOV_MENU */
150
145#endif 151#endif
diff --git a/include/linux/timecompare.h b/include/linux/timecompare.h
deleted file mode 100644
index 546e2234e4b3..000000000000
--- a/include/linux/timecompare.h
+++ /dev/null
@@ -1,125 +0,0 @@
1/*
2 * Utility code which helps transforming between two different time
3 * bases, called "source" and "target" time in this code.
4 *
5 * Source time has to be provided via the timecounter API while target
6 * time is accessed via a function callback whose prototype
7 * intentionally matches ktime_get() and ktime_get_real(). These
8 * interfaces where chosen like this so that the code serves its
9 * initial purpose without additional glue code.
10 *
11 * This purpose is synchronizing a hardware clock in a NIC with system
12 * time, in order to implement the Precision Time Protocol (PTP,
13 * IEEE1588) with more accurate hardware assisted time stamping. In
14 * that context only synchronization against system time (=
15 * ktime_get_real()) is currently needed. But this utility code might
16 * become useful in other situations, which is why it was written as
17 * general purpose utility code.
18 *
19 * The source timecounter is assumed to return monotonically
20 * increasing time (but this code does its best to compensate if that
21 * is not the case) whereas target time may jump.
22 *
23 * The target time corresponding to a source time is determined by
24 * reading target time, reading source time, reading target time
25 * again, then assuming that average target time corresponds to source
26 * time. In other words, the assumption is that reading the source
27 * time is slow and involves equal time for sending the request and
28 * receiving the reply, whereas reading target time is assumed to be
29 * fast.
30 *
31 * Copyright (C) 2009 Intel Corporation.
32 * Author: Patrick Ohly <patrick.ohly@intel.com>
33 *
34 * This program is free software; you can redistribute it and/or modify it
35 * under the terms and conditions of the GNU General Public License,
36 * version 2, as published by the Free Software Foundation.
37 *
38 * This program is distributed in the hope it will be useful, but WITHOUT
39 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
40 * FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for
41 * more details.
42 *
43 * You should have received a copy of the GNU General Public License along with
44 * this program; if not, write to the Free Software Foundation, Inc.,
45 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
46 */
47#ifndef _LINUX_TIMECOMPARE_H
48#define _LINUX_TIMECOMPARE_H
49
50#include <linux/clocksource.h>
51#include <linux/ktime.h>
52
53/**
54 * struct timecompare - stores state and configuration for the two clocks
55 *
56 * Initialize to zero, then set source/target/num_samples.
57 *
58 * Transformation between source time and target time is done with:
59 * target_time = source_time + offset +
60 * (source_time - last_update) * skew /
61 * TIMECOMPARE_SKEW_RESOLUTION
62 *
63 * @source: used to get source time stamps via timecounter_read()
64 * @target: function returning target time (for example, ktime_get
65 * for monotonic time, or ktime_get_real for wall clock)
66 * @num_samples: number of times that source time and target time are to
67 * be compared when determining their offset
68 * @offset: (target time - source time) at the time of the last update
69 * @skew: average (target time - source time) / delta source time *
70 * TIMECOMPARE_SKEW_RESOLUTION
71 * @last_update: last source time stamp when time offset was measured
72 */
73struct timecompare {
74 struct timecounter *source;
75 ktime_t (*target)(void);
76 int num_samples;
77
78 s64 offset;
79 s64 skew;
80 u64 last_update;
81};
82
83/**
84 * timecompare_transform - transform source time stamp into target time base
85 * @sync: context for time sync
86 * @source_tstamp: the result of timecounter_read() or
87 * timecounter_cyc2time()
88 */
89extern ktime_t timecompare_transform(struct timecompare *sync,
90 u64 source_tstamp);
91
92/**
93 * timecompare_offset - measure current (target time - source time) offset
94 * @sync: context for time sync
95 * @offset: average offset during sample period returned here
96 * @source_tstamp: average source time during sample period returned here
97 *
98 * Returns number of samples used. Might be zero (= no result) in the
99 * unlikely case that target time was monotonically decreasing for all
100 * samples (= broken).
101 */
102extern int timecompare_offset(struct timecompare *sync,
103 s64 *offset,
104 u64 *source_tstamp);
105
106extern void __timecompare_update(struct timecompare *sync,
107 u64 source_tstamp);
108
109/**
110 * timecompare_update - update offset and skew by measuring current offset
111 * @sync: context for time sync
112 * @source_tstamp: the result of timecounter_read() or
113 * timecounter_cyc2time(), pass zero to force update
114 *
115 * Updates are only done at most once per second.
116 */
117static inline void timecompare_update(struct timecompare *sync,
118 u64 source_tstamp)
119{
120 if (!source_tstamp ||
121 (s64)(source_tstamp - sync->last_update) >= NSEC_PER_SEC)
122 __timecompare_update(sync, source_tstamp);
123}
124
125#endif /* _LINUX_TIMECOMPARE_H */
diff --git a/include/linux/trace_clock.h b/include/linux/trace_clock.h
index 4eb490237d4c..d563f37e1a1d 100644
--- a/include/linux/trace_clock.h
+++ b/include/linux/trace_clock.h
@@ -12,6 +12,8 @@
12#include <linux/compiler.h> 12#include <linux/compiler.h>
13#include <linux/types.h> 13#include <linux/types.h>
14 14
15#include <asm/trace_clock.h>
16
15extern u64 notrace trace_clock_local(void); 17extern u64 notrace trace_clock_local(void);
16extern u64 notrace trace_clock(void); 18extern u64 notrace trace_clock(void);
17extern u64 notrace trace_clock_global(void); 19extern u64 notrace trace_clock_global(void);
diff --git a/include/linux/tty.h b/include/linux/tty.h
index f0b4eb47297c..8db1b569c37a 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -188,7 +188,9 @@ struct tty_port_operations {
188}; 188};
189 189
190struct tty_port { 190struct tty_port {
191 struct tty_bufhead buf; /* Locked internally */
191 struct tty_struct *tty; /* Back pointer */ 192 struct tty_struct *tty; /* Back pointer */
193 struct tty_struct *itty; /* internal back ptr */
192 const struct tty_port_operations *ops; /* Port operations */ 194 const struct tty_port_operations *ops; /* Port operations */
193 spinlock_t lock; /* Lock protecting tty field */ 195 spinlock_t lock; /* Lock protecting tty field */
194 int blocked_open; /* Waiting to open */ 196 int blocked_open; /* Waiting to open */
@@ -197,6 +199,9 @@ struct tty_port {
197 wait_queue_head_t close_wait; /* Close waiters */ 199 wait_queue_head_t close_wait; /* Close waiters */
198 wait_queue_head_t delta_msr_wait; /* Modem status change */ 200 wait_queue_head_t delta_msr_wait; /* Modem status change */
199 unsigned long flags; /* TTY flags ASY_*/ 201 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 */
200 unsigned char console:1; /* port is a console */ 205 unsigned char console:1; /* port is a console */
201 struct mutex mutex; /* Locking */ 206 struct mutex mutex; /* Locking */
202 struct mutex buf_mutex; /* Buffer alloc lock */ 207 struct mutex buf_mutex; /* Buffer alloc lock */
@@ -235,6 +240,7 @@ struct tty_struct {
235 struct mutex ldisc_mutex; 240 struct mutex ldisc_mutex;
236 struct tty_ldisc *ldisc; 241 struct tty_ldisc *ldisc;
237 242
243 struct mutex atomic_write_lock;
238 struct mutex legacy_mutex; 244 struct mutex legacy_mutex;
239 struct mutex termios_mutex; 245 struct mutex termios_mutex;
240 spinlock_t ctrl_lock; 246 spinlock_t ctrl_lock;
@@ -254,7 +260,6 @@ struct tty_struct {
254 260
255 struct tty_struct *link; 261 struct tty_struct *link;
256 struct fasync_struct *fasync; 262 struct fasync_struct *fasync;
257 struct tty_bufhead buf; /* Locked internally */
258 int alt_speed; /* For magic substitution of 38400 bps */ 263 int alt_speed; /* For magic substitution of 38400 bps */
259 wait_queue_head_t write_wait; 264 wait_queue_head_t write_wait;
260 wait_queue_head_t read_wait; 265 wait_queue_head_t read_wait;
@@ -265,37 +270,10 @@ struct tty_struct {
265 270
266#define N_TTY_BUF_SIZE 4096 271#define N_TTY_BUF_SIZE 4096
267 272
268 /*
269 * The following is data for the N_TTY line discipline. For
270 * historical reasons, this is included in the tty structure.
271 * Mostly locked by the BKL.
272 */
273 unsigned int column;
274 unsigned char lnext:1, erasing:1, raw:1, real_raw:1, icanon:1;
275 unsigned char closing:1; 273 unsigned char closing:1;
276 unsigned char echo_overrun:1;
277 unsigned short minimum_to_wake; 274 unsigned short minimum_to_wake;
278 unsigned long overrun_time;
279 int num_overrun;
280 unsigned long process_char_map[256/(8*sizeof(unsigned long))];
281 char *read_buf;
282 int read_head;
283 int read_tail;
284 int read_cnt;
285 unsigned long read_flags[N_TTY_BUF_SIZE/(8*sizeof(unsigned long))];
286 unsigned char *echo_buf;
287 unsigned int echo_pos;
288 unsigned int echo_cnt;
289 int canon_data;
290 unsigned long canon_head;
291 unsigned int canon_column;
292 struct mutex atomic_read_lock;
293 struct mutex atomic_write_lock;
294 struct mutex output_lock;
295 struct mutex echo_lock;
296 unsigned char *write_buf; 275 unsigned char *write_buf;
297 int write_cnt; 276 int write_cnt;
298 spinlock_t read_lock;
299 /* If the tty has a pending do_SAK, queue it here - akpm */ 277 /* If the tty has a pending do_SAK, queue it here - akpm */
300 struct work_struct SAK_work; 278 struct work_struct SAK_work;
301 struct tty_port *port; 279 struct tty_port *port;
@@ -335,8 +313,6 @@ struct tty_file_private {
335#define TTY_PTY_LOCK 16 /* pty private */ 313#define TTY_PTY_LOCK 16 /* pty private */
336#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */ 314#define TTY_NO_WRITE_SPLIT 17 /* Preserve write boundaries to driver */
337#define TTY_HUPPED 18 /* Post driver->hangup() */ 315#define TTY_HUPPED 18 /* Post driver->hangup() */
338#define TTY_FLUSHING 19 /* Flushing to ldisc in progress */
339#define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */
340#define TTY_HUPPING 21 /* ->hangup() in progress */ 316#define TTY_HUPPING 21 /* ->hangup() in progress */
341 317
342#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) 318#define TTY_WRITE_FLUSH(tty) tty_write_flush((tty))
@@ -412,9 +388,9 @@ extern void disassociate_ctty(int priv);
412extern void no_tty(void); 388extern void no_tty(void);
413extern void tty_flip_buffer_push(struct tty_struct *tty); 389extern void tty_flip_buffer_push(struct tty_struct *tty);
414extern void tty_flush_to_ldisc(struct tty_struct *tty); 390extern void tty_flush_to_ldisc(struct tty_struct *tty);
415extern void tty_buffer_free_all(struct tty_struct *tty); 391extern void tty_buffer_free_all(struct tty_port *port);
416extern void tty_buffer_flush(struct tty_struct *tty); 392extern void tty_buffer_flush(struct tty_struct *tty);
417extern void tty_buffer_init(struct tty_struct *tty); 393extern void tty_buffer_init(struct tty_port *port);
418extern speed_t tty_get_baud_rate(struct tty_struct *tty); 394extern speed_t tty_get_baud_rate(struct tty_struct *tty);
419extern speed_t tty_termios_baud_rate(struct ktermios *termios); 395extern speed_t tty_termios_baud_rate(struct ktermios *termios);
420extern speed_t tty_termios_input_baud_rate(struct ktermios *termios); 396extern speed_t tty_termios_input_baud_rate(struct ktermios *termios);
@@ -479,6 +455,7 @@ extern struct device *tty_port_register_device_attr(struct tty_port *port,
479 const struct attribute_group **attr_grp); 455 const struct attribute_group **attr_grp);
480extern int tty_port_alloc_xmit_buf(struct tty_port *port); 456extern int tty_port_alloc_xmit_buf(struct tty_port *port);
481extern void tty_port_free_xmit_buf(struct tty_port *port); 457extern void tty_port_free_xmit_buf(struct tty_port *port);
458extern void tty_port_destroy(struct tty_port *port);
482extern void tty_port_put(struct tty_port *port); 459extern void tty_port_put(struct tty_port *port);
483 460
484static inline struct tty_port *tty_port_get(struct tty_port *port) 461static inline struct tty_port *tty_port_get(struct tty_port *port)
@@ -535,7 +512,7 @@ extern void n_tty_inherit_ops(struct tty_ldisc_ops *ops);
535/* tty_audit.c */ 512/* tty_audit.c */
536#ifdef CONFIG_AUDIT 513#ifdef CONFIG_AUDIT
537extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data, 514extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
538 size_t size); 515 size_t size, unsigned icanon);
539extern void tty_audit_exit(void); 516extern void tty_audit_exit(void);
540extern void tty_audit_fork(struct signal_struct *sig); 517extern void tty_audit_fork(struct signal_struct *sig);
541extern void tty_audit_tiocsti(struct tty_struct *tty, char ch); 518extern void tty_audit_tiocsti(struct tty_struct *tty, char ch);
@@ -544,7 +521,7 @@ extern int tty_audit_push_task(struct task_struct *tsk,
544 kuid_t loginuid, u32 sessionid); 521 kuid_t loginuid, u32 sessionid);
545#else 522#else
546static inline void tty_audit_add_data(struct tty_struct *tty, 523static inline void tty_audit_add_data(struct tty_struct *tty,
547 unsigned char *data, size_t size) 524 unsigned char *data, size_t size, unsigned icanon)
548{ 525{
549} 526}
550static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch) 527static inline void tty_audit_tiocsti(struct tty_struct *tty, char ch)
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index 9239d033a0a3..2002344ed36a 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -11,7 +11,7 @@ void tty_schedule_flip(struct tty_struct *tty);
11static inline int tty_insert_flip_char(struct tty_struct *tty, 11static inline int tty_insert_flip_char(struct tty_struct *tty,
12 unsigned char ch, char flag) 12 unsigned char ch, char flag)
13{ 13{
14 struct tty_buffer *tb = tty->buf.tail; 14 struct tty_buffer *tb = tty->port->buf.tail;
15 if (tb && tb->used < tb->size) { 15 if (tb && tb->used < tb->size) {
16 tb->flag_buf_ptr[tb->used] = flag; 16 tb->flag_buf_ptr[tb->used] = flag;
17 tb->char_buf_ptr[tb->used++] = ch; 17 tb->char_buf_ptr[tb->used++] = ch;
diff --git a/include/linux/types.h b/include/linux/types.h
index 1cc0e4b9a048..4d118ba11349 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -156,6 +156,7 @@ typedef u32 dma_addr_t;
156#endif 156#endif
157typedef unsigned __bitwise__ gfp_t; 157typedef unsigned __bitwise__ gfp_t;
158typedef unsigned __bitwise__ fmode_t; 158typedef unsigned __bitwise__ fmode_t;
159typedef unsigned __bitwise__ oom_flags_t;
159 160
160#ifdef CONFIG_PHYS_ADDR_T_64BIT 161#ifdef CONFIG_PHYS_ADDR_T_64BIT
161typedef u64 phys_addr_t; 162typedef u64 phys_addr_t;
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 0b67d7793520..9d81de123c90 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -27,6 +27,11 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
27 return (struct udphdr *)skb_transport_header(skb); 27 return (struct udphdr *)skb_transport_header(skb);
28} 28}
29 29
30static inline struct udphdr *inner_udp_hdr(const struct sk_buff *skb)
31{
32 return (struct udphdr *)skb_inner_transport_header(skb);
33}
34
30#define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256) 35#define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256)
31 36
32static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask) 37static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask)
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h
index 24594571c5a3..4f628a6fc5b4 100644
--- a/include/linux/uprobes.h
+++ b/include/linux/uprobes.h
@@ -97,12 +97,12 @@ extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_con
97extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); 97extern void uprobe_unregister(struct inode *inode, loff_t offset, struct uprobe_consumer *uc);
98extern int uprobe_mmap(struct vm_area_struct *vma); 98extern int uprobe_mmap(struct vm_area_struct *vma);
99extern void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end); 99extern void uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end);
100extern void uprobe_start_dup_mmap(void);
101extern void uprobe_end_dup_mmap(void);
100extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm); 102extern void uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm);
101extern void uprobe_free_utask(struct task_struct *t); 103extern void uprobe_free_utask(struct task_struct *t);
102extern void uprobe_copy_process(struct task_struct *t); 104extern void uprobe_copy_process(struct task_struct *t);
103extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); 105extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs);
104extern void __weak arch_uprobe_enable_step(struct arch_uprobe *arch);
105extern void __weak arch_uprobe_disable_step(struct arch_uprobe *arch);
106extern int uprobe_post_sstep_notifier(struct pt_regs *regs); 106extern int uprobe_post_sstep_notifier(struct pt_regs *regs);
107extern int uprobe_pre_sstep_notifier(struct pt_regs *regs); 107extern int uprobe_pre_sstep_notifier(struct pt_regs *regs);
108extern void uprobe_notify_resume(struct pt_regs *regs); 108extern void uprobe_notify_resume(struct pt_regs *regs);
@@ -129,6 +129,12 @@ static inline void
129uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end) 129uprobe_munmap(struct vm_area_struct *vma, unsigned long start, unsigned long end)
130{ 130{
131} 131}
132static inline void uprobe_start_dup_mmap(void)
133{
134}
135static inline void uprobe_end_dup_mmap(void)
136{
137}
132static inline void 138static inline void
133uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm) 139uprobe_dup_mmap(struct mm_struct *oldmm, struct mm_struct *newmm)
134{ 140{
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 10278d18709c..689b14b26c8d 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -482,6 +482,7 @@ struct usb3_lpm_parameters {
482 * @connect_time: time device was first connected 482 * @connect_time: time device was first connected
483 * @do_remote_wakeup: remote wakeup should be enabled 483 * @do_remote_wakeup: remote wakeup should be enabled
484 * @reset_resume: needs reset instead of resume 484 * @reset_resume: needs reset instead of resume
485 * @port_is_suspended: the upstream port is suspended (L2 or U3)
485 * @wusb_dev: if this is a Wireless USB device, link to the WUSB 486 * @wusb_dev: if this is a Wireless USB device, link to the WUSB
486 * specific data for the device. 487 * specific data for the device.
487 * @slot_id: Slot ID assigned by xHCI 488 * @slot_id: Slot ID assigned by xHCI
@@ -560,6 +561,7 @@ struct usb_device {
560 561
561 unsigned do_remote_wakeup:1; 562 unsigned do_remote_wakeup:1;
562 unsigned reset_resume:1; 563 unsigned reset_resume:1;
564 unsigned port_is_suspended:1;
563#endif 565#endif
564 struct wusb_dev *wusb_dev; 566 struct wusb_dev *wusb_dev;
565 int slot_id; 567 int slot_id;
@@ -588,8 +590,9 @@ extern struct usb_device *usb_hub_find_child(struct usb_device *hdev,
588 */ 590 */
589#define usb_hub_for_each_child(hdev, port1, child) \ 591#define usb_hub_for_each_child(hdev, port1, child) \
590 for (port1 = 1, child = usb_hub_find_child(hdev, port1); \ 592 for (port1 = 1, child = usb_hub_find_child(hdev, port1); \
591 port1 <= hdev->maxchild; \ 593 port1 <= hdev->maxchild; \
592 child = usb_hub_find_child(hdev, ++port1)) 594 child = usb_hub_find_child(hdev, ++port1)) \
595 if (!child) continue; else
593 596
594/* USB device locking */ 597/* USB device locking */
595#define usb_lock_device(udev) device_lock(&(udev)->dev) 598#define usb_lock_device(udev) device_lock(&(udev)->dev)
@@ -805,6 +808,22 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size)
805 .bcdDevice_hi = (hi) 808 .bcdDevice_hi = (hi)
806 809
807/** 810/**
811 * USB_DEVICE_INTERFACE_CLASS - describe a usb device with a specific interface class
812 * @vend: the 16 bit USB Vendor ID
813 * @prod: the 16 bit USB Product ID
814 * @cl: bInterfaceClass value
815 *
816 * This macro is used to create a struct usb_device_id that matches a
817 * specific interface class of devices.
818 */
819#define USB_DEVICE_INTERFACE_CLASS(vend, prod, cl) \
820 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
821 USB_DEVICE_ID_MATCH_INT_CLASS, \
822 .idVendor = (vend), \
823 .idProduct = (prod), \
824 .bInterfaceClass = (cl)
825
826/**
808 * USB_DEVICE_INTERFACE_PROTOCOL - describe a usb device with a specific interface protocol 827 * USB_DEVICE_INTERFACE_PROTOCOL - describe a usb device with a specific interface protocol
809 * @vend: the 16 bit USB Vendor ID 828 * @vend: the 16 bit USB Vendor ID
810 * @prod: the 16 bit USB Product ID 829 * @prod: the 16 bit USB Product ID
@@ -1129,8 +1148,8 @@ extern int usb_disabled(void);
1129 * Note: URB_DIR_IN/OUT is automatically set in usb_submit_urb(). 1148 * Note: URB_DIR_IN/OUT is automatically set in usb_submit_urb().
1130 */ 1149 */
1131#define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */ 1150#define URB_SHORT_NOT_OK 0x0001 /* report short reads as errors */
1132#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame 1151#define URB_ISO_ASAP 0x0002 /* iso-only; use the first unexpired
1133 * ignored */ 1152 * slot in the schedule */
1134#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ 1153#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */
1135#define URB_NO_FSBR 0x0020 /* UHCI-specific */ 1154#define URB_NO_FSBR 0x0020 /* UHCI-specific */
1136#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ 1155#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */
@@ -1309,15 +1328,20 @@ typedef void (*usb_complete_t)(struct urb *);
1309 * the transfer interval in the endpoint descriptor is logarithmic. 1328 * the transfer interval in the endpoint descriptor is logarithmic.
1310 * Device drivers must convert that value to linear units themselves.) 1329 * Device drivers must convert that value to linear units themselves.)
1311 * 1330 *
1312 * Isochronous URBs normally use the URB_ISO_ASAP transfer flag, telling 1331 * If an isochronous endpoint queue isn't already running, the host
1313 * the host controller to schedule the transfer as soon as bandwidth 1332 * controller will schedule a new URB to start as soon as bandwidth
1314 * utilization allows, and then set start_frame to reflect the actual frame 1333 * utilization allows. If the queue is running then a new URB will be
1315 * selected during submission. Otherwise drivers must specify the start_frame 1334 * scheduled to start in the first transfer slot following the end of the
1316 * and handle the case where the transfer can't begin then. However, drivers 1335 * preceding URB, if that slot has not already expired. If the slot has
1317 * won't know how bandwidth is currently allocated, and while they can 1336 * expired (which can happen when IRQ delivery is delayed for a long time),
1318 * find the current frame using usb_get_current_frame_number () they can't 1337 * the scheduling behavior depends on the URB_ISO_ASAP flag. If the flag
1319 * know the range for that frame number. (Ranges for frame counter values 1338 * is clear then the URB will be scheduled to start in the expired slot,
1320 * are HC-specific, and can go from 256 to 65536 frames from "now".) 1339 * implying that some of its packets will not be transferred; if the flag
1340 * is set then the URB will be scheduled in the first unexpired slot,
1341 * breaking the queue's synchronization. Upon URB completion, the
1342 * start_frame field will be set to the (micro)frame number in which the
1343 * transfer was scheduled. Ranges for frame counter values are HC-specific
1344 * and can go from as low as 256 to as high as 65536 frames.
1321 * 1345 *
1322 * Isochronous URBs have a different data transfer model, in part because 1346 * Isochronous URBs have a different data transfer model, in part because
1323 * the quality of service is only "best effort". Callers provide specially 1347 * the quality of service is only "best effort". Callers provide specially
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h
new file mode 100644
index 000000000000..3b8f9d4fc3fe
--- /dev/null
+++ b/include/linux/usb/cdc_ncm.h
@@ -0,0 +1,134 @@
1/*
2 * Copyright (C) ST-Ericsson 2010-2012
3 * Contact: Alexey Orishko <alexey.orishko@stericsson.com>
4 * Original author: Hans Petter Selasky <hans.petter.selasky@stericsson.com>
5 *
6 * USB Host Driver for Network Control Model (NCM)
7 * http://www.usb.org/developers/devclass_docs/NCM10.zip
8 *
9 * The NCM encoding, decoding and initialization logic
10 * derives from FreeBSD 8.x. if_cdce.c and if_cdcereg.h
11 *
12 * This software is available to you under a choice of one of two
13 * licenses. You may choose this file to be licensed under the terms
14 * of the GNU General Public License (GPL) Version 2 or the 2-clause
15 * BSD license listed below:
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions
19 * are met:
20 * 1. Redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer.
22 * 2. Redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 */
38
39#define CDC_NCM_COMM_ALTSETTING_NCM 0
40#define CDC_NCM_COMM_ALTSETTING_MBIM 1
41
42#define CDC_NCM_DATA_ALTSETTING_NCM 1
43#define CDC_NCM_DATA_ALTSETTING_MBIM 2
44
45/* CDC NCM subclass 3.2.1 */
46#define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10
47
48/* Maximum NTB length */
49#define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */
50#define CDC_NCM_NTB_MAX_SIZE_RX 32768 /* bytes */
51
52/* Minimum value for MaxDatagramSize, ch. 6.2.9 */
53#define CDC_NCM_MIN_DATAGRAM_SIZE 1514 /* bytes */
54
55/* Minimum value for MaxDatagramSize, ch. 8.1.3 */
56#define CDC_MBIM_MIN_DATAGRAM_SIZE 2048 /* bytes */
57
58#define CDC_NCM_MIN_TX_PKT 512 /* bytes */
59
60/* Default value for MaxDatagramSize */
61#define CDC_NCM_MAX_DATAGRAM_SIZE 8192 /* bytes */
62
63/*
64 * Maximum amount of datagrams in NCM Datagram Pointer Table, not counting
65 * the last NULL entry.
66 */
67#define CDC_NCM_DPT_DATAGRAMS_MAX 40
68
69/* Restart the timer, if amount of datagrams is less than given value */
70#define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3
71#define CDC_NCM_TIMER_PENDING_CNT 2
72#define CDC_NCM_TIMER_INTERVAL (400UL * NSEC_PER_USEC)
73
74/* The following macro defines the minimum header space */
75#define CDC_NCM_MIN_HDR_SIZE \
76 (sizeof(struct usb_cdc_ncm_nth16) + sizeof(struct usb_cdc_ncm_ndp16) + \
77 (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16))
78
79#define CDC_NCM_NDP_SIZE \
80 (sizeof(struct usb_cdc_ncm_ndp16) + \
81 (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16))
82
83#define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \
84 (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE)
85#define cdc_ncm_data_intf_is_mbim(x) ((x)->desc.bInterfaceProtocol == USB_CDC_MBIM_PROTO_NTB)
86
87struct cdc_ncm_ctx {
88 struct usb_cdc_ncm_ntb_parameters ncm_parm;
89 struct hrtimer tx_timer;
90 struct tasklet_struct bh;
91
92 const struct usb_cdc_ncm_desc *func_desc;
93 const struct usb_cdc_mbim_desc *mbim_desc;
94 const struct usb_cdc_header_desc *header_desc;
95 const struct usb_cdc_union_desc *union_desc;
96 const struct usb_cdc_ether_desc *ether_desc;
97
98 struct net_device *netdev;
99 struct usb_device *udev;
100 struct usb_host_endpoint *in_ep;
101 struct usb_host_endpoint *out_ep;
102 struct usb_host_endpoint *status_ep;
103 struct usb_interface *intf;
104 struct usb_interface *control;
105 struct usb_interface *data;
106
107 struct sk_buff *tx_curr_skb;
108 struct sk_buff *tx_rem_skb;
109 __le32 tx_rem_sign;
110
111 spinlock_t mtx;
112 atomic_t stop;
113
114 u32 tx_timer_pending;
115 u32 tx_curr_frame_num;
116 u32 rx_speed;
117 u32 tx_speed;
118 u32 rx_max;
119 u32 tx_max;
120 u32 max_datagram_size;
121 u16 tx_max_datagrams;
122 u16 tx_remainder;
123 u16 tx_modulus;
124 u16 tx_ndp_modulus;
125 u16 tx_seq;
126 u16 rx_seq;
127 u16 connected;
128};
129
130extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting);
131extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf);
132extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign);
133extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in);
134extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset);
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index f8dda0621800..b09c37e04a91 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -38,6 +38,7 @@
38#include <linux/version.h> 38#include <linux/version.h>
39#include <linux/usb/ch9.h> 39#include <linux/usb/ch9.h>
40#include <linux/usb/gadget.h> 40#include <linux/usb/gadget.h>
41#include <linux/log2.h>
41 42
42/* 43/*
43 * USB function drivers should return USB_GADGET_DELAYED_STATUS if they 44 * USB function drivers should return USB_GADGET_DELAYED_STATUS if they
@@ -51,6 +52,7 @@
51/* big enough to hold our biggest descriptor */ 52/* big enough to hold our biggest descriptor */
52#define USB_COMP_EP0_BUFSIZ 1024 53#define USB_COMP_EP0_BUFSIZ 1024
53 54
55#define USB_MS_TO_HS_INTERVAL(x) (ilog2((x * 1000 / 125)) + 1)
54struct usb_configuration; 56struct usb_configuration;
55 57
56/** 58/**
@@ -117,7 +119,7 @@ struct usb_configuration;
117struct usb_function { 119struct usb_function {
118 const char *name; 120 const char *name;
119 struct usb_gadget_strings **strings; 121 struct usb_gadget_strings **strings;
120 struct usb_descriptor_header **descriptors; 122 struct usb_descriptor_header **fs_descriptors;
121 struct usb_descriptor_header **hs_descriptors; 123 struct usb_descriptor_header **hs_descriptors;
122 struct usb_descriptor_header **ss_descriptors; 124 struct usb_descriptor_header **ss_descriptors;
123 125
diff --git a/include/linux/usb/ehci_pdriver.h b/include/linux/usb/ehci_pdriver.h
index c9d09f8b7ff2..99238b096f7e 100644
--- a/include/linux/usb/ehci_pdriver.h
+++ b/include/linux/usb/ehci_pdriver.h
@@ -29,6 +29,8 @@
29 * initialization. 29 * initialization.
30 * @port_power_off: set to 1 if the controller needs to be powered down 30 * @port_power_off: set to 1 if the controller needs to be powered down
31 * after initialization. 31 * after initialization.
32 * @no_io_watchdog: set to 1 if the controller does not need the I/O
33 * watchdog to run.
32 * 34 *
33 * These are general configuration options for the EHCI controller. All of 35 * These are general configuration options for the EHCI controller. All of
34 * these options are activating more or less workarounds for some hardware. 36 * these options are activating more or less workarounds for some hardware.
@@ -39,8 +41,7 @@ struct usb_ehci_pdata {
39 unsigned has_synopsys_hc_bug:1; 41 unsigned has_synopsys_hc_bug:1;
40 unsigned big_endian_desc:1; 42 unsigned big_endian_desc:1;
41 unsigned big_endian_mmio:1; 43 unsigned big_endian_mmio:1;
42 unsigned port_power_on:1; 44 unsigned no_io_watchdog:1;
43 unsigned port_power_off:1;
44 45
45 /* Turn on all power and clocks */ 46 /* Turn on all power and clocks */
46 int (*power_on)(struct platform_device *pdev); 47 int (*power_on)(struct platform_device *pdev);
diff --git a/include/linux/usb/ezusb.h b/include/linux/usb/ezusb.h
index fc618d8d1e92..639ee45779fb 100644
--- a/include/linux/usb/ezusb.h
+++ b/include/linux/usb/ezusb.h
@@ -1,16 +1,8 @@
1#ifndef __EZUSB_H 1#ifndef __EZUSB_H
2#define __EZUSB_H 2#define __EZUSB_H
3 3
4
5extern int ezusb_writememory(struct usb_device *dev, int address,
6 unsigned char *data, int length, __u8 bRequest);
7
8extern int ezusb_fx1_set_reset(struct usb_device *dev, unsigned char reset_bit); 4extern int ezusb_fx1_set_reset(struct usb_device *dev, unsigned char reset_bit);
9extern int ezusb_fx2_set_reset(struct usb_device *dev, unsigned char reset_bit);
10
11extern int ezusb_fx1_ihex_firmware_download(struct usb_device *dev, 5extern int ezusb_fx1_ihex_firmware_download(struct usb_device *dev,
12 const char *firmware_path); 6 const char *firmware_path);
13extern int ezusb_fx2_ihex_firmware_download(struct usb_device *dev,
14 const char *firmware_path);
15 7
16#endif /* __EZUSB_H */ 8#endif /* __EZUSB_H */
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 5b6e50888248..0af6569b8cc6 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -939,6 +939,13 @@ static inline void usb_free_descriptors(struct usb_descriptor_header **v)
939 kfree(v); 939 kfree(v);
940} 940}
941 941
942struct usb_function;
943int usb_assign_descriptors(struct usb_function *f,
944 struct usb_descriptor_header **fs,
945 struct usb_descriptor_header **hs,
946 struct usb_descriptor_header **ss);
947void usb_free_all_descriptors(struct usb_function *f);
948
942/*-------------------------------------------------------------------------*/ 949/*-------------------------------------------------------------------------*/
943 950
944/* utility to simplify map/unmap of usb_requests to/from DMA */ 951/* utility to simplify map/unmap of usb_requests to/from DMA */
diff --git a/include/linux/usb/ohci_pdriver.h b/include/linux/usb/ohci_pdriver.h
index 74e7755168b7..012f2b7eb2b6 100644
--- a/include/linux/usb/ohci_pdriver.h
+++ b/include/linux/usb/ohci_pdriver.h
@@ -25,6 +25,7 @@
25 * @big_endian_desc: BE descriptors 25 * @big_endian_desc: BE descriptors
26 * @big_endian_mmio: BE registers 26 * @big_endian_mmio: BE registers
27 * @no_big_frame_no: no big endian frame_no shift 27 * @no_big_frame_no: no big endian frame_no shift
28 * @num_ports: number of ports
28 * 29 *
29 * These are general configuration options for the OHCI controller. All of 30 * These are general configuration options for the OHCI controller. All of
30 * these options are activating more or less workarounds for some hardware. 31 * these options are activating more or less workarounds for some hardware.
@@ -33,6 +34,7 @@ struct usb_ohci_pdata {
33 unsigned big_endian_desc:1; 34 unsigned big_endian_desc:1;
34 unsigned big_endian_mmio:1; 35 unsigned big_endian_mmio:1;
35 unsigned no_big_frame_no:1; 36 unsigned no_big_frame_no:1;
37 unsigned int num_ports;
36 38
37 /* Turn on all power and clocks */ 39 /* Turn on all power and clocks */
38 int (*power_on)(struct platform_device *pdev); 40 int (*power_on)(struct platform_device *pdev);
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.h
index 06b5bae35b29..a29ae1eb9346 100644
--- a/include/linux/usb/phy.h
+++ b/include/linux/usb/phy.h
@@ -10,6 +10,7 @@
10#define __LINUX_USB_PHY_H 10#define __LINUX_USB_PHY_H
11 11
12#include <linux/notifier.h> 12#include <linux/notifier.h>
13#include <linux/usb.h>
13 14
14enum usb_phy_events { 15enum usb_phy_events {
15 USB_EVENT_NONE, /* no events or cable disconnected */ 16 USB_EVENT_NONE, /* no events or cable disconnected */
@@ -99,8 +100,10 @@ struct usb_phy {
99 int suspend); 100 int suspend);
100 101
101 /* notify phy connect status change */ 102 /* notify phy connect status change */
102 int (*notify_connect)(struct usb_phy *x, int port); 103 int (*notify_connect)(struct usb_phy *x,
103 int (*notify_disconnect)(struct usb_phy *x, int port); 104 enum usb_device_speed speed);
105 int (*notify_disconnect)(struct usb_phy *x,
106 enum usb_device_speed speed);
104}; 107};
105 108
106 109
@@ -189,19 +192,19 @@ usb_phy_set_suspend(struct usb_phy *x, int suspend)
189} 192}
190 193
191static inline int 194static inline int
192usb_phy_notify_connect(struct usb_phy *x, int port) 195usb_phy_notify_connect(struct usb_phy *x, enum usb_device_speed speed)
193{ 196{
194 if (x->notify_connect) 197 if (x->notify_connect)
195 return x->notify_connect(x, port); 198 return x->notify_connect(x, speed);
196 else 199 else
197 return 0; 200 return 0;
198} 201}
199 202
200static inline int 203static inline int
201usb_phy_notify_disconnect(struct usb_phy *x, int port) 204usb_phy_notify_disconnect(struct usb_phy *x, enum usb_device_speed speed)
202{ 205{
203 if (x->notify_disconnect) 206 if (x->notify_disconnect)
204 return x->notify_disconnect(x, port); 207 return x->notify_disconnect(x, speed);
205 else 208 else
206 return 0; 209 return 0;
207} 210}
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index ddbbb7de894b..9bbeabf66c54 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -163,6 +163,16 @@ extern int usbnet_resume(struct usb_interface *);
163extern void usbnet_disconnect(struct usb_interface *); 163extern void usbnet_disconnect(struct usb_interface *);
164extern void usbnet_device_suggests_idle(struct usbnet *dev); 164extern void usbnet_device_suggests_idle(struct usbnet *dev);
165 165
166extern int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
167 u16 value, u16 index, void *data, u16 size);
168extern int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
169 u16 value, u16 index, const void *data, u16 size);
170extern int usbnet_read_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype,
171 u16 value, u16 index, void *data, u16 size);
172extern int usbnet_write_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype,
173 u16 value, u16 index, const void *data, u16 size);
174extern int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype,
175 u16 value, u16 index, const void *data, u16 size);
166 176
167/* Drivers that reuse some of the standard USB CDC infrastructure 177/* Drivers that reuse some of the standard USB CDC infrastructure
168 * (notably, using multiple interfaces according to the CDC 178 * (notably, using multiple interfaces according to the CDC
diff --git a/include/linux/vexpress.h b/include/linux/vexpress.h
new file mode 100644
index 000000000000..c52215ff4245
--- /dev/null
+++ b/include/linux/vexpress.h
@@ -0,0 +1,121 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License version 2 as
4 * published by the Free Software Foundation.
5 *
6 * This program is distributed in the hope that it will be useful,
7 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 * GNU General Public License for more details.
10 *
11 * Copyright (C) 2012 ARM Limited
12 */
13
14#ifndef _LINUX_VEXPRESS_H
15#define _LINUX_VEXPRESS_H
16
17#include <linux/device.h>
18
19#define VEXPRESS_SITE_MB 0
20#define VEXPRESS_SITE_DB1 1
21#define VEXPRESS_SITE_DB2 2
22#define VEXPRESS_SITE_MASTER 0xf
23
24#define VEXPRESS_CONFIG_STATUS_DONE 0
25#define VEXPRESS_CONFIG_STATUS_WAIT 1
26
27#define VEXPRESS_GPIO_MMC_CARDIN 0
28#define VEXPRESS_GPIO_MMC_WPROT 1
29#define VEXPRESS_GPIO_FLASH_WPn 2
30
31#define VEXPRESS_RES_FUNC(_site, _func) \
32{ \
33 .start = (_site), \
34 .end = (_func), \
35 .flags = IORESOURCE_BUS, \
36}
37
38/* Config bridge API */
39
40/**
41 * struct vexpress_config_bridge_info - description of the platform
42 * configuration infrastructure bridge.
43 *
44 * @name: Bridge name
45 *
46 * @func_get: Obtains pointer to a configuration function for a given
47 * device or a Device Tree node, to be used with @func_put
48 * and @func_exec. The node pointer should take precedence
49 * over device pointer when both are passed.
50 *
51 * @func_put: Tells the bridge that the function will not be used any
52 * more, so all allocated resources can be released.
53 *
54 * @func_exec: Executes a configuration function read or write operation.
55 * The offset selects a 32 bit word of the value accessed.
56 * Must return VEXPRESS_CONFIG_STATUS_DONE when operation
57 * is finished immediately, VEXPRESS_CONFIG_STATUS_WAIT when
58 * will be completed in some time or negative value in case
59 * of error.
60 */
61struct vexpress_config_bridge_info {
62 const char *name;
63 void *(*func_get)(struct device *dev, struct device_node *node);
64 void (*func_put)(void *func);
65 int (*func_exec)(void *func, int offset, bool write, u32 *data);
66};
67
68struct vexpress_config_bridge;
69
70struct vexpress_config_bridge *vexpress_config_bridge_register(
71 struct device_node *node,
72 struct vexpress_config_bridge_info *info);
73void vexpress_config_bridge_unregister(struct vexpress_config_bridge *bridge);
74
75void vexpress_config_complete(struct vexpress_config_bridge *bridge,
76 int status);
77
78/* Config function API */
79
80struct vexpress_config_func;
81
82struct vexpress_config_func *__vexpress_config_func_get(struct device *dev,
83 struct device_node *node);
84#define vexpress_config_func_get_by_dev(dev) \
85 __vexpress_config_func_get(dev, NULL)
86#define vexpress_config_func_get_by_node(node) \
87 __vexpress_config_func_get(NULL, node)
88void vexpress_config_func_put(struct vexpress_config_func *func);
89
90/* Both may sleep! */
91int vexpress_config_read(struct vexpress_config_func *func, int offset,
92 u32 *data);
93int vexpress_config_write(struct vexpress_config_func *func, int offset,
94 u32 data);
95
96/* Platform control */
97
98u32 vexpress_get_procid(int site);
99u32 vexpress_get_hbi(int site);
100void *vexpress_get_24mhz_clock_base(void);
101void vexpress_flags_set(u32 data);
102
103#define vexpress_get_site_by_node(node) __vexpress_get_site(NULL, node)
104#define vexpress_get_site_by_dev(dev) __vexpress_get_site(dev, NULL)
105unsigned __vexpress_get_site(struct device *dev, struct device_node *node);
106
107void vexpress_sysreg_early_init(void __iomem *base);
108void vexpress_sysreg_of_early_init(void);
109
110void vexpress_power_off(void);
111void vexpress_restart(char str, const char *cmd);
112
113/* Clocks */
114
115struct clk *vexpress_osc_setup(struct device *dev);
116void vexpress_osc_of_setup(struct device_node *node);
117
118void vexpress_clk_init(void __iomem *sp810_base);
119void vexpress_clk_of_init(void);
120
121#endif
diff --git a/include/linux/vgaarb.h b/include/linux/vgaarb.h
index 0ee42d9acdc0..2c02f3a8d2ba 100644
--- a/include/linux/vgaarb.h
+++ b/include/linux/vgaarb.h
@@ -78,7 +78,7 @@ extern void vga_set_legacy_decoding(struct pci_dev *pdev,
78 * This function acquires VGA resources for the given 78 * This function acquires VGA resources for the given
79 * card and mark those resources locked. If the resource requested 79 * card and mark those resources locked. If the resource requested
80 * are "normal" (and not legacy) resources, the arbiter will first check 80 * are "normal" (and not legacy) resources, the arbiter will first check
81 * wether the card is doing legacy decoding for that type of resource. If 81 * whether the card is doing legacy decoding for that type of resource. If
82 * yes, the lock is "converted" into a legacy resource lock. 82 * yes, the lock is "converted" into a legacy resource lock.
83 * The arbiter will first look for all VGA cards that might conflict 83 * The arbiter will first look for all VGA cards that might conflict
84 * and disable their IOs and/or Memory access, including VGA forwarding 84 * and disable their IOs and/or Memory access, including VGA forwarding
@@ -89,7 +89,7 @@ extern void vga_set_legacy_decoding(struct pci_dev *pdev,
89 * This function will block if some conflicting card is already locking 89 * This function will block if some conflicting card is already locking
90 * one of the required resources (or any resource on a different bus 90 * one of the required resources (or any resource on a different bus
91 * segment, since P2P bridges don't differenciate VGA memory and IO 91 * segment, since P2P bridges don't differenciate VGA memory and IO
92 * afaik). You can indicate wether this blocking should be interruptible 92 * afaik). You can indicate whether this blocking should be interruptible
93 * by a signal (for userland interface) or not. 93 * by a signal (for userland interface) or not.
94 * Must not be called at interrupt time or in atomic context. 94 * Must not be called at interrupt time or in atomic context.
95 * If the card already owns the resources, the function succeeds. 95 * If the card already owns the resources, the function succeeds.
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index 55600049e794..fce0a2799d43 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -68,6 +68,8 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
68 THP_COLLAPSE_ALLOC, 68 THP_COLLAPSE_ALLOC,
69 THP_COLLAPSE_ALLOC_FAILED, 69 THP_COLLAPSE_ALLOC_FAILED,
70 THP_SPLIT, 70 THP_SPLIT,
71 THP_ZERO_PAGE_ALLOC,
72 THP_ZERO_PAGE_ALLOC_FAILED,
71#endif 73#endif
72 NR_VM_EVENT_ITEMS 74 NR_VM_EVENT_ITEMS
73}; 75};
diff --git a/include/linux/vtime.h b/include/linux/vtime.h
new file mode 100644
index 000000000000..ae30ab58431a
--- /dev/null
+++ b/include/linux/vtime.h
@@ -0,0 +1,48 @@
1#ifndef _LINUX_KERNEL_VTIME_H
2#define _LINUX_KERNEL_VTIME_H
3
4struct task_struct;
5
6#ifdef CONFIG_VIRT_CPU_ACCOUNTING
7extern void vtime_task_switch(struct task_struct *prev);
8extern void vtime_account_system(struct task_struct *tsk);
9extern void vtime_account_system_irqsafe(struct task_struct *tsk);
10extern void vtime_account_idle(struct task_struct *tsk);
11extern void vtime_account_user(struct task_struct *tsk);
12extern void vtime_account(struct task_struct *tsk);
13#else
14static inline void vtime_task_switch(struct task_struct *prev) { }
15static inline void vtime_account_system(struct task_struct *tsk) { }
16static inline void vtime_account_system_irqsafe(struct task_struct *tsk) { }
17static inline void vtime_account(struct task_struct *tsk) { }
18#endif
19
20#ifdef CONFIG_IRQ_TIME_ACCOUNTING
21extern void irqtime_account_irq(struct task_struct *tsk);
22#else
23static inline void irqtime_account_irq(struct task_struct *tsk) { }
24#endif
25
26static inline void vtime_account_irq_enter(struct task_struct *tsk)
27{
28 /*
29 * Hardirq can interrupt idle task anytime. So we need vtime_account()
30 * that performs the idle check in CONFIG_VIRT_CPU_ACCOUNTING.
31 * Softirq can also interrupt idle task directly if it calls
32 * local_bh_enable(). Such case probably don't exist but we never know.
33 * Ksoftirqd is not concerned because idle time is flushed on context
34 * switch. Softirqs in the end of hardirqs are also not a problem because
35 * the idle time is flushed on hardirq time already.
36 */
37 vtime_account(tsk);
38 irqtime_account_irq(tsk);
39}
40
41static inline void vtime_account_irq_exit(struct task_struct *tsk)
42{
43 /* On hard|softirq exit we always account to hard|softirq cputime */
44 vtime_account_system(tsk);
45 irqtime_account_irq(tsk);
46}
47
48#endif /* _LINUX_KERNEL_VTIME_H */
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index b7f45d48b2de..87490ac4bd87 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -105,7 +105,7 @@ struct watchdog_device {
105#define WATCHDOG_NOWAYOUT_INIT_STATUS 0 105#define WATCHDOG_NOWAYOUT_INIT_STATUS 0
106#endif 106#endif
107 107
108/* Use the following function to check wether or not the watchdog is active */ 108/* Use the following function to check whether or not the watchdog is active */
109static inline bool watchdog_active(struct watchdog_device *wdd) 109static inline bool watchdog_active(struct watchdog_device *wdd)
110{ 110{
111 return test_bit(WDOG_ACTIVE, &wdd->status); 111 return test_bit(WDOG_ACTIVE, &wdd->status);
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 50c3e8fa06a8..b82a83aba311 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -161,14 +161,7 @@ void __bdi_update_bandwidth(struct backing_dev_info *bdi,
161 unsigned long start_time); 161 unsigned long start_time);
162 162
163void page_writeback_init(void); 163void page_writeback_init(void);
164void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, 164void balance_dirty_pages_ratelimited(struct address_space *mapping);
165 unsigned long nr_pages_dirtied);
166
167static inline void
168balance_dirty_pages_ratelimited(struct address_space *mapping)
169{
170 balance_dirty_pages_ratelimited_nr(mapping, 1);
171}
172 165
173typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, 166typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc,
174 void *data); 167 void *data);
diff --git a/include/media/adp1653.h b/include/media/adp1653.h
index 50a1af88aed0..1d9b48a3bd80 100644
--- a/include/media/adp1653.h
+++ b/include/media/adp1653.h
@@ -3,10 +3,10 @@
3 * 3 *
4 * Copyright (C) 2008--2011 Nokia Corporation 4 * Copyright (C) 2008--2011 Nokia Corporation
5 * 5 *
6 * Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> 6 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> 9 * Sakari Ailus <sakari.ailus@iki.fi>
10 * Tuukka Toivonen <tuukkat76@gmail.com> 10 * Tuukka Toivonen <tuukkat76@gmail.com>
11 * 11 *
12 * This program is free software; you can redistribute it and/or 12 * This program is free software; you can redistribute it and/or
diff --git a/include/media/adv7604.h b/include/media/adv7604.h
index 171b957db743..dc004bc926c9 100644
--- a/include/media/adv7604.h
+++ b/include/media/adv7604.h
@@ -40,14 +40,6 @@ enum adv7604_op_ch_sel {
40 ADV7604_OP_CH_SEL_RBG = 5, 40 ADV7604_OP_CH_SEL_RBG = 5,
41}; 41};
42 42
43/* Primary mode (IO register 0x01, [3:0]) */
44enum adv7604_prim_mode {
45 ADV7604_PRIM_MODE_COMP = 1,
46 ADV7604_PRIM_MODE_RGB = 2,
47 ADV7604_PRIM_MODE_HDMI_COMP = 5,
48 ADV7604_PRIM_MODE_HDMI_GR = 6,
49};
50
51/* Input Color Space (IO register 0x02, [7:4]) */ 43/* Input Color Space (IO register 0x02, [7:4]) */
52enum adv7604_inp_color_space { 44enum adv7604_inp_color_space {
53 ADV7604_INP_COLOR_SPACE_LIM_RGB = 0, 45 ADV7604_INP_COLOR_SPACE_LIM_RGB = 0,
@@ -103,9 +95,6 @@ struct adv7604_platform_data {
103 /* Bus rotation and reordering */ 95 /* Bus rotation and reordering */
104 enum adv7604_op_ch_sel op_ch_sel; 96 enum adv7604_op_ch_sel op_ch_sel;
105 97
106 /* Primary mode */
107 enum adv7604_prim_mode prim_mode;
108
109 /* Select output format */ 98 /* Select output format */
110 enum adv7604_op_format_sel op_format_sel; 99 enum adv7604_op_format_sel op_format_sel;
111 100
@@ -142,6 +131,16 @@ struct adv7604_platform_data {
142 u8 i2c_vdp; 131 u8 i2c_vdp;
143}; 132};
144 133
134/*
135 * Mode of operation.
136 * This is used as the input argument of the s_routing video op.
137 */
138enum adv7604_mode {
139 ADV7604_MODE_COMP,
140 ADV7604_MODE_GR,
141 ADV7604_MODE_HDMI,
142};
143
145#define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000) 144#define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000)
146#define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001) 145#define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001)
147#define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002) 146#define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002)
diff --git a/include/media/davinci/vpbe_display.h b/include/media/davinci/vpbe_display.h
index dbf6b37682cd..8dffffedbb59 100644
--- a/include/media/davinci/vpbe_display.h
+++ b/include/media/davinci/vpbe_display.h
@@ -16,7 +16,7 @@
16/* Header files */ 16/* Header files */
17#include <linux/videodev2.h> 17#include <linux/videodev2.h>
18#include <media/v4l2-common.h> 18#include <media/v4l2-common.h>
19#include <media/videobuf-dma-contig.h> 19#include <media/videobuf2-dma-contig.h>
20#include <media/davinci/vpbe_types.h> 20#include <media/davinci/vpbe_types.h>
21#include <media/davinci/vpbe_osd.h> 21#include <media/davinci/vpbe_osd.h>
22#include <media/davinci/vpbe.h> 22#include <media/davinci/vpbe.h>
@@ -62,6 +62,11 @@ struct display_layer_info {
62 enum osd_v_exp_ratio v_exp; 62 enum osd_v_exp_ratio v_exp;
63}; 63};
64 64
65struct vpbe_disp_buffer {
66 struct vb2_buffer vb;
67 struct list_head list;
68};
69
65/* vpbe display object structure */ 70/* vpbe display object structure */
66struct vpbe_layer { 71struct vpbe_layer {
67 /* number of buffers in fbuffers */ 72 /* number of buffers in fbuffers */
@@ -69,13 +74,15 @@ struct vpbe_layer {
69 /* Pointer to the vpbe_display */ 74 /* Pointer to the vpbe_display */
70 struct vpbe_display *disp_dev; 75 struct vpbe_display *disp_dev;
71 /* Pointer pointing to current v4l2_buffer */ 76 /* Pointer pointing to current v4l2_buffer */
72 struct videobuf_buffer *cur_frm; 77 struct vpbe_disp_buffer *cur_frm;
73 /* Pointer pointing to next v4l2_buffer */ 78 /* Pointer pointing to next v4l2_buffer */
74 struct videobuf_buffer *next_frm; 79 struct vpbe_disp_buffer *next_frm;
75 /* videobuf specific parameters 80 /* videobuf specific parameters
76 * Buffer queue used in video-buf 81 * Buffer queue used in video-buf
77 */ 82 */
78 struct videobuf_queue buffer_queue; 83 struct vb2_queue buffer_queue;
84 /* allocator-specific contexts for each plane */
85 struct vb2_alloc_ctx *alloc_ctx;
79 /* Queue of filled frames */ 86 /* Queue of filled frames */
80 struct list_head dma_queue; 87 struct list_head dma_queue;
81 /* Used in video-buf */ 88 /* Used in video-buf */
diff --git a/include/media/davinci/vpbe_osd.h b/include/media/davinci/vpbe_osd.h
index d7e397a444e6..5ab0d8d41f68 100644
--- a/include/media/davinci/vpbe_osd.h
+++ b/include/media/davinci/vpbe_osd.h
@@ -357,7 +357,7 @@ struct osd_state {
357 spinlock_t lock; 357 spinlock_t lock;
358 struct device *dev; 358 struct device *dev;
359 dma_addr_t osd_base_phys; 359 dma_addr_t osd_base_phys;
360 unsigned long osd_base; 360 void __iomem *osd_base;
361 unsigned long osd_size; 361 unsigned long osd_size;
362 /* 1-->the isr will toggle the VID0 ping-pong buffer */ 362 /* 1-->the isr will toggle the VID0 ping-pong buffer */
363 int pingpong; 363 int pingpong;
diff --git a/include/media/ir-kbd-i2c.h b/include/media/ir-kbd-i2c.h
index 768aa77925cd..e221bc74020b 100644
--- a/include/media/ir-kbd-i2c.h
+++ b/include/media/ir-kbd-i2c.h
@@ -37,7 +37,7 @@ enum ir_kbd_get_key_fn {
37struct IR_i2c_init_data { 37struct IR_i2c_init_data {
38 char *ir_codes; 38 char *ir_codes;
39 const char *name; 39 const char *name;
40 u64 type; /* RC_TYPE_RC5, etc */ 40 u64 type; /* RC_BIT_RC5, etc */
41 u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */ 41 u32 polling_interval; /* 0 means DEFAULT_POLLING_INTERVAL */
42 42
43 /* 43 /*
diff --git a/include/media/mt9v022.h b/include/media/mt9v022.h
new file mode 100644
index 000000000000..40561801321a
--- /dev/null
+++ b/include/media/mt9v022.h
@@ -0,0 +1,16 @@
1/*
2 * mt9v022 sensor
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef __MT9V022_H__
10#define __MT9V022_H__
11
12struct mt9v022_platform_data {
13 unsigned short y_skip_top; /* Lines to skip at the top */
14};
15
16#endif
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index b0c494a69079..f03445f3c767 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -50,7 +50,7 @@ enum rc_driver_type {
50 * @input_dev: the input child device used to communicate events to userspace 50 * @input_dev: the input child device used to communicate events to userspace
51 * @driver_type: specifies if protocol decoding is done in hardware or software 51 * @driver_type: specifies if protocol decoding is done in hardware or software
52 * @idle: used to keep track of RX state 52 * @idle: used to keep track of RX state
53 * @allowed_protos: bitmask with the supported RC_TYPE_* protocols 53 * @allowed_protos: bitmask with the supported RC_BIT_* protocols
54 * @scanmask: some hardware decoders are not capable of providing the full 54 * @scanmask: some hardware decoders are not capable of providing the full
55 * scancode to the application. As this is a hardware limit, we can't do 55 * scancode to the application. As this is a hardware limit, we can't do
56 * anything with it. Yet, as the same keycode table can be used with other 56 * anything with it. Yet, as the same keycode table can be used with other
@@ -113,7 +113,7 @@ struct rc_dev {
113 u32 max_timeout; 113 u32 max_timeout;
114 u32 rx_resolution; 114 u32 rx_resolution;
115 u32 tx_resolution; 115 u32 tx_resolution;
116 int (*change_protocol)(struct rc_dev *dev, u64 rc_type); 116 int (*change_protocol)(struct rc_dev *dev, u64 *rc_type);
117 int (*open)(struct rc_dev *dev); 117 int (*open)(struct rc_dev *dev);
118 void (*close)(struct rc_dev *dev); 118 void (*close)(struct rc_dev *dev);
119 int (*s_tx_mask)(struct rc_dev *dev, u32 mask); 119 int (*s_tx_mask)(struct rc_dev *dev, u32 mask);
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index cfd5163ff7f3..74f55a3f14eb 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -11,22 +11,54 @@
11 11
12#include <linux/input.h> 12#include <linux/input.h>
13 13
14#define RC_TYPE_UNKNOWN 0 14enum rc_type {
15#define RC_TYPE_RC5 (1 << 0) /* Philips RC5 protocol */ 15 RC_TYPE_UNKNOWN = 0, /* Protocol not known */
16#define RC_TYPE_NEC (1 << 1) 16 RC_TYPE_OTHER = 1, /* Protocol known but proprietary */
17#define RC_TYPE_RC6 (1 << 2) /* Philips RC6 protocol */ 17 RC_TYPE_LIRC = 2, /* Pass raw IR to lirc userspace */
18#define RC_TYPE_JVC (1 << 3) /* JVC protocol */ 18 RC_TYPE_RC5 = 3, /* Philips RC5 protocol */
19#define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ 19 RC_TYPE_RC5X = 4, /* Philips RC5x protocol */
20#define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ 20 RC_TYPE_RC5_SZ = 5, /* StreamZap variant of RC5 */
21#define RC_TYPE_SANYO (1 << 6) /* Sanyo protocol */ 21 RC_TYPE_JVC = 6, /* JVC protocol */
22#define RC_TYPE_MCE_KBD (1 << 29) /* RC6-ish MCE keyboard/mouse */ 22 RC_TYPE_SONY12 = 7, /* Sony 12 bit protocol */
23#define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ 23 RC_TYPE_SONY15 = 8, /* Sony 15 bit protocol */
24#define RC_TYPE_OTHER (1u << 31) 24 RC_TYPE_SONY20 = 9, /* Sony 20 bit protocol */
25 RC_TYPE_NEC = 10, /* NEC protocol */
26 RC_TYPE_SANYO = 11, /* Sanyo protocol */
27 RC_TYPE_MCE_KBD = 12, /* RC6-ish MCE keyboard/mouse */
28 RC_TYPE_RC6_0 = 13, /* Philips RC6-0-16 protocol */
29 RC_TYPE_RC6_6A_20 = 14, /* Philips RC6-6A-20 protocol */
30 RC_TYPE_RC6_6A_24 = 15, /* Philips RC6-6A-24 protocol */
31 RC_TYPE_RC6_6A_32 = 16, /* Philips RC6-6A-32 protocol */
32 RC_TYPE_RC6_MCE = 17, /* MCE (Philips RC6-6A-32 subtype) protocol */
33};
34
35#define RC_BIT_NONE 0
36#define RC_BIT_UNKNOWN (1 << RC_TYPE_UNKNOWN)
37#define RC_BIT_OTHER (1 << RC_TYPE_OTHER)
38#define RC_BIT_LIRC (1 << RC_TYPE_LIRC)
39#define RC_BIT_RC5 (1 << RC_TYPE_RC5)
40#define RC_BIT_RC5X (1 << RC_TYPE_RC5X)
41#define RC_BIT_RC5_SZ (1 << RC_TYPE_RC5_SZ)
42#define RC_BIT_JVC (1 << RC_TYPE_JVC)
43#define RC_BIT_SONY12 (1 << RC_TYPE_SONY12)
44#define RC_BIT_SONY15 (1 << RC_TYPE_SONY15)
45#define RC_BIT_SONY20 (1 << RC_TYPE_SONY20)
46#define RC_BIT_NEC (1 << RC_TYPE_NEC)
47#define RC_BIT_SANYO (1 << RC_TYPE_SANYO)
48#define RC_BIT_MCE_KBD (1 << RC_TYPE_MCE_KBD)
49#define RC_BIT_RC6_0 (1 << RC_TYPE_RC6_0)
50#define RC_BIT_RC6_6A_20 (1 << RC_TYPE_RC6_6A_20)
51#define RC_BIT_RC6_6A_24 (1 << RC_TYPE_RC6_6A_24)
52#define RC_BIT_RC6_6A_32 (1 << RC_TYPE_RC6_6A_32)
53#define RC_BIT_RC6_MCE (1 << RC_TYPE_RC6_MCE)
25 54
26#define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \ 55#define RC_BIT_ALL (RC_BIT_UNKNOWN | RC_BIT_OTHER | RC_BIT_LIRC | \
27 RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \ 56 RC_BIT_RC5 | RC_BIT_RC5X | RC_BIT_RC5_SZ | \
28 RC_TYPE_RC5_SZ | RC_TYPE_SANYO | RC_TYPE_MCE_KBD | \ 57 RC_BIT_JVC | \
29 RC_TYPE_OTHER) 58 RC_BIT_SONY12 | RC_BIT_SONY15 | RC_BIT_SONY20 | \
59 RC_BIT_NEC | RC_BIT_SANYO | RC_BIT_MCE_KBD | \
60 RC_BIT_RC6_0 | RC_BIT_RC6_6A_20 | RC_BIT_RC6_6A_24 | \
61 RC_BIT_RC6_6A_32 | RC_BIT_RC6_MCE)
30 62
31struct rc_map_table { 63struct rc_map_table {
32 u32 scancode; 64 u32 scancode;
@@ -38,7 +70,7 @@ struct rc_map {
38 unsigned int size; /* Max number of entries */ 70 unsigned int size; /* Max number of entries */
39 unsigned int len; /* Used number of entries */ 71 unsigned int len; /* Used number of entries */
40 unsigned int alloc; /* Size of *scan in bytes */ 72 unsigned int alloc; /* Size of *scan in bytes */
41 u64 rc_type; 73 enum rc_type rc_type;
42 const char *name; 74 const char *name;
43 spinlock_t lock; 75 spinlock_t lock;
44}; 76};
diff --git a/include/media/s3c_camif.h b/include/media/s3c_camif.h
new file mode 100644
index 000000000000..df96c2c789b4
--- /dev/null
+++ b/include/media/s3c_camif.h
@@ -0,0 +1,45 @@
1/*
2 * s3c24xx/s3c64xx SoC series Camera Interface (CAMIF) driver
3 *
4 * Copyright (C) 2012 Sylwester Nawrocki <sylvester.nawrocki@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 version 2 as
8 * published by the Free Software Foundation.
9*/
10
11#ifndef MEDIA_S3C_CAMIF_
12#define MEDIA_S3C_CAMIF_
13
14#include <linux/i2c.h>
15#include <media/v4l2-mediabus.h>
16
17/**
18 * struct s3c_camif_sensor_info - an image sensor description
19 * @i2c_board_info: pointer to an I2C sensor subdevice board info
20 * @clock_frequency: frequency of the clock the host provides to a sensor
21 * @mbus_type: media bus type
22 * @i2c_bus_num: i2c control bus id the sensor is attached to
23 * @flags: the parallel bus flags defining signals polarity (V4L2_MBUS_*)
24 * @use_field: 1 if parallel bus FIELD signal is used (only s3c64xx)
25 */
26struct s3c_camif_sensor_info {
27 struct i2c_board_info i2c_board_info;
28 unsigned long clock_frequency;
29 enum v4l2_mbus_type mbus_type;
30 u16 i2c_bus_num;
31 u16 flags;
32 u8 use_field;
33};
34
35struct s3c_camif_plat_data {
36 struct s3c_camif_sensor_info sensor;
37 int (*gpio_get)(void);
38 int (*gpio_put)(void);
39};
40
41/* Platform default helper functions */
42int s3c_camif_gpio_get(void);
43int s3c_camif_gpio_put(void);
44
45#endif /* MEDIA_S3C_CAMIF_ */
diff --git a/include/media/smiapp.h b/include/media/smiapp.h
index 9ab07fd45d5c..07f96a89e189 100644
--- a/include/media/smiapp.h
+++ b/include/media/smiapp.h
@@ -4,7 +4,7 @@
4 * Generic driver for SMIA/SMIA++ compliant camera modules 4 * Generic driver for SMIA/SMIA++ compliant camera modules
5 * 5 *
6 * Copyright (C) 2011--2012 Nokia Corporation 6 * Copyright (C) 2011--2012 Nokia Corporation
7 * Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> 7 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
8 * 8 *
9 * This program is free software; you can redistribute it and/or 9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License 10 * modify it under the terms of the GNU General Public License
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h
index e7c5d170a9cd..eff85f934b24 100644
--- a/include/media/v4l2-event.h
+++ b/include/media/v4l2-event.h
@@ -5,7 +5,7 @@
5 * 5 *
6 * Copyright (C) 2009--2010 Nokia Corporation. 6 * Copyright (C) 2009--2010 Nokia Corporation.
7 * 7 *
8 * Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> 8 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h
index 52513c225c18..a62ee18cb7b7 100644
--- a/include/media/v4l2-fh.h
+++ b/include/media/v4l2-fh.h
@@ -6,7 +6,7 @@
6 * 6 *
7 * Copyright (C) 2009--2010 Nokia Corporation. 7 * Copyright (C) 2009--2010 Nokia Corporation.
8 * 8 *
9 * Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com> 9 * Contact: Sakari Ailus <sakari.ailus@iki.fi>
10 * 10 *
11 * This program is free software; you can redistribute it and/or 11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License 12 * modify it under the terms of the GNU General Public License
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index e48b571ca37d..4118ad1324c9 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -111,6 +111,8 @@ struct v4l2_ioctl_ops {
111 int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b); 111 int (*vidioc_reqbufs) (struct file *file, void *fh, struct v4l2_requestbuffers *b);
112 int (*vidioc_querybuf)(struct file *file, void *fh, struct v4l2_buffer *b); 112 int (*vidioc_querybuf)(struct file *file, void *fh, struct v4l2_buffer *b);
113 int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b); 113 int (*vidioc_qbuf) (struct file *file, void *fh, struct v4l2_buffer *b);
114 int (*vidioc_expbuf) (struct file *file, void *fh,
115 struct v4l2_exportbuffer *e);
114 int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b); 116 int (*vidioc_dqbuf) (struct file *file, void *fh, struct v4l2_buffer *b);
115 117
116 int (*vidioc_create_bufs)(struct file *file, void *fh, struct v4l2_create_buffers *b); 118 int (*vidioc_create_bufs)(struct file *file, void *fh, struct v4l2_create_buffers *b);
diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h
index 131cc4a53675..7e82d2b193d5 100644
--- a/include/media/v4l2-mem2mem.h
+++ b/include/media/v4l2-mem2mem.h
@@ -111,6 +111,9 @@ int v4l2_m2m_qbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
111int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, 111int v4l2_m2m_dqbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
112 struct v4l2_buffer *buf); 112 struct v4l2_buffer *buf);
113 113
114int v4l2_m2m_expbuf(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
115 struct v4l2_exportbuffer *eb);
116
114int v4l2_m2m_streamon(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, 117int v4l2_m2m_streamon(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
115 enum v4l2_buf_type type); 118 enum v4l2_buf_type type);
116int v4l2_m2m_streamoff(struct file *file, struct v4l2_m2m_ctx *m2m_ctx, 119int v4l2_m2m_streamoff(struct file *file, struct v4l2_m2m_ctx *m2m_ctx,
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index e04252a9fea6..9cfd4ee9e56f 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -16,6 +16,7 @@
16#include <linux/mutex.h> 16#include <linux/mutex.h>
17#include <linux/poll.h> 17#include <linux/poll.h>
18#include <linux/videodev2.h> 18#include <linux/videodev2.h>
19#include <linux/dma-buf.h>
19 20
20struct vb2_alloc_ctx; 21struct vb2_alloc_ctx;
21struct vb2_fileio_data; 22struct vb2_fileio_data;
@@ -41,6 +42,24 @@ struct vb2_fileio_data;
41 * argument to other ops in this structure 42 * argument to other ops in this structure
42 * @put_userptr: inform the allocator that a USERPTR buffer will no longer 43 * @put_userptr: inform the allocator that a USERPTR buffer will no longer
43 * be used 44 * be used
45 * @attach_dmabuf: attach a shared struct dma_buf for a hardware operation;
46 * used for DMABUF memory types; alloc_ctx is the alloc context
47 * dbuf is the shared dma_buf; returns NULL on failure;
48 * allocator private per-buffer structure on success;
49 * this needs to be used for further accesses to the buffer
50 * @detach_dmabuf: inform the exporter of the buffer that the current DMABUF
51 * buffer is no longer used; the buf_priv argument is the
52 * allocator private per-buffer structure previously returned
53 * from the attach_dmabuf callback
54 * @map_dmabuf: request for access to the dmabuf from allocator; the allocator
55 * of dmabuf is informed that this driver is going to use the
56 * dmabuf
57 * @unmap_dmabuf: releases access control to the dmabuf - allocator is notified
58 * that this driver is done using the dmabuf for now
59 * @prepare: called every time the buffer is passed from userspace to the
60 * driver, useful for cache synchronisation, optional
61 * @finish: called every time the buffer is passed back from the driver
62 * to the userspace, also optional
44 * @vaddr: return a kernel virtual address to a given memory buffer 63 * @vaddr: return a kernel virtual address to a given memory buffer
45 * associated with the passed private structure or NULL if no 64 * associated with the passed private structure or NULL if no
46 * such mapping exists 65 * such mapping exists
@@ -56,15 +75,27 @@ struct vb2_fileio_data;
56 * Required ops for USERPTR types: get_userptr, put_userptr. 75 * Required ops for USERPTR types: get_userptr, put_userptr.
57 * Required ops for MMAP types: alloc, put, num_users, mmap. 76 * Required ops for MMAP types: alloc, put, num_users, mmap.
58 * Required ops for read/write access types: alloc, put, num_users, vaddr 77 * Required ops for read/write access types: alloc, put, num_users, vaddr
78 * Required ops for DMABUF types: attach_dmabuf, detach_dmabuf, map_dmabuf,
79 * unmap_dmabuf.
59 */ 80 */
60struct vb2_mem_ops { 81struct vb2_mem_ops {
61 void *(*alloc)(void *alloc_ctx, unsigned long size); 82 void *(*alloc)(void *alloc_ctx, unsigned long size);
62 void (*put)(void *buf_priv); 83 void (*put)(void *buf_priv);
84 struct dma_buf *(*get_dmabuf)(void *buf_priv);
63 85
64 void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr, 86 void *(*get_userptr)(void *alloc_ctx, unsigned long vaddr,
65 unsigned long size, int write); 87 unsigned long size, int write);
66 void (*put_userptr)(void *buf_priv); 88 void (*put_userptr)(void *buf_priv);
67 89
90 void (*prepare)(void *buf_priv);
91 void (*finish)(void *buf_priv);
92
93 void *(*attach_dmabuf)(void *alloc_ctx, struct dma_buf *dbuf,
94 unsigned long size, int write);
95 void (*detach_dmabuf)(void *buf_priv);
96 int (*map_dmabuf)(void *buf_priv);
97 void (*unmap_dmabuf)(void *buf_priv);
98
68 void *(*vaddr)(void *buf_priv); 99 void *(*vaddr)(void *buf_priv);
69 void *(*cookie)(void *buf_priv); 100 void *(*cookie)(void *buf_priv);
70 101
@@ -75,6 +106,8 @@ struct vb2_mem_ops {
75 106
76struct vb2_plane { 107struct vb2_plane {
77 void *mem_priv; 108 void *mem_priv;
109 struct dma_buf *dbuf;
110 unsigned int dbuf_mapped;
78}; 111};
79 112
80/** 113/**
@@ -83,12 +116,14 @@ struct vb2_plane {
83 * @VB2_USERPTR: driver supports USERPTR with streaming API 116 * @VB2_USERPTR: driver supports USERPTR with streaming API
84 * @VB2_READ: driver supports read() style access 117 * @VB2_READ: driver supports read() style access
85 * @VB2_WRITE: driver supports write() style access 118 * @VB2_WRITE: driver supports write() style access
119 * @VB2_DMABUF: driver supports DMABUF with streaming API
86 */ 120 */
87enum vb2_io_modes { 121enum vb2_io_modes {
88 VB2_MMAP = (1 << 0), 122 VB2_MMAP = (1 << 0),
89 VB2_USERPTR = (1 << 1), 123 VB2_USERPTR = (1 << 1),
90 VB2_READ = (1 << 2), 124 VB2_READ = (1 << 2),
91 VB2_WRITE = (1 << 3), 125 VB2_WRITE = (1 << 3),
126 VB2_DMABUF = (1 << 4),
92}; 127};
93 128
94/** 129/**
@@ -329,6 +364,7 @@ int __must_check vb2_queue_init(struct vb2_queue *q);
329void vb2_queue_release(struct vb2_queue *q); 364void vb2_queue_release(struct vb2_queue *q);
330 365
331int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b); 366int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b);
367int vb2_expbuf(struct vb2_queue *q, struct v4l2_exportbuffer *eb);
332int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking); 368int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking);
333 369
334int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type); 370int vb2_streamon(struct vb2_queue *q, enum v4l2_buf_type type);
@@ -438,6 +474,8 @@ int vb2_ioctl_qbuf(struct file *file, void *priv, struct v4l2_buffer *p);
438int vb2_ioctl_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p); 474int vb2_ioctl_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p);
439int vb2_ioctl_streamon(struct file *file, void *priv, enum v4l2_buf_type i); 475int vb2_ioctl_streamon(struct file *file, void *priv, enum v4l2_buf_type i);
440int vb2_ioctl_streamoff(struct file *file, void *priv, enum v4l2_buf_type i); 476int vb2_ioctl_streamoff(struct file *file, void *priv, enum v4l2_buf_type i);
477int vb2_ioctl_expbuf(struct file *file, void *priv,
478 struct v4l2_exportbuffer *p);
441 479
442/* struct v4l2_file_operations helpers */ 480/* struct v4l2_file_operations helpers */
443 481
diff --git a/include/media/videobuf2-memops.h b/include/media/videobuf2-memops.h
index 84e1f6c031c5..f05444ca8c0c 100644
--- a/include/media/videobuf2-memops.h
+++ b/include/media/videobuf2-memops.h
@@ -33,11 +33,6 @@ extern const struct vm_operations_struct vb2_common_vm_ops;
33int vb2_get_contig_userptr(unsigned long vaddr, unsigned long size, 33int vb2_get_contig_userptr(unsigned long vaddr, unsigned long size,
34 struct vm_area_struct **res_vma, dma_addr_t *res_pa); 34 struct vm_area_struct **res_vma, dma_addr_t *res_pa);
35 35
36int vb2_mmap_pfn_range(struct vm_area_struct *vma, unsigned long paddr,
37 unsigned long size,
38 const struct vm_operations_struct *vm_ops,
39 void *priv);
40
41struct vm_area_struct *vb2_get_vma(struct vm_area_struct *vma); 36struct vm_area_struct *vb2_get_vma(struct vm_area_struct *vma);
42void vb2_put_vma(struct vm_area_struct *vma); 37void vb2_put_vma(struct vm_area_struct *vma);
43 38
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 9e63e76b20e7..df4ef9453384 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -172,6 +172,9 @@ extern bool ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
172extern int register_inet6addr_notifier(struct notifier_block *nb); 172extern int register_inet6addr_notifier(struct notifier_block *nb);
173extern int unregister_inet6addr_notifier(struct notifier_block *nb); 173extern int unregister_inet6addr_notifier(struct notifier_block *nb);
174 174
175extern void inet6_netconf_notify_devconf(struct net *net, int type, int ifindex,
176 struct ipv6_devconf *devconf);
177
175/** 178/**
176 * __in6_dev_get - get inet6_dev pointer from netdevice 179 * __in6_dev_get - get inet6_dev pointer from netdevice
177 * @dev: network device 180 * @dev: network device
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index b5f8988e4283..0a996a3517ed 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -53,7 +53,6 @@ struct unix_sock {
53 struct path path; 53 struct path path;
54 struct mutex readlock; 54 struct mutex readlock;
55 struct sock *peer; 55 struct sock *peer;
56 struct sock *other;
57 struct list_head link; 56 struct list_head link;
58 atomic_long_t inflight; 57 atomic_long_t inflight;
59 spinlock_t lock; 58 spinlock_t lock;
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h
index 6a76e0a0705e..42f21766c538 100644
--- a/include/net/bluetooth/a2mp.h
+++ b/include/net/bluetooth/a2mp.h
@@ -19,13 +19,25 @@
19 19
20#define A2MP_FEAT_EXT 0x8000 20#define A2MP_FEAT_EXT 0x8000
21 21
22enum amp_mgr_state {
23 READ_LOC_AMP_INFO,
24 READ_LOC_AMP_ASSOC,
25 READ_LOC_AMP_ASSOC_FINAL,
26};
27
22struct amp_mgr { 28struct amp_mgr {
29 struct list_head list;
23 struct l2cap_conn *l2cap_conn; 30 struct l2cap_conn *l2cap_conn;
24 struct l2cap_chan *a2mp_chan; 31 struct l2cap_chan *a2mp_chan;
32 struct l2cap_chan *bredr_chan;
25 struct kref kref; 33 struct kref kref;
26 __u8 ident; 34 __u8 ident;
27 __u8 handle; 35 __u8 handle;
36 enum amp_mgr_state state;
28 unsigned long flags; 37 unsigned long flags;
38
39 struct list_head amp_ctrls;
40 struct mutex amp_ctrls_lock;
29}; 41};
30 42
31struct a2mp_cmd { 43struct a2mp_cmd {
@@ -118,9 +130,19 @@ struct a2mp_physlink_rsp {
118#define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 130#define A2MP_STATUS_PHYS_LINK_EXISTS 0x05
119#define A2MP_STATUS_SECURITY_VIOLATION 0x06 131#define A2MP_STATUS_SECURITY_VIOLATION 0x06
120 132
121void amp_mgr_get(struct amp_mgr *mgr); 133extern struct list_head amp_mgr_list;
134extern struct mutex amp_mgr_list_lock;
135
136struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr);
122int amp_mgr_put(struct amp_mgr *mgr); 137int amp_mgr_put(struct amp_mgr *mgr);
138u8 __next_ident(struct amp_mgr *mgr);
123struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, 139struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn,
124 struct sk_buff *skb); 140 struct sk_buff *skb);
141struct amp_mgr *amp_mgr_lookup_by_state(u8 state);
142void a2mp_send(struct amp_mgr *mgr, u8 code, u8 ident, u16 len, void *data);
143void a2mp_discover_amp(struct l2cap_chan *chan);
144void a2mp_send_getinfo_rsp(struct hci_dev *hdev);
145void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status);
146void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status);
125 147
126#endif /* __A2MP_H */ 148#endif /* __A2MP_H */
diff --git a/include/net/bluetooth/amp.h b/include/net/bluetooth/amp.h
new file mode 100644
index 000000000000..7ea3db77ba89
--- /dev/null
+++ b/include/net/bluetooth/amp.h
@@ -0,0 +1,54 @@
1/*
2 Copyright (c) 2011,2012 Intel Corp.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License version 2 and
6 only version 2 as published by the Free Software Foundation.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12*/
13
14#ifndef __AMP_H
15#define __AMP_H
16
17struct amp_ctrl {
18 struct list_head list;
19 struct kref kref;
20 __u8 id;
21 __u16 assoc_len_so_far;
22 __u16 assoc_rem_len;
23 __u16 assoc_len;
24 __u8 *assoc;
25};
26
27int amp_ctrl_put(struct amp_ctrl *ctrl);
28void amp_ctrl_get(struct amp_ctrl *ctrl);
29struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id);
30struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id);
31void amp_ctrl_list_flush(struct amp_mgr *mgr);
32
33struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr,
34 u8 remote_id, bool out);
35
36int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type);
37
38void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr);
39void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle);
40void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr);
41void amp_read_loc_assoc_final_data(struct hci_dev *hdev,
42 struct hci_conn *hcon);
43void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
44 struct hci_conn *hcon);
45void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr,
46 struct hci_conn *hcon);
47void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle);
48void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle);
49void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon);
50void amp_create_logical_link(struct l2cap_chan *chan);
51void amp_disconnect_logical_link(struct hci_chan *hchan);
52void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason);
53
54#endif /* __AMP_H */
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index ede036977ae8..2554b3f5222a 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -180,7 +180,6 @@ static inline void bacpy(bdaddr_t *dst, bdaddr_t *src)
180} 180}
181 181
182void baswap(bdaddr_t *dst, bdaddr_t *src); 182void baswap(bdaddr_t *dst, bdaddr_t *src);
183char *batostr(bdaddr_t *ba);
184 183
185/* Common socket structures and functions */ 184/* Common socket structures and functions */
186 185
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 76b2b6bdcf36..45eee08157bb 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -33,6 +33,8 @@
33#define HCI_LINK_KEY_SIZE 16 33#define HCI_LINK_KEY_SIZE 16
34#define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) 34#define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE)
35 35
36#define HCI_MAX_AMP_ASSOC_SIZE 672
37
36/* HCI dev events */ 38/* HCI dev events */
37#define HCI_DEV_REG 1 39#define HCI_DEV_REG 1
38#define HCI_DEV_UNREG 2 40#define HCI_DEV_UNREG 2
@@ -113,6 +115,7 @@ enum {
113 HCI_SSP_ENABLED, 115 HCI_SSP_ENABLED,
114 HCI_HS_ENABLED, 116 HCI_HS_ENABLED,
115 HCI_LE_ENABLED, 117 HCI_LE_ENABLED,
118 HCI_LE_PERIPHERAL,
116 HCI_CONNECTABLE, 119 HCI_CONNECTABLE,
117 HCI_DISCOVERABLE, 120 HCI_DISCOVERABLE,
118 HCI_LINK_SECURITY, 121 HCI_LINK_SECURITY,
@@ -151,7 +154,7 @@ enum {
151#define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 154#define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
152#define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ 155#define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */
153#define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ 156#define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */
154#define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 second */ 157#define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
155#define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ 158#define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */
156#define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ 159#define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */
157 160
@@ -196,6 +199,7 @@ enum {
196#define ACL_START_NO_FLUSH 0x00 199#define ACL_START_NO_FLUSH 0x00
197#define ACL_CONT 0x01 200#define ACL_CONT 0x01
198#define ACL_START 0x02 201#define ACL_START 0x02
202#define ACL_COMPLETE 0x03
199#define ACL_ACTIVE_BCAST 0x04 203#define ACL_ACTIVE_BCAST 0x04
200#define ACL_PICO_BCAST 0x08 204#define ACL_PICO_BCAST 0x08
201 205
@@ -205,6 +209,7 @@ enum {
205#define ESCO_LINK 0x02 209#define ESCO_LINK 0x02
206/* Low Energy links do not have defined link type. Use invented one */ 210/* Low Energy links do not have defined link type. Use invented one */
207#define LE_LINK 0x80 211#define LE_LINK 0x80
212#define AMP_LINK 0x81
208 213
209/* LMP features */ 214/* LMP features */
210#define LMP_3SLOT 0x01 215#define LMP_3SLOT 0x01
@@ -314,6 +319,9 @@ enum {
314#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 319#define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00
315#define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 320#define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01
316 321
322/* The core spec defines 127 as the "not available" value */
323#define HCI_TX_POWER_INVALID 127
324
317/* Extended Inquiry Response field types */ 325/* Extended Inquiry Response field types */
318#define EIR_FLAGS 0x01 /* flags */ 326#define EIR_FLAGS 0x01 /* flags */
319#define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ 327#define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */
@@ -330,6 +338,13 @@ enum {
330#define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ 338#define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */
331#define EIR_DEVICE_ID 0x10 /* device ID */ 339#define EIR_DEVICE_ID 0x10 /* device ID */
332 340
341/* Low Energy Advertising Flags */
342#define LE_AD_LIMITED 0x01 /* Limited Discoverable */
343#define LE_AD_GENERAL 0x02 /* General Discoverable */
344#define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */
345#define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */
346#define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */
347
333/* ----- HCI Commands ---- */ 348/* ----- HCI Commands ---- */
334#define HCI_OP_NOP 0x0000 349#define HCI_OP_NOP 0x0000
335 350
@@ -556,12 +571,46 @@ struct hci_cp_accept_phy_link {
556 __u8 key[HCI_AMP_LINK_KEY_SIZE]; 571 __u8 key[HCI_AMP_LINK_KEY_SIZE];
557} __packed; 572} __packed;
558 573
559#define HCI_OP_DISCONN_PHY_LINK 0x0437 574#define HCI_OP_DISCONN_PHY_LINK 0x0437
560struct hci_cp_disconn_phy_link { 575struct hci_cp_disconn_phy_link {
561 __u8 phy_handle; 576 __u8 phy_handle;
562 __u8 reason; 577 __u8 reason;
563} __packed; 578} __packed;
564 579
580struct ext_flow_spec {
581 __u8 id;
582 __u8 stype;
583 __le16 msdu;
584 __le32 sdu_itime;
585 __le32 acc_lat;
586 __le32 flush_to;
587} __packed;
588
589#define HCI_OP_CREATE_LOGICAL_LINK 0x0438
590#define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439
591struct hci_cp_create_accept_logical_link {
592 __u8 phy_handle;
593 struct ext_flow_spec tx_flow_spec;
594 struct ext_flow_spec rx_flow_spec;
595} __packed;
596
597#define HCI_OP_DISCONN_LOGICAL_LINK 0x043a
598struct hci_cp_disconn_logical_link {
599 __le16 log_handle;
600} __packed;
601
602#define HCI_OP_LOGICAL_LINK_CANCEL 0x043b
603struct hci_cp_logical_link_cancel {
604 __u8 phy_handle;
605 __u8 flow_spec_id;
606} __packed;
607
608struct hci_rp_logical_link_cancel {
609 __u8 status;
610 __u8 phy_handle;
611 __u8 flow_spec_id;
612} __packed;
613
565#define HCI_OP_SNIFF_MODE 0x0803 614#define HCI_OP_SNIFF_MODE 0x0803
566struct hci_cp_sniff_mode { 615struct hci_cp_sniff_mode {
567 __le16 handle; 616 __le16 handle;
@@ -894,6 +943,22 @@ struct hci_rp_le_read_buffer_size {
894 __u8 le_max_pkt; 943 __u8 le_max_pkt;
895} __packed; 944} __packed;
896 945
946#define HCI_OP_LE_READ_ADV_TX_POWER 0x2007
947struct hci_rp_le_read_adv_tx_power {
948 __u8 status;
949 __s8 tx_power;
950} __packed;
951
952#define HCI_MAX_AD_LENGTH 31
953
954#define HCI_OP_LE_SET_ADV_DATA 0x2008
955struct hci_cp_le_set_adv_data {
956 __u8 length;
957 __u8 data[HCI_MAX_AD_LENGTH];
958} __packed;
959
960#define HCI_OP_LE_SET_ADV_ENABLE 0x200a
961
897#define HCI_OP_LE_SET_SCAN_PARAM 0x200b 962#define HCI_OP_LE_SET_SCAN_PARAM 0x200b
898struct hci_cp_le_set_scan_param { 963struct hci_cp_le_set_scan_param {
899 __u8 type; 964 __u8 type;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index e7d454609881..014a2eaa5389 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -73,6 +73,7 @@ struct discovery_state {
73struct hci_conn_hash { 73struct hci_conn_hash {
74 struct list_head list; 74 struct list_head list;
75 unsigned int acl_num; 75 unsigned int acl_num;
76 unsigned int amp_num;
76 unsigned int sco_num; 77 unsigned int sco_num;
77 unsigned int le_num; 78 unsigned int le_num;
78}; 79};
@@ -124,6 +125,14 @@ struct le_scan_params {
124 125
125#define HCI_MAX_SHORT_NAME_LENGTH 10 126#define HCI_MAX_SHORT_NAME_LENGTH 10
126 127
128struct amp_assoc {
129 __u16 len;
130 __u16 offset;
131 __u16 rem_len;
132 __u16 len_so_far;
133 __u8 data[HCI_MAX_AMP_ASSOC_SIZE];
134};
135
127#define NUM_REASSEMBLY 4 136#define NUM_REASSEMBLY 4
128struct hci_dev { 137struct hci_dev {
129 struct list_head list; 138 struct list_head list;
@@ -177,6 +186,8 @@ struct hci_dev {
177 __u32 amp_max_flush_to; 186 __u32 amp_max_flush_to;
178 __u32 amp_be_flush_to; 187 __u32 amp_be_flush_to;
179 188
189 struct amp_assoc loc_assoc;
190
180 __u8 flow_ctl_mode; 191 __u8 flow_ctl_mode;
181 192
182 unsigned int auto_accept_delay; 193 unsigned int auto_accept_delay;
@@ -252,8 +263,6 @@ struct hci_dev {
252 263
253 struct sk_buff_head driver_init; 264 struct sk_buff_head driver_init;
254 265
255 void *core_data;
256
257 atomic_t promisc; 266 atomic_t promisc;
258 267
259 struct dentry *debugfs; 268 struct dentry *debugfs;
@@ -269,6 +278,10 @@ struct hci_dev {
269 struct work_struct le_scan; 278 struct work_struct le_scan;
270 struct le_scan_params le_scan_params; 279 struct le_scan_params le_scan_params;
271 280
281 __s8 adv_tx_power;
282 __u8 adv_data[HCI_MAX_AD_LENGTH];
283 __u8 adv_data_len;
284
272 int (*open)(struct hci_dev *hdev); 285 int (*open)(struct hci_dev *hdev);
273 int (*close)(struct hci_dev *hdev); 286 int (*close)(struct hci_dev *hdev);
274 int (*flush)(struct hci_dev *hdev); 287 int (*flush)(struct hci_dev *hdev);
@@ -277,6 +290,8 @@ struct hci_dev {
277 int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); 290 int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg);
278}; 291};
279 292
293#define HCI_PHY_HANDLE(handle) (handle & 0xff)
294
280struct hci_conn { 295struct hci_conn {
281 struct list_head list; 296 struct list_head list;
282 297
@@ -310,6 +325,7 @@ struct hci_conn {
310 325
311 __u8 remote_cap; 326 __u8 remote_cap;
312 __u8 remote_auth; 327 __u8 remote_auth;
328 __u8 remote_id;
313 bool flush_key; 329 bool flush_key;
314 330
315 unsigned int sent; 331 unsigned int sent;
@@ -339,10 +355,11 @@ struct hci_conn {
339 355
340struct hci_chan { 356struct hci_chan {
341 struct list_head list; 357 struct list_head list;
342 358 __u16 handle;
343 struct hci_conn *conn; 359 struct hci_conn *conn;
344 struct sk_buff_head data_q; 360 struct sk_buff_head data_q;
345 unsigned int sent; 361 unsigned int sent;
362 __u8 state;
346}; 363};
347 364
348extern struct list_head hci_dev_list; 365extern struct list_head hci_dev_list;
@@ -359,7 +376,7 @@ extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt);
359extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, 376extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb,
360 u16 flags); 377 u16 flags);
361 378
362extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); 379extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags);
363extern void sco_connect_cfm(struct hci_conn *hcon, __u8 status); 380extern void sco_connect_cfm(struct hci_conn *hcon, __u8 status);
364extern void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason); 381extern void sco_disconn_cfm(struct hci_conn *hcon, __u8 reason);
365extern int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb); 382extern int sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb);
@@ -438,6 +455,9 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
438 case ACL_LINK: 455 case ACL_LINK:
439 h->acl_num++; 456 h->acl_num++;
440 break; 457 break;
458 case AMP_LINK:
459 h->amp_num++;
460 break;
441 case LE_LINK: 461 case LE_LINK:
442 h->le_num++; 462 h->le_num++;
443 break; 463 break;
@@ -459,6 +479,9 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c)
459 case ACL_LINK: 479 case ACL_LINK:
460 h->acl_num--; 480 h->acl_num--;
461 break; 481 break;
482 case AMP_LINK:
483 h->amp_num--;
484 break;
462 case LE_LINK: 485 case LE_LINK:
463 h->le_num--; 486 h->le_num--;
464 break; 487 break;
@@ -475,6 +498,8 @@ static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type)
475 switch (type) { 498 switch (type) {
476 case ACL_LINK: 499 case ACL_LINK:
477 return h->acl_num; 500 return h->acl_num;
501 case AMP_LINK:
502 return h->amp_num;
478 case LE_LINK: 503 case LE_LINK:
479 return h->le_num; 504 return h->le_num;
480 case SCO_LINK: 505 case SCO_LINK:
@@ -552,10 +577,12 @@ struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst);
552int hci_conn_del(struct hci_conn *conn); 577int hci_conn_del(struct hci_conn *conn);
553void hci_conn_hash_flush(struct hci_dev *hdev); 578void hci_conn_hash_flush(struct hci_dev *hdev);
554void hci_conn_check_pending(struct hci_dev *hdev); 579void hci_conn_check_pending(struct hci_dev *hdev);
580void hci_conn_accept(struct hci_conn *conn, int mask);
555 581
556struct hci_chan *hci_chan_create(struct hci_conn *conn); 582struct hci_chan *hci_chan_create(struct hci_conn *conn);
557void hci_chan_del(struct hci_chan *chan); 583void hci_chan_del(struct hci_chan *chan);
558void hci_chan_list_flush(struct hci_conn *conn); 584void hci_chan_list_flush(struct hci_conn *conn);
585struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle);
559 586
560struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, 587struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
561 __u8 dst_type, __u8 sec_level, __u8 auth_type); 588 __u8 dst_type, __u8 sec_level, __u8 auth_type);
@@ -584,7 +611,10 @@ static inline void hci_conn_put(struct hci_conn *conn)
584 611
585 if (atomic_dec_and_test(&conn->refcnt)) { 612 if (atomic_dec_and_test(&conn->refcnt)) {
586 unsigned long timeo; 613 unsigned long timeo;
587 if (conn->type == ACL_LINK || conn->type == LE_LINK) { 614
615 switch (conn->type) {
616 case ACL_LINK:
617 case LE_LINK:
588 del_timer(&conn->idle_timer); 618 del_timer(&conn->idle_timer);
589 if (conn->state == BT_CONNECTED) { 619 if (conn->state == BT_CONNECTED) {
590 timeo = conn->disc_timeout; 620 timeo = conn->disc_timeout;
@@ -593,12 +623,20 @@ static inline void hci_conn_put(struct hci_conn *conn)
593 } else { 623 } else {
594 timeo = msecs_to_jiffies(10); 624 timeo = msecs_to_jiffies(10);
595 } 625 }
596 } else { 626 break;
627
628 case AMP_LINK:
629 timeo = conn->disc_timeout;
630 break;
631
632 default:
597 timeo = msecs_to_jiffies(10); 633 timeo = msecs_to_jiffies(10);
634 break;
598 } 635 }
636
599 cancel_delayed_work(&conn->disc_work); 637 cancel_delayed_work(&conn->disc_work);
600 queue_delayed_work(conn->hdev->workqueue, 638 queue_delayed_work(conn->hdev->workqueue,
601 &conn->disc_work, timeo); 639 &conn->disc_work, timeo);
602 } 640 }
603} 641}
604 642
@@ -650,7 +688,7 @@ static inline uint8_t __hci_num_ctrl(void)
650} 688}
651 689
652struct hci_dev *hci_dev_get(int index); 690struct hci_dev *hci_dev_get(int index);
653struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); 691struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src);
654 692
655struct hci_dev *hci_alloc_dev(void); 693struct hci_dev *hci_alloc_dev(void);
656void hci_free_dev(struct hci_dev *hdev); 694void hci_free_dev(struct hci_dev *hdev);
@@ -699,6 +737,8 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash,
699 u8 *randomizer); 737 u8 *randomizer);
700int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); 738int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr);
701 739
740int hci_update_ad(struct hci_dev *hdev);
741
702void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 742void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
703 743
704int hci_recv_frame(struct sk_buff *skb); 744int hci_recv_frame(struct sk_buff *skb);
@@ -715,22 +755,51 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
715#define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) 755#define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev))
716 756
717/* ----- LMP capabilities ----- */ 757/* ----- LMP capabilities ----- */
718#define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH)
719#define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) 758#define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT)
759#define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH)
760#define lmp_hold_capable(dev) ((dev)->features[0] & LMP_HOLD)
720#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) 761#define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF)
721#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) 762#define lmp_park_capable(dev) ((dev)->features[1] & LMP_PARK)
763#define lmp_inq_rssi_capable(dev) ((dev)->features[3] & LMP_RSSI_INQ)
722#define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) 764#define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO)
765#define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR))
766#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)
767#define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR)
768#define lmp_pause_enc_capable(dev) ((dev)->features[5] & LMP_PAUSE_ENC)
769#define lmp_ext_inq_capable(dev) ((dev)->features[6] & LMP_EXT_INQ)
770#define lmp_le_br_capable(dev) !!((dev)->features[6] & LMP_SIMUL_LE_BR)
723#define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) 771#define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR)
724#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) 772#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH)
725#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) 773#define lmp_lsto_capable(dev) ((dev)->features[7] & LMP_LSTO)
726#define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) 774#define lmp_inq_tx_pwr_capable(dev) ((dev)->features[7] & LMP_INQ_TX_PWR)
775#define lmp_ext_feat_capable(dev) ((dev)->features[7] & LMP_EXTFEATURES)
727 776
728/* ----- Extended LMP capabilities ----- */ 777/* ----- Extended LMP capabilities ----- */
729#define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) 778#define lmp_host_ssp_capable(dev) ((dev)->host_features[0] & LMP_HOST_SSP)
779#define lmp_host_le_capable(dev) !!((dev)->host_features[0] & LMP_HOST_LE)
780#define lmp_host_le_br_capable(dev) !!((dev)->host_features[0] & LMP_HOST_LE_BREDR)
781
782/* returns true if at least one AMP active */
783static inline bool hci_amp_capable(void)
784{
785 struct hci_dev *hdev;
786 bool ret = false;
787
788 read_lock(&hci_dev_list_lock);
789 list_for_each_entry(hdev, &hci_dev_list, list)
790 if (hdev->amp_type == HCI_AMP &&
791 test_bit(HCI_UP, &hdev->flags))
792 ret = true;
793 read_unlock(&hci_dev_list_lock);
794
795 return ret;
796}
730 797
731/* ----- HCI protocols ----- */ 798/* ----- HCI protocols ----- */
799#define HCI_PROTO_DEFER 0x01
800
732static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, 801static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
733 __u8 type) 802 __u8 type, __u8 *flags)
734{ 803{
735 switch (type) { 804 switch (type) {
736 case ACL_LINK: 805 case ACL_LINK:
@@ -738,7 +807,7 @@ static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
738 807
739 case SCO_LINK: 808 case SCO_LINK:
740 case ESCO_LINK: 809 case ESCO_LINK:
741 return sco_connect_ind(hdev, bdaddr); 810 return sco_connect_ind(hdev, bdaddr, flags);
742 811
743 default: 812 default:
744 BT_ERR("unknown link type %d", type); 813 BT_ERR("unknown link type %d", type);
@@ -789,6 +858,10 @@ static inline void hci_proto_disconn_cfm(struct hci_conn *conn, __u8 reason)
789 sco_disconn_cfm(conn, reason); 858 sco_disconn_cfm(conn, reason);
790 break; 859 break;
791 860
861 /* L2CAP would be handled for BREDR chan */
862 case AMP_LINK:
863 break;
864
792 default: 865 default:
793 BT_ERR("unknown link type %d", conn->type); 866 BT_ERR("unknown link type %d", conn->type);
794 break; 867 break;
@@ -841,7 +914,7 @@ struct hci_cb {
841 914
842static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) 915static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
843{ 916{
844 struct list_head *p; 917 struct hci_cb *cb;
845 __u8 encrypt; 918 __u8 encrypt;
846 919
847 hci_proto_auth_cfm(conn, status); 920 hci_proto_auth_cfm(conn, status);
@@ -852,8 +925,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
852 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; 925 encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00;
853 926
854 read_lock(&hci_cb_list_lock); 927 read_lock(&hci_cb_list_lock);
855 list_for_each(p, &hci_cb_list) { 928 list_for_each_entry(cb, &hci_cb_list, list) {
856 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
857 if (cb->security_cfm) 929 if (cb->security_cfm)
858 cb->security_cfm(conn, status, encrypt); 930 cb->security_cfm(conn, status, encrypt);
859 } 931 }
@@ -863,7 +935,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
863static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, 935static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
864 __u8 encrypt) 936 __u8 encrypt)
865{ 937{
866 struct list_head *p; 938 struct hci_cb *cb;
867 939
868 if (conn->sec_level == BT_SECURITY_SDP) 940 if (conn->sec_level == BT_SECURITY_SDP)
869 conn->sec_level = BT_SECURITY_LOW; 941 conn->sec_level = BT_SECURITY_LOW;
@@ -874,8 +946,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
874 hci_proto_encrypt_cfm(conn, status, encrypt); 946 hci_proto_encrypt_cfm(conn, status, encrypt);
875 947
876 read_lock(&hci_cb_list_lock); 948 read_lock(&hci_cb_list_lock);
877 list_for_each(p, &hci_cb_list) { 949 list_for_each_entry(cb, &hci_cb_list, list) {
878 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
879 if (cb->security_cfm) 950 if (cb->security_cfm)
880 cb->security_cfm(conn, status, encrypt); 951 cb->security_cfm(conn, status, encrypt);
881 } 952 }
@@ -884,11 +955,10 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
884 955
885static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) 956static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
886{ 957{
887 struct list_head *p; 958 struct hci_cb *cb;
888 959
889 read_lock(&hci_cb_list_lock); 960 read_lock(&hci_cb_list_lock);
890 list_for_each(p, &hci_cb_list) { 961 list_for_each_entry(cb, &hci_cb_list, list) {
891 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
892 if (cb->key_change_cfm) 962 if (cb->key_change_cfm)
893 cb->key_change_cfm(conn, status); 963 cb->key_change_cfm(conn, status);
894 } 964 }
@@ -898,11 +968,10 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
898static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, 968static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status,
899 __u8 role) 969 __u8 role)
900{ 970{
901 struct list_head *p; 971 struct hci_cb *cb;
902 972
903 read_lock(&hci_cb_list_lock); 973 read_lock(&hci_cb_list_lock);
904 list_for_each(p, &hci_cb_list) { 974 list_for_each_entry(cb, &hci_cb_list, list) {
905 struct hci_cb *cb = list_entry(p, struct hci_cb, list);
906 if (cb->role_switch_cfm) 975 if (cb->role_switch_cfm)
907 cb->role_switch_cfm(conn, status, role); 976 cb->role_switch_cfm(conn, status, role);
908 } 977 }
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 7ed8e356425a..7588ef44ebaf 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -32,13 +32,14 @@
32/* L2CAP defaults */ 32/* L2CAP defaults */
33#define L2CAP_DEFAULT_MTU 672 33#define L2CAP_DEFAULT_MTU 672
34#define L2CAP_DEFAULT_MIN_MTU 48 34#define L2CAP_DEFAULT_MIN_MTU 48
35#define L2CAP_DEFAULT_FLUSH_TO 0xffff 35#define L2CAP_DEFAULT_FLUSH_TO 0xFFFF
36#define L2CAP_EFS_DEFAULT_FLUSH_TO 0xFFFFFFFF
36#define L2CAP_DEFAULT_TX_WINDOW 63 37#define L2CAP_DEFAULT_TX_WINDOW 63
37#define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF 38#define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF
38#define L2CAP_DEFAULT_MAX_TX 3 39#define L2CAP_DEFAULT_MAX_TX 3
39#define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ 40#define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */
40#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ 41#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */
41#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ 42#define L2CAP_DEFAULT_MAX_PDU_SIZE 1492 /* Sized for AMP packet */
42#define L2CAP_DEFAULT_ACK_TO 200 43#define L2CAP_DEFAULT_ACK_TO 200
43#define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF 44#define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF
44#define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF 45#define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF
@@ -51,6 +52,8 @@
51#define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) 52#define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000)
52#define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) 53#define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000)
53#define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) 54#define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000)
55#define L2CAP_MOVE_TIMEOUT msecs_to_jiffies(4000)
56#define L2CAP_MOVE_ERTX_TIMEOUT msecs_to_jiffies(60000)
54 57
55#define L2CAP_A2MP_DEFAULT_MTU 670 58#define L2CAP_A2MP_DEFAULT_MTU 670
56 59
@@ -433,6 +436,8 @@ struct l2cap_chan {
433 struct sock *sk; 436 struct sock *sk;
434 437
435 struct l2cap_conn *conn; 438 struct l2cap_conn *conn;
439 struct hci_conn *hs_hcon;
440 struct hci_chan *hs_hchan;
436 struct kref kref; 441 struct kref kref;
437 442
438 __u8 state; 443 __u8 state;
@@ -476,6 +481,12 @@ struct l2cap_chan {
476 unsigned long conn_state; 481 unsigned long conn_state;
477 unsigned long flags; 482 unsigned long flags;
478 483
484 __u8 remote_amp_id;
485 __u8 local_amp_id;
486 __u8 move_id;
487 __u8 move_state;
488 __u8 move_role;
489
479 __u16 next_tx_seq; 490 __u16 next_tx_seq;
480 __u16 expected_ack_seq; 491 __u16 expected_ack_seq;
481 __u16 expected_tx_seq; 492 __u16 expected_tx_seq;
@@ -538,6 +549,7 @@ struct l2cap_ops {
538 void (*state_change) (struct l2cap_chan *chan, 549 void (*state_change) (struct l2cap_chan *chan,
539 int state); 550 int state);
540 void (*ready) (struct l2cap_chan *chan); 551 void (*ready) (struct l2cap_chan *chan);
552 void (*defer) (struct l2cap_chan *chan);
541 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, 553 struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan,
542 unsigned long len, int nb); 554 unsigned long len, int nb);
543}; 555};
@@ -599,7 +611,7 @@ enum {
599 CONF_MTU_DONE, 611 CONF_MTU_DONE,
600 CONF_MODE_DONE, 612 CONF_MODE_DONE,
601 CONF_CONNECT_PEND, 613 CONF_CONNECT_PEND,
602 CONF_NO_FCS_RECV, 614 CONF_RECV_NO_FCS,
603 CONF_STATE2_DEVICE, 615 CONF_STATE2_DEVICE,
604 CONF_EWS_RECV, 616 CONF_EWS_RECV,
605 CONF_LOC_CONF_PEND, 617 CONF_LOC_CONF_PEND,
@@ -640,6 +652,9 @@ enum {
640enum { 652enum {
641 L2CAP_RX_STATE_RECV, 653 L2CAP_RX_STATE_RECV,
642 L2CAP_RX_STATE_SREJ_SENT, 654 L2CAP_RX_STATE_SREJ_SENT,
655 L2CAP_RX_STATE_MOVE,
656 L2CAP_RX_STATE_WAIT_P,
657 L2CAP_RX_STATE_WAIT_F,
643}; 658};
644 659
645enum { 660enum {
@@ -670,6 +685,25 @@ enum {
670 L2CAP_EV_RECV_FRAME, 685 L2CAP_EV_RECV_FRAME,
671}; 686};
672 687
688enum {
689 L2CAP_MOVE_ROLE_NONE,
690 L2CAP_MOVE_ROLE_INITIATOR,
691 L2CAP_MOVE_ROLE_RESPONDER,
692};
693
694enum {
695 L2CAP_MOVE_STABLE,
696 L2CAP_MOVE_WAIT_REQ,
697 L2CAP_MOVE_WAIT_RSP,
698 L2CAP_MOVE_WAIT_RSP_SUCCESS,
699 L2CAP_MOVE_WAIT_CONFIRM,
700 L2CAP_MOVE_WAIT_CONFIRM_RSP,
701 L2CAP_MOVE_WAIT_LOGICAL_COMP,
702 L2CAP_MOVE_WAIT_LOGICAL_CFM,
703 L2CAP_MOVE_WAIT_LOCAL_BUSY,
704 L2CAP_MOVE_WAIT_PREPARE,
705};
706
673void l2cap_chan_hold(struct l2cap_chan *c); 707void l2cap_chan_hold(struct l2cap_chan *c);
674void l2cap_chan_put(struct l2cap_chan *c); 708void l2cap_chan_put(struct l2cap_chan *c);
675 709
@@ -745,6 +779,10 @@ static inline void l2cap_chan_no_ready(struct l2cap_chan *chan)
745{ 779{
746} 780}
747 781
782static inline void l2cap_chan_no_defer(struct l2cap_chan *chan)
783{
784}
785
748extern bool disable_ertm; 786extern bool disable_ertm;
749 787
750int l2cap_init_sockets(void); 788int l2cap_init_sockets(void);
@@ -767,6 +805,12 @@ int l2cap_chan_check_security(struct l2cap_chan *chan);
767void l2cap_chan_set_defaults(struct l2cap_chan *chan); 805void l2cap_chan_set_defaults(struct l2cap_chan *chan);
768int l2cap_ertm_init(struct l2cap_chan *chan); 806int l2cap_ertm_init(struct l2cap_chan *chan);
769void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); 807void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan);
808void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan);
770void l2cap_chan_del(struct l2cap_chan *chan, int err); 809void l2cap_chan_del(struct l2cap_chan *chan, int err);
810void l2cap_send_conn_req(struct l2cap_chan *chan);
811void l2cap_move_start(struct l2cap_chan *chan);
812void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan,
813 u8 status);
814void __l2cap_physical_cfm(struct l2cap_chan *chan, int result);
771 815
772#endif /* __L2CAP_H */ 816#endif /* __L2CAP_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 7d5b6000378b..8e6a6b73b9c9 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -58,6 +58,8 @@
58 * structures here describe these capabilities in detail. 58 * structures here describe these capabilities in detail.
59 */ 59 */
60 60
61struct wiphy;
62
61/* 63/*
62 * wireless hardware capability structures 64 * wireless hardware capability structures
63 */ 65 */
@@ -306,6 +308,104 @@ struct key_params {
306}; 308};
307 309
308/** 310/**
311 * struct cfg80211_chan_def - channel definition
312 * @chan: the (control) channel
313 * @width: channel width
314 * @center_freq1: center frequency of first segment
315 * @center_freq2: center frequency of second segment
316 * (only with 80+80 MHz)
317 */
318struct cfg80211_chan_def {
319 struct ieee80211_channel *chan;
320 enum nl80211_chan_width width;
321 u32 center_freq1;
322 u32 center_freq2;
323};
324
325/**
326 * cfg80211_get_chandef_type - return old channel type from chandef
327 * @chandef: the channel definition
328 *
329 * Returns the old channel type (NOHT, HT20, HT40+/-) from a given
330 * chandef, which must have a bandwidth allowing this conversion.
331 */
332static inline enum nl80211_channel_type
333cfg80211_get_chandef_type(const struct cfg80211_chan_def *chandef)
334{
335 switch (chandef->width) {
336 case NL80211_CHAN_WIDTH_20_NOHT:
337 return NL80211_CHAN_NO_HT;
338 case NL80211_CHAN_WIDTH_20:
339 return NL80211_CHAN_HT20;
340 case NL80211_CHAN_WIDTH_40:
341 if (chandef->center_freq1 > chandef->chan->center_freq)
342 return NL80211_CHAN_HT40PLUS;
343 return NL80211_CHAN_HT40MINUS;
344 default:
345 WARN_ON(1);
346 return NL80211_CHAN_NO_HT;
347 }
348}
349
350/**
351 * cfg80211_chandef_create - create channel definition using channel type
352 * @chandef: the channel definition struct to fill
353 * @channel: the control channel
354 * @chantype: the channel type
355 *
356 * Given a channel type, create a channel definition.
357 */
358void cfg80211_chandef_create(struct cfg80211_chan_def *chandef,
359 struct ieee80211_channel *channel,
360 enum nl80211_channel_type chantype);
361
362/**
363 * cfg80211_chandef_identical - check if two channel definitions are identical
364 * @chandef1: first channel definition
365 * @chandef2: second channel definition
366 *
367 * Returns %true if the channels defined by the channel definitions are
368 * identical, %false otherwise.
369 */
370static inline bool
371cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef1,
372 const struct cfg80211_chan_def *chandef2)
373{
374 return (chandef1->chan == chandef2->chan &&
375 chandef1->width == chandef2->width &&
376 chandef1->center_freq1 == chandef2->center_freq1 &&
377 chandef1->center_freq2 == chandef2->center_freq2);
378}
379
380/**
381 * cfg80211_chandef_compatible - check if two channel definitions are compatible
382 * @chandef1: first channel definition
383 * @chandef2: second channel definition
384 *
385 * Returns %NULL if the given channel definitions are incompatible,
386 * chandef1 or chandef2 otherwise.
387 */
388const struct cfg80211_chan_def *
389cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1,
390 const struct cfg80211_chan_def *chandef2);
391
392/**
393 * cfg80211_chandef_valid - check if a channel definition is valid
394 * @chandef: the channel definition to check
395 */
396bool cfg80211_chandef_valid(const struct cfg80211_chan_def *chandef);
397
398/**
399 * cfg80211_chandef_usable - check if secondary channels can be used
400 * @wiphy: the wiphy to validate against
401 * @chandef: the channel definition to check
402 * @prohibited_flags: the regulatory chanenl flags that must not be set
403 */
404bool cfg80211_chandef_usable(struct wiphy *wiphy,
405 const struct cfg80211_chan_def *chandef,
406 u32 prohibited_flags);
407
408/**
309 * enum survey_info_flags - survey information flags 409 * enum survey_info_flags - survey information flags
310 * 410 *
311 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in 411 * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in
@@ -426,8 +526,7 @@ struct cfg80211_beacon_data {
426 * 526 *
427 * Used to configure an AP interface. 527 * Used to configure an AP interface.
428 * 528 *
429 * @channel: the channel to start the AP on 529 * @chandef: defines the channel to use
430 * @channel_type: the channel type to use
431 * @beacon: beacon data 530 * @beacon: beacon data
432 * @beacon_interval: beacon interval 531 * @beacon_interval: beacon interval
433 * @dtim_period: DTIM period 532 * @dtim_period: DTIM period
@@ -439,10 +538,11 @@ struct cfg80211_beacon_data {
439 * @privacy: the BSS uses privacy 538 * @privacy: the BSS uses privacy
440 * @auth_type: Authentication type (algorithm) 539 * @auth_type: Authentication type (algorithm)
441 * @inactivity_timeout: time in seconds to determine station's inactivity. 540 * @inactivity_timeout: time in seconds to determine station's inactivity.
541 * @p2p_ctwindow: P2P CT Window
542 * @p2p_opp_ps: P2P opportunistic PS
442 */ 543 */
443struct cfg80211_ap_settings { 544struct cfg80211_ap_settings {
444 struct ieee80211_channel *channel; 545 struct cfg80211_chan_def chandef;
445 enum nl80211_channel_type channel_type;
446 546
447 struct cfg80211_beacon_data beacon; 547 struct cfg80211_beacon_data beacon;
448 548
@@ -454,6 +554,8 @@ struct cfg80211_ap_settings {
454 bool privacy; 554 bool privacy;
455 enum nl80211_auth_type auth_type; 555 enum nl80211_auth_type auth_type;
456 int inactivity_timeout; 556 int inactivity_timeout;
557 u8 p2p_ctwindow;
558 bool p2p_opp_ps;
457}; 559};
458 560
459/** 561/**
@@ -498,6 +600,7 @@ enum station_parameters_apply_mask {
498 * @plink_action: plink action to take 600 * @plink_action: plink action to take
499 * @plink_state: set the peer link state for a station 601 * @plink_state: set the peer link state for a station
500 * @ht_capa: HT capabilities of station 602 * @ht_capa: HT capabilities of station
603 * @vht_capa: VHT capabilities of station
501 * @uapsd_queues: bitmap of queues configured for uapsd. same format 604 * @uapsd_queues: bitmap of queues configured for uapsd. same format
502 * as the AC bitmap in the QoS info field 605 * as the AC bitmap in the QoS info field
503 * @max_sp: max Service Period. same format as the MAX_SP in the 606 * @max_sp: max Service Period. same format as the MAX_SP in the
@@ -517,6 +620,7 @@ struct station_parameters {
517 u8 plink_action; 620 u8 plink_action;
518 u8 plink_state; 621 u8 plink_state;
519 struct ieee80211_ht_cap *ht_capa; 622 struct ieee80211_ht_cap *ht_capa;
623 struct ieee80211_vht_cap *vht_capa;
520 u8 uapsd_queues; 624 u8 uapsd_queues;
521 u8 max_sp; 625 u8 max_sp;
522}; 626};
@@ -580,16 +684,24 @@ enum station_info_flags {
580 * Used by the driver to indicate the specific rate transmission 684 * Used by the driver to indicate the specific rate transmission
581 * type for 802.11n transmissions. 685 * type for 802.11n transmissions.
582 * 686 *
583 * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled 687 * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS
584 * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission 688 * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS
689 * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 MHz width transmission
690 * @RATE_INFO_FLAGS_80_MHZ_WIDTH: 80 MHz width transmission
691 * @RATE_INFO_FLAGS_80P80_MHZ_WIDTH: 80+80 MHz width transmission
692 * @RATE_INFO_FLAGS_160_MHZ_WIDTH: 160 MHz width transmission
585 * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval 693 * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval
586 * @RATE_INFO_FLAGS_60G: 60gHz MCS 694 * @RATE_INFO_FLAGS_60G: 60GHz MCS
587 */ 695 */
588enum rate_info_flags { 696enum rate_info_flags {
589 RATE_INFO_FLAGS_MCS = 1<<0, 697 RATE_INFO_FLAGS_MCS = BIT(0),
590 RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1, 698 RATE_INFO_FLAGS_VHT_MCS = BIT(1),
591 RATE_INFO_FLAGS_SHORT_GI = 1<<2, 699 RATE_INFO_FLAGS_40_MHZ_WIDTH = BIT(2),
592 RATE_INFO_FLAGS_60G = 1<<3, 700 RATE_INFO_FLAGS_80_MHZ_WIDTH = BIT(3),
701 RATE_INFO_FLAGS_80P80_MHZ_WIDTH = BIT(4),
702 RATE_INFO_FLAGS_160_MHZ_WIDTH = BIT(5),
703 RATE_INFO_FLAGS_SHORT_GI = BIT(6),
704 RATE_INFO_FLAGS_60G = BIT(7),
593}; 705};
594 706
595/** 707/**
@@ -600,11 +712,13 @@ enum rate_info_flags {
600 * @flags: bitflag of flags from &enum rate_info_flags 712 * @flags: bitflag of flags from &enum rate_info_flags
601 * @mcs: mcs index if struct describes a 802.11n bitrate 713 * @mcs: mcs index if struct describes a 802.11n bitrate
602 * @legacy: bitrate in 100kbit/s for 802.11abg 714 * @legacy: bitrate in 100kbit/s for 802.11abg
715 * @nss: number of streams (VHT only)
603 */ 716 */
604struct rate_info { 717struct rate_info {
605 u8 flags; 718 u8 flags;
606 u8 mcs; 719 u8 mcs;
607 u16 legacy; 720 u16 legacy;
721 u8 nss;
608}; 722};
609 723
610/** 724/**
@@ -803,6 +917,8 @@ struct mpath_info {
803 * @ap_isolate: do not forward packets between connected stations 917 * @ap_isolate: do not forward packets between connected stations
804 * @ht_opmode: HT Operation mode 918 * @ht_opmode: HT Operation mode
805 * (u16 = opmode, -1 = do not change) 919 * (u16 = opmode, -1 = do not change)
920 * @p2p_ctwindow: P2P CT Window (-1 = no change)
921 * @p2p_opp_ps: P2P opportunistic PS (-1 = no change)
806 */ 922 */
807struct bss_parameters { 923struct bss_parameters {
808 int use_cts_prot; 924 int use_cts_prot;
@@ -812,6 +928,7 @@ struct bss_parameters {
812 u8 basic_rates_len; 928 u8 basic_rates_len;
813 int ap_isolate; 929 int ap_isolate;
814 int ht_opmode; 930 int ht_opmode;
931 s8 p2p_ctwindow, p2p_opp_ps;
815}; 932};
816 933
817/** 934/**
@@ -907,8 +1024,7 @@ struct mesh_config {
907 1024
908/** 1025/**
909 * struct mesh_setup - 802.11s mesh setup configuration 1026 * struct mesh_setup - 802.11s mesh setup configuration
910 * @channel: the channel to start the mesh network on 1027 * @chandef: defines the channel to use
911 * @channel_type: the channel type to use
912 * @mesh_id: the mesh ID 1028 * @mesh_id: the mesh ID
913 * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes 1029 * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes
914 * @sync_method: which synchronization method to use 1030 * @sync_method: which synchronization method to use
@@ -923,8 +1039,7 @@ struct mesh_config {
923 * These parameters are fixed when the mesh is created. 1039 * These parameters are fixed when the mesh is created.
924 */ 1040 */
925struct mesh_setup { 1041struct mesh_setup {
926 struct ieee80211_channel *channel; 1042 struct cfg80211_chan_def chandef;
927 enum nl80211_channel_type channel_type;
928 const u8 *mesh_id; 1043 const u8 *mesh_id;
929 u8 mesh_id_len; 1044 u8 mesh_id_len;
930 u8 sync_method; 1045 u8 sync_method;
@@ -955,9 +1070,6 @@ struct ieee80211_txq_params {
955 u8 aifs; 1070 u8 aifs;
956}; 1071};
957 1072
958/* from net/wireless.h */
959struct wiphy;
960
961/** 1073/**
962 * DOC: Scanning and BSS list handling 1074 * DOC: Scanning and BSS list handling
963 * 1075 *
@@ -1000,8 +1112,10 @@ struct cfg80211_ssid {
1000 * @n_channels: total number of channels to scan 1112 * @n_channels: total number of channels to scan
1001 * @ie: optional information element(s) to add into Probe Request or %NULL 1113 * @ie: optional information element(s) to add into Probe Request or %NULL
1002 * @ie_len: length of ie in octets 1114 * @ie_len: length of ie in octets
1115 * @flags: bit field of flags controlling operation
1003 * @rates: bitmap of rates to advertise for each band 1116 * @rates: bitmap of rates to advertise for each band
1004 * @wiphy: the wiphy this was for 1117 * @wiphy: the wiphy this was for
1118 * @scan_start: time (in jiffies) when the scan started
1005 * @wdev: the wireless device to scan for 1119 * @wdev: the wireless device to scan for
1006 * @aborted: (internal) scan request was notified as aborted 1120 * @aborted: (internal) scan request was notified as aborted
1007 * @no_cck: used to send probe requests at non CCK rate in 2GHz band 1121 * @no_cck: used to send probe requests at non CCK rate in 2GHz band
@@ -1012,6 +1126,7 @@ struct cfg80211_scan_request {
1012 u32 n_channels; 1126 u32 n_channels;
1013 const u8 *ie; 1127 const u8 *ie;
1014 size_t ie_len; 1128 size_t ie_len;
1129 u32 flags;
1015 1130
1016 u32 rates[IEEE80211_NUM_BANDS]; 1131 u32 rates[IEEE80211_NUM_BANDS];
1017 1132
@@ -1019,6 +1134,7 @@ struct cfg80211_scan_request {
1019 1134
1020 /* internal */ 1135 /* internal */
1021 struct wiphy *wiphy; 1136 struct wiphy *wiphy;
1137 unsigned long scan_start;
1022 bool aborted; 1138 bool aborted;
1023 bool no_cck; 1139 bool no_cck;
1024 1140
@@ -1044,6 +1160,7 @@ struct cfg80211_match_set {
1044 * @interval: interval between each scheduled scan cycle 1160 * @interval: interval between each scheduled scan cycle
1045 * @ie: optional information element(s) to add into Probe Request or %NULL 1161 * @ie: optional information element(s) to add into Probe Request or %NULL
1046 * @ie_len: length of ie in octets 1162 * @ie_len: length of ie in octets
1163 * @flags: bit field of flags controlling operation
1047 * @match_sets: sets of parameters to be matched for a scan result 1164 * @match_sets: sets of parameters to be matched for a scan result
1048 * entry to be considered valid and to be passed to the host 1165 * entry to be considered valid and to be passed to the host
1049 * (others are filtered out). 1166 * (others are filtered out).
@@ -1061,6 +1178,7 @@ struct cfg80211_sched_scan_request {
1061 u32 interval; 1178 u32 interval;
1062 const u8 *ie; 1179 const u8 *ie;
1063 size_t ie_len; 1180 size_t ie_len;
1181 u32 flags;
1064 struct cfg80211_match_set *match_sets; 1182 struct cfg80211_match_set *match_sets;
1065 int n_match_sets; 1183 int n_match_sets;
1066 s32 rssi_thold; 1184 s32 rssi_thold;
@@ -1068,6 +1186,7 @@ struct cfg80211_sched_scan_request {
1068 /* internal */ 1186 /* internal */
1069 struct wiphy *wiphy; 1187 struct wiphy *wiphy;
1070 struct net_device *dev; 1188 struct net_device *dev;
1189 unsigned long scan_start;
1071 1190
1072 /* keep last */ 1191 /* keep last */
1073 struct ieee80211_channel *channels[0]; 1192 struct ieee80211_channel *channels[0];
@@ -1087,6 +1206,18 @@ enum cfg80211_signal_type {
1087}; 1206};
1088 1207
1089/** 1208/**
1209 * struct cfg80211_bss_ie_data - BSS entry IE data
1210 * @rcu_head: internal use, for freeing
1211 * @len: length of the IEs
1212 * @data: IE data
1213 */
1214struct cfg80211_bss_ies {
1215 struct rcu_head rcu_head;
1216 int len;
1217 u8 data[];
1218};
1219
1220/**
1090 * struct cfg80211_bss - BSS description 1221 * struct cfg80211_bss - BSS description
1091 * 1222 *
1092 * This structure describes a BSS (which may also be a mesh network) 1223 * This structure describes a BSS (which may also be a mesh network)
@@ -1097,36 +1228,34 @@ enum cfg80211_signal_type {
1097 * @tsf: timestamp of last received update 1228 * @tsf: timestamp of last received update
1098 * @beacon_interval: the beacon interval as from the frame 1229 * @beacon_interval: the beacon interval as from the frame
1099 * @capability: the capability field in host byte order 1230 * @capability: the capability field in host byte order
1100 * @information_elements: the information elements (Note that there 1231 * @ies: the information elements (Note that there
1101 * is no guarantee that these are well-formed!); this is a pointer to 1232 * is no guarantee that these are well-formed!); this is a pointer to
1102 * either the beacon_ies or proberesp_ies depending on whether Probe 1233 * either the beacon_ies or proberesp_ies depending on whether Probe
1103 * Response frame has been received 1234 * Response frame has been received
1104 * @len_information_elements: total length of the information elements
1105 * @beacon_ies: the information elements from the last Beacon frame 1235 * @beacon_ies: the information elements from the last Beacon frame
1106 * @len_beacon_ies: total length of the beacon_ies
1107 * @proberesp_ies: the information elements from the last Probe Response frame 1236 * @proberesp_ies: the information elements from the last Probe Response frame
1108 * @len_proberesp_ies: total length of the proberesp_ies
1109 * @signal: signal strength value (type depends on the wiphy's signal_type) 1237 * @signal: signal strength value (type depends on the wiphy's signal_type)
1110 * @free_priv: function pointer to free private data 1238 * @free_priv: function pointer to free private data
1111 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes 1239 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
1112 */ 1240 */
1113struct cfg80211_bss { 1241struct cfg80211_bss {
1242 u64 tsf;
1243
1114 struct ieee80211_channel *channel; 1244 struct ieee80211_channel *channel;
1115 1245
1116 u8 bssid[ETH_ALEN]; 1246 const struct cfg80211_bss_ies __rcu *ies;
1117 u64 tsf; 1247 const struct cfg80211_bss_ies __rcu *beacon_ies;
1248 const struct cfg80211_bss_ies __rcu *proberesp_ies;
1249
1250 void (*free_priv)(struct cfg80211_bss *bss);
1251
1252 s32 signal;
1253
1118 u16 beacon_interval; 1254 u16 beacon_interval;
1119 u16 capability; 1255 u16 capability;
1120 u8 *information_elements;
1121 size_t len_information_elements;
1122 u8 *beacon_ies;
1123 size_t len_beacon_ies;
1124 u8 *proberesp_ies;
1125 size_t len_proberesp_ies;
1126 1256
1127 s32 signal; 1257 u8 bssid[ETH_ALEN];
1128 1258
1129 void (*free_priv)(struct cfg80211_bss *bss);
1130 u8 priv[0] __attribute__((__aligned__(sizeof(void *)))); 1259 u8 priv[0] __attribute__((__aligned__(sizeof(void *))));
1131}; 1260};
1132 1261
@@ -1134,6 +1263,9 @@ struct cfg80211_bss {
1134 * ieee80211_bss_get_ie - find IE with given ID 1263 * ieee80211_bss_get_ie - find IE with given ID
1135 * @bss: the bss to search 1264 * @bss: the bss to search
1136 * @ie: the IE ID 1265 * @ie: the IE ID
1266 *
1267 * Note that the return value is an RCU-protected pointer, so
1268 * rcu_read_lock() must be held when calling this function.
1137 * Returns %NULL if not found. 1269 * Returns %NULL if not found.
1138 */ 1270 */
1139const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie); 1271const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
@@ -1152,6 +1284,9 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
1152 * @key_len: length of WEP key for shared key authentication 1284 * @key_len: length of WEP key for shared key authentication
1153 * @key_idx: index of WEP key for shared key authentication 1285 * @key_idx: index of WEP key for shared key authentication
1154 * @key: WEP key for shared key authentication 1286 * @key: WEP key for shared key authentication
1287 * @sae_data: Non-IE data to use with SAE or %NULL. This starts with
1288 * Authentication transaction sequence number field.
1289 * @sae_data_len: Length of sae_data buffer in octets
1155 */ 1290 */
1156struct cfg80211_auth_request { 1291struct cfg80211_auth_request {
1157 struct cfg80211_bss *bss; 1292 struct cfg80211_bss *bss;
@@ -1160,6 +1295,8 @@ struct cfg80211_auth_request {
1160 enum nl80211_auth_type auth_type; 1295 enum nl80211_auth_type auth_type;
1161 const u8 *key; 1296 const u8 *key;
1162 u8 key_len, key_idx; 1297 u8 key_len, key_idx;
1298 const u8 *sae_data;
1299 size_t sae_data_len;
1163}; 1300};
1164 1301
1165/** 1302/**
@@ -1252,8 +1389,7 @@ struct cfg80211_disassoc_request {
1252 * @ssid_len: The length of the SSID, will always be non-zero. 1389 * @ssid_len: The length of the SSID, will always be non-zero.
1253 * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not 1390 * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not
1254 * search for IBSSs with a different BSSID. 1391 * search for IBSSs with a different BSSID.
1255 * @channel: The channel to use if no IBSS can be found to join. 1392 * @chandef: defines the channel to use if no other IBSS to join can be found
1256 * @channel_type: channel type (HT mode)
1257 * @channel_fixed: The channel should be fixed -- do not search for 1393 * @channel_fixed: The channel should be fixed -- do not search for
1258 * IBSSs to join on other channels. 1394 * IBSSs to join on other channels.
1259 * @ie: information element(s) to include in the beacon 1395 * @ie: information element(s) to include in the beacon
@@ -1271,8 +1407,7 @@ struct cfg80211_disassoc_request {
1271struct cfg80211_ibss_params { 1407struct cfg80211_ibss_params {
1272 u8 *ssid; 1408 u8 *ssid;
1273 u8 *bssid; 1409 u8 *bssid;
1274 struct ieee80211_channel *channel; 1410 struct cfg80211_chan_def chandef;
1275 enum nl80211_channel_type channel_type;
1276 u8 *ie; 1411 u8 *ie;
1277 u8 ssid_len, ie_len; 1412 u8 ssid_len, ie_len;
1278 u16 beacon_interval; 1413 u16 beacon_interval;
@@ -1531,13 +1666,19 @@ struct cfg80211_gtk_rekey_data {
1531 * to a merge. 1666 * to a merge.
1532 * @leave_ibss: Leave the IBSS. 1667 * @leave_ibss: Leave the IBSS.
1533 * 1668 *
1669 * @set_mcast_rate: Set the specified multicast rate (only if vif is in ADHOC or
1670 * MESH mode)
1671 *
1534 * @set_wiphy_params: Notify that wiphy parameters have changed; 1672 * @set_wiphy_params: Notify that wiphy parameters have changed;
1535 * @changed bitfield (see &enum wiphy_params_flags) describes which values 1673 * @changed bitfield (see &enum wiphy_params_flags) describes which values
1536 * have changed. The actual parameter values are available in 1674 * have changed. The actual parameter values are available in
1537 * struct wiphy. If returning an error, no value should be changed. 1675 * struct wiphy. If returning an error, no value should be changed.
1538 * 1676 *
1539 * @set_tx_power: set the transmit power according to the parameters, 1677 * @set_tx_power: set the transmit power according to the parameters,
1540 * the power passed is in mBm, to get dBm use MBM_TO_DBM(). 1678 * the power passed is in mBm, to get dBm use MBM_TO_DBM(). The
1679 * wdev may be %NULL if power was set for the wiphy, and will
1680 * always be %NULL unless the driver supports per-vif TX power
1681 * (as advertised by the nl80211 feature flag.)
1541 * @get_tx_power: store the current TX power into the dbm variable; 1682 * @get_tx_power: store the current TX power into the dbm variable;
1542 * return 0 if successful 1683 * return 0 if successful
1543 * 1684 *
@@ -1708,8 +1849,7 @@ struct cfg80211_ops {
1708 struct ieee80211_channel *chan); 1849 struct ieee80211_channel *chan);
1709 1850
1710 int (*set_monitor_channel)(struct wiphy *wiphy, 1851 int (*set_monitor_channel)(struct wiphy *wiphy,
1711 struct ieee80211_channel *chan, 1852 struct cfg80211_chan_def *chandef);
1712 enum nl80211_channel_type channel_type);
1713 1853
1714 int (*scan)(struct wiphy *wiphy, 1854 int (*scan)(struct wiphy *wiphy,
1715 struct cfg80211_scan_request *request); 1855 struct cfg80211_scan_request *request);
@@ -1732,11 +1872,15 @@ struct cfg80211_ops {
1732 struct cfg80211_ibss_params *params); 1872 struct cfg80211_ibss_params *params);
1733 int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); 1873 int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev);
1734 1874
1875 int (*set_mcast_rate)(struct wiphy *wiphy, struct net_device *dev,
1876 int rate[IEEE80211_NUM_BANDS]);
1877
1735 int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); 1878 int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed);
1736 1879
1737 int (*set_tx_power)(struct wiphy *wiphy, 1880 int (*set_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
1738 enum nl80211_tx_power_setting type, int mbm); 1881 enum nl80211_tx_power_setting type, int mbm);
1739 int (*get_tx_power)(struct wiphy *wiphy, int *dbm); 1882 int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
1883 int *dbm);
1740 1884
1741 int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, 1885 int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev,
1742 const u8 *addr); 1886 const u8 *addr);
@@ -1767,7 +1911,6 @@ struct cfg80211_ops {
1767 int (*remain_on_channel)(struct wiphy *wiphy, 1911 int (*remain_on_channel)(struct wiphy *wiphy,
1768 struct wireless_dev *wdev, 1912 struct wireless_dev *wdev,
1769 struct ieee80211_channel *chan, 1913 struct ieee80211_channel *chan,
1770 enum nl80211_channel_type channel_type,
1771 unsigned int duration, 1914 unsigned int duration,
1772 u64 *cookie); 1915 u64 *cookie);
1773 int (*cancel_remain_on_channel)(struct wiphy *wiphy, 1916 int (*cancel_remain_on_channel)(struct wiphy *wiphy,
@@ -1776,10 +1919,8 @@ struct cfg80211_ops {
1776 1919
1777 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, 1920 int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev,
1778 struct ieee80211_channel *chan, bool offchan, 1921 struct ieee80211_channel *chan, bool offchan,
1779 enum nl80211_channel_type channel_type, 1922 unsigned int wait, const u8 *buf, size_t len,
1780 bool channel_type_valid, unsigned int wait, 1923 bool no_cck, bool dont_wait_for_ack, u64 *cookie);
1781 const u8 *buf, size_t len, bool no_cck,
1782 bool dont_wait_for_ack, u64 *cookie);
1783 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, 1924 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
1784 struct wireless_dev *wdev, 1925 struct wireless_dev *wdev,
1785 u64 cookie); 1926 u64 cookie);
@@ -1834,10 +1975,9 @@ struct cfg80211_ops {
1834 void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, 1975 void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev,
1835 u32 sset, u8 *data); 1976 u32 sset, u8 *data);
1836 1977
1837 struct ieee80211_channel * 1978 int (*get_channel)(struct wiphy *wiphy,
1838 (*get_channel)(struct wiphy *wiphy,
1839 struct wireless_dev *wdev, 1979 struct wireless_dev *wdev,
1840 enum nl80211_channel_type *type); 1980 struct cfg80211_chan_def *chandef);
1841 1981
1842 int (*start_p2p_device)(struct wiphy *wiphy, 1982 int (*start_p2p_device)(struct wiphy *wiphy,
1843 struct wireless_dev *wdev); 1983 struct wireless_dev *wdev);
@@ -2445,8 +2585,7 @@ struct wireless_dev {
2445 spinlock_t event_lock; 2585 spinlock_t event_lock;
2446 2586
2447 struct cfg80211_internal_bss *current_bss; /* associated / joined */ 2587 struct cfg80211_internal_bss *current_bss; /* associated / joined */
2448 struct ieee80211_channel *preset_chan; 2588 struct cfg80211_chan_def preset_chandef;
2449 enum nl80211_channel_type preset_chantype;
2450 2589
2451 /* for AP and mesh channel tracking */ 2590 /* for AP and mesh channel tracking */
2452 struct ieee80211_channel *channel; 2591 struct ieee80211_channel *channel;
@@ -3326,14 +3465,12 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason,
3326 * @wdev: wireless device 3465 * @wdev: wireless device
3327 * @cookie: the request cookie 3466 * @cookie: the request cookie
3328 * @chan: The current channel (from remain_on_channel request) 3467 * @chan: The current channel (from remain_on_channel request)
3329 * @channel_type: Channel type
3330 * @duration: Duration in milliseconds that the driver intents to remain on the 3468 * @duration: Duration in milliseconds that the driver intents to remain on the
3331 * channel 3469 * channel
3332 * @gfp: allocation flags 3470 * @gfp: allocation flags
3333 */ 3471 */
3334void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, 3472void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
3335 struct ieee80211_channel *chan, 3473 struct ieee80211_channel *chan,
3336 enum nl80211_channel_type channel_type,
3337 unsigned int duration, gfp_t gfp); 3474 unsigned int duration, gfp_t gfp);
3338 3475
3339/** 3476/**
@@ -3341,12 +3478,10 @@ void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie,
3341 * @wdev: wireless device 3478 * @wdev: wireless device
3342 * @cookie: the request cookie 3479 * @cookie: the request cookie
3343 * @chan: The current channel (from remain_on_channel request) 3480 * @chan: The current channel (from remain_on_channel request)
3344 * @channel_type: Channel type
3345 * @gfp: allocation flags 3481 * @gfp: allocation flags
3346 */ 3482 */
3347void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, 3483void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie,
3348 struct ieee80211_channel *chan, 3484 struct ieee80211_channel *chan,
3349 enum nl80211_channel_type channel_type,
3350 gfp_t gfp); 3485 gfp_t gfp);
3351 3486
3352 3487
@@ -3536,7 +3671,6 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
3536 * @len: length of the frame 3671 * @len: length of the frame
3537 * @freq: frequency the frame was received on 3672 * @freq: frequency the frame was received on
3538 * @sig_dbm: signal strength in mBm, or 0 if unknown 3673 * @sig_dbm: signal strength in mBm, or 0 if unknown
3539 * @gfp: allocation flags
3540 * 3674 *
3541 * Use this function to report to userspace when a beacon was 3675 * Use this function to report to userspace when a beacon was
3542 * received. It is not useful to call this when there is no 3676 * received. It is not useful to call this when there is no
@@ -3544,31 +3678,47 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
3544 */ 3678 */
3545void cfg80211_report_obss_beacon(struct wiphy *wiphy, 3679void cfg80211_report_obss_beacon(struct wiphy *wiphy,
3546 const u8 *frame, size_t len, 3680 const u8 *frame, size_t len,
3547 int freq, int sig_dbm, gfp_t gfp); 3681 int freq, int sig_dbm);
3548 3682
3549/** 3683/**
3550 * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used 3684 * cfg80211_reg_can_beacon - check if beaconing is allowed
3551 * @wiphy: the wiphy 3685 * @wiphy: the wiphy
3552 * @chan: main channel 3686 * @chandef: the channel definition
3553 * @channel_type: HT mode
3554 * 3687 *
3555 * This function returns true if there is no secondary channel or the secondary 3688 * This function returns true if there is no secondary channel or the secondary
3556 * channel can be used for beaconing (i.e. is not a radar channel etc.) 3689 * channel(s) can be used for beaconing (i.e. is not a radar channel etc.)
3557 */ 3690 */
3558bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, 3691bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
3559 struct ieee80211_channel *chan, 3692 struct cfg80211_chan_def *chandef);
3560 enum nl80211_channel_type channel_type);
3561 3693
3562/* 3694/*
3563 * cfg80211_ch_switch_notify - update wdev channel and notify userspace 3695 * cfg80211_ch_switch_notify - update wdev channel and notify userspace
3564 * @dev: the device which switched channels 3696 * @dev: the device which switched channels
3565 * @freq: new channel frequency (in MHz) 3697 * @chandef: the new channel definition
3566 * @type: channel type
3567 * 3698 *
3568 * Acquires wdev_lock, so must only be called from sleepable driver context! 3699 * Acquires wdev_lock, so must only be called from sleepable driver context!
3569 */ 3700 */
3570void cfg80211_ch_switch_notify(struct net_device *dev, int freq, 3701void cfg80211_ch_switch_notify(struct net_device *dev,
3571 enum nl80211_channel_type type); 3702 struct cfg80211_chan_def *chandef);
3703
3704/*
3705 * cfg80211_tdls_oper_request - request userspace to perform TDLS operation
3706 * @dev: the device on which the operation is requested
3707 * @peer: the MAC address of the peer device
3708 * @oper: the requested TDLS operation (NL80211_TDLS_SETUP or
3709 * NL80211_TDLS_TEARDOWN)
3710 * @reason_code: the reason code for teardown request
3711 * @gfp: allocation flags
3712 *
3713 * This function is used to request userspace to perform TDLS operation that
3714 * requires knowledge of keys, i.e., link setup or teardown when the AP
3715 * connection uses encryption. This is optional mechanism for the driver to use
3716 * if it can automatically determine when a TDLS link could be useful (e.g.,
3717 * based on traffic and signal strength for a peer).
3718 */
3719void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer,
3720 enum nl80211_tdls_operation oper,
3721 u16 reason_code, gfp_t gfp);
3572 3722
3573/* 3723/*
3574 * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) 3724 * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units)
@@ -3594,6 +3744,26 @@ u32 cfg80211_calculate_bitrate(struct rate_info *rate);
3594 */ 3744 */
3595void cfg80211_unregister_wdev(struct wireless_dev *wdev); 3745void cfg80211_unregister_wdev(struct wireless_dev *wdev);
3596 3746
3747/**
3748 * cfg80211_get_p2p_attr - find and copy a P2P attribute from IE buffer
3749 * @ies: the input IE buffer
3750 * @len: the input length
3751 * @attr: the attribute ID to find
3752 * @buf: output buffer, can be %NULL if the data isn't needed, e.g.
3753 * if the function is only called to get the needed buffer size
3754 * @bufsize: size of the output buffer
3755 *
3756 * The function finds a given P2P attribute in the (vendor) IEs and
3757 * copies its contents to the given buffer.
3758 *
3759 * The return value is a negative error code (-%EILSEQ or -%ENOENT) if
3760 * the data is malformed or the attribute can't be found (respectively),
3761 * or the length of the found attribute (which can be zero).
3762 */
3763int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len,
3764 enum ieee80211_p2p_attr_id attr,
3765 u8 *buf, unsigned int bufsize);
3766
3597/* Logging, debugging and troubleshooting/diagnostic helpers. */ 3767/* Logging, debugging and troubleshooting/diagnostic helpers. */
3598 3768
3599/* wiphy_printk helpers, similar to dev_printk */ 3769/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index b6a6eeb3905f..2581638f4a3d 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -24,12 +24,12 @@ struct cgroup_cls_state
24 u32 classid; 24 u32 classid;
25}; 25};
26 26
27extern void sock_update_classid(struct sock *sk); 27extern void sock_update_classid(struct sock *sk, struct task_struct *task);
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)
31{ 31{
32 int classid; 32 u32 classid;
33 33
34 if (in_interrupt()) 34 if (in_interrupt())
35 return 0; 35 return 0;
@@ -61,7 +61,7 @@ static inline u32 task_cls_classid(struct task_struct *p)
61} 61}
62#endif 62#endif
63#else /* !CGROUP_NET_CLS_CGROUP */ 63#else /* !CGROUP_NET_CLS_CGROUP */
64static inline void sock_update_classid(struct sock *sk) 64static inline void sock_update_classid(struct sock *sk, struct task_struct *task)
65{ 65{
66} 66}
67 67
diff --git a/include/net/gro_cells.h b/include/net/gro_cells.h
index 4fd8a4b4b7ee..e5062c955ea6 100644
--- a/include/net/gro_cells.h
+++ b/include/net/gro_cells.h
@@ -17,7 +17,6 @@ struct gro_cells {
17 17
18static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb) 18static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb)
19{ 19{
20 unsigned long flags;
21 struct gro_cell *cell = gcells->cells; 20 struct gro_cell *cell = gcells->cells;
22 struct net_device *dev = skb->dev; 21 struct net_device *dev = skb->dev;
23 22
@@ -35,32 +34,37 @@ static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *s
35 return; 34 return;
36 } 35 }
37 36
38 spin_lock_irqsave(&cell->napi_skbs.lock, flags); 37 /* We run in BH context */
38 spin_lock(&cell->napi_skbs.lock);
39 39
40 __skb_queue_tail(&cell->napi_skbs, skb); 40 __skb_queue_tail(&cell->napi_skbs, skb);
41 if (skb_queue_len(&cell->napi_skbs) == 1) 41 if (skb_queue_len(&cell->napi_skbs) == 1)
42 napi_schedule(&cell->napi); 42 napi_schedule(&cell->napi);
43 43
44 spin_unlock_irqrestore(&cell->napi_skbs.lock, flags); 44 spin_unlock(&cell->napi_skbs.lock);
45} 45}
46 46
47/* called unser BH context */
47static inline int gro_cell_poll(struct napi_struct *napi, int budget) 48static inline int gro_cell_poll(struct napi_struct *napi, int budget)
48{ 49{
49 struct gro_cell *cell = container_of(napi, struct gro_cell, napi); 50 struct gro_cell *cell = container_of(napi, struct gro_cell, napi);
50 struct sk_buff *skb; 51 struct sk_buff *skb;
51 int work_done = 0; 52 int work_done = 0;
52 53
54 spin_lock(&cell->napi_skbs.lock);
53 while (work_done < budget) { 55 while (work_done < budget) {
54 skb = skb_dequeue(&cell->napi_skbs); 56 skb = __skb_dequeue(&cell->napi_skbs);
55 if (!skb) 57 if (!skb)
56 break; 58 break;
57 59 spin_unlock(&cell->napi_skbs.lock);
58 napi_gro_receive(napi, skb); 60 napi_gro_receive(napi, skb);
59 work_done++; 61 work_done++;
62 spin_lock(&cell->napi_skbs.lock);
60 } 63 }
61 64
62 if (work_done < budget) 65 if (work_done < budget)
63 napi_complete(napi); 66 napi_complete(napi);
67 spin_unlock(&cell->napi_skbs.lock);
64 return work_done; 68 return work_done;
65} 69}
66 70
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index 7f0df133d119..c3999632e616 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -186,6 +186,10 @@ struct ieee80211_radiotap_header {
186 * IEEE80211_RADIOTAP_AMPDU_STATUS u32, u16, u8, u8 unitless 186 * IEEE80211_RADIOTAP_AMPDU_STATUS u32, u16, u8, u8 unitless
187 * 187 *
188 * Contains the AMPDU information for the subframe. 188 * Contains the AMPDU information for the subframe.
189 *
190 * IEEE80211_RADIOTAP_VHT u16, u8, u8, u8[4], u8, u8, u16
191 *
192 * Contains VHT information about this frame.
189 */ 193 */
190enum ieee80211_radiotap_type { 194enum ieee80211_radiotap_type {
191 IEEE80211_RADIOTAP_TSFT = 0, 195 IEEE80211_RADIOTAP_TSFT = 0,
@@ -209,6 +213,7 @@ enum ieee80211_radiotap_type {
209 213
210 IEEE80211_RADIOTAP_MCS = 19, 214 IEEE80211_RADIOTAP_MCS = 19,
211 IEEE80211_RADIOTAP_AMPDU_STATUS = 20, 215 IEEE80211_RADIOTAP_AMPDU_STATUS = 20,
216 IEEE80211_RADIOTAP_VHT = 21,
212 217
213 /* valid in every it_present bitmap, even vendor namespaces */ 218 /* valid in every it_present bitmap, even vendor namespaces */
214 IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29, 219 IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29,
@@ -282,6 +287,25 @@ enum ieee80211_radiotap_type {
282#define IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_ERR 0x0010 287#define IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_ERR 0x0010
283#define IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_KNOWN 0x0020 288#define IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_KNOWN 0x0020
284 289
290/* For IEEE80211_RADIOTAP_VHT */
291#define IEEE80211_RADIOTAP_VHT_KNOWN_STBC 0x0001
292#define IEEE80211_RADIOTAP_VHT_KNOWN_TXOP_PS_NA 0x0002
293#define IEEE80211_RADIOTAP_VHT_KNOWN_GI 0x0004
294#define IEEE80211_RADIOTAP_VHT_KNOWN_SGI_NSYM_DIS 0x0008
295#define IEEE80211_RADIOTAP_VHT_KNOWN_LDPC_EXTRA_OFDM_SYM 0x0010
296#define IEEE80211_RADIOTAP_VHT_KNOWN_BEAMFORMED 0x0020
297#define IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH 0x0040
298#define IEEE80211_RADIOTAP_VHT_KNOWN_GROUP_ID 0x0080
299#define IEEE80211_RADIOTAP_VHT_KNOWN_PARTIAL_AID 0x0100
300
301#define IEEE80211_RADIOTAP_VHT_FLAG_STBC 0x01
302#define IEEE80211_RADIOTAP_VHT_FLAG_TXOP_PS_NA 0x02
303#define IEEE80211_RADIOTAP_VHT_FLAG_SGI 0x04
304#define IEEE80211_RADIOTAP_VHT_FLAG_SGI_NSYM_M10_9 0x08
305#define IEEE80211_RADIOTAP_VHT_FLAG_LDPC_EXTRA_OFDM_SYM 0x10
306#define IEEE80211_RADIOTAP_VHT_FLAG_BEAMFORMED 0x20
307
308
285/* helpers */ 309/* helpers */
286static inline int ieee80211_get_radiotap_len(unsigned char *data) 310static inline int ieee80211_get_radiotap_len(unsigned char *data)
287{ 311{
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 54be0287eb98..67a8fa098e3a 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -277,7 +277,6 @@ static inline struct sock *inet_lookup_listener(struct net *net,
277 On 64bit targets we combine comparisons with pair of adjacent __be32 277 On 64bit targets we combine comparisons with pair of adjacent __be32
278 fields in the same way. 278 fields in the same way.
279*/ 279*/
280typedef __u32 __bitwise __portpair;
281#ifdef __BIG_ENDIAN 280#ifdef __BIG_ENDIAN
282#define INET_COMBINED_PORTS(__sport, __dport) \ 281#define INET_COMBINED_PORTS(__sport, __dport) \
283 ((__force __portpair)(((__force __u32)(__be16)(__sport) << 16) | (__u32)(__dport))) 282 ((__force __portpair)(((__force __u32)(__be16)(__sport) << 16) | (__u32)(__dport)))
@@ -287,7 +286,6 @@ typedef __u32 __bitwise __portpair;
287#endif 286#endif
288 287
289#if (BITS_PER_LONG == 64) 288#if (BITS_PER_LONG == 64)
290typedef __u64 __bitwise __addrpair;
291#ifdef __BIG_ENDIAN 289#ifdef __BIG_ENDIAN
292#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \ 290#define INET_ADDR_COOKIE(__name, __saddr, __daddr) \
293 const __addrpair __name = (__force __addrpair) ( \ 291 const __addrpair __name = (__force __addrpair) ( \
@@ -299,30 +297,34 @@ typedef __u64 __bitwise __addrpair;
299 (((__force __u64)(__be32)(__daddr)) << 32) | \ 297 (((__force __u64)(__be32)(__daddr)) << 32) | \
300 ((__force __u64)(__be32)(__saddr))); 298 ((__force __u64)(__be32)(__saddr)));
301#endif /* __BIG_ENDIAN */ 299#endif /* __BIG_ENDIAN */
302#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ 300#define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \
303 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 301 ((inet_sk(__sk)->inet_portpair == (__ports)) && \
304 ((*((__addrpair *)&(inet_sk(__sk)->inet_daddr))) == (__cookie)) && \ 302 (inet_sk(__sk)->inet_addrpair == (__cookie)) && \
305 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ 303 (!(__sk)->sk_bound_dev_if || \
306 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 304 ((__sk)->sk_bound_dev_if == (__dif))) && \
307#define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ 305 net_eq(sock_net(__sk), (__net)))
308 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 306#define INET_TW_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif)\
309 ((*((__addrpair *)&(inet_twsk(__sk)->tw_daddr))) == (__cookie)) && \ 307 ((inet_twsk(__sk)->tw_portpair == (__ports)) && \
310 ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ 308 (inet_twsk(__sk)->tw_addrpair == (__cookie)) && \
311 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 309 (!(__sk)->sk_bound_dev_if || \
310 ((__sk)->sk_bound_dev_if == (__dif))) && \
311 net_eq(sock_net(__sk), (__net)))
312#else /* 32-bit arch */ 312#else /* 32-bit arch */
313#define INET_ADDR_COOKIE(__name, __saddr, __daddr) 313#define INET_ADDR_COOKIE(__name, __saddr, __daddr)
314#define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ 314#define INET_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \
315 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 315 ((inet_sk(__sk)->inet_portpair == (__ports)) && \
316 (inet_sk(__sk)->inet_daddr == (__saddr)) && \ 316 (inet_sk(__sk)->inet_daddr == (__saddr)) && \
317 (inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \ 317 (inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \
318 ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ 318 (!(__sk)->sk_bound_dev_if || \
319 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 319 ((__sk)->sk_bound_dev_if == (__dif))) && \
320#define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ 320 net_eq(sock_net(__sk), (__net)))
321 (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ 321#define INET_TW_MATCH(__sk, __net, __cookie, __saddr, __daddr, __ports, __dif) \
322 (inet_twsk(__sk)->tw_daddr == (__saddr)) && \ 322 ((inet_twsk(__sk)->tw_portpair == (__ports)) && \
323 (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \ 323 (inet_twsk(__sk)->tw_daddr == (__saddr)) && \
324 ((*((__portpair *)&(inet_twsk(__sk)->tw_dport))) == (__ports)) && \ 324 (inet_twsk(__sk)->tw_rcv_saddr == (__daddr)) && \
325 (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) 325 (!(__sk)->sk_bound_dev_if || \
326 ((__sk)->sk_bound_dev_if == (__dif))) && \
327 net_eq(sock_net(__sk), (__net)))
326#endif /* 64-bit arch */ 328#endif /* 64-bit arch */
327 329
328/* 330/*
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 256c1ed2d69a..a4196cbc84ec 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -144,9 +144,11 @@ struct inet_sock {
144 /* Socket demultiplex comparisons on incoming packets. */ 144 /* Socket demultiplex comparisons on incoming packets. */
145#define inet_daddr sk.__sk_common.skc_daddr 145#define inet_daddr sk.__sk_common.skc_daddr
146#define inet_rcv_saddr sk.__sk_common.skc_rcv_saddr 146#define inet_rcv_saddr sk.__sk_common.skc_rcv_saddr
147#define inet_addrpair sk.__sk_common.skc_addrpair
148#define inet_dport sk.__sk_common.skc_dport
149#define inet_num sk.__sk_common.skc_num
150#define inet_portpair sk.__sk_common.skc_portpair
147 151
148 __be16 inet_dport;
149 __u16 inet_num;
150 __be32 inet_saddr; 152 __be32 inet_saddr;
151 __s16 uc_ttl; 153 __s16 uc_ttl;
152 __u16 cmsg_flags; 154 __u16 cmsg_flags;
@@ -154,6 +156,7 @@ struct inet_sock {
154 __u16 inet_id; 156 __u16 inet_id;
155 157
156 struct ip_options_rcu __rcu *inet_opt; 158 struct ip_options_rcu __rcu *inet_opt;
159 int rx_dst_ifindex;
157 __u8 tos; 160 __u8 tos;
158 __u8 min_ttl; 161 __u8 min_ttl;
159 __u8 mc_ttl; 162 __u8 mc_ttl;
@@ -170,7 +173,6 @@ struct inet_sock {
170 int uc_index; 173 int uc_index;
171 int mc_index; 174 int mc_index;
172 __be32 mc_addr; 175 __be32 mc_addr;
173 int rx_dst_ifindex;
174 struct ip_mc_socklist __rcu *mc_list; 176 struct ip_mc_socklist __rcu *mc_list;
175 struct inet_cork_full cork; 177 struct inet_cork_full cork;
176}; 178};
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index ba52c830a7a5..7d658d577368 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -112,6 +112,11 @@ struct inet_timewait_sock {
112#define tw_net __tw_common.skc_net 112#define tw_net __tw_common.skc_net
113#define tw_daddr __tw_common.skc_daddr 113#define tw_daddr __tw_common.skc_daddr
114#define tw_rcv_saddr __tw_common.skc_rcv_saddr 114#define tw_rcv_saddr __tw_common.skc_rcv_saddr
115#define tw_addrpair __tw_common.skc_addrpair
116#define tw_dport __tw_common.skc_dport
117#define tw_num __tw_common.skc_num
118#define tw_portpair __tw_common.skc_portpair
119
115 int tw_timeout; 120 int tw_timeout;
116 volatile unsigned char tw_substate; 121 volatile unsigned char tw_substate;
117 unsigned char tw_rcv_wscale; 122 unsigned char tw_rcv_wscale;
@@ -119,8 +124,6 @@ struct inet_timewait_sock {
119 /* Socket demultiplex comparisons on incoming packets. */ 124 /* Socket demultiplex comparisons on incoming packets. */
120 /* these three are in inet_sock */ 125 /* these three are in inet_sock */
121 __be16 tw_sport; 126 __be16 tw_sport;
122 __be16 tw_dport;
123 __u16 tw_num;
124 kmemcheck_bitfield_begin(flags); 127 kmemcheck_bitfield_begin(flags);
125 /* And these are ours. */ 128 /* And these are ours. */
126 unsigned int tw_ipv6only : 1, 129 unsigned int tw_ipv6only : 1,
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h
index bc1b0fda2b04..652d3d309357 100644
--- a/include/net/ip6_checksum.h
+++ b/include/net/ip6_checksum.h
@@ -31,6 +31,8 @@
31#include <net/ip.h> 31#include <net/ip.h>
32#include <asm/checksum.h> 32#include <asm/checksum.h>
33#include <linux/in6.h> 33#include <linux/in6.h>
34#include <linux/tcp.h>
35#include <linux/ipv6.h>
34 36
35#ifndef _HAVE_ARCH_IPV6_CSUM 37#ifndef _HAVE_ARCH_IPV6_CSUM
36 38
@@ -91,4 +93,37 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
91} 93}
92 94
93#endif 95#endif
96
97static __inline__ __sum16 tcp_v6_check(int len,
98 const struct in6_addr *saddr,
99 const struct in6_addr *daddr,
100 __wsum base)
101{
102 return csum_ipv6_magic(saddr, daddr, len, IPPROTO_TCP, base);
103}
104
105static inline void __tcp_v6_send_check(struct sk_buff *skb,
106 const struct in6_addr *saddr,
107 const struct in6_addr *daddr)
108{
109 struct tcphdr *th = tcp_hdr(skb);
110
111 if (skb->ip_summed == CHECKSUM_PARTIAL) {
112 th->check = ~tcp_v6_check(skb->len, saddr, daddr, 0);
113 skb->csum_start = skb_transport_header(skb) - skb->head;
114 skb->csum_offset = offsetof(struct tcphdr, check);
115 } else {
116 th->check = tcp_v6_check(skb->len, saddr, daddr,
117 csum_partial(th, th->doff << 2,
118 skb->csum));
119 }
120}
121
122static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb)
123{
124 struct ipv6_pinfo *np = inet6_sk(sk);
125
126 __tcp_v6_send_check(skb, &np->saddr, &np->daddr);
127}
128
94#endif 129#endif
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 8a2a203eb15d..fdc48a94a063 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -47,6 +47,8 @@ struct fib6_config {
47 unsigned long fc_expires; 47 unsigned long fc_expires;
48 struct nlattr *fc_mx; 48 struct nlattr *fc_mx;
49 int fc_mx_len; 49 int fc_mx_len;
50 int fc_mp_len;
51 struct nlattr *fc_mp;
50 52
51 struct nl_info fc_nlinfo; 53 struct nl_info fc_nlinfo;
52}; 54};
@@ -99,6 +101,14 @@ struct rt6_info {
99 101
100 struct in6_addr rt6i_gateway; 102 struct in6_addr rt6i_gateway;
101 103
104 /* Multipath routes:
105 * siblings is a list of rt6_info that have the the same metric/weight,
106 * destination, but not the same gateway. nsiblings is just a cache
107 * to speed up lookup.
108 */
109 struct list_head rt6i_siblings;
110 unsigned int rt6i_nsiblings;
111
102 atomic_t rt6i_ref; 112 atomic_t rt6i_ref;
103 113
104 /* These are in a separate cache line. */ 114 /* These are in a separate cache line. */
@@ -107,7 +117,6 @@ struct rt6_info {
107 struct rt6key rt6i_src; 117 struct rt6key rt6i_src;
108 struct rt6key rt6i_prefsrc; 118 struct rt6key rt6i_prefsrc;
109 u32 rt6i_metric; 119 u32 rt6i_metric;
110 u32 rt6i_peer_genid;
111 120
112 struct inet6_dev *rt6i_idev; 121 struct inet6_dev *rt6i_idev;
113 unsigned long _rt6i_peer; 122 unsigned long _rt6i_peer;
@@ -203,6 +212,15 @@ static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from)
203 dst_hold(new); 212 dst_hold(new);
204} 213}
205 214
215static inline void ip6_rt_put(struct rt6_info *rt)
216{
217 /* dst_release() accepts a NULL parameter.
218 * We rely on dst being first structure in struct rt6_info
219 */
220 BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0);
221 dst_release(&rt->dst);
222}
223
206struct fib6_walker_t { 224struct fib6_walker_t {
207 struct list_head lh; 225 struct list_head lh;
208 struct fib6_node *root, *node; 226 struct fib6_node *root, *node;
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 5fa2af00634a..27d83183e615 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -1,9 +1,6 @@
1#ifndef _NET_IP6_ROUTE_H 1#ifndef _NET_IP6_ROUTE_H
2#define _NET_IP6_ROUTE_H 2#define _NET_IP6_ROUTE_H
3 3
4#define IP6_RT_PRIO_USER 1024
5#define IP6_RT_PRIO_ADDRCONF 256
6
7struct route_info { 4struct route_info {
8 __u8 type; 5 __u8 type;
9 __u8 length; 6 __u8 length;
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index ee75ccdf5188..68c69d54d392 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -22,7 +22,10 @@
22#include <linux/ip.h> 22#include <linux/ip.h>
23#include <linux/ipv6.h> /* for struct ipv6hdr */ 23#include <linux/ipv6.h> /* for struct ipv6hdr */
24#include <net/ipv6.h> 24#include <net/ipv6.h>
25#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) 25#if IS_ENABLED(CONFIG_IP_VS_IPV6)
26#include <linux/netfilter_ipv6/ip6_tables.h>
27#endif
28#if IS_ENABLED(CONFIG_NF_CONNTRACK)
26#include <net/netfilter/nf_conntrack.h> 29#include <net/netfilter/nf_conntrack.h>
27#endif 30#endif
28#include <net/net_namespace.h> /* Netw namespace */ 31#include <net/net_namespace.h> /* Netw namespace */
@@ -103,30 +106,117 @@ static inline struct net *seq_file_single_net(struct seq_file *seq)
103/* Connections' size value needed by ip_vs_ctl.c */ 106/* Connections' size value needed by ip_vs_ctl.c */
104extern int ip_vs_conn_tab_size; 107extern int ip_vs_conn_tab_size;
105 108
106
107struct ip_vs_iphdr { 109struct ip_vs_iphdr {
108 int len; 110 __u32 len; /* IPv4 simply where L4 starts
109 __u8 protocol; 111 IPv6 where L4 Transport Header starts */
112 __u32 thoff_reasm; /* Transport Header Offset in nfct_reasm skb */
113 __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/
114 __s16 protocol;
115 __s32 flags;
110 union nf_inet_addr saddr; 116 union nf_inet_addr saddr;
111 union nf_inet_addr daddr; 117 union nf_inet_addr daddr;
112}; 118};
113 119
120/* Dependency to module: nf_defrag_ipv6 */
121#if defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE)
122static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb)
123{
124 return skb->nfct_reasm;
125}
126static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset,
127 int len, void *buffer,
128 const struct ip_vs_iphdr *ipvsh)
129{
130 if (unlikely(ipvsh->fragoffs && skb_nfct_reasm(skb)))
131 return skb_header_pointer(skb_nfct_reasm(skb),
132 ipvsh->thoff_reasm, len, buffer);
133
134 return skb_header_pointer(skb, offset, len, buffer);
135}
136#else
137static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb)
138{
139 return NULL;
140}
141static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset,
142 int len, void *buffer,
143 const struct ip_vs_iphdr *ipvsh)
144{
145 return skb_header_pointer(skb, offset, len, buffer);
146}
147#endif
148
114static inline void 149static inline void
115ip_vs_fill_iphdr(int af, const void *nh, struct ip_vs_iphdr *iphdr) 150ip_vs_fill_ip4hdr(const void *nh, struct ip_vs_iphdr *iphdr)
151{
152 const struct iphdr *iph = nh;
153
154 iphdr->len = iph->ihl * 4;
155 iphdr->fragoffs = 0;
156 iphdr->protocol = iph->protocol;
157 iphdr->saddr.ip = iph->saddr;
158 iphdr->daddr.ip = iph->daddr;
159}
160
161/* This function handles filling *ip_vs_iphdr, both for IPv4 and IPv6.
162 * IPv6 requires some extra work, as finding proper header position,
163 * depend on the IPv6 extension headers.
164 */
165static inline void
166ip_vs_fill_iph_skb(int af, const struct sk_buff *skb, struct ip_vs_iphdr *iphdr)
116{ 167{
117#ifdef CONFIG_IP_VS_IPV6 168#ifdef CONFIG_IP_VS_IPV6
118 if (af == AF_INET6) { 169 if (af == AF_INET6) {
119 const struct ipv6hdr *iph = nh; 170 const struct ipv6hdr *iph =
120 iphdr->len = sizeof(struct ipv6hdr); 171 (struct ipv6hdr *)skb_network_header(skb);
121 iphdr->protocol = iph->nexthdr;
122 iphdr->saddr.in6 = iph->saddr; 172 iphdr->saddr.in6 = iph->saddr;
123 iphdr->daddr.in6 = iph->daddr; 173 iphdr->daddr.in6 = iph->daddr;
174 /* ipv6_find_hdr() updates len, flags, thoff_reasm */
175 iphdr->thoff_reasm = 0;
176 iphdr->len = 0;
177 iphdr->flags = 0;
178 iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1,
179 &iphdr->fragoffs,
180 &iphdr->flags);
181 /* get proto from re-assembled packet and it's offset */
182 if (skb_nfct_reasm(skb))
183 iphdr->protocol = ipv6_find_hdr(skb_nfct_reasm(skb),
184 &iphdr->thoff_reasm,
185 -1, NULL, NULL);
186
124 } else 187 } else
125#endif 188#endif
126 { 189 {
127 const struct iphdr *iph = nh; 190 const struct iphdr *iph =
128 iphdr->len = iph->ihl * 4; 191 (struct iphdr *)skb_network_header(skb);
129 iphdr->protocol = iph->protocol; 192 iphdr->len = iph->ihl * 4;
193 iphdr->fragoffs = 0;
194 iphdr->protocol = iph->protocol;
195 iphdr->saddr.ip = iph->saddr;
196 iphdr->daddr.ip = iph->daddr;
197 }
198}
199
200/* This function is a faster version of ip_vs_fill_iph_skb().
201 * Where we only populate {s,d}addr (and avoid calling ipv6_find_hdr()).
202 * This is used by the some of the ip_vs_*_schedule() functions.
203 * (Mostly done to avoid ABI breakage of external schedulers)
204 */
205static inline void
206ip_vs_fill_iph_addr_only(int af, const struct sk_buff *skb,
207 struct ip_vs_iphdr *iphdr)
208{
209#ifdef CONFIG_IP_VS_IPV6
210 if (af == AF_INET6) {
211 const struct ipv6hdr *iph =
212 (struct ipv6hdr *)skb_network_header(skb);
213 iphdr->saddr.in6 = iph->saddr;
214 iphdr->daddr.in6 = iph->daddr;
215 } else
216#endif
217 {
218 const struct iphdr *iph =
219 (struct iphdr *)skb_network_header(skb);
130 iphdr->saddr.ip = iph->saddr; 220 iphdr->saddr.ip = iph->saddr;
131 iphdr->daddr.ip = iph->daddr; 221 iphdr->daddr.ip = iph->daddr;
132 } 222 }
@@ -165,7 +255,7 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
165 int len; 255 int len;
166#ifdef CONFIG_IP_VS_IPV6 256#ifdef CONFIG_IP_VS_IPV6
167 if (af == AF_INET6) 257 if (af == AF_INET6)
168 len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6]", 258 len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6c]",
169 &addr->in6) + 1; 259 &addr->in6) + 1;
170 else 260 else
171#endif 261#endif
@@ -398,27 +488,26 @@ struct ip_vs_protocol {
398 488
399 int (*conn_schedule)(int af, struct sk_buff *skb, 489 int (*conn_schedule)(int af, struct sk_buff *skb,
400 struct ip_vs_proto_data *pd, 490 struct ip_vs_proto_data *pd,
401 int *verdict, struct ip_vs_conn **cpp); 491 int *verdict, struct ip_vs_conn **cpp,
492 struct ip_vs_iphdr *iph);
402 493
403 struct ip_vs_conn * 494 struct ip_vs_conn *
404 (*conn_in_get)(int af, 495 (*conn_in_get)(int af,
405 const struct sk_buff *skb, 496 const struct sk_buff *skb,
406 const struct ip_vs_iphdr *iph, 497 const struct ip_vs_iphdr *iph,
407 unsigned int proto_off,
408 int inverse); 498 int inverse);
409 499
410 struct ip_vs_conn * 500 struct ip_vs_conn *
411 (*conn_out_get)(int af, 501 (*conn_out_get)(int af,
412 const struct sk_buff *skb, 502 const struct sk_buff *skb,
413 const struct ip_vs_iphdr *iph, 503 const struct ip_vs_iphdr *iph,
414 unsigned int proto_off,
415 int inverse); 504 int inverse);
416 505
417 int (*snat_handler)(struct sk_buff *skb, 506 int (*snat_handler)(struct sk_buff *skb, struct ip_vs_protocol *pp,
418 struct ip_vs_protocol *pp, struct ip_vs_conn *cp); 507 struct ip_vs_conn *cp, struct ip_vs_iphdr *iph);
419 508
420 int (*dnat_handler)(struct sk_buff *skb, 509 int (*dnat_handler)(struct sk_buff *skb, struct ip_vs_protocol *pp,
421 struct ip_vs_protocol *pp, struct ip_vs_conn *cp); 510 struct ip_vs_conn *cp, struct ip_vs_iphdr *iph);
422 511
423 int (*csum_check)(int af, struct sk_buff *skb, 512 int (*csum_check)(int af, struct sk_buff *skb,
424 struct ip_vs_protocol *pp); 513 struct ip_vs_protocol *pp);
@@ -518,7 +607,7 @@ struct ip_vs_conn {
518 NF_ACCEPT can be returned when destination is local. 607 NF_ACCEPT can be returned when destination is local.
519 */ 608 */
520 int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, 609 int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp,
521 struct ip_vs_protocol *pp); 610 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
522 611
523 /* Note: we can group the following members into a structure, 612 /* Note: we can group the following members into a structure,
524 in order to save more space, and the following members are 613 in order to save more space, and the following members are
@@ -769,13 +858,11 @@ struct ip_vs_app {
769 858
770 struct ip_vs_conn * 859 struct ip_vs_conn *
771 (*conn_in_get)(const struct sk_buff *skb, struct ip_vs_app *app, 860 (*conn_in_get)(const struct sk_buff *skb, struct ip_vs_app *app,
772 const struct iphdr *iph, unsigned int proto_off, 861 const struct iphdr *iph, int inverse);
773 int inverse);
774 862
775 struct ip_vs_conn * 863 struct ip_vs_conn *
776 (*conn_out_get)(const struct sk_buff *skb, struct ip_vs_app *app, 864 (*conn_out_get)(const struct sk_buff *skb, struct ip_vs_app *app,
777 const struct iphdr *iph, unsigned int proto_off, 865 const struct iphdr *iph, int inverse);
778 int inverse);
779 866
780 int (*state_transition)(struct ip_vs_conn *cp, int direction, 867 int (*state_transition)(struct ip_vs_conn *cp, int direction,
781 const struct sk_buff *skb, 868 const struct sk_buff *skb,
@@ -1074,14 +1161,12 @@ struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p);
1074 1161
1075struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, 1162struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb,
1076 const struct ip_vs_iphdr *iph, 1163 const struct ip_vs_iphdr *iph,
1077 unsigned int proto_off,
1078 int inverse); 1164 int inverse);
1079 1165
1080struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); 1166struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p);
1081 1167
1082struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, 1168struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb,
1083 const struct ip_vs_iphdr *iph, 1169 const struct ip_vs_iphdr *iph,
1084 unsigned int proto_off,
1085 int inverse); 1170 int inverse);
1086 1171
1087/* put back the conn without restarting its timer */ 1172/* put back the conn without restarting its timer */
@@ -1254,9 +1339,10 @@ extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name);
1254extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); 1339extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler);
1255extern struct ip_vs_conn * 1340extern struct ip_vs_conn *
1256ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, 1341ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb,
1257 struct ip_vs_proto_data *pd, int *ignored); 1342 struct ip_vs_proto_data *pd, int *ignored,
1343 struct ip_vs_iphdr *iph);
1258extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, 1344extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
1259 struct ip_vs_proto_data *pd); 1345 struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph);
1260 1346
1261extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); 1347extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg);
1262 1348
@@ -1315,33 +1401,38 @@ extern void ip_vs_read_estimator(struct ip_vs_stats_user *dst,
1315/* 1401/*
1316 * Various IPVS packet transmitters (from ip_vs_xmit.c) 1402 * Various IPVS packet transmitters (from ip_vs_xmit.c)
1317 */ 1403 */
1318extern int ip_vs_null_xmit 1404extern int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1319(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1405 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1320extern int ip_vs_bypass_xmit 1406extern int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1321(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1407 struct ip_vs_protocol *pp,
1322extern int ip_vs_nat_xmit 1408 struct ip_vs_iphdr *iph);
1323(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1409extern int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1324extern int ip_vs_tunnel_xmit 1410 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1325(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1411extern int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1326extern int ip_vs_dr_xmit 1412 struct ip_vs_protocol *pp,
1327(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1413 struct ip_vs_iphdr *iph);
1328extern int ip_vs_icmp_xmit 1414extern int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1329(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, 1415 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1330 int offset, unsigned int hooknum); 1416extern int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1417 struct ip_vs_protocol *pp, int offset,
1418 unsigned int hooknum, struct ip_vs_iphdr *iph);
1331extern void ip_vs_dst_reset(struct ip_vs_dest *dest); 1419extern void ip_vs_dst_reset(struct ip_vs_dest *dest);
1332 1420
1333#ifdef CONFIG_IP_VS_IPV6 1421#ifdef CONFIG_IP_VS_IPV6
1334extern int ip_vs_bypass_xmit_v6 1422extern int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1335(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1423 struct ip_vs_protocol *pp,
1336extern int ip_vs_nat_xmit_v6 1424 struct ip_vs_iphdr *iph);
1337(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1425extern int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1338extern int ip_vs_tunnel_xmit_v6 1426 struct ip_vs_protocol *pp,
1339(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1427 struct ip_vs_iphdr *iph);
1340extern int ip_vs_dr_xmit_v6 1428extern int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1341(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); 1429 struct ip_vs_protocol *pp,
1342extern int ip_vs_icmp_xmit_v6 1430 struct ip_vs_iphdr *iph);
1343(struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, 1431extern int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1344 int offset, unsigned int hooknum); 1432 struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph);
1433extern int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1434 struct ip_vs_protocol *pp, int offset,
1435 unsigned int hooknum, struct ip_vs_iphdr *iph);
1345#endif 1436#endif
1346 1437
1347#ifdef CONFIG_SYSCTL 1438#ifdef CONFIG_SYSCTL
diff --git a/include/net/ipip.h b/include/net/ipip.h
index ddc077c51f32..21947cf4fa46 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -48,25 +48,27 @@ struct ip_tunnel_prl_entry {
48 struct rcu_head rcu_head; 48 struct rcu_head rcu_head;
49}; 49};
50 50
51#define __IPTUNNEL_XMIT(stats1, stats2) do { \ 51static inline void iptunnel_xmit(struct sk_buff *skb, struct net_device *dev)
52 int err; \ 52{
53 int pkt_len = skb->len - skb_transport_offset(skb); \ 53 int err;
54 \ 54 struct iphdr *iph = ip_hdr(skb);
55 skb->ip_summed = CHECKSUM_NONE; \ 55 int pkt_len = skb->len - skb_transport_offset(skb);
56 ip_select_ident(iph, &rt->dst, NULL); \ 56 struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats);
57 \
58 err = ip_local_out(skb); \
59 if (likely(net_xmit_eval(err) == 0)) { \
60 u64_stats_update_begin(&(stats1)->syncp); \
61 (stats1)->tx_bytes += pkt_len; \
62 (stats1)->tx_packets++; \
63 u64_stats_update_end(&(stats1)->syncp); \
64 } else { \
65 (stats2)->tx_errors++; \
66 (stats2)->tx_aborted_errors++; \
67 } \
68} while (0)
69 57
70#define IPTUNNEL_XMIT() __IPTUNNEL_XMIT(txq, stats) 58 nf_reset(skb);
59 skb->ip_summed = CHECKSUM_NONE;
60 ip_select_ident(iph, skb_dst(skb), NULL);
61
62 err = ip_local_out(skb);
63 if (likely(net_xmit_eval(err) == 0)) {
64 u64_stats_update_begin(&tstats->syncp);
65 tstats->tx_bytes += pkt_len;
66 tstats->tx_packets++;
67 u64_stats_update_end(&tstats->syncp);
68 } else {
69 dev->stats.tx_errors++;
70 dev->stats.tx_aborted_errors++;
71 }
72}
71 73
72#endif 74#endif
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 979bf6c13141..5af66b26ebdd 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -271,6 +271,15 @@ struct ipv6_txoptions *ipv6_fixup_options(struct ipv6_txoptions *opt_space,
271 271
272extern bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb); 272extern bool ipv6_opt_accepted(const struct sock *sk, const struct sk_buff *skb);
273 273
274static inline bool ipv6_accept_ra(struct inet6_dev *idev)
275{
276 /* If forwarding is enabled, RA are not accepted unless the special
277 * hybrid mode (accept_ra=2) is enabled.
278 */
279 return idev->cnf.forwarding ? idev->cnf.accept_ra == 2 :
280 idev->cnf.accept_ra;
281}
282
274#if IS_ENABLED(CONFIG_IPV6) 283#if IS_ENABLED(CONFIG_IPV6)
275static inline int ip6_frag_nqueues(struct net *net) 284static inline int ip6_frag_nqueues(struct net *net)
276{ 285{
@@ -630,6 +639,16 @@ extern int ipv6_skip_exthdr(const struct sk_buff *, int start,
630 639
631extern bool ipv6_ext_hdr(u8 nexthdr); 640extern bool ipv6_ext_hdr(u8 nexthdr);
632 641
642enum {
643 IP6_FH_F_FRAG = (1 << 0),
644 IP6_FH_F_AUTH = (1 << 1),
645 IP6_FH_F_SKIP_RH = (1 << 2),
646};
647
648/* find specified header and get offset to it */
649extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
650 int target, unsigned short *fragoff, int *fragflg);
651
633extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type); 652extern int ipv6_find_tlv(struct sk_buff *skb, int offset, int type);
634 653
635extern struct in6_addr *fl6_update_dst(struct flowi6 *fl6, 654extern struct in6_addr *fl6_update_dst(struct flowi6 *fl6,
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index fff11b7fe8a4..591f78631f13 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -134,7 +134,7 @@ typedef struct {
134} CACHE_ENTRY; 134} CACHE_ENTRY;
135 135
136/* 136/*
137 * Information about each registred IrLAP layer 137 * Information about each registered IrLAP layer
138 */ 138 */
139struct lap_cb { 139struct lap_cb {
140 irda_queue_t queue; /* Must be first */ 140 irda_queue_t queue; /* Must be first */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 82558c8decf8..ee50c5eba50c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -144,6 +144,39 @@ struct ieee80211_low_level_stats {
144}; 144};
145 145
146/** 146/**
147 * enum ieee80211_chanctx_change - change flag for channel context
148 * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed
149 * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed
150 */
151enum ieee80211_chanctx_change {
152 IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0),
153 IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1),
154};
155
156/**
157 * struct ieee80211_chanctx_conf - channel context that vifs may be tuned to
158 *
159 * This is the driver-visible part. The ieee80211_chanctx
160 * that contains it is visible in mac80211 only.
161 *
162 * @def: the channel definition
163 * @rx_chains_static: The number of RX chains that must always be
164 * active on the channel to receive MIMO transmissions
165 * @rx_chains_dynamic: The number of RX chains that must be enabled
166 * after RTS/CTS handshake to receive SMPS MIMO transmissions;
167 * this will always be >= @rx_chains_static.
168 * @drv_priv: data area for driver use, will always be aligned to
169 * sizeof(void *), size is determined in hw information.
170 */
171struct ieee80211_chanctx_conf {
172 struct cfg80211_chan_def def;
173
174 u8 rx_chains_static, rx_chains_dynamic;
175
176 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
177};
178
179/**
147 * enum ieee80211_bss_change - BSS change notification flags 180 * enum ieee80211_bss_change - BSS change notification flags
148 * 181 *
149 * These flags are used with the bss_info_changed() callback 182 * These flags are used with the bss_info_changed() callback
@@ -172,6 +205,9 @@ struct ieee80211_low_level_stats {
172 * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) 205 * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode)
173 * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) 206 * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode)
174 * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) 207 * @BSS_CHANGED_PS: PS changed for this BSS (STA mode)
208 * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface
209 * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS)
210 * changed (currently only in P2P client mode, GO mode will be later)
175 */ 211 */
176enum ieee80211_bss_change { 212enum ieee80211_bss_change {
177 BSS_CHANGED_ASSOC = 1<<0, 213 BSS_CHANGED_ASSOC = 1<<0,
@@ -192,6 +228,8 @@ enum ieee80211_bss_change {
192 BSS_CHANGED_SSID = 1<<15, 228 BSS_CHANGED_SSID = 1<<15,
193 BSS_CHANGED_AP_PROBE_RESP = 1<<16, 229 BSS_CHANGED_AP_PROBE_RESP = 1<<16,
194 BSS_CHANGED_PS = 1<<17, 230 BSS_CHANGED_PS = 1<<17,
231 BSS_CHANGED_TXPOWER = 1<<18,
232 BSS_CHANGED_P2P_PS = 1<<19,
195 233
196 /* when adding here, make sure to change ieee80211_reconfig */ 234 /* when adding here, make sure to change ieee80211_reconfig */
197}; 235};
@@ -223,6 +261,7 @@ enum ieee80211_rssi_event {
223 * @assoc: association status 261 * @assoc: association status
224 * @ibss_joined: indicates whether this station is part of an IBSS 262 * @ibss_joined: indicates whether this station is part of an IBSS
225 * or not 263 * or not
264 * @ibss_creator: indicates if a new IBSS network is being created
226 * @aid: association ID number, valid only when @assoc is true 265 * @aid: association ID number, valid only when @assoc is true
227 * @use_cts_prot: use CTS protection 266 * @use_cts_prot: use CTS protection
228 * @use_short_preamble: use 802.11b short preamble; 267 * @use_short_preamble: use 802.11b short preamble;
@@ -247,9 +286,8 @@ enum ieee80211_rssi_event {
247 * @mcast_rate: per-band multicast rate index + 1 (0: disabled) 286 * @mcast_rate: per-band multicast rate index + 1 (0: disabled)
248 * @bssid: The BSSID for this BSS 287 * @bssid: The BSSID for this BSS
249 * @enable_beacon: whether beaconing should be enabled or not 288 * @enable_beacon: whether beaconing should be enabled or not
250 * @channel_type: Channel type for this BSS -- the hardware might be 289 * @chandef: Channel definition for this BSS -- the hardware might be
251 * configured for HT40+ while this BSS only uses no-HT, for 290 * configured a higher bandwidth than this BSS uses, for example.
252 * example.
253 * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation. 291 * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation.
254 * This field is only valid when the channel type is one of the HT types. 292 * This field is only valid when the channel type is one of the HT types.
255 * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value 293 * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value
@@ -273,11 +311,15 @@ enum ieee80211_rssi_event {
273 * @ssid: The SSID of the current vif. Only valid in AP-mode. 311 * @ssid: The SSID of the current vif. Only valid in AP-mode.
274 * @ssid_len: Length of SSID given in @ssid. 312 * @ssid_len: Length of SSID given in @ssid.
275 * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. 313 * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode.
314 * @txpower: TX power in dBm
315 * @p2p_ctwindow: P2P CTWindow, only for P2P client interfaces
316 * @p2p_oppps: P2P opportunistic PS is enabled
276 */ 317 */
277struct ieee80211_bss_conf { 318struct ieee80211_bss_conf {
278 const u8 *bssid; 319 const u8 *bssid;
279 /* association related data */ 320 /* association related data */
280 bool assoc, ibss_joined; 321 bool assoc, ibss_joined;
322 bool ibss_creator;
281 u16 aid; 323 u16 aid;
282 /* erp related data */ 324 /* erp related data */
283 bool use_cts_prot; 325 bool use_cts_prot;
@@ -294,7 +336,7 @@ struct ieee80211_bss_conf {
294 u16 ht_operation_mode; 336 u16 ht_operation_mode;
295 s32 cqm_rssi_thold; 337 s32 cqm_rssi_thold;
296 u32 cqm_rssi_hyst; 338 u32 cqm_rssi_hyst;
297 enum nl80211_channel_type channel_type; 339 struct cfg80211_chan_def chandef;
298 __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; 340 __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN];
299 u8 arp_addr_cnt; 341 u8 arp_addr_cnt;
300 bool arp_filter_enabled; 342 bool arp_filter_enabled;
@@ -304,6 +346,9 @@ struct ieee80211_bss_conf {
304 u8 ssid[IEEE80211_MAX_SSID_LEN]; 346 u8 ssid[IEEE80211_MAX_SSID_LEN];
305 size_t ssid_len; 347 size_t ssid_len;
306 bool hidden_ssid; 348 bool hidden_ssid;
349 int txpower;
350 u8 p2p_ctwindow;
351 bool p2p_oppps;
307}; 352};
308 353
309/** 354/**
@@ -454,9 +499,14 @@ enum mac80211_tx_control_flags {
454 * This is set if the current BSS requires ERP protection. 499 * This is set if the current BSS requires ERP protection.
455 * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. 500 * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble.
456 * @IEEE80211_TX_RC_MCS: HT rate. 501 * @IEEE80211_TX_RC_MCS: HT rate.
502 * @IEEE80211_TX_RC_VHT_MCS: VHT MCS rate, in this case the idx field is split
503 * into a higher 4 bits (Nss) and lower 4 bits (MCS number)
457 * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in 504 * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in
458 * Greenfield mode. 505 * Greenfield mode.
459 * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz. 506 * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz.
507 * @IEEE80211_TX_RC_80_MHZ_WIDTH: Indicates 80 MHz transmission
508 * @IEEE80211_TX_RC_160_MHZ_WIDTH: Indicates 160 MHz transmission
509 * (80+80 isn't supported yet)
460 * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the 510 * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the
461 * adjacent 20 MHz channels, if the current channel type is 511 * adjacent 20 MHz channels, if the current channel type is
462 * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. 512 * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS.
@@ -467,12 +517,15 @@ enum mac80211_rate_control_flags {
467 IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), 517 IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1),
468 IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), 518 IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2),
469 519
470 /* rate index is an MCS rate number instead of an index */ 520 /* rate index is an HT/VHT MCS instead of an index */
471 IEEE80211_TX_RC_MCS = BIT(3), 521 IEEE80211_TX_RC_MCS = BIT(3),
472 IEEE80211_TX_RC_GREEN_FIELD = BIT(4), 522 IEEE80211_TX_RC_GREEN_FIELD = BIT(4),
473 IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), 523 IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5),
474 IEEE80211_TX_RC_DUP_DATA = BIT(6), 524 IEEE80211_TX_RC_DUP_DATA = BIT(6),
475 IEEE80211_TX_RC_SHORT_GI = BIT(7), 525 IEEE80211_TX_RC_SHORT_GI = BIT(7),
526 IEEE80211_TX_RC_VHT_MCS = BIT(8),
527 IEEE80211_TX_RC_80_MHZ_WIDTH = BIT(9),
528 IEEE80211_TX_RC_160_MHZ_WIDTH = BIT(10),
476}; 529};
477 530
478 531
@@ -515,10 +568,32 @@ enum mac80211_rate_control_flags {
515 */ 568 */
516struct ieee80211_tx_rate { 569struct ieee80211_tx_rate {
517 s8 idx; 570 s8 idx;
518 u8 count; 571 u16 count:5,
519 u8 flags; 572 flags:11;
520} __packed; 573} __packed;
521 574
575#define IEEE80211_MAX_TX_RETRY 31
576
577static inline void ieee80211_rate_set_vht(struct ieee80211_tx_rate *rate,
578 u8 mcs, u8 nss)
579{
580 WARN_ON(mcs & ~0xF);
581 WARN_ON(nss & ~0x7);
582 rate->idx = (nss << 4) | mcs;
583}
584
585static inline u8
586ieee80211_rate_get_vht_mcs(const struct ieee80211_tx_rate *rate)
587{
588 return rate->idx & 0xF;
589}
590
591static inline u8
592ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate)
593{
594 return rate->idx >> 4;
595}
596
522/** 597/**
523 * struct ieee80211_tx_info - skb transmit information 598 * struct ieee80211_tx_info - skb transmit information
524 * 599 *
@@ -663,13 +738,20 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
663 * the frame. 738 * the frame.
664 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on 739 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
665 * the frame. 740 * the frame.
666 * @RX_FLAG_MACTIME_MPDU: The timestamp passed in the RX status (@mactime 741 * @RX_FLAG_MACTIME_START: The timestamp passed in the RX status (@mactime
667 * field) is valid and contains the time the first symbol of the MPDU 742 * field) is valid and contains the time the first symbol of the MPDU
668 * was received. This is useful in monitor mode and for proper IBSS 743 * was received. This is useful in monitor mode and for proper IBSS
669 * merging. 744 * merging.
745 * @RX_FLAG_MACTIME_END: The timestamp passed in the RX status (@mactime
746 * field) is valid and contains the time the last symbol of the MPDU
747 * (including FCS) was received.
670 * @RX_FLAG_SHORTPRE: Short preamble was used for this frame 748 * @RX_FLAG_SHORTPRE: Short preamble was used for this frame
671 * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index 749 * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index
750 * @RX_FLAG_VHT: VHT MCS was used and rate_index is MCS index
672 * @RX_FLAG_40MHZ: HT40 (40 MHz) was used 751 * @RX_FLAG_40MHZ: HT40 (40 MHz) was used
752 * @RX_FLAG_80MHZ: 80 MHz was used
753 * @RX_FLAG_80P80MHZ: 80+80 MHz was used
754 * @RX_FLAG_160MHZ: 160 MHz was used
673 * @RX_FLAG_SHORT_GI: Short guard interval was used 755 * @RX_FLAG_SHORT_GI: Short guard interval was used
674 * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present. 756 * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present.
675 * Valid only for data frames (mainly A-MPDU) 757 * Valid only for data frames (mainly A-MPDU)
@@ -697,7 +779,7 @@ enum mac80211_rx_flags {
697 RX_FLAG_IV_STRIPPED = BIT(4), 779 RX_FLAG_IV_STRIPPED = BIT(4),
698 RX_FLAG_FAILED_FCS_CRC = BIT(5), 780 RX_FLAG_FAILED_FCS_CRC = BIT(5),
699 RX_FLAG_FAILED_PLCP_CRC = BIT(6), 781 RX_FLAG_FAILED_PLCP_CRC = BIT(6),
700 RX_FLAG_MACTIME_MPDU = BIT(7), 782 RX_FLAG_MACTIME_START = BIT(7),
701 RX_FLAG_SHORTPRE = BIT(8), 783 RX_FLAG_SHORTPRE = BIT(8),
702 RX_FLAG_HT = BIT(9), 784 RX_FLAG_HT = BIT(9),
703 RX_FLAG_40MHZ = BIT(10), 785 RX_FLAG_40MHZ = BIT(10),
@@ -711,6 +793,11 @@ enum mac80211_rx_flags {
711 RX_FLAG_AMPDU_IS_LAST = BIT(18), 793 RX_FLAG_AMPDU_IS_LAST = BIT(18),
712 RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), 794 RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19),
713 RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), 795 RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20),
796 RX_FLAG_MACTIME_END = BIT(21),
797 RX_FLAG_VHT = BIT(22),
798 RX_FLAG_80MHZ = BIT(23),
799 RX_FLAG_80P80MHZ = BIT(24),
800 RX_FLAG_160MHZ = BIT(25),
714}; 801};
715 802
716/** 803/**
@@ -731,25 +818,39 @@ enum mac80211_rx_flags {
731 * @IEEE80211_HW_SIGNAL_* 818 * @IEEE80211_HW_SIGNAL_*
732 * @antenna: antenna used 819 * @antenna: antenna used
733 * @rate_idx: index of data rate into band's supported rates or MCS index if 820 * @rate_idx: index of data rate into band's supported rates or MCS index if
734 * HT rates are use (RX_FLAG_HT) 821 * HT or VHT is used (%RX_FLAG_HT/%RX_FLAG_VHT)
822 * @vht_nss: number of streams (VHT only)
735 * @flag: %RX_FLAG_* 823 * @flag: %RX_FLAG_*
736 * @rx_flags: internal RX flags for mac80211 824 * @rx_flags: internal RX flags for mac80211
737 * @ampdu_reference: A-MPDU reference number, must be a different value for 825 * @ampdu_reference: A-MPDU reference number, must be a different value for
738 * each A-MPDU but the same for each subframe within one A-MPDU 826 * each A-MPDU but the same for each subframe within one A-MPDU
739 * @ampdu_delimiter_crc: A-MPDU delimiter CRC 827 * @ampdu_delimiter_crc: A-MPDU delimiter CRC
828 * @vendor_radiotap_bitmap: radiotap vendor namespace presence bitmap
829 * @vendor_radiotap_len: radiotap vendor namespace length
830 * @vendor_radiotap_align: radiotap vendor namespace alignment. Note
831 * that the actual data must be at the start of the SKB data
832 * already.
833 * @vendor_radiotap_oui: radiotap vendor namespace OUI
834 * @vendor_radiotap_subns: radiotap vendor sub namespace
740 */ 835 */
741struct ieee80211_rx_status { 836struct ieee80211_rx_status {
742 u64 mactime; 837 u64 mactime;
743 u32 device_timestamp; 838 u32 device_timestamp;
744 u32 ampdu_reference; 839 u32 ampdu_reference;
745 u32 flag; 840 u32 flag;
841 u32 vendor_radiotap_bitmap;
842 u16 vendor_radiotap_len;
746 u16 freq; 843 u16 freq;
747 u8 rate_idx; 844 u8 rate_idx;
845 u8 vht_nss;
748 u8 rx_flags; 846 u8 rx_flags;
749 u8 band; 847 u8 band;
750 u8 antenna; 848 u8 antenna;
751 s8 signal; 849 s8 signal;
752 u8 ampdu_delimiter_crc; 850 u8 ampdu_delimiter_crc;
851 u8 vendor_radiotap_align;
852 u8 vendor_radiotap_oui[3];
853 u8 vendor_radiotap_subns;
753}; 854};
754 855
755/** 856/**
@@ -794,6 +895,8 @@ enum ieee80211_conf_flags {
794 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed 895 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
795 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed 896 * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed
796 * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed 897 * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed
898 * Note that this is only valid if channel contexts are not used,
899 * otherwise each channel context has the number of chains listed.
797 */ 900 */
798enum ieee80211_conf_changed { 901enum ieee80211_conf_changed {
799 IEEE80211_CONF_CHANGE_SMPS = BIT(1), 902 IEEE80211_CONF_CHANGE_SMPS = BIT(1),
@@ -845,7 +948,8 @@ enum ieee80211_smps_mode {
845 * powersave documentation below. This variable is valid only when 948 * powersave documentation below. This variable is valid only when
846 * the CONF_PS flag is set. 949 * the CONF_PS flag is set.
847 * 950 *
848 * @power_level: requested transmit power (in dBm) 951 * @power_level: requested transmit power (in dBm), backward compatibility
952 * value only that is set to the minimum of all interfaces
849 * 953 *
850 * @channel: the channel to tune to 954 * @channel: the channel to tune to
851 * @channel_type: the channel (HT) type 955 * @channel_type: the channel (HT) type
@@ -859,7 +963,9 @@ enum ieee80211_smps_mode {
859 * 963 *
860 * @smps_mode: spatial multiplexing powersave mode; note that 964 * @smps_mode: spatial multiplexing powersave mode; note that
861 * %IEEE80211_SMPS_STATIC is used when the device is not 965 * %IEEE80211_SMPS_STATIC is used when the device is not
862 * configured for an HT channel 966 * configured for an HT channel.
967 * Note that this is only valid if channel contexts are not used,
968 * otherwise each channel context has the number of chains listed.
863 */ 969 */
864struct ieee80211_conf { 970struct ieee80211_conf {
865 u32 flags; 971 u32 flags;
@@ -931,6 +1037,11 @@ enum ieee80211_vif_flags {
931 * at runtime, mac80211 will never touch this field 1037 * at runtime, mac80211 will never touch this field
932 * @hw_queue: hardware queue for each AC 1038 * @hw_queue: hardware queue for each AC
933 * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only 1039 * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only
1040 * @chanctx_conf: The channel context this interface is assigned to, or %NULL
1041 * when it is not assigned. This pointer is RCU-protected due to the TX
1042 * path needing to access it; even though the netdev carrier will always
1043 * be off when it is %NULL there can still be races and packets could be
1044 * processed after it switches back to %NULL.
934 * @drv_priv: data area for driver use, will always be aligned to 1045 * @drv_priv: data area for driver use, will always be aligned to
935 * sizeof(void *). 1046 * sizeof(void *).
936 */ 1047 */
@@ -943,6 +1054,8 @@ struct ieee80211_vif {
943 u8 cab_queue; 1054 u8 cab_queue;
944 u8 hw_queue[IEEE80211_NUM_ACS]; 1055 u8 hw_queue[IEEE80211_NUM_ACS];
945 1056
1057 struct ieee80211_chanctx_conf __rcu *chanctx_conf;
1058
946 u32 driver_flags; 1059 u32 driver_flags;
947 1060
948 /* must be last */ 1061 /* must be last */
@@ -1076,6 +1189,8 @@ enum ieee80211_sta_state {
1076 * @aid: AID we assigned to the station if we're an AP 1189 * @aid: AID we assigned to the station if we're an AP
1077 * @supp_rates: Bitmap of supported rates (per band) 1190 * @supp_rates: Bitmap of supported rates (per band)
1078 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities 1191 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities
1192 * @vht_cap: VHT capabilities of this STA; Not restricting any capabilities
1193 * of remote STA. Taking as is.
1079 * @wme: indicates whether the STA supports WME. Only valid during AP-mode. 1194 * @wme: indicates whether the STA supports WME. Only valid during AP-mode.
1080 * @drv_priv: data area for driver use, will always be aligned to 1195 * @drv_priv: data area for driver use, will always be aligned to
1081 * sizeof(void *), size is determined in hw information. 1196 * sizeof(void *), size is determined in hw information.
@@ -1088,6 +1203,7 @@ struct ieee80211_sta {
1088 u8 addr[ETH_ALEN]; 1203 u8 addr[ETH_ALEN];
1089 u16 aid; 1204 u16 aid;
1090 struct ieee80211_sta_ht_cap ht_cap; 1205 struct ieee80211_sta_ht_cap ht_cap;
1206 struct ieee80211_sta_vht_cap vht_cap;
1091 bool wme; 1207 bool wme;
1092 u8 uapsd_queues; 1208 u8 uapsd_queues;
1093 u8 max_sp; 1209 u8 max_sp;
@@ -1253,6 +1369,10 @@ struct ieee80211_tx_control {
1253 * @IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF: Use the P2P Device address for any 1369 * @IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF: Use the P2P Device address for any
1254 * P2P Interface. This will be honoured even if more than one interface 1370 * P2P Interface. This will be honoured even if more than one interface
1255 * is supported. 1371 * is supported.
1372 *
1373 * @IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL: On this hardware TX BA session
1374 * should be tear down once BAR frame will not be acked.
1375 *
1256 */ 1376 */
1257enum ieee80211_hw_flags { 1377enum ieee80211_hw_flags {
1258 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 1378 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -1281,6 +1401,7 @@ enum ieee80211_hw_flags {
1281 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, 1401 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
1282 IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24, 1402 IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24,
1283 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25, 1403 IEEE80211_HW_P2P_DEV_ADDR_FOR_INTF = 1<<25,
1404 IEEE80211_HW_TEARDOWN_AGGR_ON_BAR_FAIL = 1<<26,
1284}; 1405};
1285 1406
1286/** 1407/**
@@ -1325,6 +1446,8 @@ enum ieee80211_hw_flags {
1325 * within &struct ieee80211_vif. 1446 * within &struct ieee80211_vif.
1326 * @sta_data_size: size (in bytes) of the drv_priv data area 1447 * @sta_data_size: size (in bytes) of the drv_priv data area
1327 * within &struct ieee80211_sta. 1448 * within &struct ieee80211_sta.
1449 * @chanctx_data_size: size (in bytes) of the drv_priv data area
1450 * within &struct ieee80211_chanctx_conf.
1328 * 1451 *
1329 * @max_rates: maximum number of alternate rate retry stages the hw 1452 * @max_rates: maximum number of alternate rate retry stages the hw
1330 * can handle. 1453 * can handle.
@@ -1355,6 +1478,10 @@ enum ieee80211_hw_flags {
1355 * include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only 1478 * include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only
1356 * adding _BW is supported today. 1479 * adding _BW is supported today.
1357 * 1480 *
1481 * @radiotap_vht_details: lists which VHT MCS information the HW reports,
1482 * the default is _GI | _BANDWIDTH.
1483 * Use the %IEEE80211_RADIOTAP_VHT_KNOWN_* values.
1484 *
1358 * @netdev_features: netdev features to be set in each netdev created 1485 * @netdev_features: netdev features to be set in each netdev created
1359 * from this HW. Note only HW checksum features are currently 1486 * from this HW. Note only HW checksum features are currently
1360 * compatible with mac80211. Other feature bits will be rejected. 1487 * compatible with mac80211. Other feature bits will be rejected.
@@ -1369,6 +1496,7 @@ struct ieee80211_hw {
1369 int channel_change_time; 1496 int channel_change_time;
1370 int vif_data_size; 1497 int vif_data_size;
1371 int sta_data_size; 1498 int sta_data_size;
1499 int chanctx_data_size;
1372 int napi_weight; 1500 int napi_weight;
1373 u16 queues; 1501 u16 queues;
1374 u16 max_listen_interval; 1502 u16 max_listen_interval;
@@ -1380,6 +1508,7 @@ struct ieee80211_hw {
1380 u8 max_tx_aggregation_subframes; 1508 u8 max_tx_aggregation_subframes;
1381 u8 offchannel_tx_hw_queue; 1509 u8 offchannel_tx_hw_queue;
1382 u8 radiotap_mcs_details; 1510 u8 radiotap_mcs_details;
1511 u16 radiotap_vht_details;
1383 netdev_features_t netdev_features; 1512 netdev_features_t netdev_features;
1384}; 1513};
1385 1514
@@ -2126,6 +2255,14 @@ enum ieee80211_rate_control_changed {
2126 * @sta_remove: Notifies low level driver about removal of an associated 2255 * @sta_remove: Notifies low level driver about removal of an associated
2127 * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. 2256 * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep.
2128 * 2257 *
2258 * @sta_add_debugfs: Drivers can use this callback to add debugfs files
2259 * when a station is added to mac80211's station list. This callback
2260 * and @sta_remove_debugfs should be within a CONFIG_MAC80211_DEBUGFS
2261 * conditional. This callback can sleep.
2262 *
2263 * @sta_remove_debugfs: Remove the debugfs files which were added using
2264 * @sta_add_debugfs. This callback can sleep.
2265 *
2129 * @sta_notify: Notifies low level driver about power state transition of an 2266 * @sta_notify: Notifies low level driver about power state transition of an
2130 * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating 2267 * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating
2131 * in AP mode, this callback will not be called when the flag 2268 * in AP mode, this callback will not be called when the flag
@@ -2317,6 +2454,27 @@ enum ieee80211_rate_control_changed {
2317 * The callback will be called before each transmission and upon return 2454 * The callback will be called before each transmission and upon return
2318 * mac80211 will transmit the frame right away. 2455 * mac80211 will transmit the frame right away.
2319 * The callback is optional and can (should!) sleep. 2456 * The callback is optional and can (should!) sleep.
2457 *
2458 * @add_chanctx: Notifies device driver about new channel context creation.
2459 * @remove_chanctx: Notifies device driver about channel context destruction.
2460 * @change_chanctx: Notifies device driver about channel context changes that
2461 * may happen when combining different virtual interfaces on the same
2462 * channel context with different settings
2463 * @assign_vif_chanctx: Notifies device driver about channel context being bound
2464 * to vif. Possible use is for hw queue remapping.
2465 * @unassign_vif_chanctx: Notifies device driver about channel context being
2466 * unbound from vif.
2467 * @start_ap: Start operation on the AP interface, this is called after all the
2468 * information in bss_conf is set and beacon can be retrieved. A channel
2469 * context is bound before this is called. Note that if the driver uses
2470 * software scan or ROC, this (and @stop_ap) isn't called when the AP is
2471 * just "paused" for scanning/ROC, which is indicated by the beacon being
2472 * disabled/enabled via @bss_info_changed.
2473 * @stop_ap: Stop operation on the AP interface.
2474 *
2475 * @restart_complete: Called after a call to ieee80211_restart_hw(), when the
2476 * reconfiguration has completed. This can help the driver implement the
2477 * reconfiguration step. This callback may sleep.
2320 */ 2478 */
2321struct ieee80211_ops { 2479struct ieee80211_ops {
2322 void (*tx)(struct ieee80211_hw *hw, 2480 void (*tx)(struct ieee80211_hw *hw,
@@ -2342,6 +2500,9 @@ struct ieee80211_ops {
2342 struct ieee80211_bss_conf *info, 2500 struct ieee80211_bss_conf *info,
2343 u32 changed); 2501 u32 changed);
2344 2502
2503 int (*start_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
2504 void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
2505
2345 u64 (*prepare_multicast)(struct ieee80211_hw *hw, 2506 u64 (*prepare_multicast)(struct ieee80211_hw *hw,
2346 struct netdev_hw_addr_list *mc_list); 2507 struct netdev_hw_addr_list *mc_list);
2347 void (*configure_filter)(struct ieee80211_hw *hw, 2508 void (*configure_filter)(struct ieee80211_hw *hw,
@@ -2383,6 +2544,16 @@ struct ieee80211_ops {
2383 struct ieee80211_sta *sta); 2544 struct ieee80211_sta *sta);
2384 int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2545 int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2385 struct ieee80211_sta *sta); 2546 struct ieee80211_sta *sta);
2547#ifdef CONFIG_MAC80211_DEBUGFS
2548 void (*sta_add_debugfs)(struct ieee80211_hw *hw,
2549 struct ieee80211_vif *vif,
2550 struct ieee80211_sta *sta,
2551 struct dentry *dir);
2552 void (*sta_remove_debugfs)(struct ieee80211_hw *hw,
2553 struct ieee80211_vif *vif,
2554 struct ieee80211_sta *sta,
2555 struct dentry *dir);
2556#endif
2386 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2557 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2387 enum sta_notify_cmd, struct ieee80211_sta *sta); 2558 enum sta_notify_cmd, struct ieee80211_sta *sta);
2388 int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2559 int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
@@ -2424,8 +2595,8 @@ struct ieee80211_ops {
2424 int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); 2595 int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant);
2425 2596
2426 int (*remain_on_channel)(struct ieee80211_hw *hw, 2597 int (*remain_on_channel)(struct ieee80211_hw *hw,
2598 struct ieee80211_vif *vif,
2427 struct ieee80211_channel *chan, 2599 struct ieee80211_channel *chan,
2428 enum nl80211_channel_type channel_type,
2429 int duration); 2600 int duration);
2430 int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); 2601 int (*cancel_remain_on_channel)(struct ieee80211_hw *hw);
2431 int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); 2602 int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx);
@@ -2461,6 +2632,22 @@ struct ieee80211_ops {
2461 2632
2462 void (*mgd_prepare_tx)(struct ieee80211_hw *hw, 2633 void (*mgd_prepare_tx)(struct ieee80211_hw *hw,
2463 struct ieee80211_vif *vif); 2634 struct ieee80211_vif *vif);
2635
2636 int (*add_chanctx)(struct ieee80211_hw *hw,
2637 struct ieee80211_chanctx_conf *ctx);
2638 void (*remove_chanctx)(struct ieee80211_hw *hw,
2639 struct ieee80211_chanctx_conf *ctx);
2640 void (*change_chanctx)(struct ieee80211_hw *hw,
2641 struct ieee80211_chanctx_conf *ctx,
2642 u32 changed);
2643 int (*assign_vif_chanctx)(struct ieee80211_hw *hw,
2644 struct ieee80211_vif *vif,
2645 struct ieee80211_chanctx_conf *ctx);
2646 void (*unassign_vif_chanctx)(struct ieee80211_hw *hw,
2647 struct ieee80211_vif *vif,
2648 struct ieee80211_chanctx_conf *ctx);
2649
2650 void (*restart_complete)(struct ieee80211_hw *hw);
2464}; 2651};
2465 2652
2466/** 2653/**
@@ -2962,8 +3149,7 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
2962 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3149 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2963 * @ssid: SSID buffer 3150 * @ssid: SSID buffer
2964 * @ssid_len: length of SSID 3151 * @ssid_len: length of SSID
2965 * @ie: buffer containing all IEs except SSID for the template 3152 * @tailroom: tailroom to reserve at end of SKB for IEs
2966 * @ie_len: length of the IE buffer
2967 * 3153 *
2968 * Creates a Probe Request template which can, for example, be uploaded to 3154 * Creates a Probe Request template which can, for example, be uploaded to
2969 * hardware. 3155 * hardware.
@@ -2971,7 +3157,7 @@ struct sk_buff *ieee80211_nullfunc_get(struct ieee80211_hw *hw,
2971struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw, 3157struct sk_buff *ieee80211_probereq_get(struct ieee80211_hw *hw,
2972 struct ieee80211_vif *vif, 3158 struct ieee80211_vif *vif,
2973 const u8 *ssid, size_t ssid_len, 3159 const u8 *ssid, size_t ssid_len,
2974 const u8 *ie, size_t ie_len); 3160 size_t tailroom);
2975 3161
2976/** 3162/**
2977 * ieee80211_rts_get - RTS frame generation function 3163 * ieee80211_rts_get - RTS frame generation function
@@ -3145,6 +3331,19 @@ void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
3145 struct sk_buff *skb, u8 *p2k); 3331 struct sk_buff *skb, u8 *p2k);
3146 3332
3147/** 3333/**
3334 * ieee80211_aes_cmac_calculate_k1_k2 - calculate the AES-CMAC sub keys
3335 *
3336 * This function computes the two AES-CMAC sub-keys, based on the
3337 * previously installed master key.
3338 *
3339 * @keyconf: the parameter passed with the set key
3340 * @k1: a buffer to be filled with the 1st sub-key
3341 * @k2: a buffer to be filled with the 2nd sub-key
3342 */
3343void ieee80211_aes_cmac_calculate_k1_k2(struct ieee80211_key_conf *keyconf,
3344 u8 *k1, u8 *k2);
3345
3346/**
3148 * struct ieee80211_key_seq - key sequence counter 3347 * struct ieee80211_key_seq - key sequence counter
3149 * 3348 *
3150 * @tkip: TKIP data, containing IV32 and IV16 in host byte order 3349 * @tkip: TKIP data, containing IV32 and IV16 in host byte order
@@ -3294,6 +3493,21 @@ void ieee80211_sched_scan_results(struct ieee80211_hw *hw);
3294void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); 3493void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw);
3295 3494
3296/** 3495/**
3496 * enum ieee80211_interface_iteration_flags - interface iteration flags
3497 * @IEEE80211_IFACE_ITER_NORMAL: Iterate over all interfaces that have
3498 * been added to the driver; However, note that during hardware
3499 * reconfiguration (after restart_hw) it will iterate over a new
3500 * interface and over all the existing interfaces even if they
3501 * haven't been re-added to the driver yet.
3502 * @IEEE80211_IFACE_ITER_RESUME_ALL: During resume, iterate over all
3503 * interfaces, even if they haven't been re-added to the driver yet.
3504 */
3505enum ieee80211_interface_iteration_flags {
3506 IEEE80211_IFACE_ITER_NORMAL = 0,
3507 IEEE80211_IFACE_ITER_RESUME_ALL = BIT(0),
3508};
3509
3510/**
3297 * ieee80211_iterate_active_interfaces - iterate active interfaces 3511 * ieee80211_iterate_active_interfaces - iterate active interfaces
3298 * 3512 *
3299 * This function iterates over the interfaces associated with a given 3513 * This function iterates over the interfaces associated with a given
@@ -3301,13 +3515,15 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw);
3301 * This function allows the iterator function to sleep, when the iterator 3515 * This function allows the iterator function to sleep, when the iterator
3302 * function is atomic @ieee80211_iterate_active_interfaces_atomic can 3516 * function is atomic @ieee80211_iterate_active_interfaces_atomic can
3303 * be used. 3517 * be used.
3304 * Does not iterate over a new interface during add_interface() 3518 * Does not iterate over a new interface during add_interface().
3305 * 3519 *
3306 * @hw: the hardware struct of which the interfaces should be iterated over 3520 * @hw: the hardware struct of which the interfaces should be iterated over
3521 * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags
3307 * @iterator: the iterator function to call 3522 * @iterator: the iterator function to call
3308 * @data: first argument of the iterator function 3523 * @data: first argument of the iterator function
3309 */ 3524 */
3310void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, 3525void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
3526 u32 iter_flags,
3311 void (*iterator)(void *data, u8 *mac, 3527 void (*iterator)(void *data, u8 *mac,
3312 struct ieee80211_vif *vif), 3528 struct ieee80211_vif *vif),
3313 void *data); 3529 void *data);
@@ -3319,13 +3535,15 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
3319 * hardware that are currently active and calls the callback for them. 3535 * hardware that are currently active and calls the callback for them.
3320 * This function requires the iterator callback function to be atomic, 3536 * This function requires the iterator callback function to be atomic,
3321 * if that is not desired, use @ieee80211_iterate_active_interfaces instead. 3537 * if that is not desired, use @ieee80211_iterate_active_interfaces instead.
3322 * Does not iterate over a new interface during add_interface() 3538 * Does not iterate over a new interface during add_interface().
3323 * 3539 *
3324 * @hw: the hardware struct of which the interfaces should be iterated over 3540 * @hw: the hardware struct of which the interfaces should be iterated over
3541 * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags
3325 * @iterator: the iterator function to call, cannot sleep 3542 * @iterator: the iterator function to call, cannot sleep
3326 * @data: first argument of the iterator function 3543 * @data: first argument of the iterator function
3327 */ 3544 */
3328void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, 3545void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw,
3546 u32 iter_flags,
3329 void (*iterator)(void *data, 3547 void (*iterator)(void *data,
3330 u8 *mac, 3548 u8 *mac,
3331 struct ieee80211_vif *vif), 3549 struct ieee80211_vif *vif),
@@ -3524,6 +3742,27 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw,
3524 void *iter_data); 3742 void *iter_data);
3525 3743
3526/** 3744/**
3745 * ieee80211_iter_chan_contexts_atomic - iterate channel contexts
3746 * @hw: pointre obtained from ieee80211_alloc_hw().
3747 * @iter: iterator function
3748 * @iter_data: data passed to iterator function
3749 *
3750 * Iterate all active channel contexts. This function is atomic and
3751 * doesn't acquire any locks internally that might be held in other
3752 * places while calling into the driver.
3753 *
3754 * The iterator will not find a context that's being added (during
3755 * the driver callback to add it) but will find it while it's being
3756 * removed.
3757 */
3758void ieee80211_iter_chan_contexts_atomic(
3759 struct ieee80211_hw *hw,
3760 void (*iter)(struct ieee80211_hw *hw,
3761 struct ieee80211_chanctx_conf *chanctx_conf,
3762 void *data),
3763 void *iter_data);
3764
3765/**
3527 * ieee80211_ap_probereq_get - retrieve a Probe Request template 3766 * ieee80211_ap_probereq_get - retrieve a Probe Request template
3528 * @hw: pointer obtained from ieee80211_alloc_hw(). 3767 * @hw: pointer obtained from ieee80211_alloc_hw().
3529 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3768 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 980d263765cf..7af1ea893038 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -190,21 +190,6 @@ extern void ndisc_send_redirect(struct sk_buff *skb,
190extern int ndisc_mc_map(const struct in6_addr *addr, char *buf, 190extern int ndisc_mc_map(const struct in6_addr *addr, char *buf,
191 struct net_device *dev, int dir); 191 struct net_device *dev, int dir);
192 192
193extern struct sk_buff *ndisc_build_skb(struct net_device *dev,
194 const struct in6_addr *daddr,
195 const struct in6_addr *saddr,
196 struct icmp6hdr *icmp6h,
197 const struct in6_addr *target,
198 int llinfo);
199
200extern void ndisc_send_skb(struct sk_buff *skb,
201 struct net_device *dev,
202 struct neighbour *neigh,
203 const struct in6_addr *daddr,
204 const struct in6_addr *saddr,
205 struct icmp6hdr *icmp6h);
206
207
208 193
209/* 194/*
210 * IGMP 195 * IGMP
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 95e646641184..c5a43f56b796 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -23,6 +23,7 @@
23#endif 23#endif
24#include <net/netns/xfrm.h> 24#include <net/netns/xfrm.h>
25 25
26struct user_namespace;
26struct proc_dir_entry; 27struct proc_dir_entry;
27struct net_device; 28struct net_device;
28struct sock; 29struct sock;
@@ -53,6 +54,8 @@ struct net {
53 struct list_head cleanup_list; /* namespaces on death row */ 54 struct list_head cleanup_list; /* namespaces on death row */
54 struct list_head exit_list; /* Use only net_mutex */ 55 struct list_head exit_list; /* Use only net_mutex */
55 56
57 struct user_namespace *user_ns; /* Owning user namespace */
58
56 struct proc_dir_entry *proc_net; 59 struct proc_dir_entry *proc_net;
57 struct proc_dir_entry *proc_net_stat; 60 struct proc_dir_entry *proc_net_stat;
58 61
@@ -126,16 +129,21 @@ struct net {
126/* Init's network namespace */ 129/* Init's network namespace */
127extern struct net init_net; 130extern struct net init_net;
128 131
129#ifdef CONFIG_NET 132#ifdef CONFIG_NET_NS
130extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns); 133extern struct net *copy_net_ns(unsigned long flags,
131 134 struct user_namespace *user_ns, struct net *old_net);
132#else /* CONFIG_NET */ 135
133static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) 136#else /* CONFIG_NET_NS */
137#include <linux/sched.h>
138#include <linux/nsproxy.h>
139static inline struct net *copy_net_ns(unsigned long flags,
140 struct user_namespace *user_ns, struct net *old_net)
134{ 141{
135 /* There is nothing to copy so this is a noop */ 142 if (flags & CLONE_NEWNET)
136 return net_ns; 143 return ERR_PTR(-EINVAL);
144 return old_net;
137} 145}
138#endif /* CONFIG_NET */ 146#endif /* CONFIG_NET_NS */
139 147
140 148
141extern struct list_head net_namespace_list; 149extern struct list_head net_namespace_list;
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index f1494feba79f..caca0c4d6b4b 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -182,7 +182,7 @@ __nf_conntrack_find(struct net *net, u16 zone,
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); 184extern void nf_ct_delete_from_lists(struct nf_conn *ct);
185extern void nf_ct_insert_dying_list(struct nf_conn *ct); 185extern void nf_ct_dying_timeout(struct nf_conn *ct);
186 186
187extern void nf_conntrack_flush_report(struct net *net, u32 pid, int report); 187extern void nf_conntrack_flush_report(struct net *net, u32 pid, int report);
188 188
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h
index bd8eea720f2e..ad14a799fd2e 100644
--- a/include/net/netfilter/nf_nat.h
+++ b/include/net/netfilter/nf_nat.h
@@ -68,4 +68,19 @@ static inline struct nf_conn_nat *nfct_nat(const struct nf_conn *ct)
68#endif 68#endif
69} 69}
70 70
71static inline bool nf_nat_oif_changed(unsigned int hooknum,
72 enum ip_conntrack_info ctinfo,
73 struct nf_conn_nat *nat,
74 const struct net_device *out)
75{
76#if IS_ENABLED(CONFIG_IP_NF_TARGET_MASQUERADE) || \
77 IS_ENABLED(CONFIG_IP6_NF_TARGET_MASQUERADE)
78 return nat->masq_index && hooknum == NF_INET_POST_ROUTING &&
79 CTINFO2DIR(ctinfo) == IP_CT_DIR_ORIGINAL &&
80 nat->masq_index != out->ifindex;
81#else
82 return false;
83#endif
84}
85
71#endif 86#endif
diff --git a/include/net/netfilter/nf_queue.h b/include/net/netfilter/nf_queue.h
index 252fd1010b77..fb1c0be38b6d 100644
--- a/include/net/netfilter/nf_queue.h
+++ b/include/net/netfilter/nf_queue.h
@@ -21,14 +21,10 @@ struct nf_queue_entry {
21struct nf_queue_handler { 21struct nf_queue_handler {
22 int (*outfn)(struct nf_queue_entry *entry, 22 int (*outfn)(struct nf_queue_entry *entry,
23 unsigned int queuenum); 23 unsigned int queuenum);
24 char *name;
25}; 24};
26 25
27extern int nf_register_queue_handler(u_int8_t pf, 26void nf_register_queue_handler(const struct nf_queue_handler *qh);
28 const struct nf_queue_handler *qh); 27void nf_unregister_queue_handler(void);
29extern int nf_unregister_queue_handler(u_int8_t pf,
30 const struct nf_queue_handler *qh);
31extern void nf_unregister_queue_handlers(const struct nf_queue_handler *qh);
32extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict); 28extern void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict);
33 29
34#endif /* _NF_QUEUE_H */ 30#endif /* _NF_QUEUE_H */
diff --git a/include/net/netns/sctp.h b/include/net/netns/sctp.h
index 5e5eb1f9f14b..3573a81815ad 100644
--- a/include/net/netns/sctp.h
+++ b/include/net/netns/sctp.h
@@ -62,6 +62,9 @@ struct netns_sctp {
62 /* Whether Cookie Preservative is enabled(1) or not(0) */ 62 /* Whether Cookie Preservative is enabled(1) or not(0) */
63 int cookie_preserve_enable; 63 int cookie_preserve_enable;
64 64
65 /* The namespace default hmac alg */
66 char *sctp_hmac_alg;
67
65 /* Valid.Cookie.Life - 60 seconds */ 68 /* Valid.Cookie.Life - 60 seconds */
66 unsigned int valid_cookie_life; 69 unsigned int valid_cookie_life;
67 70
diff --git a/include/net/netprio_cgroup.h b/include/net/netprio_cgroup.h
index 2760f4f4ae9b..1d04b6f0fbd4 100644
--- a/include/net/netprio_cgroup.h
+++ b/include/net/netprio_cgroup.h
@@ -27,7 +27,6 @@ struct netprio_map {
27 27
28struct cgroup_netprio_state { 28struct cgroup_netprio_state {
29 struct cgroup_subsys_state css; 29 struct cgroup_subsys_state css;
30 u32 prioidx;
31}; 30};
32 31
33extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task); 32extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task);
@@ -36,13 +35,12 @@ extern void sock_update_netprioidx(struct sock *sk, struct task_struct *task);
36 35
37static inline u32 task_netprioidx(struct task_struct *p) 36static inline u32 task_netprioidx(struct task_struct *p)
38{ 37{
39 struct cgroup_netprio_state *state; 38 struct cgroup_subsys_state *css;
40 u32 idx; 39 u32 idx;
41 40
42 rcu_read_lock(); 41 rcu_read_lock();
43 state = container_of(task_subsys_state(p, net_prio_subsys_id), 42 css = task_subsys_state(p, net_prio_subsys_id);
44 struct cgroup_netprio_state, css); 43 idx = css->cgroup->id;
45 idx = state->prioidx;
46 rcu_read_unlock(); 44 rcu_read_unlock();
47 return idx; 45 return idx;
48} 46}
@@ -57,8 +55,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
57 rcu_read_lock(); 55 rcu_read_lock();
58 css = task_subsys_state(p, net_prio_subsys_id); 56 css = task_subsys_state(p, net_prio_subsys_id);
59 if (css) 57 if (css)
60 idx = container_of(css, 58 idx = css->cgroup->id;
61 struct cgroup_netprio_state, css)->prioidx;
62 rcu_read_unlock(); 59 rcu_read_unlock();
63 return idx; 60 return idx;
64} 61}
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h
index e900072950cb..671953e11575 100644
--- a/include/net/nfc/hci.h
+++ b/include/net/nfc/hci.h
@@ -24,6 +24,12 @@
24 24
25#include <net/nfc/nfc.h> 25#include <net/nfc/nfc.h>
26 26
27struct nfc_phy_ops {
28 int (*write)(void *dev_id, struct sk_buff *skb);
29 int (*enable)(void *dev_id);
30 void (*disable)(void *dev_id);
31};
32
27struct nfc_hci_dev; 33struct nfc_hci_dev;
28 34
29struct nfc_hci_ops { 35struct nfc_hci_ops {
@@ -38,15 +44,21 @@ struct nfc_hci_ops {
38 int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); 44 int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb);
39 int (*start_poll) (struct nfc_hci_dev *hdev, 45 int (*start_poll) (struct nfc_hci_dev *hdev,
40 u32 im_protocols, u32 tm_protocols); 46 u32 im_protocols, u32 tm_protocols);
47 int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target,
48 u8 comm_mode, u8 *gb, size_t gb_len);
49 int (*dep_link_down)(struct nfc_hci_dev *hdev);
41 int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, 50 int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate,
42 struct nfc_target *target); 51 struct nfc_target *target);
43 int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, 52 int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate,
44 struct nfc_target *target); 53 struct nfc_target *target);
45 int (*data_exchange) (struct nfc_hci_dev *hdev, 54 int (*im_transceive) (struct nfc_hci_dev *hdev,
46 struct nfc_target *target, struct sk_buff *skb, 55 struct nfc_target *target, struct sk_buff *skb,
47 data_exchange_cb_t cb, void *cb_context); 56 data_exchange_cb_t cb, void *cb_context);
57 int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb);
48 int (*check_presence)(struct nfc_hci_dev *hdev, 58 int (*check_presence)(struct nfc_hci_dev *hdev,
49 struct nfc_target *target); 59 struct nfc_target *target);
60 void (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event,
61 struct sk_buff *skb);
50}; 62};
51 63
52/* Pipes */ 64/* Pipes */
@@ -114,6 +126,9 @@ struct nfc_hci_dev {
114 int async_cb_type; 126 int async_cb_type;
115 data_exchange_cb_t async_cb; 127 data_exchange_cb_t async_cb;
116 void *async_cb_context; 128 void *async_cb_context;
129
130 u8 *gb;
131 size_t gb_len;
117}; 132};
118 133
119/* hci device allocation */ 134/* hci device allocation */
@@ -134,6 +149,8 @@ void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev);
134 149
135void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); 150void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err);
136 151
152int nfc_hci_result_to_errno(u8 result);
153
137/* Host IDs */ 154/* Host IDs */
138#define NFC_HCI_HOST_CONTROLLER_ID 0x00 155#define NFC_HCI_HOST_CONTROLLER_ID 0x00
139#define NFC_HCI_TERMINAL_HOST_ID 0x01 156#define NFC_HCI_TERMINAL_HOST_ID 0x01
@@ -219,5 +236,7 @@ int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response,
219 const u8 *param, size_t param_len); 236 const u8 *param, size_t param_len);
220int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, 237int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event,
221 const u8 *param, size_t param_len); 238 const u8 *param, size_t param_len);
239int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate);
240u32 nfc_hci_sak_to_protocol(u8 sak);
222 241
223#endif /* __NET_HCI_H */ 242#endif /* __NET_HCI_H */
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h
index f05b10682c9d..fce80b2f9be7 100644
--- a/include/net/nfc/nfc.h
+++ b/include/net/nfc/nfc.h
@@ -95,7 +95,7 @@ struct nfc_genl_data {
95}; 95};
96 96
97struct nfc_dev { 97struct nfc_dev {
98 unsigned int idx; 98 int idx;
99 u32 target_next_idx; 99 u32 target_next_idx;
100 struct nfc_target *targets; 100 struct nfc_target *targets;
101 int n_targets; 101 int n_targets;
diff --git a/include/net/protocol.h b/include/net/protocol.h
index 929528c73fe8..047c0476c0a0 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -25,9 +25,11 @@
25#define _PROTOCOL_H 25#define _PROTOCOL_H
26 26
27#include <linux/in6.h> 27#include <linux/in6.h>
28#include <linux/skbuff.h>
28#if IS_ENABLED(CONFIG_IPV6) 29#if IS_ENABLED(CONFIG_IPV6)
29#include <linux/ipv6.h> 30#include <linux/ipv6.h>
30#endif 31#endif
32#include <linux/netdevice.h>
31 33
32/* This is one larger than the largest protocol value that can be 34/* This is one larger than the largest protocol value that can be
33 * found in an ipv4 or ipv6 header. Since in both cases the protocol 35 * found in an ipv4 or ipv6 header. Since in both cases the protocol
@@ -40,12 +42,6 @@ struct net_protocol {
40 void (*early_demux)(struct sk_buff *skb); 42 void (*early_demux)(struct sk_buff *skb);
41 int (*handler)(struct sk_buff *skb); 43 int (*handler)(struct sk_buff *skb);
42 void (*err_handler)(struct sk_buff *skb, u32 info); 44 void (*err_handler)(struct sk_buff *skb, u32 info);
43 int (*gso_send_check)(struct sk_buff *skb);
44 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
45 netdev_features_t features);
46 struct sk_buff **(*gro_receive)(struct sk_buff **head,
47 struct sk_buff *skb);
48 int (*gro_complete)(struct sk_buff *skb);
49 unsigned int no_policy:1, 45 unsigned int no_policy:1,
50 netns_ok:1; 46 netns_ok:1;
51}; 47};
@@ -60,23 +56,20 @@ struct inet6_protocol {
60 struct inet6_skb_parm *opt, 56 struct inet6_skb_parm *opt,
61 u8 type, u8 code, int offset, 57 u8 type, u8 code, int offset,
62 __be32 info); 58 __be32 info);
63
64 int (*gso_send_check)(struct sk_buff *skb);
65 struct sk_buff *(*gso_segment)(struct sk_buff *skb,
66 netdev_features_t features);
67 struct sk_buff **(*gro_receive)(struct sk_buff **head,
68 struct sk_buff *skb);
69 int (*gro_complete)(struct sk_buff *skb);
70
71 unsigned int flags; /* INET6_PROTO_xxx */ 59 unsigned int flags; /* INET6_PROTO_xxx */
72}; 60};
73 61
74#define INET6_PROTO_NOPOLICY 0x1 62#define INET6_PROTO_NOPOLICY 0x1
75#define INET6_PROTO_FINAL 0x2 63#define INET6_PROTO_FINAL 0x2
76/* This should be set for any extension header which is compatible with GSO. */
77#define INET6_PROTO_GSO_EXTHDR 0x4
78#endif 64#endif
79 65
66struct net_offload {
67 struct offload_callbacks callbacks;
68 unsigned int flags; /* Flags used by IPv6 for now */
69};
70/* This should be set for any extension header which is compatible with GSO. */
71#define INET6_PROTO_GSO_EXTHDR 0x1
72
80/* This is used to register socket interfaces for IP protocols. */ 73/* This is used to register socket interfaces for IP protocols. */
81struct inet_protosw { 74struct inet_protosw {
82 struct list_head list; 75 struct list_head list;
@@ -96,6 +89,8 @@ struct inet_protosw {
96#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ 89#define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */
97 90
98extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS]; 91extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS];
92extern const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS];
93extern const struct net_offload __rcu *inet6_offloads[MAX_INET_PROTOS];
99 94
100#if IS_ENABLED(CONFIG_IPV6) 95#if IS_ENABLED(CONFIG_IPV6)
101extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; 96extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS];
@@ -103,6 +98,8 @@ extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS];
103 98
104extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); 99extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num);
105extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); 100extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num);
101extern int inet_add_offload(const struct net_offload *prot, unsigned char num);
102extern int inet_del_offload(const struct net_offload *prot, unsigned char num);
106extern void inet_register_protosw(struct inet_protosw *p); 103extern void inet_register_protosw(struct inet_protosw *p);
107extern void inet_unregister_protosw(struct inet_protosw *p); 104extern void inet_unregister_protosw(struct inet_protosw *p);
108 105
@@ -112,5 +109,7 @@ extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char n
112extern int inet6_register_protosw(struct inet_protosw *p); 109extern int inet6_register_protosw(struct inet_protosw *p);
113extern void inet6_unregister_protosw(struct inet_protosw *p); 110extern void inet6_unregister_protosw(struct inet_protosw *p);
114#endif 111#endif
112extern int inet6_add_offload(const struct net_offload *prot, unsigned char num);
113extern int inet6_del_offload(const struct net_offload *prot, unsigned char num);
115 114
116#endif /* _PROTOCOL_H */ 115#endif /* _PROTOCOL_H */
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index b01d8dd9ee7c..a51dbd17c2de 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -49,13 +49,16 @@ struct request_sock_ops {
49 struct request_sock *req); 49 struct request_sock *req);
50}; 50};
51 51
52extern int inet_rtx_syn_ack(struct sock *parent, struct request_sock *req);
53
52/* struct request_sock - mini sock to represent a connection request 54/* struct request_sock - mini sock to represent a connection request
53 */ 55 */
54struct request_sock { 56struct request_sock {
55 struct request_sock *dl_next; /* Must be first member! */ 57 struct request_sock *dl_next; /* Must be first member! */
56 u16 mss; 58 u16 mss;
57 u8 retrans; 59 u8 num_retrans; /* number of retransmits */
58 u8 cookie_ts; /* syncookie: encode tcpopts in timestamp */ 60 u8 cookie_ts:1; /* syncookie: encode tcpopts in timestamp */
61 u8 num_timeout:7; /* number of timeouts */
59 /* The following two fields can be easily recomputed I think -AK */ 62 /* The following two fields can be easily recomputed I think -AK */
60 u32 window_clamp; /* window clamp at creation time */ 63 u32 window_clamp; /* window clamp at creation time */
61 u32 rcv_wnd; /* rcv_wnd offered first time */ 64 u32 rcv_wnd; /* rcv_wnd offered first time */
@@ -231,7 +234,7 @@ static inline int reqsk_queue_removed(struct request_sock_queue *queue,
231{ 234{
232 struct listen_sock *lopt = queue->listen_opt; 235 struct listen_sock *lopt = queue->listen_opt;
233 236
234 if (req->retrans == 0) 237 if (req->num_timeout == 0)
235 --lopt->qlen_young; 238 --lopt->qlen_young;
236 239
237 return --lopt->qlen; 240 return --lopt->qlen;
@@ -269,7 +272,8 @@ static inline void reqsk_queue_hash_req(struct request_sock_queue *queue,
269 struct listen_sock *lopt = queue->listen_opt; 272 struct listen_sock *lopt = queue->listen_opt;
270 273
271 req->expires = jiffies + timeout; 274 req->expires = jiffies + timeout;
272 req->retrans = 0; 275 req->num_retrans = 0;
276 req->num_timeout = 0;
273 req->sk = NULL; 277 req->sk = NULL;
274 req->dl_next = lopt->syn_table[hash]; 278 req->dl_next = lopt->syn_table[hash];
275 279
diff --git a/include/net/route.h b/include/net/route.h
index bc40b633a5c4..2ea40c1b5e00 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -198,10 +198,13 @@ struct in_ifaddr;
198extern void fib_add_ifaddr(struct in_ifaddr *); 198extern void fib_add_ifaddr(struct in_ifaddr *);
199extern void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); 199extern void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *);
200 200
201static inline void ip_rt_put(struct rtable * rt) 201static inline void ip_rt_put(struct rtable *rt)
202{ 202{
203 if (rt) 203 /* dst_release() accepts a NULL parameter.
204 dst_release(&rt->dst); 204 * We rely on dst being first structure in struct rtable
205 */
206 BUILD_BUG_ON(offsetof(struct rtable, dst) != 0);
207 dst_release(&rt->dst);
205} 208}
206 209
207#define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) 210#define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3)
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index 6b00c4fc4291..5a15fabd6a75 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -125,7 +125,7 @@ extern void rtnl_af_unregister(struct rtnl_af_ops *ops);
125 125
126 126
127extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); 127extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]);
128extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net, 128extern struct net_device *rtnl_create_link(struct net *net,
129 char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); 129 char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]);
130extern int rtnl_configure_link(struct net_device *dev, 130extern int rtnl_configure_link(struct net_device *dev,
131 const struct ifinfomsg *ifm); 131 const struct ifinfomsg *ifm);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 4616f468d599..1540f9c2fcf4 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -50,6 +50,13 @@ struct Qdisc {
50#define TCQ_F_INGRESS 2 50#define TCQ_F_INGRESS 2
51#define TCQ_F_CAN_BYPASS 4 51#define TCQ_F_CAN_BYPASS 4
52#define TCQ_F_MQROOT 8 52#define TCQ_F_MQROOT 8
53#define TCQ_F_ONETXQUEUE 0x10 /* dequeue_skb() can assume all skbs are for
54 * q->dev_queue : It can test
55 * netif_xmit_frozen_or_stopped() before
56 * dequeueing next packet.
57 * Its true for MQ/MQPRIO slaves, or non
58 * multiqueue device.
59 */
53#define TCQ_F_WARN_NONWC (1 << 16) 60#define TCQ_F_WARN_NONWC (1 << 16)
54 int padded; 61 int padded;
55 const struct Qdisc_ops *ops; 62 const struct Qdisc_ops *ops;
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 712b3bebeda7..35247271e557 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -130,8 +130,6 @@ typedef union {
130 __be16 err; 130 __be16 err;
131 sctp_state_t state; 131 sctp_state_t state;
132 sctp_event_timeout_t to; 132 sctp_event_timeout_t to;
133 unsigned long zero;
134 void *ptr;
135 struct sctp_chunk *chunk; 133 struct sctp_chunk *chunk;
136 struct sctp_association *asoc; 134 struct sctp_association *asoc;
137 struct sctp_transport *transport; 135 struct sctp_transport *transport;
@@ -154,23 +152,15 @@ typedef union {
154 * which takes an __s32 and returns a sctp_arg_t containing the 152 * which takes an __s32 and returns a sctp_arg_t containing the
155 * __s32. So, after foo = SCTP_I32(arg), foo.i32 == arg. 153 * __s32. So, after foo = SCTP_I32(arg), foo.i32 == arg.
156 */ 154 */
157static inline sctp_arg_t SCTP_NULL(void)
158{
159 sctp_arg_t retval; retval.ptr = NULL; return retval;
160}
161static inline sctp_arg_t SCTP_NOFORCE(void)
162{
163 sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 0; return retval;
164}
165static inline sctp_arg_t SCTP_FORCE(void)
166{
167 sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 1; return retval;
168}
169 155
170#define SCTP_ARG_CONSTRUCTOR(name, type, elt) \ 156#define SCTP_ARG_CONSTRUCTOR(name, type, elt) \
171static inline sctp_arg_t \ 157static inline sctp_arg_t \
172SCTP_## name (type arg) \ 158SCTP_## name (type arg) \
173{ sctp_arg_t retval = {.zero = 0UL}; retval.elt = arg; return retval; } 159{ sctp_arg_t retval;\
160 memset(&retval, 0, sizeof(sctp_arg_t));\
161 retval.elt = arg;\
162 return retval;\
163}
174 164
175SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) 165SCTP_ARG_CONSTRUCTOR(I32, __s32, i32)
176SCTP_ARG_CONSTRUCTOR(U32, __u32, u32) 166SCTP_ARG_CONSTRUCTOR(U32, __u32, u32)
@@ -181,7 +171,6 @@ SCTP_ARG_CONSTRUCTOR(ERROR, int, error)
181SCTP_ARG_CONSTRUCTOR(PERR, __be16, err) /* protocol error */ 171SCTP_ARG_CONSTRUCTOR(PERR, __be16, err) /* protocol error */
182SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) 172SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state)
183SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) 173SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to)
184SCTP_ARG_CONSTRUCTOR(PTR, void *, ptr)
185SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk) 174SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk)
186SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc) 175SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc)
187SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport) 176SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport)
@@ -192,6 +181,23 @@ SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet)
192SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) 181SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh)
193SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg) 182SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg)
194 183
184static inline sctp_arg_t SCTP_FORCE(void)
185{
186 return SCTP_I32(1);
187}
188
189static inline sctp_arg_t SCTP_NOFORCE(void)
190{
191 return SCTP_I32(0);
192}
193
194static inline sctp_arg_t SCTP_NULL(void)
195{
196 sctp_arg_t retval;
197 memset(&retval, 0, sizeof(sctp_arg_t));
198 return retval;
199}
200
195typedef struct { 201typedef struct {
196 sctp_arg_t obj; 202 sctp_arg_t obj;
197 sctp_verb_t verb; 203 sctp_verb_t verb;
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index d053d2e99876..c29707d654c0 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -312,14 +312,6 @@ enum { SCTP_MAX_GABS = 16 };
312 * functions simpler to write. 312 * functions simpler to write.
313 */ 313 */
314 314
315#if defined (CONFIG_SCTP_HMAC_MD5)
316#define SCTP_COOKIE_HMAC_ALG "hmac(md5)"
317#elif defined (CONFIG_SCTP_HMAC_SHA1)
318#define SCTP_COOKIE_HMAC_ALG "hmac(sha1)"
319#else
320#define SCTP_COOKIE_HMAC_ALG NULL
321#endif
322
323/* These return values describe the success or failure of a number of 315/* These return values describe the success or failure of a number of
324 * routines which form the lower interface to SCTP_outqueue. 316 * routines which form the lower interface to SCTP_outqueue.
325 */ 317 */
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 9c6414f553f9..7fdf298a47ef 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -272,6 +272,18 @@ struct sctp_mib {
272 unsigned long mibs[SCTP_MIB_MAX]; 272 unsigned long mibs[SCTP_MIB_MAX];
273}; 273};
274 274
275/* helper function to track stats about max rto and related transport */
276static inline void sctp_max_rto(struct sctp_association *asoc,
277 struct sctp_transport *trans)
278{
279 if (asoc->stats.max_obs_rto < (__u64)trans->rto) {
280 asoc->stats.max_obs_rto = trans->rto;
281 memset(&asoc->stats.obs_rto_ipaddr, 0,
282 sizeof(struct sockaddr_storage));
283 memcpy(&asoc->stats.obs_rto_ipaddr, &trans->ipaddr,
284 trans->af_specific->sockaddr_len);
285 }
286}
275 287
276/* Print debugging messages. */ 288/* Print debugging messages. */
277#if SCTP_DEBUG 289#if SCTP_DEBUG
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index b5887e1677e4..2a82d1384706 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -234,6 +234,8 @@ struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *,
234struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *, 234struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *,
235 const struct sctp_chunk *, 235 const struct sctp_chunk *,
236 struct sctp_paramhdr *); 236 struct sctp_paramhdr *);
237struct sctp_chunk *sctp_make_violation_max_retrans(const struct sctp_association *,
238 const struct sctp_chunk *);
237struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, 239struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *,
238 const struct sctp_transport *); 240 const struct sctp_transport *);
239struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *, 241struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *,
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 64158aa1bb5f..fdeb85a970fc 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -177,6 +177,7 @@ struct sctp_sock {
177 177
178 /* Access to HMAC transform. */ 178 /* Access to HMAC transform. */
179 struct crypto_hash *hmac; 179 struct crypto_hash *hmac;
180 char *sctp_hmac_alg;
180 181
181 /* What is our base endpointer? */ 182 /* What is our base endpointer? */
182 struct sctp_endpoint *ep; 183 struct sctp_endpoint *ep;
@@ -948,6 +949,8 @@ struct sctp_transport {
948 949
949 /* 64-bit random number sent with heartbeat. */ 950 /* 64-bit random number sent with heartbeat. */
950 __u64 hb_nonce; 951 __u64 hb_nonce;
952
953 struct rcu_head rcu;
951}; 954};
952 955
953struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *, 956struct sctp_transport *sctp_transport_new(struct net *, const union sctp_addr *,
@@ -1311,6 +1314,40 @@ struct sctp_inithdr_host {
1311 __u32 initial_tsn; 1314 __u32 initial_tsn;
1312}; 1315};
1313 1316
1317/* SCTP_GET_ASSOC_STATS counters */
1318struct sctp_priv_assoc_stats {
1319 /* Maximum observed rto in the association during subsequent
1320 * observations. Value is set to 0 if no RTO measurement took place
1321 * The transport where the max_rto was observed is returned in
1322 * obs_rto_ipaddr
1323 */
1324 struct sockaddr_storage obs_rto_ipaddr;
1325 __u64 max_obs_rto;
1326 /* Total In and Out SACKs received and sent */
1327 __u64 isacks;
1328 __u64 osacks;
1329 /* Total In and Out packets received and sent */
1330 __u64 opackets;
1331 __u64 ipackets;
1332 /* Total retransmitted chunks */
1333 __u64 rtxchunks;
1334 /* TSN received > next expected */
1335 __u64 outofseqtsns;
1336 /* Duplicate Chunks received */
1337 __u64 idupchunks;
1338 /* Gap Ack Blocks received */
1339 __u64 gapcnt;
1340 /* Unordered data chunks sent and received */
1341 __u64 ouodchunks;
1342 __u64 iuodchunks;
1343 /* Ordered data chunks sent and received */
1344 __u64 oodchunks;
1345 __u64 iodchunks;
1346 /* Control chunks sent and received */
1347 __u64 octrlchunks;
1348 __u64 ictrlchunks;
1349};
1350
1314/* RFC2960 1351/* RFC2960
1315 * 1352 *
1316 * 12. Recommended Transmission Control Block (TCB) Parameters 1353 * 12. Recommended Transmission Control Block (TCB) Parameters
@@ -1829,6 +1866,8 @@ struct sctp_association {
1829 1866
1830 __u8 need_ecne:1, /* Need to send an ECNE Chunk? */ 1867 __u8 need_ecne:1, /* Need to send an ECNE Chunk? */
1831 temp:1; /* Is it a temporary association? */ 1868 temp:1; /* Is it a temporary association? */
1869
1870 struct sctp_priv_assoc_stats stats;
1832}; 1871};
1833 1872
1834 1873
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h
index 2e5ee0d8458d..ff1b8ba73ab1 100644
--- a/include/net/sctp/ulpqueue.h
+++ b/include/net/sctp/ulpqueue.h
@@ -72,7 +72,7 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev);
72void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); 72void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t);
73 73
74/* Perform partial delivery. */ 74/* Perform partial delivery. */
75void sctp_ulpq_partial_delivery(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); 75void sctp_ulpq_partial_delivery(struct sctp_ulpq *, gfp_t);
76 76
77/* Abort the partial delivery. */ 77/* Abort the partial delivery. */
78void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t); 78void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t);
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 1b02d7ad453b..9a0ae091366d 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -107,6 +107,7 @@ typedef __s32 sctp_assoc_t;
107#define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */ 107#define SCTP_GET_LOCAL_ADDRS 109 /* Get all local address. */
108#define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ 108#define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */
109#define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ 109#define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */
110#define SCTP_GET_ASSOC_STATS 112 /* Read only */
110 111
111/* 112/*
112 * 5.2.1 SCTP Initiation Structure (SCTP_INIT) 113 * 5.2.1 SCTP Initiation Structure (SCTP_INIT)
@@ -719,6 +720,32 @@ struct sctp_getaddrs {
719 __u8 addrs[0]; /*output, variable size*/ 720 __u8 addrs[0]; /*output, variable size*/
720}; 721};
721 722
723/* A socket user request obtained via SCTP_GET_ASSOC_STATS that retrieves
724 * association stats. All stats are counts except sas_maxrto and
725 * sas_obs_rto_ipaddr. maxrto is the max observed rto + transport since
726 * the last call. Will return 0 when RTO was not update since last call
727 */
728struct sctp_assoc_stats {
729 sctp_assoc_t sas_assoc_id; /* Input */
730 /* Transport of observed max RTO */
731 struct sockaddr_storage sas_obs_rto_ipaddr;
732 __u64 sas_maxrto; /* Maximum Observed RTO for period */
733 __u64 sas_isacks; /* SACKs received */
734 __u64 sas_osacks; /* SACKs sent */
735 __u64 sas_opackets; /* Packets sent */
736 __u64 sas_ipackets; /* Packets received */
737 __u64 sas_rtxchunks; /* Retransmitted Chunks */
738 __u64 sas_outofseqtsns;/* TSN received > next expected */
739 __u64 sas_idupchunks; /* Dups received (ordered+unordered) */
740 __u64 sas_gapcnt; /* Gap Acknowledgements Received */
741 __u64 sas_ouodchunks; /* Unordered data chunks sent */
742 __u64 sas_iuodchunks; /* Unordered data chunks received */
743 __u64 sas_oodchunks; /* Ordered data chunks sent */
744 __u64 sas_iodchunks; /* Ordered data chunks received */
745 __u64 sas_octrlchunks; /* Control chunks sent */
746 __u64 sas_ictrlchunks; /* Control chunks received */
747};
748
722/* These are bit fields for msghdr->msg_flags. See section 5.1. */ 749/* These are bit fields for msghdr->msg_flags. See section 5.1. */
723/* On user space Linux, these live in <bits/socket.h> as an enum. */ 750/* On user space Linux, these live in <bits/socket.h> as an enum. */
724enum sctp_msg_flags { 751enum sctp_msg_flags {
diff --git a/include/net/sock.h b/include/net/sock.h
index c945fba4f543..93a6745bfdb2 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -126,12 +126,17 @@ struct sock;
126struct proto; 126struct proto;
127struct net; 127struct net;
128 128
129typedef __u32 __bitwise __portpair;
130typedef __u64 __bitwise __addrpair;
131
129/** 132/**
130 * struct sock_common - minimal network layer representation of sockets 133 * struct sock_common - minimal network layer representation of sockets
131 * @skc_daddr: Foreign IPv4 addr 134 * @skc_daddr: Foreign IPv4 addr
132 * @skc_rcv_saddr: Bound local IPv4 addr 135 * @skc_rcv_saddr: Bound local IPv4 addr
133 * @skc_hash: hash value used with various protocol lookup tables 136 * @skc_hash: hash value used with various protocol lookup tables
134 * @skc_u16hashes: two u16 hash values used by UDP lookup tables 137 * @skc_u16hashes: two u16 hash values used by UDP lookup tables
138 * @skc_dport: placeholder for inet_dport/tw_dport
139 * @skc_num: placeholder for inet_num/tw_num
135 * @skc_family: network address family 140 * @skc_family: network address family
136 * @skc_state: Connection state 141 * @skc_state: Connection state
137 * @skc_reuse: %SO_REUSEADDR setting 142 * @skc_reuse: %SO_REUSEADDR setting
@@ -149,16 +154,29 @@ struct net;
149 * for struct sock and struct inet_timewait_sock. 154 * for struct sock and struct inet_timewait_sock.
150 */ 155 */
151struct sock_common { 156struct sock_common {
152 /* skc_daddr and skc_rcv_saddr must be grouped : 157 /* skc_daddr and skc_rcv_saddr must be grouped on a 8 bytes aligned
153 * cf INET_MATCH() and INET_TW_MATCH() 158 * address on 64bit arches : cf INET_MATCH() and INET_TW_MATCH()
154 */ 159 */
155 __be32 skc_daddr; 160 union {
156 __be32 skc_rcv_saddr; 161 __addrpair skc_addrpair;
157 162 struct {
163 __be32 skc_daddr;
164 __be32 skc_rcv_saddr;
165 };
166 };
158 union { 167 union {
159 unsigned int skc_hash; 168 unsigned int skc_hash;
160 __u16 skc_u16hashes[2]; 169 __u16 skc_u16hashes[2];
161 }; 170 };
171 /* skc_dport && skc_num must be grouped as well */
172 union {
173 __portpair skc_portpair;
174 struct {
175 __be16 skc_dport;
176 __u16 skc_num;
177 };
178 };
179
162 unsigned short skc_family; 180 unsigned short skc_family;
163 volatile unsigned char skc_state; 181 volatile unsigned char skc_state;
164 unsigned char skc_reuse; 182 unsigned char skc_reuse;
@@ -213,7 +231,7 @@ struct cg_proto;
213 * @sk_sndbuf: size of send buffer in bytes 231 * @sk_sndbuf: size of send buffer in bytes
214 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE, 232 * @sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE,
215 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings 233 * %SO_OOBINLINE settings, %SO_TIMESTAMPING settings
216 * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets 234 * @sk_no_check: %SO_NO_CHECK setting, whether or not checkup packets
217 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) 235 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO)
218 * @sk_route_nocaps: forbidden route capabilities (e.g NETIF_F_GSO_MASK) 236 * @sk_route_nocaps: forbidden route capabilities (e.g NETIF_F_GSO_MASK)
219 * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) 237 * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 6feeccd83dd7..aed42c785153 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -369,7 +369,6 @@ extern void tcp_shutdown (struct sock *sk, int how);
369extern void tcp_v4_early_demux(struct sk_buff *skb); 369extern void tcp_v4_early_demux(struct sk_buff *skb);
370extern int tcp_v4_rcv(struct sk_buff *skb); 370extern int tcp_v4_rcv(struct sk_buff *skb);
371 371
372extern struct inet_peer *tcp_v4_get_peer(struct sock *sk);
373extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); 372extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw);
374extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 373extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
375 size_t size); 374 size_t size);
@@ -525,6 +524,7 @@ static inline __u32 cookie_v6_init_sequence(struct sock *sk,
525extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, 524extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
526 int nonagle); 525 int nonagle);
527extern bool tcp_may_send_now(struct sock *sk); 526extern bool tcp_may_send_now(struct sock *sk);
527extern int __tcp_retransmit_skb(struct sock *, struct sk_buff *);
528extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); 528extern int tcp_retransmit_skb(struct sock *, struct sk_buff *);
529extern void tcp_retransmit_timer(struct sock *sk); 529extern void tcp_retransmit_timer(struct sock *sk);
530extern void tcp_xmit_retransmit_queue(struct sock *); 530extern void tcp_xmit_retransmit_queue(struct sock *);
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 6f0ba01afe73..63445ede48bb 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1351,7 +1351,7 @@ struct xfrm6_tunnel {
1351}; 1351};
1352 1352
1353extern void xfrm_init(void); 1353extern void xfrm_init(void);
1354extern void xfrm4_init(int rt_hash_size); 1354extern void xfrm4_init(void);
1355extern int xfrm_state_init(struct net *net); 1355extern int xfrm_state_init(struct net *net);
1356extern void xfrm_state_fini(struct net *net); 1356extern void xfrm_state_fini(struct net *net);
1357extern void xfrm4_state_init(void); 1357extern void xfrm4_state_init(void);
diff --git a/include/rdma/Kbuild b/include/rdma/Kbuild
index ea56f76c0c22..e69de29bb2d1 100644
--- a/include/rdma/Kbuild
+++ b/include/rdma/Kbuild
@@ -1,6 +0,0 @@
1header-y += ib_user_cm.h
2header-y += ib_user_mad.h
3header-y += ib_user_sa.h
4header-y += ib_user_verbs.h
5header-y += rdma_netlink.h
6header-y += rdma_user_cm.h
diff --git a/include/rdma/rdma_netlink.h b/include/rdma/rdma_netlink.h
index bd3d8b24b420..e38de79eeb48 100644
--- a/include/rdma/rdma_netlink.h
+++ b/include/rdma/rdma_netlink.h
@@ -1,41 +1,9 @@
1#ifndef _RDMA_NETLINK_H 1#ifndef _RDMA_NETLINK_H
2#define _RDMA_NETLINK_H 2#define _RDMA_NETLINK_H
3 3
4#include <linux/types.h>
5
6enum {
7 RDMA_NL_RDMA_CM = 1
8};
9
10#define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10)
11#define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1))
12#define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op)
13
14enum {
15 RDMA_NL_RDMA_CM_ID_STATS = 0,
16 RDMA_NL_RDMA_CM_NUM_OPS
17};
18
19enum {
20 RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1,
21 RDMA_NL_RDMA_CM_ATTR_DST_ADDR,
22 RDMA_NL_RDMA_CM_NUM_ATTR,
23};
24
25struct rdma_cm_id_stats {
26 __u32 qp_num;
27 __u32 bound_dev_if;
28 __u32 port_space;
29 __s32 pid;
30 __u8 cm_state;
31 __u8 node_type;
32 __u8 port_num;
33 __u8 qp_type;
34};
35
36#ifdef __KERNEL__
37 4
38#include <linux/netlink.h> 5#include <linux/netlink.h>
6#include <uapi/rdma/rdma_netlink.h>
39 7
40struct ibnl_client_cbs { 8struct ibnl_client_cbs {
41 int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb); 9 int (*dump)(struct sk_buff *skb, struct netlink_callback *nlcb);
@@ -88,6 +56,4 @@ void *ibnl_put_msg(struct sk_buff *skb, struct nlmsghdr **nlh, int seq,
88int ibnl_put_attr(struct sk_buff *skb, struct nlmsghdr *nlh, 56int ibnl_put_attr(struct sk_buff *skb, struct nlmsghdr *nlh,
89 int len, void *data, int type); 57 int len, void *data, int type);
90 58
91#endif /* __KERNEL__ */
92
93#endif /* _RDMA_NETLINK_H */ 59#endif /* _RDMA_NETLINK_H */
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 88fae8d20154..e65c62e82c5a 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -135,6 +135,9 @@ struct scsi_device {
135 * because we did a bus reset. */ 135 * because we did a bus reset. */
136 unsigned use_10_for_rw:1; /* first try 10-byte read / write */ 136 unsigned use_10_for_rw:1; /* first try 10-byte read / write */
137 unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */ 137 unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */
138 unsigned no_report_opcodes:1; /* no REPORT SUPPORTED OPERATION CODES */
139 unsigned no_write_same:1; /* no WRITE SAME command */
140 unsigned use_16_for_rw:1; /* Use read/write(16) over read/write(10) */
138 unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */ 141 unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */
139 unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */ 142 unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */
140 unsigned skip_vpd_pages:1; /* do not read VPD pages */ 143 unsigned skip_vpd_pages:1; /* do not read VPD pages */
@@ -362,6 +365,8 @@ extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout,
362 int retries, struct scsi_sense_hdr *sshdr); 365 int retries, struct scsi_sense_hdr *sshdr);
363extern int scsi_get_vpd_page(struct scsi_device *, u8 page, unsigned char *buf, 366extern int scsi_get_vpd_page(struct scsi_device *, u8 page, unsigned char *buf,
364 int buf_len); 367 int buf_len);
368extern int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer,
369 unsigned int len, unsigned char opcode);
365extern int scsi_device_set_state(struct scsi_device *sdev, 370extern int scsi_device_set_state(struct scsi_device *sdev,
366 enum scsi_device_state state); 371 enum scsi_device_state state);
367extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type, 372extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type,
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 98b3a20a0102..9b8e08879cfc 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -36,6 +36,7 @@ enum sas_linkrate {
36 SAS_LINK_RATE_3_0_GBPS = 9, 36 SAS_LINK_RATE_3_0_GBPS = 9,
37 SAS_LINK_RATE_G2 = SAS_LINK_RATE_3_0_GBPS, 37 SAS_LINK_RATE_G2 = SAS_LINK_RATE_3_0_GBPS,
38 SAS_LINK_RATE_6_0_GBPS = 10, 38 SAS_LINK_RATE_6_0_GBPS = 10,
39 SAS_LINK_RATE_12_0_GBPS = 11,
39 /* These are virtual to the transport class and may never 40 /* These are virtual to the transport class and may never
40 * be signalled normally since the standard defined field 41 * be signalled normally since the standard defined field
41 * is only 4 bits */ 42 * is only 4 bits */
diff --git a/include/scsi/scsi_transport_srp.h b/include/scsi/scsi_transport_srp.h
index 9c60ca1c08c5..ff0f04ac91aa 100644
--- a/include/scsi/scsi_transport_srp.h
+++ b/include/scsi/scsi_transport_srp.h
@@ -14,13 +14,21 @@ struct srp_rport_identifiers {
14}; 14};
15 15
16struct srp_rport { 16struct srp_rport {
17 /* for initiator and target drivers */
18
17 struct device dev; 19 struct device dev;
18 20
19 u8 port_id[16]; 21 u8 port_id[16];
20 u8 roles; 22 u8 roles;
23
24 /* for initiator drivers */
25
26 void *lld_data; /* LLD private data */
21}; 27};
22 28
23struct srp_function_template { 29struct srp_function_template {
30 /* for initiator drivers */
31 void (*rport_delete)(struct srp_rport *rport);
24 /* for target drivers */ 32 /* for target drivers */
25 int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int); 33 int (* tsk_mgmt_response)(struct Scsi_Host *, u64, u64, int);
26 int (* it_nexus_response)(struct Scsi_Host *, u64, int); 34 int (* it_nexus_response)(struct Scsi_Host *, u64, int);
diff --git a/include/sound/Kbuild b/include/sound/Kbuild
index 6df30ed1581c..e69de29bb2d1 100644
--- a/include/sound/Kbuild
+++ b/include/sound/Kbuild
@@ -1,10 +0,0 @@
1header-y += asequencer.h
2header-y += asound.h
3header-y += asound_fm.h
4header-y += emu10k1.h
5header-y += hdsp.h
6header-y += hdspm.h
7header-y += sb16_csp.h
8header-y += sfnt_info.h
9header-y += compress_params.h
10header-y += compress_offload.h
diff --git a/include/sound/asequencer.h b/include/sound/asequencer.h
index 1505e6d5ef82..75935ce739c5 100644
--- a/include/sound/asequencer.h
+++ b/include/sound/asequencer.h
@@ -22,294 +22,9 @@
22#ifndef __SOUND_ASEQUENCER_H 22#ifndef __SOUND_ASEQUENCER_H
23#define __SOUND_ASEQUENCER_H 23#define __SOUND_ASEQUENCER_H
24 24
25#ifdef __KERNEL__
26#include <linux/ioctl.h> 25#include <linux/ioctl.h>
27#include <sound/asound.h> 26#include <sound/asound.h>
28#endif 27#include <uapi/sound/asequencer.h>
29
30/** version of the sequencer */
31#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
32
33/**
34 * definition of sequencer event types
35 */
36
37/** system messages
38 * event data type = #snd_seq_result
39 */
40#define SNDRV_SEQ_EVENT_SYSTEM 0
41#define SNDRV_SEQ_EVENT_RESULT 1
42
43/** note messages (channel specific)
44 * event data type = #snd_seq_ev_note
45 */
46#define SNDRV_SEQ_EVENT_NOTE 5
47#define SNDRV_SEQ_EVENT_NOTEON 6
48#define SNDRV_SEQ_EVENT_NOTEOFF 7
49#define SNDRV_SEQ_EVENT_KEYPRESS 8
50
51/** control messages (channel specific)
52 * event data type = #snd_seq_ev_ctrl
53 */
54#define SNDRV_SEQ_EVENT_CONTROLLER 10
55#define SNDRV_SEQ_EVENT_PGMCHANGE 11
56#define SNDRV_SEQ_EVENT_CHANPRESS 12
57#define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */
58#define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */
59#define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */
60#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
61
62/** synchronisation messages
63 * event data type = #snd_seq_ev_ctrl
64 */
65#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
66#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
67#define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */
68#define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */
69#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
70
71/** timer messages
72 * event data type = snd_seq_ev_queue_control
73 */
74#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
75#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
76#define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */
77#define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */
78#define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */
79#define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */
80#define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */
81#define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */
82#define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
83
84/** others
85 * event data type = none
86 */
87#define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */
88#define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */
89#define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
90
91/** echo back, kernel private messages
92 * event data type = any type
93 */
94#define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */
95#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
96
97/** system status messages (broadcast for subscribers)
98 * event data type = snd_seq_addr
99 */
100#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
101#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
102#define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */
103#define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */
104#define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */
105#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
106
107/** port connection changes
108 * event data type = snd_seq_connect
109 */
110#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
111#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
112
113/* 70-89: synthesizer events - obsoleted */
114
115/** user-defined events with fixed length
116 * event data type = any
117 */
118#define SNDRV_SEQ_EVENT_USR0 90
119#define SNDRV_SEQ_EVENT_USR1 91
120#define SNDRV_SEQ_EVENT_USR2 92
121#define SNDRV_SEQ_EVENT_USR3 93
122#define SNDRV_SEQ_EVENT_USR4 94
123#define SNDRV_SEQ_EVENT_USR5 95
124#define SNDRV_SEQ_EVENT_USR6 96
125#define SNDRV_SEQ_EVENT_USR7 97
126#define SNDRV_SEQ_EVENT_USR8 98
127#define SNDRV_SEQ_EVENT_USR9 99
128
129/* 100-118: instrument layer - obsoleted */
130/* 119-129: reserved */
131
132/* 130-139: variable length events
133 * event data type = snd_seq_ev_ext
134 * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
135 */
136#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
137#define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */
138/* 132-134: reserved */
139#define SNDRV_SEQ_EVENT_USR_VAR0 135
140#define SNDRV_SEQ_EVENT_USR_VAR1 136
141#define SNDRV_SEQ_EVENT_USR_VAR2 137
142#define SNDRV_SEQ_EVENT_USR_VAR3 138
143#define SNDRV_SEQ_EVENT_USR_VAR4 139
144
145/* 150-151: kernel events with quote - DO NOT use in user clients */
146#define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
147#define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
148
149/* 152-191: reserved */
150
151/* 192-254: hardware specific events */
152
153/* 255: special event */
154#define SNDRV_SEQ_EVENT_NONE 255
155
156
157typedef unsigned char snd_seq_event_type_t;
158
159/** event address */
160struct snd_seq_addr {
161 unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
162 unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
163};
164
165/** port connection */
166struct snd_seq_connect {
167 struct snd_seq_addr sender;
168 struct snd_seq_addr dest;
169};
170
171
172#define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */
173#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */
174#define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */
175#define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */
176
177 /* event mode flag - NOTE: only 8 bits available! */
178#define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */
179#define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */
180#define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
181
182#define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */
183#define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */
184#define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
185
186#define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */
187#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */
188#define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */
189#define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
190
191#define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */
192#define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
193#define SNDRV_SEQ_PRIORITY_MASK (1<<4)
194
195
196 /* note event */
197struct snd_seq_ev_note {
198 unsigned char channel;
199 unsigned char note;
200 unsigned char velocity;
201 unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */
202 unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */
203};
204
205 /* controller event */
206struct snd_seq_ev_ctrl {
207 unsigned char channel;
208 unsigned char unused1, unused2, unused3; /* pad */
209 unsigned int param;
210 signed int value;
211};
212
213 /* generic set of bytes (12x8 bit) */
214struct snd_seq_ev_raw8 {
215 unsigned char d[12]; /* 8 bit value */
216};
217
218 /* generic set of integers (3x32 bit) */
219struct snd_seq_ev_raw32 {
220 unsigned int d[3]; /* 32 bit value */
221};
222
223 /* external stored data */
224struct snd_seq_ev_ext {
225 unsigned int len; /* length of data */
226 void *ptr; /* pointer to data (note: maybe 64-bit) */
227} __attribute__((packed));
228
229struct snd_seq_result {
230 int event; /* processed event type */
231 int result;
232};
233
234
235struct snd_seq_real_time {
236 unsigned int tv_sec; /* seconds */
237 unsigned int tv_nsec; /* nanoseconds */
238};
239
240typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
241
242union snd_seq_timestamp {
243 snd_seq_tick_time_t tick;
244 struct snd_seq_real_time time;
245};
246
247struct snd_seq_queue_skew {
248 unsigned int value;
249 unsigned int base;
250};
251
252 /* queue timer control */
253struct snd_seq_ev_queue_control {
254 unsigned char queue; /* affected queue */
255 unsigned char pad[3]; /* reserved */
256 union {
257 signed int value; /* affected value (e.g. tempo) */
258 union snd_seq_timestamp time; /* time */
259 unsigned int position; /* sync position */
260 struct snd_seq_queue_skew skew;
261 unsigned int d32[2];
262 unsigned char d8[8];
263 } param;
264};
265
266 /* quoted event - inside the kernel only */
267struct snd_seq_ev_quote {
268 struct snd_seq_addr origin; /* original sender */
269 unsigned short value; /* optional data */
270 struct snd_seq_event *event; /* quoted event */
271} __attribute__((packed));
272
273
274 /* sequencer event */
275struct snd_seq_event {
276 snd_seq_event_type_t type; /* event type */
277 unsigned char flags; /* event flags */
278 char tag;
279
280 unsigned char queue; /* schedule queue */
281 union snd_seq_timestamp time; /* schedule time */
282
283
284 struct snd_seq_addr source; /* source address */
285 struct snd_seq_addr dest; /* destination address */
286
287 union { /* event data... */
288 struct snd_seq_ev_note note;
289 struct snd_seq_ev_ctrl control;
290 struct snd_seq_ev_raw8 raw8;
291 struct snd_seq_ev_raw32 raw32;
292 struct snd_seq_ev_ext ext;
293 struct snd_seq_ev_queue_control queue;
294 union snd_seq_timestamp time;
295 struct snd_seq_addr addr;
296 struct snd_seq_connect connect;
297 struct snd_seq_result result;
298 struct snd_seq_ev_quote quote;
299 } data;
300};
301
302
303/*
304 * bounce event - stored as variable size data
305 */
306struct snd_seq_event_bounce {
307 int err;
308 struct snd_seq_event event;
309 /* external data follows here. */
310};
311
312#ifdef __KERNEL__
313 28
314/* helper macro */ 29/* helper macro */
315#define snd_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(struct snd_seq_event_bounce))) 30#define snd_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(struct snd_seq_event_bounce)))
@@ -368,311 +83,4 @@ struct snd_seq_event_bounce {
368/* queue sync port */ 83/* queue sync port */
369#define snd_seq_queue_sync_port(q) ((q) + 16) 84#define snd_seq_queue_sync_port(q) ((q) + 16)
370 85
371#endif /* __KERNEL__ */
372
373 /* system information */
374struct snd_seq_system_info {
375 int queues; /* maximum queues count */
376 int clients; /* maximum clients count */
377 int ports; /* maximum ports per client */
378 int channels; /* maximum channels per port */
379 int cur_clients; /* current clients */
380 int cur_queues; /* current queues */
381 char reserved[24];
382};
383
384
385 /* system running information */
386struct snd_seq_running_info {
387 unsigned char client; /* client id */
388 unsigned char big_endian; /* 1 = big-endian */
389 unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
390 unsigned char pad; /* reserved */
391 unsigned char reserved[12];
392};
393
394
395 /* known client numbers */
396#define SNDRV_SEQ_CLIENT_SYSTEM 0
397 /* internal client numbers */
398#define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
399#define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
400
401
402 /* client types */
403typedef int __bitwise snd_seq_client_type_t;
404#define NO_CLIENT ((__force snd_seq_client_type_t) 0)
405#define USER_CLIENT ((__force snd_seq_client_type_t) 1)
406#define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2)
407
408 /* event filter flags */
409#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
410#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */
411#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
412#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
413
414struct snd_seq_client_info {
415 int client; /* client number to inquire */
416 snd_seq_client_type_t type; /* client type */
417 char name[64]; /* client name */
418 unsigned int filter; /* filter flags */
419 unsigned char multicast_filter[8]; /* multicast filter bitmap */
420 unsigned char event_filter[32]; /* event filter bitmap */
421 int num_ports; /* RO: number of ports */
422 int event_lost; /* number of lost events */
423 char reserved[64]; /* for future use */
424};
425
426
427/* client pool size */
428struct snd_seq_client_pool {
429 int client; /* client number to inquire */
430 int output_pool; /* outgoing (write) pool size */
431 int input_pool; /* incoming (read) pool size */
432 int output_room; /* minimum free pool size for select/blocking mode */
433 int output_free; /* unused size */
434 int input_free; /* unused size */
435 char reserved[64];
436};
437
438
439/* Remove events by specified criteria */
440
441#define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */
442#define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */
443#define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */
444#define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */
445#define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */
446#define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */
447#define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */
448#define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */
449#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
450#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
451
452struct snd_seq_remove_events {
453 unsigned int remove_mode; /* Flags that determine what gets removed */
454
455 union snd_seq_timestamp time;
456
457 unsigned char queue; /* Queue for REMOVE_DEST */
458 struct snd_seq_addr dest; /* Address for REMOVE_DEST */
459 unsigned char channel; /* Channel for REMOVE_DEST */
460
461 int type; /* For REMOVE_EVENT_TYPE */
462 char tag; /* Tag for REMOVE_TAG */
463
464 int reserved[10]; /* To allow for future binary compatibility */
465
466};
467
468
469 /* known port numbers */
470#define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
471#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
472
473 /* port capabilities (32 bits) */
474#define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */
475#define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
476
477#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
478#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
479
480#define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
481
482#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
483#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
484#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
485
486 /* port type */
487#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
488#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
489#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */
490#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */
491#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
492#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
493#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
494
495/* other standards...*/
496#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
497#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
498#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
499/*...*/
500#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
501#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
502#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
503#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
504#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
505
506/* misc. conditioning flags */
507#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
508#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
509#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
510
511struct snd_seq_port_info {
512 struct snd_seq_addr addr; /* client/port numbers */
513 char name[64]; /* port name */
514
515 unsigned int capability; /* port capability bits */
516 unsigned int type; /* port type bits */
517 int midi_channels; /* channels per MIDI port */
518 int midi_voices; /* voices per MIDI port */
519 int synth_voices; /* voices per SYNTH port */
520
521 int read_use; /* R/O: subscribers for output (from this port) */
522 int write_use; /* R/O: subscribers for input (to this port) */
523
524 void *kernel; /* reserved for kernel use (must be NULL) */
525 unsigned int flags; /* misc. conditioning */
526 unsigned char time_queue; /* queue # for timestamping */
527 char reserved[59]; /* for future use */
528};
529
530
531/* queue flags */
532#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
533
534/* queue information */
535struct snd_seq_queue_info {
536 int queue; /* queue id */
537
538 /*
539 * security settings, only owner of this queue can start/stop timer
540 * etc. if the queue is locked for other clients
541 */
542 int owner; /* client id for owner of the queue */
543 unsigned locked:1; /* timing queue locked for other queues */
544 char name[64]; /* name of this queue */
545 unsigned int flags; /* flags */
546 char reserved[60]; /* for future use */
547
548};
549
550/* queue info/status */
551struct snd_seq_queue_status {
552 int queue; /* queue id */
553 int events; /* read-only - queue size */
554 snd_seq_tick_time_t tick; /* current tick */
555 struct snd_seq_real_time time; /* current time */
556 int running; /* running state of queue */
557 int flags; /* various flags */
558 char reserved[64]; /* for the future */
559};
560
561
562/* queue tempo */
563struct snd_seq_queue_tempo {
564 int queue; /* sequencer queue */
565 unsigned int tempo; /* current tempo, us/tick */
566 int ppq; /* time resolution, ticks/quarter */
567 unsigned int skew_value; /* queue skew */
568 unsigned int skew_base; /* queue skew base */
569 char reserved[24]; /* for the future */
570};
571
572
573/* sequencer timer sources */
574#define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */
575#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */
576#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
577
578/* queue timer info */
579struct snd_seq_queue_timer {
580 int queue; /* sequencer queue */
581 int type; /* source timer type */
582 union {
583 struct {
584 struct snd_timer_id id; /* ALSA's timer ID */
585 unsigned int resolution; /* resolution in Hz */
586 } alsa;
587 } u;
588 char reserved[64]; /* for the future use */
589};
590
591
592struct snd_seq_queue_client {
593 int queue; /* sequencer queue */
594 int client; /* sequencer client */
595 int used; /* queue is used with this client
596 (must be set for accepting events) */
597 /* per client watermarks */
598 char reserved[64]; /* for future use */
599};
600
601
602#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */
603#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
604#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
605
606struct snd_seq_port_subscribe {
607 struct snd_seq_addr sender; /* sender address */
608 struct snd_seq_addr dest; /* destination address */
609 unsigned int voices; /* number of voices to be allocated (0 = don't care) */
610 unsigned int flags; /* modes */
611 unsigned char queue; /* input time-stamp queue (optional) */
612 unsigned char pad[3]; /* reserved */
613 char reserved[64];
614};
615
616/* type of query subscription */
617#define SNDRV_SEQ_QUERY_SUBS_READ 0
618#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
619
620struct snd_seq_query_subs {
621 struct snd_seq_addr root; /* client/port id to be searched */
622 int type; /* READ or WRITE */
623 int index; /* 0..N-1 */
624 int num_subs; /* R/O: number of subscriptions on this port */
625 struct snd_seq_addr addr; /* R/O: result */
626 unsigned char queue; /* R/O: result */
627 unsigned int flags; /* R/O: result */
628 char reserved[64]; /* for future use */
629};
630
631
632/*
633 * IOCTL commands
634 */
635
636#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
637#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
638#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
639#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
640
641#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
642#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
643
644#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
645#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
646#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
647#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
648
649#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
650#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
651
652#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
653#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
654#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
655#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
656#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
657#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
658#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
659#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
660#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
661#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
662#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
663#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
664/* XXX
665#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync)
666#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync)
667*/
668#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
669#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
670#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
671#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
672#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
673#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
674#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
675#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
676#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
677
678#endif /* __SOUND_ASEQUENCER_H */ 86#endif /* __SOUND_ASEQUENCER_H */
diff --git a/include/sound/asound.h b/include/sound/asound.h
index dfe7d441748c..c2dff5369d33 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -19,13 +19,9 @@
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * 20 *
21 */ 21 */
22
23#ifndef __SOUND_ASOUND_H 22#ifndef __SOUND_ASOUND_H
24#define __SOUND_ASOUND_H 23#define __SOUND_ASOUND_H
25 24
26#include <linux/types.h>
27
28#ifdef __KERNEL__
29#include <linux/ioctl.h> 25#include <linux/ioctl.h>
30#include <linux/time.h> 26#include <linux/time.h>
31#include <asm/byteorder.h> 27#include <asm/byteorder.h>
@@ -40,934 +36,5 @@
40#endif 36#endif
41#endif 37#endif
42 38
43#endif /* __KERNEL__ **/ 39#include <uapi/sound/asound.h>
44
45/*
46 * protocol version
47 */
48
49#define SNDRV_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor))
50#define SNDRV_PROTOCOL_MAJOR(version) (((version)>>16)&0xffff)
51#define SNDRV_PROTOCOL_MINOR(version) (((version)>>8)&0xff)
52#define SNDRV_PROTOCOL_MICRO(version) ((version)&0xff)
53#define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion) \
54 (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || \
55 (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && \
56 SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))
57
58/****************************************************************************
59 * *
60 * Digital audio interface *
61 * *
62 ****************************************************************************/
63
64struct snd_aes_iec958 {
65 unsigned char status[24]; /* AES/IEC958 channel status bits */
66 unsigned char subcode[147]; /* AES/IEC958 subcode bits */
67 unsigned char pad; /* nothing */
68 unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */
69};
70
71/****************************************************************************
72 * *
73 * CEA-861 Audio InfoFrame. Used in HDMI and DisplayPort *
74 * *
75 ****************************************************************************/
76
77struct snd_cea_861_aud_if {
78 unsigned char db1_ct_cc; /* coding type and channel count */
79 unsigned char db2_sf_ss; /* sample frequency and size */
80 unsigned char db3; /* not used, all zeros */
81 unsigned char db4_ca; /* channel allocation code */
82 unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */
83};
84
85/****************************************************************************
86 * *
87 * Section for driver hardware dependent interface - /dev/snd/hw? *
88 * *
89 ****************************************************************************/
90
91#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
92
93enum {
94 SNDRV_HWDEP_IFACE_OPL2 = 0,
95 SNDRV_HWDEP_IFACE_OPL3,
96 SNDRV_HWDEP_IFACE_OPL4,
97 SNDRV_HWDEP_IFACE_SB16CSP, /* Creative Signal Processor */
98 SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */
99 SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */
100 SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */
101 SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */
102 SNDRV_HWDEP_IFACE_VX, /* Digigram VX cards */
103 SNDRV_HWDEP_IFACE_MIXART, /* Digigram miXart cards */
104 SNDRV_HWDEP_IFACE_USX2Y, /* Tascam US122, US224 & US428 usb */
105 SNDRV_HWDEP_IFACE_EMUX_WAVETABLE, /* EmuX wavetable */
106 SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */
107 SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */
108 SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */
109 SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
110 SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
111 SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
112
113 /* Don't forget to change the following: */
114 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
115};
116
117struct snd_hwdep_info {
118 unsigned int device; /* WR: device number */
119 int card; /* R: card number */
120 unsigned char id[64]; /* ID (user selectable) */
121 unsigned char name[80]; /* hwdep name */
122 int iface; /* hwdep interface */
123 unsigned char reserved[64]; /* reserved for future */
124};
125
126/* generic DSP loader */
127struct snd_hwdep_dsp_status {
128 unsigned int version; /* R: driver-specific version */
129 unsigned char id[32]; /* R: driver-specific ID string */
130 unsigned int num_dsps; /* R: number of DSP images to transfer */
131 unsigned int dsp_loaded; /* R: bit flags indicating the loaded DSPs */
132 unsigned int chip_ready; /* R: 1 = initialization finished */
133 unsigned char reserved[16]; /* reserved for future use */
134};
135
136struct snd_hwdep_dsp_image {
137 unsigned int index; /* W: DSP index */
138 unsigned char name[64]; /* W: ID (e.g. file name) */
139 unsigned char __user *image; /* W: binary image */
140 size_t length; /* W: size of image in bytes */
141 unsigned long driver_data; /* W: driver-specific data */
142};
143
144#define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int)
145#define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info)
146#define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
147#define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
148
149/*****************************************************************************
150 * *
151 * Digital Audio (PCM) interface - /dev/snd/pcm?? *
152 * *
153 *****************************************************************************/
154
155#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 10)
156
157typedef unsigned long snd_pcm_uframes_t;
158typedef signed long snd_pcm_sframes_t;
159
160enum {
161 SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */
162 SNDRV_PCM_CLASS_MULTI, /* multichannel device */
163 SNDRV_PCM_CLASS_MODEM, /* software modem class */
164 SNDRV_PCM_CLASS_DIGITIZER, /* digitizer class */
165 /* Don't forget to change the following: */
166 SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
167};
168
169enum {
170 SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */
171 SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */
172 /* Don't forget to change the following: */
173 SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
174};
175
176enum {
177 SNDRV_PCM_STREAM_PLAYBACK = 0,
178 SNDRV_PCM_STREAM_CAPTURE,
179 SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
180};
181
182typedef int __bitwise snd_pcm_access_t;
183#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0) /* interleaved mmap */
184#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1) /* noninterleaved mmap */
185#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2) /* complex mmap */
186#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3) /* readi/writei */
187#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4) /* readn/writen */
188#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
189
190typedef int __bitwise snd_pcm_format_t;
191#define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0)
192#define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1)
193#define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2)
194#define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3)
195#define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4)
196#define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5)
197#define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6) /* low three bytes */
198#define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */
199#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */
200#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */
201#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
202#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
203#define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
204#define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13)
205#define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
206#define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
207#define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
208#define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
209#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */
210#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */
211#define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20)
212#define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21)
213#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
214#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
215#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
216#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
217#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */
218#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */
219#define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34) /* in three bytes */
220#define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35) /* in three bytes */
221#define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36) /* in three bytes */
222#define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37) /* in three bytes */
223#define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38) /* in three bytes */
224#define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39) /* in three bytes */
225#define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40) /* in three bytes */
226#define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */
227#define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */
228#define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */
229#define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44) /* 8 samples in 3 bytes */
230#define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */
231#define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */
232#define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */
233#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_G723_40_1B
234
235#ifdef SNDRV_LITTLE_ENDIAN
236#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
237#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
238#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
239#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
240#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
241#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
242#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
243#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
244#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
245#endif
246#ifdef SNDRV_BIG_ENDIAN
247#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
248#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
249#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
250#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
251#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
252#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
253#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
254#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
255#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
256#endif
257
258typedef int __bitwise snd_pcm_subformat_t;
259#define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0)
260#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
261
262#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */
263#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */
264#define SNDRV_PCM_INFO_DOUBLE 0x00000004 /* Double buffering needed for PCM start/stop */
265#define SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */
266#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */
267#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */
268#define SNDRV_PCM_INFO_COMPLEX 0x00000400 /* complex frame organization (mmap only) */
269#define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000 /* hardware transfer block of samples */
270#define SNDRV_PCM_INFO_OVERRANGE 0x00020000 /* hardware supports ADC (capture) overrange detection */
271#define SNDRV_PCM_INFO_RESUME 0x00040000 /* hardware supports stream resume after suspend */
272#define SNDRV_PCM_INFO_PAUSE 0x00080000 /* pause ioctl is supported */
273#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
274#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
275#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
276#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */
277#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
278
279typedef int __bitwise snd_pcm_state_t;
280#define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */
281#define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */
282#define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2) /* stream is ready to start */
283#define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3) /* stream is running */
284#define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4) /* stream reached an xrun */
285#define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5) /* stream is draining */
286#define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6) /* stream is paused */
287#define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7) /* hardware is suspended */
288#define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8) /* hardware is disconnected */
289#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
290
291enum {
292 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
293 SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
294 SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
295};
296
297union snd_pcm_sync_id {
298 unsigned char id[16];
299 unsigned short id16[8];
300 unsigned int id32[4];
301};
302
303struct snd_pcm_info {
304 unsigned int device; /* RO/WR (control): device number */
305 unsigned int subdevice; /* RO/WR (control): subdevice number */
306 int stream; /* RO/WR (control): stream direction */
307 int card; /* R: card number */
308 unsigned char id[64]; /* ID (user selectable) */
309 unsigned char name[80]; /* name of this device */
310 unsigned char subname[32]; /* subdevice name */
311 int dev_class; /* SNDRV_PCM_CLASS_* */
312 int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */
313 unsigned int subdevices_count;
314 unsigned int subdevices_avail;
315 union snd_pcm_sync_id sync; /* hardware synchronization ID */
316 unsigned char reserved[64]; /* reserved for future... */
317};
318
319typedef int snd_pcm_hw_param_t;
320#define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */
321#define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */
322#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */
323#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
324#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
325
326#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */
327#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */
328#define SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */
329#define SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */
330#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between
331 * interrupts in us
332 */
333#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between
334 * interrupts
335 */
336#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between
337 * interrupts
338 */
339#define SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per
340 * buffer
341 */
342#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer
343 * in us
344 */
345#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */
346#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */
347#define SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */
348#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
349#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
350
351#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
352#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
353#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
354
355struct snd_interval {
356 unsigned int min, max;
357 unsigned int openmin:1,
358 openmax:1,
359 integer:1,
360 empty:1;
361};
362
363#define SNDRV_MASK_MAX 256
364
365struct snd_mask {
366 __u32 bits[(SNDRV_MASK_MAX+31)/32];
367};
368
369struct snd_pcm_hw_params {
370 unsigned int flags;
371 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
372 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
373 struct snd_mask mres[5]; /* reserved masks */
374 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
375 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
376 struct snd_interval ires[9]; /* reserved intervals */
377 unsigned int rmask; /* W: requested masks */
378 unsigned int cmask; /* R: changed masks */
379 unsigned int info; /* R: Info flags for returned setup */
380 unsigned int msbits; /* R: used most significant bits */
381 unsigned int rate_num; /* R: rate numerator */
382 unsigned int rate_den; /* R: rate denominator */
383 snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
384 unsigned char reserved[64]; /* reserved for future */
385};
386
387enum {
388 SNDRV_PCM_TSTAMP_NONE = 0,
389 SNDRV_PCM_TSTAMP_ENABLE,
390 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
391};
392
393struct snd_pcm_sw_params {
394 int tstamp_mode; /* timestamp mode */
395 unsigned int period_step;
396 unsigned int sleep_min; /* min ticks to sleep */
397 snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
398 snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */
399 snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */
400 snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */
401 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
402 snd_pcm_uframes_t silence_size; /* silence block size */
403 snd_pcm_uframes_t boundary; /* pointers wrap point */
404 unsigned char reserved[64]; /* reserved for future */
405};
406
407struct snd_pcm_channel_info {
408 unsigned int channel;
409 __kernel_off_t offset; /* mmap offset */
410 unsigned int first; /* offset to first sample in bits */
411 unsigned int step; /* samples distance in bits */
412};
413
414struct snd_pcm_status {
415 snd_pcm_state_t state; /* stream state */
416 struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
417 struct timespec tstamp; /* reference timestamp */
418 snd_pcm_uframes_t appl_ptr; /* appl ptr */
419 snd_pcm_uframes_t hw_ptr; /* hw ptr */
420 snd_pcm_sframes_t delay; /* current delay in frames */
421 snd_pcm_uframes_t avail; /* number of frames available */
422 snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */
423 snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */
424 snd_pcm_state_t suspended_state; /* suspended stream state */
425 unsigned char reserved[60]; /* must be filled with zero */
426};
427
428struct snd_pcm_mmap_status {
429 snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */
430 int pad1; /* Needed for 64 bit alignment */
431 snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */
432 struct timespec tstamp; /* Timestamp */
433 snd_pcm_state_t suspended_state; /* RO: suspended stream state */
434};
435
436struct snd_pcm_mmap_control {
437 snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */
438 snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
439};
440
441#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */
442#define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */
443#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */
444
445struct snd_pcm_sync_ptr {
446 unsigned int flags;
447 union {
448 struct snd_pcm_mmap_status status;
449 unsigned char reserved[64];
450 } s;
451 union {
452 struct snd_pcm_mmap_control control;
453 unsigned char reserved[64];
454 } c;
455};
456
457struct snd_xferi {
458 snd_pcm_sframes_t result;
459 void __user *buf;
460 snd_pcm_uframes_t frames;
461};
462
463struct snd_xfern {
464 snd_pcm_sframes_t result;
465 void __user * __user *bufs;
466 snd_pcm_uframes_t frames;
467};
468
469enum {
470 SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
471 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
472 SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
473};
474
475/* channel positions */
476enum {
477 SNDRV_CHMAP_UNKNOWN = 0,
478 SNDRV_CHMAP_NA, /* N/A, silent */
479 SNDRV_CHMAP_MONO, /* mono stream */
480 /* this follows the alsa-lib mixer channel value + 3 */
481 SNDRV_CHMAP_FL, /* front left */
482 SNDRV_CHMAP_FR, /* front right */
483 SNDRV_CHMAP_RL, /* rear left */
484 SNDRV_CHMAP_RR, /* rear right */
485 SNDRV_CHMAP_FC, /* front center */
486 SNDRV_CHMAP_LFE, /* LFE */
487 SNDRV_CHMAP_SL, /* side left */
488 SNDRV_CHMAP_SR, /* side right */
489 SNDRV_CHMAP_RC, /* rear center */
490 /* new definitions */
491 SNDRV_CHMAP_FLC, /* front left center */
492 SNDRV_CHMAP_FRC, /* front right center */
493 SNDRV_CHMAP_RLC, /* rear left center */
494 SNDRV_CHMAP_RRC, /* rear right center */
495 SNDRV_CHMAP_FLW, /* front left wide */
496 SNDRV_CHMAP_FRW, /* front right wide */
497 SNDRV_CHMAP_FLH, /* front left high */
498 SNDRV_CHMAP_FCH, /* front center high */
499 SNDRV_CHMAP_FRH, /* front right high */
500 SNDRV_CHMAP_TC, /* top center */
501 SNDRV_CHMAP_TFL, /* top front left */
502 SNDRV_CHMAP_TFR, /* top front right */
503 SNDRV_CHMAP_TFC, /* top front center */
504 SNDRV_CHMAP_TRL, /* top rear left */
505 SNDRV_CHMAP_TRR, /* top rear right */
506 SNDRV_CHMAP_TRC, /* top rear center */
507 SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC,
508};
509
510#define SNDRV_CHMAP_POSITION_MASK 0xffff
511#define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
512#define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
513
514#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
515#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
516#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
517#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
518#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
519#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
520#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
521#define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
522#define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
523#define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
524#define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
525#define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
526#define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
527#define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
528#define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
529#define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
530#define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
531#define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
532#define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
533#define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
534#define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
535#define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
536#define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
537#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
538#define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
539#define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
540#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
541#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
542#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
543
544/*****************************************************************************
545 * *
546 * MIDI v1.0 interface *
547 * *
548 *****************************************************************************/
549
550/*
551 * Raw MIDI section - /dev/snd/midi??
552 */
553
554#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
555
556enum {
557 SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
558 SNDRV_RAWMIDI_STREAM_INPUT,
559 SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
560};
561
562#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
563#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
564#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
565
566struct snd_rawmidi_info {
567 unsigned int device; /* RO/WR (control): device number */
568 unsigned int subdevice; /* RO/WR (control): subdevice number */
569 int stream; /* WR: stream */
570 int card; /* R: card number */
571 unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */
572 unsigned char id[64]; /* ID (user selectable) */
573 unsigned char name[80]; /* name of device */
574 unsigned char subname[32]; /* name of active or selected subdevice */
575 unsigned int subdevices_count;
576 unsigned int subdevices_avail;
577 unsigned char reserved[64]; /* reserved for future use */
578};
579
580struct snd_rawmidi_params {
581 int stream;
582 size_t buffer_size; /* queue size in bytes */
583 size_t avail_min; /* minimum avail bytes for wakeup */
584 unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */
585 unsigned char reserved[16]; /* reserved for future use */
586};
587
588struct snd_rawmidi_status {
589 int stream;
590 struct timespec tstamp; /* Timestamp */
591 size_t avail; /* available bytes */
592 size_t xruns; /* count of overruns since last status (in bytes) */
593 unsigned char reserved[16]; /* reserved for future use */
594};
595
596#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
597#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
598#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
599#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
600#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
601#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
602
603/*
604 * Timer section - /dev/snd/timer
605 */
606
607#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
608
609enum {
610 SNDRV_TIMER_CLASS_NONE = -1,
611 SNDRV_TIMER_CLASS_SLAVE = 0,
612 SNDRV_TIMER_CLASS_GLOBAL,
613 SNDRV_TIMER_CLASS_CARD,
614 SNDRV_TIMER_CLASS_PCM,
615 SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
616};
617
618/* slave timer classes */
619enum {
620 SNDRV_TIMER_SCLASS_NONE = 0,
621 SNDRV_TIMER_SCLASS_APPLICATION,
622 SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */
623 SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /* alias */
624 SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
625};
626
627/* global timers (device member) */
628#define SNDRV_TIMER_GLOBAL_SYSTEM 0
629#define SNDRV_TIMER_GLOBAL_RTC 1
630#define SNDRV_TIMER_GLOBAL_HPET 2
631#define SNDRV_TIMER_GLOBAL_HRTIMER 3
632
633/* info flags */
634#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
635
636struct snd_timer_id {
637 int dev_class;
638 int dev_sclass;
639 int card;
640 int device;
641 int subdevice;
642};
643
644struct snd_timer_ginfo {
645 struct snd_timer_id tid; /* requested timer ID */
646 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
647 int card; /* card number */
648 unsigned char id[64]; /* timer identification */
649 unsigned char name[80]; /* timer name */
650 unsigned long reserved0; /* reserved for future use */
651 unsigned long resolution; /* average period resolution in ns */
652 unsigned long resolution_min; /* minimal period resolution in ns */
653 unsigned long resolution_max; /* maximal period resolution in ns */
654 unsigned int clients; /* active timer clients */
655 unsigned char reserved[32];
656};
657
658struct snd_timer_gparams {
659 struct snd_timer_id tid; /* requested timer ID */
660 unsigned long period_num; /* requested precise period duration (in seconds) - numerator */
661 unsigned long period_den; /* requested precise period duration (in seconds) - denominator */
662 unsigned char reserved[32];
663};
664
665struct snd_timer_gstatus {
666 struct snd_timer_id tid; /* requested timer ID */
667 unsigned long resolution; /* current period resolution in ns */
668 unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */
669 unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */
670 unsigned char reserved[32];
671};
672
673struct snd_timer_select {
674 struct snd_timer_id id; /* bind to timer ID */
675 unsigned char reserved[32]; /* reserved */
676};
677
678struct snd_timer_info {
679 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
680 int card; /* card number */
681 unsigned char id[64]; /* timer identificator */
682 unsigned char name[80]; /* timer name */
683 unsigned long reserved0; /* reserved for future use */
684 unsigned long resolution; /* average period resolution in ns */
685 unsigned char reserved[64]; /* reserved */
686};
687
688#define SNDRV_TIMER_PSFLG_AUTO (1<<0) /* auto start, otherwise one-shot */
689#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */
690#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */
691
692struct snd_timer_params {
693 unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */
694 unsigned int ticks; /* requested resolution in ticks */
695 unsigned int queue_size; /* total size of queue (32-1024) */
696 unsigned int reserved0; /* reserved, was: failure locations */
697 unsigned int filter; /* event filter (bitmask of SNDRV_TIMER_EVENT_*) */
698 unsigned char reserved[60]; /* reserved */
699};
700
701struct snd_timer_status {
702 struct timespec tstamp; /* Timestamp - last update */
703 unsigned int resolution; /* current period resolution in ns */
704 unsigned int lost; /* counter of master tick lost */
705 unsigned int overrun; /* count of read queue overruns */
706 unsigned int queue; /* used queue size */
707 unsigned char reserved[64]; /* reserved */
708};
709
710#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
711#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
712#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
713#define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
714#define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
715#define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
716#define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
717#define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
718#define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
719#define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
720/* The following four ioctls are changed since 1.0.9 due to confliction */
721#define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
722#define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
723#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
724#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
725
726struct snd_timer_read {
727 unsigned int resolution;
728 unsigned int ticks;
729};
730
731enum {
732 SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */
733 SNDRV_TIMER_EVENT_TICK, /* val = ticks */
734 SNDRV_TIMER_EVENT_START, /* val = resolution in ns */
735 SNDRV_TIMER_EVENT_STOP, /* val = 0 */
736 SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */
737 SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */
738 SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */
739 SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */
740 SNDRV_TIMER_EVENT_RESUME, /* val = resolution in ns */
741 /* master timer events for slave timer instances */
742 SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
743 SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
744 SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
745 SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
746 SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
747 SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
748};
749
750struct snd_timer_tread {
751 int event;
752 struct timespec tstamp;
753 unsigned int val;
754};
755
756/****************************************************************************
757 * *
758 * Section for driver control interface - /dev/snd/control? *
759 * *
760 ****************************************************************************/
761
762#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
763
764struct snd_ctl_card_info {
765 int card; /* card number */
766 int pad; /* reserved for future (was type) */
767 unsigned char id[16]; /* ID of card (user selectable) */
768 unsigned char driver[16]; /* Driver name */
769 unsigned char name[32]; /* Short name of soundcard */
770 unsigned char longname[80]; /* name + info text about soundcard */
771 unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */
772 unsigned char mixername[80]; /* visual mixer identification */
773 unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */
774};
775
776typedef int __bitwise snd_ctl_elem_type_t;
777#define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0) /* invalid */
778#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1) /* boolean type */
779#define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2) /* integer type */
780#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3) /* enumerated type */
781#define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4) /* byte array */
782#define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */
783#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6) /* 64-bit integer type */
784#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
785
786typedef int __bitwise snd_ctl_elem_iface_t;
787#define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0) /* global control */
788#define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1) /* hardware dependent device */
789#define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2) /* virtual mixer device */
790#define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3) /* PCM device */
791#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4) /* RawMidi device */
792#define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5) /* timer device */
793#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6) /* sequencer client */
794#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
795
796#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
797#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
798#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
799#define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */
800#define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3) /* when was control changed */
801#define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4) /* TLV read is possible */
802#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5) /* TLV write is possible */
803#define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
804#define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6) /* TLV command is possible */
805#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */
806#define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */
807#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */
808#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* kernel use a TLV callback */
809#define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */
810/* bits 30 and 31 are obsoleted (for indirect access) */
811
812/* for further details see the ACPI and PCI power management specification */
813#define SNDRV_CTL_POWER_D0 0x0000 /* full On */
814#define SNDRV_CTL_POWER_D1 0x0100 /* partial On */
815#define SNDRV_CTL_POWER_D2 0x0200 /* partial On */
816#define SNDRV_CTL_POWER_D3 0x0300 /* Off */
817#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
818#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
819
820struct snd_ctl_elem_id {
821 unsigned int numid; /* numeric identifier, zero = invalid */
822 snd_ctl_elem_iface_t iface; /* interface identifier */
823 unsigned int device; /* device/client number */
824 unsigned int subdevice; /* subdevice (substream) number */
825 unsigned char name[44]; /* ASCII name of item */
826 unsigned int index; /* index of item */
827};
828
829struct snd_ctl_elem_list {
830 unsigned int offset; /* W: first element ID to get */
831 unsigned int space; /* W: count of element IDs to get */
832 unsigned int used; /* R: count of element IDs set */
833 unsigned int count; /* R: count of all elements */
834 struct snd_ctl_elem_id __user *pids; /* R: IDs */
835 unsigned char reserved[50];
836};
837
838struct snd_ctl_elem_info {
839 struct snd_ctl_elem_id id; /* W: element ID */
840 snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
841 unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
842 unsigned int count; /* count of values */
843 __kernel_pid_t owner; /* owner's PID of this control */
844 union {
845 struct {
846 long min; /* R: minimum value */
847 long max; /* R: maximum value */
848 long step; /* R: step (0 variable) */
849 } integer;
850 struct {
851 long long min; /* R: minimum value */
852 long long max; /* R: maximum value */
853 long long step; /* R: step (0 variable) */
854 } integer64;
855 struct {
856 unsigned int items; /* R: number of items */
857 unsigned int item; /* W: item number */
858 char name[64]; /* R: value name */
859 __u64 names_ptr; /* W: names list (ELEM_ADD only) */
860 unsigned int names_length;
861 } enumerated;
862 unsigned char reserved[128];
863 } value;
864 union {
865 unsigned short d[4]; /* dimensions */
866 unsigned short *d_ptr; /* indirect - obsoleted */
867 } dimen;
868 unsigned char reserved[64-4*sizeof(unsigned short)];
869};
870
871struct snd_ctl_elem_value {
872 struct snd_ctl_elem_id id; /* W: element ID */
873 unsigned int indirect: 1; /* W: indirect access - obsoleted */
874 union {
875 union {
876 long value[128];
877 long *value_ptr; /* obsoleted */
878 } integer;
879 union {
880 long long value[64];
881 long long *value_ptr; /* obsoleted */
882 } integer64;
883 union {
884 unsigned int item[128];
885 unsigned int *item_ptr; /* obsoleted */
886 } enumerated;
887 union {
888 unsigned char data[512];
889 unsigned char *data_ptr; /* obsoleted */
890 } bytes;
891 struct snd_aes_iec958 iec958;
892 } value; /* RO */
893 struct timespec tstamp;
894 unsigned char reserved[128-sizeof(struct timespec)];
895};
896
897struct snd_ctl_tlv {
898 unsigned int numid; /* control element numeric identification */
899 unsigned int length; /* in bytes aligned to 4 */
900 unsigned int tlv[0]; /* first TLV */
901};
902
903#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
904#define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
905#define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
906#define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
907#define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
908#define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
909#define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
910#define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
911#define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
912#define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
913#define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
914#define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
915#define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
916#define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
917#define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
918#define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
919#define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
920#define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
921#define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
922#define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
923#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
924#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
925#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
926#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
927#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
928
929/*
930 * Read interface.
931 */
932
933enum sndrv_ctl_event_type {
934 SNDRV_CTL_EVENT_ELEM = 0,
935 SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
936};
937
938#define SNDRV_CTL_EVENT_MASK_VALUE (1<<0) /* element value was changed */
939#define SNDRV_CTL_EVENT_MASK_INFO (1<<1) /* element info was changed */
940#define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */
941#define SNDRV_CTL_EVENT_MASK_TLV (1<<3) /* element TLV tree was changed */
942#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */
943
944struct snd_ctl_event {
945 int type; /* event type - SNDRV_CTL_EVENT_* */
946 union {
947 struct {
948 unsigned int mask;
949 struct snd_ctl_elem_id id;
950 } elem;
951 unsigned char data8[60];
952 } data;
953};
954
955/*
956 * Control names
957 */
958
959#define SNDRV_CTL_NAME_NONE ""
960#define SNDRV_CTL_NAME_PLAYBACK "Playback "
961#define SNDRV_CTL_NAME_CAPTURE "Capture "
962
963#define SNDRV_CTL_NAME_IEC958_NONE ""
964#define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
965#define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
966#define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
967#define SNDRV_CTL_NAME_IEC958_MASK "Mask"
968#define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
969#define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
970#define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
971#define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what
972
973#endif /* __SOUND_ASOUND_H */ 40#endif /* __SOUND_ASOUND_H */
diff --git a/include/sound/cs4271.h b/include/sound/cs4271.h
index 50a059e7d116..6d9e15ed1dcf 100644
--- a/include/sound/cs4271.h
+++ b/include/sound/cs4271.h
@@ -19,6 +19,7 @@
19 19
20struct cs4271_platform_data { 20struct cs4271_platform_data {
21 int gpio_nreset; /* GPIO driving Reset pin, if any */ 21 int gpio_nreset; /* GPIO driving Reset pin, if any */
22 int amutec_eq_bmutec:1; /* flag to enable AMUTEC=BMUTEC */
22}; 23};
23 24
24#endif /* __CS4271_H */ 25#endif /* __CS4271_H */
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 1a33f48ebe78..f841ba4bacb8 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -1,8 +1,3 @@
1#ifndef __SOUND_EMU10K1_H
2#define __SOUND_EMU10K1_H
3
4#include <linux/types.h>
5
6/* 1/*
7 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, 2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
8 * Creative Labs, Inc. 3 * Creative Labs, Inc.
@@ -24,8 +19,9 @@
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * 20 *
26 */ 21 */
22#ifndef __SOUND_EMU10K1_H
23#define __SOUND_EMU10K1_H
27 24
28#ifdef __KERNEL__
29 25
30#include <sound/pcm.h> 26#include <sound/pcm.h>
31#include <sound/rawmidi.h> 27#include <sound/rawmidi.h>
@@ -36,8 +32,10 @@
36#include <sound/timer.h> 32#include <sound/timer.h>
37#include <linux/interrupt.h> 33#include <linux/interrupt.h>
38#include <linux/mutex.h> 34#include <linux/mutex.h>
35#include <linux/firmware.h>
39 36
40#include <asm/io.h> 37#include <asm/io.h>
38#include <uapi/sound/emu10k1.h>
41 39
42/* ------------------- DEFINES -------------------- */ 40/* ------------------- DEFINES -------------------- */
43 41
@@ -1788,6 +1786,8 @@ struct snd_emu10k1 {
1788 unsigned int efx_voices_mask[2]; 1786 unsigned int efx_voices_mask[2];
1789 unsigned int next_free_voice; 1787 unsigned int next_free_voice;
1790 1788
1789 const struct firmware *firmware;
1790
1791#ifdef CONFIG_PM_SLEEP 1791#ifdef CONFIG_PM_SLEEP
1792 unsigned int *saved_ptr; 1792 unsigned int *saved_ptr;
1793 unsigned int *saved_gpr; 1793 unsigned int *saved_gpr;
@@ -1796,6 +1796,7 @@ struct snd_emu10k1 {
1796 unsigned int *saved_icode; 1796 unsigned int *saved_icode;
1797 unsigned int *p16v_saved; 1797 unsigned int *p16v_saved;
1798 unsigned int saved_a_iocfg, saved_hcfg; 1798 unsigned int saved_a_iocfg, saved_hcfg;
1799 bool suspend;
1799#endif 1800#endif
1800 1801
1801}; 1802};
@@ -1899,350 +1900,4 @@ int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu,
1899int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu, 1900int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu,
1900 struct snd_emu10k1_fx8010_irq *irq); 1901 struct snd_emu10k1_fx8010_irq *irq);
1901 1902
1902#endif /* __KERNEL__ */
1903
1904/*
1905 * ---- FX8010 ----
1906 */
1907
1908#define EMU10K1_CARD_CREATIVE 0x00000000
1909#define EMU10K1_CARD_EMUAPS 0x00000001
1910
1911#define EMU10K1_FX8010_PCM_COUNT 8
1912
1913/* instruction set */
1914#define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */
1915#define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */
1916#define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */
1917#define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */
1918#define iMACINT0 0x04 /* R = A + X * Y ; saturation */
1919#define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */
1920#define iACC3 0x06 /* R = A + X + Y ; saturation */
1921#define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */
1922#define iANDXOR 0x08 /* R = (A & X) ^ Y */
1923#define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */
1924#define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */
1925#define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */
1926#define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */
1927#define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */
1928#define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */
1929#define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */
1930
1931/* GPRs */
1932#define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */
1933#define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */
1934#define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */
1935#define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
1936 /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
1937
1938#define C_00000000 0x40
1939#define C_00000001 0x41
1940#define C_00000002 0x42
1941#define C_00000003 0x43
1942#define C_00000004 0x44
1943#define C_00000008 0x45
1944#define C_00000010 0x46
1945#define C_00000020 0x47
1946#define C_00000100 0x48
1947#define C_00010000 0x49
1948#define C_00080000 0x4a
1949#define C_10000000 0x4b
1950#define C_20000000 0x4c
1951#define C_40000000 0x4d
1952#define C_80000000 0x4e
1953#define C_7fffffff 0x4f
1954#define C_ffffffff 0x50
1955#define C_fffffffe 0x51
1956#define C_c0000000 0x52
1957#define C_4f1bbcdc 0x53
1958#define C_5a7ef9db 0x54
1959#define C_00100000 0x55 /* ?? */
1960#define GPR_ACCU 0x56 /* ACCUM, accumulator */
1961#define GPR_COND 0x57 /* CCR, condition register */
1962#define GPR_NOISE0 0x58 /* noise source */
1963#define GPR_NOISE1 0x59 /* noise source */
1964#define GPR_IRQ 0x5a /* IRQ register */
1965#define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */
1966#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
1967#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
1968#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
1969#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
1970#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
1971
1972#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
1973#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
1974#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
1975#define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
1976#define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
1977#define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
1978
1979#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */
1980#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */
1981#define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
1982#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */
1983#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
1984#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
1985#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
1986#define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
1987#define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
1988#define A_GPR(x) (A_FXGPREGBASE + (x))
1989
1990/* cc_reg constants */
1991#define CC_REG_NORMALIZED C_00000001
1992#define CC_REG_BORROW C_00000002
1993#define CC_REG_MINUS C_00000004
1994#define CC_REG_ZERO C_00000008
1995#define CC_REG_SATURATE C_00000010
1996#define CC_REG_NONZERO C_00000100
1997
1998/* FX buses */
1999#define FXBUS_PCM_LEFT 0x00
2000#define FXBUS_PCM_RIGHT 0x01
2001#define FXBUS_PCM_LEFT_REAR 0x02
2002#define FXBUS_PCM_RIGHT_REAR 0x03
2003#define FXBUS_MIDI_LEFT 0x04
2004#define FXBUS_MIDI_RIGHT 0x05
2005#define FXBUS_PCM_CENTER 0x06
2006#define FXBUS_PCM_LFE 0x07
2007#define FXBUS_PCM_LEFT_FRONT 0x08
2008#define FXBUS_PCM_RIGHT_FRONT 0x09
2009#define FXBUS_MIDI_REVERB 0x0c
2010#define FXBUS_MIDI_CHORUS 0x0d
2011#define FXBUS_PCM_LEFT_SIDE 0x0e
2012#define FXBUS_PCM_RIGHT_SIDE 0x0f
2013#define FXBUS_PT_LEFT 0x14
2014#define FXBUS_PT_RIGHT 0x15
2015
2016/* Inputs */
2017#define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
2018#define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
2019#define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */
2020#define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */
2021#define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */
2022#define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */
2023#define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */
2024#define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */
2025#define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */
2026#define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */
2027#define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */
2028#define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */
2029#define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */
2030#define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */
2031
2032/* Outputs */
2033#define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */
2034#define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */
2035#define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */
2036#define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */
2037#define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */
2038#define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */
2039#define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */
2040#define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */
2041#define EXTOUT_REAR_L 0x08 /* Rear channel - left */
2042#define EXTOUT_REAR_R 0x09 /* Rear channel - right */
2043#define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */
2044#define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */
2045#define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */
2046#define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */
2047#define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */
2048#define EXTOUT_ACENTER 0x11 /* Analog Center */
2049#define EXTOUT_ALFE 0x12 /* Analog LFE */
2050
2051/* Audigy Inputs */
2052#define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
2053#define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
2054#define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */
2055#define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */
2056#define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */
2057#define A_EXTIN_OPT_SPDIF_R 0x05 /* right */
2058#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */
2059#define A_EXTIN_LINE2_R 0x09 /* right */
2060#define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */
2061#define A_EXTIN_ADC_R 0x0b /* right */
2062#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */
2063#define A_EXTIN_AUX2_R 0x0d /* - right */
2064
2065/* Audigiy Outputs */
2066#define A_EXTOUT_FRONT_L 0x00 /* digital front left */
2067#define A_EXTOUT_FRONT_R 0x01 /* right */
2068#define A_EXTOUT_CENTER 0x02 /* digital front center */
2069#define A_EXTOUT_LFE 0x03 /* digital front lfe */
2070#define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */
2071#define A_EXTOUT_HEADPHONE_R 0x05 /* right */
2072#define A_EXTOUT_REAR_L 0x06 /* digital rear left */
2073#define A_EXTOUT_REAR_R 0x07 /* right */
2074#define A_EXTOUT_AFRONT_L 0x08 /* analog front left */
2075#define A_EXTOUT_AFRONT_R 0x09 /* right */
2076#define A_EXTOUT_ACENTER 0x0a /* analog center */
2077#define A_EXTOUT_ALFE 0x0b /* analog LFE */
2078#define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */
2079#define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */
2080#define A_EXTOUT_AREAR_L 0x0e /* analog rear left */
2081#define A_EXTOUT_AREAR_R 0x0f /* right */
2082#define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */
2083#define A_EXTOUT_AC97_R 0x11 /* right */
2084#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */
2085#define A_EXTOUT_ADC_CAP_R 0x17 /* right */
2086#define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */
2087
2088/* Audigy constants */
2089#define A_C_00000000 0xc0
2090#define A_C_00000001 0xc1
2091#define A_C_00000002 0xc2
2092#define A_C_00000003 0xc3
2093#define A_C_00000004 0xc4
2094#define A_C_00000008 0xc5
2095#define A_C_00000010 0xc6
2096#define A_C_00000020 0xc7
2097#define A_C_00000100 0xc8
2098#define A_C_00010000 0xc9
2099#define A_C_00000800 0xca
2100#define A_C_10000000 0xcb
2101#define A_C_20000000 0xcc
2102#define A_C_40000000 0xcd
2103#define A_C_80000000 0xce
2104#define A_C_7fffffff 0xcf
2105#define A_C_ffffffff 0xd0
2106#define A_C_fffffffe 0xd1
2107#define A_C_c0000000 0xd2
2108#define A_C_4f1bbcdc 0xd3
2109#define A_C_5a7ef9db 0xd4
2110#define A_C_00100000 0xd5
2111#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
2112#define A_GPR_COND 0xd7 /* CCR, condition register */
2113#define A_GPR_NOISE0 0xd8 /* noise source */
2114#define A_GPR_NOISE1 0xd9 /* noise source */
2115#define A_GPR_IRQ 0xda /* IRQ register */
2116#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
2117#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
2118
2119/* definitions for debug register */
2120#define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */
2121#define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */
2122#define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */
2123#define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */
2124#define EMU10K1_DBG_STEP 0x00004000 /* start single step */
2125#define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */
2126#define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */
2127
2128/* tank memory address line */
2129#ifndef __KERNEL__
2130#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
2131#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
2132#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
2133#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
2134#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
2135#endif
2136
2137struct snd_emu10k1_fx8010_info {
2138 unsigned int internal_tram_size; /* in samples */
2139 unsigned int external_tram_size; /* in samples */
2140 char fxbus_names[16][32]; /* names of FXBUSes */
2141 char extin_names[16][32]; /* names of external inputs */
2142 char extout_names[32][32]; /* names of external outputs */
2143 unsigned int gpr_controls; /* count of GPR controls */
2144};
2145
2146#define EMU10K1_GPR_TRANSLATION_NONE 0
2147#define EMU10K1_GPR_TRANSLATION_TABLE100 1
2148#define EMU10K1_GPR_TRANSLATION_BASS 2
2149#define EMU10K1_GPR_TRANSLATION_TREBLE 3
2150#define EMU10K1_GPR_TRANSLATION_ONOFF 4
2151
2152struct snd_emu10k1_fx8010_control_gpr {
2153 struct snd_ctl_elem_id id; /* full control ID definition */
2154 unsigned int vcount; /* visible count */
2155 unsigned int count; /* count of GPR (1..16) */
2156 unsigned short gpr[32]; /* GPR number(s) */
2157 unsigned int value[32]; /* initial values */
2158 unsigned int min; /* minimum range */
2159 unsigned int max; /* maximum range */
2160 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
2161 const unsigned int *tlv;
2162};
2163
2164/* old ABI without TLV support */
2165struct snd_emu10k1_fx8010_control_old_gpr {
2166 struct snd_ctl_elem_id id;
2167 unsigned int vcount;
2168 unsigned int count;
2169 unsigned short gpr[32];
2170 unsigned int value[32];
2171 unsigned int min;
2172 unsigned int max;
2173 unsigned int translation;
2174};
2175
2176struct snd_emu10k1_fx8010_code {
2177 char name[128];
2178
2179 DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
2180 __u32 __user *gpr_map; /* initializers */
2181
2182 unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
2183 struct snd_emu10k1_fx8010_control_gpr __user *gpr_add_controls; /* GPR controls to add/replace */
2184
2185 unsigned int gpr_del_control_count; /* count of GPR controls to remove */
2186 struct snd_ctl_elem_id __user *gpr_del_controls; /* IDs of GPR controls to remove */
2187
2188 unsigned int gpr_list_control_count; /* count of GPR controls to list */
2189 unsigned int gpr_list_control_total; /* total count of GPR controls */
2190 struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */
2191
2192 DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
2193 __u32 __user *tram_data_map; /* data initializers */
2194 __u32 __user *tram_addr_map; /* map initializers */
2195
2196 DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
2197 __u32 __user *code; /* one instruction - 64 bits */
2198};
2199
2200struct snd_emu10k1_fx8010_tram {
2201 unsigned int address; /* 31.bit == 1 -> external TRAM */
2202 unsigned int size; /* size in samples (4 bytes) */
2203 unsigned int *samples; /* pointer to samples (20-bit) */
2204 /* NULL->clear memory */
2205};
2206
2207struct snd_emu10k1_fx8010_pcm_rec {
2208 unsigned int substream; /* substream number */
2209 unsigned int res1; /* reserved */
2210 unsigned int channels; /* 16-bit channels count, zero = remove this substream */
2211 unsigned int tram_start; /* ring buffer position in TRAM (in samples) */
2212 unsigned int buffer_size; /* count of buffered samples */
2213 unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */
2214 unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
2215 unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */
2216 unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
2217 unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
2218 unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
2219 unsigned char pad; /* reserved */
2220 unsigned char etram[32]; /* external TRAM address & data (one per channel) */
2221 unsigned int res2; /* reserved */
2222};
2223
2224#define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
2225
2226#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
2227#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
2228#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
2229#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int)
2230#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram)
2231#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
2232#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
2233#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
2234#define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int)
2235#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80)
2236#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81)
2237#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
2238#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)
2239#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)
2240
2241/* typedefs for compatibility to user-space */
2242typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t;
2243typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t;
2244typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t;
2245typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t;
2246typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t;
2247
2248#endif /* __SOUND_EMU10K1_H */ 1903#endif /* __SOUND_EMU10K1_H */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 6268a4192d5c..45c1981c9ca2 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -71,6 +71,8 @@ struct snd_pcm_ops {
71 int (*prepare)(struct snd_pcm_substream *substream); 71 int (*prepare)(struct snd_pcm_substream *substream);
72 int (*trigger)(struct snd_pcm_substream *substream, int cmd); 72 int (*trigger)(struct snd_pcm_substream *substream, int cmd);
73 snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream); 73 snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream);
74 int (*wall_clock)(struct snd_pcm_substream *substream,
75 struct timespec *audio_ts);
74 int (*copy)(struct snd_pcm_substream *substream, int channel, 76 int (*copy)(struct snd_pcm_substream *substream, int channel,
75 snd_pcm_uframes_t pos, 77 snd_pcm_uframes_t pos,
76 void __user *buf, snd_pcm_uframes_t count); 78 void __user *buf, snd_pcm_uframes_t count);
@@ -281,6 +283,7 @@ struct snd_pcm_runtime {
281 unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ 283 unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */
282 unsigned long hw_ptr_buffer_jiffies; /* buffer time in jiffies */ 284 unsigned long hw_ptr_buffer_jiffies; /* buffer time in jiffies */
283 snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */ 285 snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */
286 u64 hw_ptr_wrap; /* offset for hw_ptr due to boundary wrap-around */
284 287
285 /* -- HW params -- */ 288 /* -- HW params -- */
286 snd_pcm_access_t access; /* access mode */ 289 snd_pcm_access_t access; /* access mode */
diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h
index 7e950560e591..c7c7788005e4 100644
--- a/include/sound/sb16_csp.h
+++ b/include/sound/sb16_csp.h
@@ -1,6 +1,3 @@
1#ifndef __SOUND_SB16_CSP_H
2#define __SOUND_SB16_CSP_H
3
4/* 1/*
5 * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si> 2 * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si>
6 * Takashi Iwai <tiwai@suse.de> 3 * Takashi Iwai <tiwai@suse.de>
@@ -22,106 +19,13 @@
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 * 20 *
24 */ 21 */
22#ifndef __SOUND_SB16_CSP_H
23#define __SOUND_SB16_CSP_H
25 24
26/* CSP modes */
27#define SNDRV_SB_CSP_MODE_NONE 0x00
28#define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */
29#define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */
30#define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */
31
32/* CSP load flags */
33#define SNDRV_SB_CSP_LOAD_FROMUSER 0x01
34#define SNDRV_SB_CSP_LOAD_INITBLOCK 0x02
35
36/* CSP sample width */
37#define SNDRV_SB_CSP_SAMPLE_8BIT 0x01
38#define SNDRV_SB_CSP_SAMPLE_16BIT 0x02
39
40/* CSP channels */
41#define SNDRV_SB_CSP_MONO 0x01
42#define SNDRV_SB_CSP_STEREO 0x02
43
44/* CSP rates */
45#define SNDRV_SB_CSP_RATE_8000 0x01
46#define SNDRV_SB_CSP_RATE_11025 0x02
47#define SNDRV_SB_CSP_RATE_22050 0x04
48#define SNDRV_SB_CSP_RATE_44100 0x08
49#define SNDRV_SB_CSP_RATE_ALL 0x0f
50
51/* CSP running state */
52#define SNDRV_SB_CSP_ST_IDLE 0x00
53#define SNDRV_SB_CSP_ST_LOADED 0x01
54#define SNDRV_SB_CSP_ST_RUNNING 0x02
55#define SNDRV_SB_CSP_ST_PAUSED 0x04
56#define SNDRV_SB_CSP_ST_AUTO 0x08
57#define SNDRV_SB_CSP_ST_QSOUND 0x10
58
59/* maximum QSound value (180 degrees right) */
60#define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x20
61
62/* maximum microcode RIFF file size */
63#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000
64
65/* microcode header */
66struct snd_sb_csp_mc_header {
67 char codec_name[16]; /* id name of codec */
68 unsigned short func_req; /* requested function */
69};
70
71/* microcode to be loaded */
72struct snd_sb_csp_microcode {
73 struct snd_sb_csp_mc_header info;
74 unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
75};
76
77/* start CSP with sample_width in mono/stereo */
78struct snd_sb_csp_start {
79 int sample_width; /* sample width, look above */
80 int channels; /* channels, look above */
81};
82
83/* CSP information */
84struct snd_sb_csp_info {
85 char codec_name[16]; /* id name of codec */
86 unsigned short func_nr; /* function number */
87 unsigned int acc_format; /* accepted PCM formats */
88 unsigned short acc_channels; /* accepted channels */
89 unsigned short acc_width; /* accepted sample width */
90 unsigned short acc_rates; /* accepted sample rates */
91 unsigned short csp_mode; /* CSP mode, see above */
92 unsigned short run_channels; /* current channels */
93 unsigned short run_width; /* current sample width */
94 unsigned short version; /* version id: 0x10 - 0x1f */
95 unsigned short state; /* state bits */
96};
97
98/* HWDEP controls */
99/* get CSP information */
100#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info)
101/* load microcode to CSP */
102/* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits)
103 * defined for some architectures like MIPS, and it leads to build errors.
104 * (x86 and co have 14-bit size, thus it's valid, though.)
105 * As a workaround for skipping the size-limit check, here we don't use the
106 * normal _IOW() macro but _IOC() with the manual argument.
107 */
108#define SNDRV_SB_CSP_IOCTL_LOAD_CODE \
109 _IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode))
110/* unload microcode from CSP */
111#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
112/* start CSP */
113#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, struct snd_sb_csp_start)
114/* stop CSP */
115#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14)
116/* pause CSP and DMA transfer */
117#define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15)
118/* restart CSP and DMA transfer */
119#define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16)
120
121#ifdef __KERNEL__
122#include <sound/sb.h> 25#include <sound/sb.h>
123#include <sound/hwdep.h> 26#include <sound/hwdep.h>
124#include <linux/firmware.h> 27#include <linux/firmware.h>
28#include <uapi/sound/sb16_csp.h>
125 29
126struct snd_sb_csp; 30struct snd_sb_csp;
127 31
@@ -183,6 +87,4 @@ struct snd_sb_csp {
183}; 87};
184 88
185int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep); 89int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep);
186#endif
187
188#endif /* __SOUND_SB16_CSP */ 90#endif /* __SOUND_SB16_CSP */
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h
index 906010344dd7..cc1c919c6436 100644
--- a/include/sound/sh_fsi.h
+++ b/include/sound/sh_fsi.h
@@ -26,6 +26,7 @@
26 * A: inversion 26 * A: inversion
27 * B: format mode 27 * B: format mode
28 * C: chip specific 28 * C: chip specific
29 * D: clock selecter if master mode
29 */ 30 */
30 31
31/* A: clock inversion */ 32/* A: clock inversion */
@@ -44,6 +45,11 @@
44#define SH_FSI_OPTION_MASK 0x00000F00 45#define SH_FSI_OPTION_MASK 0x00000F00
45#define SH_FSI_ENABLE_STREAM_MODE (1 << 8) /* for 16bit data */ 46#define SH_FSI_ENABLE_STREAM_MODE (1 << 8) /* for 16bit data */
46 47
48/* D: clock selecter if master mode */
49#define SH_FSI_CLK_MASK 0x0000F000
50#define SH_FSI_CLK_EXTERNAL (0 << 12)
51#define SH_FSI_CLK_CPG (1 << 12) /* FSIxCK + FSI-DIV */
52
47/* 53/*
48 * set_rate return value 54 * set_rate return value
49 * 55 *
diff --git a/include/sound/tlv320aic32x4.h b/include/sound/tlv320aic32x4.h
index c009f70b4029..24e5d991f148 100644
--- a/include/sound/tlv320aic32x4.h
+++ b/include/sound/tlv320aic32x4.h
@@ -26,6 +26,7 @@ struct aic32x4_pdata {
26 u32 power_cfg; 26 u32 power_cfg;
27 u32 micpga_routing; 27 u32 micpga_routing;
28 bool swapdacs; 28 bool swapdacs;
29 int rstn_gpio;
29}; 30};
30 31
31#endif 32#endif
diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h
index 4f67c762cd74..f634f8f85db5 100644
--- a/include/sound/vx_core.h
+++ b/include/sound/vx_core.h
@@ -27,12 +27,6 @@
27#include <sound/hwdep.h> 27#include <sound/hwdep.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29 29
30#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
31#if !defined(CONFIG_USE_VXLOADER) && !defined(CONFIG_SND_VX_LIB) /* built-in kernel */
32#define SND_VX_FW_LOADER /* use the standard firmware loader */
33#endif
34#endif
35
36struct firmware; 30struct firmware;
37struct device; 31struct device;
38 32
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index 2acd54018b64..507910992c59 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -9,6 +9,8 @@ struct se_subsystem_api {
9 struct list_head sub_api_list; 9 struct list_head sub_api_list;
10 10
11 char name[16]; 11 char name[16];
12 char inquiry_prod[16];
13 char inquiry_rev[4];
12 struct module *owner; 14 struct module *owner;
13 15
14 u8 transport_type; 16 u8 transport_type;
@@ -16,46 +18,45 @@ struct se_subsystem_api {
16 int (*attach_hba)(struct se_hba *, u32); 18 int (*attach_hba)(struct se_hba *, u32);
17 void (*detach_hba)(struct se_hba *); 19 void (*detach_hba)(struct se_hba *);
18 int (*pmode_enable_hba)(struct se_hba *, unsigned long); 20 int (*pmode_enable_hba)(struct se_hba *, unsigned long);
19 void *(*allocate_virtdevice)(struct se_hba *, const char *); 21
20 struct se_device *(*create_virtdevice)(struct se_hba *, 22 struct se_device *(*alloc_device)(struct se_hba *, const char *);
21 struct se_subsystem_dev *, void *); 23 int (*configure_device)(struct se_device *);
22 void (*free_device)(void *); 24 void (*free_device)(struct se_device *device);
25
26 ssize_t (*set_configfs_dev_params)(struct se_device *,
27 const char *, ssize_t);
28 ssize_t (*show_configfs_dev_params)(struct se_device *, char *);
29
23 void (*transport_complete)(struct se_cmd *cmd, 30 void (*transport_complete)(struct se_cmd *cmd,
24 struct scatterlist *, 31 struct scatterlist *,
25 unsigned char *); 32 unsigned char *);
26 33
27 int (*parse_cdb)(struct se_cmd *cmd); 34 sense_reason_t (*parse_cdb)(struct se_cmd *cmd);
28 ssize_t (*check_configfs_dev_params)(struct se_hba *,
29 struct se_subsystem_dev *);
30 ssize_t (*set_configfs_dev_params)(struct se_hba *,
31 struct se_subsystem_dev *, const char *, ssize_t);
32 ssize_t (*show_configfs_dev_params)(struct se_hba *,
33 struct se_subsystem_dev *, char *);
34 u32 (*get_device_rev)(struct se_device *);
35 u32 (*get_device_type)(struct se_device *); 35 u32 (*get_device_type)(struct se_device *);
36 sector_t (*get_blocks)(struct se_device *); 36 sector_t (*get_blocks)(struct se_device *);
37 unsigned char *(*get_sense_buffer)(struct se_cmd *); 37 unsigned char *(*get_sense_buffer)(struct se_cmd *);
38}; 38};
39 39
40struct spc_ops { 40struct sbc_ops {
41 int (*execute_rw)(struct se_cmd *cmd); 41 sense_reason_t (*execute_rw)(struct se_cmd *cmd);
42 int (*execute_sync_cache)(struct se_cmd *cmd); 42 sense_reason_t (*execute_sync_cache)(struct se_cmd *cmd);
43 int (*execute_write_same)(struct se_cmd *cmd); 43 sense_reason_t (*execute_write_same)(struct se_cmd *cmd);
44 int (*execute_unmap)(struct se_cmd *cmd); 44 sense_reason_t (*execute_write_same_unmap)(struct se_cmd *cmd);
45 sense_reason_t (*execute_unmap)(struct se_cmd *cmd);
45}; 46};
46 47
47int transport_subsystem_register(struct se_subsystem_api *); 48int transport_subsystem_register(struct se_subsystem_api *);
48void transport_subsystem_release(struct se_subsystem_api *); 49void transport_subsystem_release(struct se_subsystem_api *);
49 50
50struct se_device *transport_add_device_to_core_hba(struct se_hba *,
51 struct se_subsystem_api *, struct se_subsystem_dev *, u32,
52 void *, struct se_dev_limits *, const char *, const char *);
53
54void target_complete_cmd(struct se_cmd *, u8); 51void target_complete_cmd(struct se_cmd *, u8);
55 52
56int sbc_parse_cdb(struct se_cmd *cmd, struct spc_ops *ops); 53sense_reason_t spc_parse_cdb(struct se_cmd *cmd, unsigned int *size);
57int spc_parse_cdb(struct se_cmd *cmd, unsigned int *size); 54sense_reason_t spc_emulate_report_luns(struct se_cmd *cmd);
58int spc_get_write_same_sectors(struct se_cmd *cmd); 55sector_t spc_get_write_same_sectors(struct se_cmd *cmd);
56
57sense_reason_t sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops);
58u32 sbc_get_device_rev(struct se_device *dev);
59u32 sbc_get_device_type(struct se_device *dev);
59 60
60void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *); 61void transport_set_vpd_proto_id(struct t10_vpd *, unsigned char *);
61int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *); 62int transport_set_vpd_assoc(struct t10_vpd *, unsigned char *);
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 5be89373ceac..7cae2360221e 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -62,20 +62,6 @@
62 62
63#define PYX_TRANSPORT_STATUS_INTERVAL 5 /* In seconds */ 63#define PYX_TRANSPORT_STATUS_INTERVAL 5 /* In seconds */
64 64
65/*
66 * struct se_subsystem_dev->su_dev_flags
67*/
68#define SDF_FIRMWARE_VPD_UNIT_SERIAL 0x00000001
69#define SDF_EMULATED_VPD_UNIT_SERIAL 0x00000002
70#define SDF_USING_UDEV_PATH 0x00000004
71#define SDF_USING_ALIAS 0x00000008
72
73/*
74 * struct se_device->dev_flags
75 */
76#define DF_SPC2_RESERVATIONS 0x00000001
77#define DF_SPC2_RESERVATIONS_WITH_ISID 0x00000002
78
79/* struct se_dev_attrib sanity values */ 65/* struct se_dev_attrib sanity values */
80/* Default max_unmap_lba_count */ 66/* Default max_unmap_lba_count */
81#define DA_MAX_UNMAP_LBA_COUNT 0 67#define DA_MAX_UNMAP_LBA_COUNT 0
@@ -85,6 +71,8 @@
85#define DA_UNMAP_GRANULARITY_DEFAULT 0 71#define DA_UNMAP_GRANULARITY_DEFAULT 0
86/* Default unmap_granularity_alignment */ 72/* Default unmap_granularity_alignment */
87#define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 0 73#define DA_UNMAP_GRANULARITY_ALIGNMENT_DEFAULT 0
74/* Default max_write_same_len, disabled by default */
75#define DA_MAX_WRITE_SAME_LEN 0
88/* Default max transfer length */ 76/* Default max transfer length */
89#define DA_FABRIC_MAX_SECTORS 8192 77#define DA_FABRIC_MAX_SECTORS 8192
90/* Emulation for Direct Page Out */ 78/* Emulation for Direct Page Out */
@@ -107,8 +95,6 @@
107 */ 95 */
108#define DA_EMULATE_TPWS 0 96#define DA_EMULATE_TPWS 0
109/* No Emulation for PSCSI by default */ 97/* No Emulation for PSCSI by default */
110#define DA_EMULATE_RESERVATIONS 0
111/* No Emulation for PSCSI by default */
112#define DA_EMULATE_ALUA 0 98#define DA_EMULATE_ALUA 0
113/* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */ 99/* Enforce SCSI Initiator Port TransportID with 'ISID' for PR */
114#define DA_ENFORCE_PR_ISIDS 1 100#define DA_ENFORCE_PR_ISIDS 1
@@ -160,8 +146,6 @@ enum se_cmd_flags_table {
160 SCF_EMULATED_TASK_SENSE = 0x00000004, 146 SCF_EMULATED_TASK_SENSE = 0x00000004,
161 SCF_SCSI_DATA_CDB = 0x00000008, 147 SCF_SCSI_DATA_CDB = 0x00000008,
162 SCF_SCSI_TMR_CDB = 0x00000010, 148 SCF_SCSI_TMR_CDB = 0x00000010,
163 SCF_SCSI_CDB_EXCEPTION = 0x00000020,
164 SCF_SCSI_RESERVATION_CONFLICT = 0x00000040,
165 SCF_FUA = 0x00000080, 149 SCF_FUA = 0x00000080,
166 SCF_SE_LUN_CMD = 0x00000100, 150 SCF_SE_LUN_CMD = 0x00000100,
167 SCF_BIDI = 0x00000400, 151 SCF_BIDI = 0x00000400,
@@ -182,38 +166,33 @@ enum transport_lunflags_table {
182 TRANSPORT_LUNFLAGS_READ_WRITE = 0x04, 166 TRANSPORT_LUNFLAGS_READ_WRITE = 0x04,
183}; 167};
184 168
185/* struct se_device->dev_status */
186enum transport_device_status_table {
187 TRANSPORT_DEVICE_ACTIVATED = 0x01,
188 TRANSPORT_DEVICE_DEACTIVATED = 0x02,
189 TRANSPORT_DEVICE_QUEUE_FULL = 0x04,
190 TRANSPORT_DEVICE_SHUTDOWN = 0x08,
191 TRANSPORT_DEVICE_OFFLINE_ACTIVATED = 0x10,
192 TRANSPORT_DEVICE_OFFLINE_DEACTIVATED = 0x20,
193};
194
195/* 169/*
196 * Used by transport_send_check_condition_and_sense() and se_cmd->scsi_sense_reason 170 * Used by transport_send_check_condition_and_sense()
197 * to signal which ASC/ASCQ sense payload should be built. 171 * to signal which ASC/ASCQ sense payload should be built.
198 */ 172 */
173typedef unsigned __bitwise__ sense_reason_t;
174
199enum tcm_sense_reason_table { 175enum tcm_sense_reason_table {
200 TCM_NON_EXISTENT_LUN = 0x01, 176#define R(x) (__force sense_reason_t )(x)
201 TCM_UNSUPPORTED_SCSI_OPCODE = 0x02, 177 TCM_NON_EXISTENT_LUN = R(0x01),
202 TCM_INCORRECT_AMOUNT_OF_DATA = 0x03, 178 TCM_UNSUPPORTED_SCSI_OPCODE = R(0x02),
203 TCM_UNEXPECTED_UNSOLICITED_DATA = 0x04, 179 TCM_INCORRECT_AMOUNT_OF_DATA = R(0x03),
204 TCM_SERVICE_CRC_ERROR = 0x05, 180 TCM_UNEXPECTED_UNSOLICITED_DATA = R(0x04),
205 TCM_SNACK_REJECTED = 0x06, 181 TCM_SERVICE_CRC_ERROR = R(0x05),
206 TCM_SECTOR_COUNT_TOO_MANY = 0x07, 182 TCM_SNACK_REJECTED = R(0x06),
207 TCM_INVALID_CDB_FIELD = 0x08, 183 TCM_SECTOR_COUNT_TOO_MANY = R(0x07),
208 TCM_INVALID_PARAMETER_LIST = 0x09, 184 TCM_INVALID_CDB_FIELD = R(0x08),
209 TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE = 0x0a, 185 TCM_INVALID_PARAMETER_LIST = R(0x09),
210 TCM_UNKNOWN_MODE_PAGE = 0x0b, 186 TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE = R(0x0a),
211 TCM_WRITE_PROTECTED = 0x0c, 187 TCM_UNKNOWN_MODE_PAGE = R(0x0b),
212 TCM_CHECK_CONDITION_ABORT_CMD = 0x0d, 188 TCM_WRITE_PROTECTED = R(0x0c),
213 TCM_CHECK_CONDITION_UNIT_ATTENTION = 0x0e, 189 TCM_CHECK_CONDITION_ABORT_CMD = R(0x0d),
214 TCM_CHECK_CONDITION_NOT_READY = 0x0f, 190 TCM_CHECK_CONDITION_UNIT_ATTENTION = R(0x0e),
215 TCM_RESERVATION_CONFLICT = 0x10, 191 TCM_CHECK_CONDITION_NOT_READY = R(0x0f),
216 TCM_ADDRESS_OUT_OF_RANGE = 0x11, 192 TCM_RESERVATION_CONFLICT = R(0x10),
193 TCM_ADDRESS_OUT_OF_RANGE = R(0x11),
194 TCM_OUT_OF_RESOURCES = R(0x12),
195#undef R
217}; 196};
218 197
219enum target_sc_flags_table { 198enum target_sc_flags_table {
@@ -246,30 +225,6 @@ enum tcm_tmrsp_table {
246 TMR_FUNCTION_REJECTED = 255, 225 TMR_FUNCTION_REJECTED = 255,
247}; 226};
248 227
249struct se_obj {
250 atomic_t obj_access_count;
251};
252
253/*
254 * Used by TCM Core internally to signal if ALUA emulation is enabled or
255 * disabled, or running in with TCM/pSCSI passthrough mode
256 */
257typedef enum {
258 SPC_ALUA_PASSTHROUGH,
259 SPC2_ALUA_DISABLED,
260 SPC3_ALUA_EMULATED
261} t10_alua_index_t;
262
263/*
264 * Used by TCM Core internally to signal if SAM Task Attribute emulation
265 * is enabled or disabled, or running in with TCM/pSCSI passthrough mode
266 */
267typedef enum {
268 SAM_TASK_ATTR_PASSTHROUGH,
269 SAM_TASK_ATTR_UNTAGGED,
270 SAM_TASK_ATTR_EMULATED
271} t10_task_attr_index_t;
272
273/* 228/*
274 * Used for target SCSI statistics 229 * Used for target SCSI statistics
275 */ 230 */
@@ -283,17 +238,15 @@ typedef enum {
283struct se_cmd; 238struct se_cmd;
284 239
285struct t10_alua { 240struct t10_alua {
286 t10_alua_index_t alua_type;
287 /* ALUA Target Port Group ID */ 241 /* ALUA Target Port Group ID */
288 u16 alua_tg_pt_gps_counter; 242 u16 alua_tg_pt_gps_counter;
289 u32 alua_tg_pt_gps_count; 243 u32 alua_tg_pt_gps_count;
290 spinlock_t tg_pt_gps_lock; 244 spinlock_t tg_pt_gps_lock;
291 struct se_subsystem_dev *t10_sub_dev; 245 struct se_device *t10_dev;
292 /* Used for default ALUA Target Port Group */ 246 /* Used for default ALUA Target Port Group */
293 struct t10_alua_tg_pt_gp *default_tg_pt_gp; 247 struct t10_alua_tg_pt_gp *default_tg_pt_gp;
294 /* Used for default ALUA Target Port Group ConfigFS group */ 248 /* Used for default ALUA Target Port Group ConfigFS group */
295 struct config_group alua_tg_pt_gps_group; 249 struct config_group alua_tg_pt_gps_group;
296 int (*alua_state_check)(struct se_cmd *, unsigned char *, u8 *);
297 struct list_head tg_pt_gps_list; 250 struct list_head tg_pt_gps_list;
298}; 251};
299 252
@@ -335,7 +288,7 @@ struct t10_alua_tg_pt_gp {
335 atomic_t tg_pt_gp_ref_cnt; 288 atomic_t tg_pt_gp_ref_cnt;
336 spinlock_t tg_pt_gp_lock; 289 spinlock_t tg_pt_gp_lock;
337 struct mutex tg_pt_gp_md_mutex; 290 struct mutex tg_pt_gp_md_mutex;
338 struct se_subsystem_dev *tg_pt_gp_su_dev; 291 struct se_device *tg_pt_gp_dev;
339 struct config_group tg_pt_gp_group; 292 struct config_group tg_pt_gp_group;
340 struct list_head tg_pt_gp_list; 293 struct list_head tg_pt_gp_list;
341 struct list_head tg_pt_gp_mem_list; 294 struct list_head tg_pt_gp_mem_list;
@@ -366,23 +319,11 @@ struct t10_wwn {
366 char revision[4]; 319 char revision[4];
367 char unit_serial[INQUIRY_VPD_SERIAL_LEN]; 320 char unit_serial[INQUIRY_VPD_SERIAL_LEN];
368 spinlock_t t10_vpd_lock; 321 spinlock_t t10_vpd_lock;
369 struct se_subsystem_dev *t10_sub_dev; 322 struct se_device *t10_dev;
370 struct config_group t10_wwn_group; 323 struct config_group t10_wwn_group;
371 struct list_head t10_vpd_list; 324 struct list_head t10_vpd_list;
372}; 325};
373 326
374
375/*
376 * Used by TCM Core internally to signal if >= SPC-3 persistent reservations
377 * emulation is enabled or disabled, or running in with TCM/pSCSI passthrough
378 * mode
379 */
380typedef enum {
381 SPC_PASSTHROUGH,
382 SPC2_RESERVATIONS,
383 SPC3_PERSISTENT_RESERVATIONS
384} t10_reservations_index_t;
385
386struct t10_pr_registration { 327struct t10_pr_registration {
387 /* Used for fabrics that contain WWN+ISID */ 328 /* Used for fabrics that contain WWN+ISID */
388#define PR_REG_ISID_LEN 16 329#define PR_REG_ISID_LEN 16
@@ -424,18 +365,6 @@ struct t10_pr_registration {
424 struct list_head pr_reg_atp_mem_list; 365 struct list_head pr_reg_atp_mem_list;
425}; 366};
426 367
427/*
428 * This set of function pointer ops is set based upon SPC3_PERSISTENT_RESERVATIONS,
429 * SPC2_RESERVATIONS or SPC_PASSTHROUGH in drivers/target/target_core_pr.c:
430 * core_setup_reservations()
431 */
432struct t10_reservation_ops {
433 int (*t10_reservation_check)(struct se_cmd *, u32 *);
434 int (*t10_seq_non_holder)(struct se_cmd *, unsigned char *, u32);
435 int (*t10_pr_register)(struct se_cmd *);
436 int (*t10_pr_clear)(struct se_cmd *);
437};
438
439struct t10_reservation { 368struct t10_reservation {
440 /* Reservation effects all target ports */ 369 /* Reservation effects all target ports */
441 int pr_all_tg_pt; 370 int pr_all_tg_pt;
@@ -446,7 +375,6 @@ struct t10_reservation {
446#define PR_APTPL_BUF_LEN 8192 375#define PR_APTPL_BUF_LEN 8192
447 u32 pr_aptpl_buf_len; 376 u32 pr_aptpl_buf_len;
448 u32 pr_generation; 377 u32 pr_generation;
449 t10_reservations_index_t res_type;
450 spinlock_t registration_lock; 378 spinlock_t registration_lock;
451 spinlock_t aptpl_reg_lock; 379 spinlock_t aptpl_reg_lock;
452 /* 380 /*
@@ -462,7 +390,6 @@ struct t10_reservation {
462 struct se_node_acl *pr_res_holder; 390 struct se_node_acl *pr_res_holder;
463 struct list_head registration_list; 391 struct list_head registration_list;
464 struct list_head aptpl_reg_list; 392 struct list_head aptpl_reg_list;
465 struct t10_reservation_ops pr_ops;
466}; 393};
467 394
468struct se_tmr_req { 395struct se_tmr_req {
@@ -485,7 +412,6 @@ struct se_cmd {
485 u8 scsi_status; 412 u8 scsi_status;
486 u8 scsi_asc; 413 u8 scsi_asc;
487 u8 scsi_ascq; 414 u8 scsi_ascq;
488 u8 scsi_sense_reason;
489 u16 scsi_sense_length; 415 u16 scsi_sense_length;
490 /* Delay for ALUA Active/NonOptimized state access in milliseconds */ 416 /* Delay for ALUA Active/NonOptimized state access in milliseconds */
491 int alua_nonop_delay; 417 int alua_nonop_delay;
@@ -523,7 +449,7 @@ struct se_cmd {
523 struct completion cmd_wait_comp; 449 struct completion cmd_wait_comp;
524 struct kref cmd_kref; 450 struct kref cmd_kref;
525 struct target_core_fabric_ops *se_tfo; 451 struct target_core_fabric_ops *se_tfo;
526 int (*execute_cmd)(struct se_cmd *); 452 sense_reason_t (*execute_cmd)(struct se_cmd *);
527 void (*transport_complete_callback)(struct se_cmd *); 453 void (*transport_complete_callback)(struct se_cmd *);
528 454
529 unsigned char *t_task_cdb; 455 unsigned char *t_task_cdb;
@@ -581,6 +507,8 @@ struct se_node_acl {
581 bool acl_stop:1; 507 bool acl_stop:1;
582 u32 queue_depth; 508 u32 queue_depth;
583 u32 acl_index; 509 u32 acl_index;
510#define MAX_ACL_TAG_SIZE 64
511 char acl_tag[MAX_ACL_TAG_SIZE];
584 u64 num_cmds; 512 u64 num_cmds;
585 u64 read_bytes; 513 u64 read_bytes;
586 u64 write_bytes; 514 u64 write_bytes;
@@ -662,15 +590,6 @@ struct se_dev_entry {
662 struct list_head ua_list; 590 struct list_head ua_list;
663}; 591};
664 592
665struct se_dev_limits {
666 /* Max supported HW queue depth */
667 u32 hw_queue_depth;
668 /* Max supported virtual queue depth */
669 u32 queue_depth;
670 /* From include/linux/blkdev.h for the other HW/SW limits. */
671 struct queue_limits limits;
672};
673
674struct se_dev_attrib { 593struct se_dev_attrib {
675 int emulate_dpo; 594 int emulate_dpo;
676 int emulate_fua_write; 595 int emulate_fua_write;
@@ -680,8 +599,6 @@ struct se_dev_attrib {
680 int emulate_tas; 599 int emulate_tas;
681 int emulate_tpu; 600 int emulate_tpu;
682 int emulate_tpws; 601 int emulate_tpws;
683 int emulate_reservations;
684 int emulate_alua;
685 int enforce_pr_isids; 602 int enforce_pr_isids;
686 int is_nonrot; 603 int is_nonrot;
687 int emulate_rest_reord; 604 int emulate_rest_reord;
@@ -696,7 +613,8 @@ struct se_dev_attrib {
696 u32 max_unmap_block_desc_count; 613 u32 max_unmap_block_desc_count;
697 u32 unmap_granularity; 614 u32 unmap_granularity;
698 u32 unmap_granularity_alignment; 615 u32 unmap_granularity_alignment;
699 struct se_subsystem_dev *da_sub_dev; 616 u32 max_write_same_len;
617 struct se_device *da_dev;
700 struct config_group da_group; 618 struct config_group da_group;
701}; 619};
702 620
@@ -707,48 +625,25 @@ struct se_dev_stat_grps {
707 struct config_group scsi_lu_group; 625 struct config_group scsi_lu_group;
708}; 626};
709 627
710struct se_subsystem_dev {
711/* Used for struct se_subsystem_dev-->se_dev_alias, must be less than PAGE_SIZE */
712#define SE_DEV_ALIAS_LEN 512
713 unsigned char se_dev_alias[SE_DEV_ALIAS_LEN];
714/* Used for struct se_subsystem_dev->se_dev_udev_path[], must be less than PAGE_SIZE */
715#define SE_UDEV_PATH_LEN 512
716 unsigned char se_dev_udev_path[SE_UDEV_PATH_LEN];
717 u32 su_dev_flags;
718 struct se_hba *se_dev_hba;
719 struct se_device *se_dev_ptr;
720 struct se_dev_attrib se_dev_attrib;
721 /* T10 Asymmetric Logical Unit Assignment for Target Ports */
722 struct t10_alua t10_alua;
723 /* T10 Inquiry and VPD WWN Information */
724 struct t10_wwn t10_wwn;
725 /* T10 SPC-2 + SPC-3 Reservations */
726 struct t10_reservation t10_pr;
727 spinlock_t se_dev_lock;
728 void *se_dev_su_ptr;
729 struct config_group se_dev_group;
730 /* For T10 Reservations */
731 struct config_group se_dev_pr_group;
732 /* For target_core_stat.c groups */
733 struct se_dev_stat_grps dev_stat_grps;
734};
735
736struct se_device { 628struct se_device {
629#define SE_DEV_LINK_MAGIC 0xfeeddeef
630 u32 dev_link_magic;
737 /* RELATIVE TARGET PORT IDENTIFER Counter */ 631 /* RELATIVE TARGET PORT IDENTIFER Counter */
738 u16 dev_rpti_counter; 632 u16 dev_rpti_counter;
739 /* Used for SAM Task Attribute ordering */ 633 /* Used for SAM Task Attribute ordering */
740 u32 dev_cur_ordered_id; 634 u32 dev_cur_ordered_id;
741 u32 dev_flags; 635 u32 dev_flags;
636#define DF_CONFIGURED 0x00000001
637#define DF_FIRMWARE_VPD_UNIT_SERIAL 0x00000002
638#define DF_EMULATED_VPD_UNIT_SERIAL 0x00000004
639#define DF_USING_UDEV_PATH 0x00000008
640#define DF_USING_ALIAS 0x00000010
742 u32 dev_port_count; 641 u32 dev_port_count;
743 /* See transport_device_status_table */
744 u32 dev_status;
745 /* Physical device queue depth */ 642 /* Physical device queue depth */
746 u32 queue_depth; 643 u32 queue_depth;
747 /* Used for SPC-2 reservations enforce of ISIDs */ 644 /* Used for SPC-2 reservations enforce of ISIDs */
748 u64 dev_res_bin_isid; 645 u64 dev_res_bin_isid;
749 t10_task_attr_index_t dev_task_attr_type;
750 /* Pointer to transport specific device structure */ 646 /* Pointer to transport specific device structure */
751 void *dev_ptr;
752 u32 dev_index; 647 u32 dev_index;
753 u64 creation_time; 648 u64 creation_time;
754 u32 num_resets; 649 u32 num_resets;
@@ -761,13 +656,13 @@ struct se_device {
761 atomic_t dev_ordered_id; 656 atomic_t dev_ordered_id;
762 atomic_t dev_ordered_sync; 657 atomic_t dev_ordered_sync;
763 atomic_t dev_qf_count; 658 atomic_t dev_qf_count;
764 struct se_obj dev_obj; 659 int export_count;
765 struct se_obj dev_access_obj;
766 struct se_obj dev_export_obj;
767 spinlock_t delayed_cmd_lock; 660 spinlock_t delayed_cmd_lock;
768 spinlock_t execute_task_lock; 661 spinlock_t execute_task_lock;
769 spinlock_t dev_reservation_lock; 662 spinlock_t dev_reservation_lock;
770 spinlock_t dev_status_lock; 663 unsigned int dev_reservation_flags;
664#define DRF_SPC2_RESERVATIONS 0x00000001
665#define DRF_SPC2_RESERVATIONS_WITH_ISID 0x00000002
771 spinlock_t se_port_lock; 666 spinlock_t se_port_lock;
772 spinlock_t se_tmr_lock; 667 spinlock_t se_tmr_lock;
773 spinlock_t qf_cmd_lock; 668 spinlock_t qf_cmd_lock;
@@ -786,7 +681,20 @@ struct se_device {
786 struct list_head qf_cmd_list; 681 struct list_head qf_cmd_list;
787 /* Pointer to associated SE HBA */ 682 /* Pointer to associated SE HBA */
788 struct se_hba *se_hba; 683 struct se_hba *se_hba;
789 struct se_subsystem_dev *se_sub_dev; 684 /* T10 Inquiry and VPD WWN Information */
685 struct t10_wwn t10_wwn;
686 /* T10 Asymmetric Logical Unit Assignment for Target Ports */
687 struct t10_alua t10_alua;
688 /* T10 SPC-2 + SPC-3 Reservations */
689 struct t10_reservation t10_pr;
690 struct se_dev_attrib dev_attrib;
691 struct config_group dev_group;
692 struct config_group dev_pr_group;
693 struct se_dev_stat_grps dev_stat_grps;
694#define SE_DEV_ALIAS_LEN 512 /* must be less than PAGE_SIZE */
695 unsigned char dev_alias[SE_DEV_ALIAS_LEN];
696#define SE_UDEV_PATH_LEN 512 /* must be less than PAGE_SIZE */
697 unsigned char udev_path[SE_UDEV_PATH_LEN];
790 /* Pointer to template of function pointers for transport */ 698 /* Pointer to template of function pointers for transport */
791 struct se_subsystem_api *transport; 699 struct se_subsystem_api *transport;
792 /* Linked list for struct se_hba struct se_device list */ 700 /* Linked list for struct se_hba struct se_device list */
@@ -803,8 +711,6 @@ struct se_hba {
803 u32 hba_index; 711 u32 hba_index;
804 /* Pointer to transport specific host structure. */ 712 /* Pointer to transport specific host structure. */
805 void *hba_ptr; 713 void *hba_ptr;
806 /* Linked list for struct se_device */
807 struct list_head hba_dev_list;
808 struct list_head hba_node; 714 struct list_head hba_node;
809 spinlock_t device_lock; 715 spinlock_t device_lock;
810 struct config_group hba_group; 716 struct config_group hba_group;
@@ -820,6 +726,8 @@ struct se_port_stat_grps {
820}; 726};
821 727
822struct se_lun { 728struct se_lun {
729#define SE_LUN_LINK_MAGIC 0xffff7771
730 u32 lun_link_magic;
823 /* See transport_lun_status_table */ 731 /* See transport_lun_status_table */
824 enum transport_lun_status_table lun_status; 732 enum transport_lun_status_table lun_status;
825 u32 lun_access; 733 u32 lun_access;
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index 81ddb4ae6c3f..aaa1ee6ab391 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -98,8 +98,8 @@ void transport_deregister_session(struct se_session *);
98 98
99void transport_init_se_cmd(struct se_cmd *, struct target_core_fabric_ops *, 99void transport_init_se_cmd(struct se_cmd *, struct target_core_fabric_ops *,
100 struct se_session *, u32, int, int, unsigned char *); 100 struct se_session *, u32, int, int, unsigned char *);
101int transport_lookup_cmd_lun(struct se_cmd *, u32); 101sense_reason_t transport_lookup_cmd_lun(struct se_cmd *, u32);
102int target_setup_cmd_from_cdb(struct se_cmd *, unsigned char *); 102sense_reason_t target_setup_cmd_from_cdb(struct se_cmd *, unsigned char *);
103int target_submit_cmd_map_sgls(struct se_cmd *, struct se_session *, 103int target_submit_cmd_map_sgls(struct se_cmd *, struct se_session *,
104 unsigned char *, unsigned char *, u32, u32, int, int, int, 104 unsigned char *, unsigned char *, u32, u32, int, int, int,
105 struct scatterlist *, u32, struct scatterlist *, u32); 105 struct scatterlist *, u32, struct scatterlist *, u32);
@@ -110,9 +110,7 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
110 void *fabric_tmr_ptr, unsigned char tm_type, 110 void *fabric_tmr_ptr, unsigned char tm_type,
111 gfp_t, unsigned int, int); 111 gfp_t, unsigned int, int);
112int transport_handle_cdb_direct(struct se_cmd *); 112int transport_handle_cdb_direct(struct se_cmd *);
113int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, 113sense_reason_t transport_generic_new_cmd(struct se_cmd *);
114 struct scatterlist *, u32, struct scatterlist *, u32);
115int transport_generic_new_cmd(struct se_cmd *);
116 114
117void target_execute_cmd(struct se_cmd *cmd); 115void target_execute_cmd(struct se_cmd *cmd);
118 116
@@ -120,7 +118,8 @@ void transport_generic_free_cmd(struct se_cmd *, int);
120 118
121bool transport_wait_for_tasks(struct se_cmd *); 119bool transport_wait_for_tasks(struct se_cmd *);
122int transport_check_aborted_status(struct se_cmd *, int); 120int transport_check_aborted_status(struct se_cmd *, int);
123int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); 121int transport_send_check_condition_and_sense(struct se_cmd *,
122 sense_reason_t, int);
124 123
125int target_put_sess_cmd(struct se_session *, struct se_cmd *); 124int target_put_sess_cmd(struct se_session *, struct se_cmd *);
126void target_sess_cmd_list_set_waiting(struct se_session *); 125void target_sess_cmd_list_set_waiting(struct se_session *);
@@ -131,7 +130,7 @@ int core_alua_check_nonop_delay(struct se_cmd *);
131int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t); 130int core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
132void core_tmr_release_req(struct se_tmr_req *); 131void core_tmr_release_req(struct se_tmr_req *);
133int transport_generic_handle_tmr(struct se_cmd *); 132int transport_generic_handle_tmr(struct se_cmd *);
134void transport_generic_request_failure(struct se_cmd *); 133void transport_generic_request_failure(struct se_cmd *, sense_reason_t);
135int transport_lookup_tmr_lun(struct se_cmd *, u32); 134int transport_lookup_tmr_lun(struct se_cmd *, u32);
136 135
137struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *, 136struct se_node_acl *core_tpg_check_initiator_node_acl(struct se_portal_group *,
@@ -143,6 +142,8 @@ int core_tpg_del_initiator_node_acl(struct se_portal_group *,
143 struct se_node_acl *, int); 142 struct se_node_acl *, int);
144int core_tpg_set_initiator_node_queue_depth(struct se_portal_group *, 143int core_tpg_set_initiator_node_queue_depth(struct se_portal_group *,
145 unsigned char *, u32, int); 144 unsigned char *, u32, int);
145int core_tpg_set_initiator_node_tag(struct se_portal_group *,
146 struct se_node_acl *, const char *);
146int core_tpg_register(struct target_core_fabric_ops *, struct se_wwn *, 147int core_tpg_register(struct target_core_fabric_ops *, struct se_wwn *,
147 struct se_portal_group *, void *, int); 148 struct se_portal_group *, void *, int);
148int core_tpg_deregister(struct se_portal_group *); 149int core_tpg_deregister(struct se_portal_group *);
diff --git a/include/trace/events/gfpflags.h b/include/trace/events/gfpflags.h
index 9391706e9254..d6fd8e5b14b7 100644
--- a/include/trace/events/gfpflags.h
+++ b/include/trace/events/gfpflags.h
@@ -36,6 +36,7 @@
36 {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ 36 {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \
37 {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"}, \ 37 {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"}, \
38 {(unsigned long)__GFP_NOTRACK, "GFP_NOTRACK"}, \ 38 {(unsigned long)__GFP_NOTRACK, "GFP_NOTRACK"}, \
39 {(unsigned long)__GFP_NO_KSWAPD, "GFP_NO_KSWAPD"}, \
39 {(unsigned long)__GFP_OTHER_NODE, "GFP_OTHER_NODE"} \ 40 {(unsigned long)__GFP_OTHER_NODE, "GFP_OTHER_NODE"} \
40 ) : "GFP_NOWAIT" 41 ) : "GFP_NOWAIT"
41 42
diff --git a/include/trace/events/oom.h b/include/trace/events/oom.h
index dd4ba3b92002..1e974983757e 100644
--- a/include/trace/events/oom.h
+++ b/include/trace/events/oom.h
@@ -14,7 +14,7 @@ TRACE_EVENT(oom_score_adj_update,
14 TP_STRUCT__entry( 14 TP_STRUCT__entry(
15 __field( pid_t, pid) 15 __field( pid_t, pid)
16 __array( char, comm, TASK_COMM_LEN ) 16 __array( char, comm, TASK_COMM_LEN )
17 __field( int, oom_score_adj) 17 __field( short, oom_score_adj)
18 ), 18 ),
19 19
20 TP_fast_assign( 20 TP_fast_assign(
@@ -23,7 +23,7 @@ TRACE_EVENT(oom_score_adj_update,
23 __entry->oom_score_adj = task->signal->oom_score_adj; 23 __entry->oom_score_adj = task->signal->oom_score_adj;
24 ), 24 ),
25 25
26 TP_printk("pid=%d comm=%s oom_score_adj=%d", 26 TP_printk("pid=%d comm=%s oom_score_adj=%hd",
27 __entry->pid, __entry->comm, __entry->oom_score_adj) 27 __entry->pid, __entry->comm, __entry->oom_score_adj)
28); 28);
29 29
diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h
index 5bde94d8585b..d4f559b1ec34 100644
--- a/include/trace/events/rcu.h
+++ b/include/trace/events/rcu.h
@@ -549,6 +549,7 @@ TRACE_EVENT(rcu_torture_read,
549 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit. 549 * "EarlyExit": rcu_barrier_callback() piggybacked, thus early exit.
550 * "Inc1": rcu_barrier_callback() piggyback check counter incremented. 550 * "Inc1": rcu_barrier_callback() piggyback check counter incremented.
551 * "Offline": rcu_barrier_callback() found offline CPU 551 * "Offline": rcu_barrier_callback() found offline CPU
552 * "OnlineNoCB": rcu_barrier_callback() found online no-CBs CPU.
552 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks. 553 * "OnlineQ": rcu_barrier_callback() found online CPU with callbacks.
553 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks. 554 * "OnlineNQ": rcu_barrier_callback() found online CPU, no callbacks.
554 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU. 555 * "IRQ": An rcu_barrier_callback() callback posted on remote CPU.
diff --git a/include/trace/events/task.h b/include/trace/events/task.h
index b53add02e929..102a646e1996 100644
--- a/include/trace/events/task.h
+++ b/include/trace/events/task.h
@@ -15,7 +15,7 @@ TRACE_EVENT(task_newtask,
15 __field( pid_t, pid) 15 __field( pid_t, pid)
16 __array( char, comm, TASK_COMM_LEN) 16 __array( char, comm, TASK_COMM_LEN)
17 __field( unsigned long, clone_flags) 17 __field( unsigned long, clone_flags)
18 __field( int, oom_score_adj) 18 __field( short, oom_score_adj)
19 ), 19 ),
20 20
21 TP_fast_assign( 21 TP_fast_assign(
@@ -25,7 +25,7 @@ TRACE_EVENT(task_newtask,
25 __entry->oom_score_adj = task->signal->oom_score_adj; 25 __entry->oom_score_adj = task->signal->oom_score_adj;
26 ), 26 ),
27 27
28 TP_printk("pid=%d comm=%s clone_flags=%lx oom_score_adj=%d", 28 TP_printk("pid=%d comm=%s clone_flags=%lx oom_score_adj=%hd",
29 __entry->pid, __entry->comm, 29 __entry->pid, __entry->comm,
30 __entry->clone_flags, __entry->oom_score_adj) 30 __entry->clone_flags, __entry->oom_score_adj)
31); 31);
@@ -40,7 +40,7 @@ TRACE_EVENT(task_rename,
40 __field( pid_t, pid) 40 __field( pid_t, pid)
41 __array( char, oldcomm, TASK_COMM_LEN) 41 __array( char, oldcomm, TASK_COMM_LEN)
42 __array( char, newcomm, TASK_COMM_LEN) 42 __array( char, newcomm, TASK_COMM_LEN)
43 __field( int, oom_score_adj) 43 __field( short, oom_score_adj)
44 ), 44 ),
45 45
46 TP_fast_assign( 46 TP_fast_assign(
@@ -50,7 +50,7 @@ TRACE_EVENT(task_rename,
50 __entry->oom_score_adj = task->signal->oom_score_adj; 50 __entry->oom_score_adj = task->signal->oom_score_adj;
51 ), 51 ),
52 52
53 TP_printk("pid=%d oldcomm=%s newcomm=%s oom_score_adj=%d", 53 TP_printk("pid=%d oldcomm=%s newcomm=%s oom_score_adj=%hd",
54 __entry->pid, __entry->oldcomm, 54 __entry->pid, __entry->oldcomm,
55 __entry->newcomm, __entry->oom_score_adj) 55 __entry->newcomm, __entry->oom_score_adj)
56); 56);
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index a763888a36f9..40dc5e8fe340 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -545,8 +545,7 @@ ftrace_raw_event_##call(void *__data, proto) \
545 { assign; } \ 545 { assign; } \
546 \ 546 \
547 if (!filter_current_check_discard(buffer, event_call, entry, event)) \ 547 if (!filter_current_check_discard(buffer, event_call, entry, event)) \
548 trace_nowake_buffer_unlock_commit(buffer, \ 548 trace_buffer_unlock_commit(buffer, event, irq_flags, pc); \
549 event, irq_flags, pc); \
550} 549}
551/* 550/*
552 * The ftrace_test_probe is compiled out, it is only here as a build time check 551 * The ftrace_test_probe is compiled out, it is only here as a build time check
@@ -620,79 +619,6 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
620 619
621#include TRACE_INCLUDE(TRACE_INCLUDE_FILE) 620#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
622 621
623/*
624 * Define the insertion callback to perf events
625 *
626 * The job is very similar to ftrace_raw_event_<call> except that we don't
627 * insert in the ring buffer but in a perf counter.
628 *
629 * static void ftrace_perf_<call>(proto)
630 * {
631 * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets;
632 * struct ftrace_event_call *event_call = &event_<call>;
633 * extern void perf_tp_event(int, u64, u64, void *, int);
634 * struct ftrace_raw_##call *entry;
635 * struct perf_trace_buf *trace_buf;
636 * u64 __addr = 0, __count = 1;
637 * unsigned long irq_flags;
638 * struct trace_entry *ent;
639 * int __entry_size;
640 * int __data_size;
641 * int __cpu
642 * int pc;
643 *
644 * pc = preempt_count();
645 *
646 * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args);
647 *
648 * // Below we want to get the aligned size by taking into account
649 * // the u32 field that will later store the buffer size
650 * __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),
651 * sizeof(u64));
652 * __entry_size -= sizeof(u32);
653 *
654 * // Protect the non nmi buffer
655 * // This also protects the rcu read side
656 * local_irq_save(irq_flags);
657 * __cpu = smp_processor_id();
658 *
659 * if (in_nmi())
660 * trace_buf = rcu_dereference_sched(perf_trace_buf_nmi);
661 * else
662 * trace_buf = rcu_dereference_sched(perf_trace_buf);
663 *
664 * if (!trace_buf)
665 * goto end;
666 *
667 * trace_buf = per_cpu_ptr(trace_buf, __cpu);
668 *
669 * // Avoid recursion from perf that could mess up the buffer
670 * if (trace_buf->recursion++)
671 * goto end_recursion;
672 *
673 * raw_data = trace_buf->buf;
674 *
675 * // Make recursion update visible before entering perf_tp_event
676 * // so that we protect from perf recursions.
677 *
678 * barrier();
679 *
680 * //zero dead bytes from alignment to avoid stack leak to userspace:
681 * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL;
682 * entry = (struct ftrace_raw_<call> *)raw_data;
683 * ent = &entry->ent;
684 * tracing_generic_entry_update(ent, irq_flags, pc);
685 * ent->type = event_call->id;
686 *
687 * <tstruct> <- do some jobs with dynamic arrays
688 *
689 * <assign> <- affect our values
690 *
691 * perf_tp_event(event_call->id, __addr, __count, entry,
692 * __entry_size); <- submit them to perf counter
693 *
694 * }
695 */
696 622
697#ifdef CONFIG_PERF_EVENTS 623#ifdef CONFIG_PERF_EVENTS
698 624
diff --git a/include/trace/syscall.h b/include/trace/syscall.h
index 31966a4fb8cc..84bc4197e736 100644
--- a/include/trace/syscall.h
+++ b/include/trace/syscall.h
@@ -31,27 +31,4 @@ struct syscall_metadata {
31 struct ftrace_event_call *exit_event; 31 struct ftrace_event_call *exit_event;
32}; 32};
33 33
34#ifdef CONFIG_FTRACE_SYSCALLS
35extern unsigned long arch_syscall_addr(int nr);
36extern int init_syscall_trace(struct ftrace_event_call *call);
37
38extern int reg_event_syscall_enter(struct ftrace_event_call *call);
39extern void unreg_event_syscall_enter(struct ftrace_event_call *call);
40extern int reg_event_syscall_exit(struct ftrace_event_call *call);
41extern void unreg_event_syscall_exit(struct ftrace_event_call *call);
42extern int
43ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s);
44enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags,
45 struct trace_event *event);
46enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags,
47 struct trace_event *event);
48#endif
49
50#ifdef CONFIG_PERF_EVENTS
51int perf_sysenter_enable(struct ftrace_event_call *call);
52void perf_sysenter_disable(struct ftrace_event_call *call);
53int perf_sysexit_enable(struct ftrace_event_call *call);
54void perf_sysexit_disable(struct ftrace_event_call *call);
55#endif
56
57#endif /* _TRACE_SYSCALL_H */ 34#endif /* _TRACE_SYSCALL_H */
diff --git a/include/uapi/asm-generic/ioctls.h b/include/uapi/asm-generic/ioctls.h
index 199975fac395..143dacbb7d9a 100644
--- a/include/uapi/asm-generic/ioctls.h
+++ b/include/uapi/asm-generic/ioctls.h
@@ -74,6 +74,9 @@
74#define TCSETXW 0x5435 74#define TCSETXW 0x5435
75#define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */ 75#define TIOCSIG _IOW('T', 0x36, int) /* pty: generate signal */
76#define TIOCVHANGUP 0x5437 76#define TIOCVHANGUP 0x5437
77#define TIOCGPKT _IOR('T', 0x38, int) /* Get packet mode state */
78#define TIOCGPTLCK _IOR('T', 0x39, int) /* Get Pty lock state */
79#define TIOCGEXCL _IOR('T', 0x40, int) /* Get exclusive mode state */
77 80
78#define FIONCLEX 0x5450 81#define FIONCLEX 0x5450
79#define FIOCLEX 0x5451 82#define FIOCLEX 0x5451
diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h
index d030d2c2647a..4164529a94f9 100644
--- a/include/uapi/asm-generic/mman-common.h
+++ b/include/uapi/asm-generic/mman-common.h
@@ -55,4 +55,15 @@
55/* compatibility flags */ 55/* compatibility flags */
56#define MAP_FILE 0 56#define MAP_FILE 0
57 57
58/*
59 * When MAP_HUGETLB is set bits [26:31] encode the log2 of the huge page size.
60 * This gives us 6 bits, which is enough until someone invents 128 bit address
61 * spaces.
62 *
63 * Assume these are all power of twos.
64 * When 0 use the default page size.
65 */
66#define MAP_HUGE_SHIFT 26
67#define MAP_HUGE_MASK 0x3f
68
58#endif /* __ASM_GENERIC_MMAN_COMMON_H */ 69#endif /* __ASM_GENERIC_MMAN_COMMON_H */
diff --git a/include/uapi/asm-generic/mman.h b/include/uapi/asm-generic/mman.h
index 32c8bd6a196d..e9fe6fd2a074 100644
--- a/include/uapi/asm-generic/mman.h
+++ b/include/uapi/asm-generic/mman.h
@@ -13,6 +13,8 @@
13#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ 13#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */
14#define MAP_HUGETLB 0x40000 /* create a huge page mapping */ 14#define MAP_HUGETLB 0x40000 /* create a huge page mapping */
15 15
16/* Bits [26:31] are reserved, see mman-common.h for MAP_HUGETLB usage */
17
16#define MCL_CURRENT 1 /* lock all current mappings */ 18#define MCL_CURRENT 1 /* lock all current mappings */
17#define MCL_FUTURE 2 /* lock all future mappings */ 19#define MCL_FUTURE 2 /* lock all future mappings */
18 20
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index b1bea03274d5..2d32d073a6f9 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -43,6 +43,7 @@
43/* Socket filtering */ 43/* Socket filtering */
44#define SO_ATTACH_FILTER 26 44#define SO_ATTACH_FILTER 26
45#define SO_DETACH_FILTER 27 45#define SO_DETACH_FILTER 27
46#define SO_GET_FILTER SO_ATTACH_FILTER
46 47
47#define SO_PEERNAME 28 48#define SO_PEERNAME 28
48#define SO_TIMESTAMP 29 49#define SO_TIMESTAMP 29
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index e194387ef784..4e67194fd2c3 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -258,6 +258,7 @@ header-y += neighbour.h
258header-y += net.h 258header-y += net.h
259header-y += net_dropmon.h 259header-y += net_dropmon.h
260header-y += net_tstamp.h 260header-y += net_tstamp.h
261header-y += netconf.h
261header-y += netdevice.h 262header-y += netdevice.h
262header-y += netfilter.h 263header-y += netfilter.h
263header-y += netfilter_arp.h 264header-y += netfilter_arp.h
@@ -415,3 +416,4 @@ header-y += wireless.h
415header-y += x25.h 416header-y += x25.h
416header-y += xattr.h 417header-y += xattr.h
417header-y += xfrm.h 418header-y += xfrm.h
419header-y += hw_breakpoint.h
diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
index d3eaaaf1009e..0c9b44871df0 100644
--- a/include/uapi/linux/ethtool.h
+++ b/include/uapi/linux/ethtool.h
@@ -500,13 +500,26 @@ union ethtool_flow_union {
500 struct ethtool_ah_espip4_spec esp_ip4_spec; 500 struct ethtool_ah_espip4_spec esp_ip4_spec;
501 struct ethtool_usrip4_spec usr_ip4_spec; 501 struct ethtool_usrip4_spec usr_ip4_spec;
502 struct ethhdr ether_spec; 502 struct ethhdr ether_spec;
503 __u8 hdata[60]; 503 __u8 hdata[52];
504}; 504};
505 505
506/**
507 * struct ethtool_flow_ext - additional RX flow fields
508 * @h_dest: destination MAC address
509 * @vlan_etype: VLAN EtherType
510 * @vlan_tci: VLAN tag control information
511 * @data: user defined data
512 *
513 * Note, @vlan_etype, @vlan_tci, and @data are only valid if %FLOW_EXT
514 * is set in &struct ethtool_rx_flow_spec @flow_type.
515 * @h_dest is valid if %FLOW_MAC_EXT is set.
516 */
506struct ethtool_flow_ext { 517struct ethtool_flow_ext {
507 __be16 vlan_etype; 518 __u8 padding[2];
508 __be16 vlan_tci; 519 unsigned char h_dest[ETH_ALEN];
509 __be32 data[2]; 520 __be16 vlan_etype;
521 __be16 vlan_tci;
522 __be32 data[2];
510}; 523};
511 524
512/** 525/**
@@ -517,7 +530,8 @@ struct ethtool_flow_ext {
517 * @m_u: Masks for flow field bits to be matched 530 * @m_u: Masks for flow field bits to be matched
518 * @m_ext: Masks for additional field bits to be matched 531 * @m_ext: Masks for additional field bits to be matched
519 * Note, all additional fields must be ignored unless @flow_type 532 * Note, all additional fields must be ignored unless @flow_type
520 * includes the %FLOW_EXT flag. 533 * includes the %FLOW_EXT or %FLOW_MAC_EXT flag
534 * (see &struct ethtool_flow_ext description).
521 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC 535 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
522 * if packets should be discarded 536 * if packets should be discarded
523 * @location: Location of rule in the table. Locations must be 537 * @location: Location of rule in the table. Locations must be
@@ -1027,6 +1041,7 @@ enum ethtool_sfeatures_retval_bits {
1027#define ETHER_FLOW 0x12 /* spec only (ether_spec) */ 1041#define ETHER_FLOW 0x12 /* spec only (ether_spec) */
1028/* Flag to enable additional fields in struct ethtool_rx_flow_spec */ 1042/* Flag to enable additional fields in struct ethtool_rx_flow_spec */
1029#define FLOW_EXT 0x80000000 1043#define FLOW_EXT 0x80000000
1044#define FLOW_MAC_EXT 0x40000000
1030 1045
1031/* L3-L4 network traffic flow hash options */ 1046/* L3-L4 network traffic flow hash options */
1032#define RXH_L2DA (1 << 1) 1047#define RXH_L2DA (1 << 1)
diff --git a/include/uapi/linux/filter.h b/include/uapi/linux/filter.h
index 3d7922433aba..9cfde6941099 100644
--- a/include/uapi/linux/filter.h
+++ b/include/uapi/linux/filter.h
@@ -127,7 +127,9 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
127#define SKF_AD_RXHASH 32 127#define SKF_AD_RXHASH 32
128#define SKF_AD_CPU 36 128#define SKF_AD_CPU 36
129#define SKF_AD_ALU_XOR_X 40 129#define SKF_AD_ALU_XOR_X 40
130#define SKF_AD_MAX 44 130#define SKF_AD_VLAN_TAG 44
131#define SKF_AD_VLAN_TAG_PRESENT 48
132#define SKF_AD_MAX 52
131#define SKF_NET_OFF (-0x100000) 133#define SKF_NET_OFF (-0x100000)
132#define SKF_LL_OFF (-0x200000) 134#define SKF_LL_OFF (-0x200000)
133 135
diff --git a/include/uapi/linux/hdlc/Kbuild b/include/uapi/linux/hdlc/Kbuild
index aafaa5aa54d4..8c1d2cb75e33 100644
--- a/include/uapi/linux/hdlc/Kbuild
+++ b/include/uapi/linux/hdlc/Kbuild
@@ -1 +1,2 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += ioctl.h
diff --git a/include/linux/hdlc/ioctl.h b/include/uapi/linux/hdlc/ioctl.h
index 583972364357..04bc0274a189 100644
--- a/include/linux/hdlc/ioctl.h
+++ b/include/uapi/linux/hdlc/ioctl.h
@@ -34,13 +34,15 @@
34#define LMI_CCITT 3 /* ITU-T Annex A */ 34#define LMI_CCITT 3 /* ITU-T Annex A */
35#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ 35#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */
36 36
37typedef struct { 37#ifndef __ASSEMBLY__
38
39typedef struct {
38 unsigned int clock_rate; /* bits per second */ 40 unsigned int clock_rate; /* bits per second */
39 unsigned int clock_type; /* internal, external, TX-internal etc. */ 41 unsigned int clock_type; /* internal, external, TX-internal etc. */
40 unsigned short loopback; 42 unsigned short loopback;
41} sync_serial_settings; /* V.35, V.24, X.21 */ 43} sync_serial_settings; /* V.35, V.24, X.21 */
42 44
43typedef struct { 45typedef struct {
44 unsigned int clock_rate; /* bits per second */ 46 unsigned int clock_rate; /* bits per second */
45 unsigned int clock_type; /* internal, external, TX-internal etc. */ 47 unsigned int clock_type; /* internal, external, TX-internal etc. */
46 unsigned short loopback; 48 unsigned short loopback;
@@ -78,4 +80,5 @@ typedef struct {
78 80
79/* PPP doesn't need any info now - supply length = 0 to ioctl */ 81/* PPP doesn't need any info now - supply length = 0 to ioctl */
80 82
83#endif /* __ASSEMBLY__ */
81#endif /* __HDLC_IOCTL_H__ */ 84#endif /* __HDLC_IOCTL_H__ */
diff --git a/include/uapi/linux/hw_breakpoint.h b/include/uapi/linux/hw_breakpoint.h
new file mode 100644
index 000000000000..b04000a2296a
--- /dev/null
+++ b/include/uapi/linux/hw_breakpoint.h
@@ -0,0 +1,30 @@
1#ifndef _UAPI_LINUX_HW_BREAKPOINT_H
2#define _UAPI_LINUX_HW_BREAKPOINT_H
3
4enum {
5 HW_BREAKPOINT_LEN_1 = 1,
6 HW_BREAKPOINT_LEN_2 = 2,
7 HW_BREAKPOINT_LEN_4 = 4,
8 HW_BREAKPOINT_LEN_8 = 8,
9};
10
11enum {
12 HW_BREAKPOINT_EMPTY = 0,
13 HW_BREAKPOINT_R = 1,
14 HW_BREAKPOINT_W = 2,
15 HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W,
16 HW_BREAKPOINT_X = 4,
17 HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
18};
19
20enum bp_type_idx {
21 TYPE_INST = 0,
22#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
23 TYPE_DATA = 0,
24#else
25 TYPE_DATA = 1,
26#endif
27 TYPE_MAX
28};
29
30#endif /* _UAPI_LINUX_HW_BREAKPOINT_H */
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
index a8fe9549ddbc..afbb18a0227c 100644
--- a/include/uapi/linux/if_bridge.h
+++ b/include/uapi/linux/if_bridge.h
@@ -97,5 +97,86 @@ struct __fdb_entry {
97 __u16 unused; 97 __u16 unused;
98}; 98};
99 99
100/* Bridge Flags */
101#define BRIDGE_FLAGS_MASTER 1 /* Bridge command to/from master */
102#define BRIDGE_FLAGS_SELF 2 /* Bridge command to/from lowerdev */
103
104#define BRIDGE_MODE_VEB 0 /* Default loopback mode */
105#define BRIDGE_MODE_VEPA 1 /* 802.1Qbg defined VEPA mode */
106
107/* Bridge management nested attributes
108 * [IFLA_AF_SPEC] = {
109 * [IFLA_BRIDGE_FLAGS]
110 * [IFLA_BRIDGE_MODE]
111 * }
112 */
113enum {
114 IFLA_BRIDGE_FLAGS,
115 IFLA_BRIDGE_MODE,
116 __IFLA_BRIDGE_MAX,
117};
118#define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1)
119
120/* Bridge multicast database attributes
121 * [MDBA_MDB] = {
122 * [MDBA_MDB_ENTRY] = {
123 * [MDBA_MDB_ENTRY_INFO]
124 * }
125 * }
126 * [MDBA_ROUTER] = {
127 * [MDBA_ROUTER_PORT]
128 * }
129 */
130enum {
131 MDBA_UNSPEC,
132 MDBA_MDB,
133 MDBA_ROUTER,
134 __MDBA_MAX,
135};
136#define MDBA_MAX (__MDBA_MAX - 1)
137
138enum {
139 MDBA_MDB_UNSPEC,
140 MDBA_MDB_ENTRY,
141 __MDBA_MDB_MAX,
142};
143#define MDBA_MDB_MAX (__MDBA_MDB_MAX - 1)
144
145enum {
146 MDBA_MDB_ENTRY_UNSPEC,
147 MDBA_MDB_ENTRY_INFO,
148 __MDBA_MDB_ENTRY_MAX,
149};
150#define MDBA_MDB_ENTRY_MAX (__MDBA_MDB_ENTRY_MAX - 1)
151
152enum {
153 MDBA_ROUTER_UNSPEC,
154 MDBA_ROUTER_PORT,
155 __MDBA_ROUTER_MAX,
156};
157#define MDBA_ROUTER_MAX (__MDBA_ROUTER_MAX - 1)
158
159struct br_port_msg {
160 __u8 family;
161 __u32 ifindex;
162};
163
164struct br_mdb_entry {
165 __u32 ifindex;
166 struct {
167 union {
168 __be32 ip4;
169 struct in6_addr ip6;
170 } u;
171 __be16 proto;
172 } addr;
173};
174
175enum {
176 MDBA_SET_ENTRY_UNSPEC,
177 MDBA_SET_ENTRY,
178 __MDBA_SET_ENTRY_MAX,
179};
180#define MDBA_SET_ENTRY_MAX (__MDBA_SET_ENTRY_MAX - 1)
100 181
101#endif /* _UAPI_LINUX_IF_BRIDGE_H */ 182#endif /* _UAPI_LINUX_IF_BRIDGE_H */
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
index 0343e1f0582c..67fb87ca1094 100644
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
@@ -48,6 +48,7 @@
48#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */ 48#define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */
49#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ 49#define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */
50#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */ 50#define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */
51#define ETH_P_BATMAN 0x4305 /* B.A.T.M.A.N.-Advanced packet [ NOT AN OFFICIALLY REGISTERED ID ] */
51#define ETH_P_DEC 0x6000 /* DEC Assigned proto */ 52#define ETH_P_DEC 0x6000 /* DEC Assigned proto */
52#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */ 53#define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */
53#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */ 54#define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
index 5c80cb11518b..60f3b6b90602 100644
--- a/include/uapi/linux/if_link.h
+++ b/include/uapi/linux/if_link.h
@@ -205,6 +205,24 @@ enum {
205 205
206#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) 206#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
207 207
208enum {
209 BRIDGE_MODE_UNSPEC,
210 BRIDGE_MODE_HAIRPIN,
211};
212
213enum {
214 IFLA_BRPORT_UNSPEC,
215 IFLA_BRPORT_STATE, /* Spanning tree state */
216 IFLA_BRPORT_PRIORITY, /* " priority */
217 IFLA_BRPORT_COST, /* " cost */
218 IFLA_BRPORT_MODE, /* mode (hairpin) */
219 IFLA_BRPORT_GUARD, /* bpdu guard */
220 IFLA_BRPORT_PROTECT, /* root port protection */
221 IFLA_BRPORT_FAST_LEAVE, /* multicast fast leave */
222 __IFLA_BRPORT_MAX
223};
224#define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
225
208struct ifla_cacheinfo { 226struct ifla_cacheinfo {
209 __u32 max_reasm_len; 227 __u32 max_reasm_len;
210 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ 228 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
@@ -285,6 +303,10 @@ enum {
285 IFLA_VXLAN_AGEING, 303 IFLA_VXLAN_AGEING,
286 IFLA_VXLAN_LIMIT, 304 IFLA_VXLAN_LIMIT,
287 IFLA_VXLAN_PORT_RANGE, 305 IFLA_VXLAN_PORT_RANGE,
306 IFLA_VXLAN_PROXY,
307 IFLA_VXLAN_RSC,
308 IFLA_VXLAN_L2MISS,
309 IFLA_VXLAN_L3MISS,
288 __IFLA_VXLAN_MAX 310 __IFLA_VXLAN_MAX
289}; 311};
290#define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) 312#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 f3799295d231..f9a60375f0d0 100644
--- a/include/uapi/linux/if_packet.h
+++ b/include/uapi/linux/if_packet.h
@@ -50,6 +50,7 @@ struct sockaddr_ll {
50#define PACKET_TX_TIMESTAMP 16 50#define PACKET_TX_TIMESTAMP 16
51#define PACKET_TIMESTAMP 17 51#define PACKET_TIMESTAMP 17
52#define PACKET_FANOUT 18 52#define PACKET_FANOUT 18
53#define PACKET_TX_HAS_OFF 19
53 54
54#define PACKET_FANOUT_HASH 0 55#define PACKET_FANOUT_HASH 0
55#define PACKET_FANOUT_LB 1 56#define PACKET_FANOUT_LB 1
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
index 25a585ce23e6..2835b85fd46d 100644
--- a/include/uapi/linux/if_tun.h
+++ b/include/uapi/linux/if_tun.h
@@ -31,9 +31,11 @@
31#define TUN_FASYNC 0x0010 31#define TUN_FASYNC 0x0010
32#define TUN_NOCHECKSUM 0x0020 32#define TUN_NOCHECKSUM 0x0020
33#define TUN_NO_PI 0x0040 33#define TUN_NO_PI 0x0040
34/* This flag has no real effect */
34#define TUN_ONE_QUEUE 0x0080 35#define TUN_ONE_QUEUE 0x0080
35#define TUN_PERSIST 0x0100 36#define TUN_PERSIST 0x0100
36#define TUN_VNET_HDR 0x0200 37#define TUN_VNET_HDR 0x0200
38#define TUN_TAP_MQ 0x0400
37 39
38/* Ioctl defines */ 40/* Ioctl defines */
39#define TUNSETNOCSUM _IOW('T', 200, int) 41#define TUNSETNOCSUM _IOW('T', 200, int)
@@ -53,14 +55,19 @@
53#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) 55#define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog)
54#define TUNGETVNETHDRSZ _IOR('T', 215, int) 56#define TUNGETVNETHDRSZ _IOR('T', 215, int)
55#define TUNSETVNETHDRSZ _IOW('T', 216, int) 57#define TUNSETVNETHDRSZ _IOW('T', 216, int)
58#define TUNSETQUEUE _IOW('T', 217, int)
56 59
57/* TUNSETIFF ifr flags */ 60/* TUNSETIFF ifr flags */
58#define IFF_TUN 0x0001 61#define IFF_TUN 0x0001
59#define IFF_TAP 0x0002 62#define IFF_TAP 0x0002
60#define IFF_NO_PI 0x1000 63#define IFF_NO_PI 0x1000
64/* This flag has no real effect */
61#define IFF_ONE_QUEUE 0x2000 65#define IFF_ONE_QUEUE 0x2000
62#define IFF_VNET_HDR 0x4000 66#define IFF_VNET_HDR 0x4000
63#define IFF_TUN_EXCL 0x8000 67#define IFF_TUN_EXCL 0x8000
68#define IFF_MULTI_QUEUE 0x0100
69#define IFF_ATTACH_QUEUE 0x0200
70#define IFF_DETACH_QUEUE 0x0400
64 71
65/* Features for GSO (TUNSETOFFLOAD). */ 72/* Features for GSO (TUNSETOFFLOAD). */
66#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ 73#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h
index 5db5942575fe..aee73d0611fb 100644
--- a/include/uapi/linux/if_tunnel.h
+++ b/include/uapi/linux/if_tunnel.h
@@ -37,6 +37,26 @@ struct ip_tunnel_parm {
37 struct iphdr iph; 37 struct iphdr iph;
38}; 38};
39 39
40enum {
41 IFLA_IPTUN_UNSPEC,
42 IFLA_IPTUN_LINK,
43 IFLA_IPTUN_LOCAL,
44 IFLA_IPTUN_REMOTE,
45 IFLA_IPTUN_TTL,
46 IFLA_IPTUN_TOS,
47 IFLA_IPTUN_ENCAP_LIMIT,
48 IFLA_IPTUN_FLOWINFO,
49 IFLA_IPTUN_FLAGS,
50 IFLA_IPTUN_PROTO,
51 IFLA_IPTUN_PMTUDISC,
52 IFLA_IPTUN_6RD_PREFIX,
53 IFLA_IPTUN_6RD_RELAY_PREFIX,
54 IFLA_IPTUN_6RD_PREFIXLEN,
55 IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
56 __IFLA_IPTUN_MAX,
57};
58#define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1)
59
40/* SIT-mode i_flags */ 60/* SIT-mode i_flags */
41#define SIT_ISATAP 0x0001 61#define SIT_ISATAP 0x0001
42 62
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h
index 1e3159989958..f79c3721da6e 100644
--- a/include/uapi/linux/in6.h
+++ b/include/uapi/linux/in6.h
@@ -240,6 +240,7 @@ struct in6_flowlabel_req {
240 * 240 *
241 * IP6T_SO_GET_REVISION_MATCH 68 241 * IP6T_SO_GET_REVISION_MATCH 68
242 * IP6T_SO_GET_REVISION_TARGET 69 242 * IP6T_SO_GET_REVISION_TARGET 69
243 * IP6T_SO_ORIGINAL_DST 80
243 */ 244 */
244 245
245/* RFC5014: Source address selection */ 246/* RFC5014: Source address selection */
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h
index 8c469af939aa..bbde90fa5838 100644
--- a/include/uapi/linux/inet_diag.h
+++ b/include/uapi/linux/inet_diag.h
@@ -109,9 +109,10 @@ enum {
109 INET_DIAG_TOS, 109 INET_DIAG_TOS,
110 INET_DIAG_TCLASS, 110 INET_DIAG_TCLASS,
111 INET_DIAG_SKMEMINFO, 111 INET_DIAG_SKMEMINFO,
112 INET_DIAG_SHUTDOWN,
112}; 113};
113 114
114#define INET_DIAG_MAX INET_DIAG_SKMEMINFO 115#define INET_DIAG_MAX INET_DIAG_SHUTDOWN
115 116
116 117
117/* INET_DIAG_MEM */ 118/* INET_DIAG_MEM */
diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h
index 558828590a69..935119c698ac 100644
--- a/include/uapi/linux/input.h
+++ b/include/uapi/linux/input.h
@@ -851,6 +851,7 @@ struct input_keymap_entry {
851#define MSC_GESTURE 0x02 851#define MSC_GESTURE 0x02
852#define MSC_RAW 0x03 852#define MSC_RAW 0x03
853#define MSC_SCAN 0x04 853#define MSC_SCAN 0x04
854#define MSC_TIMESTAMP 0x05
854#define MSC_MAX 0x07 855#define MSC_MAX 0x07
855#define MSC_CNT (MSC_MAX+1) 856#define MSC_CNT (MSC_MAX+1)
856 857
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index a6d7d1c536c3..5a2991cf0251 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -157,6 +157,7 @@ enum {
157 DEVCONF_DISABLE_IPV6, 157 DEVCONF_DISABLE_IPV6,
158 DEVCONF_ACCEPT_DAD, 158 DEVCONF_ACCEPT_DAD,
159 DEVCONF_FORCE_TLLAO, 159 DEVCONF_FORCE_TLLAO,
160 DEVCONF_NDISC_NOTIFY,
160 DEVCONF_MAX 161 DEVCONF_MAX
161}; 162};
162 163
diff --git a/include/uapi/linux/ipv6_route.h b/include/uapi/linux/ipv6_route.h
index 0459664c2636..2be7bd174751 100644
--- a/include/uapi/linux/ipv6_route.h
+++ b/include/uapi/linux/ipv6_route.h
@@ -55,4 +55,7 @@ struct in6_rtmsg {
55#define RTMSG_NEWROUTE 0x21 55#define RTMSG_NEWROUTE 0x21
56#define RTMSG_DELROUTE 0x22 56#define RTMSG_DELROUTE 0x22
57 57
58#define IP6_RT_PRIO_USER 1024
59#define IP6_RT_PRIO_ADDRCONF 256
60
58#endif /* _UAPI_LINUX_IPV6_ROUTE_H */ 61#endif /* _UAPI_LINUX_IPV6_ROUTE_H */
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 0a6d6ba44c85..e6e5d4b13708 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -167,10 +167,15 @@ struct kvm_pit_config {
167#define KVM_EXIT_OSI 18 167#define KVM_EXIT_OSI 18
168#define KVM_EXIT_PAPR_HCALL 19 168#define KVM_EXIT_PAPR_HCALL 19
169#define KVM_EXIT_S390_UCONTROL 20 169#define KVM_EXIT_S390_UCONTROL 20
170#define KVM_EXIT_WATCHDOG 21
170 171
171/* For KVM_EXIT_INTERNAL_ERROR */ 172/* For KVM_EXIT_INTERNAL_ERROR */
172#define KVM_INTERNAL_ERROR_EMULATION 1 173/* Emulate instruction failed. */
173#define KVM_INTERNAL_ERROR_SIMUL_EX 2 174#define KVM_INTERNAL_ERROR_EMULATION 1
175/* Encounter unexpected simultaneous exceptions. */
176#define KVM_INTERNAL_ERROR_SIMUL_EX 2
177/* Encounter unexpected vm-exit due to delivery event. */
178#define KVM_INTERNAL_ERROR_DELIVERY_EV 3
174 179
175/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ 180/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
176struct kvm_run { 181struct kvm_run {
@@ -477,6 +482,8 @@ struct kvm_ppc_smmu_info {
477 struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ]; 482 struct kvm_ppc_one_seg_page_size sps[KVM_PPC_PAGE_SIZES_MAX_SZ];
478}; 483};
479 484
485#define KVM_PPC_PVINFO_FLAGS_EV_IDLE (1<<0)
486
480#define KVMIO 0xAE 487#define KVMIO 0xAE
481 488
482/* machine type bits, to be used as argument to KVM_CREATE_VM */ 489/* machine type bits, to be used as argument to KVM_CREATE_VM */
@@ -626,6 +633,8 @@ struct kvm_ppc_smmu_info {
626#define KVM_CAP_READONLY_MEM 81 633#define KVM_CAP_READONLY_MEM 81
627#endif 634#endif
628#define KVM_CAP_IRQFD_RESAMPLE 82 635#define KVM_CAP_IRQFD_RESAMPLE 82
636#define KVM_CAP_PPC_BOOKE_WATCHDOG 83
637#define KVM_CAP_PPC_HTAB_FD 84
629 638
630#ifdef KVM_CAP_IRQ_ROUTING 639#ifdef KVM_CAP_IRQ_ROUTING
631 640
@@ -848,6 +857,11 @@ struct kvm_s390_ucas_mapping {
848#define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info) 857#define KVM_PPC_GET_SMMU_INFO _IOR(KVMIO, 0xa6, struct kvm_ppc_smmu_info)
849/* Available with KVM_CAP_PPC_ALLOC_HTAB */ 858/* Available with KVM_CAP_PPC_ALLOC_HTAB */
850#define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32) 859#define KVM_PPC_ALLOCATE_HTAB _IOWR(KVMIO, 0xa7, __u32)
860#define KVM_CREATE_SPAPR_TCE _IOW(KVMIO, 0xa8, struct kvm_create_spapr_tce)
861/* Available with KVM_CAP_RMA */
862#define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma)
863/* Available with KVM_CAP_PPC_HTAB_FD */
864#define KVM_PPC_GET_HTAB_FD _IOW(KVMIO, 0xaa, struct kvm_get_htab_fd)
851 865
852/* 866/*
853 * ioctls for vcpu fds 867 * ioctls for vcpu fds
@@ -911,9 +925,6 @@ struct kvm_s390_ucas_mapping {
911/* Available with KVM_CAP_XCRS */ 925/* Available with KVM_CAP_XCRS */
912#define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs) 926#define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs)
913#define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs) 927#define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs)
914#define KVM_CREATE_SPAPR_TCE _IOW(KVMIO, 0xa8, struct kvm_create_spapr_tce)
915/* Available with KVM_CAP_RMA */
916#define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma)
917/* Available with KVM_CAP_SW_TLB */ 928/* Available with KVM_CAP_SW_TLB */
918#define KVM_DIRTY_TLB _IOW(KVMIO, 0xaa, struct kvm_dirty_tlb) 929#define KVM_DIRTY_TLB _IOW(KVMIO, 0xaa, struct kvm_dirty_tlb)
919/* Available with KVM_CAP_ONE_REG */ 930/* Available with KVM_CAP_ONE_REG */
diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h
index e15192cb9cf4..12f68c7ceba6 100644
--- a/include/uapi/linux/magic.h
+++ b/include/uapi/linux/magic.h
@@ -27,6 +27,7 @@
27#define ISOFS_SUPER_MAGIC 0x9660 27#define ISOFS_SUPER_MAGIC 0x9660
28#define JFFS2_SUPER_MAGIC 0x72b6 28#define JFFS2_SUPER_MAGIC 0x72b6
29#define PSTOREFS_MAGIC 0x6165676C 29#define PSTOREFS_MAGIC 0x6165676C
30#define EFIVARFS_MAGIC 0xde5e81e4
30 31
31#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */ 32#define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */
32#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */ 33#define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */
diff --git a/include/uapi/linux/netconf.h b/include/uapi/linux/netconf.h
new file mode 100644
index 000000000000..64804a798b0c
--- /dev/null
+++ b/include/uapi/linux/netconf.h
@@ -0,0 +1,24 @@
1#ifndef _UAPI_LINUX_NETCONF_H_
2#define _UAPI_LINUX_NETCONF_H_
3
4#include <linux/types.h>
5#include <linux/netlink.h>
6
7struct netconfmsg {
8 __u8 ncm_family;
9};
10
11enum {
12 NETCONFA_UNSPEC,
13 NETCONFA_IFINDEX,
14 NETCONFA_FORWARDING,
15 NETCONFA_RP_FILTER,
16 NETCONFA_MC_FORWARDING,
17 __NETCONFA_MAX
18};
19#define NETCONFA_MAX (__NETCONFA_MAX - 1)
20
21#define NETCONFA_IFINDEX_ALL -1
22#define NETCONFA_IFINDEX_DEFAULT -2
23
24#endif /* _UAPI_LINUX_NETCONF_H_ */
diff --git a/include/uapi/linux/netfilter/nfnetlink_conntrack.h b/include/uapi/linux/netfilter/nfnetlink_conntrack.h
index 43bfe3e1685b..86e930cf3dfb 100644
--- a/include/uapi/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/uapi/linux/netfilter/nfnetlink_conntrack.h
@@ -9,6 +9,8 @@ enum cntl_msg_types {
9 IPCTNL_MSG_CT_GET_CTRZERO, 9 IPCTNL_MSG_CT_GET_CTRZERO,
10 IPCTNL_MSG_CT_GET_STATS_CPU, 10 IPCTNL_MSG_CT_GET_STATS_CPU,
11 IPCTNL_MSG_CT_GET_STATS, 11 IPCTNL_MSG_CT_GET_STATS,
12 IPCTNL_MSG_CT_GET_DYING,
13 IPCTNL_MSG_CT_GET_UNCONFIRMED,
12 14
13 IPCTNL_MSG_MAX 15 IPCTNL_MSG_MAX
14}; 16};
diff --git a/include/uapi/linux/netfilter_ipv6/ip6_tables.h b/include/uapi/linux/netfilter_ipv6/ip6_tables.h
index bf1ef65cc582..649c68062dca 100644
--- a/include/uapi/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/uapi/linux/netfilter_ipv6/ip6_tables.h
@@ -178,6 +178,9 @@ struct ip6t_error {
178#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) 178#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
179#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET 179#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
180 180
181/* obtain original address if REDIRECT'd connection */
182#define IP6T_SO_ORIGINAL_DST 80
183
181/* ICMP matching stuff */ 184/* ICMP matching stuff */
182struct ip6t_icmp { 185struct ip6t_icmp {
183 __u8 type; /* type to match */ 186 __u8 type; /* type to match */
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h
index d908d17da56d..0e63cee8d810 100644
--- a/include/uapi/linux/nfc.h
+++ b/include/uapi/linux/nfc.h
@@ -60,6 +60,13 @@
60 * target mode. 60 * target mode.
61 * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated 61 * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated
62 * from target mode. 62 * from target mode.
63 * @NFC_CMD_LLC_GET_PARAMS: request LTO, RW, and MIUX parameters for a device
64 * @NFC_CMD_LLC_SET_PARAMS: set one or more of LTO, RW, and MIUX parameters for
65 * a device. LTO must be set before the link is up otherwise -EINPROGRESS
66 * is returned. RW and MIUX can be set at anytime and will be passed in
67 * subsequent CONNECT and CC messages.
68 * If one of the passed parameters is wrong none is set and -EINVAL is
69 * returned.
63 */ 70 */
64enum nfc_commands { 71enum nfc_commands {
65 NFC_CMD_UNSPEC, 72 NFC_CMD_UNSPEC,
@@ -77,6 +84,8 @@ enum nfc_commands {
77 NFC_EVENT_TARGET_LOST, 84 NFC_EVENT_TARGET_LOST,
78 NFC_EVENT_TM_ACTIVATED, 85 NFC_EVENT_TM_ACTIVATED,
79 NFC_EVENT_TM_DEACTIVATED, 86 NFC_EVENT_TM_DEACTIVATED,
87 NFC_CMD_LLC_GET_PARAMS,
88 NFC_CMD_LLC_SET_PARAMS,
80/* private: internal use only */ 89/* private: internal use only */
81 __NFC_CMD_AFTER_LAST 90 __NFC_CMD_AFTER_LAST
82}; 91};
@@ -102,6 +111,9 @@ enum nfc_commands {
102 * @NFC_ATTR_RF_MODE: Initiator or target 111 * @NFC_ATTR_RF_MODE: Initiator or target
103 * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for 112 * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for
104 * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for 113 * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for
114 * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter
115 * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter
116 * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter
105 */ 117 */
106enum nfc_attrs { 118enum nfc_attrs {
107 NFC_ATTR_UNSPEC, 119 NFC_ATTR_UNSPEC,
@@ -119,6 +131,9 @@ enum nfc_attrs {
119 NFC_ATTR_DEVICE_POWERED, 131 NFC_ATTR_DEVICE_POWERED,
120 NFC_ATTR_IM_PROTOCOLS, 132 NFC_ATTR_IM_PROTOCOLS,
121 NFC_ATTR_TM_PROTOCOLS, 133 NFC_ATTR_TM_PROTOCOLS,
134 NFC_ATTR_LLC_PARAM_LTO,
135 NFC_ATTR_LLC_PARAM_RW,
136 NFC_ATTR_LLC_PARAM_MIUX,
122/* private: internal use only */ 137/* private: internal use only */
123 __NFC_ATTR_AFTER_LAST 138 __NFC_ATTR_AFTER_LAST
124}; 139};
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 7df9b500c804..e3e19f8b16f2 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -118,8 +118,9 @@
118 * to get a list of all present wiphys. 118 * to get a list of all present wiphys.
119 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or 119 * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
120 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, 120 * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
121 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, 121 * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the
122 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT, 122 * attributes determining the channel width; this is used for setting
123 * monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT,
123 * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, 124 * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
124 * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. 125 * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
125 * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL 126 * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
@@ -171,7 +172,7 @@
171 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, 172 * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
172 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. 173 * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT.
173 * The channel to use can be set on the interface or be given using the 174 * The channel to use can be set on the interface or be given using the
174 * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs. 175 * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width.
175 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP 176 * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
176 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface 177 * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
177 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP 178 * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
@@ -401,8 +402,7 @@
401 * a response while being associated to an AP on another channel. 402 * a response while being associated to an AP on another channel.
402 * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus 403 * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus
403 * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the 404 * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
404 * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be 405 * frequency for the operation.
405 * optionally used to specify additional channel parameters.
406 * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds 406 * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
407 * to remain on the channel. This command is also used as an event to 407 * to remain on the channel. This command is also used as an event to
408 * notify when the requested duration starts (it may take a while for the 408 * notify when the requested duration starts (it may take a while for the
@@ -440,12 +440,11 @@
440 * as an event indicating reception of a frame that was not processed in 440 * as an event indicating reception of a frame that was not processed in
441 * kernel code, but is for us (i.e., which may need to be processed in a 441 * kernel code, but is for us (i.e., which may need to be processed in a
442 * user space application). %NL80211_ATTR_FRAME is used to specify the 442 * user space application). %NL80211_ATTR_FRAME is used to specify the
443 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and 443 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used
444 * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on 444 * to indicate on which channel the frame is to be transmitted or was
445 * which channel the frame is to be transmitted or was received. If this 445 * received. If this channel is not the current channel (remain-on-channel
446 * channel is not the current channel (remain-on-channel or the 446 * or the operational channel) the device will switch to the given channel
447 * operational channel) the device will switch to the given channel and 447 * and transmit the frame, optionally waiting for a response for the time
448 * transmit the frame, optionally waiting for a response for the time
449 * specified using %NL80211_ATTR_DURATION. When called, this operation 448 * specified using %NL80211_ATTR_DURATION. When called, this operation
450 * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the 449 * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
451 * TX status event pertaining to the TX request. 450 * TX status event pertaining to the TX request.
@@ -473,8 +472,8 @@
473 * command is used as an event to indicate the that a trigger level was 472 * command is used as an event to indicate the that a trigger level was
474 * reached. 473 * reached.
475 * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ 474 * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
476 * and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed 475 * and the attributes determining channel width) the given interface
477 * by %NL80211_ATTR_IFINDEX) shall operate on. 476 * (identifed by %NL80211_ATTR_IFINDEX) shall operate on.
478 * In case multiple channels are supported by the device, the mechanism 477 * In case multiple channels are supported by the device, the mechanism
479 * with which it switches channels is implementation-defined. 478 * with which it switches channels is implementation-defined.
480 * When a monitor interface is given, it can only switch channel while 479 * When a monitor interface is given, it can only switch channel while
@@ -526,6 +525,12 @@
526 * of PMKSA caching dandidates. 525 * of PMKSA caching dandidates.
527 * 526 *
528 * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup). 527 * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
528 * In addition, this can be used as an event to request userspace to take
529 * actions on TDLS links (set up a new link or tear down an existing one).
530 * In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested
531 * operation, %NL80211_ATTR_MAC contains the peer MAC address, and
532 * %NL80211_ATTR_REASON_CODE the reason code to be used (only with
533 * %NL80211_TDLS_TEARDOWN).
529 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. 534 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame.
530 * 535 *
531 * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP 536 * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
@@ -562,8 +567,8 @@
562 * 567 *
563 * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels 568 * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
564 * independently of the userspace SME, send this event indicating 569 * independently of the userspace SME, send this event indicating
565 * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ with 570 * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
566 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE. 571 * attributes determining channel width.
567 * 572 *
568 * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by 573 * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by
569 * its %NL80211_ATTR_WDEV identifier. It must have been created with 574 * its %NL80211_ATTR_WDEV identifier. It must have been created with
@@ -578,6 +583,9 @@
578 * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON 583 * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON
579 * is used for this. 584 * is used for this.
580 * 585 *
586 * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames
587 * for IBSS or MESH vif.
588 *
581 * @NL80211_CMD_MAX: highest used command number 589 * @NL80211_CMD_MAX: highest used command number
582 * @__NL80211_CMD_AFTER_LAST: internal use 590 * @__NL80211_CMD_AFTER_LAST: internal use
583 */ 591 */
@@ -726,6 +734,8 @@ enum nl80211_commands {
726 734
727 NL80211_CMD_CONN_FAILED, 735 NL80211_CMD_CONN_FAILED,
728 736
737 NL80211_CMD_SET_MCAST_RATE,
738
729 /* add new commands above here */ 739 /* add new commands above here */
730 740
731 /* used to define NL80211_CMD_MAX below */ 741 /* used to define NL80211_CMD_MAX below */
@@ -762,14 +772,26 @@ enum nl80211_commands {
762 * /sys/class/ieee80211/<phyname>/index 772 * /sys/class/ieee80211/<phyname>/index
763 * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) 773 * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
764 * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters 774 * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
765 * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz 775 * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz,
776 * defines the channel together with the (deprecated)
777 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes
778 * %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1
779 * and %NL80211_ATTR_CENTER_FREQ2
780 * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values
781 * of &enum nl80211_chan_width, describing the channel width. See the
782 * documentation of the enum for more information.
783 * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the
784 * channel, used for anything but 20 MHz bandwidth
785 * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the
786 * channel, used only for 80+80 MHz bandwidth
766 * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ 787 * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
767 * if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included): 788 * if HT20 or HT40 are to be used (i.e., HT disabled if not included):
768 * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including 789 * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
769 * this attribute) 790 * this attribute)
770 * NL80211_CHAN_HT20 = HT20 only 791 * NL80211_CHAN_HT20 = HT20 only
771 * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel 792 * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
772 * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel 793 * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
794 * This attribute is now deprecated.
773 * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is 795 * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is
774 * less than or equal to the RTS threshold; allowed range: 1..255; 796 * less than or equal to the RTS threshold; allowed range: 1..255;
775 * dot11ShortRetryLimit; u8 797 * dot11ShortRetryLimit; u8
@@ -1273,6 +1295,21 @@ enum nl80211_commands {
1273 * the connection request from a station. nl80211_connect_failed_reason 1295 * the connection request from a station. nl80211_connect_failed_reason
1274 * enum has different reasons of connection failure. 1296 * enum has different reasons of connection failure.
1275 * 1297 *
1298 * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts
1299 * with the Authentication transaction sequence number field.
1300 *
1301 * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from
1302 * association request when used with NL80211_CMD_NEW_STATION)
1303 *
1304 * @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32)
1305 *
1306 * @NL80211_ATTR_P2P_CTWINDOW: P2P GO Client Traffic Window (u8), used with
1307 * the START_AP and SET_BSS commands
1308 * @NL80211_ATTR_P2P_OPPPS: P2P GO opportunistic PS (u8), used with the
1309 * START_AP and SET_BSS commands. This can have the values 0 or 1;
1310 * if not given in START_AP 0 is assumed, if not given in SET_BSS
1311 * no change is made.
1312 *
1276 * @NL80211_ATTR_MAX: highest attribute number currently defined 1313 * @NL80211_ATTR_MAX: highest attribute number currently defined
1277 * @__NL80211_ATTR_AFTER_LAST: internal use 1314 * @__NL80211_ATTR_AFTER_LAST: internal use
1278 */ 1315 */
@@ -1530,6 +1567,19 @@ enum nl80211_attrs {
1530 1567
1531 NL80211_ATTR_CONN_FAILED_REASON, 1568 NL80211_ATTR_CONN_FAILED_REASON,
1532 1569
1570 NL80211_ATTR_SAE_DATA,
1571
1572 NL80211_ATTR_VHT_CAPABILITY,
1573
1574 NL80211_ATTR_SCAN_FLAGS,
1575
1576 NL80211_ATTR_CHANNEL_WIDTH,
1577 NL80211_ATTR_CENTER_FREQ1,
1578 NL80211_ATTR_CENTER_FREQ2,
1579
1580 NL80211_ATTR_P2P_CTWINDOW,
1581 NL80211_ATTR_P2P_OPPPS,
1582
1533 /* add attributes here, update the policy in nl80211.c */ 1583 /* add attributes here, update the policy in nl80211.c */
1534 1584
1535 __NL80211_ATTR_AFTER_LAST, 1585 __NL80211_ATTR_AFTER_LAST,
@@ -1573,6 +1623,7 @@ enum nl80211_attrs {
1573#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 1623#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
1574#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 1624#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
1575#define NL80211_HT_CAPABILITY_LEN 26 1625#define NL80211_HT_CAPABILITY_LEN 26
1626#define NL80211_VHT_CAPABILITY_LEN 12
1576 1627
1577#define NL80211_MAX_NR_CIPHER_SUITES 5 1628#define NL80211_MAX_NR_CIPHER_SUITES 5
1578#define NL80211_MAX_NR_AKM_SUITES 2 1629#define NL80211_MAX_NR_AKM_SUITES 2
@@ -1693,10 +1744,15 @@ struct nl80211_sta_flag_update {
1693 * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved 1744 * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
1694 * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) 1745 * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
1695 * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) 1746 * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
1696 * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate 1747 * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate
1697 * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval 1748 * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
1698 * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) 1749 * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s)
1699 * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined 1750 * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
1751 * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8)
1752 * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8)
1753 * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate
1754 * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate
1755 * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate
1700 * @__NL80211_RATE_INFO_AFTER_LAST: internal use 1756 * @__NL80211_RATE_INFO_AFTER_LAST: internal use
1701 */ 1757 */
1702enum nl80211_rate_info { 1758enum nl80211_rate_info {
@@ -1706,6 +1762,11 @@ enum nl80211_rate_info {
1706 NL80211_RATE_INFO_40_MHZ_WIDTH, 1762 NL80211_RATE_INFO_40_MHZ_WIDTH,
1707 NL80211_RATE_INFO_SHORT_GI, 1763 NL80211_RATE_INFO_SHORT_GI,
1708 NL80211_RATE_INFO_BITRATE32, 1764 NL80211_RATE_INFO_BITRATE32,
1765 NL80211_RATE_INFO_VHT_MCS,
1766 NL80211_RATE_INFO_VHT_NSS,
1767 NL80211_RATE_INFO_80_MHZ_WIDTH,
1768 NL80211_RATE_INFO_80P80_MHZ_WIDTH,
1769 NL80211_RATE_INFO_160_MHZ_WIDTH,
1709 1770
1710 /* keep last */ 1771 /* keep last */
1711 __NL80211_RATE_INFO_AFTER_LAST, 1772 __NL80211_RATE_INFO_AFTER_LAST,
@@ -2414,6 +2475,15 @@ enum nl80211_ac {
2414#define NL80211_TXQ_Q_BE NL80211_AC_BE 2475#define NL80211_TXQ_Q_BE NL80211_AC_BE
2415#define NL80211_TXQ_Q_BK NL80211_AC_BK 2476#define NL80211_TXQ_Q_BK NL80211_AC_BK
2416 2477
2478/**
2479 * enum nl80211_channel_type - channel type
2480 * @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel
2481 * @NL80211_CHAN_HT20: 20 MHz HT channel
2482 * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel
2483 * below the control channel
2484 * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel
2485 * above the control channel
2486 */
2417enum nl80211_channel_type { 2487enum nl80211_channel_type {
2418 NL80211_CHAN_NO_HT, 2488 NL80211_CHAN_NO_HT,
2419 NL80211_CHAN_HT20, 2489 NL80211_CHAN_HT20,
@@ -2422,6 +2492,32 @@ enum nl80211_channel_type {
2422}; 2492};
2423 2493
2424/** 2494/**
2495 * enum nl80211_chan_width - channel width definitions
2496 *
2497 * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH
2498 * attribute.
2499 *
2500 * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel
2501 * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel
2502 * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2503 * attribute must be provided as well
2504 * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2505 * attribute must be provided as well
2506 * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2507 * and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well
2508 * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
2509 * attribute must be provided as well
2510 */
2511enum nl80211_chan_width {
2512 NL80211_CHAN_WIDTH_20_NOHT,
2513 NL80211_CHAN_WIDTH_20,
2514 NL80211_CHAN_WIDTH_40,
2515 NL80211_CHAN_WIDTH_80,
2516 NL80211_CHAN_WIDTH_80P80,
2517 NL80211_CHAN_WIDTH_160,
2518};
2519
2520/**
2425 * enum nl80211_bss - netlink attributes for a BSS 2521 * enum nl80211_bss - netlink attributes for a BSS
2426 * 2522 *
2427 * @__NL80211_BSS_INVALID: invalid 2523 * @__NL80211_BSS_INVALID: invalid
@@ -2489,6 +2585,7 @@ enum nl80211_bss_status {
2489 * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) 2585 * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only)
2490 * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) 2586 * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
2491 * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) 2587 * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
2588 * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals
2492 * @__NL80211_AUTHTYPE_NUM: internal 2589 * @__NL80211_AUTHTYPE_NUM: internal
2493 * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm 2590 * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
2494 * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by 2591 * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
@@ -2500,6 +2597,7 @@ enum nl80211_auth_type {
2500 NL80211_AUTHTYPE_SHARED_KEY, 2597 NL80211_AUTHTYPE_SHARED_KEY,
2501 NL80211_AUTHTYPE_FT, 2598 NL80211_AUTHTYPE_FT,
2502 NL80211_AUTHTYPE_NETWORK_EAP, 2599 NL80211_AUTHTYPE_NETWORK_EAP,
2600 NL80211_AUTHTYPE_SAE,
2503 2601
2504 /* keep last */ 2602 /* keep last */
2505 __NL80211_AUTHTYPE_NUM, 2603 __NL80211_AUTHTYPE_NUM,
@@ -3028,6 +3126,20 @@ enum nl80211_ap_sme_features {
3028 * in the interface combinations, even when it's only used for scan 3126 * in the interface combinations, even when it's only used for scan
3029 * and remain-on-channel. This could be due to, for example, the 3127 * and remain-on-channel. This could be due to, for example, the
3030 * remain-on-channel implementation requiring a channel context. 3128 * remain-on-channel implementation requiring a channel context.
3129 * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of
3130 * equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station
3131 * mode
3132 * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan
3133 * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported
3134 * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif
3135 * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting
3136 * @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform
3137 * OBSS scans and generate 20/40 BSS coex reports. This flag is used only
3138 * for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied.
3139 * @NL80211_FEATURE_P2P_GO_CTWIN: P2P GO implementation supports CT Window
3140 * setting
3141 * @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic
3142 * powersave
3031 */ 3143 */
3032enum nl80211_feature_flags { 3144enum nl80211_feature_flags {
3033 NL80211_FEATURE_SK_TX_STATUS = 1 << 0, 3145 NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
@@ -3035,6 +3147,14 @@ enum nl80211_feature_flags {
3035 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, 3147 NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
3036 NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, 3148 NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
3037 NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4, 3149 NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4,
3150 NL80211_FEATURE_SAE = 1 << 5,
3151 NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6,
3152 NL80211_FEATURE_SCAN_FLUSH = 1 << 7,
3153 NL80211_FEATURE_AP_SCAN = 1 << 8,
3154 NL80211_FEATURE_VIF_TXPOWER = 1 << 9,
3155 NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10,
3156 NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11,
3157 NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12,
3038}; 3158};
3039 3159
3040/** 3160/**
@@ -3069,4 +3189,25 @@ enum nl80211_connect_failed_reason {
3069 NL80211_CONN_FAIL_BLOCKED_CLIENT, 3189 NL80211_CONN_FAIL_BLOCKED_CLIENT,
3070}; 3190};
3071 3191
3192/**
3193 * enum nl80211_scan_flags - scan request control flags
3194 *
3195 * Scan request control flags are used to control the handling
3196 * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN
3197 * requests.
3198 *
3199 * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority
3200 * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning
3201 * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured
3202 * as AP and the beaconing has already been configured. This attribute is
3203 * dangerous because will destroy stations performance as a lot of frames
3204 * will be lost while scanning off-channel, therefore it must be used only
3205 * when really needed
3206 */
3207enum nl80211_scan_flags {
3208 NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0,
3209 NL80211_SCAN_FLAG_FLUSH = 1<<1,
3210 NL80211_SCAN_FLAG_AP = 1<<2,
3211};
3212
3072#endif /* __LINUX_NL80211_H */ 3213#endif /* __LINUX_NL80211_H */
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index 20ae747ddf34..6b7b6f1e2fd6 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -349,7 +349,7 @@
349#define PCI_AF_STATUS_TP 0x01 349#define PCI_AF_STATUS_TP 0x01
350#define PCI_CAP_AF_SIZEOF 6 /* size of AF registers */ 350#define PCI_CAP_AF_SIZEOF 6 /* size of AF registers */
351 351
352/* PCI-X registers */ 352/* PCI-X registers (Type 0 (non-bridge) devices) */
353 353
354#define PCI_X_CMD 2 /* Modes & Features */ 354#define PCI_X_CMD 2 /* Modes & Features */
355#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */ 355#define PCI_X_CMD_DPERR_E 0x0001 /* Data Parity Error Recovery Enable */
@@ -389,6 +389,19 @@
389#define PCI_CAP_PCIX_SIZEOF_V1 24 /* size for Version 1 */ 389#define PCI_CAP_PCIX_SIZEOF_V1 24 /* size for Version 1 */
390#define PCI_CAP_PCIX_SIZEOF_V2 PCI_CAP_PCIX_SIZEOF_V1 /* Same for v2 */ 390#define PCI_CAP_PCIX_SIZEOF_V2 PCI_CAP_PCIX_SIZEOF_V1 /* Same for v2 */
391 391
392/* PCI-X registers (Type 1 (bridge) devices) */
393
394#define PCI_X_BRIDGE_SSTATUS 2 /* Secondary Status */
395#define PCI_X_SSTATUS_64BIT 0x0001 /* Secondary AD interface is 64 bits */
396#define PCI_X_SSTATUS_133MHZ 0x0002 /* 133 MHz capable */
397#define PCI_X_SSTATUS_FREQ 0x03c0 /* Secondary Bus Mode and Frequency */
398#define PCI_X_SSTATUS_VERS 0x3000 /* PCI-X Capability Version */
399#define PCI_X_SSTATUS_V1 0x1000 /* Mode 2, not Mode 1 */
400#define PCI_X_SSTATUS_V2 0x2000 /* Mode 1 or Modes 1 and 2 */
401#define PCI_X_SSTATUS_266MHZ 0x4000 /* 266 MHz capable */
402#define PCI_X_SSTATUS_533MHZ 0x8000 /* 533 MHz capable */
403#define PCI_X_BRIDGE_STATUS 4 /* Bridge Status */
404
392/* PCI Bridge Subsystem ID registers */ 405/* PCI Bridge Subsystem ID registers */
393 406
394#define PCI_SSVID_VENDOR_ID 4 /* PCI-Bridge subsystem vendor id register */ 407#define PCI_SSVID_VENDOR_ID 4 /* PCI-Bridge subsystem vendor id register */
@@ -456,6 +469,8 @@
456#define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */ 469#define PCI_EXP_LNKCAP_PN 0xff000000 /* Port Number */
457#define PCI_EXP_LNKCTL 16 /* Link Control */ 470#define PCI_EXP_LNKCTL 16 /* Link Control */
458#define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */ 471#define PCI_EXP_LNKCTL_ASPMC 0x0003 /* ASPM Control */
472#define PCI_EXP_LNKCTL_ASPM_L0S 0x01 /* L0s Enable */
473#define PCI_EXP_LNKCTL_ASPM_L1 0x02 /* L1 Enable */
459#define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */ 474#define PCI_EXP_LNKCTL_RCB 0x0008 /* Read Completion Boundary */
460#define PCI_EXP_LNKCTL_LD 0x0010 /* Link Disable */ 475#define PCI_EXP_LNKCTL_LD 0x0010 /* Link Disable */
461#define PCI_EXP_LNKCTL_RL 0x0020 /* Retrain Link */ 476#define PCI_EXP_LNKCTL_RL 0x0020 /* Retrain Link */
@@ -544,9 +559,9 @@
544#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */ 559#define PCI_EXP_OBFF_WAKE_EN 0x6000 /* OBFF using WAKE# signaling */
545#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */ 560#define PCI_CAP_EXP_ENDPOINT_SIZEOF_V2 44 /* v2 endpoints end here */
546#define PCI_EXP_LNKCAP2 44 /* Link Capability 2 */ 561#define PCI_EXP_LNKCAP2 44 /* Link Capability 2 */
547#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x01 /* Current Link Speed 2.5GT/s */ 562#define PCI_EXP_LNKCAP2_SLS_2_5GB 0x02 /* Supported Link Speed 2.5GT/s */
548#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x02 /* Current Link Speed 5.0GT/s */ 563#define PCI_EXP_LNKCAP2_SLS_5_0GB 0x04 /* Supported Link Speed 5.0GT/s */
549#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x04 /* Current Link Speed 8.0GT/s */ 564#define PCI_EXP_LNKCAP2_SLS_8_0GB 0x08 /* Supported Link Speed 8.0GT/s */
550#define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */ 565#define PCI_EXP_LNKCAP2_CROSSLINK 0x100 /* Crosslink supported */
551#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */ 566#define PCI_EXP_LNKCTL2 48 /* Link Control 2 */
552#define PCI_EXP_LNKSTA2 50 /* Link Status 2 */ 567#define PCI_EXP_LNKSTA2 50 /* Link Status 2 */
diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h
index 94e981f810a2..b65c834f83e9 100644
--- a/include/uapi/linux/ptp_clock.h
+++ b/include/uapi/linux/ptp_clock.h
@@ -67,12 +67,26 @@ struct ptp_perout_request {
67 unsigned int rsv[4]; /* Reserved for future use. */ 67 unsigned int rsv[4]; /* Reserved for future use. */
68}; 68};
69 69
70#define PTP_MAX_SAMPLES 25 /* Maximum allowed offset measurement samples. */
71
72struct ptp_sys_offset {
73 unsigned int n_samples; /* Desired number of measurements. */
74 unsigned int rsv[3]; /* Reserved for future use. */
75 /*
76 * Array of interleaved system/phc time stamps. The kernel
77 * will provide 2*n_samples + 1 time stamps, with the last
78 * one as a system time stamp.
79 */
80 struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];
81};
82
70#define PTP_CLK_MAGIC '=' 83#define PTP_CLK_MAGIC '='
71 84
72#define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps) 85#define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps)
73#define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request) 86#define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request)
74#define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request) 87#define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request)
75#define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int) 88#define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int)
89#define PTP_SYS_OFFSET _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset)
76 90
77struct ptp_extts_event { 91struct ptp_extts_event {
78 struct ptp_clock_time t; /* Time event occured. */ 92 struct ptp_clock_time t; /* Time event occured. */
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index fcd768b09f6e..7a5eb196ade9 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -120,6 +120,18 @@ enum {
120 RTM_SETDCB, 120 RTM_SETDCB,
121#define RTM_SETDCB RTM_SETDCB 121#define RTM_SETDCB RTM_SETDCB
122 122
123 RTM_NEWNETCONF = 80,
124#define RTM_NEWNETCONF RTM_NEWNETCONF
125 RTM_GETNETCONF = 82,
126#define RTM_GETNETCONF RTM_GETNETCONF
127
128 RTM_NEWMDB = 84,
129#define RTM_NEWMDB RTM_NEWMDB
130 RTM_DELMDB = 85,
131#define RTM_DELMDB RTM_DELMDB
132 RTM_GETMDB = 86,
133#define RTM_GETMDB RTM_GETMDB
134
123 __RTM_MAX, 135 __RTM_MAX,
124#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) 136#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
125}; 137};
@@ -222,6 +234,7 @@ enum {
222#define RTPROT_XORP 14 /* XORP */ 234#define RTPROT_XORP 14 /* XORP */
223#define RTPROT_NTK 15 /* Netsukuku */ 235#define RTPROT_NTK 15 /* Netsukuku */
224#define RTPROT_DHCP 16 /* DHCP client */ 236#define RTPROT_DHCP 16 /* DHCP client */
237#define RTPROT_MROUTED 17 /* Multicast daemon */
225 238
226/* rtm_scope 239/* rtm_scope
227 240
@@ -283,6 +296,7 @@ enum rtattr_type_t {
283 RTA_MP_ALGO, /* no longer used */ 296 RTA_MP_ALGO, /* no longer used */
284 RTA_TABLE, 297 RTA_TABLE,
285 RTA_MARK, 298 RTA_MARK,
299 RTA_MFC_STATS,
286 __RTA_MAX 300 __RTA_MAX
287}; 301};
288 302
@@ -403,6 +417,12 @@ struct rta_session {
403 } u; 417 } u;
404}; 418};
405 419
420struct rta_mfc_stats {
421 __u64 mfcs_packets;
422 __u64 mfcs_bytes;
423 __u64 mfcs_wrong_if;
424};
425
406/**** 426/****
407 * General form of address family dependent message. 427 * General form of address family dependent message.
408 ****/ 428 ****/
@@ -587,6 +607,12 @@ enum rtnetlink_groups {
587#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE 607#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
588 RTNLGRP_DCB, 608 RTNLGRP_DCB,
589#define RTNLGRP_DCB RTNLGRP_DCB 609#define RTNLGRP_DCB RTNLGRP_DCB
610 RTNLGRP_IPV4_NETCONF,
611#define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF
612 RTNLGRP_IPV6_NETCONF,
613#define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF
614 RTNLGRP_MDB,
615#define RTNLGRP_MDB RTNLGRP_MDB
590 __RTNLGRP_MAX 616 __RTNLGRP_MAX
591}; 617};
592#define RTNLGRP_MAX (__RTNLGRP_MAX - 1) 618#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
diff --git a/include/uapi/linux/serial_core.h b/include/uapi/linux/serial_core.h
index 7e1ab20adc03..78f99d97475b 100644
--- a/include/uapi/linux/serial_core.h
+++ b/include/uapi/linux/serial_core.h
@@ -49,7 +49,8 @@
49#define PORT_XR17D15X 21 /* Exar XR17D15x UART */ 49#define PORT_XR17D15X 21 /* Exar XR17D15x UART */
50#define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */ 50#define PORT_LPC3220 22 /* NXP LPC32xx SoC "Standard" UART */
51#define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */ 51#define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */
52#define PORT_MAX_8250 23 /* max port ID */ 52#define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */
53#define PORT_MAX_8250 24 /* max port ID */
53 54
54/* 55/*
55 * ARM specific type numbers. These are not currently guaranteed 56 * ARM specific type numbers. These are not currently guaranteed
@@ -215,5 +216,7 @@
215/* Energy Micro efm32 SoC */ 216/* Energy Micro efm32 SoC */
216#define PORT_EFMUART 100 217#define PORT_EFMUART 100
217 218
219/* ARC (Synopsys) on-chip UART */
220#define PORT_ARC 101
218 221
219#endif /* _UAPILINUX_SERIAL_CORE_H */ 222#endif /* _UAPILINUX_SERIAL_CORE_H */
diff --git a/include/uapi/linux/serial_reg.h b/include/uapi/linux/serial_reg.h
index 5ed325e88a81..e6322605b138 100644
--- a/include/uapi/linux/serial_reg.h
+++ b/include/uapi/linux/serial_reg.h
@@ -367,5 +367,23 @@
367#define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */ 367#define UART_OMAP_MDR1_CIR_MODE 0x06 /* CIR mode */
368#define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */ 368#define UART_OMAP_MDR1_DISABLE 0x07 /* Disable (default state) */
369 369
370/*
371 * These are definitions for the Exar XR17V35X and XR17(C|D)15X
372 */
373#define UART_EXAR_8XMODE 0x88 /* 8X sampling rate select */
374#define UART_EXAR_SLEEP 0x8b /* Sleep mode */
375#define UART_EXAR_DVID 0x8d /* Device identification */
376
377#define UART_EXAR_FCTR 0x08 /* Feature Control Register */
378#define UART_FCTR_EXAR_IRDA 0x08 /* IrDa data encode select */
379#define UART_FCTR_EXAR_485 0x10 /* Auto 485 half duplex dir ctl */
380#define UART_FCTR_EXAR_TRGA 0x00 /* FIFO trigger table A */
381#define UART_FCTR_EXAR_TRGB 0x60 /* FIFO trigger table B */
382#define UART_FCTR_EXAR_TRGC 0x80 /* FIFO trigger table C */
383#define UART_FCTR_EXAR_TRGD 0xc0 /* FIFO trigger table D programmable */
384
385#define UART_EXAR_TXTRG 0x0a /* Tx FIFO trigger level write-only */
386#define UART_EXAR_RXTRG 0x0b /* Rx FIFO trigger level write-only */
387
370#endif /* _LINUX_SERIAL_REG_H */ 388#endif /* _LINUX_SERIAL_REG_H */
371 389
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h
index b1d2bf16b33c..b8a24941db21 100644
--- a/include/uapi/linux/unix_diag.h
+++ b/include/uapi/linux/unix_diag.h
@@ -37,6 +37,7 @@ enum {
37 UNIX_DIAG_ICONS, 37 UNIX_DIAG_ICONS,
38 UNIX_DIAG_RQLEN, 38 UNIX_DIAG_RQLEN,
39 UNIX_DIAG_MEMINFO, 39 UNIX_DIAG_MEMINFO,
40 UNIX_DIAG_SHUTDOWN,
40 41
41 UNIX_DIAG_MAX, 42 UNIX_DIAG_MAX,
42}; 43};
diff --git a/include/uapi/linux/usb/cdc.h b/include/uapi/linux/usb/cdc.h
index 81a927930bfd..f35aa0a338c7 100644
--- a/include/uapi/linux/usb/cdc.h
+++ b/include/uapi/linux/usb/cdc.h
@@ -19,6 +19,7 @@
19#define USB_CDC_SUBCLASS_OBEX 0x0b 19#define USB_CDC_SUBCLASS_OBEX 0x0b
20#define USB_CDC_SUBCLASS_EEM 0x0c 20#define USB_CDC_SUBCLASS_EEM 0x0c
21#define USB_CDC_SUBCLASS_NCM 0x0d 21#define USB_CDC_SUBCLASS_NCM 0x0d
22#define USB_CDC_SUBCLASS_MBIM 0x0e
22 23
23#define USB_CDC_PROTO_NONE 0 24#define USB_CDC_PROTO_NONE 0
24 25
@@ -33,6 +34,7 @@
33#define USB_CDC_PROTO_EEM 7 34#define USB_CDC_PROTO_EEM 7
34 35
35#define USB_CDC_NCM_PROTO_NTB 1 36#define USB_CDC_NCM_PROTO_NTB 1
37#define USB_CDC_MBIM_PROTO_NTB 2
36 38
37/*-------------------------------------------------------------------------*/ 39/*-------------------------------------------------------------------------*/
38 40
@@ -53,6 +55,7 @@
53#define USB_CDC_DMM_TYPE 0x14 55#define USB_CDC_DMM_TYPE 0x14
54#define USB_CDC_OBEX_TYPE 0x15 56#define USB_CDC_OBEX_TYPE 0x15
55#define USB_CDC_NCM_TYPE 0x1a 57#define USB_CDC_NCM_TYPE 0x1a
58#define USB_CDC_MBIM_TYPE 0x1b
56 59
57/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ 60/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */
58struct usb_cdc_header_desc { 61struct usb_cdc_header_desc {
@@ -187,6 +190,21 @@ struct usb_cdc_ncm_desc {
187 __le16 bcdNcmVersion; 190 __le16 bcdNcmVersion;
188 __u8 bmNetworkCapabilities; 191 __u8 bmNetworkCapabilities;
189} __attribute__ ((packed)); 192} __attribute__ ((packed));
193
194/* "MBIM Control Model Functional Descriptor" */
195struct usb_cdc_mbim_desc {
196 __u8 bLength;
197 __u8 bDescriptorType;
198 __u8 bDescriptorSubType;
199
200 __le16 bcdMBIMVersion;
201 __le16 wMaxControlMessage;
202 __u8 bNumberFilters;
203 __u8 bMaxFilterSize;
204 __le16 wMaxSegmentSize;
205 __u8 bmNetworkCapabilities;
206} __attribute__ ((packed));
207
190/*-------------------------------------------------------------------------*/ 208/*-------------------------------------------------------------------------*/
191 209
192/* 210/*
@@ -332,6 +350,11 @@ struct usb_cdc_ncm_nth32 {
332#define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */ 350#define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */
333#define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */ 351#define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */
334 352
353#define USB_CDC_MBIM_NDP16_IPS_SIGN 0x00535049 /* IPS<sessionID> : IPS0 for now */
354#define USB_CDC_MBIM_NDP32_IPS_SIGN 0x00737069 /* ips<sessionID> : ips0 for now */
355#define USB_CDC_MBIM_NDP16_DSS_SIGN 0x00535344 /* DSS<sessionID> */
356#define USB_CDC_MBIM_NDP32_DSS_SIGN 0x00737364 /* dss<sessionID> */
357
335/* 16-bit NCM Datagram Pointer Entry */ 358/* 16-bit NCM Datagram Pointer Entry */
336struct usb_cdc_ncm_dpe16 { 359struct usb_cdc_ncm_dpe16 {
337 __le16 wDatagramIndex; 360 __le16 wDatagramIndex;
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 57bfa59cda74..3cf3e946e331 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -186,6 +186,7 @@ enum v4l2_memory {
186 V4L2_MEMORY_MMAP = 1, 186 V4L2_MEMORY_MMAP = 1,
187 V4L2_MEMORY_USERPTR = 2, 187 V4L2_MEMORY_USERPTR = 2,
188 V4L2_MEMORY_OVERLAY = 3, 188 V4L2_MEMORY_OVERLAY = 3,
189 V4L2_MEMORY_DMABUF = 4,
189}; 190};
190 191
191/* see also http://vektor.theorem.ca/graphics/ycbcr/ */ 192/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
@@ -602,6 +603,8 @@ struct v4l2_requestbuffers {
602 * should be passed to mmap() called on the video node) 603 * should be passed to mmap() called on the video node)
603 * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer 604 * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer
604 * pointing to this plane 605 * pointing to this plane
606 * @fd: when memory is V4L2_MEMORY_DMABUF, a userspace file
607 * descriptor associated with this plane
605 * @data_offset: offset in the plane to the start of data; usually 0, 608 * @data_offset: offset in the plane to the start of data; usually 0,
606 * unless there is a header in front of the data 609 * unless there is a header in front of the data
607 * 610 *
@@ -616,6 +619,7 @@ struct v4l2_plane {
616 union { 619 union {
617 __u32 mem_offset; 620 __u32 mem_offset;
618 unsigned long userptr; 621 unsigned long userptr;
622 __s32 fd;
619 } m; 623 } m;
620 __u32 data_offset; 624 __u32 data_offset;
621 __u32 reserved[11]; 625 __u32 reserved[11];
@@ -640,6 +644,8 @@ struct v4l2_plane {
640 * (or a "cookie" that should be passed to mmap() as offset) 644 * (or a "cookie" that should be passed to mmap() as offset)
641 * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR; 645 * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
642 * a userspace pointer pointing to this buffer 646 * a userspace pointer pointing to this buffer
647 * @fd: for non-multiplanar buffers with memory == V4L2_MEMORY_DMABUF;
648 * a userspace file descriptor associated with this buffer
643 * @planes: for multiplanar buffers; userspace pointer to the array of plane 649 * @planes: for multiplanar buffers; userspace pointer to the array of plane
644 * info structs for this buffer 650 * info structs for this buffer
645 * @length: size in bytes of the buffer (NOT its payload) for single-plane 651 * @length: size in bytes of the buffer (NOT its payload) for single-plane
@@ -666,6 +672,7 @@ struct v4l2_buffer {
666 __u32 offset; 672 __u32 offset;
667 unsigned long userptr; 673 unsigned long userptr;
668 struct v4l2_plane *planes; 674 struct v4l2_plane *planes;
675 __s32 fd;
669 } m; 676 } m;
670 __u32 length; 677 __u32 length;
671 __u32 reserved2; 678 __u32 reserved2;
@@ -687,6 +694,33 @@ struct v4l2_buffer {
687#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800 694#define V4L2_BUF_FLAG_NO_CACHE_INVALIDATE 0x0800
688#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000 695#define V4L2_BUF_FLAG_NO_CACHE_CLEAN 0x1000
689 696
697/**
698 * struct v4l2_exportbuffer - export of video buffer as DMABUF file descriptor
699 *
700 * @index: id number of the buffer
701 * @type: enum v4l2_buf_type; buffer type (type == *_MPLANE for
702 * multiplanar buffers);
703 * @plane: index of the plane to be exported, 0 for single plane queues
704 * @flags: flags for newly created file, currently only O_CLOEXEC is
705 * supported, refer to manual of open syscall for more details
706 * @fd: file descriptor associated with DMABUF (set by driver)
707 *
708 * Contains data used for exporting a video buffer as DMABUF file descriptor.
709 * The buffer is identified by a 'cookie' returned by VIDIOC_QUERYBUF
710 * (identical to the cookie used to mmap() the buffer to userspace). All
711 * reserved fields must be set to zero. The field reserved0 is expected to
712 * become a structure 'type' allowing an alternative layout of the structure
713 * content. Therefore this field should not be used for any other extensions.
714 */
715struct v4l2_exportbuffer {
716 __u32 type; /* enum v4l2_buf_type */
717 __u32 index;
718 __u32 plane;
719 __u32 flags;
720 __s32 fd;
721 __u32 reserved[11];
722};
723
690/* 724/*
691 * O V E R L A Y P R E V I E W 725 * O V E R L A Y P R E V I E W
692 */ 726 */
@@ -737,7 +771,7 @@ struct v4l2_window {
737struct v4l2_captureparm { 771struct v4l2_captureparm {
738 __u32 capability; /* Supported modes */ 772 __u32 capability; /* Supported modes */
739 __u32 capturemode; /* Current mode */ 773 __u32 capturemode; /* Current mode */
740 struct v4l2_fract timeperframe; /* Time per frame in .1us units */ 774 struct v4l2_fract timeperframe; /* Time per frame in seconds */
741 __u32 extendedmode; /* Driver-specific extensions */ 775 __u32 extendedmode; /* Driver-specific extensions */
742 __u32 readbuffers; /* # of buffers for read */ 776 __u32 readbuffers; /* # of buffers for read */
743 __u32 reserved[4]; 777 __u32 reserved[4];
@@ -1888,6 +1922,7 @@ struct v4l2_create_buffers {
1888#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer) 1922#define VIDIOC_S_FBUF _IOW('V', 11, struct v4l2_framebuffer)
1889#define VIDIOC_OVERLAY _IOW('V', 14, int) 1923#define VIDIOC_OVERLAY _IOW('V', 14, int)
1890#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer) 1924#define VIDIOC_QBUF _IOWR('V', 15, struct v4l2_buffer)
1925#define VIDIOC_EXPBUF _IOWR('V', 16, struct v4l2_exportbuffer)
1891#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer) 1926#define VIDIOC_DQBUF _IOWR('V', 17, struct v4l2_buffer)
1892#define VIDIOC_STREAMON _IOW('V', 18, int) 1927#define VIDIOC_STREAMON _IOW('V', 18, int)
1893#define VIDIOC_STREAMOFF _IOW('V', 19, int) 1928#define VIDIOC_STREAMOFF _IOW('V', 19, int)
diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_net.h
index 2470f541af50..848e3584d7c8 100644
--- a/include/uapi/linux/virtio_net.h
+++ b/include/uapi/linux/virtio_net.h
@@ -51,6 +51,8 @@
51#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */ 51#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
52#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can announce device on the 52#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can announce device on the
53 * network */ 53 * network */
54#define VIRTIO_NET_F_MQ 22 /* Device supports Receive Flow
55 * Steering */
54 56
55#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ 57#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
56#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ 58#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */
@@ -60,6 +62,11 @@ struct virtio_net_config {
60 __u8 mac[6]; 62 __u8 mac[6];
61 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ 63 /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */
62 __u16 status; 64 __u16 status;
65 /* Maximum number of each of transmit and receive queues;
66 * see VIRTIO_NET_F_MQ and VIRTIO_NET_CTRL_MQ.
67 * Legal values are between 1 and 0x8000
68 */
69 __u16 max_virtqueue_pairs;
63} __attribute__((packed)); 70} __attribute__((packed));
64 71
65/* This is the first element of the scatter-gather list. If you don't 72/* This is the first element of the scatter-gather list. If you don't
@@ -166,4 +173,24 @@ struct virtio_net_ctrl_mac {
166#define VIRTIO_NET_CTRL_ANNOUNCE 3 173#define VIRTIO_NET_CTRL_ANNOUNCE 3
167 #define VIRTIO_NET_CTRL_ANNOUNCE_ACK 0 174 #define VIRTIO_NET_CTRL_ANNOUNCE_ACK 0
168 175
176/*
177 * Control Receive Flow Steering
178 *
179 * The command VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET
180 * enables Receive Flow Steering, specifying the number of the transmit and
181 * receive queues that will be used. After the command is consumed and acked by
182 * the device, the device will not steer new packets on receive virtqueues
183 * other than specified nor read from transmit virtqueues other than specified.
184 * Accordingly, driver should not transmit new packets on virtqueues other than
185 * specified.
186 */
187struct virtio_net_ctrl_mq {
188 u16 virtqueue_pairs;
189};
190
191#define VIRTIO_NET_CTRL_MQ 4
192 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET 0
193 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN 1
194 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX 0x8000
195
169#endif /* _LINUX_VIRTIO_NET_H */ 196#endif /* _LINUX_VIRTIO_NET_H */
diff --git a/include/uapi/rdma/Kbuild b/include/uapi/rdma/Kbuild
index aafaa5aa54d4..687ae332200f 100644
--- a/include/uapi/rdma/Kbuild
+++ b/include/uapi/rdma/Kbuild
@@ -1 +1,7 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += ib_user_cm.h
3header-y += ib_user_mad.h
4header-y += ib_user_sa.h
5header-y += ib_user_verbs.h
6header-y += rdma_netlink.h
7header-y += rdma_user_cm.h
diff --git a/include/rdma/ib_user_cm.h b/include/uapi/rdma/ib_user_cm.h
index f79014aa28f9..f79014aa28f9 100644
--- a/include/rdma/ib_user_cm.h
+++ b/include/uapi/rdma/ib_user_cm.h
diff --git a/include/rdma/ib_user_mad.h b/include/uapi/rdma/ib_user_mad.h
index d6fce1cbdb90..d6fce1cbdb90 100644
--- a/include/rdma/ib_user_mad.h
+++ b/include/uapi/rdma/ib_user_mad.h
diff --git a/include/rdma/ib_user_sa.h b/include/uapi/rdma/ib_user_sa.h
index cfc7c9ba781e..cfc7c9ba781e 100644
--- a/include/rdma/ib_user_sa.h
+++ b/include/uapi/rdma/ib_user_sa.h
diff --git a/include/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h
index 81aba3a73aa3..81aba3a73aa3 100644
--- a/include/rdma/ib_user_verbs.h
+++ b/include/uapi/rdma/ib_user_verbs.h
diff --git a/include/uapi/rdma/rdma_netlink.h b/include/uapi/rdma/rdma_netlink.h
new file mode 100644
index 000000000000..8297285b6288
--- /dev/null
+++ b/include/uapi/rdma/rdma_netlink.h
@@ -0,0 +1,37 @@
1#ifndef _UAPI_RDMA_NETLINK_H
2#define _UAPI_RDMA_NETLINK_H
3
4#include <linux/types.h>
5
6enum {
7 RDMA_NL_RDMA_CM = 1
8};
9
10#define RDMA_NL_GET_CLIENT(type) ((type & (((1 << 6) - 1) << 10)) >> 10)
11#define RDMA_NL_GET_OP(type) (type & ((1 << 10) - 1))
12#define RDMA_NL_GET_TYPE(client, op) ((client << 10) + op)
13
14enum {
15 RDMA_NL_RDMA_CM_ID_STATS = 0,
16 RDMA_NL_RDMA_CM_NUM_OPS
17};
18
19enum {
20 RDMA_NL_RDMA_CM_ATTR_SRC_ADDR = 1,
21 RDMA_NL_RDMA_CM_ATTR_DST_ADDR,
22 RDMA_NL_RDMA_CM_NUM_ATTR,
23};
24
25struct rdma_cm_id_stats {
26 __u32 qp_num;
27 __u32 bound_dev_if;
28 __u32 port_space;
29 __s32 pid;
30 __u8 cm_state;
31 __u8 node_type;
32 __u8 port_num;
33 __u8 qp_type;
34};
35
36
37#endif /* _UAPI_RDMA_NETLINK_H */
diff --git a/include/rdma/rdma_user_cm.h b/include/uapi/rdma/rdma_user_cm.h
index 1ee9239ff8c2..1ee9239ff8c2 100644
--- a/include/rdma/rdma_user_cm.h
+++ b/include/uapi/rdma/rdma_user_cm.h
diff --git a/include/uapi/sound/Kbuild b/include/uapi/sound/Kbuild
index aafaa5aa54d4..0f7d279ebde3 100644
--- a/include/uapi/sound/Kbuild
+++ b/include/uapi/sound/Kbuild
@@ -1 +1,11 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += asequencer.h
3header-y += asound.h
4header-y += asound_fm.h
5header-y += compress_offload.h
6header-y += compress_params.h
7header-y += emu10k1.h
8header-y += hdsp.h
9header-y += hdspm.h
10header-y += sb16_csp.h
11header-y += sfnt_info.h
diff --git a/include/uapi/sound/asequencer.h b/include/uapi/sound/asequencer.h
new file mode 100644
index 000000000000..09c8a00ea503
--- /dev/null
+++ b/include/uapi/sound/asequencer.h
@@ -0,0 +1,614 @@
1/*
2 * Main header file for the ALSA sequencer
3 * Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
4 * (c) 1998-1999 by Jaroslav Kysela <perex@perex.cz>
5 *
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22#ifndef _UAPI__SOUND_ASEQUENCER_H
23#define _UAPI__SOUND_ASEQUENCER_H
24
25
26/** version of the sequencer */
27#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
28
29/**
30 * definition of sequencer event types
31 */
32
33/** system messages
34 * event data type = #snd_seq_result
35 */
36#define SNDRV_SEQ_EVENT_SYSTEM 0
37#define SNDRV_SEQ_EVENT_RESULT 1
38
39/** note messages (channel specific)
40 * event data type = #snd_seq_ev_note
41 */
42#define SNDRV_SEQ_EVENT_NOTE 5
43#define SNDRV_SEQ_EVENT_NOTEON 6
44#define SNDRV_SEQ_EVENT_NOTEOFF 7
45#define SNDRV_SEQ_EVENT_KEYPRESS 8
46
47/** control messages (channel specific)
48 * event data type = #snd_seq_ev_ctrl
49 */
50#define SNDRV_SEQ_EVENT_CONTROLLER 10
51#define SNDRV_SEQ_EVENT_PGMCHANGE 11
52#define SNDRV_SEQ_EVENT_CHANPRESS 12
53#define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */
54#define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */
55#define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */
56#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
57
58/** synchronisation messages
59 * event data type = #snd_seq_ev_ctrl
60 */
61#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
62#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
63#define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */
64#define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */
65#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
66
67/** timer messages
68 * event data type = snd_seq_ev_queue_control
69 */
70#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
71#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
72#define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */
73#define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */
74#define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */
75#define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */
76#define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */
77#define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */
78#define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
79
80/** others
81 * event data type = none
82 */
83#define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */
84#define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */
85#define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
86
87/** echo back, kernel private messages
88 * event data type = any type
89 */
90#define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */
91#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
92
93/** system status messages (broadcast for subscribers)
94 * event data type = snd_seq_addr
95 */
96#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
97#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
98#define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */
99#define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */
100#define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */
101#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
102
103/** port connection changes
104 * event data type = snd_seq_connect
105 */
106#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
107#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
108
109/* 70-89: synthesizer events - obsoleted */
110
111/** user-defined events with fixed length
112 * event data type = any
113 */
114#define SNDRV_SEQ_EVENT_USR0 90
115#define SNDRV_SEQ_EVENT_USR1 91
116#define SNDRV_SEQ_EVENT_USR2 92
117#define SNDRV_SEQ_EVENT_USR3 93
118#define SNDRV_SEQ_EVENT_USR4 94
119#define SNDRV_SEQ_EVENT_USR5 95
120#define SNDRV_SEQ_EVENT_USR6 96
121#define SNDRV_SEQ_EVENT_USR7 97
122#define SNDRV_SEQ_EVENT_USR8 98
123#define SNDRV_SEQ_EVENT_USR9 99
124
125/* 100-118: instrument layer - obsoleted */
126/* 119-129: reserved */
127
128/* 130-139: variable length events
129 * event data type = snd_seq_ev_ext
130 * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
131 */
132#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
133#define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */
134/* 132-134: reserved */
135#define SNDRV_SEQ_EVENT_USR_VAR0 135
136#define SNDRV_SEQ_EVENT_USR_VAR1 136
137#define SNDRV_SEQ_EVENT_USR_VAR2 137
138#define SNDRV_SEQ_EVENT_USR_VAR3 138
139#define SNDRV_SEQ_EVENT_USR_VAR4 139
140
141/* 150-151: kernel events with quote - DO NOT use in user clients */
142#define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
143#define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
144
145/* 152-191: reserved */
146
147/* 192-254: hardware specific events */
148
149/* 255: special event */
150#define SNDRV_SEQ_EVENT_NONE 255
151
152
153typedef unsigned char snd_seq_event_type_t;
154
155/** event address */
156struct snd_seq_addr {
157 unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
158 unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
159};
160
161/** port connection */
162struct snd_seq_connect {
163 struct snd_seq_addr sender;
164 struct snd_seq_addr dest;
165};
166
167
168#define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */
169#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */
170#define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */
171#define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */
172
173 /* event mode flag - NOTE: only 8 bits available! */
174#define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */
175#define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */
176#define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
177
178#define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */
179#define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */
180#define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
181
182#define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */
183#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */
184#define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */
185#define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
186
187#define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */
188#define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
189#define SNDRV_SEQ_PRIORITY_MASK (1<<4)
190
191
192 /* note event */
193struct snd_seq_ev_note {
194 unsigned char channel;
195 unsigned char note;
196 unsigned char velocity;
197 unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */
198 unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */
199};
200
201 /* controller event */
202struct snd_seq_ev_ctrl {
203 unsigned char channel;
204 unsigned char unused1, unused2, unused3; /* pad */
205 unsigned int param;
206 signed int value;
207};
208
209 /* generic set of bytes (12x8 bit) */
210struct snd_seq_ev_raw8 {
211 unsigned char d[12]; /* 8 bit value */
212};
213
214 /* generic set of integers (3x32 bit) */
215struct snd_seq_ev_raw32 {
216 unsigned int d[3]; /* 32 bit value */
217};
218
219 /* external stored data */
220struct snd_seq_ev_ext {
221 unsigned int len; /* length of data */
222 void *ptr; /* pointer to data (note: maybe 64-bit) */
223} __attribute__((packed));
224
225struct snd_seq_result {
226 int event; /* processed event type */
227 int result;
228};
229
230
231struct snd_seq_real_time {
232 unsigned int tv_sec; /* seconds */
233 unsigned int tv_nsec; /* nanoseconds */
234};
235
236typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
237
238union snd_seq_timestamp {
239 snd_seq_tick_time_t tick;
240 struct snd_seq_real_time time;
241};
242
243struct snd_seq_queue_skew {
244 unsigned int value;
245 unsigned int base;
246};
247
248 /* queue timer control */
249struct snd_seq_ev_queue_control {
250 unsigned char queue; /* affected queue */
251 unsigned char pad[3]; /* reserved */
252 union {
253 signed int value; /* affected value (e.g. tempo) */
254 union snd_seq_timestamp time; /* time */
255 unsigned int position; /* sync position */
256 struct snd_seq_queue_skew skew;
257 unsigned int d32[2];
258 unsigned char d8[8];
259 } param;
260};
261
262 /* quoted event - inside the kernel only */
263struct snd_seq_ev_quote {
264 struct snd_seq_addr origin; /* original sender */
265 unsigned short value; /* optional data */
266 struct snd_seq_event *event; /* quoted event */
267} __attribute__((packed));
268
269
270 /* sequencer event */
271struct snd_seq_event {
272 snd_seq_event_type_t type; /* event type */
273 unsigned char flags; /* event flags */
274 char tag;
275
276 unsigned char queue; /* schedule queue */
277 union snd_seq_timestamp time; /* schedule time */
278
279
280 struct snd_seq_addr source; /* source address */
281 struct snd_seq_addr dest; /* destination address */
282
283 union { /* event data... */
284 struct snd_seq_ev_note note;
285 struct snd_seq_ev_ctrl control;
286 struct snd_seq_ev_raw8 raw8;
287 struct snd_seq_ev_raw32 raw32;
288 struct snd_seq_ev_ext ext;
289 struct snd_seq_ev_queue_control queue;
290 union snd_seq_timestamp time;
291 struct snd_seq_addr addr;
292 struct snd_seq_connect connect;
293 struct snd_seq_result result;
294 struct snd_seq_ev_quote quote;
295 } data;
296};
297
298
299/*
300 * bounce event - stored as variable size data
301 */
302struct snd_seq_event_bounce {
303 int err;
304 struct snd_seq_event event;
305 /* external data follows here. */
306};
307
308
309 /* system information */
310struct snd_seq_system_info {
311 int queues; /* maximum queues count */
312 int clients; /* maximum clients count */
313 int ports; /* maximum ports per client */
314 int channels; /* maximum channels per port */
315 int cur_clients; /* current clients */
316 int cur_queues; /* current queues */
317 char reserved[24];
318};
319
320
321 /* system running information */
322struct snd_seq_running_info {
323 unsigned char client; /* client id */
324 unsigned char big_endian; /* 1 = big-endian */
325 unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
326 unsigned char pad; /* reserved */
327 unsigned char reserved[12];
328};
329
330
331 /* known client numbers */
332#define SNDRV_SEQ_CLIENT_SYSTEM 0
333 /* internal client numbers */
334#define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
335#define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
336
337
338 /* client types */
339typedef int __bitwise snd_seq_client_type_t;
340#define NO_CLIENT ((__force snd_seq_client_type_t) 0)
341#define USER_CLIENT ((__force snd_seq_client_type_t) 1)
342#define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2)
343
344 /* event filter flags */
345#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
346#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */
347#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
348#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
349
350struct snd_seq_client_info {
351 int client; /* client number to inquire */
352 snd_seq_client_type_t type; /* client type */
353 char name[64]; /* client name */
354 unsigned int filter; /* filter flags */
355 unsigned char multicast_filter[8]; /* multicast filter bitmap */
356 unsigned char event_filter[32]; /* event filter bitmap */
357 int num_ports; /* RO: number of ports */
358 int event_lost; /* number of lost events */
359 char reserved[64]; /* for future use */
360};
361
362
363/* client pool size */
364struct snd_seq_client_pool {
365 int client; /* client number to inquire */
366 int output_pool; /* outgoing (write) pool size */
367 int input_pool; /* incoming (read) pool size */
368 int output_room; /* minimum free pool size for select/blocking mode */
369 int output_free; /* unused size */
370 int input_free; /* unused size */
371 char reserved[64];
372};
373
374
375/* Remove events by specified criteria */
376
377#define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */
378#define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */
379#define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */
380#define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */
381#define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */
382#define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */
383#define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */
384#define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */
385#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
386#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
387
388struct snd_seq_remove_events {
389 unsigned int remove_mode; /* Flags that determine what gets removed */
390
391 union snd_seq_timestamp time;
392
393 unsigned char queue; /* Queue for REMOVE_DEST */
394 struct snd_seq_addr dest; /* Address for REMOVE_DEST */
395 unsigned char channel; /* Channel for REMOVE_DEST */
396
397 int type; /* For REMOVE_EVENT_TYPE */
398 char tag; /* Tag for REMOVE_TAG */
399
400 int reserved[10]; /* To allow for future binary compatibility */
401
402};
403
404
405 /* known port numbers */
406#define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
407#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
408
409 /* port capabilities (32 bits) */
410#define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */
411#define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
412
413#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
414#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
415
416#define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
417
418#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
419#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
420#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
421
422 /* port type */
423#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
424#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
425#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */
426#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */
427#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
428#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
429#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
430
431/* other standards...*/
432#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
433#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
434#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
435/*...*/
436#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
437#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
438#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
439#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
440#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
441
442/* misc. conditioning flags */
443#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
444#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
445#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
446
447struct snd_seq_port_info {
448 struct snd_seq_addr addr; /* client/port numbers */
449 char name[64]; /* port name */
450
451 unsigned int capability; /* port capability bits */
452 unsigned int type; /* port type bits */
453 int midi_channels; /* channels per MIDI port */
454 int midi_voices; /* voices per MIDI port */
455 int synth_voices; /* voices per SYNTH port */
456
457 int read_use; /* R/O: subscribers for output (from this port) */
458 int write_use; /* R/O: subscribers for input (to this port) */
459
460 void *kernel; /* reserved for kernel use (must be NULL) */
461 unsigned int flags; /* misc. conditioning */
462 unsigned char time_queue; /* queue # for timestamping */
463 char reserved[59]; /* for future use */
464};
465
466
467/* queue flags */
468#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
469
470/* queue information */
471struct snd_seq_queue_info {
472 int queue; /* queue id */
473
474 /*
475 * security settings, only owner of this queue can start/stop timer
476 * etc. if the queue is locked for other clients
477 */
478 int owner; /* client id for owner of the queue */
479 unsigned locked:1; /* timing queue locked for other queues */
480 char name[64]; /* name of this queue */
481 unsigned int flags; /* flags */
482 char reserved[60]; /* for future use */
483
484};
485
486/* queue info/status */
487struct snd_seq_queue_status {
488 int queue; /* queue id */
489 int events; /* read-only - queue size */
490 snd_seq_tick_time_t tick; /* current tick */
491 struct snd_seq_real_time time; /* current time */
492 int running; /* running state of queue */
493 int flags; /* various flags */
494 char reserved[64]; /* for the future */
495};
496
497
498/* queue tempo */
499struct snd_seq_queue_tempo {
500 int queue; /* sequencer queue */
501 unsigned int tempo; /* current tempo, us/tick */
502 int ppq; /* time resolution, ticks/quarter */
503 unsigned int skew_value; /* queue skew */
504 unsigned int skew_base; /* queue skew base */
505 char reserved[24]; /* for the future */
506};
507
508
509/* sequencer timer sources */
510#define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */
511#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */
512#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
513
514/* queue timer info */
515struct snd_seq_queue_timer {
516 int queue; /* sequencer queue */
517 int type; /* source timer type */
518 union {
519 struct {
520 struct snd_timer_id id; /* ALSA's timer ID */
521 unsigned int resolution; /* resolution in Hz */
522 } alsa;
523 } u;
524 char reserved[64]; /* for the future use */
525};
526
527
528struct snd_seq_queue_client {
529 int queue; /* sequencer queue */
530 int client; /* sequencer client */
531 int used; /* queue is used with this client
532 (must be set for accepting events) */
533 /* per client watermarks */
534 char reserved[64]; /* for future use */
535};
536
537
538#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */
539#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
540#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
541
542struct snd_seq_port_subscribe {
543 struct snd_seq_addr sender; /* sender address */
544 struct snd_seq_addr dest; /* destination address */
545 unsigned int voices; /* number of voices to be allocated (0 = don't care) */
546 unsigned int flags; /* modes */
547 unsigned char queue; /* input time-stamp queue (optional) */
548 unsigned char pad[3]; /* reserved */
549 char reserved[64];
550};
551
552/* type of query subscription */
553#define SNDRV_SEQ_QUERY_SUBS_READ 0
554#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
555
556struct snd_seq_query_subs {
557 struct snd_seq_addr root; /* client/port id to be searched */
558 int type; /* READ or WRITE */
559 int index; /* 0..N-1 */
560 int num_subs; /* R/O: number of subscriptions on this port */
561 struct snd_seq_addr addr; /* R/O: result */
562 unsigned char queue; /* R/O: result */
563 unsigned int flags; /* R/O: result */
564 char reserved[64]; /* for future use */
565};
566
567
568/*
569 * IOCTL commands
570 */
571
572#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
573#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
574#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
575#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
576
577#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
578#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
579
580#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
581#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
582#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
583#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
584
585#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
586#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
587
588#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
589#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
590#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
591#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
592#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
593#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
594#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
595#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
596#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
597#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
598#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
599#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
600/* XXX
601#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync)
602#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync)
603*/
604#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
605#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
606#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
607#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
608#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
609#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
610#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
611#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
612#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
613
614#endif /* _UAPI__SOUND_ASEQUENCER_H */
diff --git a/include/uapi/sound/asound.h b/include/uapi/sound/asound.h
new file mode 100644
index 000000000000..1774a5c3ef10
--- /dev/null
+++ b/include/uapi/sound/asound.h
@@ -0,0 +1,971 @@
1/*
2 * Advanced Linux Sound Architecture - ALSA - Driver
3 * Copyright (c) 1994-2003 by Jaroslav Kysela <perex@perex.cz>,
4 * Abramo Bagnara <abramo@alsa-project.org>
5 *
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22
23#ifndef _UAPI__SOUND_ASOUND_H
24#define _UAPI__SOUND_ASOUND_H
25
26#include <linux/types.h>
27
28
29/*
30 * protocol version
31 */
32
33#define SNDRV_PROTOCOL_VERSION(major, minor, subminor) (((major)<<16)|((minor)<<8)|(subminor))
34#define SNDRV_PROTOCOL_MAJOR(version) (((version)>>16)&0xffff)
35#define SNDRV_PROTOCOL_MINOR(version) (((version)>>8)&0xff)
36#define SNDRV_PROTOCOL_MICRO(version) ((version)&0xff)
37#define SNDRV_PROTOCOL_INCOMPATIBLE(kversion, uversion) \
38 (SNDRV_PROTOCOL_MAJOR(kversion) != SNDRV_PROTOCOL_MAJOR(uversion) || \
39 (SNDRV_PROTOCOL_MAJOR(kversion) == SNDRV_PROTOCOL_MAJOR(uversion) && \
40 SNDRV_PROTOCOL_MINOR(kversion) != SNDRV_PROTOCOL_MINOR(uversion)))
41
42/****************************************************************************
43 * *
44 * Digital audio interface *
45 * *
46 ****************************************************************************/
47
48struct snd_aes_iec958 {
49 unsigned char status[24]; /* AES/IEC958 channel status bits */
50 unsigned char subcode[147]; /* AES/IEC958 subcode bits */
51 unsigned char pad; /* nothing */
52 unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */
53};
54
55/****************************************************************************
56 * *
57 * CEA-861 Audio InfoFrame. Used in HDMI and DisplayPort *
58 * *
59 ****************************************************************************/
60
61struct snd_cea_861_aud_if {
62 unsigned char db1_ct_cc; /* coding type and channel count */
63 unsigned char db2_sf_ss; /* sample frequency and size */
64 unsigned char db3; /* not used, all zeros */
65 unsigned char db4_ca; /* channel allocation code */
66 unsigned char db5_dminh_lsv; /* downmix inhibit & level-shit values */
67};
68
69/****************************************************************************
70 * *
71 * Section for driver hardware dependent interface - /dev/snd/hw? *
72 * *
73 ****************************************************************************/
74
75#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
76
77enum {
78 SNDRV_HWDEP_IFACE_OPL2 = 0,
79 SNDRV_HWDEP_IFACE_OPL3,
80 SNDRV_HWDEP_IFACE_OPL4,
81 SNDRV_HWDEP_IFACE_SB16CSP, /* Creative Signal Processor */
82 SNDRV_HWDEP_IFACE_EMU10K1, /* FX8010 processor in EMU10K1 chip */
83 SNDRV_HWDEP_IFACE_YSS225, /* Yamaha FX processor */
84 SNDRV_HWDEP_IFACE_ICS2115, /* Wavetable synth */
85 SNDRV_HWDEP_IFACE_SSCAPE, /* Ensoniq SoundScape ISA card (MC68EC000) */
86 SNDRV_HWDEP_IFACE_VX, /* Digigram VX cards */
87 SNDRV_HWDEP_IFACE_MIXART, /* Digigram miXart cards */
88 SNDRV_HWDEP_IFACE_USX2Y, /* Tascam US122, US224 & US428 usb */
89 SNDRV_HWDEP_IFACE_EMUX_WAVETABLE, /* EmuX wavetable */
90 SNDRV_HWDEP_IFACE_BLUETOOTH, /* Bluetooth audio */
91 SNDRV_HWDEP_IFACE_USX2Y_PCM, /* Tascam US122, US224 & US428 rawusb pcm */
92 SNDRV_HWDEP_IFACE_PCXHR, /* Digigram PCXHR */
93 SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
94 SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
95 SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
96
97 /* Don't forget to change the following: */
98 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
99};
100
101struct snd_hwdep_info {
102 unsigned int device; /* WR: device number */
103 int card; /* R: card number */
104 unsigned char id[64]; /* ID (user selectable) */
105 unsigned char name[80]; /* hwdep name */
106 int iface; /* hwdep interface */
107 unsigned char reserved[64]; /* reserved for future */
108};
109
110/* generic DSP loader */
111struct snd_hwdep_dsp_status {
112 unsigned int version; /* R: driver-specific version */
113 unsigned char id[32]; /* R: driver-specific ID string */
114 unsigned int num_dsps; /* R: number of DSP images to transfer */
115 unsigned int dsp_loaded; /* R: bit flags indicating the loaded DSPs */
116 unsigned int chip_ready; /* R: 1 = initialization finished */
117 unsigned char reserved[16]; /* reserved for future use */
118};
119
120struct snd_hwdep_dsp_image {
121 unsigned int index; /* W: DSP index */
122 unsigned char name[64]; /* W: ID (e.g. file name) */
123 unsigned char __user *image; /* W: binary image */
124 size_t length; /* W: size of image in bytes */
125 unsigned long driver_data; /* W: driver-specific data */
126};
127
128#define SNDRV_HWDEP_IOCTL_PVERSION _IOR ('H', 0x00, int)
129#define SNDRV_HWDEP_IOCTL_INFO _IOR ('H', 0x01, struct snd_hwdep_info)
130#define SNDRV_HWDEP_IOCTL_DSP_STATUS _IOR('H', 0x02, struct snd_hwdep_dsp_status)
131#define SNDRV_HWDEP_IOCTL_DSP_LOAD _IOW('H', 0x03, struct snd_hwdep_dsp_image)
132
133/*****************************************************************************
134 * *
135 * Digital Audio (PCM) interface - /dev/snd/pcm?? *
136 * *
137 *****************************************************************************/
138
139#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 11)
140
141typedef unsigned long snd_pcm_uframes_t;
142typedef signed long snd_pcm_sframes_t;
143
144enum {
145 SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */
146 SNDRV_PCM_CLASS_MULTI, /* multichannel device */
147 SNDRV_PCM_CLASS_MODEM, /* software modem class */
148 SNDRV_PCM_CLASS_DIGITIZER, /* digitizer class */
149 /* Don't forget to change the following: */
150 SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
151};
152
153enum {
154 SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */
155 SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */
156 /* Don't forget to change the following: */
157 SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
158};
159
160enum {
161 SNDRV_PCM_STREAM_PLAYBACK = 0,
162 SNDRV_PCM_STREAM_CAPTURE,
163 SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
164};
165
166typedef int __bitwise snd_pcm_access_t;
167#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0) /* interleaved mmap */
168#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1) /* noninterleaved mmap */
169#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2) /* complex mmap */
170#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3) /* readi/writei */
171#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4) /* readn/writen */
172#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
173
174typedef int __bitwise snd_pcm_format_t;
175#define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0)
176#define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1)
177#define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2)
178#define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3)
179#define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4)
180#define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5)
181#define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6) /* low three bytes */
182#define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */
183#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */
184#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */
185#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
186#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
187#define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
188#define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13)
189#define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
190#define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
191#define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
192#define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
193#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */
194#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */
195#define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20)
196#define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21)
197#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
198#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
199#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
200#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
201#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */
202#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */
203#define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34) /* in three bytes */
204#define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35) /* in three bytes */
205#define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36) /* in three bytes */
206#define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37) /* in three bytes */
207#define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38) /* in three bytes */
208#define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39) /* in three bytes */
209#define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40) /* in three bytes */
210#define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */
211#define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */
212#define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */
213#define SNDRV_PCM_FORMAT_G723_24 ((__force snd_pcm_format_t) 44) /* 8 samples in 3 bytes */
214#define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */
215#define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */
216#define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */
217#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_G723_40_1B
218
219#ifdef SNDRV_LITTLE_ENDIAN
220#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
221#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
222#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
223#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
224#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
225#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
226#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
227#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
228#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
229#endif
230#ifdef SNDRV_BIG_ENDIAN
231#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
232#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
233#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
234#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
235#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
236#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
237#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
238#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
239#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
240#endif
241
242typedef int __bitwise snd_pcm_subformat_t;
243#define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0)
244#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
245
246#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */
247#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */
248#define SNDRV_PCM_INFO_DOUBLE 0x00000004 /* Double buffering needed for PCM start/stop */
249#define SNDRV_PCM_INFO_BATCH 0x00000010 /* double buffering */
250#define SNDRV_PCM_INFO_INTERLEAVED 0x00000100 /* channels are interleaved */
251#define SNDRV_PCM_INFO_NONINTERLEAVED 0x00000200 /* channels are not interleaved */
252#define SNDRV_PCM_INFO_COMPLEX 0x00000400 /* complex frame organization (mmap only) */
253#define SNDRV_PCM_INFO_BLOCK_TRANSFER 0x00010000 /* hardware transfer block of samples */
254#define SNDRV_PCM_INFO_OVERRANGE 0x00020000 /* hardware supports ADC (capture) overrange detection */
255#define SNDRV_PCM_INFO_RESUME 0x00040000 /* hardware supports stream resume after suspend */
256#define SNDRV_PCM_INFO_PAUSE 0x00080000 /* pause ioctl is supported */
257#define SNDRV_PCM_INFO_HALF_DUPLEX 0x00100000 /* only half duplex */
258#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
259#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
260#define SNDRV_PCM_INFO_NO_PERIOD_WAKEUP 0x00800000 /* period wakeup can be disabled */
261#define SNDRV_PCM_INFO_HAS_WALL_CLOCK 0x01000000 /* has audio wall clock for audio/system time sync */
262#define SNDRV_PCM_INFO_FIFO_IN_FRAMES 0x80000000 /* internal kernel flag - FIFO size is in frames */
263
264typedef int __bitwise snd_pcm_state_t;
265#define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */
266#define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */
267#define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2) /* stream is ready to start */
268#define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3) /* stream is running */
269#define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4) /* stream reached an xrun */
270#define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5) /* stream is draining */
271#define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6) /* stream is paused */
272#define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7) /* hardware is suspended */
273#define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8) /* hardware is disconnected */
274#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
275
276enum {
277 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
278 SNDRV_PCM_MMAP_OFFSET_STATUS = 0x80000000,
279 SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
280};
281
282union snd_pcm_sync_id {
283 unsigned char id[16];
284 unsigned short id16[8];
285 unsigned int id32[4];
286};
287
288struct snd_pcm_info {
289 unsigned int device; /* RO/WR (control): device number */
290 unsigned int subdevice; /* RO/WR (control): subdevice number */
291 int stream; /* RO/WR (control): stream direction */
292 int card; /* R: card number */
293 unsigned char id[64]; /* ID (user selectable) */
294 unsigned char name[80]; /* name of this device */
295 unsigned char subname[32]; /* subdevice name */
296 int dev_class; /* SNDRV_PCM_CLASS_* */
297 int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */
298 unsigned int subdevices_count;
299 unsigned int subdevices_avail;
300 union snd_pcm_sync_id sync; /* hardware synchronization ID */
301 unsigned char reserved[64]; /* reserved for future... */
302};
303
304typedef int snd_pcm_hw_param_t;
305#define SNDRV_PCM_HW_PARAM_ACCESS 0 /* Access type */
306#define SNDRV_PCM_HW_PARAM_FORMAT 1 /* Format */
307#define SNDRV_PCM_HW_PARAM_SUBFORMAT 2 /* Subformat */
308#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
309#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
310
311#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS 8 /* Bits per sample */
312#define SNDRV_PCM_HW_PARAM_FRAME_BITS 9 /* Bits per frame */
313#define SNDRV_PCM_HW_PARAM_CHANNELS 10 /* Channels */
314#define SNDRV_PCM_HW_PARAM_RATE 11 /* Approx rate */
315#define SNDRV_PCM_HW_PARAM_PERIOD_TIME 12 /* Approx distance between
316 * interrupts in us
317 */
318#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE 13 /* Approx frames between
319 * interrupts
320 */
321#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES 14 /* Approx bytes between
322 * interrupts
323 */
324#define SNDRV_PCM_HW_PARAM_PERIODS 15 /* Approx interrupts per
325 * buffer
326 */
327#define SNDRV_PCM_HW_PARAM_BUFFER_TIME 16 /* Approx duration of buffer
328 * in us
329 */
330#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE 17 /* Size of buffer in frames */
331#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES 18 /* Size of buffer in bytes */
332#define SNDRV_PCM_HW_PARAM_TICK_TIME 19 /* Approx tick duration in us */
333#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
334#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
335
336#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
337#define SNDRV_PCM_HW_PARAMS_EXPORT_BUFFER (1<<1) /* export buffer */
338#define SNDRV_PCM_HW_PARAMS_NO_PERIOD_WAKEUP (1<<2) /* disable period wakeups */
339
340struct snd_interval {
341 unsigned int min, max;
342 unsigned int openmin:1,
343 openmax:1,
344 integer:1,
345 empty:1;
346};
347
348#define SNDRV_MASK_MAX 256
349
350struct snd_mask {
351 __u32 bits[(SNDRV_MASK_MAX+31)/32];
352};
353
354struct snd_pcm_hw_params {
355 unsigned int flags;
356 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
357 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
358 struct snd_mask mres[5]; /* reserved masks */
359 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
360 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
361 struct snd_interval ires[9]; /* reserved intervals */
362 unsigned int rmask; /* W: requested masks */
363 unsigned int cmask; /* R: changed masks */
364 unsigned int info; /* R: Info flags for returned setup */
365 unsigned int msbits; /* R: used most significant bits */
366 unsigned int rate_num; /* R: rate numerator */
367 unsigned int rate_den; /* R: rate denominator */
368 snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
369 unsigned char reserved[64]; /* reserved for future */
370};
371
372enum {
373 SNDRV_PCM_TSTAMP_NONE = 0,
374 SNDRV_PCM_TSTAMP_ENABLE,
375 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_ENABLE,
376};
377
378struct snd_pcm_sw_params {
379 int tstamp_mode; /* timestamp mode */
380 unsigned int period_step;
381 unsigned int sleep_min; /* min ticks to sleep */
382 snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
383 snd_pcm_uframes_t xfer_align; /* obsolete: xfer size need to be a multiple */
384 snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */
385 snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */
386 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
387 snd_pcm_uframes_t silence_size; /* silence block size */
388 snd_pcm_uframes_t boundary; /* pointers wrap point */
389 unsigned char reserved[64]; /* reserved for future */
390};
391
392struct snd_pcm_channel_info {
393 unsigned int channel;
394 __kernel_off_t offset; /* mmap offset */
395 unsigned int first; /* offset to first sample in bits */
396 unsigned int step; /* samples distance in bits */
397};
398
399struct snd_pcm_status {
400 snd_pcm_state_t state; /* stream state */
401 struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
402 struct timespec tstamp; /* reference timestamp */
403 snd_pcm_uframes_t appl_ptr; /* appl ptr */
404 snd_pcm_uframes_t hw_ptr; /* hw ptr */
405 snd_pcm_sframes_t delay; /* current delay in frames */
406 snd_pcm_uframes_t avail; /* number of frames available */
407 snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */
408 snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */
409 snd_pcm_state_t suspended_state; /* suspended stream state */
410 __u32 reserved_alignment; /* must be filled with zero */
411 struct timespec audio_tstamp; /* from sample counter or wall clock */
412 unsigned char reserved[56-sizeof(struct timespec)]; /* must be filled with zero */
413};
414
415struct snd_pcm_mmap_status {
416 snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */
417 int pad1; /* Needed for 64 bit alignment */
418 snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */
419 struct timespec tstamp; /* Timestamp */
420 snd_pcm_state_t suspended_state; /* RO: suspended stream state */
421 struct timespec audio_tstamp; /* from sample counter or wall clock */
422};
423
424struct snd_pcm_mmap_control {
425 snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */
426 snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
427};
428
429#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */
430#define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */
431#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */
432
433struct snd_pcm_sync_ptr {
434 unsigned int flags;
435 union {
436 struct snd_pcm_mmap_status status;
437 unsigned char reserved[64];
438 } s;
439 union {
440 struct snd_pcm_mmap_control control;
441 unsigned char reserved[64];
442 } c;
443};
444
445struct snd_xferi {
446 snd_pcm_sframes_t result;
447 void __user *buf;
448 snd_pcm_uframes_t frames;
449};
450
451struct snd_xfern {
452 snd_pcm_sframes_t result;
453 void __user * __user *bufs;
454 snd_pcm_uframes_t frames;
455};
456
457enum {
458 SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
459 SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
460 SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
461};
462
463/* channel positions */
464enum {
465 SNDRV_CHMAP_UNKNOWN = 0,
466 SNDRV_CHMAP_NA, /* N/A, silent */
467 SNDRV_CHMAP_MONO, /* mono stream */
468 /* this follows the alsa-lib mixer channel value + 3 */
469 SNDRV_CHMAP_FL, /* front left */
470 SNDRV_CHMAP_FR, /* front right */
471 SNDRV_CHMAP_RL, /* rear left */
472 SNDRV_CHMAP_RR, /* rear right */
473 SNDRV_CHMAP_FC, /* front center */
474 SNDRV_CHMAP_LFE, /* LFE */
475 SNDRV_CHMAP_SL, /* side left */
476 SNDRV_CHMAP_SR, /* side right */
477 SNDRV_CHMAP_RC, /* rear center */
478 /* new definitions */
479 SNDRV_CHMAP_FLC, /* front left center */
480 SNDRV_CHMAP_FRC, /* front right center */
481 SNDRV_CHMAP_RLC, /* rear left center */
482 SNDRV_CHMAP_RRC, /* rear right center */
483 SNDRV_CHMAP_FLW, /* front left wide */
484 SNDRV_CHMAP_FRW, /* front right wide */
485 SNDRV_CHMAP_FLH, /* front left high */
486 SNDRV_CHMAP_FCH, /* front center high */
487 SNDRV_CHMAP_FRH, /* front right high */
488 SNDRV_CHMAP_TC, /* top center */
489 SNDRV_CHMAP_TFL, /* top front left */
490 SNDRV_CHMAP_TFR, /* top front right */
491 SNDRV_CHMAP_TFC, /* top front center */
492 SNDRV_CHMAP_TRL, /* top rear left */
493 SNDRV_CHMAP_TRR, /* top rear right */
494 SNDRV_CHMAP_TRC, /* top rear center */
495 /* new definitions for UAC2 */
496 SNDRV_CHMAP_TFLC, /* top front left center */
497 SNDRV_CHMAP_TFRC, /* top front right center */
498 SNDRV_CHMAP_TSL, /* top side left */
499 SNDRV_CHMAP_TSR, /* top side right */
500 SNDRV_CHMAP_LLFE, /* left LFE */
501 SNDRV_CHMAP_RLFE, /* right LFE */
502 SNDRV_CHMAP_BC, /* bottom center */
503 SNDRV_CHMAP_BLC, /* bottom left center */
504 SNDRV_CHMAP_BRC, /* bottom right center */
505 SNDRV_CHMAP_LAST = SNDRV_CHMAP_BRC,
506};
507
508#define SNDRV_CHMAP_POSITION_MASK 0xffff
509#define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16)
510#define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16)
511
512#define SNDRV_PCM_IOCTL_PVERSION _IOR('A', 0x00, int)
513#define SNDRV_PCM_IOCTL_INFO _IOR('A', 0x01, struct snd_pcm_info)
514#define SNDRV_PCM_IOCTL_TSTAMP _IOW('A', 0x02, int)
515#define SNDRV_PCM_IOCTL_TTSTAMP _IOW('A', 0x03, int)
516#define SNDRV_PCM_IOCTL_HW_REFINE _IOWR('A', 0x10, struct snd_pcm_hw_params)
517#define SNDRV_PCM_IOCTL_HW_PARAMS _IOWR('A', 0x11, struct snd_pcm_hw_params)
518#define SNDRV_PCM_IOCTL_HW_FREE _IO('A', 0x12)
519#define SNDRV_PCM_IOCTL_SW_PARAMS _IOWR('A', 0x13, struct snd_pcm_sw_params)
520#define SNDRV_PCM_IOCTL_STATUS _IOR('A', 0x20, struct snd_pcm_status)
521#define SNDRV_PCM_IOCTL_DELAY _IOR('A', 0x21, snd_pcm_sframes_t)
522#define SNDRV_PCM_IOCTL_HWSYNC _IO('A', 0x22)
523#define SNDRV_PCM_IOCTL_SYNC_PTR _IOWR('A', 0x23, struct snd_pcm_sync_ptr)
524#define SNDRV_PCM_IOCTL_CHANNEL_INFO _IOR('A', 0x32, struct snd_pcm_channel_info)
525#define SNDRV_PCM_IOCTL_PREPARE _IO('A', 0x40)
526#define SNDRV_PCM_IOCTL_RESET _IO('A', 0x41)
527#define SNDRV_PCM_IOCTL_START _IO('A', 0x42)
528#define SNDRV_PCM_IOCTL_DROP _IO('A', 0x43)
529#define SNDRV_PCM_IOCTL_DRAIN _IO('A', 0x44)
530#define SNDRV_PCM_IOCTL_PAUSE _IOW('A', 0x45, int)
531#define SNDRV_PCM_IOCTL_REWIND _IOW('A', 0x46, snd_pcm_uframes_t)
532#define SNDRV_PCM_IOCTL_RESUME _IO('A', 0x47)
533#define SNDRV_PCM_IOCTL_XRUN _IO('A', 0x48)
534#define SNDRV_PCM_IOCTL_FORWARD _IOW('A', 0x49, snd_pcm_uframes_t)
535#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
536#define SNDRV_PCM_IOCTL_READI_FRAMES _IOR('A', 0x51, struct snd_xferi)
537#define SNDRV_PCM_IOCTL_WRITEN_FRAMES _IOW('A', 0x52, struct snd_xfern)
538#define SNDRV_PCM_IOCTL_READN_FRAMES _IOR('A', 0x53, struct snd_xfern)
539#define SNDRV_PCM_IOCTL_LINK _IOW('A', 0x60, int)
540#define SNDRV_PCM_IOCTL_UNLINK _IO('A', 0x61)
541
542/*****************************************************************************
543 * *
544 * MIDI v1.0 interface *
545 * *
546 *****************************************************************************/
547
548/*
549 * Raw MIDI section - /dev/snd/midi??
550 */
551
552#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
553
554enum {
555 SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
556 SNDRV_RAWMIDI_STREAM_INPUT,
557 SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
558};
559
560#define SNDRV_RAWMIDI_INFO_OUTPUT 0x00000001
561#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
562#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
563
564struct snd_rawmidi_info {
565 unsigned int device; /* RO/WR (control): device number */
566 unsigned int subdevice; /* RO/WR (control): subdevice number */
567 int stream; /* WR: stream */
568 int card; /* R: card number */
569 unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */
570 unsigned char id[64]; /* ID (user selectable) */
571 unsigned char name[80]; /* name of device */
572 unsigned char subname[32]; /* name of active or selected subdevice */
573 unsigned int subdevices_count;
574 unsigned int subdevices_avail;
575 unsigned char reserved[64]; /* reserved for future use */
576};
577
578struct snd_rawmidi_params {
579 int stream;
580 size_t buffer_size; /* queue size in bytes */
581 size_t avail_min; /* minimum avail bytes for wakeup */
582 unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */
583 unsigned char reserved[16]; /* reserved for future use */
584};
585
586struct snd_rawmidi_status {
587 int stream;
588 struct timespec tstamp; /* Timestamp */
589 size_t avail; /* available bytes */
590 size_t xruns; /* count of overruns since last status (in bytes) */
591 unsigned char reserved[16]; /* reserved for future use */
592};
593
594#define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int)
595#define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info)
596#define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params)
597#define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status)
598#define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
599#define SNDRV_RAWMIDI_IOCTL_DRAIN _IOW('W', 0x31, int)
600
601/*
602 * Timer section - /dev/snd/timer
603 */
604
605#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 6)
606
607enum {
608 SNDRV_TIMER_CLASS_NONE = -1,
609 SNDRV_TIMER_CLASS_SLAVE = 0,
610 SNDRV_TIMER_CLASS_GLOBAL,
611 SNDRV_TIMER_CLASS_CARD,
612 SNDRV_TIMER_CLASS_PCM,
613 SNDRV_TIMER_CLASS_LAST = SNDRV_TIMER_CLASS_PCM,
614};
615
616/* slave timer classes */
617enum {
618 SNDRV_TIMER_SCLASS_NONE = 0,
619 SNDRV_TIMER_SCLASS_APPLICATION,
620 SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */
621 SNDRV_TIMER_SCLASS_OSS_SEQUENCER, /* alias */
622 SNDRV_TIMER_SCLASS_LAST = SNDRV_TIMER_SCLASS_OSS_SEQUENCER,
623};
624
625/* global timers (device member) */
626#define SNDRV_TIMER_GLOBAL_SYSTEM 0
627#define SNDRV_TIMER_GLOBAL_RTC 1
628#define SNDRV_TIMER_GLOBAL_HPET 2
629#define SNDRV_TIMER_GLOBAL_HRTIMER 3
630
631/* info flags */
632#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
633
634struct snd_timer_id {
635 int dev_class;
636 int dev_sclass;
637 int card;
638 int device;
639 int subdevice;
640};
641
642struct snd_timer_ginfo {
643 struct snd_timer_id tid; /* requested timer ID */
644 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
645 int card; /* card number */
646 unsigned char id[64]; /* timer identification */
647 unsigned char name[80]; /* timer name */
648 unsigned long reserved0; /* reserved for future use */
649 unsigned long resolution; /* average period resolution in ns */
650 unsigned long resolution_min; /* minimal period resolution in ns */
651 unsigned long resolution_max; /* maximal period resolution in ns */
652 unsigned int clients; /* active timer clients */
653 unsigned char reserved[32];
654};
655
656struct snd_timer_gparams {
657 struct snd_timer_id tid; /* requested timer ID */
658 unsigned long period_num; /* requested precise period duration (in seconds) - numerator */
659 unsigned long period_den; /* requested precise period duration (in seconds) - denominator */
660 unsigned char reserved[32];
661};
662
663struct snd_timer_gstatus {
664 struct snd_timer_id tid; /* requested timer ID */
665 unsigned long resolution; /* current period resolution in ns */
666 unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */
667 unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */
668 unsigned char reserved[32];
669};
670
671struct snd_timer_select {
672 struct snd_timer_id id; /* bind to timer ID */
673 unsigned char reserved[32]; /* reserved */
674};
675
676struct snd_timer_info {
677 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
678 int card; /* card number */
679 unsigned char id[64]; /* timer identificator */
680 unsigned char name[80]; /* timer name */
681 unsigned long reserved0; /* reserved for future use */
682 unsigned long resolution; /* average period resolution in ns */
683 unsigned char reserved[64]; /* reserved */
684};
685
686#define SNDRV_TIMER_PSFLG_AUTO (1<<0) /* auto start, otherwise one-shot */
687#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */
688#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */
689
690struct snd_timer_params {
691 unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */
692 unsigned int ticks; /* requested resolution in ticks */
693 unsigned int queue_size; /* total size of queue (32-1024) */
694 unsigned int reserved0; /* reserved, was: failure locations */
695 unsigned int filter; /* event filter (bitmask of SNDRV_TIMER_EVENT_*) */
696 unsigned char reserved[60]; /* reserved */
697};
698
699struct snd_timer_status {
700 struct timespec tstamp; /* Timestamp - last update */
701 unsigned int resolution; /* current period resolution in ns */
702 unsigned int lost; /* counter of master tick lost */
703 unsigned int overrun; /* count of read queue overruns */
704 unsigned int queue; /* used queue size */
705 unsigned char reserved[64]; /* reserved */
706};
707
708#define SNDRV_TIMER_IOCTL_PVERSION _IOR('T', 0x00, int)
709#define SNDRV_TIMER_IOCTL_NEXT_DEVICE _IOWR('T', 0x01, struct snd_timer_id)
710#define SNDRV_TIMER_IOCTL_TREAD _IOW('T', 0x02, int)
711#define SNDRV_TIMER_IOCTL_GINFO _IOWR('T', 0x03, struct snd_timer_ginfo)
712#define SNDRV_TIMER_IOCTL_GPARAMS _IOW('T', 0x04, struct snd_timer_gparams)
713#define SNDRV_TIMER_IOCTL_GSTATUS _IOWR('T', 0x05, struct snd_timer_gstatus)
714#define SNDRV_TIMER_IOCTL_SELECT _IOW('T', 0x10, struct snd_timer_select)
715#define SNDRV_TIMER_IOCTL_INFO _IOR('T', 0x11, struct snd_timer_info)
716#define SNDRV_TIMER_IOCTL_PARAMS _IOW('T', 0x12, struct snd_timer_params)
717#define SNDRV_TIMER_IOCTL_STATUS _IOR('T', 0x14, struct snd_timer_status)
718/* The following four ioctls are changed since 1.0.9 due to confliction */
719#define SNDRV_TIMER_IOCTL_START _IO('T', 0xa0)
720#define SNDRV_TIMER_IOCTL_STOP _IO('T', 0xa1)
721#define SNDRV_TIMER_IOCTL_CONTINUE _IO('T', 0xa2)
722#define SNDRV_TIMER_IOCTL_PAUSE _IO('T', 0xa3)
723
724struct snd_timer_read {
725 unsigned int resolution;
726 unsigned int ticks;
727};
728
729enum {
730 SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */
731 SNDRV_TIMER_EVENT_TICK, /* val = ticks */
732 SNDRV_TIMER_EVENT_START, /* val = resolution in ns */
733 SNDRV_TIMER_EVENT_STOP, /* val = 0 */
734 SNDRV_TIMER_EVENT_CONTINUE, /* val = resolution in ns */
735 SNDRV_TIMER_EVENT_PAUSE, /* val = 0 */
736 SNDRV_TIMER_EVENT_EARLY, /* val = 0, early event */
737 SNDRV_TIMER_EVENT_SUSPEND, /* val = 0 */
738 SNDRV_TIMER_EVENT_RESUME, /* val = resolution in ns */
739 /* master timer events for slave timer instances */
740 SNDRV_TIMER_EVENT_MSTART = SNDRV_TIMER_EVENT_START + 10,
741 SNDRV_TIMER_EVENT_MSTOP = SNDRV_TIMER_EVENT_STOP + 10,
742 SNDRV_TIMER_EVENT_MCONTINUE = SNDRV_TIMER_EVENT_CONTINUE + 10,
743 SNDRV_TIMER_EVENT_MPAUSE = SNDRV_TIMER_EVENT_PAUSE + 10,
744 SNDRV_TIMER_EVENT_MSUSPEND = SNDRV_TIMER_EVENT_SUSPEND + 10,
745 SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
746};
747
748struct snd_timer_tread {
749 int event;
750 struct timespec tstamp;
751 unsigned int val;
752};
753
754/****************************************************************************
755 * *
756 * Section for driver control interface - /dev/snd/control? *
757 * *
758 ****************************************************************************/
759
760#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
761
762struct snd_ctl_card_info {
763 int card; /* card number */
764 int pad; /* reserved for future (was type) */
765 unsigned char id[16]; /* ID of card (user selectable) */
766 unsigned char driver[16]; /* Driver name */
767 unsigned char name[32]; /* Short name of soundcard */
768 unsigned char longname[80]; /* name + info text about soundcard */
769 unsigned char reserved_[16]; /* reserved for future (was ID of mixer) */
770 unsigned char mixername[80]; /* visual mixer identification */
771 unsigned char components[128]; /* card components / fine identification, delimited with one space (AC97 etc..) */
772};
773
774typedef int __bitwise snd_ctl_elem_type_t;
775#define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0) /* invalid */
776#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1) /* boolean type */
777#define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2) /* integer type */
778#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3) /* enumerated type */
779#define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4) /* byte array */
780#define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */
781#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6) /* 64-bit integer type */
782#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
783
784typedef int __bitwise snd_ctl_elem_iface_t;
785#define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0) /* global control */
786#define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1) /* hardware dependent device */
787#define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2) /* virtual mixer device */
788#define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3) /* PCM device */
789#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4) /* RawMidi device */
790#define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5) /* timer device */
791#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6) /* sequencer client */
792#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
793
794#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
795#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
796#define SNDRV_CTL_ELEM_ACCESS_READWRITE (SNDRV_CTL_ELEM_ACCESS_READ|SNDRV_CTL_ELEM_ACCESS_WRITE)
797#define SNDRV_CTL_ELEM_ACCESS_VOLATILE (1<<2) /* control value may be changed without a notification */
798#define SNDRV_CTL_ELEM_ACCESS_TIMESTAMP (1<<3) /* when was control changed */
799#define SNDRV_CTL_ELEM_ACCESS_TLV_READ (1<<4) /* TLV read is possible */
800#define SNDRV_CTL_ELEM_ACCESS_TLV_WRITE (1<<5) /* TLV write is possible */
801#define SNDRV_CTL_ELEM_ACCESS_TLV_READWRITE (SNDRV_CTL_ELEM_ACCESS_TLV_READ|SNDRV_CTL_ELEM_ACCESS_TLV_WRITE)
802#define SNDRV_CTL_ELEM_ACCESS_TLV_COMMAND (1<<6) /* TLV command is possible */
803#define SNDRV_CTL_ELEM_ACCESS_INACTIVE (1<<8) /* control does actually nothing, but may be updated */
804#define SNDRV_CTL_ELEM_ACCESS_LOCK (1<<9) /* write lock */
805#define SNDRV_CTL_ELEM_ACCESS_OWNER (1<<10) /* write lock owner */
806#define SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK (1<<28) /* kernel use a TLV callback */
807#define SNDRV_CTL_ELEM_ACCESS_USER (1<<29) /* user space element */
808/* bits 30 and 31 are obsoleted (for indirect access) */
809
810/* for further details see the ACPI and PCI power management specification */
811#define SNDRV_CTL_POWER_D0 0x0000 /* full On */
812#define SNDRV_CTL_POWER_D1 0x0100 /* partial On */
813#define SNDRV_CTL_POWER_D2 0x0200 /* partial On */
814#define SNDRV_CTL_POWER_D3 0x0300 /* Off */
815#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
816#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
817
818struct snd_ctl_elem_id {
819 unsigned int numid; /* numeric identifier, zero = invalid */
820 snd_ctl_elem_iface_t iface; /* interface identifier */
821 unsigned int device; /* device/client number */
822 unsigned int subdevice; /* subdevice (substream) number */
823 unsigned char name[44]; /* ASCII name of item */
824 unsigned int index; /* index of item */
825};
826
827struct snd_ctl_elem_list {
828 unsigned int offset; /* W: first element ID to get */
829 unsigned int space; /* W: count of element IDs to get */
830 unsigned int used; /* R: count of element IDs set */
831 unsigned int count; /* R: count of all elements */
832 struct snd_ctl_elem_id __user *pids; /* R: IDs */
833 unsigned char reserved[50];
834};
835
836struct snd_ctl_elem_info {
837 struct snd_ctl_elem_id id; /* W: element ID */
838 snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
839 unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
840 unsigned int count; /* count of values */
841 __kernel_pid_t owner; /* owner's PID of this control */
842 union {
843 struct {
844 long min; /* R: minimum value */
845 long max; /* R: maximum value */
846 long step; /* R: step (0 variable) */
847 } integer;
848 struct {
849 long long min; /* R: minimum value */
850 long long max; /* R: maximum value */
851 long long step; /* R: step (0 variable) */
852 } integer64;
853 struct {
854 unsigned int items; /* R: number of items */
855 unsigned int item; /* W: item number */
856 char name[64]; /* R: value name */
857 __u64 names_ptr; /* W: names list (ELEM_ADD only) */
858 unsigned int names_length;
859 } enumerated;
860 unsigned char reserved[128];
861 } value;
862 union {
863 unsigned short d[4]; /* dimensions */
864 unsigned short *d_ptr; /* indirect - obsoleted */
865 } dimen;
866 unsigned char reserved[64-4*sizeof(unsigned short)];
867};
868
869struct snd_ctl_elem_value {
870 struct snd_ctl_elem_id id; /* W: element ID */
871 unsigned int indirect: 1; /* W: indirect access - obsoleted */
872 union {
873 union {
874 long value[128];
875 long *value_ptr; /* obsoleted */
876 } integer;
877 union {
878 long long value[64];
879 long long *value_ptr; /* obsoleted */
880 } integer64;
881 union {
882 unsigned int item[128];
883 unsigned int *item_ptr; /* obsoleted */
884 } enumerated;
885 union {
886 unsigned char data[512];
887 unsigned char *data_ptr; /* obsoleted */
888 } bytes;
889 struct snd_aes_iec958 iec958;
890 } value; /* RO */
891 struct timespec tstamp;
892 unsigned char reserved[128-sizeof(struct timespec)];
893};
894
895struct snd_ctl_tlv {
896 unsigned int numid; /* control element numeric identification */
897 unsigned int length; /* in bytes aligned to 4 */
898 unsigned int tlv[0]; /* first TLV */
899};
900
901#define SNDRV_CTL_IOCTL_PVERSION _IOR('U', 0x00, int)
902#define SNDRV_CTL_IOCTL_CARD_INFO _IOR('U', 0x01, struct snd_ctl_card_info)
903#define SNDRV_CTL_IOCTL_ELEM_LIST _IOWR('U', 0x10, struct snd_ctl_elem_list)
904#define SNDRV_CTL_IOCTL_ELEM_INFO _IOWR('U', 0x11, struct snd_ctl_elem_info)
905#define SNDRV_CTL_IOCTL_ELEM_READ _IOWR('U', 0x12, struct snd_ctl_elem_value)
906#define SNDRV_CTL_IOCTL_ELEM_WRITE _IOWR('U', 0x13, struct snd_ctl_elem_value)
907#define SNDRV_CTL_IOCTL_ELEM_LOCK _IOW('U', 0x14, struct snd_ctl_elem_id)
908#define SNDRV_CTL_IOCTL_ELEM_UNLOCK _IOW('U', 0x15, struct snd_ctl_elem_id)
909#define SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS _IOWR('U', 0x16, int)
910#define SNDRV_CTL_IOCTL_ELEM_ADD _IOWR('U', 0x17, struct snd_ctl_elem_info)
911#define SNDRV_CTL_IOCTL_ELEM_REPLACE _IOWR('U', 0x18, struct snd_ctl_elem_info)
912#define SNDRV_CTL_IOCTL_ELEM_REMOVE _IOWR('U', 0x19, struct snd_ctl_elem_id)
913#define SNDRV_CTL_IOCTL_TLV_READ _IOWR('U', 0x1a, struct snd_ctl_tlv)
914#define SNDRV_CTL_IOCTL_TLV_WRITE _IOWR('U', 0x1b, struct snd_ctl_tlv)
915#define SNDRV_CTL_IOCTL_TLV_COMMAND _IOWR('U', 0x1c, struct snd_ctl_tlv)
916#define SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE _IOWR('U', 0x20, int)
917#define SNDRV_CTL_IOCTL_HWDEP_INFO _IOR('U', 0x21, struct snd_hwdep_info)
918#define SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE _IOR('U', 0x30, int)
919#define SNDRV_CTL_IOCTL_PCM_INFO _IOWR('U', 0x31, struct snd_pcm_info)
920#define SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE _IOW('U', 0x32, int)
921#define SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE _IOWR('U', 0x40, int)
922#define SNDRV_CTL_IOCTL_RAWMIDI_INFO _IOWR('U', 0x41, struct snd_rawmidi_info)
923#define SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE _IOW('U', 0x42, int)
924#define SNDRV_CTL_IOCTL_POWER _IOWR('U', 0xd0, int)
925#define SNDRV_CTL_IOCTL_POWER_STATE _IOR('U', 0xd1, int)
926
927/*
928 * Read interface.
929 */
930
931enum sndrv_ctl_event_type {
932 SNDRV_CTL_EVENT_ELEM = 0,
933 SNDRV_CTL_EVENT_LAST = SNDRV_CTL_EVENT_ELEM,
934};
935
936#define SNDRV_CTL_EVENT_MASK_VALUE (1<<0) /* element value was changed */
937#define SNDRV_CTL_EVENT_MASK_INFO (1<<1) /* element info was changed */
938#define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */
939#define SNDRV_CTL_EVENT_MASK_TLV (1<<3) /* element TLV tree was changed */
940#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */
941
942struct snd_ctl_event {
943 int type; /* event type - SNDRV_CTL_EVENT_* */
944 union {
945 struct {
946 unsigned int mask;
947 struct snd_ctl_elem_id id;
948 } elem;
949 unsigned char data8[60];
950 } data;
951};
952
953/*
954 * Control names
955 */
956
957#define SNDRV_CTL_NAME_NONE ""
958#define SNDRV_CTL_NAME_PLAYBACK "Playback "
959#define SNDRV_CTL_NAME_CAPTURE "Capture "
960
961#define SNDRV_CTL_NAME_IEC958_NONE ""
962#define SNDRV_CTL_NAME_IEC958_SWITCH "Switch"
963#define SNDRV_CTL_NAME_IEC958_VOLUME "Volume"
964#define SNDRV_CTL_NAME_IEC958_DEFAULT "Default"
965#define SNDRV_CTL_NAME_IEC958_MASK "Mask"
966#define SNDRV_CTL_NAME_IEC958_CON_MASK "Con Mask"
967#define SNDRV_CTL_NAME_IEC958_PRO_MASK "Pro Mask"
968#define SNDRV_CTL_NAME_IEC958_PCM_STREAM "PCM Stream"
969#define SNDRV_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SNDRV_CTL_NAME_##direction SNDRV_CTL_NAME_IEC958_##what
970
971#endif /* _UAPI__SOUND_ASOUND_H */
diff --git a/include/sound/asound_fm.h b/include/uapi/sound/asound_fm.h
index c2a4b967d5be..c2a4b967d5be 100644
--- a/include/sound/asound_fm.h
+++ b/include/uapi/sound/asound_fm.h
diff --git a/include/sound/compress_offload.h b/include/uapi/sound/compress_offload.h
index 05341a43fedf..05341a43fedf 100644
--- a/include/sound/compress_offload.h
+++ b/include/uapi/sound/compress_offload.h
diff --git a/include/sound/compress_params.h b/include/uapi/sound/compress_params.h
index 602dc6c45d1a..602dc6c45d1a 100644
--- a/include/sound/compress_params.h
+++ b/include/uapi/sound/compress_params.h
diff --git a/include/uapi/sound/emu10k1.h b/include/uapi/sound/emu10k1.h
new file mode 100644
index 000000000000..d1bbaf78457a
--- /dev/null
+++ b/include/uapi/sound/emu10k1.h
@@ -0,0 +1,373 @@
1/*
2 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
3 * Creative Labs, Inc.
4 * Definitions for EMU10K1 (SB Live!) chips
5 *
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22#ifndef _UAPI__SOUND_EMU10K1_H
23#define _UAPI__SOUND_EMU10K1_H
24
25#include <linux/types.h>
26
27
28
29/*
30 * ---- FX8010 ----
31 */
32
33#define EMU10K1_CARD_CREATIVE 0x00000000
34#define EMU10K1_CARD_EMUAPS 0x00000001
35
36#define EMU10K1_FX8010_PCM_COUNT 8
37
38/* instruction set */
39#define iMAC0 0x00 /* R = A + (X * Y >> 31) ; saturation */
40#define iMAC1 0x01 /* R = A + (-X * Y >> 31) ; saturation */
41#define iMAC2 0x02 /* R = A + (X * Y >> 31) ; wraparound */
42#define iMAC3 0x03 /* R = A + (-X * Y >> 31) ; wraparound */
43#define iMACINT0 0x04 /* R = A + X * Y ; saturation */
44#define iMACINT1 0x05 /* R = A + X * Y ; wraparound (31-bit) */
45#define iACC3 0x06 /* R = A + X + Y ; saturation */
46#define iMACMV 0x07 /* R = A, acc += X * Y >> 31 */
47#define iANDXOR 0x08 /* R = (A & X) ^ Y */
48#define iTSTNEG 0x09 /* R = (A >= Y) ? X : ~X */
49#define iLIMITGE 0x0a /* R = (A >= Y) ? X : Y */
50#define iLIMITLT 0x0b /* R = (A < Y) ? X : Y */
51#define iLOG 0x0c /* R = linear_data, A (log_data), X (max_exp), Y (format_word) */
52#define iEXP 0x0d /* R = log_data, A (linear_data), X (max_exp), Y (format_word) */
53#define iINTERP 0x0e /* R = A + (X * (Y - A) >> 31) ; saturation */
54#define iSKIP 0x0f /* R = A (cc_reg), X (count), Y (cc_test) */
55
56/* GPRs */
57#define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */
58#define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */
59#define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */
60#define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */
61 /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */
62
63#define C_00000000 0x40
64#define C_00000001 0x41
65#define C_00000002 0x42
66#define C_00000003 0x43
67#define C_00000004 0x44
68#define C_00000008 0x45
69#define C_00000010 0x46
70#define C_00000020 0x47
71#define C_00000100 0x48
72#define C_00010000 0x49
73#define C_00080000 0x4a
74#define C_10000000 0x4b
75#define C_20000000 0x4c
76#define C_40000000 0x4d
77#define C_80000000 0x4e
78#define C_7fffffff 0x4f
79#define C_ffffffff 0x50
80#define C_fffffffe 0x51
81#define C_c0000000 0x52
82#define C_4f1bbcdc 0x53
83#define C_5a7ef9db 0x54
84#define C_00100000 0x55 /* ?? */
85#define GPR_ACCU 0x56 /* ACCUM, accumulator */
86#define GPR_COND 0x57 /* CCR, condition register */
87#define GPR_NOISE0 0x58 /* noise source */
88#define GPR_NOISE1 0x59 /* noise source */
89#define GPR_IRQ 0x5a /* IRQ register */
90#define GPR_DBAC 0x5b /* TRAM Delay Base Address Counter */
91#define GPR(x) (FXGPREGBASE + (x)) /* free GPRs: x = 0x00 - 0xff */
92#define ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
93#define ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
94#define ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0x7f */
95#define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */
96
97#define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
98#define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
99#define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
100#define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
101#define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */
102#define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */
103
104#define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */
105#define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */
106#define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */
107#define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */
108#define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */
109#define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */
110#define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */
111#define A3_EMU32IN(x) (0x160 + (x)) /* x = 0x00 - 0x3f "EMU32_IN_00 - _3F" - Only when .device = 0x0008 */
112#define A3_EMU32OUT(x) (0x1E0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_00 - _3F" - Only when .device = 0x0008 */
113#define A_GPR(x) (A_FXGPREGBASE + (x))
114
115/* cc_reg constants */
116#define CC_REG_NORMALIZED C_00000001
117#define CC_REG_BORROW C_00000002
118#define CC_REG_MINUS C_00000004
119#define CC_REG_ZERO C_00000008
120#define CC_REG_SATURATE C_00000010
121#define CC_REG_NONZERO C_00000100
122
123/* FX buses */
124#define FXBUS_PCM_LEFT 0x00
125#define FXBUS_PCM_RIGHT 0x01
126#define FXBUS_PCM_LEFT_REAR 0x02
127#define FXBUS_PCM_RIGHT_REAR 0x03
128#define FXBUS_MIDI_LEFT 0x04
129#define FXBUS_MIDI_RIGHT 0x05
130#define FXBUS_PCM_CENTER 0x06
131#define FXBUS_PCM_LFE 0x07
132#define FXBUS_PCM_LEFT_FRONT 0x08
133#define FXBUS_PCM_RIGHT_FRONT 0x09
134#define FXBUS_MIDI_REVERB 0x0c
135#define FXBUS_MIDI_CHORUS 0x0d
136#define FXBUS_PCM_LEFT_SIDE 0x0e
137#define FXBUS_PCM_RIGHT_SIDE 0x0f
138#define FXBUS_PT_LEFT 0x14
139#define FXBUS_PT_RIGHT 0x15
140
141/* Inputs */
142#define EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
143#define EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
144#define EXTIN_SPDIF_CD_L 0x02 /* internal S/PDIF CD - onboard - left */
145#define EXTIN_SPDIF_CD_R 0x03 /* internal S/PDIF CD - onboard - right */
146#define EXTIN_ZOOM_L 0x04 /* Zoom Video I2S - left */
147#define EXTIN_ZOOM_R 0x05 /* Zoom Video I2S - right */
148#define EXTIN_TOSLINK_L 0x06 /* LiveDrive - TOSLink Optical - left */
149#define EXTIN_TOSLINK_R 0x07 /* LiveDrive - TOSLink Optical - right */
150#define EXTIN_LINE1_L 0x08 /* LiveDrive - Line/Mic 1 - left */
151#define EXTIN_LINE1_R 0x09 /* LiveDrive - Line/Mic 1 - right */
152#define EXTIN_COAX_SPDIF_L 0x0a /* LiveDrive - Coaxial S/PDIF - left */
153#define EXTIN_COAX_SPDIF_R 0x0b /* LiveDrive - Coaxial S/PDIF - right */
154#define EXTIN_LINE2_L 0x0c /* LiveDrive - Line/Mic 2 - left */
155#define EXTIN_LINE2_R 0x0d /* LiveDrive - Line/Mic 2 - right */
156
157/* Outputs */
158#define EXTOUT_AC97_L 0x00 /* AC'97 playback channel - left */
159#define EXTOUT_AC97_R 0x01 /* AC'97 playback channel - right */
160#define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */
161#define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */
162#define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */
163#define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */
164#define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */
165#define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */
166#define EXTOUT_REAR_L 0x08 /* Rear channel - left */
167#define EXTOUT_REAR_R 0x09 /* Rear channel - right */
168#define EXTOUT_ADC_CAP_L 0x0a /* ADC Capture buffer - left */
169#define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */
170#define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */
171#define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */
172#define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */
173#define EXTOUT_ACENTER 0x11 /* Analog Center */
174#define EXTOUT_ALFE 0x12 /* Analog LFE */
175
176/* Audigy Inputs */
177#define A_EXTIN_AC97_L 0x00 /* AC'97 capture channel - left */
178#define A_EXTIN_AC97_R 0x01 /* AC'97 capture channel - right */
179#define A_EXTIN_SPDIF_CD_L 0x02 /* digital CD left */
180#define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */
181#define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */
182#define A_EXTIN_OPT_SPDIF_R 0x05 /* right */
183#define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */
184#define A_EXTIN_LINE2_R 0x09 /* right */
185#define A_EXTIN_ADC_L 0x0a /* Philips ADC - left */
186#define A_EXTIN_ADC_R 0x0b /* right */
187#define A_EXTIN_AUX2_L 0x0c /* audigy drive aux2 - left */
188#define A_EXTIN_AUX2_R 0x0d /* - right */
189
190/* Audigiy Outputs */
191#define A_EXTOUT_FRONT_L 0x00 /* digital front left */
192#define A_EXTOUT_FRONT_R 0x01 /* right */
193#define A_EXTOUT_CENTER 0x02 /* digital front center */
194#define A_EXTOUT_LFE 0x03 /* digital front lfe */
195#define A_EXTOUT_HEADPHONE_L 0x04 /* headphone audigy drive left */
196#define A_EXTOUT_HEADPHONE_R 0x05 /* right */
197#define A_EXTOUT_REAR_L 0x06 /* digital rear left */
198#define A_EXTOUT_REAR_R 0x07 /* right */
199#define A_EXTOUT_AFRONT_L 0x08 /* analog front left */
200#define A_EXTOUT_AFRONT_R 0x09 /* right */
201#define A_EXTOUT_ACENTER 0x0a /* analog center */
202#define A_EXTOUT_ALFE 0x0b /* analog LFE */
203#define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */
204#define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */
205#define A_EXTOUT_AREAR_L 0x0e /* analog rear left */
206#define A_EXTOUT_AREAR_R 0x0f /* right */
207#define A_EXTOUT_AC97_L 0x10 /* AC97 left (front) */
208#define A_EXTOUT_AC97_R 0x11 /* right */
209#define A_EXTOUT_ADC_CAP_L 0x16 /* ADC capture buffer left */
210#define A_EXTOUT_ADC_CAP_R 0x17 /* right */
211#define A_EXTOUT_MIC_CAP 0x18 /* Mic capture buffer */
212
213/* Audigy constants */
214#define A_C_00000000 0xc0
215#define A_C_00000001 0xc1
216#define A_C_00000002 0xc2
217#define A_C_00000003 0xc3
218#define A_C_00000004 0xc4
219#define A_C_00000008 0xc5
220#define A_C_00000010 0xc6
221#define A_C_00000020 0xc7
222#define A_C_00000100 0xc8
223#define A_C_00010000 0xc9
224#define A_C_00000800 0xca
225#define A_C_10000000 0xcb
226#define A_C_20000000 0xcc
227#define A_C_40000000 0xcd
228#define A_C_80000000 0xce
229#define A_C_7fffffff 0xcf
230#define A_C_ffffffff 0xd0
231#define A_C_fffffffe 0xd1
232#define A_C_c0000000 0xd2
233#define A_C_4f1bbcdc 0xd3
234#define A_C_5a7ef9db 0xd4
235#define A_C_00100000 0xd5
236#define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */
237#define A_GPR_COND 0xd7 /* CCR, condition register */
238#define A_GPR_NOISE0 0xd8 /* noise source */
239#define A_GPR_NOISE1 0xd9 /* noise source */
240#define A_GPR_IRQ 0xda /* IRQ register */
241#define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */
242#define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */
243
244/* definitions for debug register */
245#define EMU10K1_DBG_ZC 0x80000000 /* zero tram counter */
246#define EMU10K1_DBG_SATURATION_OCCURED 0x02000000 /* saturation control */
247#define EMU10K1_DBG_SATURATION_ADDR 0x01ff0000 /* saturation address */
248#define EMU10K1_DBG_SINGLE_STEP 0x00008000 /* single step mode */
249#define EMU10K1_DBG_STEP 0x00004000 /* start single step */
250#define EMU10K1_DBG_CONDITION_CODE 0x00003e00 /* condition code */
251#define EMU10K1_DBG_SINGLE_STEP_ADDR 0x000001ff /* single step address */
252
253/* tank memory address line */
254#ifndef __KERNEL__
255#define TANKMEMADDRREG_ADDR_MASK 0x000fffff /* 20 bit tank address field */
256#define TANKMEMADDRREG_CLEAR 0x00800000 /* Clear tank memory */
257#define TANKMEMADDRREG_ALIGN 0x00400000 /* Align read or write relative to tank access */
258#define TANKMEMADDRREG_WRITE 0x00200000 /* Write to tank memory */
259#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
260#endif
261
262struct snd_emu10k1_fx8010_info {
263 unsigned int internal_tram_size; /* in samples */
264 unsigned int external_tram_size; /* in samples */
265 char fxbus_names[16][32]; /* names of FXBUSes */
266 char extin_names[16][32]; /* names of external inputs */
267 char extout_names[32][32]; /* names of external outputs */
268 unsigned int gpr_controls; /* count of GPR controls */
269};
270
271#define EMU10K1_GPR_TRANSLATION_NONE 0
272#define EMU10K1_GPR_TRANSLATION_TABLE100 1
273#define EMU10K1_GPR_TRANSLATION_BASS 2
274#define EMU10K1_GPR_TRANSLATION_TREBLE 3
275#define EMU10K1_GPR_TRANSLATION_ONOFF 4
276
277struct snd_emu10k1_fx8010_control_gpr {
278 struct snd_ctl_elem_id id; /* full control ID definition */
279 unsigned int vcount; /* visible count */
280 unsigned int count; /* count of GPR (1..16) */
281 unsigned short gpr[32]; /* GPR number(s) */
282 unsigned int value[32]; /* initial values */
283 unsigned int min; /* minimum range */
284 unsigned int max; /* maximum range */
285 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
286 const unsigned int *tlv;
287};
288
289/* old ABI without TLV support */
290struct snd_emu10k1_fx8010_control_old_gpr {
291 struct snd_ctl_elem_id id;
292 unsigned int vcount;
293 unsigned int count;
294 unsigned short gpr[32];
295 unsigned int value[32];
296 unsigned int min;
297 unsigned int max;
298 unsigned int translation;
299};
300
301struct snd_emu10k1_fx8010_code {
302 char name[128];
303
304 DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
305 __u32 __user *gpr_map; /* initializers */
306
307 unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
308 struct snd_emu10k1_fx8010_control_gpr __user *gpr_add_controls; /* GPR controls to add/replace */
309
310 unsigned int gpr_del_control_count; /* count of GPR controls to remove */
311 struct snd_ctl_elem_id __user *gpr_del_controls; /* IDs of GPR controls to remove */
312
313 unsigned int gpr_list_control_count; /* count of GPR controls to list */
314 unsigned int gpr_list_control_total; /* total count of GPR controls */
315 struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */
316
317 DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
318 __u32 __user *tram_data_map; /* data initializers */
319 __u32 __user *tram_addr_map; /* map initializers */
320
321 DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
322 __u32 __user *code; /* one instruction - 64 bits */
323};
324
325struct snd_emu10k1_fx8010_tram {
326 unsigned int address; /* 31.bit == 1 -> external TRAM */
327 unsigned int size; /* size in samples (4 bytes) */
328 unsigned int *samples; /* pointer to samples (20-bit) */
329 /* NULL->clear memory */
330};
331
332struct snd_emu10k1_fx8010_pcm_rec {
333 unsigned int substream; /* substream number */
334 unsigned int res1; /* reserved */
335 unsigned int channels; /* 16-bit channels count, zero = remove this substream */
336 unsigned int tram_start; /* ring buffer position in TRAM (in samples) */
337 unsigned int buffer_size; /* count of buffered samples */
338 unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */
339 unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */
340 unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */
341 unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */
342 unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
343 unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
344 unsigned char pad; /* reserved */
345 unsigned char etram[32]; /* external TRAM address & data (one per channel) */
346 unsigned int res2; /* reserved */
347};
348
349#define SNDRV_EMU10K1_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
350
351#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
352#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
353#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
354#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int)
355#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram)
356#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
357#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
358#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
359#define SNDRV_EMU10K1_IOCTL_PVERSION _IOR ('H', 0x40, int)
360#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80)
361#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81)
362#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
363#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)
364#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)
365
366/* typedefs for compatibility to user-space */
367typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t;
368typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t;
369typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t;
370typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t;
371typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t;
372
373#endif /* _UAPI__SOUND_EMU10K1_H */
diff --git a/include/sound/hdsp.h b/include/uapi/sound/hdsp.h
index 0909a3843479..0909a3843479 100644
--- a/include/sound/hdsp.h
+++ b/include/uapi/sound/hdsp.h
diff --git a/include/sound/hdspm.h b/include/uapi/sound/hdspm.h
index 1f59ea2a4a76..1f59ea2a4a76 100644
--- a/include/sound/hdspm.h
+++ b/include/uapi/sound/hdspm.h
diff --git a/include/uapi/sound/sb16_csp.h b/include/uapi/sound/sb16_csp.h
new file mode 100644
index 000000000000..3b96907e2afb
--- /dev/null
+++ b/include/uapi/sound/sb16_csp.h
@@ -0,0 +1,122 @@
1/*
2 * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si>
3 * Takashi Iwai <tiwai@suse.de>
4 *
5 * SB16ASP/AWE32 CSP control
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22#ifndef _UAPI__SOUND_SB16_CSP_H
23#define _UAPI__SOUND_SB16_CSP_H
24
25
26/* CSP modes */
27#define SNDRV_SB_CSP_MODE_NONE 0x00
28#define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */
29#define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */
30#define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */
31
32/* CSP load flags */
33#define SNDRV_SB_CSP_LOAD_FROMUSER 0x01
34#define SNDRV_SB_CSP_LOAD_INITBLOCK 0x02
35
36/* CSP sample width */
37#define SNDRV_SB_CSP_SAMPLE_8BIT 0x01
38#define SNDRV_SB_CSP_SAMPLE_16BIT 0x02
39
40/* CSP channels */
41#define SNDRV_SB_CSP_MONO 0x01
42#define SNDRV_SB_CSP_STEREO 0x02
43
44/* CSP rates */
45#define SNDRV_SB_CSP_RATE_8000 0x01
46#define SNDRV_SB_CSP_RATE_11025 0x02
47#define SNDRV_SB_CSP_RATE_22050 0x04
48#define SNDRV_SB_CSP_RATE_44100 0x08
49#define SNDRV_SB_CSP_RATE_ALL 0x0f
50
51/* CSP running state */
52#define SNDRV_SB_CSP_ST_IDLE 0x00
53#define SNDRV_SB_CSP_ST_LOADED 0x01
54#define SNDRV_SB_CSP_ST_RUNNING 0x02
55#define SNDRV_SB_CSP_ST_PAUSED 0x04
56#define SNDRV_SB_CSP_ST_AUTO 0x08
57#define SNDRV_SB_CSP_ST_QSOUND 0x10
58
59/* maximum QSound value (180 degrees right) */
60#define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x20
61
62/* maximum microcode RIFF file size */
63#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000
64
65/* microcode header */
66struct snd_sb_csp_mc_header {
67 char codec_name[16]; /* id name of codec */
68 unsigned short func_req; /* requested function */
69};
70
71/* microcode to be loaded */
72struct snd_sb_csp_microcode {
73 struct snd_sb_csp_mc_header info;
74 unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
75};
76
77/* start CSP with sample_width in mono/stereo */
78struct snd_sb_csp_start {
79 int sample_width; /* sample width, look above */
80 int channels; /* channels, look above */
81};
82
83/* CSP information */
84struct snd_sb_csp_info {
85 char codec_name[16]; /* id name of codec */
86 unsigned short func_nr; /* function number */
87 unsigned int acc_format; /* accepted PCM formats */
88 unsigned short acc_channels; /* accepted channels */
89 unsigned short acc_width; /* accepted sample width */
90 unsigned short acc_rates; /* accepted sample rates */
91 unsigned short csp_mode; /* CSP mode, see above */
92 unsigned short run_channels; /* current channels */
93 unsigned short run_width; /* current sample width */
94 unsigned short version; /* version id: 0x10 - 0x1f */
95 unsigned short state; /* state bits */
96};
97
98/* HWDEP controls */
99/* get CSP information */
100#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info)
101/* load microcode to CSP */
102/* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits)
103 * defined for some architectures like MIPS, and it leads to build errors.
104 * (x86 and co have 14-bit size, thus it's valid, though.)
105 * As a workaround for skipping the size-limit check, here we don't use the
106 * normal _IOW() macro but _IOC() with the manual argument.
107 */
108#define SNDRV_SB_CSP_IOCTL_LOAD_CODE \
109 _IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode))
110/* unload microcode from CSP */
111#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
112/* start CSP */
113#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, struct snd_sb_csp_start)
114/* stop CSP */
115#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14)
116/* pause CSP and DMA transfer */
117#define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15)
118/* restart CSP and DMA transfer */
119#define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16)
120
121
122#endif /* _UAPI__SOUND_SB16_CSP_H */
diff --git a/include/sound/sfnt_info.h b/include/uapi/sound/sfnt_info.h
index 1bce7fd1725f..1bce7fd1725f 100644
--- a/include/sound/sfnt_info.h
+++ b/include/uapi/sound/sfnt_info.h
diff --git a/include/video/da8xx-fb.h b/include/video/da8xx-fb.h
index 5a0e4f9efb53..f88825928dd1 100644
--- a/include/video/da8xx-fb.h
+++ b/include/video/da8xx-fb.h
@@ -12,10 +12,6 @@
12#ifndef DA8XX_FB_H 12#ifndef DA8XX_FB_H
13#define DA8XX_FB_H 13#define DA8XX_FB_H
14 14
15enum panel_type {
16 QVGA = 0
17};
18
19enum panel_shade { 15enum panel_shade {
20 MONOCHROME = 0, 16 MONOCHROME = 0,
21 COLOR_ACTIVE, 17 COLOR_ACTIVE,
@@ -27,13 +23,6 @@ enum raster_load_mode {
27 LOAD_PALETTE, 23 LOAD_PALETTE,
28}; 24};
29 25
30struct display_panel {
31 enum panel_type panel_type; /* QVGA */
32 int max_bpp;
33 int min_bpp;
34 enum panel_shade panel_shade;
35};
36
37struct da8xx_lcdc_platform_data { 26struct da8xx_lcdc_platform_data {
38 const char manu_name[10]; 27 const char manu_name[10];
39 void *controller_data; 28 void *controller_data;
@@ -42,7 +31,7 @@ struct da8xx_lcdc_platform_data {
42}; 31};
43 32
44struct lcd_ctrl_config { 33struct lcd_ctrl_config {
45 const struct display_panel *p_disp_panel; 34 enum panel_shade panel_shade;
46 35
47 /* AC Bias Pin Frequency */ 36 /* AC Bias Pin Frequency */
48 int ac_bias; 37 int ac_bias;
@@ -68,18 +57,9 @@ struct lcd_ctrl_config {
68 /* Mono 8-bit Mode: 1=D0-D7 or 0=D0-D3 */ 57 /* Mono 8-bit Mode: 1=D0-D7 or 0=D0-D3 */
69 unsigned char mono_8bit_mode; 58 unsigned char mono_8bit_mode;
70 59
71 /* Invert line clock */
72 unsigned char invert_line_clock;
73
74 /* Invert frame clock */
75 unsigned char invert_frm_clock;
76
77 /* Horizontal and Vertical Sync Edge: 0=rising 1=falling */ 60 /* Horizontal and Vertical Sync Edge: 0=rising 1=falling */
78 unsigned char sync_edge; 61 unsigned char sync_edge;
79 62
80 /* Horizontal and Vertical Sync: Control: 0=ignore */
81 unsigned char sync_ctrl;
82
83 /* Raster Data Order Select: 1=Most-to-least 0=Least-to-most */ 63 /* Raster Data Order Select: 1=Most-to-least 0=Least-to-most */
84 unsigned char raster_order; 64 unsigned char raster_order;
85 65
@@ -103,5 +83,8 @@ struct lcd_sync_arg {
103#define FBIPUT_HSYNC _IOW('F', 9, int) 83#define FBIPUT_HSYNC _IOW('F', 9, int)
104#define FBIPUT_VSYNC _IOW('F', 10, int) 84#define FBIPUT_VSYNC _IOW('F', 10, int)
105 85
86/* Proprietary FB_SYNC_ flags */
87#define FB_SYNC_CLK_INVERT 0x40000000
88
106#endif /* ifndef DA8XX_FB_H */ 89#endif /* ifndef DA8XX_FB_H */
107 90
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 3729173b7fbc..caefa093337d 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -21,6 +21,7 @@
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/kobject.h> 22#include <linux/kobject.h>
23#include <linux/device.h> 23#include <linux/device.h>
24#include <linux/interrupt.h>
24 25
25#define DISPC_IRQ_FRAMEDONE (1 << 0) 26#define DISPC_IRQ_FRAMEDONE (1 << 0)
26#define DISPC_IRQ_VSYNC (1 << 1) 27#define DISPC_IRQ_VSYNC (1 << 1)
@@ -55,6 +56,7 @@
55 56
56struct omap_dss_device; 57struct omap_dss_device;
57struct omap_overlay_manager; 58struct omap_overlay_manager;
59struct dss_lcd_mgr_config;
58struct snd_aes_iec958; 60struct snd_aes_iec958;
59struct snd_cea_861_aud_if; 61struct snd_cea_861_aud_if;
60 62
@@ -158,7 +160,6 @@ enum omap_display_caps {
158enum omap_dss_display_state { 160enum omap_dss_display_state {
159 OMAP_DSS_DISPLAY_DISABLED = 0, 161 OMAP_DSS_DISPLAY_DISABLED = 0,
160 OMAP_DSS_DISPLAY_ACTIVE, 162 OMAP_DSS_DISPLAY_ACTIVE,
161 OMAP_DSS_DISPLAY_SUSPENDED,
162}; 163};
163 164
164enum omap_dss_audio_state { 165enum omap_dss_audio_state {
@@ -314,6 +315,19 @@ int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);
314int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel); 315int dsi_enable_video_output(struct omap_dss_device *dssdev, int channel);
315void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel); 316void dsi_disable_video_output(struct omap_dss_device *dssdev, int channel);
316 317
318enum omapdss_version {
319 OMAPDSS_VER_UNKNOWN = 0,
320 OMAPDSS_VER_OMAP24xx,
321 OMAPDSS_VER_OMAP34xx_ES1, /* OMAP3430 ES1.0, 2.0 */
322 OMAPDSS_VER_OMAP34xx_ES3, /* OMAP3430 ES3.0+ */
323 OMAPDSS_VER_OMAP3630,
324 OMAPDSS_VER_AM35xx,
325 OMAPDSS_VER_OMAP4430_ES1, /* OMAP4430 ES1.0 */
326 OMAPDSS_VER_OMAP4430_ES2, /* OMAP4430 ES2.0, 2.1, 2.2 */
327 OMAPDSS_VER_OMAP4, /* All other OMAP4s */
328 OMAPDSS_VER_OMAP5,
329};
330
317/* Board specific data */ 331/* Board specific data */
318struct omap_dss_board_info { 332struct omap_dss_board_info {
319 int (*get_context_loss_count)(struct device *dev); 333 int (*get_context_loss_count)(struct device *dev);
@@ -323,6 +337,7 @@ struct omap_dss_board_info {
323 int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask); 337 int (*dsi_enable_pads)(int dsi_id, unsigned lane_mask);
324 void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask); 338 void (*dsi_disable_pads)(int dsi_id, unsigned lane_mask);
325 int (*set_min_bus_tput)(struct device *dev, unsigned long r); 339 int (*set_min_bus_tput)(struct device *dev, unsigned long r);
340 enum omapdss_version version;
326}; 341};
327 342
328/* Init with the board info */ 343/* Init with the board info */
@@ -607,10 +622,6 @@ struct omap_dss_device {
607 struct { 622 struct {
608 struct omap_video_timings timings; 623 struct omap_video_timings timings;
609 624
610 int acbi; /* ac-bias pin transitions per interrupt */
611 /* Unit: line clocks */
612 int acb; /* ac-bias pin frequency */
613
614 enum omap_dss_dsi_pixel_format dsi_pix_fmt; 625 enum omap_dss_dsi_pixel_format dsi_pix_fmt;
615 enum omap_dss_dsi_mode dsi_mode; 626 enum omap_dss_dsi_mode dsi_mode;
616 struct omap_dss_dsi_videomode_timings dsi_vm_timings; 627 struct omap_dss_dsi_videomode_timings dsi_vm_timings;
@@ -672,8 +683,6 @@ struct omap_dss_driver {
672 683
673 int (*enable)(struct omap_dss_device *display); 684 int (*enable)(struct omap_dss_device *display);
674 void (*disable)(struct omap_dss_device *display); 685 void (*disable)(struct omap_dss_device *display);
675 int (*suspend)(struct omap_dss_device *display);
676 int (*resume)(struct omap_dss_device *display);
677 int (*run_test)(struct omap_dss_device *display, int test); 686 int (*run_test)(struct omap_dss_device *display, int test);
678 687
679 int (*update)(struct omap_dss_device *dssdev, 688 int (*update)(struct omap_dss_device *dssdev,
@@ -731,6 +740,8 @@ struct omap_dss_driver {
731 740
732}; 741};
733 742
743enum omapdss_version omapdss_get_version(void);
744
734int omap_dss_register_driver(struct omap_dss_driver *); 745int omap_dss_register_driver(struct omap_dss_driver *);
735void omap_dss_unregister_driver(struct omap_dss_driver *); 746void omap_dss_unregister_driver(struct omap_dss_driver *);
736 747
@@ -740,10 +751,19 @@ void omap_dss_put_device(struct omap_dss_device *dssdev);
740struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from); 751struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from);
741struct omap_dss_device *omap_dss_find_device(void *data, 752struct omap_dss_device *omap_dss_find_device(void *data,
742 int (*match)(struct omap_dss_device *dssdev, void *data)); 753 int (*match)(struct omap_dss_device *dssdev, void *data));
754const char *omapdss_get_default_display_name(void);
743 755
744int omap_dss_start_device(struct omap_dss_device *dssdev); 756int omap_dss_start_device(struct omap_dss_device *dssdev);
745void omap_dss_stop_device(struct omap_dss_device *dssdev); 757void omap_dss_stop_device(struct omap_dss_device *dssdev);
746 758
759int dss_feat_get_num_mgrs(void);
760int dss_feat_get_num_ovls(void);
761enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel);
762enum omap_dss_output_id dss_feat_get_supported_outputs(enum omap_channel channel);
763enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane);
764
765
766
747int omap_dss_get_num_overlay_managers(void); 767int omap_dss_get_num_overlay_managers(void);
748struct omap_overlay_manager *omap_dss_get_overlay_manager(int num); 768struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
749 769
@@ -765,9 +785,43 @@ typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
765int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask); 785int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
766int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask); 786int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
767 787
768int omap_dispc_wait_for_irq_timeout(u32 irqmask, unsigned long timeout); 788u32 dispc_read_irqstatus(void);
769int omap_dispc_wait_for_irq_interruptible_timeout(u32 irqmask, 789void dispc_clear_irqstatus(u32 mask);
770 unsigned long timeout); 790u32 dispc_read_irqenable(void);
791void dispc_write_irqenable(u32 mask);
792
793int dispc_request_irq(irq_handler_t handler, void *dev_id);
794void dispc_free_irq(void *dev_id);
795
796int dispc_runtime_get(void);
797void dispc_runtime_put(void);
798
799void dispc_mgr_enable(enum omap_channel channel, bool enable);
800bool dispc_mgr_is_enabled(enum omap_channel channel);
801u32 dispc_mgr_get_vsync_irq(enum omap_channel channel);
802u32 dispc_mgr_get_framedone_irq(enum omap_channel channel);
803u32 dispc_mgr_get_sync_lost_irq(enum omap_channel channel);
804bool dispc_mgr_go_busy(enum omap_channel channel);
805void dispc_mgr_go(enum omap_channel channel);
806void dispc_mgr_set_lcd_config(enum omap_channel channel,
807 const struct dss_lcd_mgr_config *config);
808void dispc_mgr_set_timings(enum omap_channel channel,
809 const struct omap_video_timings *timings);
810void dispc_mgr_setup(enum omap_channel channel,
811 const struct omap_overlay_manager_info *info);
812
813int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel,
814 const struct omap_overlay_info *oi,
815 const struct omap_video_timings *timings,
816 int *x_predecim, int *y_predecim);
817
818int dispc_ovl_enable(enum omap_plane plane, bool enable);
819bool dispc_ovl_enabled(enum omap_plane plane);
820void dispc_ovl_set_channel_out(enum omap_plane plane,
821 enum omap_channel channel);
822int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
823 bool replication, const struct omap_video_timings *mgr_timings,
824 bool mem_to_mem);
771 825
772#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver) 826#define to_dss_driver(x) container_of((x), struct omap_dss_driver, driver)
773#define to_dss_device(x) container_of((x), struct omap_dss_device, dev) 827#define to_dss_device(x) container_of((x), struct omap_dss_device, dev)
@@ -826,4 +880,35 @@ void omapdss_rfbi_set_data_lines(struct omap_dss_device *dssdev,
826void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev, 880void omapdss_rfbi_set_interface_timings(struct omap_dss_device *dssdev,
827 struct rfbi_timings *timings); 881 struct rfbi_timings *timings);
828 882
883int omapdss_compat_init(void);
884void omapdss_compat_uninit(void);
885
886struct dss_mgr_ops {
887 void (*start_update)(struct omap_overlay_manager *mgr);
888 int (*enable)(struct omap_overlay_manager *mgr);
889 void (*disable)(struct omap_overlay_manager *mgr);
890 void (*set_timings)(struct omap_overlay_manager *mgr,
891 const struct omap_video_timings *timings);
892 void (*set_lcd_config)(struct omap_overlay_manager *mgr,
893 const struct dss_lcd_mgr_config *config);
894 int (*register_framedone_handler)(struct omap_overlay_manager *mgr,
895 void (*handler)(void *), void *data);
896 void (*unregister_framedone_handler)(struct omap_overlay_manager *mgr,
897 void (*handler)(void *), void *data);
898};
899
900int dss_install_mgr_ops(const struct dss_mgr_ops *mgr_ops);
901void dss_uninstall_mgr_ops(void);
902
903void dss_mgr_set_timings(struct omap_overlay_manager *mgr,
904 const struct omap_video_timings *timings);
905void dss_mgr_set_lcd_config(struct omap_overlay_manager *mgr,
906 const struct dss_lcd_mgr_config *config);
907int dss_mgr_enable(struct omap_overlay_manager *mgr);
908void dss_mgr_disable(struct omap_overlay_manager *mgr);
909void dss_mgr_start_update(struct omap_overlay_manager *mgr);
910int dss_mgr_register_framedone_handler(struct omap_overlay_manager *mgr,
911 void (*handler)(void *), void *data);
912void dss_mgr_unregister_framedone_handler(struct omap_overlay_manager *mgr,
913 void (*handler)(void *), void *data);
829#endif 914#endif
diff --git a/include/video/omapvrfb.h b/include/video/omapvrfb.h
new file mode 100644
index 000000000000..bb0bd89f8bc6
--- /dev/null
+++ b/include/video/omapvrfb.h
@@ -0,0 +1,68 @@
1/*
2 * VRFB Rotation Engine
3 *
4 * Copyright (C) 2009 Nokia Corporation
5 * Author: Tomi Valkeinen <tomi.valkeinen@nokia.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 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21#ifndef __OMAP_VRFB_H__
22#define __OMAP_VRFB_H__
23
24#define OMAP_VRFB_LINE_LEN 2048
25
26struct vrfb {
27 u8 context;
28 void __iomem *vaddr[4];
29 unsigned long paddr[4];
30 u16 xres;
31 u16 yres;
32 u16 xoffset;
33 u16 yoffset;
34 u8 bytespp;
35 bool yuv_mode;
36};
37
38#ifdef CONFIG_OMAP2_VRFB
39extern bool omap_vrfb_supported(void);
40extern int omap_vrfb_request_ctx(struct vrfb *vrfb);
41extern void omap_vrfb_release_ctx(struct vrfb *vrfb);
42extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
43 u8 bytespp);
44extern u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp);
45extern u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp);
46extern void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
47 u16 width, u16 height,
48 unsigned bytespp, bool yuv_mode);
49extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot);
50extern void omap_vrfb_restore_context(void);
51
52#else
53static inline bool omap_vrfb_supported(void) { return false; }
54static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; }
55static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {}
56static inline void omap_vrfb_adjust_size(u16 *width, u16 *height,
57 u8 bytespp) {}
58static inline u32 omap_vrfb_min_phys_size(u16 width, u16 height, u8 bytespp)
59 { return 0; }
60static inline u16 omap_vrfb_max_height(u32 phys_size, u16 width, u8 bytespp)
61 { return 0; }
62static inline void omap_vrfb_setup(struct vrfb *vrfb, unsigned long paddr,
63 u16 width, u16 height, unsigned bytespp, bool yuv_mode) {}
64static inline int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot)
65 { return 0; }
66static inline void omap_vrfb_restore_context(void) {}
67#endif
68#endif /* __VRFB_H */
diff --git a/include/video/samsung_fimd.h b/include/video/samsung_fimd.h
index 7ae6c07f2ef8..e7554486a2b7 100644
--- a/include/video/samsung_fimd.h
+++ b/include/video/samsung_fimd.h
@@ -24,12 +24,15 @@
24 24
25#define VIDCON0 (0x00) 25#define VIDCON0 (0x00)
26#define VIDCON0_INTERLACE (1 << 29) 26#define VIDCON0_INTERLACE (1 << 29)
27#define VIDCON0_VIDOUT_MASK (0x3 << 26) 27#define VIDCON0_VIDOUT_MASK (0x7 << 26)
28#define VIDCON0_VIDOUT_SHIFT (26) 28#define VIDCON0_VIDOUT_SHIFT (26)
29#define VIDCON0_VIDOUT_RGB (0x0 << 26) 29#define VIDCON0_VIDOUT_RGB (0x0 << 26)
30#define VIDCON0_VIDOUT_TV (0x1 << 26) 30#define VIDCON0_VIDOUT_TV (0x1 << 26)
31#define VIDCON0_VIDOUT_I80_LDI0 (0x2 << 26) 31#define VIDCON0_VIDOUT_I80_LDI0 (0x2 << 26)
32#define VIDCON0_VIDOUT_I80_LDI1 (0x3 << 26) 32#define VIDCON0_VIDOUT_I80_LDI1 (0x3 << 26)
33#define VIDCON0_VIDOUT_WB_RGB (0x4 << 26)
34#define VIDCON0_VIDOUT_WB_I80_LDI0 (0x6 << 26)
35#define VIDCON0_VIDOUT_WB_I80_LDI1 (0x7 << 26)
33 36
34#define VIDCON0_L1_DATA_MASK (0x7 << 23) 37#define VIDCON0_L1_DATA_MASK (0x7 << 23)
35#define VIDCON0_L1_DATA_SHIFT (23) 38#define VIDCON0_L1_DATA_SHIFT (23)
@@ -77,6 +80,7 @@
77#define VIDCON1_LINECNT_MASK (0x7ff << 16) 80#define VIDCON1_LINECNT_MASK (0x7ff << 16)
78#define VIDCON1_LINECNT_SHIFT (16) 81#define VIDCON1_LINECNT_SHIFT (16)
79#define VIDCON1_LINECNT_GET(_v) (((_v) >> 16) & 0x7ff) 82#define VIDCON1_LINECNT_GET(_v) (((_v) >> 16) & 0x7ff)
83#define VIDCON1_FSTATUS_EVEN (1 << 15)
80#define VIDCON1_VSTATUS_MASK (0x3 << 13) 84#define VIDCON1_VSTATUS_MASK (0x3 << 13)
81#define VIDCON1_VSTATUS_SHIFT (13) 85#define VIDCON1_VSTATUS_SHIFT (13)
82#define VIDCON1_VSTATUS_VSYNC (0x0 << 13) 86#define VIDCON1_VSTATUS_VSYNC (0x0 << 13)
@@ -116,6 +120,7 @@
116 120
117/* VIDTCON0 */ 121/* VIDTCON0 */
118 122
123#define VIDTCON0 (0x10)
119#define VIDTCON0_VBPDE_MASK (0xff << 24) 124#define VIDTCON0_VBPDE_MASK (0xff << 24)
120#define VIDTCON0_VBPDE_SHIFT (24) 125#define VIDTCON0_VBPDE_SHIFT (24)
121#define VIDTCON0_VBPDE_LIMIT (0xff) 126#define VIDTCON0_VBPDE_LIMIT (0xff)
@@ -138,6 +143,7 @@
138 143
139/* VIDTCON1 */ 144/* VIDTCON1 */
140 145
146#define VIDTCON1 (0x14)
141#define VIDTCON1_VFPDE_MASK (0xff << 24) 147#define VIDTCON1_VFPDE_MASK (0xff << 24)
142#define VIDTCON1_VFPDE_SHIFT (24) 148#define VIDTCON1_VFPDE_SHIFT (24)
143#define VIDTCON1_VFPDE_LIMIT (0xff) 149#define VIDTCON1_VFPDE_LIMIT (0xff)
@@ -159,6 +165,7 @@
159#define VIDTCON1_HSPW(_x) ((_x) << 0) 165#define VIDTCON1_HSPW(_x) ((_x) << 0)
160 166
161#define VIDTCON2 (0x18) 167#define VIDTCON2 (0x18)
168#define VIDTCON2 (0x18)
162#define VIDTCON2_LINEVAL_E(_x) ((((_x) & 0x800) >> 11) << 23) 169#define VIDTCON2_LINEVAL_E(_x) ((((_x) & 0x800) >> 11) << 23)
163#define VIDTCON2_LINEVAL_MASK (0x7ff << 11) 170#define VIDTCON2_LINEVAL_MASK (0x7ff << 11)
164#define VIDTCON2_LINEVAL_SHIFT (11) 171#define VIDTCON2_LINEVAL_SHIFT (11)
@@ -173,18 +180,27 @@
173 180
174/* WINCONx */ 181/* WINCONx */
175 182
176 183#define WINCON(_win) (0x20 + ((_win) * 4))
184#define WINCONx_CSCWIDTH_MASK (0x3 << 26)
185#define WINCONx_CSCWIDTH_SHIFT (26)
186#define WINCONx_CSCWIDTH_WIDE (0x0 << 26)
187#define WINCONx_CSCWIDTH_NARROW (0x3 << 26)
188#define WINCONx_ENLOCAL (1 << 22)
189#define WINCONx_BUFSTATUS (1 << 21)
190#define WINCONx_BUFSEL (1 << 20)
191#define WINCONx_BUFAUTOEN (1 << 19)
177#define WINCONx_BITSWP (1 << 18) 192#define WINCONx_BITSWP (1 << 18)
178#define WINCONx_BYTSWP (1 << 17) 193#define WINCONx_BYTSWP (1 << 17)
179#define WINCONx_HAWSWP (1 << 16) 194#define WINCONx_HAWSWP (1 << 16)
180#define WINCONx_WSWP (1 << 15) 195#define WINCONx_WSWP (1 << 15)
196#define WINCONx_YCbCr (1 << 13)
181#define WINCONx_BURSTLEN_MASK (0x3 << 9) 197#define WINCONx_BURSTLEN_MASK (0x3 << 9)
182#define WINCONx_BURSTLEN_SHIFT (9) 198#define WINCONx_BURSTLEN_SHIFT (9)
183#define WINCONx_BURSTLEN_16WORD (0x0 << 9) 199#define WINCONx_BURSTLEN_16WORD (0x0 << 9)
184#define WINCONx_BURSTLEN_8WORD (0x1 << 9) 200#define WINCONx_BURSTLEN_8WORD (0x1 << 9)
185#define WINCONx_BURSTLEN_4WORD (0x2 << 9) 201#define WINCONx_BURSTLEN_4WORD (0x2 << 9)
186
187#define WINCONx_ENWIN (1 << 0) 202#define WINCONx_ENWIN (1 << 0)
203
188#define WINCON0_BPPMODE_MASK (0xf << 2) 204#define WINCON0_BPPMODE_MASK (0xf << 2)
189#define WINCON0_BPPMODE_SHIFT (2) 205#define WINCON0_BPPMODE_SHIFT (2)
190#define WINCON0_BPPMODE_1BPP (0x0 << 2) 206#define WINCON0_BPPMODE_1BPP (0x0 << 2)
@@ -196,9 +212,8 @@
196#define WINCON0_BPPMODE_18BPP_666 (0x8 << 2) 212#define WINCON0_BPPMODE_18BPP_666 (0x8 << 2)
197#define WINCON0_BPPMODE_24BPP_888 (0xb << 2) 213#define WINCON0_BPPMODE_24BPP_888 (0xb << 2)
198 214
215#define WINCON1_LOCALSEL_CAMIF (1 << 23)
199#define WINCON1_BLD_PIX (1 << 6) 216#define WINCON1_BLD_PIX (1 << 6)
200
201#define WINCON1_ALPHA_SEL (1 << 1)
202#define WINCON1_BPPMODE_MASK (0xf << 2) 217#define WINCON1_BPPMODE_MASK (0xf << 2)
203#define WINCON1_BPPMODE_SHIFT (2) 218#define WINCON1_BPPMODE_SHIFT (2)
204#define WINCON1_BPPMODE_1BPP (0x0 << 2) 219#define WINCON1_BPPMODE_1BPP (0x0 << 2)
@@ -216,6 +231,7 @@
216#define WINCON1_BPPMODE_24BPP_A1887 (0xc << 2) 231#define WINCON1_BPPMODE_24BPP_A1887 (0xc << 2)
217#define WINCON1_BPPMODE_25BPP_A1888 (0xd << 2) 232#define WINCON1_BPPMODE_25BPP_A1888 (0xd << 2)
218#define WINCON1_BPPMODE_28BPP_A4888 (0xd << 2) 233#define WINCON1_BPPMODE_28BPP_A4888 (0xd << 2)
234#define WINCON1_ALPHA_SEL (1 << 1)
219 235
220/* S5PV210 */ 236/* S5PV210 */
221#define SHADOWCON (0x34) 237#define SHADOWCON (0x34)
@@ -225,6 +241,9 @@
225/* Local input channels (windows 0-2) */ 241/* Local input channels (windows 0-2) */
226#define SHADOWCON_CHx_LOCAL_ENABLE(_win) (1 << (5 + (_win))) 242#define SHADOWCON_CHx_LOCAL_ENABLE(_win) (1 << (5 + (_win)))
227 243
244/* VIDOSDx */
245
246#define VIDOSD_BASE (0x40)
228#define VIDOSDxA_TOPLEFT_X_E(_x) ((((_x) & 0x800) >> 11) << 23) 247#define VIDOSDxA_TOPLEFT_X_E(_x) ((((_x) & 0x800) >> 11) << 23)
229#define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11) 248#define VIDOSDxA_TOPLEFT_X_MASK (0x7ff << 11)
230#define VIDOSDxA_TOPLEFT_X_SHIFT (11) 249#define VIDOSDxA_TOPLEFT_X_SHIFT (11)
@@ -293,6 +312,7 @@
293 312
294/* Interrupt controls and status */ 313/* Interrupt controls and status */
295 314
315#define VIDINTCON0 (0x130)
296#define VIDINTCON0_FIFOINTERVAL_MASK (0x3f << 20) 316#define VIDINTCON0_FIFOINTERVAL_MASK (0x3f << 20)
297#define VIDINTCON0_FIFOINTERVAL_SHIFT (20) 317#define VIDINTCON0_FIFOINTERVAL_SHIFT (20)
298#define VIDINTCON0_FIFOINTERVAL_LIMIT (0x3f) 318#define VIDINTCON0_FIFOINTERVAL_LIMIT (0x3f)
@@ -321,6 +341,9 @@
321#define VIDINTCON0_FIFIOSEL_SHIFT (5) 341#define VIDINTCON0_FIFIOSEL_SHIFT (5)
322#define VIDINTCON0_FIFIOSEL_WINDOW0 (0x1 << 5) 342#define VIDINTCON0_FIFIOSEL_WINDOW0 (0x1 << 5)
323#define VIDINTCON0_FIFIOSEL_WINDOW1 (0x2 << 5) 343#define VIDINTCON0_FIFIOSEL_WINDOW1 (0x2 << 5)
344#define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5)
345#define VIDINTCON0_FIFIOSEL_WINDOW3 (0x20 << 5)
346#define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5)
324 347
325#define VIDINTCON0_FIFOLEVEL_MASK (0x7 << 2) 348#define VIDINTCON0_FIFOLEVEL_MASK (0x7 << 2)
326#define VIDINTCON0_FIFOLEVEL_SHIFT (2) 349#define VIDINTCON0_FIFOLEVEL_SHIFT (2)
@@ -357,16 +380,39 @@
357#define WxKEYCON1_COLVAL_LIMIT (0xffffff) 380#define WxKEYCON1_COLVAL_LIMIT (0xffffff)
358#define WxKEYCON1_COLVAL(_x) ((_x) << 0) 381#define WxKEYCON1_COLVAL(_x) ((_x) << 0)
359 382
383/* Dithering control */
384#define DITHMODE (0x170)
385#define DITHMODE_R_POS_MASK (0x3 << 5)
386#define DITHMODE_R_POS_SHIFT (5)
387#define DITHMODE_R_POS_8BIT (0x0 << 5)
388#define DITHMODE_R_POS_6BIT (0x1 << 5)
389#define DITHMODE_R_POS_5BIT (0x2 << 5)
390#define DITHMODE_G_POS_MASK (0x3 << 3)
391#define DITHMODE_G_POS_SHIFT (3)
392#define DITHMODE_G_POS_8BIT (0x0 << 3)
393#define DITHMODE_G_POS_6BIT (0x1 << 3)
394#define DITHMODE_G_POS_5BIT (0x2 << 3)
395#define DITHMODE_B_POS_MASK (0x3 << 1)
396#define DITHMODE_B_POS_SHIFT (1)
397#define DITHMODE_B_POS_8BIT (0x0 << 1)
398#define DITHMODE_B_POS_6BIT (0x1 << 1)
399#define DITHMODE_B_POS_5BIT (0x2 << 1)
400#define DITHMODE_DITH_EN (1 << 0)
360 401
361/* Window blanking (MAP) */ 402/* Window blanking (MAP) */
362 403#define WINxMAP(_win) (0x180 + ((_win) * 4))
363#define WINxMAP_MAP (1 << 24) 404#define WINxMAP_MAP (1 << 24)
364#define WINxMAP_MAP_COLOUR_MASK (0xffffff << 0) 405#define WINxMAP_MAP_COLOUR_MASK (0xffffff << 0)
365#define WINxMAP_MAP_COLOUR_SHIFT (0) 406#define WINxMAP_MAP_COLOUR_SHIFT (0)
366#define WINxMAP_MAP_COLOUR_LIMIT (0xffffff) 407#define WINxMAP_MAP_COLOUR_LIMIT (0xffffff)
367#define WINxMAP_MAP_COLOUR(_x) ((_x) << 0) 408#define WINxMAP_MAP_COLOUR(_x) ((_x) << 0)
368 409
410/* Winodw palette control */
411#define WPALCON (0x1A0)
369#define WPALCON_PAL_UPDATE (1 << 9) 412#define WPALCON_PAL_UPDATE (1 << 9)
413#define WPALCON_W4PAL_16BPP_A555 (1 << 8)
414#define WPALCON_W3PAL_16BPP_A555 (1 << 7)
415#define WPALCON_W2PAL_16BPP_A555 (1 << 6)
370#define WPALCON_W1PAL_MASK (0x7 << 3) 416#define WPALCON_W1PAL_MASK (0x7 << 3)
371#define WPALCON_W1PAL_SHIFT (3) 417#define WPALCON_W1PAL_SHIFT (3)
372#define WPALCON_W1PAL_25BPP_A888 (0x0 << 3) 418#define WPALCON_W1PAL_25BPP_A888 (0x0 << 3)
@@ -376,7 +422,6 @@
376#define WPALCON_W1PAL_18BPP (0x4 << 3) 422#define WPALCON_W1PAL_18BPP (0x4 << 3)
377#define WPALCON_W1PAL_16BPP_A555 (0x5 << 3) 423#define WPALCON_W1PAL_16BPP_A555 (0x5 << 3)
378#define WPALCON_W1PAL_16BPP_565 (0x6 << 3) 424#define WPALCON_W1PAL_16BPP_565 (0x6 << 3)
379
380#define WPALCON_W0PAL_MASK (0x7 << 0) 425#define WPALCON_W0PAL_MASK (0x7 << 0)
381#define WPALCON_W0PAL_SHIFT (0) 426#define WPALCON_W0PAL_SHIFT (0)
382#define WPALCON_W0PAL_25BPP_A888 (0x0 << 0) 427#define WPALCON_W0PAL_25BPP_A888 (0x0 << 0)
@@ -394,115 +439,6 @@
394#define BLENDCON_NEW_4BIT_ALPHA_VALUE (0 << 0) 439#define BLENDCON_NEW_4BIT_ALPHA_VALUE (0 << 0)
395 440
396#define S3C_FB_MAX_WIN (5) /* number of hardware windows available. */ 441#define S3C_FB_MAX_WIN (5) /* number of hardware windows available. */
397#define VIDCON1_FSTATUS_EVEN (1 << 15)
398
399/* Video timing controls */
400#define VIDTCON0 (0x10)
401#define VIDTCON1 (0x14)
402#define VIDTCON2 (0x18)
403
404/* Window position controls */
405
406#define WINCON(_win) (0x20 + ((_win) * 4))
407
408/* OSD1 and OSD4 do not have register D */
409
410#define VIDOSD_BASE (0x40)
411
412#define VIDINTCON0 (0x130)
413
414/* WINCONx */
415
416#define WINCONx_CSCWIDTH_MASK (0x3 << 26)
417#define WINCONx_CSCWIDTH_SHIFT (26)
418#define WINCONx_CSCWIDTH_WIDE (0x0 << 26)
419#define WINCONx_CSCWIDTH_NARROW (0x3 << 26)
420
421#define WINCONx_ENLOCAL (1 << 22)
422#define WINCONx_BUFSTATUS (1 << 21)
423#define WINCONx_BUFSEL (1 << 20)
424#define WINCONx_BUFAUTOEN (1 << 19)
425#define WINCONx_YCbCr (1 << 13)
426
427#define WINCON1_LOCALSEL_CAMIF (1 << 23)
428
429#define WINCON2_LOCALSEL_CAMIF (1 << 23)
430#define WINCON2_BLD_PIX (1 << 6)
431
432#define WINCON2_ALPHA_SEL (1 << 1)
433#define WINCON2_BPPMODE_MASK (0xf << 2)
434#define WINCON2_BPPMODE_SHIFT (2)
435#define WINCON2_BPPMODE_1BPP (0x0 << 2)
436#define WINCON2_BPPMODE_2BPP (0x1 << 2)
437#define WINCON2_BPPMODE_4BPP (0x2 << 2)
438#define WINCON2_BPPMODE_8BPP_1232 (0x4 << 2)
439#define WINCON2_BPPMODE_16BPP_565 (0x5 << 2)
440#define WINCON2_BPPMODE_16BPP_A1555 (0x6 << 2)
441#define WINCON2_BPPMODE_16BPP_I1555 (0x7 << 2)
442#define WINCON2_BPPMODE_18BPP_666 (0x8 << 2)
443#define WINCON2_BPPMODE_18BPP_A1665 (0x9 << 2)
444#define WINCON2_BPPMODE_19BPP_A1666 (0xa << 2)
445#define WINCON2_BPPMODE_24BPP_888 (0xb << 2)
446#define WINCON2_BPPMODE_24BPP_A1887 (0xc << 2)
447#define WINCON2_BPPMODE_25BPP_A1888 (0xd << 2)
448#define WINCON2_BPPMODE_28BPP_A4888 (0xd << 2)
449
450#define WINCON3_BLD_PIX (1 << 6)
451
452#define WINCON3_ALPHA_SEL (1 << 1)
453#define WINCON3_BPPMODE_MASK (0xf << 2)
454#define WINCON3_BPPMODE_SHIFT (2)
455#define WINCON3_BPPMODE_1BPP (0x0 << 2)
456#define WINCON3_BPPMODE_2BPP (0x1 << 2)
457#define WINCON3_BPPMODE_4BPP (0x2 << 2)
458#define WINCON3_BPPMODE_16BPP_565 (0x5 << 2)
459#define WINCON3_BPPMODE_16BPP_A1555 (0x6 << 2)
460#define WINCON3_BPPMODE_16BPP_I1555 (0x7 << 2)
461#define WINCON3_BPPMODE_18BPP_666 (0x8 << 2)
462#define WINCON3_BPPMODE_18BPP_A1665 (0x9 << 2)
463#define WINCON3_BPPMODE_19BPP_A1666 (0xa << 2)
464#define WINCON3_BPPMODE_24BPP_888 (0xb << 2)
465#define WINCON3_BPPMODE_24BPP_A1887 (0xc << 2)
466#define WINCON3_BPPMODE_25BPP_A1888 (0xd << 2)
467#define WINCON3_BPPMODE_28BPP_A4888 (0xd << 2)
468
469#define VIDINTCON0_FIFIOSEL_WINDOW2 (0x10 << 5)
470#define VIDINTCON0_FIFIOSEL_WINDOW3 (0x20 << 5)
471#define VIDINTCON0_FIFIOSEL_WINDOW4 (0x40 << 5)
472
473#define DITHMODE (0x170)
474#define WINxMAP(_win) (0x180 + ((_win) * 4))
475
476
477#define DITHMODE_R_POS_MASK (0x3 << 5)
478#define DITHMODE_R_POS_SHIFT (5)
479#define DITHMODE_R_POS_8BIT (0x0 << 5)
480#define DITHMODE_R_POS_6BIT (0x1 << 5)
481#define DITHMODE_R_POS_5BIT (0x2 << 5)
482
483#define DITHMODE_G_POS_MASK (0x3 << 3)
484#define DITHMODE_G_POS_SHIFT (3)
485#define DITHMODE_G_POS_8BIT (0x0 << 3)
486#define DITHMODE_G_POS_6BIT (0x1 << 3)
487#define DITHMODE_G_POS_5BIT (0x2 << 3)
488
489#define DITHMODE_B_POS_MASK (0x3 << 1)
490#define DITHMODE_B_POS_SHIFT (1)
491#define DITHMODE_B_POS_8BIT (0x0 << 1)
492#define DITHMODE_B_POS_6BIT (0x1 << 1)
493#define DITHMODE_B_POS_5BIT (0x2 << 1)
494
495#define DITHMODE_DITH_EN (1 << 0)
496
497#define WPALCON (0x1A0)
498
499/* Palette control */
500/* Note for S5PC100: you can still use those macros on WPALCON (aka WPALCON_L),
501 * but make sure that WPALCON_H W2PAL-W4PAL entries are zeroed out */
502#define WPALCON_W4PAL_16BPP_A555 (1 << 8)
503#define WPALCON_W3PAL_16BPP_A555 (1 << 7)
504#define WPALCON_W2PAL_16BPP_A555 (1 << 6)
505
506 442
507/* Notes on per-window bpp settings 443/* Notes on per-window bpp settings
508 * 444 *
diff --git a/include/video/sh_mipi_dsi.h b/include/video/sh_mipi_dsi.h
index 06c67fbc4eee..a01f197e6ac1 100644
--- a/include/video/sh_mipi_dsi.h
+++ b/include/video/sh_mipi_dsi.h
@@ -25,8 +25,6 @@ enum sh_mipi_dsi_data_fmt {
25 MIPI_YUV420, 25 MIPI_YUV420,
26}; 26};
27 27
28struct sh_mobile_lcdc_chan_cfg;
29
30#define SH_MIPI_DSI_HSABM (1 << 0) 28#define SH_MIPI_DSI_HSABM (1 << 0)
31#define SH_MIPI_DSI_HBPBM (1 << 1) 29#define SH_MIPI_DSI_HBPBM (1 << 1)
32#define SH_MIPI_DSI_HFPBM (1 << 2) 30#define SH_MIPI_DSI_HFPBM (1 << 2)
@@ -47,7 +45,7 @@ struct sh_mobile_lcdc_chan_cfg;
47 45
48struct sh_mipi_dsi_info { 46struct sh_mipi_dsi_info {
49 enum sh_mipi_dsi_data_fmt data_format; 47 enum sh_mipi_dsi_data_fmt data_format;
50 struct sh_mobile_lcdc_chan_cfg *lcd_chan; 48 int channel;
51 int lane; 49 int lane;
52 unsigned long flags; 50 unsigned long flags;
53 u32 clksrc; 51 u32 clksrc;
diff --git a/include/video/sh_mobile_lcdc.h b/include/video/sh_mobile_lcdc.h
index ff43ffc1aab2..2605fa8adb9c 100644
--- a/include/video/sh_mobile_lcdc.h
+++ b/include/video/sh_mobile_lcdc.h
@@ -163,7 +163,6 @@ struct sh_mobile_lcdc_bl_info {
163 const char *name; 163 const char *name;
164 int max_brightness; 164 int max_brightness;
165 int (*set_brightness)(int brightness); 165 int (*set_brightness)(int brightness);
166 int (*get_brightness)(void);
167}; 166};
168 167
169struct sh_mobile_lcdc_overlay_cfg { 168struct sh_mobile_lcdc_overlay_cfg {
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h
index 90712e2072d5..b40a4315cb8b 100644
--- a/include/xen/interface/memory.h
+++ b/include/xen/interface/memory.h
@@ -153,6 +153,14 @@ struct xen_machphys_mapping {
153}; 153};
154DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mapping_t); 154DEFINE_GUEST_HANDLE_STRUCT(xen_machphys_mapping_t);
155 155
156#define XENMAPSPACE_shared_info 0 /* shared info page */
157#define XENMAPSPACE_grant_table 1 /* grant table page */
158#define XENMAPSPACE_gmfn 2 /* GMFN */
159#define XENMAPSPACE_gmfn_range 3 /* GMFN range, XENMEM_add_to_physmap only. */
160#define XENMAPSPACE_gmfn_foreign 4 /* GMFN from another dom,
161 * XENMEM_add_to_physmap_range only.
162 */
163
156/* 164/*
157 * Sets the GPFN at which a particular page appears in the specified guest's 165 * Sets the GPFN at which a particular page appears in the specified guest's
158 * pseudophysical address space. 166 * pseudophysical address space.
@@ -167,8 +175,6 @@ struct xen_add_to_physmap {
167 uint16_t size; 175 uint16_t size;
168 176
169 /* Source mapping space. */ 177 /* Source mapping space. */
170#define XENMAPSPACE_shared_info 0 /* shared info page */
171#define XENMAPSPACE_grant_table 1 /* grant table page */
172 unsigned int space; 178 unsigned int space;
173 179
174 /* Index into source mapping space. */ 180 /* Index into source mapping space. */
@@ -182,6 +188,24 @@ DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap);
182/*** REMOVED ***/ 188/*** REMOVED ***/
183/*#define XENMEM_translate_gpfn_list 8*/ 189/*#define XENMEM_translate_gpfn_list 8*/
184 190
191#define XENMEM_add_to_physmap_range 23
192struct xen_add_to_physmap_range {
193 /* Which domain to change the mapping for. */
194 domid_t domid;
195 uint16_t space; /* => enum phys_map_space */
196
197 /* Number of pages to go through */
198 uint16_t size;
199 domid_t foreign_domid; /* IFF gmfn_foreign */
200
201 /* Indexes into space being mapped. */
202 GUEST_HANDLE(xen_ulong_t) idxs;
203
204 /* GPFN in domid where the source mapping page should appear. */
205 GUEST_HANDLE(xen_pfn_t) gpfns;
206};
207DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap_range);
208
185/* 209/*
186 * Returns the pseudo-physical memory map as it was when the domain 210 * Returns the pseudo-physical memory map as it was when the domain
187 * was started (specified by XENMEM_set_memory_map). 211 * was started (specified by XENMEM_set_memory_map).
@@ -217,4 +241,20 @@ DEFINE_GUEST_HANDLE_STRUCT(xen_memory_map);
217 * during a driver critical region. 241 * during a driver critical region.
218 */ 242 */
219extern spinlock_t xen_reservation_lock; 243extern spinlock_t xen_reservation_lock;
244
245/*
246 * Unmaps the page appearing at a particular GPFN from the specified guest's
247 * pseudophysical address space.
248 * arg == addr of xen_remove_from_physmap_t.
249 */
250#define XENMEM_remove_from_physmap 15
251struct xen_remove_from_physmap {
252 /* Which domain to change the mapping for. */
253 domid_t domid;
254
255 /* GPFN of the current mapping of the page. */
256 xen_pfn_t gpfn;
257};
258DEFINE_GUEST_HANDLE_STRUCT(xen_remove_from_physmap);
259
220#endif /* __XEN_PUBLIC_MEMORY_H__ */ 260#endif /* __XEN_PUBLIC_MEMORY_H__ */
diff --git a/include/xen/interface/platform.h b/include/xen/interface/platform.h
index 4755b5fac9c7..5e36932ab407 100644
--- a/include/xen/interface/platform.h
+++ b/include/xen/interface/platform.h
@@ -324,6 +324,22 @@ struct xenpf_cpu_ol {
324}; 324};
325DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol); 325DEFINE_GUEST_HANDLE_STRUCT(xenpf_cpu_ol);
326 326
327/*
328 * CMD 58 and 59 are reserved for cpu hotadd and memory hotadd,
329 * which are already occupied at Xen hypervisor side.
330 */
331#define XENPF_core_parking 60
332struct xenpf_core_parking {
333 /* IN variables */
334#define XEN_CORE_PARKING_SET 1
335#define XEN_CORE_PARKING_GET 2
336 uint32_t type;
337 /* IN variables: set cpu nums expected to be idled */
338 /* OUT variables: get cpu nums actually be idled */
339 uint32_t idle_nums;
340};
341DEFINE_GUEST_HANDLE_STRUCT(xenpf_core_parking);
342
327struct xen_platform_op { 343struct xen_platform_op {
328 uint32_t cmd; 344 uint32_t cmd;
329 uint32_t interface_version; /* XENPF_INTERFACE_VERSION */ 345 uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -341,6 +357,7 @@ struct xen_platform_op {
341 struct xenpf_set_processor_pminfo set_pminfo; 357 struct xenpf_set_processor_pminfo set_pminfo;
342 struct xenpf_pcpuinfo pcpu_info; 358 struct xenpf_pcpuinfo pcpu_info;
343 struct xenpf_cpu_ol cpu_ol; 359 struct xenpf_cpu_ol cpu_ol;
360 struct xenpf_core_parking core_parking;
344 uint8_t pad[128]; 361 uint8_t pad[128];
345 } u; 362 } u;
346}; 363};
diff --git a/include/xen/xen-ops.h b/include/xen/xen-ops.h
index 6a198e46ab6e..d6fe062cad6b 100644
--- a/include/xen/xen-ops.h
+++ b/include/xen/xen-ops.h
@@ -2,6 +2,7 @@
2#define INCLUDE_XEN_OPS_H 2#define INCLUDE_XEN_OPS_H
3 3
4#include <linux/percpu.h> 4#include <linux/percpu.h>
5#include <asm/xen/interface.h>
5 6
6DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu); 7DECLARE_PER_CPU(struct vcpu_info *, xen_vcpu);
7 8
@@ -26,7 +27,11 @@ void xen_destroy_contiguous_region(unsigned long vstart, unsigned int order);
26struct vm_area_struct; 27struct vm_area_struct;
27int xen_remap_domain_mfn_range(struct vm_area_struct *vma, 28int xen_remap_domain_mfn_range(struct vm_area_struct *vma,
28 unsigned long addr, 29 unsigned long addr,
29 unsigned long mfn, int nr, 30 xen_pfn_t mfn, int nr,
30 pgprot_t prot, unsigned domid); 31 pgprot_t prot, unsigned domid,
32 struct page **pages);
33int xen_unmap_domain_mfn_range(struct vm_area_struct *vma,
34 int numpgs, struct page **pages);
31 35
36bool xen_running_on_version_or_later(unsigned int major, unsigned int minor);
32#endif /* INCLUDE_XEN_OPS_H */ 37#endif /* INCLUDE_XEN_OPS_H */